recaho-print-react 0.0.104 → 0.0.106

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.
@@ -3458,10 +3458,9 @@ const fd = (e) => ({
3458
3458
  Table_View: "Table View",
3459
3459
  Manage_Dine_In: "Manage Dine-In",
3460
3460
  Counter: "Counter"
3461
- }), pd = () => {
3462
- var t;
3463
- let e;
3464
- return ((t = settingData == null ? void 0 : settingData.paymentModes) == null ? void 0 : t.length) > 0 ? e = JSON.parse(JSON.stringify(settingData == null ? void 0 : settingData.paymentModes)) : e = [
3461
+ }), pd = (e) => {
3462
+ let t;
3463
+ return e != null && e.length ? t = JSON.parse(JSON.stringify(e)) : t = [
3465
3464
  {
3466
3465
  internalName: "CASH",
3467
3466
  displayName: "Cash",
@@ -3482,7 +3481,7 @@ const fd = (e) => ({
3482
3481
  displayName: "UPI",
3483
3482
  paymentState: "PAID_ONLINE"
3484
3483
  }
3485
- ], e;
3484
+ ], t;
3486
3485
  }, Te = (e) => +(Math.round(parseFloat(e) + "e+3") + "e-3"), dt = (e) => +(Math.round(parseFloat(e) + "e+2") + "e-2"), _s = lr(), yd = (e) => {
3487
3486
  let t = e || 0;
3488
3487
  var n = Math.floor(t / 60), r = `${n} min`, i = parseInt(r);
@@ -36,7 +36,7 @@ var Nr;function R(){return Nr.apply(null,arguments)}function ai(e){Nr=e}function
36
36
  [`+a+"] ";for(d in arguments[0])ce(arguments[0],d)&&(i+=d+": "+arguments[0][d]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}_r(e+`
37
37
  Arguments: `+Array.prototype.slice.call(r).join("")+`
38
38
  `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var br={};function Sr(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),br[e]||(_r(t),br[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Xe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function li(e){var t,n;for(n in e)ce(e,n)&&(t=e[n],Xe(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Sn(e,t){var n=jt({},e),r;for(r in t)ce(t,r)&&(It(e[r])&&It(t[r])?(n[r]={},jt(n[r],e[r]),jt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)ce(e,r)&&!ce(t,r)&&It(e[r])&&(n[r]=jt({},n[r]));return n}function Tn(e){e!=null&&this.set(e)}var wn;Object.keys?wn=Object.keys:wn=function(e){var t,n=[];for(t in e)ce(e,t)&&n.push(t);return n};var oi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ci(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Xe(r)?r.call(t,n):r}function et(e,t,n){var r=""+Math.abs(e),i=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var In=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,As=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Cn={},Pt={};function H(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Pt[e]=i),t&&(Pt[t[0]]=function(){return et(i.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function di(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function hi(e){var t=e.match(In),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=di(t[n]);return function(i){var a="",d;for(d=0;d<r;d++)a+=Xe(t[d])?t[d].call(i,e):t[d];return a}}function Es(e,t){return e.isValid()?(t=Tr(t,e.localeData()),Cn[t]=Cn[t]||hi(t),Cn[t](e)):e.localeData().invalidDate()}function Tr(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(As.lastIndex=0;n>=0&&As.test(e);)e=e.replace(As,r),As.lastIndex=0,n-=1;return e}var ui={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function mi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(In).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var fi="Invalid date";function pi(){return this._invalidDate}var yi="%d",gi=/\d{1,2}/;function xi(e){return this._ordinal.replace("%d",e)}var Ni={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ji(e,t,n,r){var i=this._relativeTime[n];return Xe(i)?i(e,t,n,r):i.replace(/%d/i,e)}function vi(e,t){var n=this._relativeTime[e>0?"future":"past"];return Xe(n)?n(t):n.replace(/%s/i,t)}var wr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Be(e){return typeof e=="string"?wr[e]||wr[e.toLowerCase()]:void 0}function On(e){var t={},n,r;for(r in e)ce(e,r)&&(n=Be(r),n&&(t[n]=e[r]));return t}var _i={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function bi(e){var t=[],n;for(n in e)ce(e,n)&&t.push({unit:n,priority:_i[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Ir=/\d/,Ye=/\d\d/,Cr=/\d{3}/,Mn=/\d{4}/,Rs=/[+-]?\d{6}/,ye=/\d\d?/,Or=/\d\d\d\d?/,Mr=/\d\d\d\d\d\d?/,ks=/\d{1,3}/,An=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Ft=/\d+/,Ps=/[+-]?\d+/,Si=/Z|[+-]\d\d:?\d\d/gi,Fs=/Z|[+-]\d\d(?::?\d\d)?/gi,Ti=/[+-]?\d+(\.\d{1,3})?/,rs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Dt=/^[1-9]\d?/,En=/^([1-9]\d|\d)/,Ds;Ds={};function Y(e,t,n){Ds[e]=Xe(t)?t:function(r,i){return r&&n?n:t}}function wi(e,t){return ce(Ds,e)?Ds[e](t._strict,t._locale):new RegExp(Ii(e))}function Ii(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function We(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function se(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=We(t)),n}var Rn={};function pe(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(a,d){d[t]=se(a)}),i=e.length,n=0;n<i;n++)Rn[e[n]]=r}function as(e,t){pe(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Ci(e,t,n){t!=null&&ce(Rn,e)&&Rn[e](t,n._a,n,e)}function Ys(e){return e%4===0&&e%100!==0||e%400===0}var Me=0,lt=1,tt=2,Ie=3,qe=4,ot=5,Ct=6,Oi=7,Mi=8;H("Y",0,0,function(){var e=this.year();return e<=9999?et(e,4):"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),Y("Y",Ps),Y("YY",ye,Ye),Y("YYYY",An,Mn),Y("YYYYY",Ls,Rs),Y("YYYYYY",Ls,Rs),pe(["YYYYY","YYYYYY"],Me),pe("YYYY",function(e,t){t[Me]=e.length===2?R.parseTwoDigitYear(e):se(e)}),pe("YY",function(e,t){t[Me]=R.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[Me]=parseInt(e,10)});function is(e){return Ys(e)?366:365}R.parseTwoDigitYear=function(e){return se(e)+(se(e)>68?1900:2e3)};var Ar=Yt("FullYear",!0);function Ai(){return Ys(this.year())}function Yt(e,t){return function(n){return n!=null?(Er(this,e,n),R.updateOffset(this,t),this):ls(this,e)}}function ls(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Er(e,t,n){var r,i,a,d,y;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,d=e.month(),y=e.date(),y=y===29&&d===1&&!Ys(a)?28:y,i?r.setUTCFullYear(a,d,y):r.setFullYear(a,d,y)}}function Ei(e){return e=Be(e),Xe(this[e])?this[e]():this}function Ri(e,t){if(typeof e=="object"){e=On(e);var n=bi(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=Be(e),Xe(this[e]))return this[e](t);return this}function ki(e,t){return(e%t+t)%t}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function kn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ki(t,12);return e+=(t-n)/12,n===1?Ys(e)?29:28:31-n%7%2}H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Y("M",ye,Dt),Y("MM",ye,Ye),Y("MMM",function(e,t){return t.monthsShortRegex(e)}),Y("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[lt]=se(e)-1}),pe(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[lt]=i:X(n).invalidMonth=e});var Li="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Rr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),kr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pi=rs,Fi=rs;function Di(e,t){return e?Ge(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||kr).test(t)?"format":"standalone"][e.month()]:Ge(this._months)?this._months:this._months.standalone}function Yi(e,t){return e?Ge(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[kr.test(t)?"format":"standalone"][e.month()]:Ge(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ui(e,t,n){var r,i,a,d=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Je([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=je.call(this._shortMonthsParse,d),i!==-1?i:null):(i=je.call(this._longMonthsParse,d),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,d),i!==-1?i:(i=je.call(this._longMonthsParse,d),i!==-1?i:null)):(i=je.call(this._longMonthsParse,d),i!==-1?i:(i=je.call(this._shortMonthsParse,d),i!==-1?i:null))}function $i(e,t,n){var r,i,a;if(this._monthsParseExact)return Ui.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Je([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Lr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=se(t);else if(t=e.localeData().monthsParse(t),!at(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,kn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Pr(e){return e!=null?(Lr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Hi(){return kn(this.year(),this.month())}function Bi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Fr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=Pi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Wi(e){return this._monthsParseExact?(ce(this,"_monthsRegex")||Fr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=Fi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Fr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,d,y;for(i=0;i<12;i++)a=Je([2e3,i]),d=it(this.monthsShort(a,"")),y=it(this.months(a,"")),t.push(d),n.push(y),r.push(y),r.push(d);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function zi(e,t,n,r,i,a,d){var y;return e<100&&e>=0?(y=new Date(e+400,t,n,r,i,a,d),isFinite(y.getFullYear())&&y.setFullYear(e)):y=new Date(e,t,n,r,i,a,d),y}function os(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Us(e,t,n){var r=7+t-n,i=(7+os(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Dr(e,t,n,r,i){var a=(7+n-r)%7,d=Us(e,r,i),y=1+7*(t-1)+a+d,o,l;return y<=0?(o=e-1,l=is(o)+y):y>is(e)?(o=e+1,l=y-is(e)):(o=e,l=y),{year:o,dayOfYear:l}}function cs(e,t,n){var r=Us(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,d;return i<1?(d=e.year()-1,a=i+ct(d,t,n)):i>ct(e.year(),t,n)?(a=i-ct(e.year(),t,n),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ct(e,t,n){var r=Us(e,t,n),i=Us(e+1,t,n);return(is(e)-r+i)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),Y("w",ye,Dt),Y("ww",ye,Ye),Y("W",ye,Dt),Y("WW",ye,Ye),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=se(e)});function Gi(e){return cs(e,this._week.dow,this._week.doy).week}var Vi={dow:0,doy:6};function qi(){return this._week.dow}function Ki(){return this._week.doy}function Qi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Zi(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),Y("d",ye),Y("e",ye),Y("E",ye),Y("dd",function(e,t){return t.weekdaysMinRegex(e)}),Y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Y("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:X(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=se(e)});function Ji(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function Xi(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ln(e,t){return e.slice(t,7).concat(e.slice(0,t))}var el="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),sl=rs,nl=rs,rl=rs;function al(e,t){var n=Ge(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Ln(n,this._week.dow):e?n[e.day()]:n}function il(e){return e===!0?Ln(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ll(e){return e===!0?Ln(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function ol(e,t,n){var r,i,a,d=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Je([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=je.call(this._weekdaysParse,d),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,d),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,d),i!==-1||(i=je.call(this._shortWeekdaysParse,d),i!==-1)?i:(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,d),i!==-1||(i=je.call(this._weekdaysParse,d),i!==-1)?i:(i=je.call(this._minWeekdaysParse,d),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,d),i!==-1||(i=je.call(this._weekdaysParse,d),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,d),i!==-1?i:null))}function cl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return ol.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Je([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function dl(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=Ji(e,this.localeData()),this.add(e-t,"d")):t}function hl(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function ul(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Xi(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ml(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=sl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function fl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function pl(e){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Pn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rl),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Pn(){function e(c,u){return u.length-c.length}var t=[],n=[],r=[],i=[],a,d,y,o,l;for(a=0;a<7;a++)d=Je([2e3,1]).day(a),y=it(this.weekdaysMin(d,"")),o=it(this.weekdaysShort(d,"")),l=it(this.weekdays(d,"")),t.push(y),n.push(o),r.push(l),i.push(y),i.push(o),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Fn(){return this.hours()%12||12}function yl(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Fn),H("k",["kk",2],0,yl),H("hmm",0,0,function(){return""+Fn.apply(this)+et(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Fn.apply(this)+et(this.minutes(),2)+et(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+et(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+et(this.minutes(),2)+et(this.seconds(),2)});function Ur(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Ur("a",!0),Ur("A",!1);function $r(e,t){return t._meridiemParse}Y("a",$r),Y("A",$r),Y("H",ye,En),Y("h",ye,Dt),Y("k",ye,Dt),Y("HH",ye,Ye),Y("hh",ye,Ye),Y("kk",ye,Ye),Y("hmm",Or),Y("hmmss",Mr),Y("Hmm",Or),Y("Hmmss",Mr),pe(["H","HH"],Ie),pe(["k","kk"],function(e,t,n){var r=se(e);t[Ie]=r===24?0:r}),pe(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),pe(["h","hh"],function(e,t,n){t[Ie]=se(e),X(n).bigHour=!0}),pe("hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r)),X(n).bigHour=!0}),pe("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r,2)),t[ot]=se(e.substr(i)),X(n).bigHour=!0}),pe("Hmm",function(e,t,n){var r=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r))}),pe("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=se(e.substr(0,r)),t[qe]=se(e.substr(r,2)),t[ot]=se(e.substr(i))});function gl(e){return(e+"").toLowerCase().charAt(0)==="p"}var xl=/[ap]\.?m?\.?/i,Nl=Yt("Hours",!0);function jl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Hr={calendar:oi,longDateFormat:ui,invalidDate:fi,ordinal:yi,dayOfMonthOrdinalParse:gi,relativeTime:Ni,months:Li,monthsShort:Rr,week:Vi,weekdays:el,weekdaysMin:tl,weekdaysShort:Yr,meridiemParse:xl},xe={},ds={},hs;function vl(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function Br(e){return e&&e.toLowerCase().replace("_","-")}function _l(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Br(e[t]).split("-"),n=a.length,r=Br(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=$s(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&vl(a,r)>=n-1)break;n--}t++}return hs}function bl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function $s(e){var t=null,n;if(xe[e]===void 0&&typeof module<"u"&&module&&module.exports&&bl(e))try{t=hs._abbr,n=require,n("./locale/"+e),vt(t)}catch{xe[e]=null}return xe[e]}function vt(e,t){var n;return e&&(ke(t)?n=dt(e):n=Dn(e,t),n?hs=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),hs._abbr}function Dn(e,t){if(t!==null){var n,r=Hr;if(t.abbr=e,xe[e]!=null)Sr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=xe[e]._config;else if(t.parentLocale!=null)if(xe[t.parentLocale]!=null)r=xe[t.parentLocale]._config;else if(n=$s(t.parentLocale),n!=null)r=n._config;else return ds[t.parentLocale]||(ds[t.parentLocale]=[]),ds[t.parentLocale].push({name:e,config:t}),null;return xe[e]=new Tn(Sn(r,t)),ds[e]&&ds[e].forEach(function(i){Dn(i.name,i.config)}),vt(e),xe[e]}else return delete xe[e],null}function Sl(e,t){if(t!=null){var n,r,i=Hr;xe[e]!=null&&xe[e].parentLocale!=null?xe[e].set(Sn(xe[e]._config,t)):(r=$s(e),r!=null&&(i=r._config),t=Sn(i,t),r==null&&(t.abbr=e),n=new Tn(t),n.parentLocale=xe[e],xe[e]=n),vt(e)}else xe[e]!=null&&(xe[e].parentLocale!=null?(xe[e]=xe[e].parentLocale,e===vt()&&vt(e)):xe[e]!=null&&delete xe[e]);return xe[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!Ge(e)){if(t=$s(e),t)return t;e=[e]}return _l(e)}function Tl(){return wn(xe)}function Yn(e){var t,n=e._a;return n&&X(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[tt]<1||n[tt]>kn(n[Me],n[lt])?tt:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[qe]!==0||n[ot]!==0||n[Ct]!==0)?Ie:n[qe]<0||n[qe]>59?qe:n[ot]<0||n[ot]>59?ot:n[Ct]<0||n[Ct]>999?Ct:-1,X(e)._overflowDayOfYear&&(t<Me||t>tt)&&(t=tt),X(e)._overflowWeeks&&t===-1&&(t=Oi),X(e)._overflowWeekday&&t===-1&&(t=Mi),X(e).overflow=t),e}var wl=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Il=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Cl=/Z|[+-]\d\d(?::?\d\d)?/,Hs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Un=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ol=/^\/?Date\((-?\d+)/i,Ml=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Al={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Wr(e){var t,n,r=e._i,i=wl.exec(r)||Il.exec(r),a,d,y,o,l=Hs.length,c=Un.length;if(i){for(X(e).iso=!0,t=0,n=l;t<n;t++)if(Hs[t][1].exec(i[1])){d=Hs[t][0],a=Hs[t][2]!==!1;break}if(d==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if(Un[t][1].exec(i[3])){y=(i[2]||" ")+Un[t][0];break}if(y==null){e._isValid=!1;return}}if(!a&&y!=null){e._isValid=!1;return}if(i[4])if(Cl.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=d+(y||"")+(o||""),Hn(e)}else e._isValid=!1}function El(e,t,n,r,i,a){var d=[Rl(e),Rr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Rl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function kl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ll(e,t,n){if(e){var r=Yr.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return X(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Pl(e,t,n){if(e)return Al[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function zr(e){var t=Ml.exec(kl(e._i)),n;if(t){if(n=El(t[4],t[3],t[2],t[5],t[6],t[7]),!Ll(t[1],n,e))return;e._a=n,e._tzm=Pl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),X(e).rfc2822=!0}else e._isValid=!1}function Fl(e){var t=Ol.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Wr(e),e._isValid===!1)delete e._isValid;else return;if(zr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=He("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Ut(e,t,n){return e??t??n}function Dl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function $n(e){var t,n,r=[],i,a,d;if(!e._d){for(i=Dl(e),e._w&&e._a[tt]==null&&e._a[lt]==null&&Yl(e),e._dayOfYear!=null&&(d=Ut(e._a[Me],i[Me]),(e._dayOfYear>is(d)||e._dayOfYear===0)&&(X(e)._overflowDayOfYear=!0),n=os(d,0,e._dayOfYear),e._a[lt]=n.getUTCMonth(),e._a[tt]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Ie]===24&&e._a[qe]===0&&e._a[ot]===0&&e._a[Ct]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:zi).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ie]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(X(e).weekdayMismatch=!0)}}function Yl(e){var t,n,r,i,a,d,y,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,d=4,n=Ut(t.GG,e._a[Me],cs(ge(),1,4).year),r=Ut(t.W,1),i=Ut(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,d=e._locale._week.doy,l=cs(ge(),a,d),n=Ut(t.gg,e._a[Me],l.year),r=Ut(t.w,l.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(o=!0)):i=a),r<1||r>ct(n,a,d)?X(e)._overflowWeeks=!0:o!=null?X(e)._overflowWeekday=!0:(y=Dr(n,r,i,a,d),e._a[Me]=y.year,e._dayOfYear=y.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Hn(e){if(e._f===R.ISO_8601){Wr(e);return}if(e._f===R.RFC_2822){zr(e);return}e._a=[],X(e).empty=!0;var t=""+e._i,n,r,i,a,d,y=t.length,o=0,l,c;for(i=Tr(e._f,e._locale).match(In)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(wi(a,e))||[])[0],r&&(d=t.substr(0,t.indexOf(r)),d.length>0&&X(e).unusedInput.push(d),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Pt[a]?(r?X(e).empty=!1:X(e).unusedTokens.push(a),Ci(a,r,e)):e._strict&&!r&&X(e).unusedTokens.push(a);X(e).charsLeftOver=y-o,t.length>0&&X(e).unusedInput.push(t),e._a[Ie]<=12&&X(e).bigHour===!0&&e._a[Ie]>0&&(X(e).bigHour=void 0),X(e).parsedDateParts=e._a.slice(0),X(e).meridiem=e._meridiem,e._a[Ie]=Ul(e._locale,e._a[Ie],e._meridiem),l=X(e).era,l!==null&&(e._a[Me]=e._locale.erasConvertYear(l,e._a[Me])),$n(e),Yn(e)}function Ul(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function $l(e){var t,n,r,i,a,d,y=!1,o=e._f.length;if(o===0){X(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,d=!1,t=bn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Hn(t),vn(t)&&(d=!0),a+=X(t).charsLeftOver,a+=X(t).unusedTokens.length*10,X(t).score=a,y?a<r&&(r=a,n=t):(r==null||a<r||d)&&(r=a,n=t,d&&(y=!0));jt(e,n||t)}function Hl(e){if(!e._d){var t=On(e._i),n=t.day===void 0?t.date:t.day;e._a=jr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),$n(e)}}function Bl(e){var t=new ns(Yn(Gr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Gr(e){var t=e._i,n=e._f;return e._locale=e._locale||dt(e._l),t===null||n===void 0&&t===""?Ms({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ve(t)?new ns(Yn(t)):(ss(t)?e._d=t:Ge(n)?$l(e):n?Hn(e):Wl(e),vn(e)||(e._d=null),e))}function Wl(e){var t=e._i;ke(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Fl(e):Ge(t)?(e._a=jr(t.slice(0),function(n){return parseInt(n,10)}),$n(e)):It(t)?Hl(e):at(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Vr(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(It(e)&&Nn(e)||Ge(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,Bl(a)}function ge(e,t,n,r){return Vr(e,t,n,r,!1)}var zl=He("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Ms()}),Gl=He("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Ms()});function qr(e,t){var n,r;if(t.length===1&&Ge(t[0])&&(t=t[0]),!t.length)return ge();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Vl(){var e=[].slice.call(arguments,0);return qr("isBefore",e)}function ql(){var e=[].slice.call(arguments,0);return qr("isAfter",e)}var Kl=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ql(e){var t,n=!1,r,i=us.length;for(t in e)if(ce(e,t)&&!(je.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==se(e[us[r]])&&(n=!0)}return!0}function Zl(){return this._isValid}function Jl(){return Ke(NaN)}function Bs(e){var t=On(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,y=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Ql(t),this._milliseconds=+c+l*1e3+o*6e4+y*1e3*60*60,this._days=+d+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Ws(e){return e instanceof Bs}function Bn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Xl(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,d;for(d=0;d<r;d++)se(e[d])!==se(t[d])&&a++;return a+i}function Kr(e,t){H(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+et(~~(n/60),2)+t+et(~~n%60,2)})}Kr("Z",":"),Kr("ZZ",""),Y("Z",Fs),Y("ZZ",Fs),pe(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Wn(Fs,e)});var eo=/([\+\-]|\d\d)/gi;function Wn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(eo)||["-",0,0],a=+(i[1]*60)+se(i[2]),a===0?0:i[0]==="+"?a:-a)}function zn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ve(e)||ss(e)?e.valueOf():ge(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):ge(e).local()}function Gn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function to(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Wn(Fs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Gn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Xr(this,Ke(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Gn(this)}function so(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function no(e){return this.utcOffset(0,e)}function ro(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gn(this),"m")),this}function ao(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Wn(Si,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function io(e){return this.isValid()?(e=e?ge(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function lo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function oo(){if(!ke(this._isDSTShifted))return this._isDSTShifted;var e={},t;return bn(e,this),e=Gr(e),e._a?(t=e._isUTC?Je(e._a):ge(e._a),this._isDSTShifted=this.isValid()&&Xl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function co(){return this.isValid()?!this._isUTC:!1}function ho(){return this.isValid()?this._isUTC:!1}function Qr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var uo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,mo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ke(e,t){var n=e,r=null,i,a,d;return Ws(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:at(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=uo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:se(r[tt])*i,h:se(r[Ie])*i,m:se(r[qe])*i,s:se(r[ot])*i,ms:se(Bn(r[Ct]*1e3))*i}):(r=mo.exec(e))?(i=r[1]==="-"?-1:1,n={y:Ot(r[2],i),M:Ot(r[3],i),w:Ot(r[4],i),d:Ot(r[5],i),h:Ot(r[6],i),m:Ot(r[7],i),s:Ot(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(d=fo(ge(n.from),ge(n.to)),n={},n.ms=d.milliseconds,n.M=d.months),a=new Bs(n),Ws(e)&&ce(e,"_locale")&&(a._locale=e._locale),Ws(e)&&ce(e,"_isValid")&&(a._isValid=e._isValid),a}Ke.fn=Bs.prototype,Ke.invalid=Jl;function Ot(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function fo(e,t){var n;return e.isValid()&&t.isValid()?(t=zn(t,e),e.isBefore(t)?n=Zr(e,t):(n=Zr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Jr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Sr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=Ke(n,r),Xr(this,i,e),this}}function Xr(e,t,n,r){var i=t._milliseconds,a=Bn(t._days),d=Bn(t._months);e.isValid()&&(r=r??!0,d&&Lr(e,ls(e,"Month")+d*n),a&&Er(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||d))}var po=Jr(1,"add"),yo=Jr(-1,"subtract");function ea(e){return typeof e=="string"||e instanceof String}function go(e){return Ve(e)||ss(e)||ea(e)||at(e)||No(e)||xo(e)||e===null||e===void 0}function xo(e){var t=It(e)&&!Nn(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,d=r.length;for(i=0;i<d;i+=1)a=r[i],n=n||ce(e,a);return t&&n}function No(e){var t=Ge(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&ea(e)}).length===0),t&&n}function jo(e){var t=It(e)&&!Nn(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],n=n||ce(e,a);return t&&n}function vo(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function _o(e,t){arguments.length===1&&(arguments[0]?go(arguments[0])?(e=arguments[0],t=void 0):jo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ge(),r=zn(n,this).startOf("day"),i=R.calendarFormat(this,r)||"sameElse",a=t&&(Xe(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,ge(n)))}function bo(){return new ns(this)}function So(e,t){var n=Ve(e)?e:ge(e);return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function To(e,t){var n=Ve(e)?e:ge(e);return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function wo(e,t,n,r){var i=Ve(e)?e:ge(e),a=Ve(t)?t:ge(t);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Io(e,t){var n=Ve(e)?e:ge(e),r;return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Co(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Oo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Mo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=zn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=Be(t),t){case"year":a=zs(this,r)/12;break;case"month":a=zs(this,r);break;case"quarter":a=zs(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:We(a)}function zs(e,t){if(e.date()<t.date())return-zs(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),i,a;return t-r<0?(i=e.clone().add(n-1,"months"),a=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),a=(t-r)/(i-r)),-(n+a)||0}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ao(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Eo(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Es(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Xe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Es(n,"Z")):Es(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ro(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function ko(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Es(this,e);return this.localeData().postformat(t)}function Lo(e,t){return this.isValid()&&(Ve(e)&&e.isValid()||ge(e).isValid())?Ke({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Po(e){return this.from(ge(),e)}function Fo(e,t){return this.isValid()&&(Ve(e)&&e.isValid()||ge(e).isValid())?Ke({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Do(e){return this.to(ge(),e)}function ta(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var sa=He("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function na(){return this._locale}var Gs=1e3,$t=60*Gs,Vs=60*$t,ra=(365*400+97)*24*Vs;function Ht(e,t){return(e%t+t)%t}function aa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ra:new Date(e,t,n).valueOf()}function ia(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ra:Date.UTC(e,t,n)}function Yo(e){var t,n;if(e=Be(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Ht(t+(this._isUTC?0:this.utcOffset()*$t),Vs);break;case"minute":t=this._d.valueOf(),t-=Ht(t,$t);break;case"second":t=this._d.valueOf(),t-=Ht(t,Gs);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Uo(e){var t,n;if(e=Be(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Vs-Ht(t+(this._isUTC?0:this.utcOffset()*$t),Vs)-1;break;case"minute":t=this._d.valueOf(),t+=$t-Ht(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Gs-Ht(t,Gs)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function $o(){return this._d.valueOf()-(this._offset||0)*6e4}function Ho(){return Math.floor(this.valueOf()/1e3)}function Bo(){return new Date(this.valueOf())}function Wo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function zo(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Go(){return this.isValid()?this.toISOString():null}function Vo(){return vn(this)}function qo(){return jt({},X(this))}function Ko(){return X(this).overflow}function Qo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Y("N",Vn),Y("NN",Vn),Y("NNN",Vn),Y("NNNN",lc),Y("NNNNN",oc),pe(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?X(n).era=i:X(n).invalidEra=e}),Y("y",Ft),Y("yy",Ft),Y("yyy",Ft),Y("yyyy",Ft),Y("yo",cc),pe(["y","yy","yyy","yyyy"],Me),pe(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Me]=n._locale.eraYearOrdinalParse(e,i):t[Me]=parseInt(e,10)});function Zo(e,t){var n,r,i,a=this._eras||dt("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=R(a[n].since).startOf("day"),a[n].since=i.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=R(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function Jo(e,t,n){var r,i,a=this.eras(),d,y,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(d=a[r].name.toUpperCase(),y=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(y===e)return a[r];break;case"NNNN":if(d===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([d,y,o].indexOf(e)>=0)return a[r]}function Xo(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}function ec(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function tc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function sc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function nc(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-R(i[e].since).year())*n+i[e].offset;return this.year()}function rc(e){return ce(this,"_erasNameRegex")||qn.call(this),e?this._erasNameRegex:this._erasRegex}function ac(e){return ce(this,"_erasAbbrRegex")||qn.call(this),e?this._erasAbbrRegex:this._erasRegex}function ic(e){return ce(this,"_erasNarrowRegex")||qn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vn(e,t){return t.erasAbbrRegex(e)}function lc(e,t){return t.erasNameRegex(e)}function oc(e,t){return t.erasNarrowRegex(e)}function cc(e,t){return t._eraYearOrdinalRegex||Ft}function qn(){var e=[],t=[],n=[],r=[],i,a,d,y,o,l=this.eras();for(i=0,a=l.length;i<a;++i)d=it(l[i].name),y=it(l[i].abbr),o=it(l[i].narrow),t.push(d),e.push(y),n.push(o),r.push(d),r.push(y),r.push(o);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100});function qs(e,t){H(0,[e,e.length],0,t)}qs("gggg","weekYear"),qs("ggggg","weekYear"),qs("GGGG","isoWeekYear"),qs("GGGGG","isoWeekYear"),Y("G",Ps),Y("g",Ps),Y("GG",ye,Ye),Y("gg",ye,Ye),Y("GGGG",An,Mn),Y("gggg",An,Mn),Y("GGGGG",Ls,Rs),Y("ggggg",Ls,Rs),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=se(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function dc(e){return la.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function hc(e){return la.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function uc(){return ct(this.year(),1,4)}function mc(){return ct(this.isoWeekYear(),1,4)}function fc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function pc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function la(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=ct(e,r,i),t>a&&(t=a),yc.call(this,e,t,n,r,i))}function yc(e,t,n,r,i){var a=Dr(e,t,n,r,i),d=os(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}H("Q",0,"Qo","quarter"),Y("Q",Ir),pe("Q",function(e,t){t[lt]=(se(e)-1)*3});function gc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),Y("D",ye,Dt),Y("DD",ye,Ye),Y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],tt),pe("Do",function(e,t){t[tt]=se(e.match(ye)[0])});var oa=Yt("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("DDD",ks),Y("DDDD",Cr),pe(["DDD","DDDD"],function(e,t,n){n._dayOfYear=se(e)});function xc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}H("m",["mm",2],0,"minute"),Y("m",ye,En),Y("mm",ye,Ye),pe(["m","mm"],qe);var Nc=Yt("Minutes",!1);H("s",["ss",2],0,"second"),Y("s",ye,En),Y("ss",ye,Ye),pe(["s","ss"],ot);var jc=Yt("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Y("S",ks,Ir),Y("SS",ks,Ye),Y("SSS",ks,Cr);var _t,ca;for(_t="SSSS";_t.length<=9;_t+="S")Y(_t,Ft);function vc(e,t){t[Ct]=se(("0."+e)*1e3)}for(_t="S";_t.length<=9;_t+="S")pe(_t,vc);ca=Yt("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function _c(){return this._isUTC?"UTC":""}function bc(){return this._isUTC?"Coordinated Universal Time":""}var E=ns.prototype;E.add=po,E.calendar=_o,E.clone=bo,E.diff=Mo,E.endOf=Uo,E.format=ko,E.from=Lo,E.fromNow=Po,E.to=Fo,E.toNow=Do,E.get=Ei,E.invalidAt=Ko,E.isAfter=So,E.isBefore=To,E.isBetween=wo,E.isSame=Io,E.isSameOrAfter=Co,E.isSameOrBefore=Oo,E.isValid=Vo,E.lang=sa,E.locale=ta,E.localeData=na,E.max=Gl,E.min=zl,E.parsingFlags=qo,E.set=Ri,E.startOf=Yo,E.subtract=yo,E.toArray=Wo,E.toObject=zo,E.toDate=Bo,E.toISOString=Eo,E.inspect=Ro,typeof Symbol<"u"&&Symbol.for!=null&&(E[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),E.toJSON=Go,E.toString=Ao,E.unix=Ho,E.valueOf=$o,E.creationData=Qo,E.eraName=ec,E.eraNarrow=tc,E.eraAbbr=sc,E.eraYear=nc,E.year=Ar,E.isLeapYear=Ai,E.weekYear=dc,E.isoWeekYear=hc,E.quarter=E.quarters=gc,E.month=Pr,E.daysInMonth=Hi,E.week=E.weeks=Qi,E.isoWeek=E.isoWeeks=Zi,E.weeksInYear=fc,E.weeksInWeekYear=pc,E.isoWeeksInYear=uc,E.isoWeeksInISOWeekYear=mc,E.date=oa,E.day=E.days=dl,E.weekday=hl,E.isoWeekday=ul,E.dayOfYear=xc,E.hour=E.hours=Nl,E.minute=E.minutes=Nc,E.second=E.seconds=jc,E.millisecond=E.milliseconds=ca,E.utcOffset=to,E.utc=no,E.local=ro,E.parseZone=ao,E.hasAlignedHourOffset=io,E.isDST=lo,E.isLocal=co,E.isUtcOffset=ho,E.isUtc=Qr,E.isUTC=Qr,E.zoneAbbr=_c,E.zoneName=bc,E.dates=He("dates accessor is deprecated. Use date instead.",oa),E.months=He("months accessor is deprecated. Use month instead",Pr),E.years=He("years accessor is deprecated. Use year instead",Ar),E.zone=He("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",so),E.isDSTShifted=He("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",oo);function Sc(e){return ge(e*1e3)}function Tc(){return ge.apply(null,arguments).parseZone()}function da(e){return e}var de=Tn.prototype;de.calendar=ci,de.longDateFormat=mi,de.invalidDate=pi,de.ordinal=xi,de.preparse=da,de.postformat=da,de.relativeTime=ji,de.pastFuture=vi,de.set=li,de.eras=Zo,de.erasParse=Jo,de.erasConvertYear=Xo,de.erasAbbrRegex=ac,de.erasNameRegex=rc,de.erasNarrowRegex=ic,de.months=Di,de.monthsShort=Yi,de.monthsParse=$i,de.monthsRegex=Wi,de.monthsShortRegex=Bi,de.week=Gi,de.firstDayOfYear=Ki,de.firstDayOfWeek=qi,de.weekdays=al,de.weekdaysMin=ll,de.weekdaysShort=il,de.weekdaysParse=cl,de.weekdaysRegex=ml,de.weekdaysShortRegex=fl,de.weekdaysMinRegex=pl,de.isPM=gl,de.meridiem=jl;function Ks(e,t,n,r){var i=dt(),a=Je().set(r,t);return i[n](a,e)}function ha(e,t,n){if(at(e)&&(t=e,e=void 0),e=e||"",t!=null)return Ks(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Ks(e,r,n,"month");return i}function Kn(e,t,n,r){typeof e=="boolean"?(at(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,at(t)&&(n=t,t=void 0),t=t||"");var i=dt(),a=e?i._week.dow:0,d,y=[];if(n!=null)return Ks(t,(n+a)%7,r,"day");for(d=0;d<7;d++)y[d]=Ks(t,(d+a)%7,r,"day");return y}function wc(e,t){return ha(e,t,"months")}function Ic(e,t){return ha(e,t,"monthsShort")}function Cc(e,t,n){return Kn(e,t,n,"weekdays")}function Oc(e,t,n){return Kn(e,t,n,"weekdaysShort")}function Mc(e,t,n){return Kn(e,t,n,"weekdaysMin")}vt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=se(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),R.lang=He("moment.lang is deprecated. Use moment.locale instead.",vt),R.langData=He("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Ac(){var e=this._data;return this._milliseconds=ht(this._milliseconds),this._days=ht(this._days),this._months=ht(this._months),e.milliseconds=ht(e.milliseconds),e.seconds=ht(e.seconds),e.minutes=ht(e.minutes),e.hours=ht(e.hours),e.months=ht(e.months),e.years=ht(e.years),this}function ua(e,t,n,r){var i=Ke(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ec(e,t){return ua(this,e,t,1)}function Rc(e,t){return ua(this,e,t,-1)}function ma(e){return e<0?Math.floor(e):Math.ceil(e)}function kc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,d,y,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ma(Qn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=We(e/1e3),r.seconds=i%60,a=We(i/60),r.minutes=a%60,d=We(a/60),r.hours=d%24,t+=We(d/24),o=We(fa(t)),n+=o,t-=ma(Qn(o)),y=We(n/12),n%=12,r.days=t,r.months=n,r.years=y,this}function fa(e){return e*4800/146097}function Qn(e){return e*146097/4800}function Lc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Be(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+fa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Qn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function ut(e){return function(){return this.as(e)}}var pa=ut("ms"),Pc=ut("s"),Fc=ut("m"),Dc=ut("h"),Yc=ut("d"),Uc=ut("w"),$c=ut("M"),Hc=ut("Q"),Bc=ut("y"),Wc=pa;function zc(){return Ke(this)}function Gc(e){return e=Be(e),this.isValid()?this[e+"s"]():NaN}function Mt(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vc=Mt("milliseconds"),qc=Mt("seconds"),Kc=Mt("minutes"),Qc=Mt("hours"),Zc=Mt("days"),Jc=Mt("months"),Xc=Mt("years");function ed(){return We(this.days()/7)}var mt=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function td(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function sd(e,t,n,r){var i=Ke(e).abs(),a=mt(i.as("s")),d=mt(i.as("m")),y=mt(i.as("h")),o=mt(i.as("d")),l=mt(i.as("M")),c=mt(i.as("w")),u=mt(i.as("y")),m=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||d<=1&&["m"]||d<n.m&&["mm",d]||y<=1&&["h"]||y<n.h&&["hh",y]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(m=m||c<=1&&["w"]||c<n.w&&["ww",c]),m=m||l<=1&&["M"]||l<n.M&&["MM",l]||u<=1&&["y"]||["yy",u],m[2]=t,m[3]=+e>0,m[4]=r,td.apply(null,m)}function nd(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function rd(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function ad(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Bt,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},Bt,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=sd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Zn=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Qs(){if(!this.isValid())return this.localeData().invalidDate();var e=Zn(this._milliseconds)/1e3,t=Zn(this._days),n=Zn(this._months),r,i,a,d,y=this.asSeconds(),o,l,c,u;return y?(r=We(e/60),i=We(r/60),e%=60,r%=60,a=We(n/12),n%=12,d=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=y<0?"-":"",l=Wt(this._months)!==Wt(y)?"-":"",c=Wt(this._days)!==Wt(y)?"-":"",u=Wt(this._milliseconds)!==Wt(y)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?u+i+"H":"")+(r?u+r+"M":"")+(e?u+d+"S":"")):"P0D"}var re=Bs.prototype;re.isValid=Zl,re.abs=Ac,re.add=Ec,re.subtract=Rc,re.as=Lc,re.asMilliseconds=pa,re.asSeconds=Pc,re.asMinutes=Fc,re.asHours=Dc,re.asDays=Yc,re.asWeeks=Uc,re.asMonths=$c,re.asQuarters=Hc,re.asYears=Bc,re.valueOf=Wc,re._bubble=kc,re.clone=zc,re.get=Gc,re.milliseconds=Vc,re.seconds=qc,re.minutes=Kc,re.hours=Qc,re.days=Zc,re.weeks=ed,re.months=Jc,re.years=Xc,re.humanize=ad,re.toISOString=Qs,re.toString=Qs,re.toJSON=Qs,re.locale=ta,re.localeData=na,re.toIsoString=He("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qs),re.lang=sa,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Y("x",Ps),Y("X",Ti),pe("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),pe("x",function(e,t,n){n._d=new Date(se(e))});//! moment.js
39
- R.version="2.30.1",ai(ge),R.fn=E,R.min=Vl,R.max=ql,R.now=Kl,R.utc=Je,R.unix=Sc,R.months=wc,R.isDate=ss,R.locale=vt,R.invalid=Ms,R.duration=Ke,R.isMoment=Ve,R.weekdays=Cc,R.parseZone=Tc,R.localeData=dt,R.isDuration=Ws,R.monthsShort=Ic,R.weekdaysMin=Mc,R.defineLocale=Dn,R.updateLocale=Sl,R.locales=Tl,R.weekdaysShort=Oc,R.normalizeUnits=Be,R.relativeTimeRounding=nd,R.relativeTimeThreshold=rd,R.calendarFormat=vo,R.prototype=E,R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const bt=(e,t,n)=>{let r;for(let i=0;i<(e==null?void 0:e.length);i++)if(r=e[i],r[n]==t)return r;return new Object},Qe=e=>{if(!e)return"";e=e.toLowerCase();let t=e.split(" ");for(let n=0;n<t.length;n++)t[n]=t[n].charAt(0).toUpperCase()+t[n].slice(1);return t.join(" ")},Zs=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},id=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},ld=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e),Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Xs={USD:{symbol:"$"},EUR:{symbol:"€"},GBP:{symbol:"£"},AED:{symbol:"AE",contactValidation:8},JPY:{symbol:"¥"},AUD:{symbol:"A$"},CAD:{symbol:"CA$",contactValidation:7},INR:{symbol:"₹",round:Math.round},CNY:{symbol:"CN¥",contactValidation:8},BRL:{symbol:"R$",contactValidation:9},QAR:{symbol:"QAR",contactValidation:8},SAR:{symbol:"SAR",contactValidation:7},BHD:{symbol:"BHD",minimumFractionDigits:3,contactValidation:7},NPR:{symbol:"NPR",contactValidation:10},KWD:{symbol:"KWD",minimumFractionDigits:3,contactValidation:8},ZMW:{symbol:"ZK",contactValidation:9},OMR:{symbol:"OMR",minimumFractionDigits:3,contactValidation:8},KES:{symbol:"KSh",contactValidation:9},SGD:{symbol:"S$",contactValidation:9},MVR:{symbol:"MVR",contactValidation:7,displayType:"code"},IDR:{symbol:"Rp",contactValidation:13,displayType:"code",round:Math.round},THB:{symbol:"฿",contactValidation:8,displayType:"code"},MYR:{symbol:"RM",displayType:"code"},PKR:{symbol:"₨",round:Math.round},GHS:{symbol:"₵",contactValidation:9},LKR:{symbol:"₨",displayType:"code"},TZS:{symbol:"TZS",contactValidation:9},BWP:{symbol:"P",contactValidation:8,displayType:"code"}};function od(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(m){if(m<10)return t[m];if(m<20)return n[m-11];{const f=m%10,x=Math.floor(m/10);return`${r[x]}${f?" "+t[f]:""}`}}function a(m){var f=m.toString(),x,b,_,w,T,M,F,O,B,K,te,q,he="and";if(f=f.replace(/[, ]/g,""),parseInt(f)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],b=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],_=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],w=f.length,M=[];w>0;)T=w,M.push(f.slice(w=Math.max(0,w-3),T));if(F=M.length,F>_.length)return"";for(q=[],K=0;K<F;K++)O=parseInt(M[K]),O&&(B=M[K].split("").reverse().map(parseFloat),B[1]===1&&(B[0]+=10),(te=_[K])&&q.push(te),(te=x[B[0]])&&q.push(te),(te=b[B[1]])&&q.push(te),(B[0]||B[1])&&(B[2]||K+1>F)&&q.push(he),(te=x[B[2]])&&q.push(te+" Hundred"));return q.reverse().join(" ")}const[d,y]=e.toString().split("."),o=a(parseInt(d,10)),l=i(parseInt(y,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>`${Xs[t].symbol} ${roundAccordingly(e||0,t)}`,U=(e,t)=>`${Xs[t].symbol} ${formatDecimalPlaces(e||0,t)}`,Jn=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},cd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),Xn=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(d=>{var y;(y=d.discounts)==null||y.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:cd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},er=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(d=>{const y=`${d[t]}`;n[y]?(n[y].amt+=d.amt,n[y].taxAmt+=d.taxAmt):n[y]={amt:d.amt,chargeType:d.chargeType?d.chargeType:d.type,defaultSelcted:d.defaultSelcted,rate:d.rate,tax:d.tax,taxAmt:d.taxAmt,name:d.name,type:d.type}})}),Object.values(n)},tr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function ms(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function dd(e,t,n,r,i){const a=ms("1",e),d=ms("2",t),y=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,d,y,o,l]);return c.toString("base64")}const hd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),ud=()=>{var t;let e;return((t=settingData==null?void 0:settingData.paymentModes)==null?void 0:t.length)>0?e=JSON.parse(JSON.stringify(settingData==null?void 0:settingData.paymentModes)):e=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],e},Se=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),ft=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fs=Jn(),md=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),d=Math.floor(t%3600/60),y=`${a} hr ${d} min`;return y}else return r},fd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=Zs(i,"internalName");let d;for(let y in e.paymentModes)!r[y]&&e.paymentModes[y]&&(d=a[y],n.push({displayName:d?d.displayName:Qe(y.replace("_"," ")),value:ft(e.paymentModes[y])}));return n},pd=(e,t)=>e>0&&t>0?e/t:0;function zt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var d=i.toDataURL("image/png");t(d)},r.onerror=i=>{t(null)}}catch{t(null)}})}const en=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return console.log("OLD FLOW"),!0},sr=e=>{let t={},n;for(let r=0;r<e.length;r++)switch(n=e[r],n.type){case"ORDER_DISCOUNT":t.ORDER_DISCOUNT=[n];break;case"DISCOUNT_ITEMS":t.DISCOUNT_ITEMS?t.DISCOUNT_ITEMS.push(n):t.DISCOUNT_ITEMS=[n];break;case"CATEGORY_DISCOUNT":t.CATEGORY_DISCOUNT?t.CATEGORY_DISCOUNT.push(n):t.CATEGORY_DISCOUNT=[n];break;case"ITEM_DISCOUNT":t.ITEM_DISCOUNT?t.ITEM_DISCOUNT.push(n):t.ITEM_DISCOUNT=[n];break;case"COUPON_DISCOUNT":t.COUPON_DISCOUNT=[n];break;case"SEGMENT_DISCOUNT":t.SEGMENT_DISCOUNT=[n];break}return t},nr=(e,t)=>{var c;let n,r,i,a,d;const y={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let u=0;u<e.length;u++)if(n=e[u],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],d=0;d<n.addons.length;d++)a=n.addons[d],a.serviceRate&&i.push(a);else i=n.addons;o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,y[r]?(y[r].qty+=n.qty,y[r].sub_total+=n.sub_total):y[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(y)},rr=e=>{var y;let t,n,r,i,a={},d=0;for(let o=0;o<e.length;o++)if(t=e[o],(y=t.taxation)!=null&&y.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),d+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),d+=r.taxAmt);return{obj:Object.values(a),sum:d}},ar=(e,t,n)=>{var a,d,y,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return en((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=en((d=t.siteSetting)==null?void 0:d.packagingSlipPrinters,i,"value");if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return en((y=t.siteSetting)==null?void 0:y.billPrinters,i,"value");{let l=en((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}}},yd=(e,t,n={})=>{var _;const{usersObj:r}=n;let i={},a,d;const{cancelledKOT:y,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((_=e.customFeilds)!=null&&_.length){let w=bt(e.customFeilds,"INSTRUCTION","customType");w!=null&&w.customValue&&(d=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,M)=>{var ve,W,le;let F=T.station?T.station.split("::"):"",O=F&&F.length>1?F[1]:F[0],B=e.tableNo?e.tableNo.split("::"):null,K=B&&B.length>0?B[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,q;(ve=r==null?void 0:r[w.createdBy])!=null&&ve.name&&(q=r[w.createdBy].name);let he=!1;(y||O&&T.status==l)&&(he=!0),he&&ir(O)?(i[O]||(i[O]={},i[O].station=O,i[O].services=[],i[O].tableName=te,i[O].customerName=e.name==t.companyName?null:e.name,i[O].time=R().format("DD-MM-YYYY hh:mm a"),i[O].type=e.orderFrom,i[O].subOrderFrom=e.subOrderFrom,i[O].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[O].orderId=new Set([i[O].orderId]),i[O].instruction=e.instruction,i[O].orderSource=e.orderSource,i[O].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[O].aggregatorOrderId=e.externalOrderId,i[O].otp=e.otp,i[O].totalQty=0,i[O].tokenId=e.tokenId,i[O].kotId=T.kotId?new Set([T.kotId]):null,i[O].waiterName=e.waiterName,i[O].duplicate=y,i[O].createdBy=q,i[O].zomatoInstant=c,d&&(i[O].customFields=d),o&&(i[O].onlyCancelledItems=o),e.preparationTime&&(i[O].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[O]?(i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:w.subOrderId,isUrgent:T.isUrgent,index:M,status:T.status,addons:T.addons}),i[O].totalQty+=Se(T.qty),(W=i[O].kotId)==null||W.add(T.kotId),e.externalOrderId||e.offlineOrderId||(le=i[O].orderId)==null||le.add(w.subOrderId)):(console.log("else"),i[O]=[],i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:w.subOrderId,index:M,status:T.status}),i[O].totalQty+=Se(T.qty))):console.log("cancelledKOT ::")})});let u={},m="2INCH";Jn();let f,x=[],b={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const T=i[w];try{t.printers&&t.printers.map(M=>{M.label.toUpperCase()==T.station.toUpperCase()&&(f=fs=="Android OS"?M:M.value??void 0,m=M.paperSize?M.paperSize:t.printerSize,x.push({printer:f,paperSize:m}))}),x.length==0&&x.push({printer:f,paperSize:t.printerSize||m});for(let M=0;M<T.services.length;M++){let F=T.services[M],O=e.orderList.find(K=>K.subOrderId==F.subOrderId),B=u[F.subOrderId];O&&(B?B.services.push(O.services[F.index]):(u[F.subOrderId]={},u[F.subOrderId].subOrderId=O.subOrderId,u[F.subOrderId].services=[O.services[F.index]]))}}catch(M){console.log(M)}b[w]=x,x=[],f=null}for(const w in u)Object.hasOwnProperty.call(u,w)&&u[w];return{obj:i,paperSize:m,printer:f,printersMap:b}},gd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let d="2INCH",y,o=[],l,c;const u=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let m=bt(e.customFeilds,"INSTRUCTION","customType");m!=null&&m.customValue&&(c=[{customName:m.customName,customValue:m.customValue}])}for(let m=0;m<t.packagingSlipPrinters.length;m++)if(l=t.packagingSlipPrinters[m],l.label==e.subOrderFrom&&(y=fs=="Android OS"?l:l.value??void 0,d=l.paperSize?l.paperSize:d,l.paperSize)){let f,x,b,_,w,T={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:R().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:u},M={},F=!1,O,B=0;for(e.preparationTime&&(T.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(T.customFields=c),b=0;b<e.orderList.length;b++)for(f=e.orderList[b],_=0;_<f.services.length;_++)x=f.services[_],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},F=!1,x.status===r&&((a=l.stations)!=null&&a.length?(O=id(l.stations),O[x.station]&&(F=!0)):F=!0),F&&x.kotId&&x.station&&(w=x.station.split("::")[1],B+=x.qty,M[`${w}/${x.kotId}`]?M[`${w}/${x.kotId}`].push(x):M[`${w}/${x.kotId}`]=[x]);Object.keys(M).length&&(T.services=M,T.totalQty=ft(B),o.push({printer:y,paperSize:d,obj:T}))}return{printers:o}}catch(d){console.log(d)}},xd=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let u=(c=l.station.split("::"))==null?void 0:c[1];u&&ir(u)&&(r[u]?r[u].activeKots[l.kotId]=l.kotId:r[u]={from:[n.from],to:[n.to],station:u,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,u,m={},f=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],f.push(o.tableNo),c=0;c<o.ids.length;c++)u=o.ids[c],m[u]=u;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],m[o.id]&&o.orderList.forEach(b=>{b.services.forEach(_=>{var w;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let T=(w=_.station.split("::"))==null?void 0:w[1];T&&ir(T)&&(r[T]?r[T].activeKots[_.kotId]=_.kotId:r[T]={from:f,to:[n.to],station:T,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,d=[],y={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?fs=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,d.push({printer:a,paperSize:i}))}),d.length==0&&d.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}y[o]=d,d=[],a=null}return{obj:r,paperSize:i,printersMap:y}},Nd=(e,t)=>{var M,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d,rangeDate:y}=t;console.log(e,{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d});let o={},l;const c=!!bt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:O,...B}=i;i={...B,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let u=c&&(n==null?void 0:n.length)&&n.some(O=>O.slugName==="online-menu")&&e.isAggregatorEnabled==!0,m=u?r.aggregator_collection:void 0,f=u?r.zomato_collection:void 0,x=u?r.swiggy_collection:void 0,b=c?md(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const O=r.menuWiseSales;for(const B in O)B.endsWith("collection")?l[ts(B)]=ft(O[B]):l[ts(B)]=O[B]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((M=Object.keys(r.itemTypeList))!=null&&M.length))for(let O in r.itemTypeList)_+=r.itemTypeList[O];let w=d;return y.toDate!==y.fromDate&&(w=`${tr(y.fromDate)} - ${tr(y.toDate)}`),{salesCollection:c?{...r,totalCollection:ft(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:m,zomato_aggregator_collection:f,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:fd(i,e.paymentModes),totalCollection:ft(i.totalCollection),averageCollection:{avgTableTime:b,avgorderValue:pd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?ft(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?ft(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?ft(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:w,id:Math.random(),otherFields:{salesCollection:i.salesCollection?ft(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},jd=(e,t,n={})=>new Promise(async(r,i)=>{var m,f,x;console.log({order:e,settingData:t,additionalActions:n});const a=void 0,{invoiceFormat:d,userData:y}=n;let o,l,c=[],u;try{if((m=e.appliedDiscounts)!=null&&m.length){u=0;for(let V=0;V<e.appliedDiscounts.length;V++)o=e.appliedDiscounts[V],u+=o.discountAmt}const b=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const V=bt(e.customFeilds,"INSTRUCTION","customType");V!=null&&V.customValue&&(c=[{customName:V.customName,customValue:V.customValue}])}o={};let _=(x=t==null?void 0:t.footerAddress)!=null&&x.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(M!=""?M+",":""),O=t.gstNo,B={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},q={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},he=Js(t.curr),ve={...e,companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he},W=null,le=null;d.companyLogo&&(W=await zt(`https://${a}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(le=await zt(`https://${a}.s3.amazonaws.com/${d.qrcode.key}`)),e.orderList.filter(V=>{V.services.forEach(async(Z,Ce)=>{var nt,rt;let A="kitchen",yt=e.tableName?e.tableName:e.orderFrom;A&&(o[A]||(o[A]={},o[A].station=A,o[A].services=[],o[A].tableName=yt,o[A].customerName=e.name,o[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),o[A].type=e.orderFrom,o[A].orderId=e.orderId,o[A].instruction=e.instruction,o[A].totalQty=0,o[A].tokenId=e.tokenId,o[A].orderSource=e.orderSource,o[A].aggregatorOrderId=e.externalOrderId,o[A].otp=e.otp,o[A].paymentState=e.paymentState,o[A].discountAmt=u,o[A].otherCharges=e.otherCharges,o[A].taxAmt=e.taxAmt,o[A].customFeilds=c,o[A].curr=t.curr??"INR",o[A].zomatoInstant=b),o[A]?(l={serviceName:Z.serviceName,qty:Z.qty,instruction:Z.isUrgent&&Z.instruction?`(URGENT -${Z.instruction})`:Z.instruction?`(${Z.instruction})`:Z.isUrgent?"(URGENT)":"",subOrderId:V.subOrderId,isUrgent:Z.isUrgent,index:Ce},(nt=Z.addons)!=null&&nt.length&&(l.addons=Z.addons),o[A].services.push(l),o[A].totalQty+=Z.qty):(o[A]=[],o[A].services.push({serviceName:Z.serviceName,qty:Z.qty,instruction:Z.instruction?Z.instruction:"",subOrderId:V.subOrderId,index:Ce}),o[A].totalQty+=Z.qty),o[A]={...o[A],companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he},o[A].domain=d.siteURL,o[A].paymentMethods=d.paymentMode?ve.paymentMethods:null,o[A].companyInfo.companyName=d.companyName,o[A].companyInfo.companyEmail=d.email,o[A].companyInfo.companyAddress=d.address,o[A].companyInfo.companyContact=d.mobile,o[A].tokenId=d.token?ve.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(ve.upiId=d.upiId),o[A].gstNo=d.gst?ve.gst:null,o[A].footerMessage=d.footerMessage,o[A].orderFrom=(rt=e.subOrderFrom)==null?void 0:rt.toUpperCase(),o[A].fssai=t.fssai,o[A].vatNo=t.vatNo,o[A].printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,o[A].disabledPoweredBy=t.disabledPoweredBy===!0,o[A].printTime=R().format("DD-MM-YYYY hh:mm A"),o[A].printedBy=y.userRole=="admin"?"Admin":y.name,e.deliveryTimestamp&&(o[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),o[A].itemInstructionOnBill=d.itemInstructionOnBill,o[A]={...o[A],companyLogo:W,companyQrCode:le})})});for(const V in o)if(Object.hasOwnProperty.call(o,V)){const Z=o[V];try{let Ce=t.printerSize??"2inch";r(new Object({obj:new Object({...Z,paperSize:Ce}),orderList:e.orderList}));return}catch(Ce){console.log(Ce)}}}catch(b){console.log("err::",b)}}),vd=async e=>{let t=[];for(let u=0;u<e.length;u++)for(let m=0;m<e[u].orderList.length;m++)t.push(e[u].orderList[m]);let n=[];if(t.length>0)for(let u=0;u<t.length;u++)for(let m=0;m<t[u].services.length;m++)t[u].services[m].status!="CANCELLED"&&t[u].services[m].status!="RETURNED"&&t[u].services[m].status!="SHIFTED"&&n.push(t[u].services[m]);let r={},i=[];for(let u=0;u<n.length;u++)if(n[u].addons&&n[u].addons.length>0)for(let m=0;m<n[u].addons.length;m++){let f={...n[u].addons[m]};f.qty=n[u].qty,i.push(f)}n.forEach(u=>{let{attachedCat:m,serviceId:f}=u;r[m]||(r[m]=[]);let x=r[m].findIndex(b=>b.serviceId===f);x!==-1?r[m][x].qty=r[m][x].qty+u.qty:r[m].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedCat,station:u.station})});const a=Object.keys(r).sort(),d={};a.forEach(u=>{d[u]=r[u]});for(let u in d)d[u].sort((m,f)=>m.serviceName.localeCompare(f.serviceName));let y={Category:d},o={};i.forEach(u=>{let{attachedAddonCat:m,serviceId:f}=u;o[m]||(o[m]=[]);let x=o[m].findIndex(b=>b.serviceId===f);x!==-1?o[m][x].qty=o[m][x].qty+u.qty:o[m].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedAddonCat,station:u.station})});const l=Object.keys(o).sort(),c={};l.forEach(u=>{c[u]=o[u]});for(let u in c)c[u].sort((m,f)=>m.serviceName.localeCompare(f.serviceName));return y.Addon=c,y},ya={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},ga=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ya[t]?ya[t]:"SGST"},xa=(e,t,n={})=>new Promise(async(r,i)=>{var d,y,o,l,c,u;try{const{invoiceFormat:m,custName:f,custMobile:x,custAddress:b,userData:_={}}=n,{itemList:w}=e,T=void 0;let M=_==null?void 0:_.userRole;if(_.userRole=="admin"?M="ADMIN":M=_==null?void 0:_.name,!(w!=null&&w.length))return;let F=t.printerSize,O=ar(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});F=O?(d=O[0])!=null&&d.paperSize?(y=O[0])==null?void 0:y.paperSize:F||"2INCH":F;let B=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",K=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",te=t.footerAddress.city?t.footerAddress.city:"",q=t.footerAddress.zip?t.footerAddress.zip:"",he=(B!=""?B+",":"")+(K!=""?K+",":"")+(te!=""?te+",":"")+(q!=""?q+",":""),ve=t.gstNo,W={companyName:t.companyName,companyAddress:he,companyContact:t.contactNumber,companyEmail:t.contactEmail},V={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},Z={custName:m&&m.custName?f==t.companyName?null:f:null,custAddress:m&&m.custAddress&&b||null,custContact:m&&m.custMobile?x:null,custEmail:"ajaybaglane7@gmail.com"},Ce=Js(t.curr),A={...e,companyInfo:W,orderInfo:V,customerInfo:Z,gst:ve,curr:Ce};if(m){if(A.domain=m.siteURL,A.paymentMethods=m.paymentMode?A.paymentMethods:null,A.companyInfo.companyName=m.companyName,A.companyInfo.companyEmail=m.email,A.companyInfo.companyAddress=m.address,A.companyInfo.companyContact=m.mobile,A.customerInfo.custName=m.custName?f:null,A.tokenId=m.token?A.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(A.upiId=m.upiId),A.gstNo=m.gst?A.gst:null,A.footerMessage=m.footerMessage,A.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),A.fssai=t.fssai,A.vatNo=t.vatNo,A.taxLabel=ga(t),A.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,A.disabledPoweredBy=t.disabledPoweredBy===!0,A.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(A.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),A.itemInstructionOnBill=m.itemInstructionOnBill,A.noOfInvoice=m.noOfInvoice,A.printby=M,A.newFormat=!0,!m.itemInstructionOnBill&&A.itemList){let J;for(let _e=0;_e<A.itemList.length;_e++)J=A.itemList[_e],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let yt=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let _e=0;_e<e.customFeilds.length;_e++)J=e.customFeilds[_e],J!=null&&J.customValue&&((u=J.availability)!=null&&u.includes("BILL"))&&yt.push({customName:J.customName,customValue:J.customValue});A.customFields=yt}let nt=null,rt=null;m.companyLogo&&(nt=await zt(`https://${T}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(rt=await zt(`https://${T}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let Ze={};(function(){let J,_e,gt=0,g=0,h=0,I=0,j=0,C=0,D=0,S=0,k=[],$=[],fe=0,Ee;if(F==="A4"||F==="A5"){for(_e=0;_e<w.length;_e++)J=w[_e],g+=J.sub_total,h+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0),fe+=J.qty;let Pe=Xn(w,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr(w);Ze={itemList:nr(w,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er(w,"name"),taxation:Ae,subTotal:Se(g),afterDisc:Se(h),afterCharges:Se(I),total:Se(gt+$e),qty:fe}}else{for(_e=0;_e<w.length;_e++)J=w[_e],J.taxType==="VAT"?($.push(J),S+=J.sub_total,C+=J.afterdiscAmt,j+=J.afterdiscAmt+(J.total_charges??0),D+=J.afterdiscAmt+(J.total_charges??0)):(k.push(J),g+=J.sub_total,h+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0));if(k.length){let Pe=Xn(k,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr(k);Ze.GST={itemList:nr(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er(k,"name"),taxation:Ae,subTotal:Se(g),afterDisc:Se(h),afterCharges:Se(I),total:Se(gt+$e)}}if($.length){let Pe=Xn($,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr($);Ze.VAT={itemList:nr($,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er($,"name"),taxation:Ae,subTotal:Se(S),afterDisc:Se(C),afterCharges:Se(j),total:Se(D+$e)}}}})(),console.log("distributedData :::",Ze),A.distributedData=Ze;let Tt={obj:A,companyLogo:nt,companyQrCode:rt,paperSize:t.printerSize,Name:a};console.log("obj1 :::",Tt),r(Tt)}}catch(m){console.log("err",m),i(m)}}),_d=(e,t,n={})=>new Promise(async(r,i)=>{var d,y,o,l;try{const{invoiceFormat:c,custName:u,custMobile:m,custAddress:f,orderData:x}=n,b=void 0;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(M!=""?M+",":""),O=t.gstNo,B={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:x&&x.timestamp?R.unix(x.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:x&&x.orderId?x.orderId:null,timestamp:x.timestamp},q={custName:c&&c.custName?u==t.companyName?null:u:null,custAddress:c&&c.custAddress&&f||null,custContact:c&&c.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},he=Js(t.curr),ve="",W={...e,companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he};if(c){if(W.domain=c.siteURL,W.paymentMethods=c.paymentMode?W.paymentMethods:null,W.companyInfo.companyName=c.companyName,W.companyInfo.companyEmail=c.email,W.companyInfo.companyAddress=c.address,W.companyInfo.companyContact=c.mobile,W.customerInfo.custName=c.custName?u:null,W.tokenId=c.token?W.tokenId:null,c.isPayQR&&c.upiId&&c.upiId!==""&&(W.upiId=c.upiId),W.gstNo=c.gst?W.gst:null,W.footerMessage=c.footerMessage,W.orderFrom=(d=x.subOrderFrom)==null?void 0:d.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ga(t),W.printOperatorInfo=c.printOperatorInfo===null||c.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=R().format("DD-MM-YYYY hh:mm A"),x.deliveryTimestamp&&(W.deliveryTimestamp=R.unix(x.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=c.itemInstructionOnBill,W.noOfInvoice=c.noOfInvoice,W.area=x.area,W.captainName=x.captainName,!c.itemInstructionOnBill&&W.itemList){let V;for(let Z=0;Z<W.itemList.length;Z++)V=W.itemList[Z],V.instruction&&delete V.instruction}t.enabledOutstandingOnPay&&((y=e.custoutStandingData)!=null&&y.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let le=[];if((o=x.customFeilds)!=null&&o.length){let V;for(let Z=0;Z<x.customFeilds.length;Z++)V=x.customFeilds[Z],V!=null&&V.customValue&&((l=V.availability)!=null&&l.includes("BILL"))&&le.push({customName:V.customName,customValue:V.customValue});W.customFields=le}if(t&&t.isOld&&t.isOld==!0){let V=null,Z=null;c.companyLogo&&(V=await zt(`https://${b}.s3.amazonaws.com/${c.companyLogo.key}`)),c.qrcode&&(Z=await zt(`https://${b}.s3.amazonaws.com/${c.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let Ce={obj:W,companyLogo:V,companyQrCode:Z,paperSize:t.printerSize,Name:a};r(Ce)}}}catch(c){console.log("err",c)}}),bd=(e,t)=>new Promise(async(n,r)=>{var M;console.log({orders:e,settingData:t});let i;(M=t.siteLogo)!=null&&M.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",d=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",y=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(d!=""?d+",":"")+(y!=""?y+",":"")+(o!=""?o+",":""),c=[],u,m=0,f=0,x=0,b=[],_,w;const T=Zs(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(u=e[F],c.push({date:u.date,orderId:u.orderId,finalAmount:u.finalAmount}),m+=u.finalAmount,f+=u.paidAmt,x+=u.balanceAmt,_=0;_<u.orderTransactions.length;_++)w=u.orderTransactions[_],w.paidAmt&&b.push({date:R.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:T[w.paymentMode].displayName,amount:Se(w.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:m,totalPaid:f,totalPayable:x,paperSize:t.printerSize,curr:Js(t.curr),transactions:b})}),Sd=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await xa({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await _d(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),console.log("resp :::",i),t(i)}),Na=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},ir=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(d=>d.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Td(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const wd=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function St(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function ja(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=St(window.getComputedStyle(document.documentElement)),Gt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Id(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function Cd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function va(e,t={}){const n=t.width||Id(e),r=t.height||Cd(e);return{width:n,height:r}}function Od(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Ue=16384;function Md(e){(e.width>Ue||e.height>Ue)&&(e.width>Ue&&e.height>Ue?e.width>e.height?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue):e.width>Ue?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Ad(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ed(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Ad(i)}const Le=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Le(n,t)};function Rd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function kd(e,t){return ja(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function Ld(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Rd(n):kd(n,r);return document.createTextNode(`${i}{${a}}`)}function _a(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=wd();try{t.className=`${t.className} ${d}`}catch{return}const y=document.createElement("style");y.appendChild(Ld(d,n,i,r)),t.appendChild(y)}function Pd(e,t,n){_a(e,t,":before",n),_a(e,t,":after",n)}const ba="application/font-woff",Sa="image/jpeg",Fd={woff:ba,woff2:ba,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Sa,jpeg:Sa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Dd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function lr(e){const t=Dd(e).toLowerCase();return Fd[t]||""}function Yd(e){return e.split(/,/)[1]}function or(e){return e.search(/^(data:)/)!==-1}function Ud(e,t){return`data:${t};base64,${e}`}async function Ta(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,d)=>{const y=new FileReader;y.onerror=d,y.onloadend=()=>{try{a(n({res:r,result:y.result}))}catch(o){d(o)}},y.readAsDataURL(i)})}const cr={};function $d(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function dr(e,t,n){const r=$d(e,t,n.includeQueryParams);if(cr[r]!=null)return cr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ta(e,n.fetchRequestInit,({res:d,result:y})=>(t||(t=d.headers.get("Content-Type")||""),Yd(y)));i=Ud(a,t)}catch(a){i=n.imagePlaceholder||"";let d=`Failed to fetch resource: ${e}`;a&&(d=typeof a=="string"?a:a.message),d&&console.warn(d)}return cr[r]=i,i}async function Hd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Bd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),d=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,d==null||d.drawImage(e,0,0,a.width,a.height);const y=a.toDataURL();return sn(y)}const n=e.poster,r=lr(n),i=await dr(n,r,t);return sn(i)}async function Wd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function zd(e,t){return Le(e,HTMLCanvasElement)?Hd(e):Le(e,HTMLVideoElement)?Bd(e,t):Le(e,HTMLIFrameElement)?Wd(e,t):e.cloneNode(wa(e))}const Gd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",wa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Vd(e,t,n){var r,i;if(wa(t))return t;let a=[];return Gd(e)&&e.assignedNodes?a=St(e.assignedNodes()):Le(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=St(e.contentDocument.body.childNodes):a=St(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Le(e,HTMLVideoElement)||await a.reduce((d,y)=>d.then(()=>nn(y,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function qd(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):ja(n).forEach(a=>{let d=i.getPropertyValue(a);a==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),Le(e,HTMLIFrameElement)&&a==="display"&&d==="inline"&&(d="block"),a==="d"&&t.getAttribute("d")&&(d=`path(${t.getAttribute("d")})`),r.setProperty(a,d,i.getPropertyPriority(a))})}function Kd(e,t){Le(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Le(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Qd(e,t){if(Le(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function Zd(e,t,n){return Le(t,Element)&&(qd(e,t,n),Pd(e,t,n),Kd(e,t),Qd(e,t)),t}async function Jd(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const y=n[a].getAttribute("xlink:href");if(y){const o=e.querySelector(y),l=document.querySelector(y);!o&&l&&!r[y]&&(r[y]=await nn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",d=document.createElementNS(a,"svg");d.setAttribute("xmlns",a),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const y=document.createElementNS(a,"defs");d.appendChild(y);for(let o=0;o<i.length;o++)y.appendChild(i[o]);e.appendChild(d)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>zd(r,t)).then(r=>Vd(e,r,t)).then(r=>Zd(e,r,t)).then(r=>Jd(r,t))}const Ia=/url\((['"]?)([^'"]+?)\1\)/g,Xd=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,eh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function th(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function sh(e){const t=[];return e.replace(Ia,(n,r,i)=>(t.push(i),n)),t.filter(n=>!or(n))}async function nh(e,t,n,r,i){try{const a=n?Td(t,n):t,d=lr(t);let y;return i||(y=await dr(a,d,r)),e.replace(th(t),`$1${y}$3`)}catch{}return e}function rh(e,{preferredFontFormat:t}){return t?e.replace(eh,n=>{for(;;){const[r,,i]=Xd.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ca(e){return e.search(Ia)!==-1}async function Oa(e,t,n){if(!Ca(e))return e;const r=rh(e,n);return sh(r).reduce((a,d)=>a.then(y=>nh(y,d,t,n)),Promise.resolve(r))}async function Vt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Oa(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function ah(e,t){await Vt("background",e,t)||await Vt("background-image",e,t),await Vt("mask",e,t)||await Vt("-webkit-mask",e,t)||await Vt("mask-image",e,t)||await Vt("-webkit-mask-image",e,t)}async function ih(e,t){const n=Le(e,HTMLImageElement);if(!(n&&!or(e.src))&&!(Le(e,SVGImageElement)&&!or(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dr(r,lr(r),t);await new Promise((a,d)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){d(l)}}:d;const y=e;y.decode&&(y.decode=a),y.loading==="lazy"&&(y.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function lh(e,t){const r=St(e.childNodes).map(i=>Ma(i,t));await Promise.all(r).then(()=>e)}async function Ma(e,t){Le(e,Element)&&(await ah(e,t),await ih(e,t),await lh(e,t))}function oh(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Aa={};async function Ea(e){let t=Aa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Aa[e]=t,t}async function Ra(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async d=>{let y=d.replace(r,"$1");return y.startsWith("https://")||(y=new URL(y,e.url).href),Ta(y,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function ka(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",y=new RegExp(d,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=y.exec(r),o===null)break;a.lastIndex=y.lastIndex}else y.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ch(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach((a,d)=>{if(a.type===CSSRule.IMPORT_RULE){let y=d+1;const o=a.href,l=Ea(o).then(c=>Ra(c,t)).then(c=>ka(c).forEach(u=>{try{i.insertRule(u,u.startsWith("@import")?y+=1:i.cssRules.length)}catch(m){console.error("Error inserting rule from remote css",{rule:u,error:m})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const d=e.find(y=>y.href==null)||document.styleSheets[0];i.href!=null&&r.push(Ea(i.href).then(y=>Ra(y,t)).then(y=>ka(y).forEach(o=>{d.insertRule(o,d.cssRules.length)})).catch(y=>{console.error("Error loading remote stylesheet",y)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function dh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ca(t.style.getPropertyValue("src")))}async function hh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=St(e.ownerDocument.styleSheets),r=await ch(n,t);return dh(r)}function La(e){return e.trim().replace(/["']/g,"")}function uh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(La(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function mh(e,t){const n=await hh(e,t),r=uh(e);return(await Promise.all(n.filter(a=>r.has(La(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oa(a.cssText,d,t)}))).join(`
39
+ R.version="2.30.1",ai(ge),R.fn=E,R.min=Vl,R.max=ql,R.now=Kl,R.utc=Je,R.unix=Sc,R.months=wc,R.isDate=ss,R.locale=vt,R.invalid=Ms,R.duration=Ke,R.isMoment=Ve,R.weekdays=Cc,R.parseZone=Tc,R.localeData=dt,R.isDuration=Ws,R.monthsShort=Ic,R.weekdaysMin=Mc,R.defineLocale=Dn,R.updateLocale=Sl,R.locales=Tl,R.weekdaysShort=Oc,R.normalizeUnits=Be,R.relativeTimeRounding=nd,R.relativeTimeThreshold=rd,R.calendarFormat=vo,R.prototype=E,R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const bt=(e,t,n)=>{let r;for(let i=0;i<(e==null?void 0:e.length);i++)if(r=e[i],r[n]==t)return r;return new Object},Qe=e=>{if(!e)return"";e=e.toLowerCase();let t=e.split(" ");for(let n=0;n<t.length;n++)t[n]=t[n].charAt(0).toUpperCase()+t[n].slice(1);return t.join(" ")},Zs=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},id=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},ld=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e),Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Xs={USD:{symbol:"$"},EUR:{symbol:"€"},GBP:{symbol:"£"},AED:{symbol:"AE",contactValidation:8},JPY:{symbol:"¥"},AUD:{symbol:"A$"},CAD:{symbol:"CA$",contactValidation:7},INR:{symbol:"₹",round:Math.round},CNY:{symbol:"CN¥",contactValidation:8},BRL:{symbol:"R$",contactValidation:9},QAR:{symbol:"QAR",contactValidation:8},SAR:{symbol:"SAR",contactValidation:7},BHD:{symbol:"BHD",minimumFractionDigits:3,contactValidation:7},NPR:{symbol:"NPR",contactValidation:10},KWD:{symbol:"KWD",minimumFractionDigits:3,contactValidation:8},ZMW:{symbol:"ZK",contactValidation:9},OMR:{symbol:"OMR",minimumFractionDigits:3,contactValidation:8},KES:{symbol:"KSh",contactValidation:9},SGD:{symbol:"S$",contactValidation:9},MVR:{symbol:"MVR",contactValidation:7,displayType:"code"},IDR:{symbol:"Rp",contactValidation:13,displayType:"code",round:Math.round},THB:{symbol:"฿",contactValidation:8,displayType:"code"},MYR:{symbol:"RM",displayType:"code"},PKR:{symbol:"₨",round:Math.round},GHS:{symbol:"₵",contactValidation:9},LKR:{symbol:"₨",displayType:"code"},TZS:{symbol:"TZS",contactValidation:9},BWP:{symbol:"P",contactValidation:8,displayType:"code"}};function od(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(m){if(m<10)return t[m];if(m<20)return n[m-11];{const f=m%10,x=Math.floor(m/10);return`${r[x]}${f?" "+t[f]:""}`}}function a(m){var f=m.toString(),x,b,_,w,T,M,F,O,B,K,te,q,he="and";if(f=f.replace(/[, ]/g,""),parseInt(f)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],b=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],_=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],w=f.length,M=[];w>0;)T=w,M.push(f.slice(w=Math.max(0,w-3),T));if(F=M.length,F>_.length)return"";for(q=[],K=0;K<F;K++)O=parseInt(M[K]),O&&(B=M[K].split("").reverse().map(parseFloat),B[1]===1&&(B[0]+=10),(te=_[K])&&q.push(te),(te=x[B[0]])&&q.push(te),(te=b[B[1]])&&q.push(te),(B[0]||B[1])&&(B[2]||K+1>F)&&q.push(he),(te=x[B[2]])&&q.push(te+" Hundred"));return q.reverse().join(" ")}const[d,y]=e.toString().split("."),o=a(parseInt(d,10)),l=i(parseInt(y,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>`${Xs[t].symbol} ${roundAccordingly(e||0,t)}`,U=(e,t)=>`${Xs[t].symbol} ${formatDecimalPlaces(e||0,t)}`,Jn=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},cd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),Xn=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(d=>{var y;(y=d.discounts)==null||y.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:cd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},er=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(d=>{const y=`${d[t]}`;n[y]?(n[y].amt+=d.amt,n[y].taxAmt+=d.taxAmt):n[y]={amt:d.amt,chargeType:d.chargeType?d.chargeType:d.type,defaultSelcted:d.defaultSelcted,rate:d.rate,tax:d.tax,taxAmt:d.taxAmt,name:d.name,type:d.type}})}),Object.values(n)},tr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function ms(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function dd(e,t,n,r,i){const a=ms("1",e),d=ms("2",t),y=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,d,y,o,l]);return c.toString("base64")}const hd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),ud=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},Se=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),ft=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fs=Jn(),md=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),d=Math.floor(t%3600/60),y=`${a} hr ${d} min`;return y}else return r},fd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=Zs(i,"internalName");let d;for(let y in e.paymentModes)!r[y]&&e.paymentModes[y]&&(d=a[y],n.push({displayName:d?d.displayName:Qe(y.replace("_"," ")),value:ft(e.paymentModes[y])}));return n},pd=(e,t)=>e>0&&t>0?e/t:0;function zt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var d=i.toDataURL("image/png");t(d)},r.onerror=i=>{t(null)}}catch{t(null)}})}const en=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return console.log("OLD FLOW"),!0},sr=e=>{let t={},n;for(let r=0;r<e.length;r++)switch(n=e[r],n.type){case"ORDER_DISCOUNT":t.ORDER_DISCOUNT=[n];break;case"DISCOUNT_ITEMS":t.DISCOUNT_ITEMS?t.DISCOUNT_ITEMS.push(n):t.DISCOUNT_ITEMS=[n];break;case"CATEGORY_DISCOUNT":t.CATEGORY_DISCOUNT?t.CATEGORY_DISCOUNT.push(n):t.CATEGORY_DISCOUNT=[n];break;case"ITEM_DISCOUNT":t.ITEM_DISCOUNT?t.ITEM_DISCOUNT.push(n):t.ITEM_DISCOUNT=[n];break;case"COUPON_DISCOUNT":t.COUPON_DISCOUNT=[n];break;case"SEGMENT_DISCOUNT":t.SEGMENT_DISCOUNT=[n];break}return t},nr=(e,t)=>{var c;let n,r,i,a,d;const y={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let u=0;u<e.length;u++)if(n=e[u],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],d=0;d<n.addons.length;d++)a=n.addons[d],a.serviceRate&&i.push(a);else i=n.addons;o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,y[r]?(y[r].qty+=n.qty,y[r].sub_total+=n.sub_total):y[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(y)},rr=e=>{var y;let t,n,r,i,a={},d=0;for(let o=0;o<e.length;o++)if(t=e[o],(y=t.taxation)!=null&&y.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),d+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),d+=r.taxAmt);return{obj:Object.values(a),sum:d}},ar=(e,t,n)=>{var a,d,y,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return en((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=en((d=t.siteSetting)==null?void 0:d.packagingSlipPrinters,i,"value");if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return en((y=t.siteSetting)==null?void 0:y.billPrinters,i,"value");{let l=en((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}}},yd=(e,t,n={})=>{var _;const{usersObj:r}=n;let i={},a,d;const{cancelledKOT:y,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((_=e.customFeilds)!=null&&_.length){let w=bt(e.customFeilds,"INSTRUCTION","customType");w!=null&&w.customValue&&(d=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,M)=>{var ve,W,le;let F=T.station?T.station.split("::"):"",O=F&&F.length>1?F[1]:F[0],B=e.tableNo?e.tableNo.split("::"):null,K=B&&B.length>0?B[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,q;(ve=r==null?void 0:r[w.createdBy])!=null&&ve.name&&(q=r[w.createdBy].name);let he=!1;(y||O&&T.status==l)&&(he=!0),he&&ir(O)?(i[O]||(i[O]={},i[O].station=O,i[O].services=[],i[O].tableName=te,i[O].customerName=e.name==t.companyName?null:e.name,i[O].time=R().format("DD-MM-YYYY hh:mm a"),i[O].type=e.orderFrom,i[O].subOrderFrom=e.subOrderFrom,i[O].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[O].orderId=new Set([i[O].orderId]),i[O].instruction=e.instruction,i[O].orderSource=e.orderSource,i[O].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[O].aggregatorOrderId=e.externalOrderId,i[O].otp=e.otp,i[O].totalQty=0,i[O].tokenId=e.tokenId,i[O].kotId=T.kotId?new Set([T.kotId]):null,i[O].waiterName=e.waiterName,i[O].duplicate=y,i[O].createdBy=q,i[O].zomatoInstant=c,d&&(i[O].customFields=d),o&&(i[O].onlyCancelledItems=o),e.preparationTime&&(i[O].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[O]?(i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:w.subOrderId,isUrgent:T.isUrgent,index:M,status:T.status,addons:T.addons}),i[O].totalQty+=Se(T.qty),(W=i[O].kotId)==null||W.add(T.kotId),e.externalOrderId||e.offlineOrderId||(le=i[O].orderId)==null||le.add(w.subOrderId)):(console.log("else"),i[O]=[],i[O].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:w.subOrderId,index:M,status:T.status}),i[O].totalQty+=Se(T.qty))):console.log("cancelledKOT ::")})});let u={},m="2INCH";Jn();let f,x=[],b={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const T=i[w];try{t.printers&&t.printers.map(M=>{M.label.toUpperCase()==T.station.toUpperCase()&&(f=fs=="Android OS"?M:M.value??void 0,m=M.paperSize?M.paperSize:t.printerSize,x.push({printer:f,paperSize:m}))}),x.length==0&&x.push({printer:f,paperSize:t.printerSize||m});for(let M=0;M<T.services.length;M++){let F=T.services[M],O=e.orderList.find(K=>K.subOrderId==F.subOrderId),B=u[F.subOrderId];O&&(B?B.services.push(O.services[F.index]):(u[F.subOrderId]={},u[F.subOrderId].subOrderId=O.subOrderId,u[F.subOrderId].services=[O.services[F.index]]))}}catch(M){console.log(M)}b[w]=x,x=[],f=null}for(const w in u)Object.hasOwnProperty.call(u,w)&&u[w];return{obj:i,paperSize:m,printer:f,printersMap:b}},gd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let d="2INCH",y,o=[],l,c;const u=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let m=bt(e.customFeilds,"INSTRUCTION","customType");m!=null&&m.customValue&&(c=[{customName:m.customName,customValue:m.customValue}])}for(let m=0;m<t.packagingSlipPrinters.length;m++)if(l=t.packagingSlipPrinters[m],l.label==e.subOrderFrom&&(y=fs=="Android OS"?l:l.value??void 0,d=l.paperSize?l.paperSize:d,l.paperSize)){let f,x,b,_,w,T={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:R().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:u},M={},F=!1,O,B=0;for(e.preparationTime&&(T.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(T.customFields=c),b=0;b<e.orderList.length;b++)for(f=e.orderList[b],_=0;_<f.services.length;_++)x=f.services[_],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},F=!1,x.status===r&&((a=l.stations)!=null&&a.length?(O=id(l.stations),O[x.station]&&(F=!0)):F=!0),F&&x.kotId&&x.station&&(w=x.station.split("::")[1],B+=x.qty,M[`${w}/${x.kotId}`]?M[`${w}/${x.kotId}`].push(x):M[`${w}/${x.kotId}`]=[x]);Object.keys(M).length&&(T.services=M,T.totalQty=ft(B),o.push({printer:y,paperSize:d,obj:T}))}return{printers:o}}catch(d){console.log(d)}},xd=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let u=(c=l.station.split("::"))==null?void 0:c[1];u&&ir(u)&&(r[u]?r[u].activeKots[l.kotId]=l.kotId:r[u]={from:[n.from],to:[n.to],station:u,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,u,m={},f=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],f.push(o.tableNo),c=0;c<o.ids.length;c++)u=o.ids[c],m[u]=u;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],m[o.id]&&o.orderList.forEach(b=>{b.services.forEach(_=>{var w;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let T=(w=_.station.split("::"))==null?void 0:w[1];T&&ir(T)&&(r[T]?r[T].activeKots[_.kotId]=_.kotId:r[T]={from:f,to:[n.to],station:T,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,d=[],y={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?fs=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,d.push({printer:a,paperSize:i}))}),d.length==0&&d.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}y[o]=d,d=[],a=null}return{obj:r,paperSize:i,printersMap:y}},Nd=(e,t)=>{var M,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d,rangeDate:y}=t;console.log(e,{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d});let o={},l;const c=!!bt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:O,...B}=i;i={...B,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let u=c&&(n==null?void 0:n.length)&&n.some(O=>O.slugName==="online-menu")&&e.isAggregatorEnabled==!0,m=u?r.aggregator_collection:void 0,f=u?r.zomato_collection:void 0,x=u?r.swiggy_collection:void 0,b=c?md(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const O=r.menuWiseSales;for(const B in O)B.endsWith("collection")?l[ts(B)]=ft(O[B]):l[ts(B)]=O[B]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((M=Object.keys(r.itemTypeList))!=null&&M.length))for(let O in r.itemTypeList)_+=r.itemTypeList[O];let w=d;return y.toDate!==y.fromDate&&(w=`${tr(y.fromDate)} - ${tr(y.toDate)}`),{salesCollection:c?{...r,totalCollection:ft(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:m,zomato_aggregator_collection:f,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:fd(i,e.paymentModes),totalCollection:ft(i.totalCollection),averageCollection:{avgTableTime:b,avgorderValue:pd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?ft(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?ft(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?ft(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:w,id:Math.random(),otherFields:{salesCollection:i.salesCollection?ft(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},jd=(e,t,n={})=>new Promise(async(r,i)=>{var m,f,x;console.log({order:e,settingData:t,additionalActions:n});const a=void 0,{invoiceFormat:d,userData:y}=n;let o,l,c=[],u;try{if((m=e.appliedDiscounts)!=null&&m.length){u=0;for(let V=0;V<e.appliedDiscounts.length;V++)o=e.appliedDiscounts[V],u+=o.discountAmt}const b=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const V=bt(e.customFeilds,"INSTRUCTION","customType");V!=null&&V.customValue&&(c=[{customName:V.customName,customValue:V.customValue}])}o={};let _=(x=t==null?void 0:t.footerAddress)!=null&&x.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(M!=""?M+",":""),O=t.gstNo,B={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},q={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},he=Js(t.curr),ve={...e,companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he},W=null,le=null;d.companyLogo&&(W=await zt(`https://${a}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(le=await zt(`https://${a}.s3.amazonaws.com/${d.qrcode.key}`)),e.orderList.filter(V=>{V.services.forEach(async(Z,Ce)=>{var nt,rt;let A="kitchen",yt=e.tableName?e.tableName:e.orderFrom;A&&(o[A]||(o[A]={},o[A].station=A,o[A].services=[],o[A].tableName=yt,o[A].customerName=e.name,o[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),o[A].type=e.orderFrom,o[A].orderId=e.orderId,o[A].instruction=e.instruction,o[A].totalQty=0,o[A].tokenId=e.tokenId,o[A].orderSource=e.orderSource,o[A].aggregatorOrderId=e.externalOrderId,o[A].otp=e.otp,o[A].paymentState=e.paymentState,o[A].discountAmt=u,o[A].otherCharges=e.otherCharges,o[A].taxAmt=e.taxAmt,o[A].customFeilds=c,o[A].curr=t.curr??"INR",o[A].zomatoInstant=b),o[A]?(l={serviceName:Z.serviceName,qty:Z.qty,instruction:Z.isUrgent&&Z.instruction?`(URGENT -${Z.instruction})`:Z.instruction?`(${Z.instruction})`:Z.isUrgent?"(URGENT)":"",subOrderId:V.subOrderId,isUrgent:Z.isUrgent,index:Ce},(nt=Z.addons)!=null&&nt.length&&(l.addons=Z.addons),o[A].services.push(l),o[A].totalQty+=Z.qty):(o[A]=[],o[A].services.push({serviceName:Z.serviceName,qty:Z.qty,instruction:Z.instruction?Z.instruction:"",subOrderId:V.subOrderId,index:Ce}),o[A].totalQty+=Z.qty),o[A]={...o[A],companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he},o[A].domain=d.siteURL,o[A].paymentMethods=d.paymentMode?ve.paymentMethods:null,o[A].companyInfo.companyName=d.companyName,o[A].companyInfo.companyEmail=d.email,o[A].companyInfo.companyAddress=d.address,o[A].companyInfo.companyContact=d.mobile,o[A].tokenId=d.token?ve.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(ve.upiId=d.upiId),o[A].gstNo=d.gst?ve.gst:null,o[A].footerMessage=d.footerMessage,o[A].orderFrom=(rt=e.subOrderFrom)==null?void 0:rt.toUpperCase(),o[A].fssai=t.fssai,o[A].vatNo=t.vatNo,o[A].printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,o[A].disabledPoweredBy=t.disabledPoweredBy===!0,o[A].printTime=R().format("DD-MM-YYYY hh:mm A"),o[A].printedBy=y.userRole=="admin"?"Admin":y.name,e.deliveryTimestamp&&(o[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),o[A].itemInstructionOnBill=d.itemInstructionOnBill,o[A]={...o[A],companyLogo:W,companyQrCode:le})})});for(const V in o)if(Object.hasOwnProperty.call(o,V)){const Z=o[V];try{let Ce=t.printerSize??"2inch";r(new Object({obj:new Object({...Z,paperSize:Ce}),orderList:e.orderList}));return}catch(Ce){console.log(Ce)}}}catch(b){console.log("err::",b)}}),vd=async e=>{let t=[];for(let u=0;u<e.length;u++)for(let m=0;m<e[u].orderList.length;m++)t.push(e[u].orderList[m]);let n=[];if(t.length>0)for(let u=0;u<t.length;u++)for(let m=0;m<t[u].services.length;m++)t[u].services[m].status!="CANCELLED"&&t[u].services[m].status!="RETURNED"&&t[u].services[m].status!="SHIFTED"&&n.push(t[u].services[m]);let r={},i=[];for(let u=0;u<n.length;u++)if(n[u].addons&&n[u].addons.length>0)for(let m=0;m<n[u].addons.length;m++){let f={...n[u].addons[m]};f.qty=n[u].qty,i.push(f)}n.forEach(u=>{let{attachedCat:m,serviceId:f}=u;r[m]||(r[m]=[]);let x=r[m].findIndex(b=>b.serviceId===f);x!==-1?r[m][x].qty=r[m][x].qty+u.qty:r[m].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedCat,station:u.station})});const a=Object.keys(r).sort(),d={};a.forEach(u=>{d[u]=r[u]});for(let u in d)d[u].sort((m,f)=>m.serviceName.localeCompare(f.serviceName));let y={Category:d},o={};i.forEach(u=>{let{attachedAddonCat:m,serviceId:f}=u;o[m]||(o[m]=[]);let x=o[m].findIndex(b=>b.serviceId===f);x!==-1?o[m][x].qty=o[m][x].qty+u.qty:o[m].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedAddonCat,station:u.station})});const l=Object.keys(o).sort(),c={};l.forEach(u=>{c[u]=o[u]});for(let u in c)c[u].sort((m,f)=>m.serviceName.localeCompare(f.serviceName));return y.Addon=c,y},ya={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},ga=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ya[t]?ya[t]:"SGST"},xa=(e,t,n={})=>new Promise(async(r,i)=>{var d,y,o,l,c,u;try{const{invoiceFormat:m,custName:f,custMobile:x,custAddress:b,userData:_={}}=n,{itemList:w}=e,T=void 0;let M=_==null?void 0:_.userRole;if(_.userRole=="admin"?M="ADMIN":M=_==null?void 0:_.name,!(w!=null&&w.length))return;let F=t.printerSize,O=ar(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});F=O?(d=O[0])!=null&&d.paperSize?(y=O[0])==null?void 0:y.paperSize:F||"2INCH":F;let B=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",K=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",te=t.footerAddress.city?t.footerAddress.city:"",q=t.footerAddress.zip?t.footerAddress.zip:"",he=(B!=""?B+",":"")+(K!=""?K+",":"")+(te!=""?te+",":"")+(q!=""?q+",":""),ve=t.gstNo,W={companyName:t.companyName,companyAddress:he,companyContact:t.contactNumber,companyEmail:t.contactEmail},V={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},Z={custName:m&&m.custName?f==t.companyName?null:f:null,custAddress:m&&m.custAddress&&b||null,custContact:m&&m.custMobile?x:null,custEmail:"ajaybaglane7@gmail.com"},Ce=Js(t.curr),A={...e,companyInfo:W,orderInfo:V,customerInfo:Z,gst:ve,curr:Ce};if(m){if(A.domain=m.siteURL,A.paymentMethods=m.paymentMode?A.paymentMethods:null,A.companyInfo.companyName=m.companyName,A.companyInfo.companyEmail=m.email,A.companyInfo.companyAddress=m.address,A.companyInfo.companyContact=m.mobile,A.customerInfo.custName=m.custName?f:null,A.tokenId=m.token?A.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(A.upiId=m.upiId),A.gstNo=m.gst?A.gst:null,A.footerMessage=m.footerMessage,A.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),A.fssai=t.fssai,A.vatNo=t.vatNo,A.taxLabel=ga(t),A.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,A.disabledPoweredBy=t.disabledPoweredBy===!0,A.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(A.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),A.itemInstructionOnBill=m.itemInstructionOnBill,A.noOfInvoice=m.noOfInvoice,A.printby=M,A.newFormat=!0,!m.itemInstructionOnBill&&A.itemList){let J;for(let _e=0;_e<A.itemList.length;_e++)J=A.itemList[_e],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let yt=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let _e=0;_e<e.customFeilds.length;_e++)J=e.customFeilds[_e],J!=null&&J.customValue&&((u=J.availability)!=null&&u.includes("BILL"))&&yt.push({customName:J.customName,customValue:J.customValue});A.customFields=yt}let nt=null,rt=null;m.companyLogo&&(nt=await zt(`https://${T}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(rt=await zt(`https://${T}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let Ze={};(function(){let J,_e,gt=0,g=0,h=0,I=0,j=0,C=0,D=0,S=0,k=[],$=[],fe=0,Ee;if(F==="A4"||F==="A5"){for(_e=0;_e<w.length;_e++)J=w[_e],g+=J.sub_total,h+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0),fe+=J.qty;let Pe=Xn(w,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr(w);Ze={itemList:nr(w,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er(w,"name"),taxation:Ae,subTotal:Se(g),afterDisc:Se(h),afterCharges:Se(I),total:Se(gt+$e),qty:fe}}else{for(_e=0;_e<w.length;_e++)J=w[_e],J.taxType==="VAT"?($.push(J),S+=J.sub_total,C+=J.afterdiscAmt,j+=J.afterdiscAmt+(J.total_charges??0),D+=J.afterdiscAmt+(J.total_charges??0)):(k.push(J),g+=J.sub_total,h+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0));if(k.length){let Pe=Xn(k,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr(k);Ze.GST={itemList:nr(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er(k,"name"),taxation:Ae,subTotal:Se(g),afterDisc:Se(h),afterCharges:Se(I),total:Se(gt+$e)}}if($.length){let Pe=Xn($,"discountName",{separateItemsDisc:!0});const Fe=sr(Pe);let{obj:Ae,sum:$e}=rr($);Ze.VAT={itemList:nr($,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:er($,"name"),taxation:Ae,subTotal:Se(S),afterDisc:Se(C),afterCharges:Se(j),total:Se(D+$e)}}}})(),console.log("distributedData :::",Ze),A.distributedData=Ze;let Tt={obj:A,companyLogo:nt,companyQrCode:rt,paperSize:t.printerSize,Name:a};console.log("obj1 :::",Tt),r(Tt)}}catch(m){console.log("err",m),i(m)}}),_d=(e,t,n={})=>new Promise(async(r,i)=>{var d,y,o,l;try{const{invoiceFormat:c,custName:u,custMobile:m,custAddress:f,orderData:x}=n,b=void 0;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(M!=""?M+",":""),O=t.gstNo,B={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:x&&x.timestamp?R.unix(x.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:x&&x.orderId?x.orderId:null,timestamp:x.timestamp},q={custName:c&&c.custName?u==t.companyName?null:u:null,custAddress:c&&c.custAddress&&f||null,custContact:c&&c.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},he=Js(t.curr),ve="",W={...e,companyInfo:B,orderInfo:te,customerInfo:q,gst:O,curr:he};if(c){if(W.domain=c.siteURL,W.paymentMethods=c.paymentMode?W.paymentMethods:null,W.companyInfo.companyName=c.companyName,W.companyInfo.companyEmail=c.email,W.companyInfo.companyAddress=c.address,W.companyInfo.companyContact=c.mobile,W.customerInfo.custName=c.custName?u:null,W.tokenId=c.token?W.tokenId:null,c.isPayQR&&c.upiId&&c.upiId!==""&&(W.upiId=c.upiId),W.gstNo=c.gst?W.gst:null,W.footerMessage=c.footerMessage,W.orderFrom=(d=x.subOrderFrom)==null?void 0:d.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ga(t),W.printOperatorInfo=c.printOperatorInfo===null||c.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=R().format("DD-MM-YYYY hh:mm A"),x.deliveryTimestamp&&(W.deliveryTimestamp=R.unix(x.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=c.itemInstructionOnBill,W.noOfInvoice=c.noOfInvoice,W.area=x.area,W.captainName=x.captainName,!c.itemInstructionOnBill&&W.itemList){let V;for(let Z=0;Z<W.itemList.length;Z++)V=W.itemList[Z],V.instruction&&delete V.instruction}t.enabledOutstandingOnPay&&((y=e.custoutStandingData)!=null&&y.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let le=[];if((o=x.customFeilds)!=null&&o.length){let V;for(let Z=0;Z<x.customFeilds.length;Z++)V=x.customFeilds[Z],V!=null&&V.customValue&&((l=V.availability)!=null&&l.includes("BILL"))&&le.push({customName:V.customName,customValue:V.customValue});W.customFields=le}if(t&&t.isOld&&t.isOld==!0){let V=null,Z=null;c.companyLogo&&(V=await zt(`https://${b}.s3.amazonaws.com/${c.companyLogo.key}`)),c.qrcode&&(Z=await zt(`https://${b}.s3.amazonaws.com/${c.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let Ce={obj:W,companyLogo:V,companyQrCode:Z,paperSize:t.printerSize,Name:a};r(Ce)}}}catch(c){console.log("err",c)}}),bd=(e,t)=>new Promise(async(n,r)=>{var M;console.log({orders:e,settingData:t});let i;(M=t.siteLogo)!=null&&M.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",d=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",y=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(d!=""?d+",":"")+(y!=""?y+",":"")+(o!=""?o+",":""),c=[],u,m=0,f=0,x=0,b=[],_,w;const T=Zs(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(u=e[F],c.push({date:u.date,orderId:u.orderId,finalAmount:u.finalAmount}),m+=u.finalAmount,f+=u.paidAmt,x+=u.balanceAmt,_=0;_<u.orderTransactions.length;_++)w=u.orderTransactions[_],w.paidAmt&&b.push({date:R.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:T[w.paymentMode].displayName,amount:Se(w.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:m,totalPaid:f,totalPayable:x,paperSize:t.printerSize,curr:Js(t.curr),transactions:b})}),Sd=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await xa({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await _d(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),console.log("resp :::",i),t(i)}),Na=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},ir=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(d=>d.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Td(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const wd=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function St(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function ja(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=St(window.getComputedStyle(document.documentElement)),Gt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Id(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function Cd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function va(e,t={}){const n=t.width||Id(e),r=t.height||Cd(e);return{width:n,height:r}}function Od(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Ue=16384;function Md(e){(e.width>Ue||e.height>Ue)&&(e.width>Ue&&e.height>Ue?e.width>e.height?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue):e.width>Ue?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Ad(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ed(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Ad(i)}const Le=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Le(n,t)};function Rd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function kd(e,t){return ja(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function Ld(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Rd(n):kd(n,r);return document.createTextNode(`${i}{${a}}`)}function _a(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=wd();try{t.className=`${t.className} ${d}`}catch{return}const y=document.createElement("style");y.appendChild(Ld(d,n,i,r)),t.appendChild(y)}function Pd(e,t,n){_a(e,t,":before",n),_a(e,t,":after",n)}const ba="application/font-woff",Sa="image/jpeg",Fd={woff:ba,woff2:ba,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Sa,jpeg:Sa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Dd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function lr(e){const t=Dd(e).toLowerCase();return Fd[t]||""}function Yd(e){return e.split(/,/)[1]}function or(e){return e.search(/^(data:)/)!==-1}function Ud(e,t){return`data:${t};base64,${e}`}async function Ta(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,d)=>{const y=new FileReader;y.onerror=d,y.onloadend=()=>{try{a(n({res:r,result:y.result}))}catch(o){d(o)}},y.readAsDataURL(i)})}const cr={};function $d(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function dr(e,t,n){const r=$d(e,t,n.includeQueryParams);if(cr[r]!=null)return cr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ta(e,n.fetchRequestInit,({res:d,result:y})=>(t||(t=d.headers.get("Content-Type")||""),Yd(y)));i=Ud(a,t)}catch(a){i=n.imagePlaceholder||"";let d=`Failed to fetch resource: ${e}`;a&&(d=typeof a=="string"?a:a.message),d&&console.warn(d)}return cr[r]=i,i}async function Hd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Bd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),d=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,d==null||d.drawImage(e,0,0,a.width,a.height);const y=a.toDataURL();return sn(y)}const n=e.poster,r=lr(n),i=await dr(n,r,t);return sn(i)}async function Wd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function zd(e,t){return Le(e,HTMLCanvasElement)?Hd(e):Le(e,HTMLVideoElement)?Bd(e,t):Le(e,HTMLIFrameElement)?Wd(e,t):e.cloneNode(wa(e))}const Gd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",wa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Vd(e,t,n){var r,i;if(wa(t))return t;let a=[];return Gd(e)&&e.assignedNodes?a=St(e.assignedNodes()):Le(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=St(e.contentDocument.body.childNodes):a=St(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Le(e,HTMLVideoElement)||await a.reduce((d,y)=>d.then(()=>nn(y,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function qd(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):ja(n).forEach(a=>{let d=i.getPropertyValue(a);a==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),Le(e,HTMLIFrameElement)&&a==="display"&&d==="inline"&&(d="block"),a==="d"&&t.getAttribute("d")&&(d=`path(${t.getAttribute("d")})`),r.setProperty(a,d,i.getPropertyPriority(a))})}function Kd(e,t){Le(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Le(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Qd(e,t){if(Le(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function Zd(e,t,n){return Le(t,Element)&&(qd(e,t,n),Pd(e,t,n),Kd(e,t),Qd(e,t)),t}async function Jd(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const y=n[a].getAttribute("xlink:href");if(y){const o=e.querySelector(y),l=document.querySelector(y);!o&&l&&!r[y]&&(r[y]=await nn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",d=document.createElementNS(a,"svg");d.setAttribute("xmlns",a),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const y=document.createElementNS(a,"defs");d.appendChild(y);for(let o=0;o<i.length;o++)y.appendChild(i[o]);e.appendChild(d)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>zd(r,t)).then(r=>Vd(e,r,t)).then(r=>Zd(e,r,t)).then(r=>Jd(r,t))}const Ia=/url\((['"]?)([^'"]+?)\1\)/g,Xd=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,eh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function th(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function sh(e){const t=[];return e.replace(Ia,(n,r,i)=>(t.push(i),n)),t.filter(n=>!or(n))}async function nh(e,t,n,r,i){try{const a=n?Td(t,n):t,d=lr(t);let y;return i||(y=await dr(a,d,r)),e.replace(th(t),`$1${y}$3`)}catch{}return e}function rh(e,{preferredFontFormat:t}){return t?e.replace(eh,n=>{for(;;){const[r,,i]=Xd.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ca(e){return e.search(Ia)!==-1}async function Oa(e,t,n){if(!Ca(e))return e;const r=rh(e,n);return sh(r).reduce((a,d)=>a.then(y=>nh(y,d,t,n)),Promise.resolve(r))}async function Vt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Oa(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function ah(e,t){await Vt("background",e,t)||await Vt("background-image",e,t),await Vt("mask",e,t)||await Vt("-webkit-mask",e,t)||await Vt("mask-image",e,t)||await Vt("-webkit-mask-image",e,t)}async function ih(e,t){const n=Le(e,HTMLImageElement);if(!(n&&!or(e.src))&&!(Le(e,SVGImageElement)&&!or(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dr(r,lr(r),t);await new Promise((a,d)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){d(l)}}:d;const y=e;y.decode&&(y.decode=a),y.loading==="lazy"&&(y.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function lh(e,t){const r=St(e.childNodes).map(i=>Ma(i,t));await Promise.all(r).then(()=>e)}async function Ma(e,t){Le(e,Element)&&(await ah(e,t),await ih(e,t),await lh(e,t))}function oh(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Aa={};async function Ea(e){let t=Aa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Aa[e]=t,t}async function Ra(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async d=>{let y=d.replace(r,"$1");return y.startsWith("https://")||(y=new URL(y,e.url).href),Ta(y,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function ka(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",y=new RegExp(d,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=y.exec(r),o===null)break;a.lastIndex=y.lastIndex}else y.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ch(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach((a,d)=>{if(a.type===CSSRule.IMPORT_RULE){let y=d+1;const o=a.href,l=Ea(o).then(c=>Ra(c,t)).then(c=>ka(c).forEach(u=>{try{i.insertRule(u,u.startsWith("@import")?y+=1:i.cssRules.length)}catch(m){console.error("Error inserting rule from remote css",{rule:u,error:m})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const d=e.find(y=>y.href==null)||document.styleSheets[0];i.href!=null&&r.push(Ea(i.href).then(y=>Ra(y,t)).then(y=>ka(y).forEach(o=>{d.insertRule(o,d.cssRules.length)})).catch(y=>{console.error("Error loading remote stylesheet",y)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function dh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ca(t.style.getPropertyValue("src")))}async function hh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=St(e.ownerDocument.styleSheets),r=await ch(n,t);return dh(r)}function La(e){return e.trim().replace(/["']/g,"")}function uh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(La(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function mh(e,t){const n=await hh(e,t),r=uh(e);return(await Promise.all(n.filter(a=>r.has(La(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oa(a.cssText,d,t)}))).join(`
40
40
  `)}async function fh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await mh(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Pa(e,t={}){const{width:n,height:r}=va(e,t),i=await nn(e,t,!0);return await fh(i,t),await Ma(i,t),oh(i,t),await Ed(i,n,r)}async function ph(e,t={}){const{width:n,height:r}=va(e,t),i=await Pa(e,t),a=await sn(i),d=document.createElement("canvas"),y=d.getContext("2d"),o=t.pixelRatio||Od(),l=t.canvasWidth||n,c=t.canvasHeight||r;return d.width=l*o,d.height=c*o,t.skipAutoScale||Md(d),d.style.width=`${l}`,d.style.height=`${c}`,t.backgroundColor&&(y.fillStyle=t.backgroundColor,y.fillRect(0,0,d.width,d.height)),y.drawImage(a,0,0,d.width,d.height),d}async function yh(e,t={}){return(await ph(e,t)).toDataURL("image/jpeg",t.quality||1)}var rn={exports:{}};/*! @preserve
41
41
  * numeral.js
42
42
  * version : 2.0.6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recaho-print-react",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"