recaho-print-react 0.0.125 → 0.0.126
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.
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var gr;function ti(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var e=Ne,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function _(y){if(y===null||typeof y!="object")return null;var N=x&&y[x]||y[v];return typeof N=="function"?N:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(y){{for(var N=arguments.length,P=new Array(N>1?N-1:0),V=1;V<N;V++)P[V-1]=arguments[V];O("error",y,P)}}function O(y,N,P){{var V=w.ReactDebugCurrentFrame,oe=V.getStackAddendum();oe!==""&&(N+="%s",P=P.concat([oe]));var he=P.map(function(ie){return String(ie)});he.unshift("Warning: "+N),Function.prototype.apply.call(console[y],console,he)}}var F=!1,M=!1,
|
|
17
|
+
*/var gr;function ti(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var e=Ne,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function _(y){if(y===null||typeof y!="object")return null;var N=x&&y[x]||y[v];return typeof N=="function"?N:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(y){{for(var N=arguments.length,P=new Array(N>1?N-1:0),V=1;V<N;V++)P[V-1]=arguments[V];O("error",y,P)}}function O(y,N,P){{var V=w.ReactDebugCurrentFrame,oe=V.getStackAddendum();oe!==""&&(N+="%s",P=P.concat([oe]));var he=P.map(function(ie){return String(ie)});he.unshift("Warning: "+N),Function.prototype.apply.call(console[y],console,he)}}var F=!1,M=!1,z=!1,K=!1,te=!1,Q;Q=Symbol.for("react.module.reference");function ae(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===a||te||y===i||y===l||y===c||K||y===p||F||M||z||typeof y=="object"&&y!==null&&(y.$$typeof===m||y.$$typeof===d||y.$$typeof===h||y.$$typeof===f||y.$$typeof===o||y.$$typeof===Q||y.getModuleId!==void 0))}function Ce(y,N,P){var V=y.displayName;if(V)return V;var oe=N.displayName||N.name||"";return oe!==""?P+"("+oe+")":P}function W(y){return y.displayName||"Context"}function q(y){if(y==null)return null;if(typeof y.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case f:var N=y;return W(N)+".Consumer";case h:var P=y;return W(P._context)+".Provider";case o:return Ce(y,y.render,"ForwardRef");case d:var V=y.displayName||null;return V!==null?V:q(y.type)||"Memo";case m:{var oe=y,he=oe._payload,ie=oe._init;try{return q(ie(he))}catch{return null}}}return null}var B=Object.assign,me=0,A,Be,st,nt,pt,Mt,J;function je(){}je.__reactDisabledLog=!0;function yt(){{if(me===0){A=console.log,Be=console.info,st=console.warn,nt=console.error,pt=console.group,Mt=console.groupCollapsed,J=console.groupEnd;var y={configurable:!0,enumerable:!0,value:je,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}me++}}function gt(){{if(me--,me===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},y,{value:A}),info:B({},y,{value:Be}),warn:B({},y,{value:st}),error:B({},y,{value:nt}),group:B({},y,{value:pt}),groupCollapsed:B({},y,{value:Mt}),groupEnd:B({},y,{value:J})})}me<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var g=w.ReactCurrentDispatcher,u;function C(y,N,P){{if(u===void 0)try{throw Error()}catch(oe){var V=oe.stack.trim().match(/\n( *(at )?)/);u=V&&V[1]||""}return`
|
|
18
18
|
`+u+y}}var j=!1,I;{var D=typeof WeakMap=="function"?WeakMap:Map;I=new D}function S(y,N){if(!y||j)return"";{var P=I.get(y);if(P!==void 0)return P}var V;j=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var he;he=g.current,g.current=null,yt();try{if(N){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Fe){V=Fe}Reflect.construct(y,[],ie)}else{try{ie.call()}catch(Fe){V=Fe}y.call(ie.prototype)}}else{try{throw Error()}catch(Fe){V=Fe}y()}}catch(Fe){if(Fe&&V&&typeof Fe.stack=="string"){for(var ne=Fe.stack.split(`
|
|
19
19
|
`),Ee=V.stack.split(`
|
|
20
20
|
`),be=ne.length-1,we=Ee.length-1;be>=1&&we>=0&&ne[be]!==Ee[we];)we--;for(;be>=1&&we>=0;be--,we--)if(ne[be]!==Ee[we]){if(be!==1||we!==1)do if(be--,we--,we<0||ne[be]!==Ee[we]){var We=`
|
|
@@ -42,13 +42,13 @@ R.version="2.30.1",ii(ge),R.fn=E,R.min=ql,R.max=Kl,R.now=Ql,R.utc=Qe,R.unix=Tc,R
|
|
|
42
42
|
* author : Adam Draper
|
|
43
43
|
* license : MIT
|
|
44
44
|
* http://adamwdraper.github.com/Numeral-js/
|
|
45
|
-
*/var cd=Js.exports,ga;function dd(){return ga||(ga=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(cd,function(){var t,n,r="2.0.6",i={},a={},h={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:h.currentLocale,zeroFormat:h.zeroFormat,nullFormat:h.nullFormat,defaultFormat:h.defaultFormat,scalePercentBy100:h.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,d,m,p;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(d in i)if(p=typeof i[d].regexps.unformat=="function"?i[d].regexps.unformat():i[d].regexps.unformat,p&&l.match(p)){m=i[d].unformat;break}m=m||t._.stringToNumber,c=m(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,d){var m=a[t.options.currentLocale],p=!1,x=!1,v=0,_="",w=1e12,T=1e9,O=1e6,F=1e3,M="",W=!1,K,te,Q,ae,Ce,z,q;if(l=l||0,te=Math.abs(l),t._.includes(c,"(")?(p=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Ce=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(K=c.match(/a(k|m|b|t)?/),K=K?K[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),te>=w&&!K||K==="t"?(_+=m.abbreviations.trillion,l=l/w):te<w&&te>=T&&!K||K==="b"?(_+=m.abbreviations.billion,l=l/T):te<T&&te>=O&&!K||K==="m"?(_+=m.abbreviations.million,l=l/O):(te<O&&te>=F&&!K||K==="k")&&(_+=m.abbreviations.thousand,l=l/F)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),Q=l.toString().split(".")[0],ae=c.split(".")[1],z=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,ae?(t._.includes(ae,"[")?(ae=ae.replace("]",""),ae=ae.split("["),M=t._.toFixed(l,ae[0].length+ae[1].length,d,ae[1].length)):M=t._.toFixed(l,ae.length,d),Q=M.split(".")[0],t._.includes(M,".")?M=m.delimiters.decimal+M.split(".")[1]:M="",x&&Number(M.slice(1))===0&&(M="")):Q=t._.toFixed(l,0,d),_&&!K&&Number(Q)>=1e3&&_!==m.abbreviations.trillion)switch(Q=String(Number(Q)/1e3),_){case m.abbreviations.thousand:_=m.abbreviations.million;break;case m.abbreviations.million:_=m.abbreviations.billion;break;case m.abbreviations.billion:_=m.abbreviations.trillion;break}if(t._.includes(Q,"-")&&(Q=Q.slice(1),W=!0),Q.length<v)for(var B=v-Q.length;B>0;B--)Q="0"+Q;return z>-1&&(Q=Q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),c.indexOf(".")===0&&(Q=""),q=Q+M+(_||""),p?q=(p&&W?"(":"")+q+(p&&W?")":""):Ce>=0?q=Ce===0?(W?"-":"+")+q:q+(W?"-":"+"):W&&(q="-"+q),q},stringToNumber:function(l){var c=a[f.currentLocale],d=l,m={thousand:3,million:6,billion:9,trillion:12},p,x,v;if(f.zeroFormat&&l===f.zeroFormat)x=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(p in m)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[p]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),d.match(v)){x*=Math.pow(10,m[p]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,d){return l.slice(0,d)+c+l.slice(d)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var d=Object(l),m=d.length>>>0,p=0,x;if(arguments.length===3)x=arguments[2];else{for(;p<m&&!(p in d);)p++;if(p>=m)throw new TypeError("Reduce of empty array with no initial value");x=d[p++]}for(;p<m;p++)p in d&&(x=c(x,d[p],p,d));return x},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,d){var m=n.multiplier(d);return c>m?c:m},1)},toFixed:function(l,c,d,m){var p=l.toString().split("."),x=c-(m||0),v,_,w,T;return p.length===2?v=Math.min(Math.max(p[1].length,x),c):v=x,w=Math.pow(10,v),T=(d(l+"e+"+v)/w).toFixed(v),m>c-v&&(_=new RegExp("\\.?0{1,"+(m-(c-v))+"}$"),T=T.replace(_,"")),T}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in h)f[l]=h[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,d){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=d,d},t.validate=function(l,c){var d,m,p,x,v,_,w,T;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{w=t.localeData(c)}catch{w=t.localeData(t.locale())}return p=w.currency.symbol,v=w.abbreviations,d=w.delimiters.decimal,w.delimiters.thousands==="."?m="\\.":m=w.delimiters.thousands,T=l.match(/^[^\d]+/),T!==null&&(l=l.substr(1),T[0]!==p)||(T=l.match(/[^\d]+$/),T!==null&&(l=l.slice(0,-1),T[0]!==v.thousand&&T[0]!==v.million&&T[0]!==v.billion&&T[0]!==v.trillion))?!1:(_=new RegExp(m+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(d),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var d=this._value,m=l||f.defaultFormat,p,x,v;if(c=c||Math.round,d===0&&f.zeroFormat!==null)x=f.zeroFormat;else if(d===null&&f.nullFormat!==null)x=f.nullFormat;else{for(p in i)if(m.match(i[p].regexps.format)){v=i[p].format;break}v=v||t._.numberToFormat,x=v(d,m,c)}return x},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(m,p,x,v){return m+Math.round(c*p)}return this._value=n.reduce([this._value,l],d,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(m,p,x,v){return m-Math.round(c*p)}return this._value=n.reduce([l],d,Math.round(this._value*c))/c,this},multiply:function(l){function c(d,m,p,x){var v=n.correctionFactor(d,m);return Math.round(d*v)*Math.round(m*v)/Math.round(v*v)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(d,m,p,x){var v=n.correctionFactor(d,m);return Math.round(d*v)/Math.round(m*v)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,d){var m=t._.includes(c," BPS")?" ":"",p;return l=l*1e4,c=c.replace(/\s?BPS/,""),p=t._.numberToFormat(l,c,d),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"BPS"),p=p.join("")):p=p+m+"BPS",p},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},d=l.suffixes.concat(c.suffixes.filter(function(p){return l.suffixes.indexOf(p)<0})),m=d.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(p,x,v){var _,w=t._.includes(x,"ib")?c:l,T=t._.includes(x," b")||t._.includes(x," ib")?" ":"",O,F,M;for(x=x.replace(/\s?i?b/,""),O=0;O<=w.suffixes.length;O++)if(F=Math.pow(w.base,O),M=Math.pow(w.base,O+1),p===null||p===0||p>=F&&p<M){T+=w.suffixes[O],F>0&&(p=p/F);break}return _=t._.numberToFormat(p,x,v),_+T},unformat:function(p){var x=t._.stringToNumber(p),v,_;if(x){for(v=l.suffixes.length-1;v>=0;v--){if(t._.includes(p,l.suffixes[v])){_=Math.pow(l.base,v);break}if(t._.includes(p,c.suffixes[v])){_=Math.pow(c.base,v);break}}x*=_||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,d){var m=t.locales[t.options.currentLocale],p={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,v,_;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,d),l>=0?(p.before=p.before.replace(/[\-\(]/,""),p.after=p.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(p.before,"-")&&!t._.includes(p.before,"(")&&(p.before="-"+p.before),_=0;_<p.before.length;_++)switch(v=p.before[_],v){case"$":x=t._.insert(x,m.currency.symbol,_);break;case" ":x=t._.insert(x," ",_+m.currency.symbol.length-1);break}for(_=p.after.length-1;_>=0;_--)switch(v=p.after[_],v){case"$":x=_===p.after.length-1?x+m.currency.symbol:t._.insert(x,m.currency.symbol,-(p.after.length-(1+_)));break;case" ":x=_===p.after.length-1?x+" ":t._.insert(x," ",-(p.after.length-(1+_)+m.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,d){var m,p=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=p.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(x[0]),c,d),m+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),d=Number(c[0]),m=Number(c[1]);m=t._.includes(l,"e-")?m*=-1:m;function p(x,v,_,w){var T=t._.correctionFactor(x,v),O=x*T*(v*T)/(T*T);return O}return t._.reduce([d,Math.pow(10,m)],p,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,d){var m=t.locales[t.options.currentLocale],p,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=m.ordinal(l),p=t._.numberToFormat(l,c,d),p+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,d){var m=t._.includes(c," %")?" ":"",p;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),p=t._.numberToFormat(l,c,d),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"%"),p=p.join("")):p=p+m+"%",p},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,d){var m=Math.floor(l/60/60),p=Math.floor((l-m*60*60)/60),x=Math.round(l-m*60*60-p*60);return m+":"+(p<10?"0"+p:p)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),d=0;return c.length===3?(d=d+Number(c[0])*60*60,d=d+Number(c[1])*60,d=d+Number(c[2])):c.length===2&&(d=d+Number(c[0])*60,d=d+Number(c[1])),Number(d)}})}(),t})}(Js)),Js.exports}var hd=dd();const Xs=pr(hd),_e=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),ud={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:et},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:_e}},xa=(e,t)=>{const n=ud[`_${tn[t].minimumFractionDigits??2}`].roundUpto;return n(e)},en=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",tn={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 md(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Xs(e).format("0,00.000");default:return Xs(e).format("0,00.00")}}function fd(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 p=m%10,x=Math.floor(m/10);return`${r[x]}${p?" "+t[p]:""}`}}function a(m){var p=m.toString(),x,v,_,w,T,O,F,M,W,K,te,Q,ae="and";if(p=p.replace(/[, ]/g,""),parseInt(p)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","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=p.length,O=[];w>0;)T=w,O.push(p.slice(w=Math.max(0,w-3),T));if(F=O.length,F>_.length)return"";for(Q=[],K=0;K<F;K++)M=parseInt(O[K]),M&&(W=O[K].split("").reverse().map(parseFloat),W[1]===1&&(W[0]+=10),(te=_[K])&&Q.push(te),(te=x[W[0]])&&Q.push(te),(te=v[W[1]])&&Q.push(te),(W[0]||W[1])&&(W[2]||K+1>F)&&Q.push(ae),(te=x[W[2]])&&Q.push(te+" Hundred"));return Q.reverse().join(" ")}const[h,f]=e.toString().split("."),o=a(parseInt(h,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const le=(e,t)=>`${tn[t].symbol} ${xa(e||0,t)}`,U=(e,t)=>`${tn[t].symbol} ${md(e||0,t)}`,Xn=()=>{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},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),er=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(h=>{var f;(f=h.discounts)==null||f.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:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},tr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(h=>{const f=`${h[t]}`;n[f]?(n[f].amt+=h.amt,n[f].taxAmt+=h.taxAmt):n[f]={amt:h.amt,chargeType:h.chargeType?h.chargeType:h.type,defaultSelcted:h.defaultSelcted,rate:h.rate,tax:h.tax,taxAmt:h.taxAmt,name:h.name,type:h.type}})}),Object.values(n)},sr=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 fs(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 yd(e,t,n,r,i){const a=fs("1",e),h=fs("2",t),f=fs("3",n),o=fs("4",r),l=fs("5",i);var c=Buffer.concat([a,h,f,o,l]);return c.toString("base64")}const gd=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"}),xd=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},ps=Xn(),Nd=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),h=Math.floor(t%3600/60),f=`${a} hr ${h} min`;return f}else return r},jd=(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=ms(i,"internalName");let h;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(h=a[f],n.push({displayName:h?h.displayName:Ke(f.replace("_"," ")),value:et(e.paymentModes[f])}));return n},vd=(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 h=i.toDataURL("image/png");t(h)},r.onerror=i=>{t(null)}}catch{t(null)}})}const sn=(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!0},nr=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},rr=(e,t)=>{var c,d,m,p;let n,r,i,a,h;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let x=0;x<e.length;x++)if(n=e[x],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],h=0;h<n.addons.length;h++)a=n.addons[h],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(d=f[r].addons)!=null&&d.length&&((m=n.addons)!=null&&m.length)){const v=ms(n.addons,"serviceId"),_=[];let w;for(let T=0;T<f[r].addons.length;T++)a=f[r].addons[T],(p=v[a.serviceId])!=null&&p.serviceId&&(w=v[a.serviceId],a.sub_total+=w.sub_total??0),_.push(a);f[r].addons=_}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},ar=e=>{var f;let t,n,r,i,a={},h=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.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),h+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),h+=r.taxAmt);return{obj:Object.values(a),sum:h}},ir=(e,t,n)=>{var a,h,f,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 sn((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=sn((h=t.siteSetting)==null?void 0:h.packagingSlipPrinters,i,"value");if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.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 sn((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=sn((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var _;const{usersObj:r}=n;let i={},a,h;const{cancelledKOT:f,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&&(h=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,O)=>{var Ce,z,q;let F=T.station?T.station.split("::"):"",M=F&&F.length>1?F[1]:F[0],W=e.tableNo?e.tableNo.split("::"):null,K=W&&W.length>0?W[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,Q;(Ce=r==null?void 0:r[w.createdBy])!=null&&Ce.name&&(Q=r[w.createdBy].name);let ae=!1;(f||M&&T.status==l)&&(ae=!0),ae&&lr(M)&&(i[M]||(i[M]={},i[M].station=M,i[M].services=[],i[M].tableName=te,i[M].customerName=e.name==t.companyName?null:e.name,i[M].time=R().format("DD-MM-YYYY hh:mm a"),i[M].type=e.orderFrom,i[M].subOrderFrom=e.subOrderFrom,i[M].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[M].orderId=new Set([i[M].orderId]),i[M].instruction=e.instruction,i[M].orderSource=e.orderSource,i[M].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[M].aggregatorOrderId=e.externalOrderId,i[M].otp=e.otp,i[M].totalQty=0,i[M].tokenId=e.tokenId,i[M].kotId=T.kotId?new Set([T.kotId]):null,i[M].waiterName=e.waiterName,i[M].duplicate=f,i[M].createdBy=Q,i[M].zomatoInstant=c,h&&(i[M].customFields=h),o&&(i[M].onlyCancelledItems=o),e.preparationTime&&(i[M].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[M]?(i[M].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:O,status:T.status,addons:T.addons}),i[M].totalQty+=_e(T.qty),(z=i[M].kotId)==null||z.add(T.kotId),e.externalOrderId||e.offlineOrderId||(q=i[M].orderId)==null||q.add(w.subOrderId)):(i[M]=[],i[M].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:w.subOrderId,index:O,status:T.status}),i[M].totalQty+=_e(T.qty)))})});let d={},m="2INCH";Xn();let p,x=[],v={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const T=i[w];try{t.printers&&t.printers.map(O=>{O.label.toUpperCase()==T.station.toUpperCase()&&(p=ps=="Android OS"?O:O.value??void 0,m=O.paperSize?O.paperSize:t.printerSize,x.push({printer:p,paperSize:m}))}),x.length==0&&x.push({printer:p,paperSize:t.printerSize||m});for(let O=0;O<T.services.length;O++){let F=T.services[O],M=e.orderList.find(K=>K.subOrderId==F.subOrderId),W=d[F.subOrderId];M&&(W?W.services.push(M.services[F.index]):(d[F.subOrderId]={},d[F.subOrderId].subOrderId=M.subOrderId,d[F.subOrderId].services=[M.services[F.index]]))}}catch(O){console.log(O)}v[w]=x,x=[],p=null}for(const w in d)Object.hasOwnProperty.call(d,w)&&d[w];return{obj:i,paperSize:m,printer:p,printersMap:v}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let h="2INCH",f,o=[],l,c;const d=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&&(f=ps=="Android OS"?l:l.value??void 0,h=l.paperSize?l.paperSize:h,l.paperSize)){let p,x,v,_,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:d},O={},F=!1,M,W=0;for(e.preparationTime&&(T.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(T.customFields=c),v=0;v<e.orderList.length;v++)for(p=e.orderList[v],_=0;_<p.services.length;_++)x=p.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?(M=ld(l.stations),M[x.station]&&(F=!0)):F=!0),F&&x.kotId&&x.station&&(w=x.station.split("::")[1],W+=x.qty,O[`${w}/${x.kotId}`]?O[`${w}/${x.kotId}`].push(x):O[`${w}/${x.kotId}`]=[x]);Object.keys(O).length&&(T.services=O,T.totalQty=et(W),o.push({printer:f,paperSize:h,obj:T}))}return{printers:o}}catch(h){console.log(h)}},Sd=(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 d=(c=l.station.split("::"))==null?void 0:c[1];d&&lr(d)&&(r[d]?r[d].activeKots[l.kotId]=l.kotId:r[d]={from:[n.from],to:[n.to],station:d,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,d,m={},p=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],p.push(o.tableNo),c=0;c<o.ids.length;c++)d=o.ids[c],m[d]=d;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],m[o.id]&&o.orderList.forEach(v=>{v.services.forEach(_=>{var w;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let T=(w=_.station.split("::"))==null?void 0:w[1];T&&lr(T)&&(r[T]?r[T].activeKots[_.kotId]=_.kotId:r[T]={from:p,to:[n.to],station:T,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,h=[],f={};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?ps=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,h.push({printer:a,paperSize:i}))}),h.length==0&&h.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=h,h=[],a=null}return{obj:r,paperSize:i,printersMap:f}},Td=(e,t)=>{var O,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:h,rangeDate:f}=t,o={},l;const c=!!bt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:M,...W}=i;i={...W,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let d=c&&(n==null?void 0:n.length)&&n.some(M=>M.slugName==="online-menu")&&e.isAggregatorEnabled==!0,m=d?r.aggregator_collection:void 0,p=d?r.zomato_collection:void 0,x=d?r.swiggy_collection:void 0,v=c?Nd(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const M=r.menuWiseSales;for(const W in M)W.endsWith("collection")?l[ts(W)]=et(M[W]):l[ts(W)]=M[W]}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&&((O=Object.keys(r.itemTypeList))!=null&&O.length))for(let M in r.itemTypeList)_+=r.itemTypeList[M];let w=h;return f.toDate!==f.fromDate&&(w=`${sr(f.fromDate)} - ${sr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:et(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:p,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?et(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?et(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?et(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?et(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}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var d,m,p;const{invoiceFormat:a,userData:h}=n;let f,o,l=[],c;try{if((d=e.appliedDiscounts)!=null&&d.length){c=0;for(let q=0;q<e.appliedDiscounts.length;q++)f=e.appliedDiscounts[q],c+=f.discountAmt}const x=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((m=e.customFeilds)!=null&&m.length){const q=bt(e.customFeilds,"INSTRUCTION","customType");q!=null&&q.customValue&&(l=[{customName:q.customName,customValue:q.customValue}])}f={};let v=(p=t==null?void 0:t.footerAddress)!=null&&p.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",O=(v!=""?v+",":"")+(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":""),F=t.gstNo,M={companyName:t.companyName,companyAddress:O,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={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},te={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},Q=en(t.curr),ae={...e,companyInfo:M,orderInfo:K,customerInfo:te,gst:F,curr:Q},Ce=null,z=null;a.companyLogo&&(Ce=await zt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(z=await zt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(q=>{q.services.forEach(async(B,me)=>{var st,nt;let A="kitchen",Be=e.tableName?e.tableName:e.orderFrom;A&&(f[A]||(f[A]={},f[A].station=A,f[A].services=[],f[A].tableName=Be,f[A].customerName=e.name,f[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[A].type=e.orderFrom,f[A].orderId=e.orderId,f[A].instruction=e.instruction,f[A].totalQty=0,f[A].tokenId=e.tokenId,f[A].orderSource=e.orderSource,f[A].aggregatorOrderId=e.externalOrderId,f[A].otp=e.otp,f[A].paymentState=e.paymentState,f[A].discountAmt=c,f[A].otherCharges=e.otherCharges,f[A].taxAmt=e.taxAmt,f[A].customFeilds=l,f[A].curr=t.curr??"INR",f[A].zomatoInstant=x),f[A]?(o={serviceName:B.serviceName,qty:B.qty,instruction:B.isUrgent&&B.instruction?`(URGENT -${B.instruction})`:B.instruction?`(${B.instruction})`:B.isUrgent?"(URGENT)":"",subOrderId:q.subOrderId,isUrgent:B.isUrgent,index:me},(st=B.addons)!=null&&st.length&&(o.addons=B.addons),f[A].services.push(o),f[A].totalQty+=B.qty):(f[A]=[],f[A].services.push({serviceName:B.serviceName,qty:B.qty,instruction:B.instruction?B.instruction:"",subOrderId:q.subOrderId,index:me}),f[A].totalQty+=B.qty),f[A]={...f[A],companyInfo:M,orderInfo:K,customerInfo:te,gst:F,curr:Q},f[A].domain=a.siteURL,f[A].paymentMethods=a.paymentMode?ae.paymentMethods:null,f[A].companyInfo.companyName=a.companyName,f[A].companyInfo.companyEmail=a.email,f[A].companyInfo.companyAddress=a.address,f[A].companyInfo.companyContact=a.mobile,f[A].tokenId=a.token?ae.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(ae.upiId=a.upiId),f[A].gstNo=a.gst?ae.gst:null,f[A].footerMessage=a.footerMessage,f[A].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),f[A].fssai=t.fssai,f[A].vatNo=t.vatNo,f[A].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[A].disabledPoweredBy=t.disabledPoweredBy===!0,f[A].printTime=R().format("DD-MM-YYYY hh:mm A"),f[A].printedBy=h.userRole=="admin"?"Admin":h.name,e.deliveryTimestamp&&(f[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[A].itemInstructionOnBill=a.itemInstructionOnBill,f[A]={...f[A],companyLogo:Ce,companyQrCode:z})})});for(const q in f)if(Object.hasOwnProperty.call(f,q)){const B=f[q];try{let me=t.printerSize??"2inch";r(new Object({obj:new Object({...B,paperSize:me}),orderList:e.orderList}));return}catch(me){console.log(me)}}}catch(x){console.log("err::",x)}}),Id=async e=>{let t=[];for(let d=0;d<e.length;d++)for(let m=0;m<e[d].orderList.length;m++)t.push(e[d].orderList[m]);let n=[];if(t.length>0)for(let d=0;d<t.length;d++)for(let m=0;m<t[d].services.length;m++)t[d].services[m].status!="CANCELLED"&&t[d].services[m].status!="RETURNED"&&t[d].services[m].status!="SHIFTED"&&n.push(t[d].services[m]);let r={},i=[];for(let d=0;d<n.length;d++)if(n[d].addons&&n[d].addons.length>0)for(let m=0;m<n[d].addons.length;m++){let p={...n[d].addons[m]};p.qty=n[d].qty,i.push(p)}n.forEach(d=>{let{attachedCat:m,serviceId:p}=d;r[m]||(r[m]=[]);let x=r[m].findIndex(v=>v.serviceId===p);x!==-1?r[m][x].qty=r[m][x].qty+d.qty:r[m].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedCat,station:d.station})});const a=Object.keys(r).sort(),h={};a.forEach(d=>{h[d]=r[d]});for(let d in h)h[d].sort((m,p)=>m.serviceName.localeCompare(p.serviceName));let f={Category:h},o={};i.forEach(d=>{let{attachedAddonCat:m,serviceId:p}=d;o[m]||(o[m]=[]);let x=o[m].findIndex(v=>v.serviceId===p);x!==-1?o[m][x].qty=o[m][x].qty+d.qty:o[m].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedAddonCat,station:d.station})});const l=Object.keys(o).sort(),c={};l.forEach(d=>{c[d]=o[d]});for(let d in c)c[d].sort((m,p)=>m.serviceName.localeCompare(p.serviceName));return f.Addon=c,f},Na={"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"},ja=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return Na[t]?Na[t]:"SGST"},va=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c,d;try{const{invoiceFormat:m,custName:p,custMobile:x,custAddress:v,userData:_={}}=n,{itemList:w}=e;let T=_==null?void 0:_.userRole;if(_.userRole=="admin"?T="ADMIN":T=_==null?void 0:_.name,!(w!=null&&w.length))return;let O=t.printerSize,F=ir(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});O=F?(h=F[0])!=null&&h.paperSize?(f=F[0])==null?void 0:f.paperSize:O||"2INCH":O;let M=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",W=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",K=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",Q=(M!=""?M+",":"")+(W!=""?W+",":"")+(K!=""?K+",":"")+(te!=""?te+",":""),ae=t.gstNo,Ce={companyName:t.companyName,companyAddress:Q,companyContact:t.contactNumber,companyEmail:t.contactEmail},q={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},B={custName:m&&m.custName?p==t.companyName?null:p:null,custAddress:m&&m.custAddress&&v||null,custContact:m&&m.custMobile?x:null,custEmail:"ajaybaglane7@gmail.com"},me=en(t.curr),A={...e,companyInfo:Ce,orderInfo:q,customerInfo:B,gst:ae,curr:me};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?p: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=ja(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=T,A.newFormat=!0,!m.itemInstructionOnBill&&A.itemList){let J;for(let je=0;je<A.itemList.length;je++)J=A.itemList[je],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let Be=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let je=0;je<e.customFeilds.length;je++)J=e.customFeilds[je],J!=null&&J.customValue&&((d=J.availability)!=null&&d.includes("BILL"))&&Be.push({customName:J.customName,customValue:J.customValue});A.customFields=Be}let st=null,nt=null;m.companyLogo&&(st=await zt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(nt=await zt(`https://${m.qrcode.bucket}.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 pt={};(function(){let J,je,yt=0,gt=0,g=0,u=0,C=0,j=0,I=0,D=0,S=[],k=[],$=0,pe;if(O==="A4"||O==="A5"){for(je=0;je<w.length;je++)J=w[je],gt+=J.sub_total,g+=J.afterdiscAmt,u+=J.afterdiscAmt+(J.total_charges??0),yt+=J.afterdiscAmt+(J.total_charges??0),$+=J.qty;let Te=er(w,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(w);pt={itemList:rr(w,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:tr(w,"name"),taxation:Pe,subTotal:_e(gt),afterDisc:_e(g),afterCharges:_e(u),total:_e(yt+Ae),qty:$}}else{for(je=0;je<w.length;je++)J=w[je],J.taxType==="VAT"?(k.push(J),D+=J.sub_total,j+=J.afterdiscAmt,C+=J.afterdiscAmt+(J.total_charges??0),I+=J.afterdiscAmt+(J.total_charges??0)):(S.push(J),gt+=J.sub_total,g+=J.afterdiscAmt,u+=J.afterdiscAmt+(J.total_charges??0),yt+=J.afterdiscAmt+(J.total_charges??0));if(S.length){let Te=er(S,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(S);pt.GST={itemList:rr(S,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:tr(S,"name"),taxation:Pe,subTotal:_e(gt),afterDisc:_e(g),afterCharges:_e(u),total:_e(yt+Ae)}}if(k.length){let Te=er(k,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(k);pt.VAT={itemList:rr(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:tr(k,"name"),taxation:Pe,subTotal:_e(D),afterDisc:_e(j),afterCharges:_e(C),total:_e(I+Ae)}}}})(),A.distributedData=pt;let Mt={obj:A,companyLogo:st,companyQrCode:nt,paperSize:t.printerSize,Name:a};r(Mt)}}catch(m){console.log("err",m),i(m)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c;try{const{invoiceFormat:d,custName:m,custMobile:p,custAddress:x,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",O=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(O!=""?O+",":""),M=t.gstNo,W={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?R.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},Q={custName:d&&d.custName?m==t.companyName?null:m:null,custAddress:d&&d.custAddress&&x||null,custContact:d&&d.custMobile?p:null,custEmail:"ajaybaglane7@gmail.com"},ae=en(t.curr),Ce="",z={...e,companyInfo:W,orderInfo:te,customerInfo:Q,gst:M,curr:ae};if(d){if(z.domain=d.siteURL,z.paymentMethods=d.paymentMode?z.paymentMethods:null,z.companyInfo.companyName=d.companyName,z.companyInfo.companyEmail=d.email,z.companyInfo.companyAddress=d.address,z.companyInfo.companyContact=d.mobile,z.customerInfo.custName=d.custName?m:null,z.tokenId=d.token?z.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(z.upiId=d.upiId),z.gstNo=d.gst?z.gst:null,z.footerMessage=d.footerMessage,z.orderFrom=(h=v.subOrderFrom)==null?void 0:h.toUpperCase(),z.fssai=t.fssai,z.vatNo=t.vatNo,z.taxLabel=ja(t),z.printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,z.disabledPoweredBy=t.disabledPoweredBy===!0,z.printTime=R().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(z.deliveryTimestamp=R.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),z.itemInstructionOnBill=d.itemInstructionOnBill,z.printHSNCodeOnBill=d.printHSNCodeOnBill,z.noOfInvoice=d.noOfInvoice,z.area=v.area,z.captainName=v.captainName,!(d.itemInstructionOnBill||d.printHSNCodeOnBill)&&((f=z.itemList)!=null&&f.length)){let B;for(let me=0;me<z.itemList.length;me++)B=z.itemList[me],B.instruction&&delete B.instruction,B.hsnCode&&delete B.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(z.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let q=[];if((l=v.customFeilds)!=null&&l.length){let B;for(let me=0;me<v.customFeilds.length;me++)B=v.customFeilds[me],B!=null&&B.customValue&&((c=B.availability)!=null&&c.includes("BILL"))&&q.push({customName:B.customName,customValue:B.customValue});z.customFields=q}if(t&&t.isOld&&t.isOld==!0){let B=null,me=null;d.companyLogo&&(B=await zt(`https://${d.companyLogo.bucket}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(me=await zt(`https://${d.qrcode.bucket}.s3.amazonaws.com/${d.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 A={obj:z,companyLogo:B,companyQrCode:me,paperSize:t.printerSize,Name:a};r(A)}}}catch(d){console.log("err",d)}}),Od=(e,t)=>new Promise(async(n,r)=>{var O;let i;(O=t.siteLogo)!=null&&O.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",h=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(h!=""?h+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],d,m=0,p=0,x=0,v=[],_,w;const T=ms(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(d=e[F],c.push({date:d.date,orderId:d.orderId,finalAmount:d.finalAmount}),m+=d.finalAmount,p+=d.paidAmt,x+=d.balanceAmt,_=0;_<d.orderTransactions.length;_++)w=d.orderTransactions[_],w.paidAmt&&v.push({date:R.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:T[w.paymentMode].displayName,amount:_e(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:p,totalPayable:x,paperSize:t.printerSize,curr:en(t.curr),transactions:v})}),Md=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 va({...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 Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),_a=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},lr=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(h=>h.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Ad(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 Ed=(()=>{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 ba(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=St(window.getComputedStyle(document.documentElement)),Gt))}function nn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=nn(e,"border-left-width"),n=nn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=nn(e,"border-top-width"),n=nn(e,"border-bottom-width");return e.clientHeight+t+n}function Sa(e,t={}){const n=t.width||Rd(e),r=t.height||kd(e);return{width:n,height:r}}function Ld(){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 Ye=16384;function Pd(e){(e.width>Ye||e.height>Ye)&&(e.width>Ye&&e.height>Ye?e.width>e.height?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye):e.width>Ye?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye))}function rn(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 Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(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),Fd(i)}const ke=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ke(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return ba(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function Ta(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const h=Ed();try{t.className=`${t.className} ${h}`}catch{return}const f=document.createElement("style");f.appendChild($d(h,n,i,r)),t.appendChild(f)}function Hd(e,t,n){Ta(e,t,":before",n),Ta(e,t,":after",n)}const wa="application/font-woff",Ia="image/jpeg",Bd={woff:wa,woff2:wa,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ia,jpeg:Ia,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function or(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function cr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Ca(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,h)=>{const f=new FileReader;f.onerror=h,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){h(o)}},f.readAsDataURL(i)})}const dr={};function Vd(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 hr(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(dr[r]!=null)return dr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ca(e,n.fetchRequestInit,({res:h,result:f})=>(t||(t=h.headers.get("Content-Type")||""),zd(f)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let h=`Failed to fetch resource: ${e}`;a&&(h=typeof a=="string"?a:a.message),h&&console.warn(h)}return dr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):rn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),h=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,h==null||h.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return rn(f)}const n=e.poster,r=or(n),i=await hr(n,r,t);return rn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await an(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return ke(e,HTMLCanvasElement)?qd(e):ke(e,HTMLVideoElement)?Kd(e,t):ke(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Oa(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Oa(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=St(e.assignedNodes()):ke(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||ke(e,HTMLVideoElement)||await a.reduce((h,f)=>h.then(()=>an(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(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):ba(n).forEach(a=>{let h=i.getPropertyValue(a);a==="font-size"&&h.endsWith("px")&&(h=`${Math.floor(parseFloat(h.substring(0,h.length-2)))-.1}px`),ke(e,HTMLIFrameElement)&&a==="display"&&h==="inline"&&(h="block"),a==="d"&&t.getAttribute("d")&&(h=`path(${t.getAttribute("d")})`),r.setProperty(a,h,i.getPropertyPriority(a))})}function th(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(ke(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return ke(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(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 f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await an(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",h=document.createElementNS(a,"svg");h.setAttribute("xmlns",a),h.style.position="absolute",h.style.width="0",h.style.height="0",h.style.overflow="hidden",h.style.display="none";const f=document.createElementNS(a,"defs");h.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(h)}return e}async function an(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Ma=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Ma,(n,r,i)=>(t.push(i),n)),t.filter(n=>!cr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,h=or(t);let f;return i||(f=await hr(a,h,r)),e.replace(lh(t),`$1${f}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Aa(e){return e.search(Ma)!==-1}async function Ea(e,t,n){if(!Aa(e))return e;const r=dh(e,n);return oh(r).reduce((a,h)=>a.then(f=>ch(f,h,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 Ea(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(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 uh(e,t){const n=ke(e,HTMLImageElement);if(!(n&&!cr(e.src))&&!(ke(e,SVGImageElement)&&!cr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await hr(r,or(r),t);await new Promise((a,h)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){h(l)}}:h;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=St(e.childNodes).map(i=>Ra(i,t));await Promise.all(r).then(()=>e)}async function Ra(e,t){ke(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(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 ka={};async function La(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Pa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async h=>{let f=h.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Ca(f,t.fetchRequestInit,({result:o})=>(n=n.replace(h,`url(${o})`),[h,o]))});return Promise.all(a).then(()=>n)}function Fa(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,h="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(h,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach((a,h)=>{if(a.type===CSSRule.IMPORT_RULE){let f=h+1;const o=a.href,l=La(o).then(c=>Pa(c,t)).then(c=>Fa(c).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?f+=1:i.cssRules.length)}catch(m){console.error("Error inserting rule from remote css",{rule:d,error:m})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const h=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(La(i.href).then(f=>Pa(f,t)).then(f=>Fa(f).forEach(o=>{h.insertRule(o,h.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),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 yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Aa(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=St(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Da(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Da(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Da(a.style.fontFamily))).map(a=>{const h=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ea(a.cssText,h,t)}))).join(`
|
|
45
|
+
*/var cd=Js.exports,ga;function dd(){return ga||(ga=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(cd,function(){var t,n,r="2.0.6",i={},a={},h={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:h.currentLocale,zeroFormat:h.zeroFormat,nullFormat:h.nullFormat,defaultFormat:h.defaultFormat,scalePercentBy100:h.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,d,m,p;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(d in i)if(p=typeof i[d].regexps.unformat=="function"?i[d].regexps.unformat():i[d].regexps.unformat,p&&l.match(p)){m=i[d].unformat;break}m=m||t._.stringToNumber,c=m(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,d){var m=a[t.options.currentLocale],p=!1,x=!1,v=0,_="",w=1e12,T=1e9,O=1e6,F=1e3,M="",z=!1,K,te,Q,ae,Ce,W,q;if(l=l||0,te=Math.abs(l),t._.includes(c,"(")?(p=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Ce=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(K=c.match(/a(k|m|b|t)?/),K=K?K[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),te>=w&&!K||K==="t"?(_+=m.abbreviations.trillion,l=l/w):te<w&&te>=T&&!K||K==="b"?(_+=m.abbreviations.billion,l=l/T):te<T&&te>=O&&!K||K==="m"?(_+=m.abbreviations.million,l=l/O):(te<O&&te>=F&&!K||K==="k")&&(_+=m.abbreviations.thousand,l=l/F)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),Q=l.toString().split(".")[0],ae=c.split(".")[1],W=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,ae?(t._.includes(ae,"[")?(ae=ae.replace("]",""),ae=ae.split("["),M=t._.toFixed(l,ae[0].length+ae[1].length,d,ae[1].length)):M=t._.toFixed(l,ae.length,d),Q=M.split(".")[0],t._.includes(M,".")?M=m.delimiters.decimal+M.split(".")[1]:M="",x&&Number(M.slice(1))===0&&(M="")):Q=t._.toFixed(l,0,d),_&&!K&&Number(Q)>=1e3&&_!==m.abbreviations.trillion)switch(Q=String(Number(Q)/1e3),_){case m.abbreviations.thousand:_=m.abbreviations.million;break;case m.abbreviations.million:_=m.abbreviations.billion;break;case m.abbreviations.billion:_=m.abbreviations.trillion;break}if(t._.includes(Q,"-")&&(Q=Q.slice(1),z=!0),Q.length<v)for(var B=v-Q.length;B>0;B--)Q="0"+Q;return W>-1&&(Q=Q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),c.indexOf(".")===0&&(Q=""),q=Q+M+(_||""),p?q=(p&&z?"(":"")+q+(p&&z?")":""):Ce>=0?q=Ce===0?(z?"-":"+")+q:q+(z?"-":"+"):z&&(q="-"+q),q},stringToNumber:function(l){var c=a[f.currentLocale],d=l,m={thousand:3,million:6,billion:9,trillion:12},p,x,v;if(f.zeroFormat&&l===f.zeroFormat)x=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(p in m)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[p]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),d.match(v)){x*=Math.pow(10,m[p]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,d){return l.slice(0,d)+c+l.slice(d)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var d=Object(l),m=d.length>>>0,p=0,x;if(arguments.length===3)x=arguments[2];else{for(;p<m&&!(p in d);)p++;if(p>=m)throw new TypeError("Reduce of empty array with no initial value");x=d[p++]}for(;p<m;p++)p in d&&(x=c(x,d[p],p,d));return x},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,d){var m=n.multiplier(d);return c>m?c:m},1)},toFixed:function(l,c,d,m){var p=l.toString().split("."),x=c-(m||0),v,_,w,T;return p.length===2?v=Math.min(Math.max(p[1].length,x),c):v=x,w=Math.pow(10,v),T=(d(l+"e+"+v)/w).toFixed(v),m>c-v&&(_=new RegExp("\\.?0{1,"+(m-(c-v))+"}$"),T=T.replace(_,"")),T}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in h)f[l]=h[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,d){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=d,d},t.validate=function(l,c){var d,m,p,x,v,_,w,T;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{w=t.localeData(c)}catch{w=t.localeData(t.locale())}return p=w.currency.symbol,v=w.abbreviations,d=w.delimiters.decimal,w.delimiters.thousands==="."?m="\\.":m=w.delimiters.thousands,T=l.match(/^[^\d]+/),T!==null&&(l=l.substr(1),T[0]!==p)||(T=l.match(/[^\d]+$/),T!==null&&(l=l.slice(0,-1),T[0]!==v.thousand&&T[0]!==v.million&&T[0]!==v.billion&&T[0]!==v.trillion))?!1:(_=new RegExp(m+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(d),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var d=this._value,m=l||f.defaultFormat,p,x,v;if(c=c||Math.round,d===0&&f.zeroFormat!==null)x=f.zeroFormat;else if(d===null&&f.nullFormat!==null)x=f.nullFormat;else{for(p in i)if(m.match(i[p].regexps.format)){v=i[p].format;break}v=v||t._.numberToFormat,x=v(d,m,c)}return x},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(m,p,x,v){return m+Math.round(c*p)}return this._value=n.reduce([this._value,l],d,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(m,p,x,v){return m-Math.round(c*p)}return this._value=n.reduce([l],d,Math.round(this._value*c))/c,this},multiply:function(l){function c(d,m,p,x){var v=n.correctionFactor(d,m);return Math.round(d*v)*Math.round(m*v)/Math.round(v*v)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(d,m,p,x){var v=n.correctionFactor(d,m);return Math.round(d*v)/Math.round(m*v)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,d){var m=t._.includes(c," BPS")?" ":"",p;return l=l*1e4,c=c.replace(/\s?BPS/,""),p=t._.numberToFormat(l,c,d),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"BPS"),p=p.join("")):p=p+m+"BPS",p},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},d=l.suffixes.concat(c.suffixes.filter(function(p){return l.suffixes.indexOf(p)<0})),m=d.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(p,x,v){var _,w=t._.includes(x,"ib")?c:l,T=t._.includes(x," b")||t._.includes(x," ib")?" ":"",O,F,M;for(x=x.replace(/\s?i?b/,""),O=0;O<=w.suffixes.length;O++)if(F=Math.pow(w.base,O),M=Math.pow(w.base,O+1),p===null||p===0||p>=F&&p<M){T+=w.suffixes[O],F>0&&(p=p/F);break}return _=t._.numberToFormat(p,x,v),_+T},unformat:function(p){var x=t._.stringToNumber(p),v,_;if(x){for(v=l.suffixes.length-1;v>=0;v--){if(t._.includes(p,l.suffixes[v])){_=Math.pow(l.base,v);break}if(t._.includes(p,c.suffixes[v])){_=Math.pow(c.base,v);break}}x*=_||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,d){var m=t.locales[t.options.currentLocale],p={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,v,_;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,d),l>=0?(p.before=p.before.replace(/[\-\(]/,""),p.after=p.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(p.before,"-")&&!t._.includes(p.before,"(")&&(p.before="-"+p.before),_=0;_<p.before.length;_++)switch(v=p.before[_],v){case"$":x=t._.insert(x,m.currency.symbol,_);break;case" ":x=t._.insert(x," ",_+m.currency.symbol.length-1);break}for(_=p.after.length-1;_>=0;_--)switch(v=p.after[_],v){case"$":x=_===p.after.length-1?x+m.currency.symbol:t._.insert(x,m.currency.symbol,-(p.after.length-(1+_)));break;case" ":x=_===p.after.length-1?x+" ":t._.insert(x," ",-(p.after.length-(1+_)+m.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,d){var m,p=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=p.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(x[0]),c,d),m+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),d=Number(c[0]),m=Number(c[1]);m=t._.includes(l,"e-")?m*=-1:m;function p(x,v,_,w){var T=t._.correctionFactor(x,v),O=x*T*(v*T)/(T*T);return O}return t._.reduce([d,Math.pow(10,m)],p,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,d){var m=t.locales[t.options.currentLocale],p,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=m.ordinal(l),p=t._.numberToFormat(l,c,d),p+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,d){var m=t._.includes(c," %")?" ":"",p;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),p=t._.numberToFormat(l,c,d),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"%"),p=p.join("")):p=p+m+"%",p},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,d){var m=Math.floor(l/60/60),p=Math.floor((l-m*60*60)/60),x=Math.round(l-m*60*60-p*60);return m+":"+(p<10?"0"+p:p)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),d=0;return c.length===3?(d=d+Number(c[0])*60*60,d=d+Number(c[1])*60,d=d+Number(c[2])):c.length===2&&(d=d+Number(c[0])*60,d=d+Number(c[1])),Number(d)}})}(),t})}(Js)),Js.exports}var hd=dd();const Xs=pr(hd),_e=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),ud={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:et},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:_e}},xa=(e,t)=>{const n=ud[`_${tn[t].minimumFractionDigits??2}`].roundUpto;return n(e)},en=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",tn={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 md(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Xs(e).format("0,00.000");default:return Xs(e).format("0,00.00")}}function fd(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 p=m%10,x=Math.floor(m/10);return`${r[x]}${p?" "+t[p]:""}`}}function a(m){var p=m.toString(),x,v,_,w,T,O,F,M,z,K,te,Q,ae="and";if(p=p.replace(/[, ]/g,""),parseInt(p)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","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=p.length,O=[];w>0;)T=w,O.push(p.slice(w=Math.max(0,w-3),T));if(F=O.length,F>_.length)return"";for(Q=[],K=0;K<F;K++)M=parseInt(O[K]),M&&(z=O[K].split("").reverse().map(parseFloat),z[1]===1&&(z[0]+=10),(te=_[K])&&Q.push(te),(te=x[z[0]])&&Q.push(te),(te=v[z[1]])&&Q.push(te),(z[0]||z[1])&&(z[2]||K+1>F)&&Q.push(ae),(te=x[z[2]])&&Q.push(te+" Hundred"));return Q.reverse().join(" ")}const[h,f]=e.toString().split("."),o=a(parseInt(h,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const le=(e,t)=>`${tn[t].symbol} ${xa(e||0,t)}`,U=(e,t)=>`${tn[t].symbol} ${md(e||0,t)}`,Xn=()=>{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},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),er=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(h=>{var f;(f=h.discounts)==null||f.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:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},tr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(h=>{const f=`${h[t]}`;n[f]?(n[f].amt+=h.amt,n[f].taxAmt+=h.taxAmt):n[f]={amt:h.amt,chargeType:h.chargeType?h.chargeType:h.type,defaultSelcted:h.defaultSelcted,rate:h.rate,tax:h.tax,taxAmt:h.taxAmt,name:h.name,type:h.type}})}),Object.values(n)},sr=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 fs(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 yd(e,t,n,r,i){const a=fs("1",e),h=fs("2",t),f=fs("3",n),o=fs("4",r),l=fs("5",i);var c=Buffer.concat([a,h,f,o,l]);return c.toString("base64")}const gd=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"}),xd=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},ps=Xn(),Nd=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),h=Math.floor(t%3600/60),f=`${a} hr ${h} min`;return f}else return r},jd=(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=ms(i,"internalName");let h;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(h=a[f],n.push({displayName:h?h.displayName:Ke(f.replace("_"," ")),value:et(e.paymentModes[f])}));return n},vd=(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 h=i.toDataURL("image/png");t(h)},r.onerror=i=>{t(null)}}catch{t(null)}})}const sn=(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!0},nr=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},rr=(e,t)=>{var c,d,m,p;let n,r,i,a,h;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let x=0;x<e.length;x++)if(n=e[x],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],h=0;h<n.addons.length;h++)a=n.addons[h],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(d=f[r].addons)!=null&&d.length&&((m=n.addons)!=null&&m.length)){const v=ms(n.addons,"serviceId"),_=[];let w;for(let T=0;T<f[r].addons.length;T++)a=f[r].addons[T],(p=v[a.serviceId])!=null&&p.serviceId&&(w=v[a.serviceId],a.sub_total+=w.sub_total??0),_.push(a);f[r].addons=_}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},ar=e=>{var f;let t,n,r,i,a={},h=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.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),h+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),h+=r.taxAmt);return{obj:Object.values(a),sum:h}},ir=(e,t,n)=>{var a,h,f,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 sn((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=sn((h=t.siteSetting)==null?void 0:h.packagingSlipPrinters,i,"value");if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.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 sn((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=sn((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var _;const{usersObj:r}=n;let i={},a,h;const{cancelledKOT:f,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&&(h=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,O)=>{var Ce,W,q;let F=T.station?T.station.split("::"):"",M=F&&F.length>1?F[1]:F[0],z=e.tableNo?e.tableNo.split("::"):null,K=z&&z.length>0?z[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,Q;(Ce=r==null?void 0:r[w.createdBy])!=null&&Ce.name&&(Q=r[w.createdBy].name);let ae=!1;(f||M&&T.status==l)&&(ae=!0),ae&&lr(M)&&(i[M]||(i[M]={},i[M].station=M,i[M].services=[],i[M].tableName=te,i[M].customerName=e.name==t.companyName?null:e.name,i[M].time=R().format("DD-MM-YYYY hh:mm a"),i[M].type=e.orderFrom,i[M].subOrderFrom=e.subOrderFrom,i[M].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[M].orderId=new Set([i[M].orderId]),i[M].instruction=e.instruction,i[M].orderSource=e.orderSource,i[M].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[M].aggregatorOrderId=e.externalOrderId,i[M].otp=e.otp,i[M].totalQty=0,i[M].tokenId=e.tokenId,i[M].kotId=T.kotId?new Set([T.kotId]):null,i[M].waiterName=e.waiterName,i[M].duplicate=f,i[M].createdBy=Q,i[M].zomatoInstant=c,h&&(i[M].customFields=h),o&&(i[M].onlyCancelledItems=o),e.preparationTime&&(i[M].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[M]?(i[M].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:O,status:T.status,addons:T.addons}),i[M].totalQty+=_e(T.qty),(W=i[M].kotId)==null||W.add(T.kotId),e.externalOrderId||e.offlineOrderId||(q=i[M].orderId)==null||q.add(w.subOrderId)):(i[M]=[],i[M].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:w.subOrderId,index:O,status:T.status}),i[M].totalQty+=_e(T.qty)))})});let d={},m="2INCH";Xn();let p,x=[],v={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const T=i[w];try{t.printers&&t.printers.map(O=>{O.label.toUpperCase()==T.station.toUpperCase()&&(p=ps=="Android OS"?O:O.value??void 0,m=O.paperSize?O.paperSize:t.printerSize,x.push({printer:p,paperSize:m}))}),x.length==0&&x.push({printer:p,paperSize:t.printerSize||m});for(let O=0;O<T.services.length;O++){let F=T.services[O],M=e.orderList.find(K=>K.subOrderId==F.subOrderId),z=d[F.subOrderId];M&&(z?z.services.push(M.services[F.index]):(d[F.subOrderId]={},d[F.subOrderId].subOrderId=M.subOrderId,d[F.subOrderId].services=[M.services[F.index]]))}}catch(O){console.log(O)}v[w]=x,x=[],p=null}for(const w in d)Object.hasOwnProperty.call(d,w)&&d[w];return{obj:i,paperSize:m,printer:p,printersMap:v}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let h="2INCH",f,o=[],l,c;const d=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&&(f=ps=="Android OS"?l:l.value??void 0,h=l.paperSize?l.paperSize:h,l.paperSize)){let p,x,v,_,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:d},O={},F=!1,M,z=0;for(e.preparationTime&&(T.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(T.customFields=c),v=0;v<e.orderList.length;v++)for(p=e.orderList[v],_=0;_<p.services.length;_++)x=p.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?(M=ld(l.stations),M[x.station]&&(F=!0)):F=!0),F&&x.kotId&&x.station&&(w=x.station.split("::")[1],z+=x.qty,O[`${w}/${x.kotId}`]?O[`${w}/${x.kotId}`].push(x):O[`${w}/${x.kotId}`]=[x]);Object.keys(O).length&&(T.services=O,T.totalQty=et(z),o.push({printer:f,paperSize:h,obj:T}))}return{printers:o}}catch(h){console.log(h)}},Sd=(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 d=(c=l.station.split("::"))==null?void 0:c[1];d&&lr(d)&&(r[d]?r[d].activeKots[l.kotId]=l.kotId:r[d]={from:[n.from],to:[n.to],station:d,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,d,m={},p=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],p.push(o.tableNo),c=0;c<o.ids.length;c++)d=o.ids[c],m[d]=d;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],m[o.id]&&o.orderList.forEach(v=>{v.services.forEach(_=>{var w;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let T=(w=_.station.split("::"))==null?void 0:w[1];T&&lr(T)&&(r[T]?r[T].activeKots[_.kotId]=_.kotId:r[T]={from:p,to:[n.to],station:T,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,h=[],f={};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?ps=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,h.push({printer:a,paperSize:i}))}),h.length==0&&h.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=h,h=[],a=null}return{obj:r,paperSize:i,printersMap:f}},Td=(e,t)=>{var O,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:h,rangeDate:f}=t,o={},l;const c=!!bt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:M,...z}=i;i={...z,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let d=c&&(n==null?void 0:n.length)&&n.some(M=>M.slugName==="online-menu")&&e.isAggregatorEnabled==!0,m=d?r.aggregator_collection:void 0,p=d?r.zomato_collection:void 0,x=d?r.swiggy_collection:void 0,v=c?Nd(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const M=r.menuWiseSales;for(const z in M)z.endsWith("collection")?l[ts(z)]=et(M[z]):l[ts(z)]=M[z]}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&&((O=Object.keys(r.itemTypeList))!=null&&O.length))for(let M in r.itemTypeList)_+=r.itemTypeList[M];let w=h;return f.toDate!==f.fromDate&&(w=`${sr(f.fromDate)} - ${sr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:et(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:p,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?et(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?et(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?et(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?et(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}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var d,m,p;const{invoiceFormat:a,userData:h}=n;let f,o,l=[],c;try{if((d=e.appliedDiscounts)!=null&&d.length){c=0;for(let q=0;q<e.appliedDiscounts.length;q++)f=e.appliedDiscounts[q],c+=f.discountAmt}const x=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((m=e.customFeilds)!=null&&m.length){const q=bt(e.customFeilds,"INSTRUCTION","customType");q!=null&&q.customValue&&(l=[{customName:q.customName,customValue:q.customValue}])}f={};let v=(p=t==null?void 0:t.footerAddress)!=null&&p.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",O=(v!=""?v+",":"")+(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":""),F=t.gstNo,M={companyName:t.companyName,companyAddress:O,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={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},te={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},Q=en(t.curr),ae={...e,companyInfo:M,orderInfo:K,customerInfo:te,gst:F,curr:Q},Ce=null,W=null;a.companyLogo&&(Ce=await zt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(W=await zt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(q=>{q.services.forEach(async(B,me)=>{var st,nt;let A="kitchen",Be=e.tableName?e.tableName:e.orderFrom;A&&(f[A]||(f[A]={},f[A].station=A,f[A].services=[],f[A].tableName=Be,f[A].customerName=e.name,f[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[A].type=e.orderFrom,f[A].orderId=e.orderId,f[A].instruction=e.instruction,f[A].totalQty=0,f[A].tokenId=e.tokenId,f[A].orderSource=e.orderSource,f[A].aggregatorOrderId=e.externalOrderId,f[A].otp=e.otp,f[A].paymentState=e.paymentState,f[A].discountAmt=c,f[A].otherCharges=e.otherCharges,f[A].taxAmt=e.taxAmt,f[A].customFeilds=l,f[A].curr=t.curr??"INR",f[A].zomatoInstant=x),f[A]?(o={serviceName:B.serviceName,qty:B.qty,instruction:B.isUrgent&&B.instruction?`(URGENT -${B.instruction})`:B.instruction?`(${B.instruction})`:B.isUrgent?"(URGENT)":"",subOrderId:q.subOrderId,isUrgent:B.isUrgent,index:me},(st=B.addons)!=null&&st.length&&(o.addons=B.addons),f[A].services.push(o),f[A].totalQty+=B.qty):(f[A]=[],f[A].services.push({serviceName:B.serviceName,qty:B.qty,instruction:B.instruction?B.instruction:"",subOrderId:q.subOrderId,index:me}),f[A].totalQty+=B.qty),f[A]={...f[A],companyInfo:M,orderInfo:K,customerInfo:te,gst:F,curr:Q},f[A].domain=a.siteURL,f[A].paymentMethods=a.paymentMode?ae.paymentMethods:null,f[A].companyInfo.companyName=a.companyName,f[A].companyInfo.companyEmail=a.email,f[A].companyInfo.companyAddress=a.address,f[A].companyInfo.companyContact=a.mobile,f[A].tokenId=a.token?ae.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(ae.upiId=a.upiId),f[A].gstNo=a.gst?ae.gst:null,f[A].footerMessage=a.footerMessage,f[A].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),f[A].fssai=t.fssai,f[A].vatNo=t.vatNo,f[A].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[A].disabledPoweredBy=t.disabledPoweredBy===!0,f[A].printTime=R().format("DD-MM-YYYY hh:mm A"),f[A].printedBy=h.userRole=="admin"?"Admin":h.name,e.deliveryTimestamp&&(f[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[A].itemInstructionOnBill=a.itemInstructionOnBill,f[A]={...f[A],companyLogo:Ce,companyQrCode:W})})});for(const q in f)if(Object.hasOwnProperty.call(f,q)){const B=f[q];try{let me=t.printerSize??"2inch";r(new Object({obj:new Object({...B,paperSize:me}),orderList:e.orderList}));return}catch(me){console.log(me)}}}catch(x){console.log("err::",x)}}),Id=async e=>{let t=[];for(let d=0;d<e.length;d++)for(let m=0;m<e[d].orderList.length;m++)t.push(e[d].orderList[m]);let n=[];if(t.length>0)for(let d=0;d<t.length;d++)for(let m=0;m<t[d].services.length;m++)t[d].services[m].status!="CANCELLED"&&t[d].services[m].status!="RETURNED"&&t[d].services[m].status!="SHIFTED"&&n.push(t[d].services[m]);let r={},i=[];for(let d=0;d<n.length;d++)if(n[d].addons&&n[d].addons.length>0)for(let m=0;m<n[d].addons.length;m++){let p={...n[d].addons[m]};p.qty=n[d].qty,i.push(p)}n.forEach(d=>{let{attachedCat:m,serviceId:p}=d;r[m]||(r[m]=[]);let x=r[m].findIndex(v=>v.serviceId===p);x!==-1?r[m][x].qty=r[m][x].qty+d.qty:r[m].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedCat,station:d.station})});const a=Object.keys(r).sort(),h={};a.forEach(d=>{h[d]=r[d]});for(let d in h)h[d].sort((m,p)=>m.serviceName.localeCompare(p.serviceName));let f={Category:h},o={};i.forEach(d=>{let{attachedAddonCat:m,serviceId:p}=d;o[m]||(o[m]=[]);let x=o[m].findIndex(v=>v.serviceId===p);x!==-1?o[m][x].qty=o[m][x].qty+d.qty:o[m].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedAddonCat,station:d.station})});const l=Object.keys(o).sort(),c={};l.forEach(d=>{c[d]=o[d]});for(let d in c)c[d].sort((m,p)=>m.serviceName.localeCompare(p.serviceName));return f.Addon=c,f},Na={"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"},ja=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return Na[t]?Na[t]:"SGST"},va=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c,d;try{const{invoiceFormat:m,custName:p,custMobile:x,custAddress:v,userData:_={}}=n,{itemList:w}=e;let T=_==null?void 0:_.userRole;if(_.userRole=="admin"?T="ADMIN":T=_==null?void 0:_.name,!(w!=null&&w.length))return;let O=t.printerSize,F=ir(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});O=F?(h=F[0])!=null&&h.paperSize?(f=F[0])==null?void 0:f.paperSize:O||"2INCH":O;let M=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",z=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",K=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",Q=(M!=""?M+",":"")+(z!=""?z+",":"")+(K!=""?K+",":"")+(te!=""?te+",":""),ae=t.gstNo,Ce={companyName:t.companyName,companyAddress:Q,companyContact:t.contactNumber,companyEmail:t.contactEmail},q={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},B={custName:m&&m.custName?p==t.companyName?null:p:null,custAddress:m&&m.custAddress&&v||null,custContact:m&&m.custMobile?x:null,custEmail:"ajaybaglane7@gmail.com"},me=en(t.curr),A={...e,companyInfo:Ce,orderInfo:q,customerInfo:B,gst:ae,curr:me};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?p: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=ja(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=T,A.newFormat=!0,!m.itemInstructionOnBill&&A.itemList){let J;for(let je=0;je<A.itemList.length;je++)J=A.itemList[je],J.instruction&&delete J.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let Be=[];if((c=e.customFeilds)!=null&&c.length){let J;for(let je=0;je<e.customFeilds.length;je++)J=e.customFeilds[je],J!=null&&J.customValue&&((d=J.availability)!=null&&d.includes("BILL"))&&Be.push({customName:J.customName,customValue:J.customValue});A.customFields=Be}let st=null,nt=null;m.companyLogo&&(st=await zt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(nt=await zt(`https://${m.qrcode.bucket}.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 pt={};(function(){let J,je,yt=0,gt=0,g=0,u=0,C=0,j=0,I=0,D=0,S=[],k=[],$=0,pe;if(O==="A4"||O==="A5"){for(je=0;je<w.length;je++)J=w[je],gt+=J.sub_total,g+=J.afterdiscAmt,u+=J.afterdiscAmt+(J.total_charges??0),yt+=J.afterdiscAmt+(J.total_charges??0),$+=J.qty;let Te=er(w,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(w);pt={itemList:rr(w,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:tr(w,"name"),taxation:Pe,subTotal:_e(gt),afterDisc:_e(g),afterCharges:_e(u),total:_e(yt+Ae),qty:$}}else{for(je=0;je<w.length;je++)J=w[je],J.taxType==="VAT"?(k.push(J),D+=J.sub_total,j+=J.afterdiscAmt,C+=J.afterdiscAmt+(J.total_charges??0),I+=J.afterdiscAmt+(J.total_charges??0)):(S.push(J),gt+=J.sub_total,g+=J.afterdiscAmt,u+=J.afterdiscAmt+(J.total_charges??0),yt+=J.afterdiscAmt+(J.total_charges??0));if(S.length){let Te=er(S,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(S);pt.GST={itemList:rr(S,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:tr(S,"name"),taxation:Pe,subTotal:_e(gt),afterDisc:_e(g),afterCharges:_e(u),total:_e(yt+Ae)}}if(k.length){let Te=er(k,"discountName",{separateItemsDisc:!0});const Le=nr(Te);let{obj:Pe,sum:Ae}=ar(k);pt.VAT={itemList:rr(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:tr(k,"name"),taxation:Pe,subTotal:_e(D),afterDisc:_e(j),afterCharges:_e(C),total:_e(I+Ae)}}}})(),A.distributedData=pt;let Mt={obj:A,companyLogo:st,companyQrCode:nt,paperSize:t.printerSize,Name:a};r(Mt)}}catch(m){console.log("err",m),i(m)}}),Cd=(e,t,n={})=>(console.log("orderObj :::",e,t,n),new Promise(async(r,i)=>{var h,f,o,l,c;try{const{invoiceFormat:d,custName:m,custMobile:p,custAddress:x,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",T=t.footerAddress.city?t.footerAddress.city:"",O=t.footerAddress.zip?t.footerAddress.zip:"",F=(_!=""?_+",":"")+(w!=""?w+",":"")+(T!=""?T+",":"")+(O!=""?O+",":""),M=t.gstNo,z={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},te={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?R.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},Q={custName:d&&d.custName?m==t.companyName?null:m:null,custAddress:d&&d.custAddress&&x||null,custContact:d&&d.custMobile?p:null,custEmail:"ajaybaglane7@gmail.com"},ae=en(t.curr),Ce="",W={...e,companyInfo:z,orderInfo:te,customerInfo:Q,gst:M,curr:ae};if(d){if(W.domain=d.siteURL,W.paymentMethods=d.paymentMode?W.paymentMethods:null,W.companyInfo.companyName=d.companyName,W.companyInfo.companyEmail=d.email,W.companyInfo.companyAddress=d.address,W.companyInfo.companyContact=d.mobile,W.customerInfo.custName=d.custName?m:null,W.tokenId=d.token?W.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(W.upiId=d.upiId),W.gstNo=d.gst?W.gst:null,W.footerMessage=d.footerMessage,W.orderFrom=(h=v.subOrderFrom)==null?void 0:h.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ja(t),W.printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=R().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(W.deliveryTimestamp=R.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=d.itemInstructionOnBill,W.printHSNCodeOnBill=d.printHSNCodeOnBill,W.noOfInvoice=d.noOfInvoice,W.area=v.area,W.captainName=v.captainName,!(d.itemInstructionOnBill||d.printHSNCodeOnBill)&&((f=W.itemList)!=null&&f.length)){let B;for(let me=0;me<W.itemList.length;me++)B=W.itemList[me],B.instruction&&delete B.instruction,B.hsnCode&&delete B.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let q=[];if((l=v.customFeilds)!=null&&l.length){let B;for(let me=0;me<v.customFeilds.length;me++)B=v.customFeilds[me],B!=null&&B.customValue&&((c=B.availability)!=null&&c.includes("BILL"))&&q.push({customName:B.customName,customValue:B.customValue});W.customFields=q}if(t&&t.isOld&&t.isOld==!0){let B=null,me=null;d.companyLogo&&(B=await zt(`https://${d.companyLogo.bucket}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(me=await zt(`https://${d.qrcode.bucket}.s3.amazonaws.com/${d.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 A={obj:W,companyLogo:B,companyQrCode:me,paperSize:t.printerSize,Name:a};console.log("obj :::",W),r(A)}}}catch(d){console.log("err",d)}})),Od=(e,t)=>new Promise(async(n,r)=>{var O;let i;(O=t.siteLogo)!=null&&O.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",h=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(h!=""?h+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],d,m=0,p=0,x=0,v=[],_,w;const T=ms(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(d=e[F],c.push({date:d.date,orderId:d.orderId,finalAmount:d.finalAmount}),m+=d.finalAmount,p+=d.paidAmt,x+=d.balanceAmt,_=0;_<d.orderTransactions.length;_++)w=d.orderTransactions[_],w.paidAmt&&v.push({date:R.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:T[w.paymentMode].displayName,amount:_e(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:p,totalPayable:x,paperSize:t.printerSize,curr:en(t.curr),transactions:v})}),Md=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 va({...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 Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),_a=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},lr=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(h=>h.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Ad(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 Ed=(()=>{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 ba(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=St(window.getComputedStyle(document.documentElement)),Gt))}function nn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=nn(e,"border-left-width"),n=nn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=nn(e,"border-top-width"),n=nn(e,"border-bottom-width");return e.clientHeight+t+n}function Sa(e,t={}){const n=t.width||Rd(e),r=t.height||kd(e);return{width:n,height:r}}function Ld(){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 Ye=16384;function Pd(e){(e.width>Ye||e.height>Ye)&&(e.width>Ye&&e.height>Ye?e.width>e.height?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye):e.width>Ye?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye))}function rn(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 Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(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),Fd(i)}const ke=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ke(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return ba(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function Ta(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const h=Ed();try{t.className=`${t.className} ${h}`}catch{return}const f=document.createElement("style");f.appendChild($d(h,n,i,r)),t.appendChild(f)}function Hd(e,t,n){Ta(e,t,":before",n),Ta(e,t,":after",n)}const wa="application/font-woff",Ia="image/jpeg",Bd={woff:wa,woff2:wa,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ia,jpeg:Ia,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function or(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function cr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Ca(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,h)=>{const f=new FileReader;f.onerror=h,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){h(o)}},f.readAsDataURL(i)})}const dr={};function Vd(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 hr(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(dr[r]!=null)return dr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ca(e,n.fetchRequestInit,({res:h,result:f})=>(t||(t=h.headers.get("Content-Type")||""),zd(f)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let h=`Failed to fetch resource: ${e}`;a&&(h=typeof a=="string"?a:a.message),h&&console.warn(h)}return dr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):rn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),h=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,h==null||h.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return rn(f)}const n=e.poster,r=or(n),i=await hr(n,r,t);return rn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await an(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return ke(e,HTMLCanvasElement)?qd(e):ke(e,HTMLVideoElement)?Kd(e,t):ke(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Oa(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Oa(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=St(e.assignedNodes()):ke(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||ke(e,HTMLVideoElement)||await a.reduce((h,f)=>h.then(()=>an(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(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):ba(n).forEach(a=>{let h=i.getPropertyValue(a);a==="font-size"&&h.endsWith("px")&&(h=`${Math.floor(parseFloat(h.substring(0,h.length-2)))-.1}px`),ke(e,HTMLIFrameElement)&&a==="display"&&h==="inline"&&(h="block"),a==="d"&&t.getAttribute("d")&&(h=`path(${t.getAttribute("d")})`),r.setProperty(a,h,i.getPropertyPriority(a))})}function th(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(ke(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return ke(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(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 f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await an(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",h=document.createElementNS(a,"svg");h.setAttribute("xmlns",a),h.style.position="absolute",h.style.width="0",h.style.height="0",h.style.overflow="hidden",h.style.display="none";const f=document.createElementNS(a,"defs");h.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(h)}return e}async function an(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Ma=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Ma,(n,r,i)=>(t.push(i),n)),t.filter(n=>!cr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,h=or(t);let f;return i||(f=await hr(a,h,r)),e.replace(lh(t),`$1${f}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Aa(e){return e.search(Ma)!==-1}async function Ea(e,t,n){if(!Aa(e))return e;const r=dh(e,n);return oh(r).reduce((a,h)=>a.then(f=>ch(f,h,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 Ea(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(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 uh(e,t){const n=ke(e,HTMLImageElement);if(!(n&&!cr(e.src))&&!(ke(e,SVGImageElement)&&!cr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await hr(r,or(r),t);await new Promise((a,h)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){h(l)}}:h;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=St(e.childNodes).map(i=>Ra(i,t));await Promise.all(r).then(()=>e)}async function Ra(e,t){ke(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(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 ka={};async function La(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Pa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async h=>{let f=h.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Ca(f,t.fetchRequestInit,({result:o})=>(n=n.replace(h,`url(${o})`),[h,o]))});return Promise.all(a).then(()=>n)}function Fa(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,h="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(h,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach((a,h)=>{if(a.type===CSSRule.IMPORT_RULE){let f=h+1;const o=a.href,l=La(o).then(c=>Pa(c,t)).then(c=>Fa(c).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?f+=1:i.cssRules.length)}catch(m){console.error("Error inserting rule from remote css",{rule:d,error:m})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const h=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(La(i.href).then(f=>Pa(f,t)).then(f=>Fa(f).forEach(o=>{h.insertRule(o,h.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),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 yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Aa(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=St(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Da(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Da(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Da(a.style.fontFamily))).map(a=>{const h=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ea(a.cssText,h,t)}))).join(`
|
|
46
46
|
`)}async function jh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nh(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 Ya(e,t={}){const{width:n,height:r}=Sa(e,t),i=await an(e,t,!0);return await jh(i,t),await Ra(i,t),fh(i,t),await Dd(i,n,r)}async function vh(e,t={}){const{width:n,height:r}=Sa(e,t),i=await Ya(e,t),a=await rn(i),h=document.createElement("canvas"),f=h.getContext("2d"),o=t.pixelRatio||Ld(),l=t.canvasWidth||n,c=t.canvasHeight||r;return h.width=l*o,h.height=c*o,t.skipAutoScale||Pd(h),h.style.width=`${l}`,h.style.height=`${c}`,t.backgroundColor&&(f.fillStyle=t.backgroundColor,f.fillRect(0,0,h.width,h.height)),f.drawImage(a,0,0,h.width,h.height),h}async function _h(e,t={}){return(await vh(e,t)).toDataURL("image/jpeg",t.quality||1)}var bh=Object.defineProperty,ln=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,Ha=(e,t,n)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ys=(e,t)=>{for(var n in t||(t={}))Ua.call(t,n)&&Ha(e,n,t[n]);if(ln)for(var n of ln(t))$a.call(t,n)&&Ha(e,n,t[n]);return e},ur=(e,t)=>{var n={};for(var r in e)Ua.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ln)for(var r of ln(e))t.indexOf(r)<0&&$a.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
47
47
|
* @license QR Code generator library (TypeScript)
|
|
48
48
|
* Copyright (c) Project Nayuki.
|
|
49
49
|
* SPDX-License-Identifier: MIT
|
|
50
|
-
*/var Ot;(e=>{const t=class{constructor(o,l,c,d){if(this.version=o,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(c);if(this.drawCodewords(p),d==-1){let x=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const _=this.getPenaltyScore();_<x&&(d=v,x=_),this.applyMask(v)}}a(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(o,l){const c=e.QrSegment.makeSegments(o);return t.encodeSegments(c,l)}static encodeBinary(o,l){const c=e.QrSegment.makeBytes(o);return t.encodeSegments([c],l)}static encodeSegments(o,l,c=1,d=40,m=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=d&&d<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,v;for(x=c;;x++){const O=t.getNumDataCodewords(x,l)*8,F=f.getTotalBits(o,x);if(F<=O){v=F;break}if(x>=d)throw new RangeError("Data too long")}for(const O of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&v<=t.getNumDataCodewords(x,O)*8&&(l=O);let _=[];for(const O of o){r(O.mode.modeBits,4,_),r(O.numChars,O.mode.numCharCountBits(x),_);for(const F of O.getData())_.push(F)}a(_.length==v);const w=t.getNumDataCodewords(x,l)*8;a(_.length<=w),r(0,Math.min(4,w-_.length),_),r(0,(8-_.length%8)%8,_),a(_.length%8==0);for(let O=236;_.length<w;O^=253)r(O,8,_);let T=[];for(;T.length*8<_.length;)T.push(0);return _.forEach((O,F)=>T[F>>>3]|=O<<7-(F&7)),new t(x,l,T,m)}getModule(o,l){return 0<=o&&o<this.size&&0<=l&&l<this.size&&this.modules[l][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const o=this.getAlignmentPatternPositions(),l=o.length;for(let c=0;c<l;c++)for(let d=0;d<l;d++)c==0&&d==0||c==0&&d==l-1||c==l-1&&d==0||this.drawAlignmentPattern(o[c],o[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;const d=(l<<10|c)^21522;a(d>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,i(d,m));this.setFunctionModule(8,7,i(d,6)),this.setFunctionModule(8,8,i(d,7)),this.setFunctionModule(7,8,i(d,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,i(d,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,i(d,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,i(d,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let c=0;c<12;c++)o=o<<1^(o>>>11)*7973;const l=this.version<<12|o;a(l>>>18==0);for(let c=0;c<18;c++){const d=i(l,c),m=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(m,p,d),this.setFunctionModule(p,m,d)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const m=Math.max(Math.abs(d),Math.abs(c)),p=o+d,x=l+c;0<=p&&p<this.size&&0<=x&&x<this.size&&this.setFunctionModule(p,x,m!=2&&m!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(o+d,l+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(o,l,c){this.modules[l][o]=c,this.isFunction[l][o]=!0}addEccAndInterleave(o){const l=this.version,c=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");const d=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),x=d-p%d,v=Math.floor(p/d);let _=[];const w=t.reedSolomonComputeDivisor(m);for(let O=0,F=0;O<d;O++){let M=o.slice(F,F+v-m+(O<x?0:1));F+=M.length;const W=t.reedSolomonComputeRemainder(M,w);O<x&&M.push(0),_.push(M.concat(W))}let T=[];for(let O=0;O<_[0].length;O++)_.forEach((F,M)=>{(O!=v-m||M>=x)&&T.push(F[O])});return a(T.length==p),T}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let m=0;m<2;m++){const p=c-m,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][p]&&l<o.length*8&&(this.modules[v][p]=i(o[l>>>3],7-(l&7)),l++)}}a(l==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let d;switch(o){case 0:d=(c+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+l)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:d=c*l%2+c*l%3==0;break;case 6:d=(c*l%2+c*l%3)%2==0;break;case 7:d=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&d&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let p=!1,x=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[m][_]==p?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,v),p||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[m][_],x=1);o+=this.finderPenaltyTerminateAndCount(p,x,v)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let p=!1,x=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][m]==p?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,v),p||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[_][m],x=1);o+=this.finderPenaltyTerminateAndCount(p,x,v)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){const x=this.modules[m][p];x==this.modules[m][p+1]&&x==this.modules[m+1][p]&&x==this.modules[m+1][p+1]&&(o+=t.PENALTY_N2)}let l=0;for(const m of this.modules)l=m.reduce((p,x)=>p+(x?1:0),l);const c=this.size*this.size,d=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=d&&d<=9),o+=d*t.PENALTY_N4,a(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{const o=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2;let c=[6];for(let d=this.size-7;c.length<o;d-=l)c.splice(1,0,d);return c}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*o+128)*o+64;if(o>=2){const c=Math.floor(o/7)+2;l-=(25*c-10)*c-55,o>=7&&(l-=36)}return a(208<=l&&l<=29648),l}static getNumDataCodewords(o,l){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<o-1;d++)l.push(0);l.push(1);let c=1;for(let d=0;d<o;d++){for(let m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(d=>0);for(const d of o){const m=d^c.shift();c.push(0),l.forEach((p,x)=>c[x]^=t.reedSolomonMultiply(p,m))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(l>>>d&1)*o;return a(c>>>8==0),c}finderPenaltyCountPatterns(o){const l=o[1];a(l<=this.size*3);const c=l>0&&o[2]==l&&o[3]==l*3&&o[4]==l&&o[5]==l;return(c&&o[0]>=l*4&&o[6]>=l?1:0)+(c&&o[6]>=l*4&&o[0]>=l?1:0)}finderPenaltyTerminateAndCount(o,l,c){return o&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(o,l){l[0]==0&&(o+=this.size),l.pop(),l.unshift(o)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(o,l,c){if(l<0||l>31||o>>>l)throw new RangeError("Value out of range");for(let d=l-1;d>=0;d--)c.push(o>>>d&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const h=class{constructor(o,l,c){if(this.mode=o,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(o){let l=[];for(const c of o)r(c,8,l);return new h(h.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!h.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const d=Math.min(o.length-c,3);r(parseInt(o.substr(c,d),10),d*3+1,l),c+=d}return new h(h.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!h.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=o.length;c+=2){let d=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;d+=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(d,11,l)}return c<o.length&&r(h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new h(h.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:h.isNumeric(o)?[h.makeNumeric(o)]:h.isAlphanumeric(o)?[h.makeAlphanumeric(o)]:[h.makeBytes(h.toUtf8ByteArray(o))]}static makeEci(o){let l=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)r(o,8,l);else if(o<16384)r(2,2,l),r(o,14,l);else if(o<1e6)r(6,3,l),r(o,21,l);else throw new RangeError("ECI assignment value out of range");return new h(h.Mode.ECI,0,l)}static isNumeric(o){return h.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return h.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const d of o){const m=d.mode.numCharCountBits(l);if(d.numChars>=1<<m)return 1/0;c+=4+m+d.bitData.length}return c}static toUtf8ByteArray(o){o=encodeURI(o);let l=[];for(let c=0;c<o.length;c++)o.charAt(c)!="%"?l.push(o.charCodeAt(c)):(l.push(parseInt(o.substr(c+1,2),16)),c+=2);return l}};let f=h;f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=f})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(i,a){this.ordinal=i,this.formatBits=a}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(i,a){this.modeBits=i,this.numBitsCharCount=a}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ot||(Ot={}));var qt=Ot;/**
|
|
50
|
+
*/var Ot;(e=>{const t=class{constructor(o,l,c,d){if(this.version=o,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(c);if(this.drawCodewords(p),d==-1){let x=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const _=this.getPenaltyScore();_<x&&(d=v,x=_),this.applyMask(v)}}a(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(o,l){const c=e.QrSegment.makeSegments(o);return t.encodeSegments(c,l)}static encodeBinary(o,l){const c=e.QrSegment.makeBytes(o);return t.encodeSegments([c],l)}static encodeSegments(o,l,c=1,d=40,m=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=d&&d<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,v;for(x=c;;x++){const O=t.getNumDataCodewords(x,l)*8,F=f.getTotalBits(o,x);if(F<=O){v=F;break}if(x>=d)throw new RangeError("Data too long")}for(const O of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&v<=t.getNumDataCodewords(x,O)*8&&(l=O);let _=[];for(const O of o){r(O.mode.modeBits,4,_),r(O.numChars,O.mode.numCharCountBits(x),_);for(const F of O.getData())_.push(F)}a(_.length==v);const w=t.getNumDataCodewords(x,l)*8;a(_.length<=w),r(0,Math.min(4,w-_.length),_),r(0,(8-_.length%8)%8,_),a(_.length%8==0);for(let O=236;_.length<w;O^=253)r(O,8,_);let T=[];for(;T.length*8<_.length;)T.push(0);return _.forEach((O,F)=>T[F>>>3]|=O<<7-(F&7)),new t(x,l,T,m)}getModule(o,l){return 0<=o&&o<this.size&&0<=l&&l<this.size&&this.modules[l][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const o=this.getAlignmentPatternPositions(),l=o.length;for(let c=0;c<l;c++)for(let d=0;d<l;d++)c==0&&d==0||c==0&&d==l-1||c==l-1&&d==0||this.drawAlignmentPattern(o[c],o[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;const d=(l<<10|c)^21522;a(d>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,i(d,m));this.setFunctionModule(8,7,i(d,6)),this.setFunctionModule(8,8,i(d,7)),this.setFunctionModule(7,8,i(d,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,i(d,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,i(d,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,i(d,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let c=0;c<12;c++)o=o<<1^(o>>>11)*7973;const l=this.version<<12|o;a(l>>>18==0);for(let c=0;c<18;c++){const d=i(l,c),m=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(m,p,d),this.setFunctionModule(p,m,d)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const m=Math.max(Math.abs(d),Math.abs(c)),p=o+d,x=l+c;0<=p&&p<this.size&&0<=x&&x<this.size&&this.setFunctionModule(p,x,m!=2&&m!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(o+d,l+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(o,l,c){this.modules[l][o]=c,this.isFunction[l][o]=!0}addEccAndInterleave(o){const l=this.version,c=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");const d=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),x=d-p%d,v=Math.floor(p/d);let _=[];const w=t.reedSolomonComputeDivisor(m);for(let O=0,F=0;O<d;O++){let M=o.slice(F,F+v-m+(O<x?0:1));F+=M.length;const z=t.reedSolomonComputeRemainder(M,w);O<x&&M.push(0),_.push(M.concat(z))}let T=[];for(let O=0;O<_[0].length;O++)_.forEach((F,M)=>{(O!=v-m||M>=x)&&T.push(F[O])});return a(T.length==p),T}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let m=0;m<2;m++){const p=c-m,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][p]&&l<o.length*8&&(this.modules[v][p]=i(o[l>>>3],7-(l&7)),l++)}}a(l==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let d;switch(o){case 0:d=(c+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+l)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:d=c*l%2+c*l%3==0;break;case 6:d=(c*l%2+c*l%3)%2==0;break;case 7:d=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&d&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let p=!1,x=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[m][_]==p?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,v),p||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[m][_],x=1);o+=this.finderPenaltyTerminateAndCount(p,x,v)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let p=!1,x=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][m]==p?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,v),p||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[_][m],x=1);o+=this.finderPenaltyTerminateAndCount(p,x,v)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){const x=this.modules[m][p];x==this.modules[m][p+1]&&x==this.modules[m+1][p]&&x==this.modules[m+1][p+1]&&(o+=t.PENALTY_N2)}let l=0;for(const m of this.modules)l=m.reduce((p,x)=>p+(x?1:0),l);const c=this.size*this.size,d=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=d&&d<=9),o+=d*t.PENALTY_N4,a(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{const o=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2;let c=[6];for(let d=this.size-7;c.length<o;d-=l)c.splice(1,0,d);return c}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*o+128)*o+64;if(o>=2){const c=Math.floor(o/7)+2;l-=(25*c-10)*c-55,o>=7&&(l-=36)}return a(208<=l&&l<=29648),l}static getNumDataCodewords(o,l){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<o-1;d++)l.push(0);l.push(1);let c=1;for(let d=0;d<o;d++){for(let m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(d=>0);for(const d of o){const m=d^c.shift();c.push(0),l.forEach((p,x)=>c[x]^=t.reedSolomonMultiply(p,m))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(l>>>d&1)*o;return a(c>>>8==0),c}finderPenaltyCountPatterns(o){const l=o[1];a(l<=this.size*3);const c=l>0&&o[2]==l&&o[3]==l*3&&o[4]==l&&o[5]==l;return(c&&o[0]>=l*4&&o[6]>=l?1:0)+(c&&o[6]>=l*4&&o[0]>=l?1:0)}finderPenaltyTerminateAndCount(o,l,c){return o&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(o,l){l[0]==0&&(o+=this.size),l.pop(),l.unshift(o)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(o,l,c){if(l<0||l>31||o>>>l)throw new RangeError("Value out of range");for(let d=l-1;d>=0;d--)c.push(o>>>d&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const h=class{constructor(o,l,c){if(this.mode=o,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(o){let l=[];for(const c of o)r(c,8,l);return new h(h.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!h.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const d=Math.min(o.length-c,3);r(parseInt(o.substr(c,d),10),d*3+1,l),c+=d}return new h(h.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!h.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=o.length;c+=2){let d=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;d+=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(d,11,l)}return c<o.length&&r(h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new h(h.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:h.isNumeric(o)?[h.makeNumeric(o)]:h.isAlphanumeric(o)?[h.makeAlphanumeric(o)]:[h.makeBytes(h.toUtf8ByteArray(o))]}static makeEci(o){let l=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)r(o,8,l);else if(o<16384)r(2,2,l),r(o,14,l);else if(o<1e6)r(6,3,l),r(o,21,l);else throw new RangeError("ECI assignment value out of range");return new h(h.Mode.ECI,0,l)}static isNumeric(o){return h.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return h.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const d of o){const m=d.mode.numCharCountBits(l);if(d.numChars>=1<<m)return 1/0;c+=4+m+d.bitData.length}return c}static toUtf8ByteArray(o){o=encodeURI(o);let l=[];for(let c=0;c<o.length;c++)o.charAt(c)!="%"?l.push(o.charCodeAt(c)):(l.push(parseInt(o.substr(c+1,2),16)),c+=2);return l}};let f=h;f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=f})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(i,a){this.ordinal=i,this.formatBits=a}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(i,a){this.modeBits=i,this.numBitsCharCount=a}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ot||(Ot={}));var qt=Ot;/**
|
|
51
51
|
* @license qrcode.react
|
|
52
52
|
* Copyright (c) Paul O'Shannessy
|
|
53
53
|
* SPDX-License-Identifier: ISC
|
|
54
|
-
*/var Ba={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Wa=128,za="L",Ga="#FFFFFF",Va="#000000",qa=!1,mr=4,Sh=.1;function Ka(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(h,f){if(!h&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!h)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}h&&a===null&&(a=f)})}),n.join("")}function Qa(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Za(e,t,n,r){if(r==null)return null;const i=n?mr:0,a=e.length+i*2,h=Math.floor(t*Sh),f=a/t,o=(r.width||h)*f,l=(r.height||h)*f,c=r.x==null?e.length/2-o/2:r.x*f,d=r.y==null?e.length/2-l/2:r.y*f;let m=null;if(r.excavate){let p=Math.floor(c),x=Math.floor(d),v=Math.ceil(o+c-p),_=Math.ceil(l+d-x);m={x:p,y:x,w:v,h:_}}return{x:c,y:d,h:l,w:o,excavation:m}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:h=Va,includeMargin:f=qa,style:o,imageSettings:l}=t,c=ur(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=l==null?void 0:l.src,m=Ne.useRef(null),p=Ne.useRef(null),[x,v]=Ne.useState(!1);Ne.useEffect(()=>{if(m.current!=null){const T=m.current,O=T.getContext("2d");if(!O)return;let F=qt.QrCode.encodeText(n,Ba[i]).getModules();const M=f?mr:0,W=F.length+M*2,K=Za(F,r,f,l),te=p.current,Q=K!=null&&te!==null&&te.complete&&te.naturalHeight!==0&&te.naturalWidth!==0;Q&&K.excavation!=null&&(F=Qa(F,K.excavation));const ae=window.devicePixelRatio||1;T.height=T.width=r*ae;const Ce=r/W*ae;O.scale(Ce,Ce),O.fillStyle=a,O.fillRect(0,0,W,W),O.fillStyle=h,Th?O.fill(new Path2D(Ka(F,M))):F.forEach(function(z,q){z.forEach(function(B,me){B&&O.fillRect(me+M,q+M,1,1)})}),Q&&O.drawImage(te,K.x+M,K.y+M,K.w,K.h)}}),Ne.useEffect(()=>{v(!1)},[d]);const _=ys({height:r,width:r},o);let w=null;return d!=null&&(w=Ne.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{v(!0)},ref:p})),Ne.createElement(Ne.Fragment,null,Ne.createElement("canvas",ys({style:_,height:r,width:r,ref:m},c)),w)}function Ih(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:h=Va,includeMargin:f=qa,imageSettings:o}=t,l=ur(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ba[i]).getModules();const d=f?mr:0,m=c.length+d*2,p=Za(c,r,f,o);let x=null;o!=null&&p!=null&&(p.excavation!=null&&(c=Qa(c,p.excavation)),x=Ne.createElement("image",{xlinkHref:o.src,height:p.h,width:p.w,x:p.x+d,y:p.y+d,preserveAspectRatio:"none"}));const v=Ka(c,d);return Ne.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${m} ${m}`},l),Ne.createElement("path",{fill:a,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),Ne.createElement("path",{fill:h,d:v,shapeRendering:"crispEdges"}),x)}var Ja=e=>{const t=e,{renderAs:n}=t,r=ur(t,["renderAs"]);return n==="svg"?Ne.createElement(Ih,ys({},r)):Ne.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var xs=Xn(),Se="normal-class";(xs=="Android OS"||xs==="iOS")&&(Se="bold-class");const tt=e=>{var Mt,J,je,yt,gt;const t=e.additionalActions??{},n=Ne.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:h,type:f}=e.printerDataObject,o=((J=(Mt=e.value)==null?void 0:Mt.settingData)==null?void 0:J.curr)??((je=e.settingData)==null?void 0:je.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ir(h,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const d=r.customLabels??gd();l=c?(yt=c[0])!=null&&yt.paperSize?(gt=c[0])==null?void 0:gt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function m(g){const u=Math.abs(parseFloat(g));return p(u)}function p(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(g).format("0,00.000");default:return Xs(g).format("0,00.00")}}Ne.useEffect(()=>{w()},[e.newId]);const x=()=>new Promise(async(g,u)=>{if(xs=="Android OS"||xs==="iOS"){let C=await _h(n.current);if(C){const j=await _(C);g(j)}}else{let C=await Ya(n.current);C&&g(C)}}),v=()=>new Promise(async(g,u)=>{const C=await x();g(C)}),_=g=>new Promise((u,C)=>{let j=new Image;j.src=g,j.onload=()=>{let I=document.createElement("canvas");const D=600,S=j.height;let k=j.width,$=j.height;k>$?k>D&&($*=D/k,k=D):$>S&&(k*=S/$,$=S),I.width=k,I.height=$,I.getContext("2d").drawImage(j,0,0,k,$),u(I.toDataURL())}}),w=async()=>{if(n&&n.current){const g=await v();e.onImageGenerated(g)}},T=g=>{let u=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:p(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,o)})]})),u},O=g=>{let u=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,o)}),s.jsx("span",{children:p(gs(g.totalCollection,C.value))+"%"})]}));return u},F=(g,u,C,j,I={})=>{let D=g.includes("upi://");const S=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${u}`;return s.jsx(Ja,{value:D?g:S,renderAs:"canvas",size:I.size??250})},M=(g,u)=>{var D,S;let C=0;if((D=u.taxObj)!=null&&D.VAT.length){let k,$,pe;for($=0;$<((S=u.taxObj)==null?void 0:S.VAT.length);$++){k=u.taxObj.VAT[$];for(pe in k)C+=_e(k[pe])}}const j={sellerName:u.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(u.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:u.finalAmount,invoiceVatTotal:C},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Ja,{value:I,renderAs:"canvas",size:250})},W=g=>{const u=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(u.push(s.jsx("hr",{})),g.rewardAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:le(g.rewardAmt,o)})]})),g.totalBalanceAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:le(g.totalBalanceAmt,o)})]})),g.writeOffAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:le(g.writeOffAmt,o)})]})),g.refundAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:le(g.refundAmt,o)})]})),g.cashCard&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:le(g.cashCard,o)})]}))),u},K=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].slugName===g)return u[C]}return!1},te=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].itemType===g)return u[C]}return!1},Q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ae=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Ch[g.discountType]}`,Ce=g=>{const u=new Array;if(g&&Object.keys(g).length!==0){u.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${Q[C]}:`}),s.jsx("span",{children:le(g[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][j]&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(j)}:`}),s.jsx("span",{children:le(g[C][j],o)})]}))}return u},z=(g,u)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(D=>{if(j=g.totalValue[D],D==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(S=>{if(S.taxType===D||!S.taxType)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.rate?m(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(S=>{const k=K(S,g.discArr);if(k&&j.cat[S]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.cat[S])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,g.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.itemTypes[S])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",g.taxObj&&g.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]})]}))}return k}):g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$])})]})}))}return k})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(D=>{if(j=g.totalValue[D],D==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(S=>{if(S.taxType===D)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:S.rate?m(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(S=>{const k=K(S,g.discArr);if(k&&j.cat[S]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.cat[S])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,g.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.itemTypes[S])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:S.taxOnAmount&&S.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]})]}))}return k}):g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$])})]})}))}return k})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},q=(g,u,{labels:C,doMultipleTax:j,type:I})=>{var S,k,$,pe,Te,Le,Pe,Ae,At,Et,xt;const D=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(G=>{var Rt;return s.jsxs("div",{style:G.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:[G.status==="RETURNED"?"(R) ":"",G.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[G.status==="RETURNED"?"-":"",G.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:G.serviceRate?m(G.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:G.sub_total?p(G.sub_total):""})]}),G.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",G.hsnCode]}),(Rt=G.addons)!=null&&Rt.length?G.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[G.status==="RETURNED"?"-":"",rt.qty*G.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",G.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+G.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname} ${Se}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(g.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(S=D.DISCOUNT_ITEMS)!=null&&S.length?D.DISCOUNT_ITEMS.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+G.discountName.toUpperCase()}}),s.jsx("span",{children:ae(G)})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.discountAmt)})]})):"",(k=D.CATEGORY_DISCOUNT)!=null&&k.length?D.CATEGORY_DISCOUNT.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+G.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+G.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.discountAmt)})]})):"",($=D.ITEM_DISCOUNT)!=null&&$.length?D.ITEM_DISCOUNT.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+ts(G.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+G.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.discountAmt)})]})):"",(Te=(pe=D.SEGMENT_DISCOUNT)==null?void 0:pe[0])!=null&&Te.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${D.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+D.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+D.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(D.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=D.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${D.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${D.COUPON_DISCOUNT[0].discountValue}${D.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(D.COUPON_DISCOUNT[0].discountAmt)})]}):"",(At=(Ae=D.ORDER_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(D.ORDER_DISCOUNT[0].discountValue)?`@${D.ORDER_DISCOUNT[0].discountValue}${D.ORDER_DISCOUNT[0].discountType=="RELATIVE"||D.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(D.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",u.couponCode?"COUPON DISC":"خصم الطلب",u.couponCode?`(${u.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Et=g.charges)!=null&&Et.length?g.charges.map(G=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${G.name.toLowerCase()}`]??G.name}})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(g.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(xt=g.taxation)!=null&&xt.length?g.taxation.map(G=>{if(G.taxAmt)return G.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+G.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[u.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+G.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+G.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},B=(g,u)=>{var D,S;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((D=j.GST)==null?void 0:D.itemList)&&q(j.GST,g,{labels:u,doMultipleTax:C,type:"GST"}),((S=j.VAT)==null?void 0:S.itemList)&&q(j.VAT,g,{labels:u,doMultipleTax:C,type:"VAT"})]})},me=g=>{const u=g.services,C=Object.keys(g.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Se}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((D,S)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[D.toUpperCase(),":"]})}),u[D].map(k=>{var $;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),(($=k.addons)==null?void 0:$.length)&&k.addons.map(pe=>{var Te;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Te=pe.serviceName)==null?void 0:Te.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),j!==S+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},A=g=>{const u=g.slice(0,-4),C=g.slice(-4);return{firstDigits:u,last4Dgits:C}},Be=(g,u,C,j={})=>{const I=Object.keys(u??{});let D=[],S,k="flex-two-items";if(j.action==="addCharges"&&(k="display-percentage"),g&&I.length){D.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,o)})]})]}));for(let $=0;$<I.length;$++)S=I[$],u[S]&&D.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${S.replaceAll("_"," ")}:`}),s.jsx("span",{children:le(u[S],o)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(g,u[S]))+"%"}):""]}));D.push(s.jsx("hr",{}))}return D},st=g=>{const u=Object.keys(g.Category),C=Object.keys(g.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),u.forEach((I,D)=>{const S=g.Category[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach($=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),k,D!=u.length-1&&s.jsx("hr",{})]})]}))}),C.length>0&&(j.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),C.forEach((I,D)=>{const S=g.Addon[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach($=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),k,D!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=g=>{var C;const u={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let I=0;I<g.customBillLabels.length;I++)j=g.customBillLabels[I],u[j.defaultName]=j.displayName}return u},pt=(g,u,C,j)=>{var $,pe,Te,Le,Pe,Ae,At,Et,xt,G,Rt,rt,Ns,js,on,vs,_s,cn,dn,hn,un,mn,fn,pn,Kt,bs,Nt,Qt,Zt,Ss,yn,Ts,gn,ws,Is,xn,Nn,Cs,Os;const I=nt(r.customLabelsMap),D=ms(xd(r.paymentModes),"internalName"),S=ee=>{var b;return(b=D[ee])!=null&&b.displayName?D[ee].displayName.toUpperCase():ee};if(g==="BILL"){let ee;if(l==="A4"||l==="A5"){let b={...u},Z=0,ue=b.distributedData;const y=ue.discounts;ee=s.jsx("div",{className:`invoiceContainer main-div ${L[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[b.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(b.customerInfo.custName||(($=b.customFields)==null?void 0:$.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),b.customerInfo.custName&&b.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custName})}),b.customerInfo.custContact&&b.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custContact})}),b.customerInfo.custAddress&&b.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custAddress})}),b.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.deliveryTimestamp})}),(pe=b.customFields)!=null&&pe.length?b.customFields.map(N=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[N.customName,": ",N.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyName})}),b.companyInfo.companyAddress&&b.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyAddress})}),b.companyInfo.companyEmail&&b.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyEmail})}),b.companyInfo.companyContact&&b.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyContact})}),b.fssai&&b.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:b.fssai})]})}),b.gst&&b.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:b.gst})]})}),b.vatNo&&b.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:b.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[b.itemList.map(N=>{var oe;let P="",V=[];return Z++,V.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:P,children:[s.jsx("td",{className:"text-align-left",children:N.serviceRate?Z:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:N.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:N.qty}),s.jsx("td",{className:"text-align-right",children:N.serviceRate?U(N.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:N.sub_total?U(N.sub_total,o):""})]}),N.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+N.instruction+")"})]})]})),(oe=N.addons)!=null&&oe.length&&N.addons.map(he=>{V.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",he.serviceName.toUpperCase()]}),s.jsx("td",{children:he.qty*N.qty})]}),he.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+he.instruction+")"})]})]}))}),V}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Z} Items and ${_e(ue.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(xa(b.finalAmount,o).toFixed(tn[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),b.upiId&&u.companyInfo.companyName&&s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:F(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmt,{size:100})})})})]}),b.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:b.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:U(ue.subTotal,o)})]}),(Te=y==null?void 0:y.DISCOUNT_ITEMS)!=null&&Te.length?y.DISCOUNT_ITEMS.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:ae(N)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Le=y==null?void 0:y.CATEGORY_DISCOUNT)!=null&&Le.length?y.CATEGORY_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Pe=y==null?void 0:y.ITEM_DISCOUNT)!=null&&Pe.length?y.ITEM_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(At=(Ae=y==null?void 0:y.SEGMENT_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+y.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(xt=(Et=y==null?void 0:y.COUPON_DISCOUNT)==null?void 0:Et[0])!=null&&xt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${y.COUPON_DISCOUNT[0].discountValue}${y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Rt=(G=y==null?void 0:y.ORDER_DISCOUNT)==null?void 0:G[0])!=null&&Rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(y.ORDER_DISCOUNT[0].discountValue)?`@${y.ORDER_DISCOUNT[0].discountValue}${y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(rt=ue.charges)!=null&&rt.length?ue.charges.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${N.name.toLowerCase()}`]??N.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.amt,o)})]})):"",ue.subTotal!==ue.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(ue.afterCharges,o)})]}):"",(Ns=ue.taxation)!=null&&Ns.length?ue.taxation.map(N=>N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+N.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.finalAmount,o)})]}),(js=u==null?void 0:u.custoutStandingData)!=null&&js.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((on=b==null?void 0:b.custoutStandingData)==null?void 0:on.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.grandTotal+((vs=b==null?void 0:b.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",b.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.rewardAmt,o)})]}):"",(_s=u.paymentMethods)!=null&&_s.length?u.paymentMethods.map(N=>{var P;if(N.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(P=N.paymentMode)==null?void 0:P.toLowerCase()}`]??S(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),N.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(N.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.paidAmt,o)})]})}):"",b.balanceAmt&&u.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(u.balanceAmt,o)})]}):"",u.balPoint&&!Number.isNaN(u.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:u.balPoint})]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${b.printby} Printed On: ${b.printTime}`}),b.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else ee=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[u.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&u.companyInfo.companyName&&u.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:u.companyInfo.companyName}),u.companyInfo.companyAddress&&u.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.companyInfo.companyAddress}}),u.companyInfo.companyContact&&u.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:u.companyInfo.companyContact})]})}),u.companyInfo.companyEmail&&u.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:u.companyInfo.companyEmail})]})}),u.fssai&&u.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:u.fssai})]})}),u.gst&&u.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:u.gst})]})}),u.vatNo&&u.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:u.vatNo})]})}),s.jsx("hr",{}),u.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.orderFrom}),u.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[u.area," : ",u.tableName?u.tableName:u.tableNo]}),u.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:u.tokenId})]})}),u.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${Se}`,children:[u.customerInfo.custName&&u.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:u.customerInfo.custName})]})}),u.customerInfo.custContact&&u.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:u.customerInfo.custContact})]})}),u.customerInfo.custAddress&&u.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:u.customerInfo.custAddress})]})}),bt(u.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),u.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:u.orderId})]})}),u.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:u.orderInfo.orderDate})]})}),u.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:u.deliveryTimestamp})]})}),u.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:u.captainName})]})})]}),(cn=u.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),u.customFields.map(b=>s.jsx("h4",{className:"left-align-entity",children:b.customName+": "+b.customValue}))]}):"",u.newFormat?B(u,I):z(u,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=u.custoutStandingData)!=null&&dn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=u.custoutStandingData)!=null&&hn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+p(u.finalAmount)})]}),(un=u.custoutStandingData)!=null&&un.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("h5",{children:u.curr+" "+p(u.custoutStandingData.balanceAmt)})]}),!u.rewardAmt&&!u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+p(u.finalAmount+u.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",u.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+u.usedPoints+" Points)"})]}),s.jsx("h5",{children:u.curr+" "+u.rewardAmt})]}):"",u.paymentMethods&&u.paymentMethods.length?u.paymentMethods.map(b=>{var Z;if(b.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Z=b.paymentMode)==null?void 0:Z.toLowerCase()}`]??S(b.paymentMode)??"CASH"}}),s.jsx("span",{children:b.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:b.isRefund?s.jsx(s.Fragment,{children:u.curr+" ("+p(b.paidAmt)+")"}):s.jsx(s.Fragment,{children:u.curr+" "+p(b.paidAmt)})})]})}):"",u.rewardAmt&&!u.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+p(u.finalAmount+(((mn=u==null?void 0:u.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-u.rewardAmt)})]})}):"",u.balanceAmt&&u.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:u.curr+" "+p(u.balanceAmt)})]}):"",s.jsx("hr",{})]}),u.earnPoints&&u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:u.earnPoints})]}):"",(u.balPoint||u.earnPoints)&&!Number.isNaN(u.balPoint||u.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:u.balPoint+u.earnPoints||0})]}):"",u.upiId&&u.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),F(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmount)]}),u.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),M(r.vatNo,u)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",u.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.footerMessage}}):"",u.printby&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${u.printby}`}):"",u.printTime&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${u.printTime}`}):"",u.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return ee}else if(g==="PRINT_DASHBOARD"&&u.salesCollection){const ee=u.salesCollection.totalDiscountAmt?gs(u.salesCollection.grandTotal,u.salesCollection.totalDiscountAmt):null,b=u.salesCollection.totalCollection-u.salesCollection.totalTax;var k=R().format("DD/MM/YYYY LT");const Z=(fn=u.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(u.monthTillDateSalesColl.grandTotal,u.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${k}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:u.selectedDate})]}),s.jsx("hr",{}),u.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(u.monthTillDateSalesColl.totalDiscountAmt,o)}${Z?`(${p(Z)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalCollection-u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:le(u.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(u.salesCollection.totalDiscountAmt,o)}${ee?`(${p(ee)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(u.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(b,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(u.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(u.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Be(u.otherFields.totalDiscountAmt,u.otherFields.discountList,"Discount",{action:"addCharges"}),Be(u.otherFields.totalOtherCharges,u.otherFields.otherChargesList,"Charges"),Be(u.otherFields.totalTax,u.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:le(u.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:u.salesCollection.totalOrders})]}),T(u)]}),s.jsx("hr",{}),u.otherFields.totalItemType?s.jsx("div",{children:Be(u.otherFields.totalItemType,u.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",u.averageCollection.avgTableTime||u.averageCollection.avgorderValue||u.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),u.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:u.averageCollection.avgTableTime})]}):"",u.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:le(u.averageCollection.avgorderValue,o)})]}):"",u.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:u.averageCollection.noOfGuest})]}):"",u.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:le(u.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:le(u.totalCollection,o)})]}),O(u)]}),W(u.averageCollection),u.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:le(u.otherFields.salesCollection,o)})]}),u.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:le(u.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Ce(u.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let ee;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",ee.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((pn=a.services)==null?void 0:pn.length)&&a.services.map(Z=>{var ue;return s.jsxs("div",{style:Z.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:Z.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Z.qty})]}),((ue=Z.addons)==null?void 0:ue.length)&&Z.addons.map(y=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(y.serviceName)})),Z.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Z.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",_e(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:le(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Z=>{if(Z.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Z.name}),s.jsx("h5",{children:a.curr+" "+p(Z.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Z=>{let ue=new Array;for(const y in Z)if(Z[y]&&Z[y]!=0){let N=y/2;ue.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",N]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[u.taxLabel+" "," @",N,"%"]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]})]}))}return ue})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(Kt=a.customFeilds)==null?void 0:Kt.map(Z=>s.jsx("h4",{className:"left-align-entity",children:Z.customName+": "+Z.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let ee="";return a.action==="SWITCH_TABLE"?ee=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(bs=d.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Nt=a.from)==null?void 0:Nt.map((b,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[b])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[b])==null?void 0:N.tableName}${Z+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Zt=(Qt=e.tableData[a.to[0]])==null?void 0:Qt.attachedArea)==null?void 0:Zt.toUpperCase()} - ${(Ss=e.tableData[a.to[0]])==null?void 0:Ss.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):ee=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(yn=d.Table)==null?void 0:yn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ts=a.from)==null?void 0:Ts.map((b,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[b])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[b])==null?void 0:N.tableName}${Z+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(ws=(gn=e.tableData[a.to[0]])==null?void 0:gn.attachedArea)==null?void 0:ws.toUpperCase()} - ${(Is=e.tableData[a.to[0]])==null?void 0:Is.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),ee}else if(g==="COUNTER_OPERATION"){let ee;return l=="2INCH"||l=="1.8INCH"?ee=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0||b.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}):ee=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}),ee}else if(g==="ITEMWISE_SALES_COUNTER"){let ee,{counterDetails:b}=e.printerDataObject;return ee=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:b.currentDate}),s.jsx("hr",{}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",b.CounterName]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",b.openedBy]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",b.loginTime]}),b.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",b.logoutTime]}),b.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${b.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${b.printedOn}`})]})}),ee}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:ee}=e.printerDataObject;return getRechargeDetails(ee)}else if(g==="PACKAGING_SLIP"){let ee,b=0;u.aggregatorOrderId&&u.aggregatorOrderId!==""&&(ee=A(u.aggregatorOrderId));const Z=u.services;for(let y in Z)b+=Z[y].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[u.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:u.subOrderFrom.toUpperCase()}),u.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",u.tokenId]}),u.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.tableName}),u.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+u.otp}),u.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${u.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.last4Dgits||""})]}),u.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:u.zomatoInstant}),s.jsx("hr",{}),u.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+u.orderId}),u.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",u.date]}),u.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+u.prepareBy}):"",u.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+u.waiterName})]}),me(u),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",b]}),s.jsxs("h5",{children:["TOTAL QTY: ",_e(u.totalQty)]})]}),(xn=u.customFields)==null?void 0:xn.map(y=>s.jsx("h4",{className:"left-align-entity",children:y.customName+": "+y.customValue})),s.jsx("br",{}),u.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",u.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:sr(b.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(b.finalAmount)})]})},b.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+p(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+p(a.totalPaid)})]})]}),(Nn=a.transactions)!=null&&Nn.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:b.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(b.amount)})]})},b.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+p(a.totalPayable)})]})]})]})});{let ee,b=0,Z,ue;for(let N=0;N<(((Cs=a.services)==null?void 0:Cs.length)||0);N++)ue=a.services[N],ue.status==="CANCELLED"&&!a.onlyCancelledItems&&(b+=ue.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",b||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Se}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${Se}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(N=>(N.status==="CANCELLED"?Z=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}):Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}),s.jsx("div",{children:Z}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",_e(a.totalQty-b)]})]}),(Os=a.customFields)==null?void 0:Os.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(f,a.obj,a.companyLogo,a.companyQrCode)})})},Oh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var h,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((h=n[e.primaryWaiter])==null?void 0:h.name)||null);const{obj:c,printersMap:d}=_d(e,t,r);let m=[],p=[];const x=_a(c).flatMap(v=>{var _;return(_=d[v.station])==null?void 0:_.map(w=>new Promise(T=>s.jsx(tt,{printerDataObject:{staticDataKOT:v,paperSize:w.paperSize,printer:w.printer},newId:v.newId,value:{settingData:t},onImageGenerated:O=>{m.push({paperSize:w.paperSize,printer:w.printer,image:O,type:"KOT"}),T()},additionalActions:r},v.newId)))});if(l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{p.push(new Promise(w=>{x.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:T=>{m.push({paperSize:_.paperSize,printer:_.printer,image:T,type:"PACKAGING_SLIP"}),w()},additionalActions:r},_.obj.newId))}))})}x.length&&ft("root2",x),await Promise.all(p),i(m)}catch(l){a(l)}}),Mh=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let h=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),d=_a(o).flatMap(m=>{var p;return(p=c[m.station])==null?void 0:p.map(x=>new Promise(v=>{const _=s.jsx(tt,{printerDataObject:{staticDataKOT:m,paperSize:l,printer:x.printer,type:m.type},newId:m.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:w=>{h.push({paperSize:x.paperSize,printer:x.printer,image:w,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});d.length&&ft("root1",d),await Promise.all(f.map(m=>new Promise(m)))}r(h)}catch(a){i(a)}}),Ah=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});ft("root1",o)}),n(a)}catch(i){r(i)}}),Eh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});ft("root1",l)}),r(h)}catch(a){i(a)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await va(e,t,n),h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});ft("root1",l)}),r(h)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let h=await Id(e);if(h&&Object.keys(h.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(d=>{const m=s.jsx(tt,{printerDataObject:{staticDataKOT:h,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:p=>{l.push({paperSize:t.printerSize,image:p,type:"ITEMWISE_SALES_COUNTER"}),d()},additionalActions:r});ft("root1",m)}),i(l)}else i([])}catch(h){a(h)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let h=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:h,settingData:t,onImageGenerated:d=>{f.push({paperSize:t.printerSize,image:d,type:"COUNTER_OPERATION"}),l()},additionalActions:n});ft("root1",c)}),r(f)}catch(a){i(a)}}),Ph=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var h;try{const f=await Od(e,t);let o=[],l=ir(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(h=l[0])==null?void 0:h.paperSize:t.printerSize;await new Promise(m=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),m()},additionalActions:r});ft("root1",p)}),i(o)}catch(f){a(f)}}),Fh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const h=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=od(l.invoiceFormats,"createdAt")[0],d=await Md(c);await new Promise(p=>{const x=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:d.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:d.paperSize,image:v,type:"BILL"}),p()},additionalActions:n});h.push(x)})}}h.length&&ft("root1",h),r(f)}catch(h){i(h)}}),ft=(e,t)=>{const n=document.getElementById(e);n&&ai.createRoot(n).render(t)};Oe.counterDetailsPrint=Lh,Oe.handleAggregatorBillPrint=Eh,Oe.handleBillPrint=Rh,Oe.handleDashboardPrint=Ah,Oe.handleItemWisePrint=kh,Oe.handleKOTPrint=Oh,Oe.handleOldBillPrints=Fh,Oe.handleSummaryPrint=Ph,Oe.handleUpdateTablePrint=Mh,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|
|
54
|
+
*/var Ba={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Wa=128,za="L",Ga="#FFFFFF",Va="#000000",qa=!1,mr=4,Sh=.1;function Ka(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(h,f){if(!h&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!h)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}h&&a===null&&(a=f)})}),n.join("")}function Qa(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Za(e,t,n,r){if(r==null)return null;const i=n?mr:0,a=e.length+i*2,h=Math.floor(t*Sh),f=a/t,o=(r.width||h)*f,l=(r.height||h)*f,c=r.x==null?e.length/2-o/2:r.x*f,d=r.y==null?e.length/2-l/2:r.y*f;let m=null;if(r.excavate){let p=Math.floor(c),x=Math.floor(d),v=Math.ceil(o+c-p),_=Math.ceil(l+d-x);m={x:p,y:x,w:v,h:_}}return{x:c,y:d,h:l,w:o,excavation:m}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:h=Va,includeMargin:f=qa,style:o,imageSettings:l}=t,c=ur(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=l==null?void 0:l.src,m=Ne.useRef(null),p=Ne.useRef(null),[x,v]=Ne.useState(!1);Ne.useEffect(()=>{if(m.current!=null){const T=m.current,O=T.getContext("2d");if(!O)return;let F=qt.QrCode.encodeText(n,Ba[i]).getModules();const M=f?mr:0,z=F.length+M*2,K=Za(F,r,f,l),te=p.current,Q=K!=null&&te!==null&&te.complete&&te.naturalHeight!==0&&te.naturalWidth!==0;Q&&K.excavation!=null&&(F=Qa(F,K.excavation));const ae=window.devicePixelRatio||1;T.height=T.width=r*ae;const Ce=r/z*ae;O.scale(Ce,Ce),O.fillStyle=a,O.fillRect(0,0,z,z),O.fillStyle=h,Th?O.fill(new Path2D(Ka(F,M))):F.forEach(function(W,q){W.forEach(function(B,me){B&&O.fillRect(me+M,q+M,1,1)})}),Q&&O.drawImage(te,K.x+M,K.y+M,K.w,K.h)}}),Ne.useEffect(()=>{v(!1)},[d]);const _=ys({height:r,width:r},o);let w=null;return d!=null&&(w=Ne.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{v(!0)},ref:p})),Ne.createElement(Ne.Fragment,null,Ne.createElement("canvas",ys({style:_,height:r,width:r,ref:m},c)),w)}function Ih(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:h=Va,includeMargin:f=qa,imageSettings:o}=t,l=ur(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ba[i]).getModules();const d=f?mr:0,m=c.length+d*2,p=Za(c,r,f,o);let x=null;o!=null&&p!=null&&(p.excavation!=null&&(c=Qa(c,p.excavation)),x=Ne.createElement("image",{xlinkHref:o.src,height:p.h,width:p.w,x:p.x+d,y:p.y+d,preserveAspectRatio:"none"}));const v=Ka(c,d);return Ne.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${m} ${m}`},l),Ne.createElement("path",{fill:a,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),Ne.createElement("path",{fill:h,d:v,shapeRendering:"crispEdges"}),x)}var Ja=e=>{const t=e,{renderAs:n}=t,r=ur(t,["renderAs"]);return n==="svg"?Ne.createElement(Ih,ys({},r)):Ne.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var xs=Xn(),Se="normal-class";(xs=="Android OS"||xs==="iOS")&&(Se="bold-class");const tt=e=>{var Mt,J,je,yt,gt;const t=e.additionalActions??{},n=Ne.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:h,type:f}=e.printerDataObject,o=((J=(Mt=e.value)==null?void 0:Mt.settingData)==null?void 0:J.curr)??((je=e.settingData)==null?void 0:je.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ir(h,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const d=r.customLabels??gd();l=c?(yt=c[0])!=null&&yt.paperSize?(gt=c[0])==null?void 0:gt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function m(g){const u=Math.abs(parseFloat(g));return p(u)}function p(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(g).format("0,00.000");default:return Xs(g).format("0,00.00")}}Ne.useEffect(()=>{w()},[e.newId]);const x=()=>new Promise(async(g,u)=>{if(xs=="Android OS"||xs==="iOS"){let C=await _h(n.current);if(C){const j=await _(C);g(j)}}else{let C=await Ya(n.current);C&&g(C)}}),v=()=>new Promise(async(g,u)=>{const C=await x();g(C)}),_=g=>new Promise((u,C)=>{let j=new Image;j.src=g,j.onload=()=>{let I=document.createElement("canvas");const D=600,S=j.height;let k=j.width,$=j.height;k>$?k>D&&($*=D/k,k=D):$>S&&(k*=S/$,$=S),I.width=k,I.height=$,I.getContext("2d").drawImage(j,0,0,k,$),u(I.toDataURL())}}),w=async()=>{if(n&&n.current){const g=await v();e.onImageGenerated(g)}},T=g=>{let u=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:p(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,o)})]})),u},O=g=>{let u=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,o)}),s.jsx("span",{children:p(gs(g.totalCollection,C.value))+"%"})]}));return u},F=(g,u,C,j,I={})=>{let D=g.includes("upi://");const S=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${u}`;return s.jsx(Ja,{value:D?g:S,renderAs:"canvas",size:I.size??250})},M=(g,u)=>{var D,S;let C=0;if((D=u.taxObj)!=null&&D.VAT.length){let k,$,pe;for($=0;$<((S=u.taxObj)==null?void 0:S.VAT.length);$++){k=u.taxObj.VAT[$];for(pe in k)C+=_e(k[pe])}}const j={sellerName:u.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(u.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:u.finalAmount,invoiceVatTotal:C},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Ja,{value:I,renderAs:"canvas",size:250})},z=g=>{const u=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(u.push(s.jsx("hr",{})),g.rewardAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:le(g.rewardAmt,o)})]})),g.totalBalanceAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:le(g.totalBalanceAmt,o)})]})),g.writeOffAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:le(g.writeOffAmt,o)})]})),g.refundAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:le(g.refundAmt,o)})]})),g.cashCard&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:le(g.cashCard,o)})]}))),u},K=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].slugName===g)return u[C]}return!1},te=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].itemType===g)return u[C]}return!1},Q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ae=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Ch[g.discountType]}`,Ce=g=>{const u=new Array;if(g&&Object.keys(g).length!==0){u.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${Q[C]}:`}),s.jsx("span",{children:le(g[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][j]&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(j)}:`}),s.jsx("span",{children:le(g[C][j],o)})]}))}return u},W=(g,u)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(D=>{if(j=g.totalValue[D],D==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(S=>{if(S.taxType===D||!S.taxType)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.rate?m(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(S=>{const k=K(S,g.discArr);if(k&&j.cat[S]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.cat[S])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,g.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.itemTypes[S])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",g.taxObj&&g.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]})]}))}return k}):g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$])})]})}))}return k})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(D=>{if(j=g.totalValue[D],D==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(S=>{if(S.taxType===D)return s.jsxs("div",{style:S.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"(R) ":"",S.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[S.status==="RETURNED"?"-":"",S.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:S.rate?m(S.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:S.status==="RETURNED"?S.serviceAmount?p(S.serviceAmount):"":S.price?p(S.price):""})]}),S.addons&&S.addons.length&&S.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),S.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+S.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(S=>{const k=K(S,g.discArr);if(k&&j.cat[S]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.cat[S])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(S=>{const k=te(S,g.itemTypeDiscObj);if(k&&j.itemTypes[S]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.itemTypes[S])})]})}):"",g.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${S.name.toLowerCase()}`]??S.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(S=>s.jsx(s.Fragment,{children:S.taxOnAmount&&S.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+S.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[D]&&j?s.jsx(s.Fragment,{children:D==="GST"?g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$]/2)})]})]}))}return k}):g.taxObj[D].map(S=>{let k=new Array;for(const $ in S)if(S[$]&&S[$]!=0){let pe=$;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(S[$])})]})}))}return k})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},q=(g,u,{labels:C,doMultipleTax:j,type:I})=>{var S,k,$,pe,Te,Le,Pe,Ae,At,Et,xt;const D=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(G=>{var Rt;return s.jsxs("div",{style:G.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:[G.status==="RETURNED"?"(R) ":"",G.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[G.status==="RETURNED"?"-":"",G.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:G.serviceRate?m(G.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:G.sub_total?p(G.sub_total):""})]}),G.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",G.hsnCode]}),(Rt=G.addons)!=null&&Rt.length?G.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[G.status==="RETURNED"?"-":"",rt.qty*G.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",G.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+G.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname} ${Se}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(g.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(S=D.DISCOUNT_ITEMS)!=null&&S.length?D.DISCOUNT_ITEMS.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+G.discountName.toUpperCase()}}),s.jsx("span",{children:ae(G)})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.discountAmt)})]})):"",(k=D.CATEGORY_DISCOUNT)!=null&&k.length?D.CATEGORY_DISCOUNT.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+G.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+G.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.discountAmt)})]})):"",($=D.ITEM_DISCOUNT)!=null&&$.length?D.ITEM_DISCOUNT.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+ts(G.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+G.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.discountAmt)})]})):"",(Te=(pe=D.SEGMENT_DISCOUNT)==null?void 0:pe[0])!=null&&Te.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${D.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+D.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+D.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(D.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=D.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${D.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${D.COUPON_DISCOUNT[0].discountValue}${D.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(D.COUPON_DISCOUNT[0].discountAmt)})]}):"",(At=(Ae=D.ORDER_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(D.ORDER_DISCOUNT[0].discountValue)?`@${D.ORDER_DISCOUNT[0].discountValue}${D.ORDER_DISCOUNT[0].discountType=="RELATIVE"||D.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(D.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",u.couponCode?"COUPON DISC":"خصم الطلب",u.couponCode?`(${u.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Et=g.charges)!=null&&Et.length?g.charges.map(G=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${G.name.toLowerCase()}`]??G.name}})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(g.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(xt=g.taxation)!=null&&xt.length?g.taxation.map(G=>{if(G.taxAmt)return G.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+G.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[u.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+G.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${Se}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+G.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(G.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},B=(g,u)=>{var D,S;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((D=j.GST)==null?void 0:D.itemList)&&q(j.GST,g,{labels:u,doMultipleTax:C,type:"GST"}),((S=j.VAT)==null?void 0:S.itemList)&&q(j.VAT,g,{labels:u,doMultipleTax:C,type:"VAT"})]})},me=g=>{const u=g.services,C=Object.keys(g.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Se}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((D,S)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[D.toUpperCase(),":"]})}),u[D].map(k=>{var $;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),(($=k.addons)==null?void 0:$.length)&&k.addons.map(pe=>{var Te;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Te=pe.serviceName)==null?void 0:Te.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),j!==S+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},A=g=>{const u=g.slice(0,-4),C=g.slice(-4);return{firstDigits:u,last4Dgits:C}},Be=(g,u,C,j={})=>{const I=Object.keys(u??{});let D=[],S,k="flex-two-items";if(j.action==="addCharges"&&(k="display-percentage"),g&&I.length){D.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,o)})]})]}));for(let $=0;$<I.length;$++)S=I[$],u[S]&&D.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${S.replaceAll("_"," ")}:`}),s.jsx("span",{children:le(u[S],o)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(g,u[S]))+"%"}):""]}));D.push(s.jsx("hr",{}))}return D},st=g=>{const u=Object.keys(g.Category),C=Object.keys(g.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),u.forEach((I,D)=>{const S=g.Category[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach($=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),k,D!=u.length-1&&s.jsx("hr",{})]})]}))}),C.length>0&&(j.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),C.forEach((I,D)=>{const S=g.Addon[I];let k=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(I)]}),s.jsxs("section",{className:"products-section",children:[S.forEach($=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),k,D!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=g=>{var C;const u={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let I=0;I<g.customBillLabels.length;I++)j=g.customBillLabels[I],u[j.defaultName]=j.displayName}return u},pt=(g,u,C,j)=>{var $,pe,Te,Le,Pe,Ae,At,Et,xt,G,Rt,rt,Ns,js,on,vs,_s,cn,dn,hn,un,mn,fn,pn,Kt,bs,Nt,Qt,Zt,Ss,yn,Ts,gn,ws,Is,xn,Nn,Cs,Os;const I=nt(r.customLabelsMap),D=ms(xd(r.paymentModes),"internalName"),S=ee=>{var b;return(b=D[ee])!=null&&b.displayName?D[ee].displayName.toUpperCase():ee};if(g==="BILL"){let ee;if(l==="A4"||l==="A5"){let b={...u},Z=0,ue=b.distributedData;const y=ue.discounts;ee=s.jsx("div",{className:`invoiceContainer main-div ${L[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[b.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(b.customerInfo.custName||(($=b.customFields)==null?void 0:$.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),b.customerInfo.custName&&b.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custName})}),b.customerInfo.custContact&&b.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custContact})}),b.customerInfo.custAddress&&b.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custAddress})}),b.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.deliveryTimestamp})}),(pe=b.customFields)!=null&&pe.length?b.customFields.map(N=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[N.customName,": ",N.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyName})}),b.companyInfo.companyAddress&&b.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyAddress})}),b.companyInfo.companyEmail&&b.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyEmail})}),b.companyInfo.companyContact&&b.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyContact})}),b.fssai&&b.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:b.fssai})]})}),b.gst&&b.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:b.gst})]})}),b.vatNo&&b.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:b.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[b.itemList.map(N=>{var oe;let P="",V=[];return Z++,V.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:P,children:[s.jsx("td",{className:"text-align-left",children:N.serviceRate?Z:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:N.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:N.qty}),s.jsx("td",{className:"text-align-right",children:N.serviceRate?U(N.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:N.sub_total?U(N.sub_total,o):""})]}),N.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+N.instruction+")"})]})]})),(oe=N.addons)!=null&&oe.length&&N.addons.map(he=>{V.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",he.serviceName.toUpperCase()]}),s.jsx("td",{children:he.qty*N.qty})]}),he.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+he.instruction+")"})]})]}))}),V}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Z} Items and ${_e(ue.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(xa(b.finalAmount,o).toFixed(tn[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),b.upiId&&u.companyInfo.companyName&&s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:F(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmt,{size:100})})})})]}),b.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:b.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:U(ue.subTotal,o)})]}),(Te=y==null?void 0:y.DISCOUNT_ITEMS)!=null&&Te.length?y.DISCOUNT_ITEMS.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:ae(N)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Le=y==null?void 0:y.CATEGORY_DISCOUNT)!=null&&Le.length?y.CATEGORY_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(Pe=y==null?void 0:y.ITEM_DISCOUNT)!=null&&Pe.length?y.ITEM_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.discountAmt,o)})]})):"",(At=(Ae=y==null?void 0:y.SEGMENT_DISCOUNT)==null?void 0:Ae[0])!=null&&At.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+y.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(xt=(Et=y==null?void 0:y.COUPON_DISCOUNT)==null?void 0:Et[0])!=null&&xt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${y.COUPON_DISCOUNT[0].discountValue}${y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Rt=(G=y==null?void 0:y.ORDER_DISCOUNT)==null?void 0:G[0])!=null&&Rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(y.ORDER_DISCOUNT[0].discountValue)?`@${y.ORDER_DISCOUNT[0].discountValue}${y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(rt=ue.charges)!=null&&rt.length?ue.charges.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${N.name.toLowerCase()}`]??N.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.amt,o)})]})):"",ue.subTotal!==ue.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(ue.afterCharges,o)})]}):"",(Ns=ue.taxation)!=null&&Ns.length?ue.taxation.map(N=>N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+N.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.finalAmount,o)})]}),(js=u==null?void 0:u.custoutStandingData)!=null&&js.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((on=b==null?void 0:b.custoutStandingData)==null?void 0:on.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.grandTotal+((vs=b==null?void 0:b.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",b.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.rewardAmt,o)})]}):"",(_s=u.paymentMethods)!=null&&_s.length?u.paymentMethods.map(N=>{var P;if(N.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(P=N.paymentMode)==null?void 0:P.toLowerCase()}`]??S(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),N.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(N.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(N.paidAmt,o)})]})}):"",b.balanceAmt&&u.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(u.balanceAmt,o)})]}):"",u.balPoint&&!Number.isNaN(u.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:u.balPoint})]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${b.printby} Printed On: ${b.printTime}`}),b.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else ee=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[u.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&u.companyInfo.companyName&&u.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:u.companyInfo.companyName}),u.companyInfo.companyAddress&&u.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.companyInfo.companyAddress}}),u.companyInfo.companyContact&&u.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:u.companyInfo.companyContact})]})}),u.companyInfo.companyEmail&&u.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:u.companyInfo.companyEmail})]})}),u.fssai&&u.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:u.fssai})]})}),u.gst&&u.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:u.gst})]})}),u.vatNo&&u.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:u.vatNo})]})}),s.jsx("hr",{}),u.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.orderFrom}),u.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[u.area," : ",u.tableName?u.tableName:u.tableNo]}),u.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:u.tokenId})]})}),u.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${Se}`,children:[u.customerInfo.custName&&u.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:u.customerInfo.custName})]})}),u.customerInfo.custContact&&u.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:u.customerInfo.custContact})]})}),u.customerInfo.custAddress&&u.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:u.customerInfo.custAddress})]})}),bt(u.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),u.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:u.orderId})]})}),u.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:u.orderInfo.orderDate})]})}),u.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:u.deliveryTimestamp})]})}),u.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:u.captainName})]})})]}),(cn=u.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),u.customFields.map(b=>s.jsx("h4",{className:"left-align-entity",children:b.customName+": "+b.customValue}))]}):"",u.newFormat?B(u,I):W(u,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=u.custoutStandingData)!=null&&dn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=u.custoutStandingData)!=null&&hn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+p(u.finalAmount)})]}),(un=u.custoutStandingData)!=null&&un.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("h5",{children:u.curr+" "+p(u.custoutStandingData.balanceAmt)})]}),!u.rewardAmt&&!u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+p(u.finalAmount+u.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",u.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+u.usedPoints+" Points)"})]}),s.jsx("h5",{children:u.curr+" "+u.rewardAmt})]}):"",u.paymentMethods&&u.paymentMethods.length?u.paymentMethods.map(b=>{var Z;if(b.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${Se}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Z=b.paymentMode)==null?void 0:Z.toLowerCase()}`]??S(b.paymentMode)??"CASH"}}),s.jsx("span",{children:b.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:b.isRefund?s.jsx(s.Fragment,{children:u.curr+" ("+p(b.paidAmt)+")"}):s.jsx(s.Fragment,{children:u.curr+" "+p(b.paidAmt)})})]})}):"",u.rewardAmt&&!u.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+p(u.finalAmount+(((mn=u==null?void 0:u.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-u.rewardAmt)})]})}):"",u.balanceAmt&&u.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:u.curr+" "+p(u.balanceAmt)})]}):"",s.jsx("hr",{})]}),u.earnPoints&&u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:u.earnPoints})]}):"",(u.balPoint||u.earnPoints)&&!Number.isNaN(u.balPoint||u.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:u.balPoint+u.earnPoints||0})]}):"",u.upiId&&u.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),F(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmount)]}),u.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),M(r.vatNo,u)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",u.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.footerMessage}}):"",u.printby&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${u.printby}`}):"",u.printTime&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${u.printTime}`}):"",u.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return ee}else if(g==="PRINT_DASHBOARD"&&u.salesCollection){const ee=u.salesCollection.totalDiscountAmt?gs(u.salesCollection.grandTotal,u.salesCollection.totalDiscountAmt):null,b=u.salesCollection.totalCollection-u.salesCollection.totalTax;var k=R().format("DD/MM/YYYY LT");const Z=(fn=u.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(u.monthTillDateSalesColl.grandTotal,u.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${k}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:u.selectedDate})]}),s.jsx("hr",{}),u.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(u.monthTillDateSalesColl.totalDiscountAmt,o)}${Z?`(${p(Z)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalCollection-u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(u.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:le(u.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(u.salesCollection.totalDiscountAmt,o)}${ee?`(${p(ee)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(u.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(b,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(u.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(u.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Be(u.otherFields.totalDiscountAmt,u.otherFields.discountList,"Discount",{action:"addCharges"}),Be(u.otherFields.totalOtherCharges,u.otherFields.otherChargesList,"Charges"),Be(u.otherFields.totalTax,u.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:le(u.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:u.salesCollection.totalOrders})]}),T(u)]}),s.jsx("hr",{}),u.otherFields.totalItemType?s.jsx("div",{children:Be(u.otherFields.totalItemType,u.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",u.averageCollection.avgTableTime||u.averageCollection.avgorderValue||u.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),u.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:u.averageCollection.avgTableTime})]}):"",u.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:le(u.averageCollection.avgorderValue,o)})]}):"",u.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:u.averageCollection.noOfGuest})]}):"",u.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:le(u.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:le(u.totalCollection,o)})]}),O(u)]}),z(u.averageCollection),u.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:le(u.otherFields.salesCollection,o)})]}),u.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:le(u.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Ce(u.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let ee;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",ee.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((pn=a.services)==null?void 0:pn.length)&&a.services.map(Z=>{var ue;return s.jsxs("div",{style:Z.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:Z.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Z.qty})]}),((ue=Z.addons)==null?void 0:ue.length)&&Z.addons.map(y=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(y.serviceName)})),Z.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Z.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",_e(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:le(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Z=>{if(Z.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Z.name}),s.jsx("h5",{children:a.curr+" "+p(Z.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Z=>{let ue=new Array;for(const y in Z)if(Z[y]&&Z[y]!=0){let N=y/2;ue.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",N]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[u.taxLabel+" "," @",N,"%"]}),s.jsx("h5",{children:a.curr+" "+p(Z[y]/2)})]})]}))}return ue})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(Kt=a.customFeilds)==null?void 0:Kt.map(Z=>s.jsx("h4",{className:"left-align-entity",children:Z.customName+": "+Z.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let ee="";return a.action==="SWITCH_TABLE"?ee=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(bs=d.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Nt=a.from)==null?void 0:Nt.map((b,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[b])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[b])==null?void 0:N.tableName}${Z+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Zt=(Qt=e.tableData[a.to[0]])==null?void 0:Qt.attachedArea)==null?void 0:Zt.toUpperCase()} - ${(Ss=e.tableData[a.to[0]])==null?void 0:Ss.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):ee=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(yn=d.Table)==null?void 0:yn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ts=a.from)==null?void 0:Ts.map((b,Z)=>{var ue,y,N;return`${(y=(ue=e.tableData[b])==null?void 0:ue.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[b])==null?void 0:N.tableName}${Z+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(ws=(gn=e.tableData[a.to[0]])==null?void 0:gn.attachedArea)==null?void 0:ws.toUpperCase()} - ${(Is=e.tableData[a.to[0]])==null?void 0:Is.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),ee}else if(g==="COUNTER_OPERATION"){let ee;return l=="2INCH"||l=="1.8INCH"?ee=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0||b.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}):ee=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}),ee}else if(g==="ITEMWISE_SALES_COUNTER"){let ee,{counterDetails:b}=e.printerDataObject;return ee=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:b.currentDate}),s.jsx("hr",{}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",b.CounterName]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",b.openedBy]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",b.loginTime]}),b.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",b.logoutTime]}),b.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${b.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${b.printedOn}`})]})}),ee}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:ee}=e.printerDataObject;return getRechargeDetails(ee)}else if(g==="PACKAGING_SLIP"){let ee,b=0;u.aggregatorOrderId&&u.aggregatorOrderId!==""&&(ee=A(u.aggregatorOrderId));const Z=u.services;for(let y in Z)b+=Z[y].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[u.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:u.subOrderFrom.toUpperCase()}),u.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",u.tokenId]}),u.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.tableName}),u.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+u.otp}),u.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${u.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.last4Dgits||""})]}),u.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:u.zomatoInstant}),s.jsx("hr",{}),u.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+u.orderId}),u.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",u.date]}),u.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+u.prepareBy}):"",u.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+u.waiterName})]}),me(u),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",b]}),s.jsxs("h5",{children:["TOTAL QTY: ",_e(u.totalQty)]})]}),(xn=u.customFields)==null?void 0:xn.map(y=>s.jsx("h4",{className:"left-align-entity",children:y.customName+": "+y.customValue})),s.jsx("br",{}),u.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",u.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:sr(b.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(b.finalAmount)})]})},b.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+p(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+p(a.totalPaid)})]})]}),(Nn=a.transactions)!=null&&Nn.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:b.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+p(b.amount)})]})},b.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+p(a.totalPayable)})]})]})]})});{let ee,b=0,Z,ue;for(let N=0;N<(((Cs=a.services)==null?void 0:Cs.length)||0);N++)ue=a.services[N],ue.status==="CANCELLED"&&!a.onlyCancelledItems&&(b+=ue.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ee=A(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",b||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&ee&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${ee.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ee.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Se}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${Se}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(N=>(N.status==="CANCELLED"?Z=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}):Z=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(P=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(P.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}),s.jsx("div",{children:Z}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",_e(a.totalQty-b)]})]}),(Os=a.customFields)==null?void 0:Os.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(f,a.obj,a.companyLogo,a.companyQrCode)})})},Oh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var h,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((h=n[e.primaryWaiter])==null?void 0:h.name)||null);const{obj:c,printersMap:d}=_d(e,t,r);let m=[],p=[];const x=_a(c).flatMap(v=>{var _;return(_=d[v.station])==null?void 0:_.map(w=>new Promise(T=>s.jsx(tt,{printerDataObject:{staticDataKOT:v,paperSize:w.paperSize,printer:w.printer},newId:v.newId,value:{settingData:t},onImageGenerated:O=>{m.push({paperSize:w.paperSize,printer:w.printer,image:O,type:"KOT"}),T()},additionalActions:r},v.newId)))});if(l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{p.push(new Promise(w=>{x.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:T=>{m.push({paperSize:_.paperSize,printer:_.printer,image:T,type:"PACKAGING_SLIP"}),w()},additionalActions:r},_.obj.newId))}))})}x.length&&ft("root2",x),await Promise.all(p),i(m)}catch(l){a(l)}}),Mh=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let h=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),d=_a(o).flatMap(m=>{var p;return(p=c[m.station])==null?void 0:p.map(x=>new Promise(v=>{const _=s.jsx(tt,{printerDataObject:{staticDataKOT:m,paperSize:l,printer:x.printer,type:m.type},newId:m.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:w=>{h.push({paperSize:x.paperSize,printer:x.printer,image:w,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});d.length&&ft("root1",d),await Promise.all(f.map(m=>new Promise(m)))}r(h)}catch(a){i(a)}}),Ah=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});ft("root1",o)}),n(a)}catch(i){r(i)}}),Eh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});ft("root1",l)}),r(h)}catch(a){i(a)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await va(e,t,n),h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});ft("root1",l)}),r(h)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let h=await Id(e);if(h&&Object.keys(h.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(d=>{const m=s.jsx(tt,{printerDataObject:{staticDataKOT:h,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:p=>{l.push({paperSize:t.printerSize,image:p,type:"ITEMWISE_SALES_COUNTER"}),d()},additionalActions:r});ft("root1",m)}),i(l)}else i([])}catch(h){a(h)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let h=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:h,settingData:t,onImageGenerated:d=>{f.push({paperSize:t.printerSize,image:d,type:"COUNTER_OPERATION"}),l()},additionalActions:n});ft("root1",c)}),r(f)}catch(a){i(a)}}),Ph=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var h;try{const f=await Od(e,t);let o=[],l=ir(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(h=l[0])==null?void 0:h.paperSize:t.printerSize;await new Promise(m=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),m()},additionalActions:r});ft("root1",p)}),i(o)}catch(f){a(f)}}),Fh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const h=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=od(l.invoiceFormats,"createdAt")[0],d=await Md(c);await new Promise(p=>{const x=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:d.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:d.paperSize,image:v,type:"BILL"}),p()},additionalActions:n});h.push(x)})}}h.length&&ft("root1",h),r(f)}catch(h){i(h)}}),ft=(e,t)=>{const n=document.getElementById(e);n&&ai.createRoot(n).render(t)};Oe.counterDetailsPrint=Lh,Oe.handleAggregatorBillPrint=Eh,Oe.handleBillPrint=Rh,Oe.handleDashboardPrint=Ah,Oe.handleItemWisePrint=kh,Oe.handleKOTPrint=Oh,Oe.handleOldBillPrints=Fh,Oe.handleSummaryPrint=Ph,Oe.handleUpdateTablePrint=Mh,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|