@feedmepos/mf-report 5.21.0 → 5.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-C2Ss8NKL.js → App-7ECtlBsE.js} +3 -3
- package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-Drjbx428.js → BaseDialog.vue_vue_type_script_setup_true_lang-03nmej58.js} +2 -2
- package/dist/{Default.vue_vue_type_script_setup_true_lang-BYbWwMGa.js → Default.vue_vue_type_script_setup_true_lang-BhMWXLug.js} +1 -1
- package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-K3pGqbO8.js +2449 -0
- package/dist/{InsightView-FJEsbwz9.js → InsightView-DJJJmFkl.js} +2 -2
- package/dist/{Layout-1O1_FZpi.js → Layout-B1jaac85.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-C68Ld5C-.js → MenuTab.vue_vue_type_script_setup_true_lang-Bj3JwnRs.js} +3 -3
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DdhY7AFc.js → NavigationTab.vue_vue_type_script_setup_true_lang-BZVeEoDt.js} +1 -1
- package/dist/{OverviewView-2y5hq6CV.js → OverviewView-BxIDt48t.js} +4 -4
- package/dist/{Report-51l6dlhi.js → Report-P_a1NjPi.js} +2 -2
- package/dist/{ReportEditor-CAa0SmAZ.js → ReportEditor-D_qPAbnY.js} +3 -3
- package/dist/{ReportView-DUM9xuZa.js → ReportView-DvAt5U2I.js} +5 -5
- package/dist/{Setting-DhENtKBI.js → Setting-DLnskPxP.js} +2 -2
- package/dist/{TileEditor-Ct554UQW.js → TileEditor-D6CDxeW4.js} +3 -3
- package/dist/{TransitionFade-hXbulWpB.js → TransitionFade-Cthr-E6A.js} +2 -2
- package/dist/app.js +9 -9
- package/dist/assets/{formatChartData.worker-CJVlLdXW.js → formatChartData.worker-B_urmW55.js} +1 -1
- package/dist/assets/{processTableData.worker-DRkxI8qA.js → processTableData.worker-B_-FBESg.js} +1 -1
- package/package.json +1 -1
- package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-B5rVVspC.js +0 -2455
package/dist/assets/{processTableData.worker-DRkxI8qA.js → processTableData.worker-B_-FBESg.js}
RENAMED
|
@@ -81,7 +81,7 @@ Arguments: [`+D+"]"}},t.UnsupportedError.prototype={toString$0(i){return"Unsuppo
|
|
|
81
81
|
`+_.JSString_methods.$mul(" ",m-d+c.length)+`^
|
|
82
82
|
`}else return m!=null?g+(" (at offset "+t.S(m)+")"):g}},t.Iterable.prototype={map$1$1(i,e,r){return t.MappedIterable_MappedIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"),r)},map$1(i,e){return this.map$1$1(i,e,f.dynamic)},join$1(i,e){var r,n=this.get$iterator(this);if(!n.moveNext$0())return"";if(e===""){r="";do r+=t.S(a.toString$0$(n.get$current()));while(n.moveNext$0())}else for(r=""+t.S(a.toString$0$(n.get$current()));n.moveNext$0();)r=r+e+t.S(a.toString$0$(n.get$current()));return r.charCodeAt(0)==0,r},toList$1$growable(i,e){return t.List_List$of(this,!0,t._instanceType(this)._eval$1("Iterable.E"))},toList$0(i){return this.toList$1$growable(i,!0)},get$length(i){var e,r=this.get$iterator(this);for(e=0;r.moveNext$0();)++e;return e},get$isEmpty(i){return!this.get$iterator(this).moveNext$0()},elementAt$1(i,e){var r,n,u;for(t.RangeError_checkNotNegative(e,"index"),r=this.get$iterator(this),n=0;r.moveNext$0();){if(u=r.get$current(),e===n)return u;++n}throw t.wrapException(t.IndexError$withLength(e,n,this,null,"index"))},toString$0(i){return t.IterableBase_iterableToShortString(this,"(",")")}},t._GeneratorIterable.prototype={elementAt$1(i,e){var r=this.length;return(0>e||e>=r)&&t.throwExpression(t.IndexError$withLength(e,r,this,null,"index")),this._generator.call$1(e)},get$length(i){return this.length}},t.Iterator.prototype={},t.MapEntry.prototype={toString$0(i){return"MapEntry("+t.S(this.key)+": "+t.S(this.value)+")"}},t.Null.prototype={get$hashCode(i){return t.Object.prototype.get$hashCode.call(this,this)},toString$0(i){return"null"}},t.Object.prototype={$isObject:1,$eq(i,e){return this===e},get$hashCode(i){return t.Primitives_objectHashCode(this)},toString$0(i){return"Instance of '"+t.Primitives_objectTypeName(this)+"'"},noSuchMethod$1(i,e){throw t.wrapException(t.NoSuchMethodError$_(this,e.get$memberName(),e.get$positionalArguments(),e.get$namedArguments(),null))},toString(){return this.toString$0(this)}},t.Sink.prototype={},t.StringBuffer.prototype={get$length(i){return this._contents.length},toString$0(i){var e=this._contents;return e.charCodeAt(0)==0,e}},t.Endian.prototype={},t.Digest.prototype={$eq(i,e){var r,n,u,o,s;if(e==null)return!1;if(e instanceof t.Digest){if(r=this.bytes,n=e.bytes,u=r.length,u!==n.length)return!1;for(o=0,s=0;s<u;++s)o|=r[s]^n[s];return o===0}return!1},get$hashCode(i){return t.Object_hashAll(this.bytes)},toString$0(i){return t._hexEncode(this.bytes)}},t.DigestSink.prototype={},t.HashSink.prototype={close$0(i){var e,r,n=this;n._isClosed||(n._isClosed=!0,n._finalizeData$0(),n._iterate$0(),e=n._hash_sink$_sink,r=n._byteDigest$0(),e._value!=null&&t.throwExpression(t.StateError$("add may only be called once.")),e._value=new t.Digest(r))},_byteDigest$0(){var i,e,r,n,u;if(_.C_Endian===S.$get$Endian_host())return t.NativeUint8List_NativeUint8List$view(this.digest.buffer,0,null);for(i=this.digest,e=i.byteLength,r=new Uint8Array(e),n=t.NativeByteData_NativeByteData$view(r.buffer,0,null),u=0;u<5;++u)n.setUint32(u*4,i[u],!1);return r},_iterate$0(){var i,e,r,n=this._pendingData,u=t.NativeByteData_NativeByteData$view(n._buffer.buffer,0,null),o=this._currentChunk,s=_.JSInt_methods.$tdiv(n._typed_buffer$_length,o.byteLength);for(i=o.length,e=0;e<s;++e){for(r=0;r<i;++r)o[r]=u.getUint32(e*o.byteLength+r*4,!1);this.updateHash$1(o)}o=s*o.byteLength,t.RangeError_checkValidRange(0,o,n.get$length(n)),o>0&&n._closeGap$2(n,0,o)},_finalizeData$0(){var i,e,r,n,u,o,s=this,l=s._pendingData;for(l._add$1(128),i=s._lengthInBytes+1+8,e=s._currentChunk.byteLength,e=((i+e-1&-e)>>>0)-i,r=0;r<e;++r)l._add$1(0);if(e=s._lengthInBytes,e>0x3ffffffffffff)throw t.wrapException(t.UnsupportedError$("Hashing is unsupported for messages with more than 2^53 bits."));n=e*8,u=l._typed_buffer$_length,l.addAll$1(0,new Uint8Array(8)),o=t.NativeByteData_NativeByteData$view(l._buffer.buffer,0,null),o.setUint32(u,_.JSInt_methods._tdivFast$1(n,4294967296),!1),o.setUint32(u+4,n>>>0,!1)}},t._Sha1Sink.prototype={updateHash$1(i){var e,r,n,u,o,s=this.digest,l=s[0],D=s[1],d=s[2],c=s[3],p=s[4];for(e=this._extended,r=0;r<80;++r,p=c,c=d,d=o,D=l,l=u)r<16?e[r]=i[r]:(n=e[r-3]^e[r-8]^e[r-14]^e[r-16],e[r]=(n<<1|n>>>31)>>>0),u=(((l<<5|l>>>27)>>>0)+p>>>0)+e[r]>>>0,r<20?u=(u+((D&d|~D&c)>>>0)>>>0)+1518500249>>>0:r<40?u=(u+((D^d^c)>>>0)>>>0)+1859775393>>>0:u=r<60?(u+((D&d|D&c|d&c)>>>0)>>>0)+2400959708>>>0:(u+((D^d^c)>>>0)>>>0)+3395469782>>>0,o=(D<<30|D>>>2)>>>0;s[0]=l+s[0]>>>0,s[1]=D+s[1]>>>0,s[2]=d+s[2]>>>0,s[3]=c+s[3]>>>0,s[4]=p+s[4]>>>0}},t.DateSymbols.prototype={toString$0(i){return this.NAME}},t.DateBuilder.prototype={setYear$1(i){this.year=i},setMonth$1(i){this.month=i},setDay$1(i){this.day=i},setDayOfYear$1(i){this.dayOfYear=i},setHour$1(i){this.hour=i},setMinute$1(i){this.minute=i},setSecond$1(i){this.second=i},setFractionalSecond$1(i){this.fractionalSecond=i},_offsetYear$2(i,e){return this._dateTimeConstructor.call$8(i.get$year()+e,i.get$month(),i.get$day(),i.get$hour(),i.get$minute(),i.get$second(),i.get$millisecond(),i.get$isUtc())},asDate$1$retries(i){var e,r,n,u,o,s,l,D,d,c,p,y=this,g=y._date;return g!=null||(y._hasAmbiguousCentury?(g=y.year,e=g<0||g>=100):e=!0,e?(g=y.year,r=y.month,n=y.dayOfYear,n===0&&(n=y.day),u=y.pm,o=y.hour,u=u?o+12:o,s=y._dateTimeConstructor.call$8(g,r,n,u,y.minute,y.second,y.fractionalSecond,y.utc)):(S.$get$_clockKey(),l=t.systemTime(),y.utc&&(l=l.toUtc$0()),D=y._offsetYear$2(l,-80),d=y._offsetYear$2(l,20),g=_.JSInt_methods._tdivFast$1(D.get$year(),100),r=_.JSInt_methods._tdivFast$1(d.get$year(),100),n=y.year,u=y.month,o=y.dayOfYear,o===0&&(o=y.day),c=y.pm,p=y.hour,c=c?p+12:p,p=y._dateTimeConstructor,s=p.call$8(r*100+n,u,o,c,y.minute,y.second,y.fractionalSecond,y.utc),s.compareTo$1(0,d)<=0||(r=y.year,n=y.month,u=y.dayOfYear,u===0&&(u=y.day),o=y.pm,c=y.hour,o=o?c+12:c,s=p.call$8(g*100+r,n,u,o,y.minute,y.second,y.fractionalSecond,y.utc))),y.utc&&e?(y._date=s,g=s):g=y._date=y._correctForErrors$2(s,i)),g},asDate$0(){return this.asDate$1$retries(3)},_correctForErrors$2(i,e){var r,n,u,o,s,l,D,d,c=this;return e<=0?i:(r=i.get$year(),r=t.Primitives_valueFromDecomposedDate(r,2,29,0,0,0,0,!1),t._isInt(r)||t.throwExpression(t.argumentErrorValue(r)),n=t.Primitives_getMonth(new t.DateTime(r,!1))===2,u=t.dayOfYear(i.get$month(),i.get$day(),n),c.utc?r=!1:i.get$isUtc()?(r=i.get$hour(),o=c.pm,s=c.hour,r===(o?s+12:s)&&i.get$day(),r=!0):r=!1,r?(++c._retried,c.asDate$1$retries(e-1)):c.dateOnly&&i.get$hour()!==0?(l=c.asDate$1$retries(e-1),l.$eq(0,i)?(D=c.dayOfYear,D===0&&(D=t.dayOfYear(c.month,c.day,n)),d=i.add$1(0,t.Duration$(0,(D-u)*24-i.get$hour(),0,0,0,0)),d.get$hour()===0?d:t.dayOfYear(d.get$month(),d.get$day(),n)!==D?i:d):l):i)}},t.DateFormat.prototype={_parse$3$strict$utc(i,e,r){var n,u,o,s=this,l=new t.DateBuilder(s._locale,s.dateTimeConstructor),D=s._dateOnly;for(l.dateOnly=D??(s._dateOnly=s.get$_checkDateOnly()),n=new t.StringStack(i),D=s.get$_formatFields(),u=D.length,o=0;o<D.length;D.length===u||(0,t.throwConcurrentModificationError)(D),++o)D[o].parse$2(n,l);return l.asDate$0()},get$_checkDateOnly(){return _.JSArray_methods.every$1(this.get$_formatFields(),new t.DateFormat__checkDateOnly_closure)},get$_formatFields(){var i,e=this,r=e._formatFieldsPrivate;return r==null&&(e._date_format$_pattern==null&&(e.addPattern$1("yMMMMd"),e.addPattern$1("jms")),r=e._date_format$_pattern,r.toString,r=e._parsePatternHelper$1(r),i=t._arrayInstanceType(r)._eval$1("ReversedListIterable<1>"),i=e._formatFieldsPrivate=t.List_List$of(new t.ReversedListIterable(r,i),!0,i._eval$1("ListIterable.E")),r=i),r},_appendPattern$2(i,e){var r=this._date_format$_pattern;this._date_format$_pattern=r==null?i:r+e+i},addPattern$1(i){var e,r,n=this;return n._formatFieldsPrivate=null,e=S.$get$dateTimePatterns(),r=n._locale,e.toString,(t.canonicalizedLocale(r)==="en_US"?e.fallbackData:e._throwException$0()).containsKey$1(i)?(e=S.$get$dateTimePatterns(),e.toString,n._appendPattern$2((t.canonicalizedLocale(r)==="en_US"?e.fallbackData:e._throwException$0()).$index(0,i)," ")):n._appendPattern$2(i," "),n},get$dateSymbols(){var i,e=this._locale;return e!==S.lastDateSymbolLocale&&(S.lastDateSymbolLocale=e,i=S.$get$_dateTimeSymbols(),i.toString,S.cachedDateSymbols=t.canonicalizedLocale(e)==="en_US"?i.fallbackData:i._throwException$0()),e=S.cachedDateSymbols,e.toString,e},get$useNativeDigits(){var i=this._useNativeDigits;return i==null&&(S.DateFormat__useNativeDigitsByDefault.$index(0,this._locale),i=this._useNativeDigits=!0),i},get$digitMatcher(){var i=this,e=i._digitMatcher;return e!=null||(e=S.DateFormat__digitMatchers.putIfAbsent$2(i.get$localeZero(),i.get$_initDigitMatcher()),i._digitMatcher=e,e.toString),e},get$localeZeroCodeUnit(){var i=this._localeZeroCodeUnit;return i??(this._localeZeroCodeUnit=_.JSString_methods._codeUnitAt$1(this.get$localeZero(),0))},get$localeZero(){var i=this,e=i._localeZero;return e==null&&(i.get$useNativeDigits(),i.get$dateSymbols(),e=i._localeZero="0"),e},_initDigitMatcher$0(){var i,e;return this.get$useNativeDigits(),i=this._localeZeroCodeUnit,e=S.$get$asciiZeroCodeUnit(),i==e?S.$get$asciiDigitMatcher():(i=f.int,t.RegExp_RegExp("^["+t.String_String$fromCharCodes(t.Iterable_Iterable$generate(10,new t.DateFormat__initDigitMatcher_closure,i).map$1$1(0,new t.DateFormat__initDigitMatcher_closure0(this),i).toList$0(0),0,null)+"]+",!1))},_parsePatternHelper$1(i){var e,r;return i.length===0?t._setArrayType([],f.JSArray__DateFormatField):(e=this._date_format$_match$1(i),e==null?t._setArrayType([],f.JSArray__DateFormatField):(r=this._parsePatternHelper$1(_.JSString_methods.substring$1(i,e.fullPattern$0().length)),r.push(e),r))},_date_format$_match$1(i){var e,r,n,u;for(e=0;r=S.$get$DateFormat__matchers(),e<3;++e)if(n=r[e].firstMatch$1(i),n!=null)return r=t.DateFormat__fieldConstructors()[e],u=n._match[0],u.toString,r.call$2(u,this);return null}},t.DateFormat_dateTimeConstructor_closure.prototype={call$8(i,e,r,n,u,o,s,l){var D;return l?(D=t.Primitives_valueFromDecomposedDate(i,e,r,n,u,o,s,!0),t._isInt(D)||t.throwExpression(t.argumentErrorValue(D)),new t.DateTime(D,!0)):(D=t.Primitives_valueFromDecomposedDate(i,e,r,n,u,o,s,!1),t._isInt(D)||t.throwExpression(t.argumentErrorValue(D)),new t.DateTime(D,!1))},"call*":"call$8",$requiredArgCount:8,$signature:50},t.DateFormat__checkDateOnly_closure.prototype={call$1(i){return i.get$forDate()},$signature:67},t.DateFormat__initDigitMatcher_closure.prototype={call$1(i){return i},$signature:43},t.DateFormat__initDigitMatcher_closure0.prototype={call$1(i){return this.$this.get$localeZeroCodeUnit()+i},$signature:43},t.DateFormat__fieldConstructors_closure.prototype={call$2(i,e){var r=t._DateFormatQuotedField__patchQuotes(i);return _.JSString_methods.trim$0(r),new t._DateFormatQuotedField(i,r,e)},$signature:90},t.DateFormat__fieldConstructors_closure0.prototype={call$2(i,e){return _.JSString_methods.trim$0(i),new t._DateFormatPatternField(i,e)},$signature:93},t.DateFormat__fieldConstructors_closure1.prototype={call$2(i,e){return _.JSString_methods.trim$0(i),new t._DateFormatLiteralField(i,e)},$signature:99},t._DateFormatField.prototype={get$forDate(){return!0},fullPattern$0(){return this.pattern},toString$0(i){return this.pattern},parseLiteral$1(i){var e=this.pattern,r=e.length,n=i.peek$1(r);i._string_stack$_index+=r,n!==e&&this.throwFormatException$1(i)},throwFormatException$1(i){throw t.wrapException(t.FormatException$("Trying to read "+this.toString$0(0)+" from "+i.toString$0(0),null,null))}},t._DateFormatLiteralField.prototype={parse$2(i,e){this.parseLiteral$1(i)}},t._DateFormatQuotedField.prototype={fullPattern$0(){return this._fullPattern},parse$2(i,e){this.parseLiteral$1(i)}},t._DateFormatPatternField.prototype={parse$2(i,e){this.parseField$2(i,e)},get$forDate(){var i=this._forDate;return i==null&&(i=this.pattern[0],i=this._forDate=t.stringContainsUnchecked("cdDEGLMQvyZz",i,0)),i},parseField$2(i,e){var r,n,u=this;try{switch(r=u.pattern,r[0]){case"a":u.parseEnumeratedString$2(i,u.parent.get$dateSymbols().AMPMS)===1&&(e.pm=!0);break;case"c":u.parseStandaloneDay$1(i);break;case"d":u.handleNumericField$2(i,e.get$setDay());break;case"D":u.handleNumericField$2(i,e.get$setDayOfYear());break;case"E":n=u.parent,u.parseEnumeratedString$2(i,r.length>=4?n.get$dateSymbols().WEEKDAYS:n.get$dateSymbols().SHORTWEEKDAYS);break;case"G":n=u.parent,u.parseEnumeratedString$2(i,r.length>=4?n.get$dateSymbols().ERANAMES:n.get$dateSymbols().ERAS);break;case"h":u.handleNumericField$2(i,e.get$setHour()),e.hour===12&&(e.hour=0);break;case"H":u.handleNumericField$2(i,e.get$setHour());break;case"K":u.handleNumericField$2(i,e.get$setHour());break;case"k":u.handleNumericField$3(i,e.get$setHour(),-1);break;case"L":u.parseStandaloneMonth$2(i,e);break;case"M":u.parseMonth$2(i,e);break;case"m":u.handleNumericField$2(i,e.get$setMinute());break;case"Q":break;case"S":u.handleNumericField$2(i,e.get$setFractionalSecond());break;case"s":u.handleNumericField$2(i,e.get$setSecond());break;case"v":break;case"y":u.handleNumericField$2(i,e.get$setYear()),e._hasAmbiguousCentury=r.length===2;break;case"z":break;case"Z":break;default:return}}catch{u.throwFormatException$1(i)}},handleNumericField$3(i,e,r){var n=this.parent;e.call$1(this._nextInteger$3(i,n.get$digitMatcher(),n.get$localeZeroCodeUnit())+r)},handleNumericField$2(i,e){return this.handleNumericField$3(i,e,0)},_nextInteger$3(i,e,r){var n,u,o,s,l=e.stringMatch$1(i.peek$1(i.contents.length-i._string_stack$_index));if(l==null||l.length===0)return this.throwFormatException$1(i);if(n=l.length,i._string_stack$_index+=n,u=S.$get$asciiZeroCodeUnit(),r!==u){for(n>4294967295&&t.throwExpression(t.RangeError$range(n,0,4294967295,"length",null)),o=a.JSArray_JSArray$markFixed(new Array(n),f.int),s=0;s<n;++s)o[s]=_.JSString_methods._codeUnitAt$1(l,s)-r+u;l=t.String_String$fromCharCodes(o,0,null)}return t.int_parse(l)},parseEnumeratedString$2(i,e){var r,n,u,o,s,l,D,d,c=t._setArrayType([],f.JSArray_int);for(r=e.length,n=i.contents,u=n.length,o=0;o<r;++o)s=e[o],l=i._string_stack$_index,_.JSString_methods.substring$2(n,l,Math.min(l+s.length,u))===s&&c.push(o);for(c.length===0&&this.throwFormatException$1(i),D=_.JSArray_methods.get$first(c),c=t.SubListIterable$(c,1,null,f.int),c=new t.ListIterator(c,c.get$length(c)),r=t._instanceType(c)._precomputed1;c.moveNext$0();)n=c.__internal$_current,d=n??r._as(n),e[d].length>=e[D].length&&(D=d);return i._string_stack$_index+=e[D].length,D},parseMonth$2(i,e){var r,n=this;switch(n.pattern.length){case 5:r=n.parent.get$dateSymbols().NARROWMONTHS;break;case 4:r=n.parent.get$dateSymbols().MONTHS;break;case 3:r=n.parent.get$dateSymbols().SHORTMONTHS;break;default:return n.handleNumericField$2(i,e.get$setMonth())}e.month=n.parseEnumeratedString$2(i,r)+1},parseStandaloneDay$1(i){var e,r=this;switch(r.pattern.length){case 5:e=r.parent.get$dateSymbols().STANDALONENARROWWEEKDAYS;break;case 4:e=r.parent.get$dateSymbols().STANDALONEWEEKDAYS;break;case 3:e=r.parent.get$dateSymbols().STANDALONESHORTWEEKDAYS;break;default:return r.handleNumericField$2(i,new t._DateFormatPatternField_parseStandaloneDay_closure)}r.parseEnumeratedString$2(i,e)},parseStandaloneMonth$2(i,e){var r,n=this;switch(n.pattern.length){case 5:r=n.parent.get$dateSymbols().STANDALONENARROWMONTHS;break;case 4:r=n.parent.get$dateSymbols().STANDALONEMONTHS;break;case 3:r=n.parent.get$dateSymbols().STANDALONESHORTMONTHS;break;default:return n.handleNumericField$2(i,e.get$setMonth())}e.month=n.parseEnumeratedString$2(i,r)+1}},t._DateFormatPatternField_parseStandaloneDay_closure.prototype={call$1(i){return i},$signature:6},t.StringStack.prototype={peek$1(i){var e=this.contents,r=this._string_stack$_index;return _.JSString_methods.substring$2(e,r,Math.min(r+i,e.length))},toString$0(i){return this.contents+" at "+this._string_stack$_index}},t.UninitializedLocaleData.prototype={$index(i,e){return t.canonicalizedLocale(e)==="en_US"?this.fallbackData:this._throwException$0()},_throwException$0(){throw t.wrapException(new t.LocaleDataException("Locale data has not been initialized, call "+this.message+"."))}},t.LocaleDataException.prototype={toString$0(i){return"LocaleDataException: "+this.message}},t.StartOfWeek.prototype={_enumToString$0(){return"StartOfWeek."+this._name}},t.Units.prototype={_enumToString$0(){return"Units."+this._name}},t.Jiffy.prototype={get$dateTime(){var i=this.__Jiffy__dateTime_A;return i===S&&t.throwUnnamedLateFieldNI(),i},_parseMap$1(i){var e,r,n,u,o,s,l;return i.forEach$1(0,new t.Jiffy__parseMap_closure),i.get$isEmpty(i)?new t.DateTime(Date.now(),!1):(e=i.$index(0,"year"),e==null&&(e=i.$index(0,"years")),e==null&&(e=i.$index(0,"y")),e==null&&(e=t.Primitives_getYear(new t.DateTime(Date.now(),!1))),r=i.$index(0,"month"),r==null&&(r=i.$index(0,"months")),r==null&&(r=i.$index(0,"M")),r==null&&(r=t.Primitives_getMonth(new t.DateTime(Date.now(),!1))),n=i.$index(0,"day"),n==null&&(n=i.$index(0,"days")),n==null&&(n=i.$index(0,"d")),n==null&&(n=t.Primitives_getDay(new t.DateTime(Date.now(),!1))),u=i.$index(0,"hour"),u==null&&(u=i.$index(0,"hours")),u==null&&(u=i.$index(0,"h")),u==null&&(u=t.Primitives_getHours(new t.DateTime(Date.now(),!1))),o=i.$index(0,"minute"),o==null&&(o=i.$index(0,"minutes")),o==null&&(o=i.$index(0,"m")),o==null&&(o=t.Primitives_getMinutes(new t.DateTime(Date.now(),!1))),s=i.$index(0,"second"),s==null&&(s=i.$index(0,"seconds")),s==null&&(s=i.$index(0,"s")),s==null&&(s=t.Primitives_getSeconds(new t.DateTime(Date.now(),!1))),l=i.$index(0,"millisecond"),l==null&&(l=i.$index(0,"milliseconds")),l==null&&(l=i.$index(0,"ms")),l==null&&(l=t.Primitives_getMilliseconds(new t.DateTime(Date.now(),!1))),e=t.Primitives_valueFromDecomposedDate(e,r,n,u,o,s,l,!1),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!1))},_parseList$1(i){var e,r,n,u,o,s,l=a.getInterceptor$asx(i);return l.get$isEmpty(i)?new t.DateTime(Date.now(),!1):(e=l.$index(i,0),r=l.get$length(i)>1?l.$index(i,1):1,n=l.get$length(i)>2?l.$index(i,2):1,u=l.get$length(i)>3?l.$index(i,3):0,o=l.get$length(i)>4?l.$index(i,4):0,s=l.get$length(i)>5?l.$index(i,5):0,l=l.get$length(i)>6?l.$index(i,6):0,l=t.Primitives_valueFromDecomposedDate(e,r,n,u,o,s,l,!1),t._isInt(l)||t.throwExpression(t.argumentErrorValue(l)),new t.DateTime(l,!1))},_parseString$2(i,e){var r="yyyy/MM/dd",n="(\\d{4})(\\d{1,2})(\\d{1,2})$",u=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}$",!1);if(u._nativeRegExp.test(i))return t.DateFormat$("yyyy-MM-dd")._parse$3$strict$utc(i,!1,!1);if(u=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),u._nativeRegExp.test(i)?u=!0:(u=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),u=u._nativeRegExp.test(i)),u)return t.DateTime_parse(i).toLocal$0();if(u=t.RegExp_RegExp("\\d{4}\\/\\d{1,2}\\/\\d{1,2}$",!1),u._nativeRegExp.test(i))return t.DateFormat$(r)._parse$3$strict$utc(i,!1,!1);if(u=t.RegExp_RegExp(n,!1),u._nativeRegExp.test(i))return t.DateFormat$(r)._parse$3$strict$utc(t.stringReplaceAllFuncUnchecked(i,t.RegExp_RegExp(n,!1),new t.Jiffy__parseString_closure,null),!1,!1);throw t.wrapException(t.JiffyException$('Date time not recognized, a pattern must be passed, e.g. Jiffy("12, Oct", "dd, MMM")').get$cause())},add$1$minutes(i,e){var r=this,n=r.__Jiffy__dateTime_A;return n===S&&t.throwUnnamedLateFieldNI(),n=n.add$1(0,_.Duration_0),r.__Jiffy__dateTime_A=n,n=n.add$1(0,t.Duration$(0,0,0,0,e,0)),r.__Jiffy__dateTime_A=n,n=r._addMonths$2(n,0),r.__Jiffy__dateTime_A=n,r.__Jiffy__dateTime_A=r._addMonths$2(n,0),t.Jiffy$(r)},subtract$1$days(i){var e=this,r=e.__Jiffy__dateTime_A;return r===S&&t.throwUnnamedLateFieldNI(),r=r.subtract$1(_.Duration_0),e.__Jiffy__dateTime_A=r,r=r.subtract$1(t.Duration$(i,0,0,0,0,0)),e.__Jiffy__dateTime_A=r,r=e._addMonths$2(r,-0),e.__Jiffy__dateTime_A=r,e.__Jiffy__dateTime_A=e._addMonths$2(r,-0),t.Jiffy$(e)},_addMonths$2(i,e){var r,n,u,o,s,l,D,d=_.JSInt_methods.$mod(e,12),c=_.JSInt_methods._tdivFast$1(e-d,12),p=i.get$year()+c,y=i.get$month()+d;return y>12&&(++p,y-=12),r=i.get$day(),n=_.List_mC8[y],y===2&&_.JSInt_methods.$mod(p,4)===0?u=_.JSInt_methods.$mod(p,100)!==0||_.JSInt_methods.$mod(p,400)===0:u=!1,u&&++n,o=Math.min(r,n),i.get$isUtc()?(r=i.get$hour(),u=i.get$minute(),s=i.get$second(),l=i.get$millisecond(),D=i.get$microsecond(),r=t.Primitives_valueFromDecomposedDate(p,y,o,r,u,s,l+_.JSNumber_methods.round$0(D/1e3),!0),t._isInt(r)||t.throwExpression(t.argumentErrorValue(r)),new t.DateTime(r,!0)):(r=i.get$hour(),u=i.get$minute(),s=i.get$second(),l=i.get$millisecond(),D=i.get$microsecond(),r=t.Primitives_valueFromDecomposedDate(p,y,o,r,u,s,l+_.JSNumber_methods.round$0(D/1e3),!1),t._isInt(r)||t.throwExpression(t.argumentErrorValue(r)),new t.DateTime(r,!1))}},t.Jiffy__parseMap_closure.prototype={call$2(i,e){(i==="M"?i:t.normalizeUnits(i))==="0"&&t.throwExpression(t.JiffyException$('Invalid unit passed, the following units are available "year", "month", "week", "day", "hour", "minute", "second", "millisecond"').get$cause())},$signature:35},t.Jiffy__parseString_closure.prototype={call$1(i){return t.S(i.group$1(0,1))+"/"+t.S(i.group$1(0,2))+"/"+t.S(i.group$1(0,3))},$signature:15},t.ArLyLocale.prototype={},t.ArSaMaDzKwTnLocale.prototype={},t.AzLocale.prototype={},t.BnLocale.prototype={},t.DeLocale.prototype={},t.EnLocale.prototype={},t.EsLocale.prototype={},t.FaLocale.prototype={},t.FrLocale.prototype={},t.HiLocale.prototype={},t.IdLocale.prototype={},t.ItLocale.prototype={},t.JaLocale.prototype={},t.KoLocale.prototype={},t.Locale.prototype={},t.NbLocale.prototype={},t.NlLocale.prototype={},t.PlLocale.prototype={},t.PtLocale.prototype={},t.RuLocale.prototype={},t.SvLocale.prototype={},t.ThLocale.prototype={},t.TrLocale.prototype={},t.UkLocale.prototype={},t.ZhCnLocale.prototype={},t.ZhLocale.prototype={},t.JiffyException.prototype={get$cause(){return"JiffyException: "+this._cause}},t.BufferModule.prototype={},t.BufferConstants.prototype={},t.Buffer.prototype={},t.ConsoleModule.prototype={},t.Console.prototype={},t.EventEmitter.prototype={},t.Promise.prototype={},t.Date.prototype={},t.JsError.prototype={},t.Atomics.prototype={},t.Modules.prototype={},t.Module.prototype={},t.Net.prototype={},t.Socket.prototype={},t.NetAddress.prototype={},t.NetServer.prototype={},t.NodeJsError.prototype={},t.JsAssertionError.prototype={},t.JsRangeError.prototype={},t.JsReferenceError.prototype={},t.JsSyntaxError.prototype={},t.JsTypeError.prototype={},t.JsSystemError.prototype={},t.Process.prototype={},t.CPUUsage.prototype={},t.Release.prototype={},t.StreamModule.prototype={},t.Readable.prototype={},t.Writable.prototype={},t.Duplex.prototype={},t.Transform.prototype={},t.WritableOptions.prototype={},t.ReadableOptions.prototype={},t.Immediate.prototype={},t.Timeout.prototype={},t.TTY.prototype={},t.TTYReadStream.prototype={},t.TTYWriteStream.prototype={},t.Util.prototype={},t.Connection.prototype={},t.SchemaLibrary.prototype={SchemaLibrary$2$connection$schemas(i,e){var r,n,u,o,s;for(r=this._schemas,n=i.sourceDatasetId,u=i.targetDatasetId,o=0;o<75;++o)s=r[o],s._rawTablePrefix=n,s._materializeTablePrefix=u},getSchema$1(i){return _.JSArray_methods.firstWhere$1(this._schemas,new t.SchemaLibrary_getSchema_closure(i))},get$visualizationSchemas(){var i=this._schemas,e=t._arrayInstanceType(i),r=e._eval$1("MappedIterable<1,VisualizationSchema>");return t.List_List$of(new t.MappedIterable(new t.WhereIterable(i,new t.SchemaLibrary_visualizationSchemas_closure,e._eval$1("WhereIterable<1>")),new t.SchemaLibrary_visualizationSchemas_closure0,r),!0,r._eval$1("Iterable.E"))}},t.SchemaLibrary_getSchema_closure.prototype={call$1(i){return i.name===this.name},$signature:28},t.SchemaLibrary_visualizationSchemas_closure.prototype={call$1(i){return!i.isMaterializeOnly},$signature:28},t.SchemaLibrary_visualizationSchemas_closure0.prototype={call$1(i){return i.get$visualizationSchema()},$signature:45},t.QueryEngineContext.prototype={},t.Materialize_get_createMaterializedTableSql_closure.prototype={call$1(i){return i.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure0.prototype={call$1(i){return"ADD COLUMN IF NOT EXISTS "+i.name+" "+i.type._name},$signature:10},t.Materialize_get_createMaterializedTableSql_closure1.prototype={call$1(i){return i.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure2.prototype={call$1(i){return i.name+" "+i.type._name},$signature:10},t.Materialize_getMergeSql_closure.prototype={call$1(i){return i.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure0.prototype={call$1(i){return"SAFE_CAST(JSON_VALUE("+this._this.name._name+", '$."+t.S(i.pointTo)+"') AS "+i.type._name+") AS "+i.name},$signature:10},t.Materialize_getMergeSql_closure1.prototype={call$1(i){return i.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure2.prototype={call$1(i){return i.name},$signature:10},t.Materialize_getMergeSql_closure3.prototype={call$1(i){return i.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure4.prototype={call$1(i){var e=i.name;return e+"=source_table."+e},$signature:10},t.SOURCE_TYPE.prototype={_enumToString$0(){return"SOURCE_TYPE."+this._name}},t.SCHEMA_NAME.prototype={_enumToString$0(){return"SCHEMA_NAME."+this._name}},t.DATA_TYPE.prototype={_enumToString$0(){return"DATA_TYPE."+this._name}},t.AGGREGATION_TYPE.prototype={_enumToString$0(){return"AGGREGATION_TYPE."+this._name}},t.COMPARISON_OPERATOR.prototype={_enumToString$0(){return"COMPARISON_OPERATOR."+this._name}},t.DIMENSION_OPTION.prototype={_enumToString$0(){return"DIMENSION_OPTION."+this._name}},t.TIME_FORMATTER.prototype={_enumToString$0(){return"TIME_FORMATTER."+this._name}},t.FORMATTER_TYPE.prototype={_enumToString$0(){return"FORMATTER_TYPE."+this._name}},t.PERIOD_TYPE.prototype={_enumToString$0(){return"PERIOD_TYPE."+this._name}},t.SORT_TYPE.prototype={_enumToString$0(){return"SORT_TYPE."+this._name}},t.PermissionType.prototype={_enumToString$0(){return"PermissionType."+this._name}},t.Permission.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["type",this.type._name,"field",this.field],f.String,f.dynamic)}},t.TopLevelFilters.prototype={toJson$0(){var i=this.permissions,e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>>");return t.LinkedHashMap_LinkedHashMap$_literal(["timeControl",this.timeControl,"permissions",t.List_List$of(new t.MappedListIterable(i,new t.TopLevelFilters_toJson_closure,e),!0,e._eval$1("ListIterable.E"))],f.String,f.dynamic)}},t.TopLevelFilters_fromJson_closure.prototype={call$1(i){return new t.Permission(t.EnumByName_byName(_.List_wsa,i.$index(0,"type")),i.$index(0,"field"))},$signature:52},t.TopLevelFilters_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:53},t.Source.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["type",this.type._name,"table",this.table,"field",this.field],f.String,f.dynamic)}},t.INDEX_METHOD.prototype={_enumToString$0(){return"INDEX_METHOD."+this._name}},t.Index.prototype={toJson$0(){var i=this.indexMethod;return i=i==null?null:i._name,t.LinkedHashMap_LinkedHashMap$_literal(["column",this.column,"customName",this.customName,"indexMethod",i],f.String,f.dynamic)}},t.Schema.prototype={setConnection$1(i){this._rawTablePrefix=i.sourceDatasetId,this._materializeTablePrefix=i.targetDatasetId},getTransformedTableQuery$1$getParentDocs(i){var e=this.source,r=e.type===_.SOURCE_TYPE_1?"transformCouchdbDoc":"transformMongodbDoc",n="`"+this._materializeTablePrefix+"."+r+"`(data, id, db_name, publish_time, deleted, '"+e.table+"')";return e=e.field,e!=null&&!i?(e=t.S(e),e="SELECT JSON_QUERY_ARRAY(JSON_EXTRACT("+n+", '$."+e+"')) AS "+e+" FROM docs"):e="SELECT "+n+" AS "+this.name._name+" FROM docs",e},get$fullRawTableName(){var i=this._rawTablePrefix;return i=i!==""?i+".":"",i+this.rawTableName},get$fullMaterializedTableName(){var i=this._materializeTablePrefix;return i=i!==""?i+".":"",i+this.materializedTableName},get$visualizationSchema(){var i=this,e=a.where$1$ax(i.fields,new t.Schema_visualizationSchema_closure),r=e.$ti._eval$1("MappedIterable<1,VisualizationField>");return r=t.List_List$of(new t.MappedIterable(e,new t.Schema_visualizationSchema_closure0,r),!0,r._eval$1("Iterable.E")),e=a.map$1$1$ax(i.joins,new t.Schema_visualizationSchema_closure1,f.SCHEMA_NAME),t.VisualizationSchema$(r,i.isJoinOnly,t.List_List$of(e,!0,e.$ti._eval$1("ListIterable.E")),i.label,i.name)},toJson$0(){var i,e,r,n,u,o=this,s=f.Map_String_dynamic,l=a.map$1$1$ax(o.fields,new t.Schema_toJson_closure,s);return l=t.List_List$of(l,!0,l.$ti._eval$1("ListIterable.E")),i=a.map$1$1$ax(o.joins,new t.Schema_toJson_closure0,s),i=t.List_List$of(i,!0,i.$ti._eval$1("ListIterable.E")),e=o.topLevelFilters.toJson$0(),r=o.source.toJson$0(),n=o.filters,u=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),u=t.List_List$of(new t.MappedListIterable(n,new t.Schema_toJson_closure1,u),!0,u._eval$1("ListIterable.E")),n=o.indexes,n==null?s=null:(s=a.map$1$1$ax(n,new t.Schema_toJson_closure2,s),s=t.List_List$of(s,!0,s.$ti._eval$1("ListIterable.E"))),t.LinkedHashMap_LinkedHashMap$_literal(["fields",l,"label",o.label,"name",o.name._name,"joins",i,"topLevelFilters",e,"source",r,"dynamicRawTable",o.dynamicRawTable,"rawTableName",o.rawTableName,"materializedTableName",o.materializedTableName,"materializedPostgresqlTableName",o.materializedPostgresqlTableName,"isJoinOnly",o.isJoinOnly,"isContinuousUpdate",o.isContinuousUpdate,"interval",o.interval,"partition",o.partition,"clusters",o.clusters,"filters",u,"indexes",s,"isGlobal",o.isGlobal],f.String,f.dynamic)}},t.Schema_visualizationSchema_closure.prototype={call$1(i){return!i.hidden},$signature:2},t.Schema_visualizationSchema_closure0.prototype={call$1(i){var e=i.type,r=i.name,n=i.label,u=i.schemaName,o=t.getFilterOperators(e);return new t.VisualizationField(u,r,n,e,t.getAggregationTypes(e),t.getDimensionOptions(e),o)},$signature:54},t.Schema_visualizationSchema_closure1.prototype={call$1(i){return i.joinSchemaName},$signature:55},t.Schema_fromJson_closure.prototype={call$1(i){return t.Field_fromJson(i)},$signature:3},t.Schema_fromJson_closure0.prototype={call$1(i){return t.Join_fromJson(i)},$signature:56},t.Schema_fromJson_closure1.prototype={call$1(i){var e=i.$index(0,"column");return e==null&&(e=t._setArrayType([],f.JSArray_String)),new t.Index(e,i.$index(0,"customName"),t.EnumByName_byName(_.List_88s,i.$index(0,"indexMethod")))},$signature:63},t.Schema_fromJson_closure2.prototype={call$1(i){return t.QueryRequestFilter_fromJson(i)},$signature:19},t.Schema_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:72},t.Schema_toJson_closure0.prototype={call$1(i){return i.toJson$0()},$signature:73},t.Schema_toJson_closure1.prototype={call$1(i){return i.toJson$0()},$signature:20},t.Schema_toJson_closure2.prototype={call$1(i){return i.toJson$0()},$signature:75},t.Field.prototype={getSql$3$option$schema$value(i,e,r){var n,u;return r!=null?a.toString$0$(r):(n=this.formula,u=e.name._name,n!=null?(u=t.ReCase$(u)._getCamelCase$0(),t.stringReplaceAllUnchecked(n,"@",u+".")):t.ReCase$(u)._getCamelCase$0()+"."+this.name)},getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(i,e,r,n){var u=r.getSchema$1(this.schemaName),o=a.firstWhere$1$ax(u.fields,new t.Field_getQueryPlainSql_closure(this)),s=u.name._name,l=t.ReCase$(s)._getCamelCase$0()+"."+o.name,D=o.formula;switch(D!=null&&(s=t.ReCase$(s)._getCamelCase$0(),l=t.stringReplaceAllUnchecked(D,"@",s+".")),o.type.index){case 1:l=e==null?A.FORMAT+l+")":t.DimensionOptionExtension_formatSql(e,l,n);break;case 0:l="ANY_VALUE("+l+") OVER (PARTITION BY REGEXP_REPLACE(IFNULL("+l+",''), ' ', ''))";break}return l},toJson$0(){var i=this;return t.LinkedHashMap_LinkedHashMap$_literal(["name",i.name,"schemaName",i.schemaName._name,"pointTo",i.pointTo,"formula",i.formula,"postgresqlFormula",i.postgresqlFormula,"label",i.label,"hidden",i.hidden,"type",i.type._name],f.String,f.dynamic)}},t.Field_getQueryPlainSql_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t._NumericField.prototype={getSql$3$option$schema$value(i,e,r){return this.super$Field$getSql(i,e,r)}},t._TimestampField.prototype={_getExtractTimestampSql$3$part$sql$value(i,e,r){return r!=null?e:"CAST(EXTRACT("+i+" FROM "+e+" AT TIME ZONE @TIMEZONE) as INT64)"},getSql$3$option$schema$value(i,e,r){var n=this,u=n.super$Field$getSql(i,e,r);switch(i){case _.DIMENSION_OPTION_5:u="TIME("+(r!=null?"TIMESTAMP('"+u+"')":u)+", @TIMEZONE)";break;case _.DIMENSION_OPTION_6:u=n._getExtractTimestampSql$3$part$sql$value("HOUR",u,r);break;case _.DIMENSION_OPTION_7:u=n._getExtractTimestampSql$3$part$sql$value("DAYOFWEEK",u,r);break;case _.DIMENSION_OPTION_8:u=n._getExtractTimestampSql$3$part$sql$value("DAY",u,r);break;case _.DIMENSION_OPTION_9:u=n._getExtractTimestampSql$3$part$sql$value("MONTH",u,r);break;case _.DIMENSION_OPTION_10:u=n._getExtractTimestampSql$3$part$sql$value("YEAR",u,r);break;case _.DIMENSION_OPTION_0:case _.DIMENSION_OPTION_1:case _.DIMENSION_OPTION_2:case _.DIMENSION_OPTION_3:case _.DIMENSION_OPTION_4:case _.DIMENSION_OPTION_11:default:r!=null&&(u="TIMESTAMP('"+u+"')");break}return u}},t._BoolField.prototype={getSql$3$option$schema$value(i,e,r){return this.super$Field$getSql(i,e,r)}},t._StringField.prototype={getSql$3$option$schema$value(i,e,r){var n=this.super$Field$getSql(i,e,r);return a.$eq$(r,"NULL")?n:r!=null?"'"+n+"'":n}},t.Join.prototype={getConditionsSql$1(i){return _.JSArray_methods.fold$2(this.conditions,"",new t.Join_getConditionsSql_closure(this,i))},toJson$0(){var i=this,e=i.conditions,r=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>");return r=t.List_List$of(new t.MappedListIterable(e,new t.Join_toJson_closure,r),!0,r._eval$1("ListIterable.E")),e=i.lateral,e=e==null?null:e.toJson$0(),t.LinkedHashMap_LinkedHashMap$_literal(["joinSchemaName",i.joinSchemaName._name,"mainSchemaName",i.mainSchemaName._name,"conditions",r,"topLevelTimeControl",i.topLevelTimeControl,"lateral",e],f.String,f.dynamic)}},t.Join_getConditionsSql_closure.prototype={call$2(i,e){var r=this.$this,n=t._setArrayType([e.joinField],f.JSArray_String),u=e.option,o=t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(null,n,u,r.joinSchemaName),e.operator,this.schemaLibrary,t._QueryRequestComparisonTargetVariable$(null,e.mainFields,u,r.mainSchemaName)).getSql$0();return i===""?o:i+" and "+o},$signature:76},t.Join_fromJson_closure.prototype={call$1(i){var e=i.$index(0,"joinField"),r=i.$index(0,"mainFields"),n=t.EnumByName_byName(_.List_LO4,i.$index(0,"operator"));return new t.JoinCondition(e,r,n,i.$index(0,"option")!=null?t.EnumByName_byName(_.List_yRY,i.$index(0,"option")):null)},$signature:83},t.Join_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:85},t.JoinLateralSort.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["name",this.name,"type",this.type._name],f.String,f.dynamic)}},t.JoinLateral.prototype={toJson$0(){var i=a.map$1$1$ax(this.sorts,new t.JoinLateral_toJson_closure,f.Map_String_dynamic);return t.LinkedHashMap_LinkedHashMap$_literal(["distinctFields",this.distinctFields,"sorts",t.List_List$of(i,!0,i.$ti._eval$1("ListIterable.E"))],f.String,f.dynamic)}},t.JoinLateral_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:86},t.JoinCondition.prototype={toJson$0(){var i=this,e=i.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["joinField",i.joinField,"mainFields",i.mainFields,"operator",i.operator._name,"option",e],f.String,f.dynamic)}},t.QueryRequestComparisonTarget.prototype={},t._QueryRequestComparisonTargetValue.prototype={},t._QueryRequestComparisonTargetVariable.prototype={},t.QueryRequestComparison.prototype={getSql$0(){var i,e,r,n=this,u=n.operator;switch(u.index){case 0:u=n.to,i=u.length,i===0?e="":i===1?(r=u[0],u=n.from,e=r==="NULL"?u+" is "+r:u+"="+r):(i=n.from,e=i+" in ("+_.JSArray_methods.join$1(u,",")+")",_.JSArray_methods.contains$1(u,"NULL")&&(e=e+" OR "+i+" IS NULL"));break;case 1:u=n.to,i=u.length,i===0?e="":i===1?(r=u[0],u=n.from,e=r==="NULL"?u+" is not "+r:u+"!="+r):(i=n.from,e=i+" not in ("+_.JSArray_methods.join$1(u,",")+")",_.JSArray_methods.contains$1(u,"NULL")&&(e=e+" AND "+i+" IS NOT NULL"));break;case 7:u=n.to,e=u.length===0?"":new t.MappedListIterable(u,new t.QueryRequestComparison_getSql_closure(n),t._arrayInstanceType(u)._eval$1("MappedListIterable<1,String>")).join$1(0," or ");break;case 8:u=n.to,e=u.length===0?"":new t.MappedListIterable(u,new t.QueryRequestComparison_getSql_closure0(n),t._arrayInstanceType(u)._eval$1("MappedListIterable<1,String>")).join$1(0," and ");break;case 3:e=n.from+"<"+t.S(n.to[0]);break;case 5:e=n.from+"<="+t.S(n.to[0]);break;case 2:e=n.from+">"+t.S(n.to[0]);break;case 4:e=n.from+">="+t.S(n.to[0]);break;case 6:u=n.to,e=n.from+" between "+t.S(u[0])+" and "+t.S(u[1]);break;case 10:u=t._setArrayType([n.from],f.JSArray_String),_.JSArray_methods.addAll$1(u,n.to),e=_.JSArray_methods.join$1(u," or ");break;case 9:u=t._setArrayType([n.from],f.JSArray_String),_.JSArray_methods.addAll$1(u,n.to),e=_.JSArray_methods.join$1(u," and ");break;default:throw t.wrapException(t.Exception_Exception("invalid operator "+u._name))}return e!==""?"("+e+")":e}},t.QueryRequestComparison_QueryRequestComparison$nested_closure.prototype={call$1(i){return i.getSql$0()},$signature:87},t.QueryRequestComparison_getToValues_closure.prototype={call$1(i){var e=this.toSchema;return a.firstWhere$1$ax(e.fields,new t.QueryRequestComparison_getToValues__closure0(i)).getSql$3$option$schema$value(this.to.option,e,null)},$signature:4},t.QueryRequestComparison_getToValues__closure0.prototype={call$1(i){return i.name===this.name},$signature:2},t.QueryRequestComparison_getToValues_closure0.prototype={call$1(i){var e,r=this.operator;return r===_.COMPARISON_OPERATOR_7||r===_.COMPARISON_OPERATOR_8?"'%"+t.S(i)+"%'":(r=this.toSchema,e=this.to,a.firstWhere$1$ax(r.fields,new t.QueryRequestComparison_getToValues__closure(e)).getSql$3$option$schema$value(e.option,r,i))},$signature:7},t.QueryRequestComparison_getToValues__closure.prototype={call$1(i){return i.name===a.get$first$ax(this.to.names)},$signature:2},t.QueryRequestComparison_getFromValue_closure.prototype={call$1(i){return i.name===a.get$first$ax(this.from.names)},$signature:2},t.QueryRequestComparison_getSql_closure.prototype={call$1(i){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') like "+(e+i+"), ' ', '')")},$signature:4},t.QueryRequestComparison_getSql_closure0.prototype={call$1(i){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') not like "+(e+i+"), ' ', '')")},$signature:4},t.uniqueAlias_closure.prototype={call$1(i){var e=i.$index(0,0);return e.toString,t.Primitives_stringFromCharCode(97+t.int_parse(e))},$signature:15},t.QueryRequestCommonField.prototype={getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(i,e,r,n,u,o,s,l){var D,d,c=o!=null;if(i!=null)switch(D="ORDER BY "+e+"_sort ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING",i.index){case 0:case 10:return"SUM("+e+") OVER ("+u+") "+e;case 2:case 12:return c?"SUM("+e+") OVER ("+u+") "+e:"COUNT("+e+") OVER ("+u+") "+e;case 3:return c?"SUM("+e+") OVER ("+u+") "+e:"COUNT(DISTINCT "+e+") OVER ("+u+") "+e;case 1:case 11:return"AVG("+e+") OVER ("+u+") "+e;case 7:return c?"'' "+e:"STRING_AGG("+e+") OVER ("+u+") "+e;case 4:return _.JSArray_methods.join$1(t._setArrayType(["FIRST_VALUE("+e+") OVER ("+u+" "+D+") "+e,"LAST_VALUE("+e+"_sort) OVER ("+u+" "+D+") "+e+"_sort"],f.JSArray_String),",");case 5:return d="LAST_VALUE("+e,_.JSArray_methods.join$1(t._setArrayType([d+") OVER ("+u+" "+D+") "+e,d+"_sort) OVER ("+u+" "+D+") "+e+"_sort"],f.JSArray_String),",");case 8:return"MIN("+e+") OVER ("+u+") "+e;case 9:return"MAX("+e+") OVER ("+u+") "+e;case 6:return c?"'' "+e:"ANY_VALUE(CAST("+e+" as STRING)) OVER ("+u+") "+e}else return c&&r>=o?"CAST(NULL as "+t.S(t.DataTypeExtension_get_sqlType(a.firstWhere$1$ax(s.getSchema$1(this.schemaName).fields,new t.QueryRequestCommonField_getAggregatedSql_closure(this)).type))+") "+e:n?"ANY_VALUE("+e+") OVER ("+u+") "+e:e}},t.QueryRequestCommonField_getAggregatedSql_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestDimension.prototype={toJson$0(){var i,e,r=this,n=r.timeFormatter;return n=n==null?null:n._name,i=r.formatter,i=i==null?null:i._name,e=r.option,e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",r.schemaName._name,"name",r.name,"decimal",r.decimal,"timeFormatter",n,"formatter",i,"label",r.label,"option",e,"fillGap",r.fillGap,"hide",r.hide,"dataFormula",r.dataFormula,"displayFormula",r.displayFormula,"dateComparison",r.dateComparison],f.String,f.dynamic)},get$idV1(){var i=this.name,e=this.option;return e!=null&&(i=i+"_"+e._name),(this.schemaName._name+"_"+i).toLowerCase()},get$alias(){var i=this,e=i.name,r=i.option;return r!=null&&(e=e+"_"+r._name),r=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0),(i.schemaName._name+"_"+e+"_"+t.stringReplaceAllUnchecked(i.label,r,"")).toLowerCase()},getPlainSql$2$schemaLibrary$timezone(i,e){return a.firstWhere$1$ax(i.getSchema$1(this.schemaName).fields,new t.QueryRequestDimension_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,this.option,i,e)},generateTimestampArraySql$2$timeFilters$timezone(i,e){var r,n,u,o,s,l,D;switch(this.option){case _.DIMENSION_OPTION_1:case _.DIMENSION_OPTION_6:r=_.Units_3;break;case _.DIMENSION_OPTION_2:case _.DIMENSION_OPTION_7:case _.DIMENSION_OPTION_8:case _.DIMENSION_OPTION_11:r=_.Units_4;break;case _.DIMENSION_OPTION_3:r=_.Units_5;break;case _.DIMENSION_OPTION_4:case _.DIMENSION_OPTION_9:r=_.Units_6;break;case _.DIMENSION_OPTION_10:r=_.Units_7;break;case _.DIMENSION_OPTION_0:case _.DIMENSION_OPTION_5:default:r=null;break}if(n=t.DateTime_parse(a.$index$asx(_.JSArray_methods.get$first(i).values,0)).toUtc$0(),u=t.DateTime_parse(a.$index$asx(_.JSArray_methods.get$first(i).values,1)).toUtc$0(),o=new t.QueryRequestDimension_generateTimestampArraySql_closure(i,n).call$0(),s=new t.QueryRequestDimension_generateTimestampArraySql_closure0(i,u).call$0(),o.isAfter$1(s)&&(s=s.add$1(0,t.Duration$(1,0,0,0,0,0))),r!=null)switch(l=t.DateTimeExtension_startOfUtc(o,r,o,e)._toString$1$iso8601(!0),D=t.DateTimeExtension_endOfUtc(s,r,s,e)._toString$1$iso8601(!0),r.index){case 3:case 4:return'UNNEST(GENERATE_TIMESTAMP_ARRAY(TIMESTAMP("'+l+'"),TIMESTAMP("'+D+'"),INTERVAL 1 '+r._name+"))";case 5:case 6:case 7:return'UNNEST(ARRAY(SELECT TIMESTAMP(date, "'+e+'") FROM UNNEST(GENERATE_DATE_ARRAY(DATE(TIMESTAMP "'+l+'", "'+e+'"),DATE(TIMESTAMP "'+D+'", "'+e+'"),INTERVAL 1 '+r._name+")) as date))";default:return"[]"}else return[]},getColumn$1(i){var e=this,r=e.schemaName,n=a.firstWhere$1$ax(i.getSchema$1(r).fields,new t.QueryRequestDimension_getColumn_closure(e)),u=t.uniqueAlias(e.get$alias()),o=n.type;return new t.QueryResponseColumn(r,e.label,o,_.FIELD_TYPE_0,u,null,e.option,e.decimal,e.timeFormatter,e.formatter,e.hide,e.dateComparison===!0)},$eq(i,e){var r=this;return e==null?!1:e instanceof t.QueryRequestDimension&&r.option==e.option&&r.name===e.name&&r.schemaName===e.schemaName&&r.label===e.label},get$hashCode(i){var e=this;return _.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+a.get$hashCode$(e.option)+_.JSString_methods.get$hashCode(e.label)}},t.QueryRequestDimension_getPlainSql_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestDimension_generateTimestampArraySql_closure.prototype={call$0(){var i=t.DateTime_parse(a.$index$asx(_.JSArray_methods.get$last(this.timeFilters).values,0)).toUtc$0(),e=this.startTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(i),t.Primitives_getMonth(i),t.Primitives_getDay(i),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:26},t.QueryRequestDimension_generateTimestampArraySql_closure0.prototype={call$0(){var i=t.DateTime_parse(a.$index$asx(_.JSArray_methods.get$last(this.timeFilters).values,1)).toUtc$0(),e=this.endTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(i),t.Primitives_getMonth(i),t.Primitives_getDay(i),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:26},t.QueryRequestDimension_getColumn_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestMetric.prototype={toJson$0(){var i,e=this,r=e.timeFormatter;return r=r==null?null:r._name,i=e.formatter,i=i==null?null:i._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"label",e.label,"decimal",e.decimal,"aggregation",e.aggregation._name,"hide",e.hide,"dataFormula",e.dataFormula,"displayFormula",e.displayFormula,"timeFormatter",r,"formatter",i],f.String,f.dynamic)},get$alias(){var i=this,e=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0);return(i.schemaName._name+"_"+i.name+"_"+i.aggregation._name+"_"+t.stringReplaceAllUnchecked(i.label,e,"")).toLowerCase()},getColumn$1(i){var e=this,r=e.schemaName,n=a.firstWhere$1$ax(i.getSchema$1(r).fields,new t.QueryRequestMetric_getColumn_closure(e)).type,u=e.aggregation;switch(u.index){case 2:case 3:case 0:n=_.DATA_TYPE_3;break}return new t.QueryResponseColumn(r,e.label,n,_.FIELD_TYPE_1,t.uniqueAlias(e.get$alias()),u,null,e.decimal,e.timeFormatter,e.formatter,e.hide,!1)},getPlainSql$2$schemaLibrary$timezone(i,e){return a.firstWhere$1$ax(i.getSchema$1(this.schemaName).fields,new t.QueryRequestMetric_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(this.aggregation,null,i,e)},$eq(i,e){var r=this;return e==null?!1:e instanceof t.QueryRequestMetric&&r.aggregation===e.aggregation&&r.name===e.name&&r.schemaName===e.schemaName&&r.label===e.label},get$hashCode(i){var e=this;return _.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+t.Primitives_objectHashCode(e.aggregation)+_.JSString_methods.get$hashCode(e.label)}},t.QueryRequestMetric_getColumn_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestMetric_getPlainSql_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestFilter.prototype={toComparison$2$timezone(i,e){var r,n,u,o,s,l,D,d,c,p=this,y=p.schemaName,g=i.getSchema$1(y),m=p.operator;return m===_.COMPARISON_OPERATOR_6&&p.option===_.DIMENSION_OPTION_5&&(r=p.values,n=a.getInterceptor$asx(r),u=t.Jiffy$(n.$index(r,0)),o=t.Jiffy$(n.$index(r,1)),r=u.__Jiffy__dateTime_A,r===S&&t.throwUnnamedLateFieldNI(),r=r.get$hour(),n=u.__Jiffy__dateTime_A.get$minute(),s=o.__Jiffy__dateTime_A,s===S&&t.throwUnnamedLateFieldNI(),s.get$hour()*60+o.__Jiffy__dateTime_A.get$minute()<r*60+n)?(y=g.name,m=p.name,r=f.JSArray_String,n=p.option,s=p.dataFormula,l=t._QueryRequestComparisonTargetVariable$(s,t._setArrayType([m],r),n,y),D=t.Jiffy$(u),d=D.__Jiffy__dateTime_A,d===S&&t.throwUnnamedLateFieldNI(),d=d.toUtc$0(),D.__Jiffy__dateTime_A=d,d=d.toIso8601String$0(),D=u.__Jiffy__dateTime_A,D=t.DateTimeExtension_endOfUtc(D,_.Units_4,D,e)._toString$1$iso8601(!0),D=t.QueryRequestComparison_QueryRequestComparison$single(l,_.COMPARISON_OPERATOR_6,i,new t._QueryRequestComparisonTargetValue(y,t._setArrayType([m],r),[d,D],n,null)),s=t._QueryRequestComparisonTargetVariable$(s,t._setArrayType([m],r),n,y),d=o.__Jiffy__dateTime_A,d=t.DateTimeExtension_startOfUtc(d,_.Units_4,d,e)._toString$1$iso8601(!0),l=t.Jiffy$(o),c=l.__Jiffy__dateTime_A,c===S&&t.throwUnnamedLateFieldNI(),c=c.toUtc$0(),l.__Jiffy__dateTime_A=c,c=c.toIso8601String$0(),t.QueryRequestComparison_QueryRequestComparison$nested(_.COMPARISON_OPERATOR_10,t._setArrayType([D,t.QueryRequestComparison_QueryRequestComparison$single(s,_.COMPARISON_OPERATOR_6,i,new t._QueryRequestComparisonTargetValue(y,t._setArrayType([m],r),[d,c],n,null))],f.JSArray_QueryRequestComparison))):(r=p.name,n=f.JSArray_String,s=p.option,t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(p.dataFormula,t._setArrayType([r],n),s,y),m,i,new t._QueryRequestComparisonTargetValue(y,t._setArrayType([r],n),p.values,s,null)))},toJson$0(){var i=this,e=i.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",i.schemaName._name,"name",i.name,"operator",i.operator._name,"option",e,"dataFormula",i.dataFormula,"values",i.values],f.String,f.dynamic)}},t._GetSourceTableResponse.prototype={},t._PlainSqlColumn.prototype={},t.QueryRequest.prototype={get$populatedSorts(){var i,e,r,n,u=null,o=this.sorts;return o.length!==0?o:(o=this.dimensions,i=a.getInterceptor$asx(o),i.get$isNotEmpty(o)?(e=i.get$first(o),t._setArrayType([new t.QueryRequestSort(_.SORT_TYPE_0,u,u,u,e.schemaName,e.name)],f.JSArray_QueryRequestSort)):(o=this.metrics,i=a.getInterceptor$asx(o),r=f.JSArray_QueryRequestSort,i.get$isNotEmpty(o)?(n=i.get$first(o),t._setArrayType([new t.QueryRequestSort(_.SORT_TYPE_0,u,u,u,n.schemaName,n.name)],r)):t._setArrayType([],r)))},_getJoins$1(i){var e=this.joins,r=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Join>");return t.List_List$of(new t.MappedListIterable(e,new t.QueryRequest__getJoins_closure(this,i),r),!0,r._eval$1("ListIterable.E"))},toJson$0(){var i,e,r,n,u,o,s=this,l=f.Map_String_dynamic,D=a.map$1$1$ax(s.dimensions,new t.QueryRequest_toJson_closure,l);return D=t.List_List$of(D,!0,D.$ti._eval$1("ListIterable.E")),l=a.map$1$1$ax(s.metrics,new t.QueryRequest_toJson_closure0,l),l=t.List_List$of(l,!0,l.$ti._eval$1("ListIterable.E")),i=s.joins,e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(i,new t.QueryRequest_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),i=s.timeDimension,i=i==null?null:i.toJson$0(),r=s.filters,n=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>"),n=t.List_List$of(new t.MappedListIterable(r,new t.QueryRequest_toJson_closure2,n),!0,n._eval$1("ListIterable.E")),r=s.sorts,u=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>"),u=t.List_List$of(new t.MappedListIterable(r,new t.QueryRequest_toJson_closure3,u),!0,u._eval$1("ListIterable.E")),r=s.blendConditions,r==null&&(r=t._setArrayType([],f.JSArray_JoinDatasourceCondition)),o=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",s.schemaName._name,"dimensions",D,"metrics",l,"joins",e,"timeDimension",i,"restaurantIds",s.restaurantIds,"warehouseIds",s.warehouseIds,"businessIds",s.businessIds,"filters",n,"sorts",u,"blendConditions",t.List_List$of(new t.MappedListIterable(r,new t.QueryRequest_toJson_closure4,o),!0,o._eval$1("ListIterable.E")),"limit",s.limit,"rollup",s.rollup,"rollupPosition",s.rollupPosition,"timezone",s.timezone],f.String,f.dynamic)},copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(i,e,r,n,u){var o=this,s=u??o.sorts,l=r??o.rollup,D=n??o.rollupPosition,d=i??o.blendConditions;return t.QueryRequest$(d,o.businessIds,e,o.filters,o.joins,o.limit,o.metrics,o.restaurantIds,l,D,o.schemaName,s,o.timeDimension,o.timezone,o.warehouseIds)},copyWith$2$dimensions$sorts(i,e){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,i,null,null,e)},copyWith$1$dimensions(i){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,i,null,null,null)},copyWith$3$dimensions$rollup$rollupPosition(i,e,r){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,i,e,r,null)},copyWith$3$blendConditions$dimensions$rollup(i,e,r){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(i,e,r,null,null)},getColumns$1(i){var e=f.QueryResponseColumn,r=t.List_List$of(a.map$1$1$ax(this.dimensions,new t.QueryRequest_getColumns_closure(i),e),!0,e);return _.JSArray_methods.addAll$1(r,a.map$1$1$ax(this.metrics,new t.QueryRequest_getColumns_closure0(i),e)),r},_getPlainSqlColumns$1(i){var e=this,r=f._PlainSqlColumn,n=t.List_List$of(a.map$1$1$ax(e.dimensions,new t.QueryRequest__getPlainSqlColumns_closure(e,i),r),!0,r),u=e.metrics,o=a.getInterceptor$ax(u);return _.JSArray_methods.addAll$1(n,o.map$1$1(u,new t.QueryRequest__getPlainSqlColumns_closure0(e,i),r)),r=e.sorts,_.JSArray_methods.addAll$1(n,new t.MappedListIterable(r,new t.QueryRequest__getPlainSqlColumns_closure1(e,i),t._arrayInstanceType(r)._eval$1("MappedListIterable<1,_PlainSqlColumn>"))),_.JSArray_methods.addAll$1(n,o.fold$2(u,t._setArrayType([],f.JSArray__PlainSqlColumn),new t.QueryRequest__getPlainSqlColumns_closure2(e,i))),n},_getPlainSqlSorts$1(i){var e=this.get$populatedSorts(),r=new t.MappedListIterable(e,new t.QueryRequest__getPlainSqlSorts_closure(this,i),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>"));return r.get$length(r)===0?"":" order by "+r.join$1(0,",")},_getTimeFilters$1(i){var e,r,n,u,o,s,l,D,d,c,p,y=t._setArrayType([],f.JSArray_QueryRequestFilter),g=i.topLevelFilters.timeControl;return g!=null&&(e=this.timeDimension,r=e.timeStart,r!=null&&e.timeEnd!=null?(n=t.Jiffy$(r),u=e.timeEnd,o=t.Jiffy$(u),s=n.__Jiffy__dateTime_A,s===S&&t.throwUnnamedLateFieldNI(),l=s.get$hour()*60+n.__Jiffy__dateTime_A.get$minute(),s=o.__Jiffy__dateTime_A,s===S&&t.throwUnnamedLateFieldNI(),D=s.get$hour()*60+o.__Jiffy__dateTime_A.get$minute(),d=D-l,d<=0&&(d+=1440),c=l>720&&d>720,p=D<l?o.__Jiffy__dateTime_A.toLocal$0().get$hour()*60+o.__Jiffy__dateTime_A.toLocal$0().get$minute()+1:0,r.toString,u.toString,y.push(new t.QueryRequestFilter(_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_5,null,[r,u],i.name,g))):(p=0,c=!1),r=t.Jiffy$(e.start),r=r.subtract$1$days(c?1:0).add$1$minutes(0,p),u=r.__Jiffy__dateTime_A,u===S&&t.throwUnnamedLateFieldNI(),u=u.toUtc$0(),r.__Jiffy__dateTime_A=u,u=u.toIso8601String$0(),e=t.Jiffy$(e.end),e=e.subtract$1$days(c?1:0).add$1$minutes(0,p),r=e.__Jiffy__dateTime_A,r===S&&t.throwUnnamedLateFieldNI(),r=r.toUtc$0(),e.__Jiffy__dateTime_A=r,y.push(new t.QueryRequestFilter(_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_0,null,[u,r.toIso8601String$0()],i.name,g))),y},_getSqlFilters$1(i){var e,r,n,u,o=this,s=t._setArrayType([],f.JSArray_QueryRequestFilter),l=i.getSchema$1(o.schemaName);return o.timeDimension!=null&&(e=t.List_List$of(s,!0,f.QueryRequestFilter),_.JSArray_methods.addAll$1(e,o._getTimeFilters$1(l)),s=e),e=l.topLevelFilters.permissions,e.length!==0?(r=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,QueryRequestFilter>"),n=r._eval$1("MappedListIterable<ListIterable.E,QueryRequestComparison>"),u=t.QueryRequestComparison_QueryRequestComparison$nested(_.COMPARISON_OPERATOR_10,t.List_List$of(new t.MappedListIterable(new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure(o),r),new t.QueryRequest__getSqlFilters_closure0(o,i),n),!0,n._eval$1("ListIterable.E"))).getSql$0()):u="id='_'",e=t._setArrayType([u],f.JSArray_String),_.JSArray_methods.addAll$1(e,new t.MappedListIterable(s,new t.QueryRequest__getSqlFilters_closure1(o,i),t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>"))),r=o.filters,_.JSArray_methods.addAll$1(e,new t.MappedListIterable(r,new t.QueryRequest__getSqlFilters_closure2(o,i),t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"))),r=l.filters,_.JSArray_methods.addAll$1(e,new t.MappedListIterable(r,new t.QueryRequest__getSqlFilters_closure3(o,i),t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"))),e.length!==0?" where "+new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure4,f.MappedListIterable_String_String).join$1(0," and "):""},_getSqlJoins$1(i){return _.JSArray_methods.fold$2(this._getJoins$1(i),"",new t.QueryRequest__getSqlJoins_closure(this,i))},_getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(i,e,r,n){var u,o,s,l,D,d,c,p,y=this,g=i!=null,m=y.dimensions,h=f.QueryRequestDimension,E=t.ListExtensions_whereIndexed(m,new t.QueryRequest__getRollupSelect_closure(i),h),C=E.get$isEmpty(E)?"":"PARTITION BY "+t.MappedIterable_MappedIterable(E,new t.QueryRequest__getRollupSelect_closure0,E.$ti._eval$1("Iterable.E"),f.String).join$1(0,","),I=f.String;return h=t.List_List$of(t.ListExtensions_mapIndexed(m,new t.QueryRequest__getRollupSelect_closure1(y,e,i,C),h,I),!0,I),u=y.metrics,o=f.JSArray_String,_.JSArray_methods.addAll$1(h,t.IterableExtension_foldIndexed(u,t._setArrayType([],o),new t.QueryRequest__getRollupSelect_closure2(y,e,i,C))),s=y.sorts,l=t._arrayInstanceType(s),D=l._eval$1("MappedListIterable<1,String>"),_.JSArray_methods.addAll$1(h,new t.MappedListIterable(s,new t.QueryRequest__getRollupSelect_closure3(y,e,i,C),D)),h=_.JSArray_methods.join$1(h,","),d=a.getInterceptor$ax(m),c=t.List_List$of(d.map$1$1(m,new t.QueryRequest__getRollupSelect_closure4(n),I),!0,I),_.JSArray_methods.addAll$1(c,a.fold$2$ax(u,t._setArrayType([],o),new t.QueryRequest__getRollupSelect_closure5(n,g))),_.JSArray_methods.addAll$1(c,new t.MappedListIterable(s,new t.QueryRequest__getRollupSelect_closure6,D)),c.push(""+g+" _is_rollup"),p="select "+_.JSArray_methods.join$1(c,",")+" from ("+("select "+h+" from "+r)+")",d.get$isNotEmpty(m)&&(m=t.List_List$of(d.map$1$1(m,new t.QueryRequest__getRollupSelect_closure7,I),!0,I),h=l._eval$1("MappedIterable<1,String>"),_.JSArray_methods.addAll$1(m,t.List_List$of(new t.MappedIterable(new t.WhereIterable(s,new t.QueryRequest__getRollupSelect_closure8,l._eval$1("WhereIterable<1>")),new t.QueryRequest__getRollupSelect_closure9,h),!0,h._eval$1("Iterable.E"))),p=p+" group by "+_.JSArray_methods.join$1(m,",")),p},get$_hasFillGap(){var i=a.where$1$ax(this.dimensions,new t.QueryRequest__hasFillGap_closure);return!i.get$isEmpty(i)},_getSqlSelectSorts$1(i){var e,r=this,n=r.rollup;return n==null&&(n=0),e=f.String,e=t.List_List$of(a.map$1$1$ax(a.sublist$2$ax(r.dimensions,0,n),new t.QueryRequest__getSqlSelectSorts_closure(r,i),e),!0,e),e.push("_is_rollup "+(r.rollupPosition==="BOTTOM"?"ASC":"DESC")),_.JSArray_methods.addAll$1(e,_.JSArray_methods.fold$2(r.sorts,t._setArrayType([],f.JSArray_String),new t.QueryRequest__getSqlSelectSorts_closure0(i)))," ORDER BY "+_.JSArray_methods.join$1(e,",")},_getSortedLimitTable$2$schemaLibrary$sourceTableName(i,e){var r,n=this.limit,u=n!=null?" LIMIT "+t.S(n):"";return n=this.sorts,r=n.length!==0?" ORDER BY "+a.join$1$ax(_.JSArray_methods.fold$2(n,t._setArrayType([],f.JSArray_String),new t.QueryRequest__getSortedLimitTable_closure(i)),","):"","SELECT * from "+e+r+u},getSqlSelect$1(i){var e,r,n,u,o,s,l,D,d=this,c="source_table",p=d.dimensions,y=a.getInterceptor$asx(p);if(y.get$isEmpty(p)&&a.get$isEmpty$asx(d.metrics))throw t.wrapException(t.Exception_Exception("column is empty"));for(e=d._getSourceTable$1$schemaLibrary(i),r="with source_table as ("+e.sql+")",r=d.get$_hasFillGap()?r+",fill_gap_table as ("+d._getFillGapTable$2$schemaLibrary$sourceTableName(i,c)+"),full_table as ("+d._getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName("fill_gap_table",i,c)+")":r+",full_table as (SELECT * FROM source_table)",r=r+",aggregated_table as ("+d._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(null,i,"full_table",!1)+"),sorted_limit_table as ("+d._getSortedLimitTable$2$schemaLibrary$sourceTableName(i,"aggregated_table")+")",n=d.rollup,n!=null&&y.get$isNotEmpty(p)&&n>=y.get$length(p)&&(n=y.get$length(p)-1),u=n!=null?n+1:0,u<0&&t.throwExpression(t.ArgumentError$("Length must be a non-negative integer: "+u)),o=t._setArrayType(new Array(u),f.JSArray_String),s=0;s<u;++s)o[s]=d._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(s,i,"sorted_limit_table",!0);return l=f.String,D=t.List_List$of(o,!0,l),p=t.List_List$of(y.map$1$1(p,new t.QueryRequest_getSqlSelect_closure,l),!0,l),_.JSArray_methods.addAll$1(p,a.map$1$1$ax(d.metrics,new t.QueryRequest_getSqlSelect_closure0,l)),l=d.sorts,_.JSArray_methods.addAll$1(p,new t.MappedListIterable(l,new t.QueryRequest_getSqlSelect_closure1,t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"))),p.push("_is_rollup"),D.push("SELECT "+_.JSArray_methods.join$1(p,",")+" FROM sorted_limit_table"),D.length!==0&&(r=r+" "+_.JSArray_methods.join$1(D," UNION ALL ")),p=d._getSqlSelectSorts$1(i),d._transformSqlAlias$2(t.stringReplaceAllUnchecked(r+p,"@TIMEZONE","'"+d.timezone+"'"),e.aliases)},_transformSqlAlias$2(i,e){return e.length===0?i:t.stringReplaceAllFuncUnchecked(i,t.RegExp_RegExp(new t.MappedListIterable(e,t.core_RegExp_escape$closure(),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>")).join$1(0,"|"),!1),new t.QueryRequest__transformSqlAlias_closure,null)},_getSourceTable$1$schemaLibrary(i){var e=this,r=i.getSchema$1(e.schemaName),n=e._getPlainSqlColumns$1(i),u=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"),o=new t.MappedListIterable(n,new t.QueryRequest__getSourceTable_closure,u).join$1(0,","),s=r.get$fullMaterializedTableName(),l=t.ReCase$(r.name._name)._getCamelCase$0(),D=e._getSqlJoins$1(i),d=e._getSqlFilters$1(i),c=e._getPlainSqlSorts$1(i),p=t._setArrayType([],f.JSArray_String);return new t._GetSourceTableResponse("SELECT "+new t.MappedListIterable(n,new t.QueryRequest__getSourceTable_closure0(p),u).join$1(0,",")+" FROM ("+("SELECT "+o+" FROM `"+s+"` AS "+l+D+d+c)+")",p)},_getFillGapTable$2$schemaLibrary$sourceTableName(i,e){var r,n,u,o,s,l,D,d,c,p,y,g=this,m=" CROSS JOIN ",h=f.JSArray_String,E=t._setArrayType([],h),C=g._getTimeFilters$1(i.getSchema$1(g.schemaName));for(r=g.dimensions,n=a.getInterceptor$ax(r),u=n.get$iterator(r),o=g.timeDimension!=null,s=g.timezone;u.moveNext$0();)l=u.get$current(),D=l.getColumn$1(i),l.fillGap&&D.dataType===_.DATA_TYPE_1&&o&&(d=l.generateTimestampArraySql$2$timeFilters$timezone(C,s),D=l.option,D.toString,E.push("SELECT "+t.DimensionOptionExtension_formatSql(D,t.uniqueAlias(l.get$alias()),s)+" "+t.uniqueAlias(l.get$alias())+" FROM "+t.S(d)+" "+t.uniqueAlias(l.get$alias())+" GROUP BY "+t.uniqueAlias(l.get$alias())));return u=f.String,c=t.ListExtensions_mapIndexed(E,new t.QueryRequest__getFillGapTable_closure,u,u).join$1(0,m),u=t.List_List$of(n.map$1$1(r,new t.QueryRequest__getFillGapTable_closure0,u),!0,u),_.JSArray_methods.addAll$1(u,a.fold$2$ax(g.metrics,t._setArrayType([],h),new t.QueryRequest__getFillGapTable_closure1(g,i))),o=g.sorts,_.JSArray_methods.addAll$1(u,new t.MappedListIterable(o,new t.QueryRequest__getFillGapTable_closure2(g,i),t._arrayInstanceType(o)._eval$1("MappedListIterable<1,String>"))),p=t._setArrayType(["SELECT "+_.JSArray_methods.join$1(u,",")+" FROM ("+c+")"],h),y=n.where$1(r,new t.QueryRequest__getFillGapTable_closure3),y.get$isEmpty(y)||p.push("(SELECT DISTINCT "+new t.MappedIterable(y,new t.QueryRequest__getFillGapTable_closure4,y.$ti._eval$1("MappedIterable<1,String>")).join$1(0,",")+" FROM "+e+")"),_.JSArray_methods.join$1(p,m)},_getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName(i,e,r){var n,u="fill_gap_table",o=this.dimensions,s=f.String,l=a.getInterceptor$ax(o),D=t.List_List$of(l.map$1$1(o,new t.QueryRequest__getFullTable_closure(u,r),s),!0,s);return _.JSArray_methods.addAll$1(D,a.fold$2$ax(this.metrics,t._setArrayType([],f.JSArray_String),new t.QueryRequest__getFullTable_closure0(r,u))),n=this.sorts,_.JSArray_methods.addAll$1(D,new t.MappedListIterable(n,new t.QueryRequest__getFullTable_closure1(r,u),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"))),"SELECT "+_.JSArray_methods.join$1(D,",")+" FROM fill_gap_table LEFT JOIN "+r+" ON "+l.map$1$1(o,new t.QueryRequest__getFullTable_closure2(u,r),s).join$1(0," AND ")}},t.QueryRequest_closure.prototype={call$2(i,e){var r=a.getInterceptor$ax(i),n=r.map$1$1(i,new t.QueryRequest__closure0,f.String).toSet$0(0);return _.JSArray_methods.contains$1(t.List_List$of(n,!0,t._instanceType(n)._precomputed1),t.uniqueAlias(e.get$alias()))||r.add$1(i,e),i},$signature:95},t.QueryRequest__closure0.prototype={call$1(i){return t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest_closure0.prototype={call$2(i,e){var r=a.getInterceptor$ax(i),n=r.map$1$1(i,new t.QueryRequest__closure,f.String).toSet$0(0);return _.JSArray_methods.contains$1(t.List_List$of(n,!0,t._instanceType(n)._precomputed1),t.uniqueAlias(e.get$alias()))||r.add$1(i,e),i},$signature:112},t.QueryRequest__closure.prototype={call$1(i){return t.uniqueAlias(i.get$alias())},$signature:16},t.QueryRequest__getJoins_closure.prototype={call$1(i){return a.firstWhere$1$ax(this.schemaLibrary.getSchema$1(this.$this.schemaName).joins,new t.QueryRequest__getJoins__closure(i))},$signature:115},t.QueryRequest__getJoins__closure.prototype={call$1(i){return i.joinSchemaName===this.joinSchemaName},$signature:46},t.QueryRequest_fromJson_closure.prototype={call$1(i){return t.QueryRequestDimension_fromJson(i)},$signature:17},t.QueryRequest_fromJson_closure0.prototype={call$1(i){return t.QueryRequestMetric_fromJson(i)},$signature:23},t.QueryRequest_fromJson_closure1.prototype={call$1(i){return t.EnumByName_byName(_.List_W7J,i)},$signature:24},t.QueryRequest_fromJson_closure2.prototype={call$1(i){return t.QueryRequestFilter_fromJson(i)},$signature:19},t.QueryRequest_fromJson_closure3.prototype={call$1(i){return t.QueryRequestSort_fromJson(i)},$signature:25},t.QueryRequest_fromJson_closure4.prototype={call$1(i){return t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson(i)},$signature:51},t.QueryRequest_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:44},t.QueryRequest_toJson_closure0.prototype={call$1(i){return i.toJson$0()},$signature:27},t.QueryRequest_toJson_closure1.prototype={call$1(i){return i._name},$signature:13},t.QueryRequest_toJson_closure2.prototype={call$1(i){return i.toJson$0()},$signature:20},t.QueryRequest_toJson_closure3.prototype={call$1(i){return i.toJson$0()},$signature:29},t.QueryRequest_toJson_closure4.prototype={call$1(i){return i.toJson$0()},$signature:30},t.QueryRequest_getColumns_closure.prototype={call$1(i){return i.getColumn$1(this.schemaLibrary)},$signature:57},t.QueryRequest_getColumns_closure0.prototype={call$1(i){return i.getColumn$1(this.schemaLibrary)},$signature:58},t.QueryRequest__getPlainSqlColumns_closure.prototype={call$1(i){var e=i.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),r=t.uniqueAlias(i.get$alias()),n=i.dataFormula;return new t._PlainSqlColumn(e,r,i.get$alias(),n)},$signature:59},t.QueryRequest__getPlainSqlColumns_closure0.prototype={call$1(i){var e=i.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),r=t.uniqueAlias(i.get$alias()),n=i.dataFormula;return new t._PlainSqlColumn(e,r,i.get$alias(),n)},$signature:60},t.QueryRequest__getPlainSqlColumns_closure1.prototype={call$1(i){var e=i.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),r=i.get$id(i),n=i.dataFormula;return new t._PlainSqlColumn(e,r,i.get$id(i),n)},$signature:61},t.QueryRequest__getPlainSqlColumns_closure2.prototype={call$2(i,e){var r,n=e.aggregation;return _.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],f.JSArray_AGGREGATION_TYPE),n)&&(n=this.schemaLibrary,r=t.IterableExtension_firstWhereOrNull(n.getSchema$1(e.schemaName).fields,new t.QueryRequest__getPlainSqlColumns__closure),r!=null&&a.add$1$ax(i,new t._PlainSqlColumn(r.getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,null,n,this.$this.timezone),t.uniqueAlias(e.get$alias())+"_sort",t.uniqueAlias(e.get$alias())+"_sort",null))),i},$signature:62},t.QueryRequest__getPlainSqlColumns__closure.prototype={call$1(i){return i.name==="createdAt"},$signature:2},t.QueryRequest__getPlainSqlSorts_closure.prototype={call$1(i){return i.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone)+" "+i.type._name},$signature:8},t.QueryRequest__getSqlFilters_closure.prototype={call$1(i){var e=this.$this,r=i.field;return new t.QueryRequestFilter(_.COMPARISON_OPERATOR_0,null,null,new t.QueryRequest__getSqlFilters__closure(e,i).call$0(),e.schemaName,r)},$signature:64},t.QueryRequest__getSqlFilters__closure.prototype={call$0(){var i=this,e=f.JSArray_String,r=t._setArrayType([],e);switch(i.permission.type.index){case 0:r=i.$this.restaurantIds;break;case 1:r=i.$this.warehouseIds;break;case 2:r=i.$this.businessIds;break}return a.get$isEmpty$asx(r)?t._setArrayType(["_"],e):r},$signature:65},t.QueryRequest__getSqlFilters_closure0.prototype={call$1(i){return i.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone)},$signature:66},t.QueryRequest__getSqlFilters_closure1.prototype={call$1(i){return i.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure2.prototype={call$1(i){return i.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure3.prototype={call$1(i){return i.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure4.prototype={call$1(i){return"("+i+")"},$signature:4},t.QueryRequest__getSqlJoins_closure.prototype={call$2(i,e){var r,n,u,o,s,l;return i!==""&&(i+=" "),r=this.schemaLibrary,n=r.getSchema$1(e.joinSchemaName),u=t._setArrayType([e.getConditionsSql$1(r)],f.JSArray_String),n.topLevelFilters.timeControl!=null&&(o=t.List_List$of(u,!0,f.String),s=this.$this,l=s._getTimeFilters$1(n),_.JSArray_methods.addAll$1(o,new t.MappedListIterable(l,new t.QueryRequest__getSqlJoins__closure(s,r),t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"))),u=o),o=t.List_List$of(u,!0,f.String),s=n.filters,_.JSArray_methods.addAll$1(o,new t.MappedListIterable(s,new t.QueryRequest__getSqlJoins__closure0(this.$this,r),t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>")))," "+(i+"left join `"+n.get$fullMaterializedTableName()+"` as "+t.ReCase$(n.name._name)._getCamelCase$0()+" on "+_.JSArray_methods.join$1(o," and "))},$signature:68},t.QueryRequest__getSqlJoins__closure.prototype={call$1(i){return i.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlJoins__closure0.prototype={call$1(i){return i.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getRollupSelect_closure.prototype={call$2(i,e){var r=this.rollupIndex;return!(r!=null&&i>=r)},$signature:69},t.QueryRequest__getRollupSelect_closure0.prototype={call$1(i){return t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure1.prototype={call$2(i,e){var r=this;return e.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(null,t.uniqueAlias(e.get$alias()),i,!1,r.partitions,r.rollupIndex,r.schemaLibrary,r.$this.sorts)},$signature:70},t.QueryRequest__getRollupSelect_closure2.prototype={call$3(i,e,r){var n=this,u=t.uniqueAlias(r.get$alias());return a.add$1$ax(e,r.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r.aggregation,u,i,!1,n.partitions,n.rollupIndex,n.schemaLibrary,n.$this.sorts)),e},$signature:71},t.QueryRequest__getRollupSelect_closure3.prototype={call$1(i){var e=this,r=i.get$id(i);return i.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(i.aggregation,r,9999,!0,e.partitions,e.rollupIndex,e.schemaLibrary,e.$this.sorts)},$signature:8},t.QueryRequest__getRollupSelect_closure4.prototype={call$1(i){var e;return this.useFormula?(e=i.displayFormula,e==null&&(e=t.uniqueAlias(i.get$alias()))):e=t.uniqueAlias(i.get$alias()),e+" "+t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure5.prototype={call$2(i,e){var r,n;return this.useFormula?(r=e.displayFormula,r==null&&(r=t.uniqueAlias(e.get$alias()))):r=t.uniqueAlias(e.get$alias()),n=a.getInterceptor$ax(i),n.add$1(i,"ANY_VALUE("+r+") "+t.uniqueAlias(e.get$alias())),r=e.aggregation,_.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],f.JSArray_AGGREGATION_TYPE),r)&&!this.isRollup&&n.add$1(i,"ANY_VALUE("+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),i},$signature:14},t.QueryRequest__getRollupSelect_closure6.prototype={call$1(i){return i.aggregation!=null?"ANY_VALUE("+i.get$id(i)+") "+i.get$id(i):i.get$id(i)},$signature:8},t.QueryRequest__getRollupSelect_closure7.prototype={call$1(i){return t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure8.prototype={call$1(i){return i.aggregation==null},$signature:34},t.QueryRequest__getRollupSelect_closure9.prototype={call$1(i){return i.get$id(i)},$signature:8},t.QueryRequest__hasFillGap_closure.prototype={call$1(i){return i.fillGap},$signature:9},t.QueryRequest__getSqlSelectSorts_closure.prototype={call$1(i){var e=this.$this,r=t.IterableExtension_firstWhereOrNull(e.sorts,new t.QueryRequest__getSqlSelectSorts__closure(i)),n=i.schemaName,u=i.name,o=r==null?null:r.type;return o==null&&(o=_.SORT_TYPE_0),u=new t.QueryRequestSort(o,null,i.option,i.dataFormula,n,u).getSortSql$2$id$schemaLibrary(t.uniqueAlias(i.get$alias()),this.schemaLibrary),new t.MappedListIterable(u,new t.QueryRequest__getSqlSelectSorts__closure0(e),t._arrayInstanceType(u)._eval$1("MappedListIterable<1,String>")).join$1(0,",")},$signature:5},t.QueryRequest__getSqlSelectSorts__closure.prototype={call$1(i){var e=this.dimension;return i.schemaName===e.schemaName&&i.name===e.name&&i.dimensionOption==e.option},$signature:34},t.QueryRequest__getSqlSelectSorts__closure0.prototype={call$1(i){var e=this.$this.rollupPosition==="BOTTOM"?"LAST":"FIRST";return i+" NULLS "+e},$signature:4},t.QueryRequest__getSqlSelectSorts_closure0.prototype={call$2(i,e){var r=t.List_List$of(i,!0,f.String);return _.JSArray_methods.addAll$1(r,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),r},$signature:36},t.QueryRequest__getSortedLimitTable_closure.prototype={call$2(i,e){var r=t.List_List$of(i,!0,f.String);return _.JSArray_methods.addAll$1(r,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),r},$signature:36},t.QueryRequest_getSqlSelect_closure.prototype={call$1(i){var e=i.displayFormula;return e==null&&(e=t.uniqueAlias(i.get$alias())),e+" "+t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest_getSqlSelect_closure0.prototype={call$1(i){var e=i.displayFormula;return e==null&&(e=t.uniqueAlias(i.get$alias())),e+" "+t.uniqueAlias(i.get$alias())},$signature:16},t.QueryRequest_getSqlSelect_closure1.prototype={call$1(i){return i.get$id(i)},$signature:8},t.QueryRequest__transformSqlAlias_closure.prototype={call$1(i){var e=i.$index(0,0);return e.toString,t.uniqueAlias(e)},$signature:15},t.QueryRequest__getSourceTable_closure.prototype={call$1(i){return i.field+" "+i.id},$signature:37},t.QueryRequest__getSourceTable_closure0.prototype={call$1(i){var e,r;return this.aliases.push(i.alias),e=i.formula,r=i.id,e!=null?e+" "+r:r},$signature:37},t.QueryRequest__getFillGapTable_closure.prototype={call$2(i,e){return i>0?"("+e+")":e},$signature:116},t.QueryRequest__getFillGapTable_closure0.prototype={call$1(i){return t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest__getFillGapTable_closure1.prototype={call$2(i,e){var r,n,u,o=this.schemaLibrary,s=t.IterableExtension_firstWhereOrNull(o.getSchema$1(this.$this.schemaName).fields,new t.QueryRequest__getFillGapTable__closure1(e));return s!=null&&(r=a.getInterceptor$ax(i),r.add$1(i,t.DataTypeExtension_get_defaultSql(s.type)+" "+t.uniqueAlias(e.get$alias())),n=e.aggregation,_.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],f.JSArray_AGGREGATION_TYPE),n)&&(u=t.IterableExtension_firstWhereOrNull(o.getSchema$1(e.schemaName).fields,new t.QueryRequest__getFillGapTable__closure2),u!=null&&r.add$1(i,t.DataTypeExtension_get_defaultSql(u.type)+" "+t.uniqueAlias(e.get$alias())+"_sort"))),i},$signature:14},t.QueryRequest__getFillGapTable__closure1.prototype={call$1(i){return i.name===this.metric.name},$signature:2},t.QueryRequest__getFillGapTable__closure2.prototype={call$1(i){return i.name==="createdAt"},$signature:2},t.QueryRequest__getFillGapTable_closure2.prototype={call$1(i){var e,r=t.IterableExtension_firstWhereOrNull(this.$this.dimensions,new t.QueryRequest__getFillGapTable__closure(i)),n=t.IterableExtension_firstWhereOrNull(this.schemaLibrary.getSchema$1(i.schemaName).fields,new t.QueryRequest__getFillGapTable__closure0(i));return r!=null?e=t.uniqueAlias(r.get$alias()):e=t.S(n==null?null:t.DataTypeExtension_get_defaultSql(n.type)),e+" "+i.get$id(i)},$signature:8},t.QueryRequest__getFillGapTable__closure.prototype={call$1(i){var e=this.sort;return i.schemaName===e.schemaName&&i.name===e.name&&i.option==e.dimensionOption},$signature:9},t.QueryRequest__getFillGapTable__closure0.prototype={call$1(i){return i.name===this.sort.name},$signature:2},t.QueryRequest__getFillGapTable_closure3.prototype={call$1(i){return!i.fillGap},$signature:9},t.QueryRequest__getFillGapTable_closure4.prototype={call$1(i){return t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure.prototype={call$1(i){var e=this.fillGapTableName;return i.fillGap?e+"."+t.uniqueAlias(i.get$alias()):"IFNULL("+this.sourceTableName+"."+t.uniqueAlias(i.get$alias())+","+e+"."+t.uniqueAlias(i.get$alias())+") "+t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure0.prototype={call$2(i,e){var r,n="IFNULL("+this.sourceTableName+".",u=this.fillGapTableName,o=a.getInterceptor$ax(i);return o.add$1(i,n+t.uniqueAlias(e.get$alias())+","+u+"."+t.uniqueAlias(e.get$alias())+") "+t.uniqueAlias(e.get$alias())),r=e.aggregation,_.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_4,_.AGGREGATION_TYPE_5],f.JSArray_AGGREGATION_TYPE),r)&&o.add$1(i,n+t.uniqueAlias(e.get$alias())+"_sort,"+u+"."+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),i},$signature:14},t.QueryRequest__getFullTable_closure1.prototype={call$1(i){return"IFNULL("+this.sourceTableName+"."+i.get$id(i)+","+this.fillGapTableName+"."+i.get$id(i)+") "+i.get$id(i)},$signature:8},t.QueryRequest__getFullTable_closure2.prototype={call$1(i){return this.fillGapTableName+"."+t.uniqueAlias(i.get$alias())+"="+this.sourceTableName+"."+t.uniqueAlias(i.get$alias())},$signature:5},t.QueryRequestSort.prototype={toJson$0(){var i,e=this,r=e.aggregation;return r=r==null?null:r._name,i=e.dimensionOption,i=i==null?null:i._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"type",e.type._name,"aggregation",r,"dimensionOption",i,"dataFormula",e.dataFormula],f.String,f.dynamic)},get$id(i){var e=this,r=e.name.toLowerCase(),n=e.dimensionOption;return n!=null?r=r+"_"+n._name.toLowerCase():(n=e.aggregation,n!=null&&(r=r+"_"+n._name.toLowerCase())),e.schemaName._name.toLowerCase()+"_"+r+"_"+e.type._name.toLowerCase()},getPlainSql$2$schemaLibrary$timezone(i,e){var r=this;return a.firstWhere$1$ax(i.getSchema$1(r.schemaName).fields,new t.QueryRequestSort_getPlainSql_closure(r)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(r.aggregation,r.dimensionOption,i,e)},getSortSql$2$id$schemaLibrary(i,e){var r,n=this,u=e.getSchema$1(n.schemaName),o=a.firstWhere$1$ax(u.fields,new t.QueryRequestSort_getSortSql_closure(n)),s=t._setArrayType([],f.JSArray_String),l=i??n.get$id(n);return _.JSArray_methods.contains$1(t._setArrayType([_.AGGREGATION_TYPE_2,_.AGGREGATION_TYPE_3],f.JSArray_AGGREGATION_TYPE),n.aggregation)||(r=o.type,r===_.DATA_TYPE_1?s.push("LENGTH("+l+") "+n.type._name):r===_.DATA_TYPE_0&&s.push(u._materializeTablePrefix+".stringToSortableNumber("+l+") "+n.type._name)),s.push(l+" "+n.type._name),s},getSortSql$1$schemaLibrary(i){return this.getSortSql$2$id$schemaLibrary(null,i)}},t.QueryRequestSort_getPlainSql_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestSort_getSortSql_closure.prototype={call$1(i){return i.name===this.$this.name},$signature:2},t.QueryRequestTimeDimension.prototype={toJson$0(){var i=this;return t.LinkedHashMap_LinkedHashMap$_literal(["start",i.start,"end",i.end,"timeStart",i.timeStart,"timeEnd",i.timeEnd],f.String,f.dynamic)}},t.FIELD_TYPE.prototype={_enumToString$0(){return"FIELD_TYPE."+this._name}},t.QueryResponseColumn.prototype={toJson$0(){var i,e,r,n=this,u=null,o=n.aggregationType;return o=o==null?u:o._name,i=n.optionType,i=i==null?u:i._name,e=n.timeFormatter,e=e==null?u:e._name,r=n.formatter,r=r==null?u:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["id",n.id,"schema",n.schema._name,"label",n.label,"dataType",n.dataType._name,"fieldType",n.fieldType._name,"aggregationType",o,"optionType",i,"decimal",n.decimal,"timeFormatter",e,"formatter",r,"hide",n.hide,"dateComparison",n.dateComparison],f.String,f.dynamic)}},t.DateTimeRange.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["start",this.start,"end",this.end],f.String,f.dynamic)}},t.QueryResponse.prototype={QueryResponse$map$4$columns$dateRange$rows$timeRange(i,e,r,n){var u,o,s,l,D=t.LinkedHashMap_LinkedHashMap$_empty(f.String,f.QueryResponseColumn);for(u=this.columns,o=u.length,s=0;s<u.length;u.length===o||(0,t.throwConcurrentModificationError)(u),++s)l=u[s],D.$indexSet(0,l.id,l);D=a.map$1$1$ax(r,new t.QueryResponse$map_closure(D),f.QueryResponseRow),this.rows=t.List_List$of(D,!0,D.$ti._eval$1("ListIterable.E"))},toJson$0(){var i,e=this,r=e.columns,n=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>");return n=t.List_List$of(new t.MappedListIterable(r,new t.QueryResponse_toJson_closure,n),!0,n._eval$1("ListIterable.E")),r=e.rows,i=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["columns",n,"rows",t.List_List$of(new t.MappedListIterable(r,new t.QueryResponse_toJson_closure0,i),!0,i._eval$1("ListIterable.E")),"dateRange",e.dateRange.toJson$0(),"timeRange",e.timeRange.toJson$0()],f.String,f.dynamic)}},t.QueryResponse$map_closure.prototype={call$1(i){var e,r,n,u,o,s,l,D=i.$index(0,"_is_rollup");for(D==null&&(D=!1),e=t.LinkedHashMap_LinkedHashMap$_empty(f.String,f.dynamic),r=i.get$entries(i),r=r.get$iterator(r),n=this.columnMap;r.moveNext$0();)u=r.get$current(),o=u.key,s=u.value,!_.JSString_methods.endsWith$1(o,"_GROUP")&&(l=n.$index(0,o),e.$indexSet(0,o,l!=null&&l.fieldType===_.FIELD_TYPE_1?t.DataTypeExtension_toData(l.dataType,s):s));return new t.QueryResponseRow(D,e)},$signature:78},t.QueryResponse_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:79},t.QueryResponse_toJson_closure0.prototype={call$1(i){return i.toJson$0()},$signature:80},t.QueryResponseRow.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["isRollup",this.isRollup,"value",this.value],f.String,f.dynamic)}},t.VisualizationSchema.prototype={VisualizationSchema$5$fields$isJoinOnly$joins$label$name(i,e,r,n,u){_.JSArray_methods.sort$1(this.fields,new t.VisualizationSchema_closure)},toJson$0(){var i=this,e=i.fields,r=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>"),n=i.joins,u=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>");return t.LinkedHashMap_LinkedHashMap$_literal(["name",i.name._name,"label",i.label,"fields",t.List_List$of(new t.MappedListIterable(e,new t.VisualizationSchema_toJson_closure,r),!0,r._eval$1("ListIterable.E")),"joins",t.List_List$of(new t.MappedListIterable(n,new t.VisualizationSchema_toJson_closure0,u),!0,u._eval$1("ListIterable.E")),"isJoinOnly",i.isJoinOnly],f.String,f.dynamic)}},t.VisualizationSchema_closure.prototype={call$2(i,e){return _.JSInt_methods.compareTo$1(i.type.index,e.type.index)},$signature:81},t.VisualizationSchema_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:82},t.VisualizationSchema_toJson_closure0.prototype={call$1(i){return i._name},$signature:13},t.VisualizationField.prototype={get$filterDimensionOptions(){var i=this.dimensionOptions,e=t._arrayInstanceType(i)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(i,new t.VisualizationField_filterDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$fillGapDimensionOptions(){var i=this.dimensionOptions,e=t._arrayInstanceType(i)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(i,new t.VisualizationField_fillGapDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$isNumericAggregations(){var i=this.aggregations,e=t._arrayInstanceType(i)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(i,new t.VisualizationField_isNumericAggregations_closure,e),!0,e._eval$1("Iterable.E"))},get$joinConditionOperators(){switch(this.type.index){case 2:case 0:case 3:return t._setArrayType([_.COMPARISON_OPERATOR_0],f.JSArray_COMPARISON_OPERATOR);case 1:return t._setArrayType([_.COMPARISON_OPERATOR_0,_.COMPARISON_OPERATOR_6],f.JSArray_COMPARISON_OPERATOR)}},toJson$0(){var i,e,r,n,u,o,s,l,D,d=this,c=d.type,p=d.filterOperators,y=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>");return y=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure,y),!0,y._eval$1("ListIterable.E")),p=d.dimensionOptions,i=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),i=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure0,i),!0,i._eval$1("ListIterable.E")),p=d.aggregations,e=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),p=d.get$filterDimensionOptions(),r=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),r=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure2,r),!0,r._eval$1("ListIterable.E")),p=d.get$fillGapDimensionOptions(),n=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),n=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure3,n),!0,n._eval$1("ListIterable.E")),p=d.get$isNumericAggregations(),u=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),u=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure4,u),!0,u._eval$1("ListIterable.E")),p=f.JSArray_DATA_TYPE,o=_.JSArray_methods.contains$1(t._setArrayType([_.DATA_TYPE_3],p),c),s=_.JSArray_methods.contains$1(t._setArrayType([_.DATA_TYPE_3],p),c)||d.get$isNumericAggregations().length!==0?_.List_cWd:t._setArrayType([],f.JSArray_TIME_FORMATTER),l=t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>"),l=t.List_List$of(new t.MappedListIterable(s,new t.VisualizationField_toJson_closure5,l),!0,l._eval$1("ListIterable.E")),p=_.JSArray_methods.contains$1(t._setArrayType([_.DATA_TYPE_3],p),c)||d.get$isNumericAggregations().length!==0?_.List_Jwp:t._setArrayType([],f.JSArray_FORMATTER_TYPE),s=t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"),s=t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure6,s),!0,s._eval$1("ListIterable.E")),p=d.get$joinConditionOperators(),D=t.instanceType(p)._eval$1("MappedListIterable<1,String>"),t.LinkedHashMap_LinkedHashMap$_literal(["name",d.name,"type",c._name,"label",d.label,"schemaName",d.schemaName._name,"filterOperators",y,"dimensionOptions",i,"aggregations",e,"filterDimensionOptions",r,"fillGapDimensionOptions",n,"isNumericAggregations",u,"isNumericType",o,"timeFormatters",l,"formatters",s,"joinConditionOperators",t.List_List$of(new t.MappedListIterable(p,new t.VisualizationField_toJson_closure7,D),!0,D._eval$1("ListIterable.E"))],f.String,f.dynamic)},$eq(i,e){return e==null?!1:e instanceof t.VisualizationField&&this.name===e.name&&this.schemaName===e.schemaName},get$hashCode(i){return _.JSString_methods.get$hashCode(this.name)+t.Primitives_objectHashCode(this.schemaName)}},t.VisualizationField_filterDimensionOptions_closure.prototype={call$1(i){return _.JSArray_methods.contains$1(S.VisualizationField__filterDimensionOptions,i)},$signature:38},t.VisualizationField_fillGapDimensionOptions_closure.prototype={call$1(i){return _.JSArray_methods.contains$1(S.VisualizationField__fillGapDimensionOptions,i)},$signature:38},t.VisualizationField_isNumericAggregations_closure.prototype={call$1(i){return _.JSArray_methods.contains$1(S.VisualizationField__isNumericAggregations,i)},$signature:84},t.VisualizationField_toJson_closure.prototype={call$1(i){return i._name},$signature:39},t.VisualizationField_toJson_closure0.prototype={call$1(i){return i._name},$signature:18},t.VisualizationField_toJson_closure1.prototype={call$1(i){return i._name},$signature:40},t.VisualizationField_toJson_closure2.prototype={call$1(i){return i._name},$signature:18},t.VisualizationField_toJson_closure3.prototype={call$1(i){return i._name},$signature:18},t.VisualizationField_toJson_closure4.prototype={call$1(i){return i._name},$signature:40},t.VisualizationField_toJson_closure5.prototype={call$1(i){return i._name},$signature:88},t.VisualizationField_toJson_closure6.prototype={call$1(i){return i._name},$signature:89},t.VisualizationField_toJson_closure7.prototype={call$1(i){return i._name},$signature:39},t.addonFlattenItemSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id",e,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId",e,e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt",e,e,i),t.Field_Field$string(e,!1,"Bill ID","billId",e,e,i),t.Field_Field$string(e,!1,"Status","status",e,e,i),t.Field_Field$string(e,!1,"Name","name",e,e,i),t.Field_Field$string(` IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), ' ', @categoryName)
|
|
83
83
|
`,!1,"Category","categoryName",e,` CASE WHEN @category_name IS NULL OR @produc_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN ' ' ELSE @category_name) END
|
|
84
|
-
`,i),t.Field_Field$string(e,!1,"Code","code",e,e,i),t.Field_Field$string(e,!1,"Variant","variantName",e,e,i),t.Field_Field$string(e,!1,"Parent ID","parentId",e,e,i),t.Field_Field$string("SPLIT(@addonId, '/')[OFFSET(0)]",!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",i)],f.JSArray_Field)},$signature:0},t.addonFlattenItemSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.adjustmentSchema_closure.prototype={call$1(i){var e=null,r="billCompletedAt",n="isRefund",u="quantity",o="returnId",s="referenceId";return t._setArrayType([t.Field_Field$string(e,!1,e,"id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!0,"Bill time","adjustmentCreatedAt",e,e,i),t.Field_Field$timestamp(e,!1,"Bill close time",r,r,e,i),t.Field_Field$bool(e,!1,"Refund",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Item ID","itemId","itemId",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Cause","cause","cause",e,i),t.Field_Field$string(e,!1,"Reason","reason","reason",e,i),t.Field_Field$string(e,!1,"Discount user","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!0,e,"createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"Discount approver","approvedByName","createApprovedBy.name",e,i),t.Field_Field$string(e,!0,e,"approvedById","createApprovedBy.id",e,i),t.Field_Field$numeric("IFNULL(@quantity,0)*IF(@isRefund, -1, 1)",!1,"Qty",u,u,"COALESCE(@quantity,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("IFNULL((@quantity*@total),0)*IF(@isRefund, -1, 1)",!1,"Total","total","total","COALESCE((@quantity*@total),0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$string(e,!1,"Return ID",o,o,e,i),t.Field_Field$string(e,!1,"Ref ID",s,s,e,i),t.Field_Field$string(e,!1,"Target","target",e,"coalesce((select name from flatten_items where flatten_items.id=@item_id and flatten_items.bill_id=@bill_id and flatten_items.restaurant_id=@restaurant_id), 'BILL')",i)],f.JSArray_Field)},$signature:0},t.adjustmentSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("refId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.billSchema_closure.prototype={call$1(i){var e=null,r="seqNumber",n="deliveryName",u="isRefund",o="isPickup",s="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",E="thirdPartyExtraCharge",C="deliveryFee",I="nettTotal",b="deliveryFeeWithTax",F="deliveryFeeWithoutTax",M="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",r,r,e,i),t.Field_Field$string(e,!1,"Table","slot","slot",e,i),t.Field_Field$string(e,!1,"Delivery",n,n,e,i),t.Field_Field$string(e,!1,"Refund ID","refundFrom","refundedFrom",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!0,e,"refundApprovedById","refund.approvedBy.id",e,i),t.Field_Field$string(e,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,i),t.Field_Field$string(e,!0,e,"refundedById","refund.by.id",e,i),t.Field_Field$string(e,!1,"Refund user","refundedByName","refund.by.name",e,i),t.Field_Field$string(e,!1,"Refund reason","refundReason","refund.reason",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","membership.id",e,i),t.Field_Field$string(e,!1,"Member user ID","memberUserId","membership.userId",e,i),t.Field_Field$string(e,!1,"Member name","memberUserName","membership.name",e,i),t.Field_Field$string(e,!0,"Member phone","memberPhoneNumber","membership.phoneNumber",e,i),t.Field_Field$timestamp(e,!1,"Member birthday","memberBirthday","membership.birthday",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Source","source","source",A.x28case_,i),t.Field_Field$string(e,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when upper(@type)='DRIVE THRU' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",i),t.Field_Field$bool(e,!0,"Pickup",o,o,e,i),t.Field_Field$bool(e,!0,"Is in house delivery",s,s,e,i),t.Field_Field$bool(e,!0,"Is other delivery",l,l,e,i),t.Field_Field$bool(e,!0,"Is takeaway","isTakeaway","is.takeaway",e,i),t.Field_Field$timestamp(e,!1,"Closed at",D,D,e,i),t.Field_Field$string(e,!0,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,i),t.Field_Field$string(e,!0,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,i),t.Field_Field$string(e,!0,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,i),t.Field_Field$string(e,!0,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,i),t.Field_Field$numeric("IF(@status = 'VOIDED', 0, IFNULL(@pax,0)*IF(@isRefund, -1, 1))",!1,"Pax","pax","person","(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (COALESCE(@pax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",i),t.Field_Field$string(e,!1,"Integrated order ID",d,d,e,i),t.Field_Field$numeric(A.IFNULLi,!0,"Item count",c,c,A.COALESi,i),t.Field_Field$numeric("IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,"Tax",p,p,A.COALEStax,i),t.Field_Field$numeric(A.IFNULLdiT,!1,"Discount",y,y,A.COALESdit,i),t.Field_Field$numeric(A.IFNULLg,!1,"Item gross",g,g,A.COALESg,i),t.Field_Field$numeric(A.x28IFNULnI,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,i),t.Field_Field$numeric("IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,"Rounding",m,m,A.COALESr,i),t.Field_Field$numeric("IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,i),t.Field_Field$string(e,!0,"SST %","sstPercentage","nettTaxes.SST.percentage",e,i),t.Field_Field$numeric(A.IFNULLs,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,i),t.Field_Field$string(e,!0,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,i),t.Field_Field$numeric(A.x28IFNULo,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,i),t.Field_Field$numeric(A.x28IFNULgx2d,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,i),t.Field_Field$numeric(A.IFNULLta,!1,"Takeaway",h,h,A.COALEStak,i),t.Field_Field$numeric(A.IFNULLth,!1,"Extra charge",E,E,A.COALESth,i),t.Field_Field$numeric(A.IFNULLde_,!1,"Delivery fee",C,C,A.COALESdex2c,i),t.Field_Field$numeric(A.IFNULLn,!1,"Nett",I,I,A.COALESn,i),t.Field_Field$numeric(A.x28IFNULgx2bd,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,i),t.Field_Field$numeric(A.x28IFNULn_,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,i),t.Field_Field$numeric(e,!1,"Member Recency","recency",e,A.MIN_EX,i),t.Field_Field$numeric(e,!1,"Member frequency","frequency",e,A.COUNT_,i),t.Field_Field$numeric(e,!1,"Member monetary","monetary",e,A.SUM__n,i),t.Field_Field$numeric(A.IFNULLdeWT,!1,"Delivery fee with tax",b,b,A.COALESdex5f_,i),t.Field_Field$numeric(A.IFNULLdeWo,!1,"Delivery fee without tax",F,F,A.COALESdex5fo,i),t.Field_Field$numeric(A.IFNULLoT,!1,"Other charge with tax",M,M,A.COALESo_,i),t.Field_Field$numeric(A.IFNULLoo,!1,"Other charge without tax",x,x,A.COALESoo,i),t.Field_Field$numeric(e,!1,"Duration","duration",e,A.EXTRAC,i),t.Field_Field$string(e,!1,"Restaurant","restaurantName",e,A.x28selecn,i),t.Field_Field$numeric(e,!1,"Labour hour","labourHour",e,A.x28selecS,i),t.Field_Field$string(e,!1,"Payments","payments",e,A.x28selecstdn,i),t.Field_Field$string(e,!1,"Items","items",e,A.x28selecstC,i),t.Field_Field$string(e,!1,"Discount reasons","discountReasons",e,A.x28selecstda,i),t.Field_Field$numeric(A.IFNULLdiI,!1,"Discount inc tax",R,R,A.COALESdii,i),t.Field_Field$string(e,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,i)],f.JSArray_Field)},$signature:0},t.billSchema_closure0.prototype={call$1(i){var e="id",r="restaurantId",n=null,u="billId",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n)],f.JSArray_Join)},$signature:1},t.businessSchema_closure.prototype={call$1(i){var e=null,r="expiredAt",n="restaurantQuota",u="warehouseQuota",o="internal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Agent ID","agentId","agentId",e,i),t.Field_Field$string(e,!1,"Owner ID","ownerId","ownerId",e,i),t.Field_Field$timestamp(e,!1,"Expired at",r,r,e,i),t.Field_Field$numeric(e,!0,e,n,n,e,i),t.Field_Field$numeric(e,!0,e,u,u,e,i),t.Field_Field$bool(e,!0,e,o,o,e,i)],f.JSArray_Field)},$signature:0},t.businessSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.campaignSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="restaurantId",u="description",o="collectibleId",s="templateId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$string(e,!1,"Restaurant ID",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Description",u,u,e,i),t.Field_Field$timestamp(e,!1,"Started at","startedAt","start",e,i),t.Field_Field$timestamp(e,!1,"Ended at","endedAt","end",e,i),t.Field_Field$string(e,!1,"Collectible ID",o,o,e,i),t.Field_Field$string(e,!1,"Template ID",s,s,e,i),t.Field_Field$string(e,!1,"Group ID","groupId","groupId",e,i),t.Field_Field$bool(e,!1,"Active","active",e,"((@ended_at is null or @ended_at >= !end) and (@started_at is null or @started_at <= !start))",i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Event type","eventType","event.type",e,i)],f.JSArray_Field)},$signature:0},t.campaignSchema_closure0.prototype={call$1(i){var e="businessId",r=null,n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType(["collectibleId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("campaignId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r)],f.JSArray_Join)},$signature:1},t.campaignTierSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="campaignId",u="memberCount";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Campaign ID",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$numeric(e,!1,"From","fromPoint","from",e,i),t.Field_Field$numeric(e,!1,"To","toPoint","to",e,i),t.Field_Field$numeric(e,!1,"Member count",u,u,e,i),t.Field_Field$numeric(e,!1,"Rank","rank","no",e,i),t.Field_Field$string(e,!1,"Range","range",e,"concat(@from_point,' - ',@to_point)",i)],f.JSArray_Field)},$signature:0},t.campaignTierSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("docId",t._setArrayType(["campaignId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.chargeSchema_closure.prototype={call$1(i){var e=null,r="parentId",n="isRefund",u="beforeDiscount",o="inclusive",s="percentage";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Parent ID",r,r,e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Variant","variant","variant",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$bool(e,!1,"Refund",n,n,e,i),t.Field_Field$bool(e,!1,"Before Discount",u,u,e,i),t.Field_Field$bool(e,!1,"Inclusive",o,o,e,i),t.Field_Field$numeric(e,!1,"Percentage",s,s,e,i),t.Field_Field$numeric("@total*IF(@isRefund, -1, 1)",!1,"Total","total","total","@total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i)],f.JSArray_Field)},$signature:0},t.chargeSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("id",t._setArrayType(["parentId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.closingDraftSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="closingId",u="closingAdjustmentId",o="approveRemark",s="effectiveAt",l="approvedAt",D="updatedAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Closing ID",n,n,e,i),t.Field_Field$string(e,!1,"Adjustment ID",u,u,e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Approved remark",o,o,e,i),t.Field_Field$timestamp(e,!1,"Effective time",s,s,e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"Create user","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!1,"Create user ID","createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"Approve user","approvedByName","approvedBy.name",e,i),t.Field_Field$string(e,!1,"Approve user ID","approvedById","approvedBy.id",e,i),t.Field_Field$timestamp(e,!1,"Approve time",l,l,e,i),t.Field_Field$string(e,!1,"Update user","updatedByName","updatedBy.name",e,i),t.Field_Field$string(e,!1,"Update user ID","updatedById","updatedBy.id",e,i),t.Field_Field$timestamp(e,!1,"Update time",D,D,e,i)],f.JSArray_Field)},$signature:0},t.closingDraftSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.closingDraftSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="closingDraftId",u="closingAdjustmentId",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Closing draft ID",n,n,e,i),t.Field_Field$string(e,!1,"Adjustment ID",u,u,e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","skuId",e,i)],f.JSArray_Field)},$signature:0},t.closingDraftSkuSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.closingSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="closingId",u="weightedAverage";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Closing ID",n,n,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","skuId",e,i),t.Field_Field$numeric(e,!1,"Balance","balance","balance",e,i),t.Field_Field$numeric(e,!1,"Cost","cost","cost",e,i),t.Field_Field$numeric(e,!1,"Weighted average",u,u,e,i)],f.JSArray_Field)},$signature:0},t.closingSkuSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.collectibleCollectionSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="collectibleId",u="expiredAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Collectible ID",n,n,e,i),t.Field_Field$string(e,!1,"User ID","userId","userId",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$numeric(e,!1,"Max use","maxUse","options.maxUse",e,i),t.Field_Field$timestamp(e,!1,"Expired time",u,u,"(case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end)",i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$timestamp(e,!1,"Applied time","appliedAt",e,"(select created_at from collectible_transactions where collectible_transactions.collection_id=@id order by collectible_transactions.created_at desc limit 1)",i),t.Field_Field$bool(e,!1,"Is expired","isExpired",e,"CASE WHEN (case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end) < CURRENT_TIMESTAMP THEN true ELSE false END",i),t.Field_Field$numeric(e,!1,"Applied count","appliedCount",e,"(select -sum(collectible_transactions.amount) from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.refunded is not true and collectible_transactions.amount<0 and collectible_transactions.source!='CYCLE')",i)],f.JSArray_Field)},$signature:0},t.collectibleCollectionSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["collectibleId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("collectionId",t._setArrayType(["id"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.collectibleConfigSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="description";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Description",n,n,e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$numeric(e,!1,"Max distribution","maxDistribution","options.maxReceive",e,i),t.Field_Field$numeric(e,!1,"Max distribution per user","maxDistributePerUser","options.maxPerUser",e,i),t.Field_Field$numeric(e,!1,"Max use per collectible","maxUsePerCollectible","options.maxUse",e,i)],f.JSArray_Field)},$signature:0},t.collectibleConfigSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("collectibleId",t._setArrayType(["id"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.collectibleTransactionSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="collectionId",u="collectibleId",o="fromBalance",s="toBalance",l="expiredAt",D="refundedFrom",d="refunded";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Collection ID",n,n,e,i),t.Field_Field$string(e,!1,"Collectible ID",u,u,e,i),t.Field_Field$string(e,!1,"User ID","userId","userId",e,i),t.Field_Field$string(e,!1,"Ref ID","refId","refId",e,i),t.Field_Field$string(e,!1,"Source","source","source",e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i),t.Field_Field$numeric(e,!1,"From balance",o,o,e,i),t.Field_Field$numeric(e,!1,"To balance",s,s,e,i),t.Field_Field$timestamp(e,!1,"Expired at",l,l,e,i),t.Field_Field$string(e,!1,"Refund ref ID",D,D,e,i),t.Field_Field$string(e,!1,"Campaign ID","campaignId","metadata.campaign","(case when @campaign_id is not null then @campaign_id else (select min(child.id) from campaigns child where child.collectible_id=@collectible_id) end)",i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$numeric(e,!1,"Quantity distributed","qtyDistributed",e,"case when @amount>=0 and @refunded is not true and @refunded_from is null then @amount else 0 end",i),t.Field_Field$numeric(e,!1,"Quantity usage","qtyUsage",e,"case when @amount<0 and @source!='CYCLE' and @refunded is not true then -@amount else 0 end",i),t.Field_Field$numeric(e,!1,"Quantity expired","qtyExpired",e,"case when @amount<0 and @source='CYCLE' and @refunded is not true then -@amount else 0 end",i),t.Field_Field$string(e,!1,"Transaction ID","transactionId",e,"@doc_id",i),t.Field_Field$string(e,!1,"Transformed source","transformedSource",e,"(case when @source='PORTAL' then 'ADMIN' when @source='BENEFIT' then 'MEMBERSHIP' when @source='CYCLE' then 'EXPIRED' when @source='BILL' then (case when @amount<0 then 'USAGE' when @refunded_from is not null then 'RETURN' else 'DISTRIBUTE' end) else @source end)",i),t.Field_Field$string(e,!1,"Credit type","creditType",e,"case when @expired_at is null then 'NORMAL' else 'FREE' end",i),t.Field_Field$bool(e,!0,"Refunded",d,d,e,i)],f.JSArray_Field)},$signature:0},t.collectibleTransactionSchema_closure0.prototype={call$1(i){var e="id",r="businessId",n=null,u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["refId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectibleId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_67,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectionId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["campaignId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["userId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n)],f.JSArray_Join)},$signature:1},t.completeTimeBillSchema_closure.prototype={call$1(i){var e=null,r="seqNumber",n="deliveryName",u="isRefund",o="isPickup",s="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",E="thirdPartyExtraCharge",C="deliveryFee",I="nettTotal",b="deliveryFeeWithTax",F="deliveryFeeWithoutTax",M="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",r,r,e,i),t.Field_Field$string(e,!1,"Table","slot","slot",e,i),t.Field_Field$string(e,!1,"Delivery",n,n,e,i),t.Field_Field$string(e,!1,"Refund ID","refundFrom","refundedFrom",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!0,e,"refundApprovedById","refund.approvedBy.id",e,i),t.Field_Field$string(e,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,i),t.Field_Field$string(e,!0,e,"refundedById","refund.by.id",e,i),t.Field_Field$string(e,!1,"Refund user","refundedByName","refund.by.name",e,i),t.Field_Field$string(e,!1,"Refund reason","refundReason","refund.reason",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","membership.id",e,i),t.Field_Field$string(e,!1,"Member user ID","memberUserId","membership.userId",e,i),t.Field_Field$string(e,!1,"Member name","memberUserName","membership.name",e,i),t.Field_Field$string(e,!0,"Member phone","memberPhoneNumber","membership.phoneNumber",e,i),t.Field_Field$timestamp(e,!1,"Member birthday","memberBirthday","membership.birthday",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Source","source","source",A.x28case_,i),t.Field_Field$string(e,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",i),t.Field_Field$bool(e,!0,"Pickup",o,o,e,i),t.Field_Field$bool(e,!0,"Is in house delivery",s,s,e,i),t.Field_Field$bool(e,!0,"Is other delivery",l,l,e,i),t.Field_Field$bool(e,!0,"Is takeaway","isTakeaway","is.takeaway",e,i),t.Field_Field$timestamp(e,!1,"Closed at",D,D,e,i),t.Field_Field$string(e,!0,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,i),t.Field_Field$string(e,!0,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,i),t.Field_Field$string(e,!0,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,i),t.Field_Field$string(e,!0,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,i),t.Field_Field$numeric("IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,"Pax","pax","person",A.COALESp,i),t.Field_Field$string(e,!1,"Integrated order ID",d,d,e,i),t.Field_Field$numeric(A.IFNULLi,!0,"Item count",c,c,A.COALESi,i),t.Field_Field$numeric("IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,"Tax",p,p,A.COALEStax,i),t.Field_Field$numeric(A.IFNULLdiT,!1,"Discount",y,y,A.COALESdit,i),t.Field_Field$numeric(A.IFNULLg,!1,"Item gross",g,g,A.COALESg,i),t.Field_Field$numeric(A.x28IFNULnI,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,i),t.Field_Field$numeric("IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,"Rounding",m,m,A.COALESr,i),t.Field_Field$numeric("IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,i),t.Field_Field$string(e,!0,"SST %","sstPercentage","nettTaxes.SST.percentage",e,i),t.Field_Field$numeric(A.IFNULLs,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,i),t.Field_Field$string(e,!0,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,i),t.Field_Field$numeric(A.x28IFNULo,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,i),t.Field_Field$numeric(A.x28IFNULgx2d,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,i),t.Field_Field$numeric(A.IFNULLta,!1,"Takeaway",h,h,A.COALEStak,i),t.Field_Field$numeric(A.IFNULLth,!1,"Extra charge",E,E,A.COALESth,i),t.Field_Field$numeric(A.IFNULLde_,!1,"Delivery fee",C,C,A.COALESdex2c,i),t.Field_Field$numeric(A.IFNULLn,!1,"Nett",I,I,A.COALESn,i),t.Field_Field$numeric(A.x28IFNULgx2bd,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,i),t.Field_Field$numeric(A.x28IFNULn_,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,i),t.Field_Field$numeric(e,!1,"Member Recency","recency",e,A.MIN_EX,i),t.Field_Field$numeric(e,!1,"Member frequency","frequency",e,A.COUNT_,i),t.Field_Field$numeric(e,!1,"Member monetary","monetary",e,A.SUM__n,i),t.Field_Field$numeric(A.IFNULLdeWT,!1,"Delivery fee with tax",b,b,A.COALESdex5f_,i),t.Field_Field$numeric(A.IFNULLdeWo,!1,"Delivery fee without tax",F,F,A.COALESdex5fo,i),t.Field_Field$numeric(A.IFNULLoT,!1,"Other charge with tax",M,M,A.COALESo_,i),t.Field_Field$numeric(A.IFNULLoo,!1,"Other charge without tax",x,x,A.COALESoo,i),t.Field_Field$numeric(e,!1,"Duration","duration",e,A.EXTRAC,i),t.Field_Field$string(e,!1,"Restaurant","restaurantName",e,A.x28selecn,i),t.Field_Field$numeric(e,!1,"Labour hour","labourHour",e,A.x28selecS,i),t.Field_Field$string(e,!1,"Payments","payments",e,A.x28selecstdn,i),t.Field_Field$string(e,!1,"Items","items",e,A.x28selecstC,i),t.Field_Field$string(e,!1,"Discount reasons","discountReasons",e,A.x28selecstda,i),t.Field_Field$numeric(A.IFNULLdiI,!1,"Discount inc tax",R,R,A.COALESdii,i),t.Field_Field$string(e,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,i)],f.JSArray_Field)},$signature:0},t.completeTimeBillSchema_closure0.prototype={call$1(i){var e="id",r="restaurantId",n=null,u="billId",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n)],f.JSArray_Join)},$signature:1},t.counterSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i)],f.JSArray_Field)},$signature:0},t.counterSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.creditTransactionSchema_closure.prototype={call$1(i){var e=null,r="refunded",n="freeAmount",u="normalAmount",o="totalAmount";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID","businessId","business",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","restaurant",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","member",e,i),t.Field_Field$bool(e,!1,"Is refund",r,r,e,i),t.Field_Field$string(e,!1,"Source","source","source",e,i),t.Field_Field$string(e,!1,"Ref","ref","ref",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$numeric(e,!1,"Free",n,n,e,i),t.Field_Field$numeric(e,!1,"Normal",u,u,e,i),t.Field_Field$numeric(e,!1,"Total",o,o,e,i)],f.JSArray_Field)},$signature:0},t.creditTransactionSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.drawerSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!0,e,"userId","user.id",e,i),t.Field_Field$string(e,!1,"User","userName","user.name",e,i),t.Field_Field$string(e,!1,"Reason","reason","reason",e,i),t.Field_Field$string(e,!1,"Counter ID","counterId","counter.id",e,i),t.Field_Field$string(e,!1,"Counter","counterName","counter.name",e,i),t.Field_Field$numeric(e,!1,"Total","amount","amount",e,i),t.Field_Field$string("IF(@amount>=0, 'IN', 'OUT')",!1,"Type","type",e,"CASE WHEN @amount>=0 THEN 'IN' ELSE 'OUT' END",i),t.Field_Field$numeric("IF(@amount>=0, @amount, 0)",!1,"In","in",e,A.CASE_Wax3e,i),t.Field_Field$numeric("IF(@amount<0, @amount, 0)",!1,"Out","out",e,A.CASE_Wax3c,i)],f.JSArray_Field)},$signature:0},t.drawerSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.flattenItemSchema_closure.prototype={call$1(i){var e=null,r="itemCreatedAt",n="billCompletedAt",u="perXUnit",o="takeawayId",s="takeawayName",l="productId",D="isRefund",d="servedAt",c="isTakeaway",p="quantity",y="unitQuantity",g="billAdjustmentTotal",m="itemAdjustmentTotal",h="grossTotal",E="takeawayPrice",C="nettTotal",I="layerNettTotal",b="layerBillAdjustmentTotal",F="layerItemAdjustmentTotal",M="layerGrossTotal",x="layerTakeawayPrice",R="layerTaxTotal",O="layerScTotal",L="layerOtherChargeTotal",v="customAttributes",X="layerZeroParentId",c0="collectedAt",p0="subCategories",$0="billAdjustmentInclusiveTaxTotal",f0="itemAdjustmentInclusiveTaxTotal",y0="layerBillAdjustmentInclusiveTaxTotal",g0="layerItemAdjustmentInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Item time",r,r,e,i),t.Field_Field$timestamp(e,!1,"Bill close time",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$numeric(e,!1,"Per unit",u,u,e,i),t.Field_Field$string(e,!1,"Unit","unit","unit",e,i),t.Field_Field$string(`IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), 'Other', @categoryName)
|
|
84
|
+
`,i),t.Field_Field$string(e,!1,"Code","code",e,e,i),t.Field_Field$string(e,!1,"Variant","variantName",e,e,i),t.Field_Field$string(e,!1,"Parent ID","parentId",e,e,i),t.Field_Field$string("SPLIT(@addonId, '/')[OFFSET(0)]",!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",i)],f.JSArray_Field)},$signature:0},t.addonFlattenItemSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.adjustmentSchema_closure.prototype={call$1(i){var e=null,r="billCompletedAt",n="isRefund",u="quantity",o="returnId",s="referenceId";return t._setArrayType([t.Field_Field$string(e,!1,e,"id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!0,"Bill time","adjustmentCreatedAt",e,e,i),t.Field_Field$timestamp(e,!1,"Bill close time",r,r,e,i),t.Field_Field$bool(e,!1,"Refund",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Item ID","itemId","itemId",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Cause","cause","cause",e,i),t.Field_Field$string(e,!1,"Reason","reason","reason",e,i),t.Field_Field$string(e,!1,"Discount user","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!0,e,"createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"Discount approver","approvedByName","createApprovedBy.name",e,i),t.Field_Field$string(e,!0,e,"approvedById","createApprovedBy.id",e,i),t.Field_Field$numeric("IFNULL(@quantity,0)*IF(@isRefund, -1, 1)",!1,"Qty",u,u,"COALESCE(@quantity,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("IFNULL((@quantity*@total),0)*IF(@isRefund, -1, 1)",!1,"Total","total","total","COALESCE((@quantity*@total),0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$string(e,!1,"Return ID",o,o,e,i),t.Field_Field$string(e,!1,"Ref ID",s,s,e,i),t.Field_Field$string(e,!1,"Target","target",e,"coalesce((select name from flatten_items where flatten_items.id=@item_id and flatten_items.bill_id=@bill_id and flatten_items.restaurant_id=@restaurant_id), 'BILL')",i)],f.JSArray_Field)},$signature:0},t.adjustmentSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("refId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.billSchema_closure.prototype={call$1(i){var e=null,r="seqNumber",n="deliveryName",u="isRefund",o="isPickup",s="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",E="thirdPartyExtraCharge",C="deliveryFee",I="nettTotal",b="deliveryFeeWithTax",F="deliveryFeeWithoutTax",M="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",r,r,e,i),t.Field_Field$string(e,!1,"Table","slot","slot",e,i),t.Field_Field$string(e,!1,"Delivery",n,n,e,i),t.Field_Field$string(e,!1,"Refund ID","refundFrom","refundedFrom",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!0,e,"refundApprovedById","refund.approvedBy.id",e,i),t.Field_Field$string(e,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,i),t.Field_Field$string(e,!0,e,"refundedById","refund.by.id",e,i),t.Field_Field$string(e,!1,"Refund user","refundedByName","refund.by.name",e,i),t.Field_Field$string(e,!1,"Refund reason","refundReason","refund.reason",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","membership.id",e,i),t.Field_Field$string(e,!1,"Member user ID","memberUserId","membership.userId",e,i),t.Field_Field$string(e,!1,"Member name","memberUserName","membership.name",e,i),t.Field_Field$string(e,!0,"Member phone","memberPhoneNumber","membership.phoneNumber",e,i),t.Field_Field$timestamp(e,!1,"Member birthday","memberBirthday","membership.birthday",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Source","source","source",A.x28case_,i),t.Field_Field$string(e,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when upper(@type)='DRIVE THRU' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",i),t.Field_Field$bool(e,!0,"Pickup",o,o,e,i),t.Field_Field$bool(e,!0,"Is in house delivery",s,s,e,i),t.Field_Field$bool(e,!0,"Is other delivery",l,l,e,i),t.Field_Field$bool(e,!0,"Is takeaway","isTakeaway","is.takeaway",e,i),t.Field_Field$timestamp(e,!1,"Closed at",D,D,e,i),t.Field_Field$string(e,!0,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,i),t.Field_Field$string(e,!0,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,i),t.Field_Field$string(e,!0,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,i),t.Field_Field$string(e,!0,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,i),t.Field_Field$numeric("IF(@status = 'VOIDED', 0, IFNULL(@pax,0)*IF(@isRefund, -1, 1))",!1,"Pax","pax","person","(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (COALESCE(@pax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",i),t.Field_Field$string(e,!1,"Integrated order ID",d,d,e,i),t.Field_Field$numeric(A.IFNULLi,!0,"Item count",c,c,A.COALESi,i),t.Field_Field$numeric("IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,"Tax",p,p,A.COALEStax,i),t.Field_Field$numeric(A.IFNULLdiT,!1,"Discount",y,y,A.COALESdit,i),t.Field_Field$numeric(A.IFNULLg,!1,"Item gross",g,g,A.COALESg,i),t.Field_Field$numeric(A.x28IFNULnI,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,i),t.Field_Field$numeric("IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,"Rounding",m,m,A.COALESr,i),t.Field_Field$numeric("IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,i),t.Field_Field$string(e,!0,"SST %","sstPercentage","nettTaxes.SST.percentage",e,i),t.Field_Field$numeric(A.IFNULLs,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,i),t.Field_Field$string(e,!0,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,i),t.Field_Field$numeric(A.x28IFNULo,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,i),t.Field_Field$numeric(A.x28IFNULgx2d,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,i),t.Field_Field$numeric(A.IFNULLta,!1,"Takeaway",h,h,A.COALEStak,i),t.Field_Field$numeric(A.IFNULLth,!1,"Extra charge",E,E,A.COALESth,i),t.Field_Field$numeric(A.IFNULLde_,!1,"Delivery fee",C,C,A.COALESdex2c,i),t.Field_Field$numeric(A.IFNULLn,!1,"Nett",I,I,A.COALESn,i),t.Field_Field$numeric(A.x28IFNULgx2bd,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,i),t.Field_Field$numeric(A.x28IFNULn_,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,i),t.Field_Field$numeric(e,!1,"Member Recency","recency",e,A.MIN_EX,i),t.Field_Field$numeric(e,!1,"Member frequency","frequency",e,A.COUNT_,i),t.Field_Field$numeric(e,!1,"Member monetary","monetary",e,A.SUM__n,i),t.Field_Field$numeric(A.IFNULLdeWT,!1,"Delivery fee with tax",b,b,A.COALESdex5f_,i),t.Field_Field$numeric(A.IFNULLdeWo,!1,"Delivery fee without tax",F,F,A.COALESdex5fo,i),t.Field_Field$numeric(A.IFNULLoT,!1,"Other charge with tax",M,M,A.COALESo_,i),t.Field_Field$numeric(A.IFNULLoo,!1,"Other charge without tax",x,x,A.COALESoo,i),t.Field_Field$numeric(e,!1,"Duration","duration",e,A.EXTRAC,i),t.Field_Field$string(e,!1,"Restaurant","restaurantName",e,A.x28selecn,i),t.Field_Field$numeric(e,!1,"Labour hour","labourHour",e,A.x28selecS,i),t.Field_Field$string(e,!1,"Payments","payments",e,A.x28selecstdn,i),t.Field_Field$string(e,!1,"Items","items",e,A.x28selecstC,i),t.Field_Field$string(e,!1,"Discount reasons","discountReasons",e,A.x28selecstda,i),t.Field_Field$numeric(A.IFNULLdiI,!1,"Discount inc tax",R,R,A.COALESdii,i),t.Field_Field$string(e,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,i),t.Field_Field$numeric(e,!1,"Is new member","isNewMember",e,"(CASE WHEN EXISTS (SELECT 1 FROM members WHERE members.id=@member_id AND members.created_at::date = @created_at::date) THEN 1 ELSE 0 END)",i),t.Field_Field$numeric(e,!1,"Is 30 days recency","is30DaysRecency",e,"(CASE WHEN EXISTS (SELECT 1 FROM bills WHERE bills.member_id = @member_id AND bills.status != 'VOIDED' AND bills.restaurant_id = @restaurant_id AND bills.created_at >= @created_at - INTERVAL '30 days' AND bills.created_at < @created_at) THEN 1 ELSE 0 END)",i)],f.JSArray_Field)},$signature:0},t.billSchema_closure0.prototype={call$1(i){var e="id",r="restaurantId",n=null,u="billId",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n)],f.JSArray_Join)},$signature:1},t.businessSchema_closure.prototype={call$1(i){var e=null,r="expiredAt",n="restaurantQuota",u="warehouseQuota",o="internal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Agent ID","agentId","agentId",e,i),t.Field_Field$string(e,!1,"Owner ID","ownerId","ownerId",e,i),t.Field_Field$timestamp(e,!1,"Expired at",r,r,e,i),t.Field_Field$numeric(e,!0,e,n,n,e,i),t.Field_Field$numeric(e,!0,e,u,u,e,i),t.Field_Field$bool(e,!0,e,o,o,e,i)],f.JSArray_Field)},$signature:0},t.businessSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.campaignSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="restaurantId",u="description",o="collectibleId",s="templateId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$string(e,!1,"Restaurant ID",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Description",u,u,e,i),t.Field_Field$timestamp(e,!1,"Started at","startedAt","start",e,i),t.Field_Field$timestamp(e,!1,"Ended at","endedAt","end",e,i),t.Field_Field$string(e,!1,"Collectible ID",o,o,e,i),t.Field_Field$string(e,!1,"Template ID",s,s,e,i),t.Field_Field$string(e,!1,"Group ID","groupId","groupId",e,i),t.Field_Field$bool(e,!1,"Active","active",e,"((@ended_at is null or @ended_at >= !end) and (@started_at is null or @started_at <= !start))",i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Event type","eventType","event.type",e,i)],f.JSArray_Field)},$signature:0},t.campaignSchema_closure0.prototype={call$1(i){var e="businessId",r=null,n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType(["collectibleId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("campaignId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r)],f.JSArray_Join)},$signature:1},t.campaignTierSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="campaignId",u="memberCount";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Campaign ID",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$numeric(e,!1,"From","fromPoint","from",e,i),t.Field_Field$numeric(e,!1,"To","toPoint","to",e,i),t.Field_Field$numeric(e,!1,"Member count",u,u,e,i),t.Field_Field$numeric(e,!1,"Rank","rank","no",e,i),t.Field_Field$string(e,!1,"Range","range",e,"concat(@from_point,' - ',@to_point)",i)],f.JSArray_Field)},$signature:0},t.campaignTierSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("docId",t._setArrayType(["campaignId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.chargeSchema_closure.prototype={call$1(i){var e=null,r="parentId",n="isRefund",u="beforeDiscount",o="inclusive",s="percentage";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Parent ID",r,r,e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Variant","variant","variant",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$bool(e,!1,"Refund",n,n,e,i),t.Field_Field$bool(e,!1,"Before Discount",u,u,e,i),t.Field_Field$bool(e,!1,"Inclusive",o,o,e,i),t.Field_Field$numeric(e,!1,"Percentage",s,s,e,i),t.Field_Field$numeric("@total*IF(@isRefund, -1, 1)",!1,"Total","total","total","@total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i)],f.JSArray_Field)},$signature:0},t.chargeSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("id",t._setArrayType(["parentId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.closingDraftSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="closingId",u="closingAdjustmentId",o="approveRemark",s="effectiveAt",l="approvedAt",D="updatedAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Closing ID",n,n,e,i),t.Field_Field$string(e,!1,"Adjustment ID",u,u,e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Approved remark",o,o,e,i),t.Field_Field$timestamp(e,!1,"Effective time",s,s,e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"Create user","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!1,"Create user ID","createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"Approve user","approvedByName","approvedBy.name",e,i),t.Field_Field$string(e,!1,"Approve user ID","approvedById","approvedBy.id",e,i),t.Field_Field$timestamp(e,!1,"Approve time",l,l,e,i),t.Field_Field$string(e,!1,"Update user","updatedByName","updatedBy.name",e,i),t.Field_Field$string(e,!1,"Update user ID","updatedById","updatedBy.id",e,i),t.Field_Field$timestamp(e,!1,"Update time",D,D,e,i)],f.JSArray_Field)},$signature:0},t.closingDraftSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.closingDraftSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="closingDraftId",u="closingAdjustmentId",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Closing draft ID",n,n,e,i),t.Field_Field$string(e,!1,"Adjustment ID",u,u,e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","skuId",e,i)],f.JSArray_Field)},$signature:0},t.closingDraftSkuSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.closingSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="closingId",u="weightedAverage";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Closing ID",n,n,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","skuId",e,i),t.Field_Field$numeric(e,!1,"Balance","balance","balance",e,i),t.Field_Field$numeric(e,!1,"Cost","cost","cost",e,i),t.Field_Field$numeric(e,!1,"Weighted average",u,u,e,i)],f.JSArray_Field)},$signature:0},t.closingSkuSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.collectibleCollectionSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="collectibleId",u="expiredAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Collectible ID",n,n,e,i),t.Field_Field$string(e,!1,"User ID","userId","userId",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$numeric(e,!1,"Max use","maxUse","options.maxUse",e,i),t.Field_Field$timestamp(e,!1,"Expired time",u,u,"(case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end)",i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$timestamp(e,!1,"Applied time","appliedAt",e,"(select created_at from collectible_transactions where collectible_transactions.collection_id=@id order by collectible_transactions.created_at desc limit 1)",i),t.Field_Field$bool(e,!1,"Is expired","isExpired",e,"CASE WHEN (case when @expired_at is not null then @expired_at else (select expired_at from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.expired_at is not null and collectible_transactions.amount>0 order by collectible_transactions.created_at desc limit 1) end) < CURRENT_TIMESTAMP THEN true ELSE false END",i),t.Field_Field$numeric(e,!1,"Applied count","appliedCount",e,"(select -sum(collectible_transactions.amount) from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.refunded is not true and collectible_transactions.amount<0 and collectible_transactions.source!='CYCLE')",i)],f.JSArray_Field)},$signature:0},t.collectibleCollectionSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["collectibleId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition("collectionId",t._setArrayType(["id"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.collectibleConfigSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="description";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Description",n,n,e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$numeric(e,!1,"Max distribution","maxDistribution","options.maxReceive",e,i),t.Field_Field$numeric(e,!1,"Max distribution per user","maxDistributePerUser","options.maxPerUser",e,i),t.Field_Field$numeric(e,!1,"Max use per collectible","maxUsePerCollectible","options.maxUse",e,i)],f.JSArray_Field)},$signature:0},t.collectibleConfigSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("collectibleId",t._setArrayType(["id"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.collectibleTransactionSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="collectionId",u="collectibleId",o="fromBalance",s="toBalance",l="expiredAt",D="refundedFrom",d="refunded";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Collection ID",n,n,e,i),t.Field_Field$string(e,!1,"Collectible ID",u,u,e,i),t.Field_Field$string(e,!1,"User ID","userId","userId",e,i),t.Field_Field$string(e,!1,"Ref ID","refId","refId",e,i),t.Field_Field$string(e,!1,"Source","source","source",e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i),t.Field_Field$numeric(e,!1,"From balance",o,o,e,i),t.Field_Field$numeric(e,!1,"To balance",s,s,e,i),t.Field_Field$timestamp(e,!1,"Expired at",l,l,e,i),t.Field_Field$string(e,!1,"Refund ref ID",D,D,e,i),t.Field_Field$string(e,!1,"Campaign ID","campaignId","metadata.campaign","(case when @campaign_id is not null then @campaign_id else (select min(child.id) from campaigns child where child.collectible_id=@collectible_id) end)",i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$numeric(e,!1,"Quantity distributed","qtyDistributed",e,"case when @amount>=0 and @refunded is not true and @refunded_from is null then @amount else 0 end",i),t.Field_Field$numeric(e,!1,"Quantity usage","qtyUsage",e,"case when @amount<0 and @source!='CYCLE' and @refunded is not true then -@amount else 0 end",i),t.Field_Field$numeric(e,!1,"Quantity expired","qtyExpired",e,"case when @amount<0 and @source='CYCLE' and @refunded is not true then -@amount else 0 end",i),t.Field_Field$string(e,!1,"Transaction ID","transactionId",e,"@doc_id",i),t.Field_Field$string(e,!1,"Transformed source","transformedSource",e,"(case when @source='PORTAL' then 'ADMIN' when @source='BENEFIT' then 'MEMBERSHIP' when @source='CYCLE' then 'EXPIRED' when @source='BILL' then (case when @amount<0 then 'USAGE' when @refunded_from is not null then 'RETURN' else 'DISTRIBUTE' end) else @source end)",i),t.Field_Field$string(e,!1,"Credit type","creditType",e,"case when @expired_at is null then 'NORMAL' else 'FREE' end",i),t.Field_Field$bool(e,!0,"Refunded",d,d,e,i)],f.JSArray_Field)},$signature:0},t.collectibleTransactionSchema_closure0.prototype={call$1(i){var e="id",r="businessId",n=null,u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["refId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_62,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectibleId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_67,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectionId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_61,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["campaignId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["userId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n),new t.Join(_.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["businessId"],u),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refId"],u),_.COMPARISON_OPERATOR_0,n)],o),!1,i,n)],f.JSArray_Join)},$signature:1},t.completeTimeBillSchema_closure.prototype={call$1(i){var e=null,r="seqNumber",n="deliveryName",u="isRefund",o="isPickup",s="isInHouseDelivery",l="isDelivery",D="completedAt",d="integratedOrderId",c="itemCount",p="taxTotal",y="discountTotal",g="grossTotal",m="rounding",h="takeawayPrice",E="thirdPartyExtraCharge",C="deliveryFee",I="nettTotal",b="deliveryFeeWithTax",F="deliveryFeeWithoutTax",M="otherChargeWithTax",x="otherChargeWithoutTax",R="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",r,r,e,i),t.Field_Field$string(e,!1,"Table","slot","slot",e,i),t.Field_Field$string(e,!1,"Delivery",n,n,e,i),t.Field_Field$string(e,!1,"Refund ID","refundFrom","refundedFrom",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!0,e,"refundApprovedById","refund.approvedBy.id",e,i),t.Field_Field$string(e,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,i),t.Field_Field$string(e,!0,e,"refundedById","refund.by.id",e,i),t.Field_Field$string(e,!1,"Refund user","refundedByName","refund.by.name",e,i),t.Field_Field$string(e,!1,"Refund reason","refundReason","refund.reason",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","membership.id",e,i),t.Field_Field$string(e,!1,"Member user ID","memberUserId","membership.userId",e,i),t.Field_Field$string(e,!1,"Member name","memberUserName","membership.name",e,i),t.Field_Field$string(e,!0,"Member phone","memberPhoneNumber","membership.phoneNumber",e,i),t.Field_Field$timestamp(e,!1,"Member birthday","memberBirthday","membership.birthday",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Source","source","source",A.x28case_,i),t.Field_Field$string(e,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",i),t.Field_Field$bool(e,!0,"Pickup",o,o,e,i),t.Field_Field$bool(e,!0,"Is in house delivery",s,s,e,i),t.Field_Field$bool(e,!0,"Is other delivery",l,l,e,i),t.Field_Field$bool(e,!0,"Is takeaway","isTakeaway","is.takeaway",e,i),t.Field_Field$timestamp(e,!1,"Closed at",D,D,e,i),t.Field_Field$string(e,!0,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,i),t.Field_Field$string(e,!0,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,i),t.Field_Field$string(e,!0,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,i),t.Field_Field$string(e,!0,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,i),t.Field_Field$numeric("IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,"Pax","pax","person",A.COALESp,i),t.Field_Field$string(e,!1,"Integrated order ID",d,d,e,i),t.Field_Field$numeric(A.IFNULLi,!0,"Item count",c,c,A.COALESi,i),t.Field_Field$numeric("IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,"Tax",p,p,A.COALEStax,i),t.Field_Field$numeric(A.IFNULLdiT,!1,"Discount",y,y,A.COALESdit,i),t.Field_Field$numeric(A.IFNULLg,!1,"Item gross",g,g,A.COALESg,i),t.Field_Field$numeric(A.x28IFNULnI,!1,"Bill gross","billGrossTotal",e,A.x28COALEnC,i),t.Field_Field$numeric("IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,"Rounding",m,m,A.COALESr,i),t.Field_Field$numeric("IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,i),t.Field_Field$string(e,!0,"SST %","sstPercentage","nettTaxes.SST.percentage",e,i),t.Field_Field$numeric(A.IFNULLs,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,i),t.Field_Field$string(e,!0,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,i),t.Field_Field$numeric(A.x28IFNULo,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,i),t.Field_Field$numeric(A.x28IFNULgx2d,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,i),t.Field_Field$numeric(A.IFNULLta,!1,"Takeaway",h,h,A.COALEStak,i),t.Field_Field$numeric(A.IFNULLth,!1,"Extra charge",E,E,A.COALESth,i),t.Field_Field$numeric(A.IFNULLde_,!1,"Delivery fee",C,C,A.COALESdex2c,i),t.Field_Field$numeric(A.IFNULLn,!1,"Nett",I,I,A.COALESn,i),t.Field_Field$numeric(A.x28IFNULgx2bd,!1,"Item gross before charges","grossBeforeCharges",e,A.x28COALEgx2bd,i),t.Field_Field$numeric(A.x28IFNULn_,!1,"Bill gross before charges","billGrossBeforeCharges",e,A.x28COALEn_,i),t.Field_Field$numeric(e,!1,"Member Recency","recency",e,A.MIN_EX,i),t.Field_Field$numeric(e,!1,"Member frequency","frequency",e,A.COUNT_,i),t.Field_Field$numeric(e,!1,"Member monetary","monetary",e,A.SUM__n,i),t.Field_Field$numeric(A.IFNULLdeWT,!1,"Delivery fee with tax",b,b,A.COALESdex5f_,i),t.Field_Field$numeric(A.IFNULLdeWo,!1,"Delivery fee without tax",F,F,A.COALESdex5fo,i),t.Field_Field$numeric(A.IFNULLoT,!1,"Other charge with tax",M,M,A.COALESo_,i),t.Field_Field$numeric(A.IFNULLoo,!1,"Other charge without tax",x,x,A.COALESoo,i),t.Field_Field$numeric(e,!1,"Duration","duration",e,A.EXTRAC,i),t.Field_Field$string(e,!1,"Restaurant","restaurantName",e,A.x28selecn,i),t.Field_Field$numeric(e,!1,"Labour hour","labourHour",e,A.x28selecS,i),t.Field_Field$string(e,!1,"Payments","payments",e,A.x28selecstdn,i),t.Field_Field$string(e,!1,"Items","items",e,A.x28selecstC,i),t.Field_Field$string(e,!1,"Discount reasons","discountReasons",e,A.x28selecstda,i),t.Field_Field$numeric(A.IFNULLdiI,!1,"Discount inc tax",R,R,A.COALESdii,i),t.Field_Field$string(e,!1,"Payment Summaries","paymentSummaries",e,A.x28selecstdC,i)],f.JSArray_Field)},$signature:0},t.completeTimeBillSchema_closure0.prototype={call$1(i){var e="id",r="restaurantId",n=null,u="billId",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_69,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(e,t._setArrayType(["refundFrom"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,n),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,n)],s),!1,i,n)],f.JSArray_Join)},$signature:1},t.counterSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i)],f.JSArray_Field)},$signature:0},t.counterSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.creditTransactionSchema_closure.prototype={call$1(i){var e=null,r="refunded",n="freeAmount",u="normalAmount",o="totalAmount";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID","businessId","business",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","restaurant",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","member",e,i),t.Field_Field$bool(e,!1,"Is refund",r,r,e,i),t.Field_Field$string(e,!1,"Source","source","source",e,i),t.Field_Field$string(e,!1,"Ref","ref","ref",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$numeric(e,!1,"Free",n,n,e,i),t.Field_Field$numeric(e,!1,"Normal",u,u,e,i),t.Field_Field$numeric(e,!1,"Total",o,o,e,i)],f.JSArray_Field)},$signature:0},t.creditTransactionSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.drawerSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!0,e,"userId","user.id",e,i),t.Field_Field$string(e,!1,"User","userName","user.name",e,i),t.Field_Field$string(e,!1,"Reason","reason","reason",e,i),t.Field_Field$string(e,!1,"Counter ID","counterId","counter.id",e,i),t.Field_Field$string(e,!1,"Counter","counterName","counter.name",e,i),t.Field_Field$numeric(e,!1,"Total","amount","amount",e,i),t.Field_Field$string("IF(@amount>=0, 'IN', 'OUT')",!1,"Type","type",e,"CASE WHEN @amount>=0 THEN 'IN' ELSE 'OUT' END",i),t.Field_Field$numeric("IF(@amount>=0, @amount, 0)",!1,"In","in",e,A.CASE_Wax3e,i),t.Field_Field$numeric("IF(@amount<0, @amount, 0)",!1,"Out","out",e,A.CASE_Wax3c,i)],f.JSArray_Field)},$signature:0},t.drawerSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.flattenItemSchema_closure.prototype={call$1(i){var e=null,r="itemCreatedAt",n="billCompletedAt",u="perXUnit",o="takeawayId",s="takeawayName",l="productId",D="isRefund",d="servedAt",c="isTakeaway",p="quantity",y="unitQuantity",g="billAdjustmentTotal",m="itemAdjustmentTotal",h="grossTotal",E="takeawayPrice",C="nettTotal",I="layerNettTotal",b="layerBillAdjustmentTotal",F="layerItemAdjustmentTotal",M="layerGrossTotal",x="layerTakeawayPrice",R="layerTaxTotal",O="layerScTotal",L="layerOtherChargeTotal",v="customAttributes",X="layerZeroParentId",c0="collectedAt",p0="subCategories",$0="billAdjustmentInclusiveTaxTotal",f0="itemAdjustmentInclusiveTaxTotal",y0="layerBillAdjustmentInclusiveTaxTotal",g0="layerItemAdjustmentInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Item time",r,r,e,i),t.Field_Field$timestamp(e,!1,"Bill close time",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$numeric(e,!1,"Per unit",u,u,e,i),t.Field_Field$string(e,!1,"Unit","unit","unit",e,i),t.Field_Field$string(`IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), 'Other', @categoryName)
|
|
85
85
|
`,!1,"Category","categoryName","category",`CASE WHEN @category_name IS NULL OR @product_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN 'Other' ELSE @category_name END
|
|
86
86
|
`,i),t.Field_Field$string(e,!1,"Takeaway ID",o,o,e,i),t.Field_Field$string(e,!1,"Takeaway name",s,s,e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Product ID",l,l,e,i),t.Field_Field$string(e,!1,"Variant ID","variantId","variant.id",e,i),t.Field_Field$string(e,!1,"Variant","variantName","variant.name",e,i),t.Field_Field$bool(e,!1,"Refund",D,D,e,i),t.Field_Field$string(e,!1,"User id","createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"User","createdByName","createdBy.name",e,i),t.Field_Field$timestamp(e,!1,"Sent time","sentAt","sentAt",e,i),t.Field_Field$timestamp(e,!1,"Served time",d,d,e,i),t.Field_Field$timestamp(e,!1,"Printed time","printedAt","printBy.printAt",e,i),t.Field_Field$timestamp(e,!1,"Void time","voidAt","void.voidAt",e,i),t.Field_Field$string(e,!1,"Void reason","voidReason","void.reason",e,i),t.Field_Field$string(e,!0,e,"voidedById","void.by.id",e,i),t.Field_Field$string(e,!1,"Void user","voidedByName","void.by.name",e,i),t.Field_Field$string(e,!0,e,"voidApprovedById","void.approvedBy.id",e,i),t.Field_Field$string(e,!1,"Void approver","voidApprovedByName","void.approvedBy.name",e,i),t.Field_Field$bool(e,!0,"SST before discount","sstBeforeDiscount","sst.beforeDiscount",e,i),t.Field_Field$bool(e,!0,"SC before discount","serviceChargeBeforeDiscount","sc.beforeDiscount",e,i),t.Field_Field$bool(e,!1,"Takeaway",c,c,e,i),t.Field_Field$numeric("@quantity*IF(@isRefund, -1, 1)",!1,"Qty",p,p,A.x40quant,i),t.Field_Field$numeric("@unitQuantity*IF(@isRefund, -1, 1)",!1,"Unit qty",y,y,A.x40unit_,i),t.Field_Field$numeric("@sstTotal*IF(@isRefund, -1, 1)",!1,"SST","sstTotal","sst.total",A.x40sst_t,i),t.Field_Field$numeric(e,!0,"SST %","sstPercentage","sst.percentage",e,i),t.Field_Field$numeric(e,!0,"SC %","serviceChargePercentage","sc.percentage",e,i),t.Field_Field$numeric("@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,"SC","serviceChargeTotal","sc.total",A.x40servi,i),t.Field_Field$numeric("@otherChargeTotal*IF(@isRefund, -1, 1)",!1,"Other charge","otherChargeTotal","otherCharge.total",A.x40other,i),t.Field_Field$numeric(A.x40billA,!1,"Bill discount",g,g,A.x40bill_,i),t.Field_Field$numeric(A.x40itemA,!1,"Item discount",m,m,A.x40item_,i),t.Field_Field$numeric("@grossTotal*IF(@isRefund, -1, 1)",!1,"Gross",h,h,A.x40gross,i),t.Field_Field$numeric(A.x28_grosT,!1,"Gross w/ takeaway","grossTotalWithoutTakeaway",e,A.x28_gros_,i),t.Field_Field$numeric("@takeawayPrice*IF(@isRefund, -1, 1)",!1,"Takeaway price",E,E,A.x40takea,i),t.Field_Field$numeric("@nettTotal*IF(@isRefund, -1, 1)",!1,"Nett",C,C,A.x40nett_,i),t.Field_Field$string(e,!1,"Parent ID","parentId","parent.id",e,i),t.Field_Field$string(e,!1,"Parent name","parentName","parent.name",e,i),t.Field_Field$string(e,!1,"Addon type","addonType","addon.type",e,i),t.Field_Field$string(e,!1,"Addon ID","addonId","addon.selectionId",e,i),t.Field_Field$string("SPLIT(@addonId, '/')[OFFSET(0)]",!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",i),t.Field_Field$numeric(e,!1,"Layer","layer","layer",e,i),t.Field_Field$numeric("@addonPrice*IF(@isRefund, -1, 1)",!1,"Addon price","addonPrice","addon.price",A.x40addon,i),t.Field_Field$numeric("@taxTotal*IF(@isRefund, -1, 1)",!1,"Tax","taxTotal","tax.total","@tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric(A.x28IFNULb,!1,"Discount","discountTotal",e,A.x28COALEb,i),t.Field_Field$numeric(A.x28IFNULgx2bb,!1,"Gross before charges","grossBeforeCharges",e,A.x28COALEgx2bb,i),t.Field_Field$string("CONCAT(@quantity,'x ',ARRAY_TO_STRING([IF(@code='', NULL, @code), @name], ' '))",!1,"Summary","summary",e,"CONCAT(@quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN @code='' THEN NULL ELSE @code END, @name], ' '))",i),t.Field_Field$numeric("@layerNettTotal*IF(@isRefund, -1, 1)",!1,"Layer nett",I,I,"@layer_nett_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerBillAdjustmentTotal*IF(@isRefund, -1, 1)",!1,"Layer bill discount",b,b,"@layer_bill_adjustment_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerItemAdjustmentTotal*IF(@isRefund, -1, 1)",!1,"Layer item discount",F,F,"@layer_item_adjustment_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerGrossTotal*IF(@isRefund, -1, 1)",!1,"Layer gross total",M,M,"@layer_gross_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerTakeawayPrice*IF(@isRefund, -1, 1)",!1,"Layer takeaway price",x,x,"@layer_takeaway_price*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerTaxTotal*IF(@isRefund, -1, 1)",!1,"Layer tax total",R,R,"@layer_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerScTotal*IF(@isRefund, -1, 1)",!1,"Layer sc",O,O,"@layer_sc_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerOtherChargeTotal*IF(@isRefund, -1, 1)",!1,"Layer other charge",L,L,"@layer_other_charge_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("(IFNULL(@layerGrossTotal,0)+IFNULL(@layerBillAdjustmentTotal,0)+IFNULL(@layerItemAdjustmentTotal,0))*IF(@isRefund, -1, 1)",!1,"Layer gross before charges","layerGrossBeforeCharges",e,"(COALESCE(@layer_gross_total,0)+COALESCE(@layer_bill_adjustment_total,0)+COALESCE(@layer_item_adjustment_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$string(e,!1,"Custom attributes",v,v,e,i),t.Field_Field$string(e,!1,"Layer 0 parent ID",X,X,e,i),t.Field_Field$string(e,!1,"Charge variant","chargeVariant",e,"(select variant from charges where charges.parent_id=@layer_zero_parent_id and charges.restaurant_id=@restaurant_id and charges.bill_id=@bill_id and charges.code != 'SERVICE_CHARGE')",i),t.Field_Field$timestamp(e,!1,"Collected time",c0,c0,e,i),t.Field_Field$numeric(e,!1,"Costing","costing","costing",e,i),t.Field_Field$numeric("ROUND(TIMESTAMP_DIFF(IFNULL(@servedAt, CURRENT_TIMESTAMP), @sentAt, SECOND),0)",!1,"Preparation seconds","preparationSeconds",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@served_at, CURRENT_TIMESTAMP),@sent_at)),0)",i),t.Field_Field$numeric("(@nettTotal-coalesce(@costing, 0))",!1,"Profit","profit",e,"(@nett_total-coalesce(@costing, 0))",i),t.Field_Field$string(e,!1,"Layer 0 parent name","layerZeroParentName",e,"(select name from flatten_items where flatten_items.id=@layer_zero_parent_id and flatten_items.restaurant_id=@restaurant_id and flatten_items.bill_id=@bill_id)",i),t.Field_Field$string(e,!1,"Layer 0 parent code","layerZeroParentCode",e,"(select code from flatten_items where flatten_items.id=@layer_zero_parent_id and flatten_items.restaurant_id=@restaurant_id and flatten_items.bill_id=@bill_id)",i),t.Field_Field$string(e,!1,"Layer 0 parent category","layerZeroParentCategory",e,"(select category_name from flatten_items where flatten_items.id=@layer_zero_parent_id and flatten_items.restaurant_id=@restaurant_id and flatten_items.bill_id=@bill_id)",i),t.Field_Field$string(e,!1,"Sub categories",p0,p0,e,i),t.Field_Field$numeric("@billAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,"Bill discount inc tax",$0,$0,"@bill_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@itemAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,"Item discount inc tax",f0,f0,"@item_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerBillAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,"Layer bill discount inc tax",y0,y0,"@layer_bill_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric("@layerItemAdjustmentInclusiveTaxTotal*IF(@isRefund, -1, 1)",!1,"Layer item discount inc tax",g0,g0,"@layer_item_adjustment_inclusive_tax_total*CASE WHEN @is_refund THEN -1 ELSE 1 END",i)],f.JSArray_Field)},$signature:0},t.flattenItemSchema_closure0.prototype={call$1(i){var e="id",r=null,n="restaurantId",u="parentId",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["billId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_20,t._setArrayType([new t.JoinCondition("itemId",t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("billId",t._setArrayType(["billId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_7,t._setArrayType([new t.JoinCondition(u,t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_6,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["parentId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!0,i,r),new t.Join(_.SCHEMA_NAME_52,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["groupId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_22,t._setArrayType([new t.JoinCondition("ref",t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("locationId",t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r)],f.JSArray_Join)},$signature:1},t.internalPurchaseOrderSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="seqNumber",u="generatedAt",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Ref","ref","ref",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",n,n,e,i),t.Field_Field$string(e,!1,"Supplier ID","supplierId","supplier.id",e,i),t.Field_Field$string(e,!1,"Type","supplierInternal","supplier.internal",e,i),t.Field_Field$string(e,!1,"Supplier","supplierName","supplier.name",e,i),t.Field_Field$string(e,!1,"Supplier contact name","supplierContactName","supplier.contactName",e,i),t.Field_Field$string(e,!1,"Supplier phone number","supplierPhoneNumber","supplier.phoneNumber",e,i),t.Field_Field$string(e,!1,"Supplier reg no.","supplierRegistrationNumber","supplier.registrationNumber",e,i),t.Field_Field$string(e,!1,"Supplier email","supplierEmail","supplier.email",e,i),t.Field_Field$string(e,!1,"Supplier address line 1","supplierAddressLine1","supplier.address.line1",e,i),t.Field_Field$string(e,!1,"Supplier address line 2","supplierAddressLine2","supplier.address.line2",e,i),t.Field_Field$string(e,!1,"Supplier address state","supplierAddressState","supplier.address.state",e,i),t.Field_Field$string(e,!1,"Supplier address city","supplierAddressCity","supplier.address.city",e,i),t.Field_Field$string(e,!1,"Supplier address postcode","supplierAddressPostcode","supplier.address.postcode",e,i),t.Field_Field$string(e,!1,"Supplier address country","supplierAddressCountry","supplier.address.country",e,i),t.Field_Field$timestamp(e,!0,"Generated time",u,u,e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"NetSuite ID","netSuiteId","netSuite.id",e,i),t.Field_Field$string(e,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,i),t.Field_Field$string(e,!1,"NetSuite Transaction Number","netSuiteTransactionNumber",A.netSui,e,i),t.Field_Field$string(e,!1,"Supplier Code","supplierCode",e,A.x28selecc,i)],f.JSArray_Field)},$signature:0},t.internalPurchaseOrderSchema_closure0.prototype={call$1(i){var e="purchaseOrderId",r=null,n="locationId",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_28,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!0,i,r),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r)],f.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryFulfillmentSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="adjustment",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Adjustment",u,u,e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"NetSuite ID","netSuiteId","netSuite.id",e,i),t.Field_Field$string(e,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,i)],f.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryFulfillmentSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="purchaseOrderDeliveryFulfillmentId",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Purchase delivery fulfillment ID",u,u,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","sku._id",e,i),t.Field_Field$string(e,!1,"Code","skuCode","sku.code",e,i),t.Field_Field$string(e,!1,"Name","skuName","sku.name",e,i),t.Field_Field$string(e,!1,"Unit ID","skuUnitId","sku.unit._id",e,i),t.Field_Field$string(e,!1,"Unit name","skuUnitName","sku.unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,i),t.Field_Field$numeric(e,!1,"Qty","quantity","amount",e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"Custom attributes","customAttributes","sku.customAttributes",e,i)],f.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure0.prototype={call$1(i){var e=null,r="locationId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryFulfillmentId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryOrderSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="adjustment",o="deliveryOrderNumber",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"User ID","createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"User","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Adjustment",u,u,e,i),t.Field_Field$string(e,!1,"No.",o,o,e,i),t.Field_Field$timestamp(e,!1,"Effective time",s,s,e,i),t.Field_Field$string(e,!1,"NetSuite ID","netSuiteId","netSuite.id",e,i),t.Field_Field$string(e,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,i)],f.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryOrderSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.internalPurchaseOrderDeliveryOrderSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="purchaseOrderDeliveryOrderId",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Purchase delivery order ID",u,u,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","sku._id",e,i),t.Field_Field$string(e,!1,"Code","skuCode","sku.code",e,i),t.Field_Field$string(e,!1,"Name","skuName","sku.name",e,i),t.Field_Field$string(e,!1,"Unit ID","skuUnitId","sku.unit._id",e,i),t.Field_Field$string(e,!1,"Unit name","skuUnitName","sku.unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,i),t.Field_Field$numeric(e,!1,"Qty","quantity","amount",e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"Custom attributes","customAttributes","sku.customAttributes",e,i),t.Field_Field$numeric(e,!1,"Cost","cost","cost",e,i)],f.JSArray_Field)},$signature:0},t.internalPurchaseOrderDeliveryOrderSkuSchema_closure0.prototype={call$1(i){var e=null,r="locationId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.internalPurchaseOrderItemSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="quantity",o="receivedQuantity",s="requestedQuantity",l="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","sku._id",e,i),t.Field_Field$string(e,!1,"SKU code","skuCode","sku.code",e,i),t.Field_Field$string(e,!1,"SKU name","skuName","sku.name",e,i),t.Field_Field$string(e,!1,"SKU unit ID","skuUnitId","sku.unit._id",e,i),t.Field_Field$string(e,!1,"SKU unit name","skuUnitName","sku.unit.name",e,i),t.Field_Field$string(e,!1,"SKU unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,i),t.Field_Field$numeric(e,!0,"Qty",u,u,e,i),t.Field_Field$numeric(e,!1,"Received qty",o,o,e,i),t.Field_Field$numeric(e,!1,"Requested qty",s,s,e,i),t.Field_Field$numeric(e,!1,"Cost","cost","totalCost",e,i),t.Field_Field$timestamp(e,!1,"Effective time",l,l,e,i),t.Field_Field$string(e,!1,"Custom attributes","customAttributes","sku.customAttributes",e,i)],f.JSArray_Field)},$signature:0},t.internalPurchaseOrderItemSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.inventoryAdjustmentSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="generatedAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Ref","ref","ref",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$timestamp(e,!1,"Generated time",n,n,e,i),t.Field_Field$string(e,!1,"Reason","reason","reason",e,i)],f.JSArray_Field)},$signature:0},t.inventoryAdjustmentSchema_closure0.prototype={call$1(i){var e="locationId",r=null,n="inventoryAdjustmentId",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("restaurantId",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType(["ref"],u),_.COMPARISON_OPERATOR_0,r)],o),!0,i,r),new t.Join(_.SCHEMA_NAME_22,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_23,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_25,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("closingAdjustmentId",t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r)],f.JSArray_Join)},$signature:1},t.inventoryAdjustmentPhysicalSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="inventoryAdjustmentId",u="inventoryAdjustmentSkuId",o="unitName",s="unitAbbrev",l="trackingAmount",D="trackingUnitName",d="trackingUnitAbbrev",c="conversion";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Inventory Adjustment ID",n,n,e,i),t.Field_Field$string(e,!1,"Inventory Adjustment SKU ID",u,u,e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i),t.Field_Field$string(e,!1,"Unit",o,o,e,i),t.Field_Field$string(e,!1,"Unit abbrev.",s,s,e,i),t.Field_Field$string(e,!1,"Qty x Unit","qtyXUnit",e,"concat(@tracking_amount,'x ',@tracking_unit_name)",i),t.Field_Field$numeric(e,!1,"Tracking amount",l,l,e,i),t.Field_Field$string(e,!1,"Tracking unit",D,D,e,i),t.Field_Field$string(e,!1,"Tracking unit abbrev.",d,d,e,i),t.Field_Field$numeric(e,!1,"Conversion",c,c,e,i)],f.JSArray_Field)},$signature:0},t.inventoryAdjustmentPhysicalSkuSchema_closure0.prototype={call$1(i){var e="locationId",r=null,n="inventoryAdjustmentId",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_21,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType([n],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_22,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType([n],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType(["inventoryAdjustmentSkuId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r)],f.JSArray_Join)},$signature:1},t.inventoryAdjustmentSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="inventoryAdjustmentId",u="fromBalance",o="toBalance",s="unitPrecision",l="unitName",D="unitAbbrev",d="amountCost",c="fromBalanceCost",p="toBalanceCost",y="trackingAmount",g="trackingUnitName",m="trackingUnitAbbrev",h="conversion",E="customAttributes",C="defaultCostPerUnit";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Inventory Adjustment ID",n,n,e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i),t.Field_Field$numeric("IF(@amount>=0, @amount, 0)",!1,"In","in",e,A.CASE_Wax3e,i),t.Field_Field$numeric("IF(@amount<0, @amount, 0)",!1,"Out","out",e,A.CASE_Wax3c,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$numeric(e,!1,"From balance",u,u,e,i),t.Field_Field$numeric(e,!1,"To balance",o,o,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Unit ID","unitId","unitId",e,i),t.Field_Field$string(e,!1,"Unit Precision",s,s,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","skuId",e,i),t.Field_Field$string(e,!1,"Unit",l,l,e,i),t.Field_Field$string(e,!1,"Unit abbrev.",D,D,e,i),t.Field_Field$numeric(e,!1,"Amount cost",d,d,"case when @amount<0 then -@amount_cost else @amount_cost end",i),t.Field_Field$numeric(e,!1,"From balance cost",c,c,e,i),t.Field_Field$numeric(e,!1,"To balance cost",p,p,e,i),t.Field_Field$string(e,!1,"Name (unit)","nameUnit",e,"concat(@name,' (',@unit_abbrev,')')",i),t.Field_Field$numeric(e,!1,"Daily consumption","dailyConsumption",e,"(sum(@amount) filter (where type in ('SALES','DAMAGE')) over (partition by @name)/(EXTRACT(DAY FROM (!end - !start))+1))",i),t.Field_Field$numeric(e,!1,"Days outstanding","daysOutstanding",e,"-(last_value(@to_balance) over (partition by @name order by @created_at asc ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)/(sum(@amount) filter (where type in ('SALES','DAMAGE')) over (partition by @name)/(EXTRACT(DAY FROM (!end - !start))+1)))",i),t.Field_Field$numeric(e,!1,"Tracking amount",y,y,e,i),t.Field_Field$string(e,!1,"Tracking unit",g,g,e,i),t.Field_Field$string(e,!1,"Tracking unit abbrev.",m,m,e,i),t.Field_Field$numeric(e,!1,"Conversion",h,h,e,i),t.Field_Field$string(e,!1,"Custom attributes",E,E,e,i),t.Field_Field$string(e,!1,"Ref","ref","ref",e,i),t.Field_Field$numeric(e,!1,"Default unit cost",C,C,e,i),t.Field_Field$bool(e,!1,"From closing template","fromClosingTemplate",e,"((select 1 from closing_draft_skus where closing_adjustment_id = @inventory_adjustment_id and sku_id = @sku_id limit 1) is not null)",i)],f.JSArray_Field)},$signature:0},t.inventoryAdjustmentSkuSchema_closure0.prototype={call$1(i){var e="locationId",r=null,n="inventoryAdjustmentId",u="snapshottedAt",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_21,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType([n],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_23,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType([n],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("inventoryAdjustmentSkuId",t._setArrayType(["id"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_25,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("closingAdjustmentId",t._setArrayType([n],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("skuId",t._setArrayType(["skuId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(u,t._setArrayType(["createdAt"],o),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],s),!1,i,new t.JoinLateral(t._setArrayType(["mechanism"],o),t._setArrayType([new t.JoinLateralSort(u,_.SORT_TYPE_1)],f.JSArray_JoinLateralSort)))],f.JSArray_Join)},$signature:1},t.inventoryV1FlattenInventorySchema_closure.prototype={call$1(i){var e=null,r="locationId",n="customAttributes";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Link ID","linkId","linkId",e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i),t.Field_Field$numeric(e,!1,"Cost","cost","cost",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Unit ID","unitId","unit._id",e,i),t.Field_Field$string(e,!1,"Unit name","unitName","unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev","unitAbbrev","unit.abbrev",e,i),t.Field_Field$string(e,!1,"Custom attributes",n,n,e,i)],f.JSArray_Field)},$signature:0},t.inventoryV1FlattenInventorySchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.itemSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id",e,e,i),t.Field_Field$string(e,!0,e,"docId",e,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId",e,e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt",e,e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt",e,e,i),t.Field_Field$timestamp(e,!1,"Item time","itemCreatedAt",e,e,i),t.Field_Field$timestamp(e,!1,"Bill close time","billCompletedAt",e,e,i),t.Field_Field$string(e,!1,"Bill ID","billId",e,e,i),t.Field_Field$string(e,!1,"Status","status",e,e,i),t.Field_Field$string(e,!1,"Name","name",e,e,i),t.Field_Field$numeric(e,!1,"Per unit","perXUnit",e,e,i),t.Field_Field$string(e,!1,"Unit","unit",e,e,i),t.Field_Field$string(A.IF__ca,!1,"Category","categoryName",e,A.CASE_Wc,i),t.Field_Field$string(e,!1,"Takeaway ID","takeawayId",e,e,i),t.Field_Field$string(e,!1,"Takeaway name","takeawayName",e,e,i),t.Field_Field$string(e,!1,"Code","code",e,e,i),t.Field_Field$string(e,!1,"Remark","remark",e,e,i),t.Field_Field$string(e,!1,"Product ID","productId",e,e,i),t.Field_Field$string(e,!1,"Variant ID","variantId",e,e,i),t.Field_Field$string(e,!1,"Variant","variantName",e,e,i),t.Field_Field$bool(e,!1,"Refund","isRefund",e,e,i),t.Field_Field$string(e,!1,"User id","createdById",e,e,i),t.Field_Field$string(e,!1,"User","createdByName",e,e,i),t.Field_Field$timestamp(e,!1,"Sent time","sentAt",e,e,i),t.Field_Field$timestamp(e,!1,"Served time","servedAt",e,e,i),t.Field_Field$timestamp(e,!1,"Printed time","printedAt",e,e,i),t.Field_Field$timestamp(e,!1,"Void time","voidAt",e,e,i),t.Field_Field$string(e,!1,"Void reason","voidReason",e,e,i),t.Field_Field$string(e,!0,e,"voidedById",e,e,i),t.Field_Field$string(e,!1,"Void user","voidedByName",e,e,i),t.Field_Field$string(e,!0,e,"voidApprovedById",e,e,i),t.Field_Field$string(e,!1,"Void approver","voidApprovedByName",e,e,i),t.Field_Field$bool(e,!1,"SST before discount","sstBeforeDiscount",e,e,i),t.Field_Field$bool(e,!1,"SC before discount","serviceChargeBeforeDiscount",e,e,i),t.Field_Field$bool(e,!1,"Takeaway","isTakeaway",e,e,i),t.Field_Field$numeric("@quantity*IF(@isRefund, -1, 1)",!1,"Qty","quantity",e,A.x40quant,i),t.Field_Field$numeric("@unitQuantity*IF(@isRefund, -1, 1)",!1,"Unit qty","unitQuantity",e,A.x40unit_,i),t.Field_Field$numeric("@sstTotal*IF(@isRefund, -1, 1)",!1,"SST","sstTotal",e,A.x40sst_t,i),t.Field_Field$numeric(e,!0,"SST %","sstPercentage",e,e,i),t.Field_Field$numeric(e,!0,"SC %","serviceChargePercentage",e,e,i),t.Field_Field$numeric("@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,"SC","serviceChargeTotal",e,A.x40servi,i),t.Field_Field$numeric("@otherChargeTotal*IF(@isRefund, -1, 1)",!1,"Other charge","otherChargeTotal",e,A.x40other,i),t.Field_Field$numeric(A.x40billA,!1,"Bill discount","billAdjustmentTotal",e,A.x40bill_,i),t.Field_Field$numeric(A.x40itemA,!1,"Item discount","itemAdjustmentTotal",e,A.x40item_,i),t.Field_Field$numeric("@grossTotal*IF(@isRefund, -1, 1)",!1,"Gross","grossTotal",e,A.x40gross,i),t.Field_Field$numeric(A.x28_grosT,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28_gros_,i),t.Field_Field$numeric("@takeawayPrice*IF(@isRefund, -1, 1)",!1,"Takeaway price","takeawayPrice",e,A.x40takea,i),t.Field_Field$numeric("@nettTotal*IF(@isRefund, -1, 1)",!1,"Nett","nettTotal",e,A.x40nett_,i),t.Field_Field$numeric(A.x28IFNULb,!1,"Discount","discountTotal",e,A.x28COALEb,i),t.Field_Field$numeric(A.x28IFNULgx2bb,!1,"Gross before charges","grossBeforeCharges",e,A.x28COALEgx2bb,i),t.Field_Field$numeric("TIMESTAMP_DIFF(TIMESTAMP(@servedAt), TIMESTAMP(@sentAt), SECOND)",!1,"Preparation seconds","preparationSeconds",e,"EXTRACT(EPOCH FROM AGE(@served_at,@sent_at))",i),t.Field_Field$string("CONCAT(@quantity,'x ',ARRAY_TO_STRING([IF(code='', NULL, code), name], ' '))",!1,"Summary","summary",e,"CONCAT(@quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN code='' THEN NULL ELSE code END, name], ' '))",i),t.Field_Field$numeric(e,!1,"Layer","layer",e,e,i)],f.JSArray_Field)},$signature:0},t.itemSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.itemMovementSchema_closure.prototype={call$1(i){var e=null,r="userName",n="moveFromBillId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Move Time","movedAt","movedAt",e,i),t.Field_Field$string(e,!1,"User ID","userId","userId",e,i),t.Field_Field$string(e,!1,"User Name",r,r,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Item ID","itemId","itemId",e,i),t.Field_Field$string(e,!1,"Move From Table","moveFromSlot","slot",e,i),t.Field_Field$string(e,!1,"Move From Bill ID",n,n,e,i),t.Field_Field$string(e,!1,"Move From Bill No.","moveFromBillSeqNumber",e,"(select seq_number from bills where bills.id=@move_from_bill_id)",i)],f.JSArray_Field)},$signature:0},t.itemMovementSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.kitchenStationSchema_closure.prototype={call$1(i){var e=null,r="completedAt",n="productId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!0,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Item ID","itemId","itemId",e,i),t.Field_Field$timestamp(e,!1,"Start time","startedAt","startAt",e,i),t.Field_Field$timestamp(e,!1,"Finish time","finishedAt","finishAt",e,i),t.Field_Field$timestamp(e,!0,"Complete time",r,r,e,i),t.Field_Field$numeric("ROUND(TIMESTAMP_DIFF(IFNULL(@finishedAt, CURRENT_TIMESTAMP), @startedAt, SECOND),0)",!1,"Seconds","seconds",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@finished_at, CURRENT_TIMESTAMP),@started_at)),0)",i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Product ID",n,n,e,i)],f.JSArray_Field)},$signature:0},t.kitchenStationSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.memberSchema_closure.prototype={call$1(i){var e=null,r="experience",n="normalBalance",u="freeBalance";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID","businessId","business",e,i),t.Field_Field$string(e,!1,"User ID","userId","user",e,i),t.Field_Field$string(e,!1,"Level","level","level",e,i),t.Field_Field$string(e,!1,"Experience",r,r,e,i),t.Field_Field$string(e,!1,"Tier","tier","tier",e,i),t.Field_Field$string(e,!1,"Card No.","cardNo","cardNo",e,i),t.Field_Field$numeric(e,!1,"Balance","balance","balance",e,i),t.Field_Field$numeric(e,!1,"Normal Balance",n,n,e,i),t.Field_Field$numeric(e,!1,"Free balance",u,u,e,i),t.Field_Field$numeric(e,!0,"Visit","visit","stat.visitCount",e,i),t.Field_Field$timestamp(e,!1,"Last visit","lastVisit","stat.lastVisit",e,i),t.Field_Field$numeric(e,!0,"Visit frequency","visitFrequency","stat.avgVisitFrequency",e,i),t.Field_Field$numeric(e,!0,"Avg bill size","avgBillSize","stat.avgBillSize",e,i),t.Field_Field$numeric(e,!1,"Version","version","version",e,i),t.Field_Field$numeric(e,!1,"Points","point","point",e,i),t.Field_Field$numeric(e,!1,"Sales","sales",e,A.x28selecsum,i),t.Field_Field$numeric(e,!1,"Tier number","tierNumber",e,"case when @tier is null then null else @tier::numeric end",i),t.Field_Field$string(e,!1,"Name","name",e,"(select name from users where users.id=@user_id)",i),t.Field_Field$string(e,!1,"Location ID","locationId","location",e,i),t.Field_Field$string(e,!1,"Phone number","phoneNumber",e,"(select phone_number from users where users.id=@user_id)",i)],f.JSArray_Field)},$signature:0},t.memberSchema_closure0.prototype={call$1(i){var e="businessId",r=null,n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_49,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_48,t._setArrayType([new t.JoinCondition("memberId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("userId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_64,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("rank",t._setArrayType(["tierNumber"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r)],f.JSArray_Join)},$signature:1},t.memberStorePurchaseSchema_closure.prototype={call$1(i){var e=null,r="isRefund",n="refundedReason",u="refundedFrom",o="refundedAt",s="status",l="grossTotal",D="taxTotal",d="nettTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Bundle name","bundleName","bundle.name",e,i),t.Field_Field$string(e,!1,"Bundle ID","bundleId","bundle.id",e,i),t.Field_Field$string(e,!1,"Create user ID","createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"Create user name","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!1,"Refund user ID","refundedById","refundedBy.id",e,i),t.Field_Field$string(e,!1,"Refund user name","refundedName","refunded.name",e,i),t.Field_Field$bool(e,!1,"Refund",r,r,e,i),t.Field_Field$bool(e,!1,"Refund reason",n,n,e,i),t.Field_Field$string(e,!1,"Refund ID",u,u,e,i),t.Field_Field$timestamp(e,!1,"Refund time",o,o,e,i),t.Field_Field$string(e,!1,"Member ID","memberId","member.id",e,i),t.Field_Field$string(e,!1,"User ID","memberUserId","member.userId",e,i),t.Field_Field$string(e,!1,"Member name","memberName","member.name",e,i),t.Field_Field$string(e,!1,s,s,s,e,i),t.Field_Field$numeric(A.IFNULLg,!1,"Gross",l,l,A.COALESg,i),t.Field_Field$numeric("IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,"Tax",D,D,A.COALEStax,i),t.Field_Field$numeric(A.IFNULLn,!1,"Nett",d,d,A.COALESn,i),t.Field_Field$string(e,!1,"Transaction ID","transactionId","transaction.id",e,i),t.Field_Field$numeric(e,!1,"Normal credit","normalCredit","bundle.credit.normal",e,i),t.Field_Field$numeric(e,!1,"Free credit","freeCredit","bundle.credit.free.amount",e,i),t.Field_Field$string(e,!1,"Tax code","taxCode","taxCode",e,i)],f.JSArray_Field)},$signature:0},t.memberStorePurchaseSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_47,t._setArrayType([new t.JoinCondition("memberStorePurchaseId",t._setArrayType(["id"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberUserId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.memberStorePurchasePaymentSchema_closure.prototype={call$1(i){var e=null,r="memberStorePurchaseId",n="isRefund",u="reference";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Purchase ID",r,r,e,i),t.Field_Field$bool(e,!1,"Refund",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","payment.name",e,i),t.Field_Field$string(e,!1,"Counter ID","counterId","counter.id",e,i),t.Field_Field$string(e,!1,"Counter","counterName","counter.name",e,i),t.Field_Field$string(e,!1,"Reference",u,u,e,i),t.Field_Field$numeric(e,!1,"Total","total","receivedAmount",e,i),t.Field_Field$numeric(e,!1,"Paid","paid","paid",e,i),t.Field_Field$numeric(e,!1,"Change","change","change",e,i)],f.JSArray_Field)},$signature:0},t.memberStorePurchasePaymentSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_46,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberStorePurchaseId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.memberTitleSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="memberId",u="acquiredAt",o="expiredAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Member ID",n,n,e,i),t.Field_Field$timestamp(e,!1,"Acquired time",u,u,e,i),t.Field_Field$timestamp(e,!1,"Expired time",o,o,e,i)],f.JSArray_Field)},$signature:0},t.memberTitleSchema_closure0.prototype={call$1(i){var e=f.JSArray_String;return t._setArrayType([new t.Join(_.SCHEMA_NAME_50,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],e),_.COMPARISON_OPERATOR_0,null),new t.JoinCondition("id",t._setArrayType(["id"],e),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.memberV2Schema_closure.prototype={call$1(i){var e=null,r="experience";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","joinAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID","businessId","business",e,i),t.Field_Field$string(e,!1,"User ID","userId","externalMemberId",e,i),t.Field_Field$string(e,!1,"Level","level","level",e,i),t.Field_Field$string(e,!1,"Experience",r,r,e,i),t.Field_Field$string(e,!1,"Tier","tier","tier.balance",e,i),t.Field_Field$string(e,!1,"Card No.","cardNo","cardNo",e,i),t.Field_Field$numeric(e,!1,"Balance","balance","credit.balance",e,i),t.Field_Field$numeric(e,!1,"Normal Balance","normalBalance","credit.normalBalance",e,i),t.Field_Field$numeric(e,!1,"Free balance","freeBalance","credit.freeBalance",e,i),t.Field_Field$numeric(e,!0,"Visit","visit","stats.visitCount",e,i),t.Field_Field$timestamp(e,!1,"Last visit","lastVisit","stats.lastVisit",e,i),t.Field_Field$numeric(e,!0,"Visit frequency","visitFrequency","stats.avgVisitFrequency",e,i),t.Field_Field$numeric(e,!0,"Avg bill size","avgBillSize","stats.avgBillSize",e,i),t.Field_Field$numeric(e,!1,"Version","version","version",e,i),t.Field_Field$numeric(e,!1,"Points","point","point.balance",e,i),t.Field_Field$numeric(e,!1,"Sales","sales",e,A.x28selecsum,i),t.Field_Field$string(e,!1,"Location ID","locationId","location",e,i)],f.JSArray_Field)},$signature:0},t.memberV2Schema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.membershipSchema_closure.prototype={call$1(i){var e=null,r="businessId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i)],f.JSArray_Field)},$signature:0},t.membershipSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.membershipTitleSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="internal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$bool(e,!1,"Is internal",n,n,e,i)],f.JSArray_Field)},$signature:0},t.membershipTitleSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.menuV3GroupSchema_closure.prototype={call$1(i){var e=null,r="locationId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i)],f.JSArray_Field)},$signature:0},t.menuV3GroupSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.menuV3ItemSchema_closure.prototype={call$1(i){var e=null,r="productId",n="locationId",u="category",o="customAttributes",s="thumbnail",l="orderFrom",D="additionalCategories";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Product ID",r,r,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Variant","variant","variant",e,i),t.Field_Field$string(e,!1,"Category",u,u,e,i),t.Field_Field$string(e,!1,"Custom attributes",o,o,e,i),t.Field_Field$numeric(e,!1,"Costing","costing","costing",e,i),t.Field_Field$string(e,!1,"Thumbnail",s,s,e,i),t.Field_Field$string(e,!1,"Tax code","taxCode","taxCode",e,i),t.Field_Field$string(e,!1,"Order from",l,l,e,i),t.Field_Field$string(e,!1,"Additional categories",D,D,e,i)],f.JSArray_Field)},$signature:0},t.menuV3ItemSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.menuV3SkuSchema_closure.prototype={call$1(i){var e=null,r="locationId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Unit ID","unitId","unit._id",e,i),t.Field_Field$numeric(e,!1,"Unit Precision","unitPrecision","unit.precision",e,i),t.Field_Field$string(e,!1,"Unit","unitName","unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev.","unitAbbrev","unit.abbrev",e,i)],f.JSArray_Field)},$signature:0},t.menuV3SkuSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.menuV4CatalogItemSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="catalogId",u="catalogName",o="productId",s="orderFrom";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Menu ID","menuId","menuId",e,i),t.Field_Field$string(e,!1,"Catalog ID",n,n,e,i),t.Field_Field$string(e,!1,"Catalog name",u,u,e,i),t.Field_Field$string(e,!1,"Product ID",o,o,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Order from",s,s,e,i)],f.JSArray_Field)},$signature:0},t.menuV4CatalogItemSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.menuV4GroupSchema_closure.prototype={call$1(i){var e=null,r="locationId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i)],f.JSArray_Field)},$signature:0},t.menuV4GroupSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.menuV4ItemSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="productId",u="category",o="customAttributes",s="thumbnail",l="orderFrom",D="additionalCategories";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Product ID",n,n,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Variant","variant","variant",e,i),t.Field_Field$string(e,!1,"Category",u,u,e,i),t.Field_Field$string(e,!1,"Custom attributes",o,o,e,i),t.Field_Field$numeric(e,!1,"Costing","costing","costing",e,i),t.Field_Field$string(e,!1,"Thumbnail",s,s,e,i),t.Field_Field$string(e,!1,"Tax code","taxCode","taxCode",e,i),t.Field_Field$string(e,!1,"Order from",l,l,e,i),t.Field_Field$string(e,!1,"Additional categories",D,D,e,i)],f.JSArray_Field)},$signature:0},t.menuV4ItemSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.menuV4ItemInventoryBindingSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="productId",u="inventoryId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Product ID",n,n,e,i),t.Field_Field$string(e,!1,"Inventory ID",u,u,e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i)],f.JSArray_Field)},$signature:0},t.menuV4ItemInventoryBindingSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.menuV4SkuSchema_closure.prototype={call$1(i){var e=null,r="locationId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Unit ID","unitId","unit._id",e,i),t.Field_Field$numeric(e,!1,"Unit Precision","unitPrecision","unit.precision",e,i),t.Field_Field$string(e,!1,"Unit","unitName","unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev.","unitAbbrev","unit.abbrev",e,i)],f.JSArray_Field)},$signature:0},t.menuV4SkuSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.parentFlattenItemSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id",e,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId",e,e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt",e,e,i),t.Field_Field$string(e,!1,"Bill ID","billId",e,e,i),t.Field_Field$string(e,!1,"Status","status",e,e,i),t.Field_Field$string(e,!1,"Name","name",e,e,i),t.Field_Field$string(A.IF__ca,!1,"Category","categoryName",e,A.CASE_Wc,i),t.Field_Field$string(e,!1,"Code","code",e,e,i),t.Field_Field$string(e,!1,"Variant","variantName",e,e,i)],f.JSArray_Field)},$signature:0},t.parentFlattenItemSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.paymentSchema_closure.prototype={call$1(i){var e=null,r="paymentCreatedAt",n="billCompletedAt",u="isRefund",o="reference";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Payment time",r,r,e,i),t.Field_Field$timestamp(e,!1,"Bill close time",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!1,"Name","name","payment.name",e,i),t.Field_Field$string(A.case_wI,!1,"Counter ID","counterId","counter.id",A.case_w_i,i),t.Field_Field$string(A.case_wN,!1,"Counter","counterName","counter.name",A.case_w_n,i),t.Field_Field$string(e,!1,"User","byName","by.name",e,i),t.Field_Field$string(e,!1,"User ID","byId","by.id",e,i),t.Field_Field$string(e,!1,"Reference",o,o,e,i),t.Field_Field$numeric(e,!1,"Total","total","receivedAmount",e,i),t.Field_Field$numeric(e,!1,"Paid","paid","paid",e,i),t.Field_Field$numeric(e,!1,"Change","change","change",e,i),t.Field_Field$numeric("@otherChargeTotal*IF(@isRefund, -1, 1)",!1,"Other charge","otherChargeTotal","OTHER_CHARGE.total",A.x40other,i),t.Field_Field$numeric("@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,"SC","serviceChargeTotal","SERVICE_CHARGE.total",A.x40servi,i),t.Field_Field$numeric("@sstTotal*IF(@isRefund, -1, 1)",!0,"SST","sstTotal","SST.total",A.x40sst_t,i),t.Field_Field$numeric("@vatTotal*IF(@isRefund, -1, 1)",!0,"VAT","vatTotal","VAT.total",A.x40vat_t,i),t.Field_Field$string(e,!1,"Issuer","paymentGatewayIssuer","paymentGateway.method.issuer",e,i),t.Field_Field$string(e,!1,"Variant","paymentGatewayVariant","paymentGateway.method.variant",e,i),t.Field_Field$string(e,!1,"Gateway key","paymentGatewayKey","paymentGateway.key",e,i),t.Field_Field$string(e,!1,"Gateway","gateway","paymentGateway.gateway",e,i),t.Field_Field$string(e,!1,"Card type","cardType","paymentGateway.cardType",e,i),t.Field_Field$string(A.CONCATC,!1,"Summary","summary",e,A.CONCAT_,i),t.Field_Field$string(e,!1,"Card no","cardNo","paymentGateway.cardNo",e,i)],f.JSArray_Field)},$signature:0},t.paymentSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("parentId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_39,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["reference"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.paymentTimePaymentSchema_closure.prototype={call$1(i){var e=null,r="paymentCreatedAt",n="billCompletedAt",u="isRefund",o="reference";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Payment time",r,r,e,i),t.Field_Field$timestamp(e,!1,"Bill close time",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!1,"Name","name","payment.name",e,i),t.Field_Field$string(A.case_wI,!1,"Counter ID","counterId","counter.id",A.case_w_i,i),t.Field_Field$string(A.case_wN,!1,"Counter","counterName","counter.name",A.case_w_n,i),t.Field_Field$string(e,!1,"User","byName","by.name",e,i),t.Field_Field$string(e,!1,"User ID","byId","by.id",e,i),t.Field_Field$string(e,!1,"Reference",o,o,e,i),t.Field_Field$numeric(e,!1,"Total","total","receivedAmount",e,i),t.Field_Field$numeric(e,!1,"Paid","paid","paid",e,i),t.Field_Field$numeric(e,!1,"Change","change","change",e,i),t.Field_Field$numeric("@otherChargeTotal*IF(@isRefund, -1, 1)",!1,"Other charge","otherChargeTotal","OTHER_CHARGE.total",A.x40other,i),t.Field_Field$numeric("@serviceChargeTotal*IF(@isRefund, -1, 1)",!1,"SC","serviceChargeTotal","SERVICE_CHARGE.total",A.x40servi,i),t.Field_Field$numeric("@sstTotal*IF(@isRefund, -1, 1)",!0,"SST","sstTotal","SST.total",A.x40sst_t,i),t.Field_Field$numeric("@vatTotal*IF(@isRefund, -1, 1)",!0,"VAT","vatTotal","VAT.total",A.x40vat_t,i),t.Field_Field$string(e,!1,"Issuer","paymentGatewayIssuer","paymentGateway.method.issuer",e,i),t.Field_Field$string(e,!1,"Variant","paymentGatewayVariant","paymentGateway.method.variant",e,i),t.Field_Field$string(e,!1,"Gateway key","paymentGatewayKey","paymentGateway.key",e,i),t.Field_Field$string(e,!1,"Gateway","gateway","paymentGateway.gateway",e,i),t.Field_Field$string(e,!1,"Card type","cardType","paymentGateway.cardType",e,i),t.Field_Field$string(A.CONCATC,!1,"Summary","summary",e,A.CONCAT_,i),t.Field_Field$string(e,!1,"Card no","cardNo","paymentGateway.cardNo",e,i)],f.JSArray_Field)},$signature:0},t.paymentTimePaymentSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("parentId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_39,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["reference"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.purchaseOrderSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="seqNumber",u="generatedAt",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Ref","ref","ref",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",n,n,e,i),t.Field_Field$string(e,!1,"Supplier ID","supplierId","supplier.id",e,i),t.Field_Field$string(e,!1,"Type","supplierInternal","supplier.internal",e,i),t.Field_Field$string(e,!1,"Supplier","supplierName","supplier.name",e,i),t.Field_Field$string(e,!1,"Supplier contact name","supplierContactName","supplier.contactName",e,i),t.Field_Field$string(e,!1,"Supplier phone number","supplierPhoneNumber","supplier.phoneNumber",e,i),t.Field_Field$string(e,!1,"Supplier reg no.","supplierRegistrationNumber","supplier.registrationNumber",e,i),t.Field_Field$string(e,!1,"Supplier email","supplierEmail","supplier.email",e,i),t.Field_Field$string(e,!1,"Supplier address line 1","supplierAddressLine1","supplier.address.line1",e,i),t.Field_Field$string(e,!1,"Supplier address line 2","supplierAddressLine2","supplier.address.line2",e,i),t.Field_Field$string(e,!1,"Supplier address state","supplierAddressState","supplier.address.state",e,i),t.Field_Field$string(e,!1,"Supplier address city","supplierAddressCity","supplier.address.city",e,i),t.Field_Field$string(e,!1,"Supplier address postcode","supplierAddressPostcode","supplier.address.postcode",e,i),t.Field_Field$string(e,!1,"Supplier address country","supplierAddressCountry","supplier.address.country",e,i),t.Field_Field$timestamp(e,!0,"Generated time",u,u,e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"NetSuite ID","netSuiteId","netSuite.id",e,i),t.Field_Field$string(e,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,i),t.Field_Field$string(e,!1,"NetSuite Transaction Number","netSuiteTransactionNumber",A.netSui,e,i),t.Field_Field$string(e,!1,"Supplier Code","supplierCode",e,A.x28selecc,i),t.Field_Field$string(e,!1,"Transformed status","transformedStatus",e,"(case when (@status in ('RECEIVING','PROCESSING') and (select count(*) from purchase_order_delivery_orders dos where dos.location_id=@location_id and dos.purchase_order_id=@id) > 0) then 'PARTIAL RECEIVED' when @status = 'CLOSE' then 'COMPLETE' else @status end)",i)],f.JSArray_Field)},$signature:0},t.purchaseOrderSchema_closure0.prototype={call$1(i){var e="purchaseOrderId",r=null,n="locationId",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_28,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["id"],u),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(n,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,r)],o),!1,i,r)],f.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryFulfillmentSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="adjustment",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Adjustment",u,u,e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"NetSuite ID","netSuiteId","netSuite.id",e,i),t.Field_Field$string(e,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,i)],f.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryFulfillmentSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("locationId",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryFulfillmentSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="purchaseOrderDeliveryFulfillmentId",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Purchase delivery fulfillment ID",u,u,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","sku._id",e,i),t.Field_Field$string(e,!1,"Code","skuCode","sku.code",e,i),t.Field_Field$string(e,!1,"Name","skuName","sku.name",e,i),t.Field_Field$string(e,!1,"Unit ID","skuUnitId","sku.unit._id",e,i),t.Field_Field$string(e,!1,"Unit name","skuUnitName","sku.unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,i),t.Field_Field$numeric(e,!1,"Qty","quantity","amount",e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"Custom attributes","customAttributes","sku.customAttributes",e,i),t.Field_Field$string(e,!1,"Supplier ID","supplierId",e,A.x28selecsup,i)],f.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryFulfillmentSkuSchema_closure0.prototype={call$1(i){var e=null,r="locationId",n="snapshottedAt",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryFulfillmentId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!0,i,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!1,i,e),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["supplierId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("skuId",t._setArrayType(["skuId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["effectiveAt"],u),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],o),!1,i,new t.JoinLateral(t._setArrayType(["mechanism"],u),t._setArrayType([new t.JoinLateralSort(n,_.SORT_TYPE_1)],f.JSArray_JoinLateralSort)))],f.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryOrderSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="adjustment",o="deliveryOrderNumber",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"User ID","createdById","createdBy.id",e,i),t.Field_Field$string(e,!1,"User","createdByName","createdBy.name",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Adjustment",u,u,e,i),t.Field_Field$string(e,!1,"No.",o,o,e,i),t.Field_Field$timestamp(e,!1,"Effective time",s,s,e,i),t.Field_Field$string(e,!1,"NetSuite ID","netSuiteId","netSuite.id",e,i),t.Field_Field$string(e,!1,"NetSuite Ref No","netSuiteRefNo","netSuite.refNo",e,i)],f.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryOrderSchema_closure0.prototype={call$1(i){var e=null,r="locationId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_31,t._setArrayType([new t.JoinCondition("purchaseOrderDeliveryOrderId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("purchaseOrderId",t._setArrayType(["purchaseOrderId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.purchaseOrderDeliveryOrderSkuSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="purchaseOrderDeliveryOrderId",o="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Purchase delivery order ID",u,u,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","sku._id",e,i),t.Field_Field$string(e,!1,"Code","skuCode","sku.code",e,i),t.Field_Field$string(e,!1,"Name","skuName","sku.name",e,i),t.Field_Field$string(e,!1,"Unit ID","skuUnitId","sku.unit._id",e,i),t.Field_Field$string(e,!1,"Unit name","skuUnitName","sku.unit.name",e,i),t.Field_Field$string(e,!1,"Unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,i),t.Field_Field$numeric(e,!1,"Qty","quantity","amount",e,i),t.Field_Field$timestamp(e,!1,"Effective time",o,o,e,i),t.Field_Field$string(e,!1,"Custom attributes","customAttributes","sku.customAttributes",e,i),t.Field_Field$numeric(e,!1,"Cost","cost","cost",e,i),t.Field_Field$string(e,!1,"Supplier ID","supplierId",e,A.x28selecsup,i)],f.JSArray_Field)},$signature:0},t.purchaseOrderDeliveryOrderSkuSchema_closure0.prototype={call$1(i){var e=null,r="locationId",n="snapshottedAt",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_29,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderDeliveryOrderId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!1,i,e),new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!1,i,e),new t.Join(_.SCHEMA_NAME_30,t._setArrayType([new t.JoinCondition("purchaseOrderId",t._setArrayType(["purchaseOrderId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!1,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!1,i,e),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["supplierId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("skuId",t._setArrayType(["skuId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["effectiveAt"],u),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],o),!1,i,new t.JoinLateral(t._setArrayType(["mechanism"],u),t._setArrayType([new t.JoinLateralSort(n,_.SORT_TYPE_1)],f.JSArray_JoinLateralSort)))],f.JSArray_Join)},$signature:1},t.purchaseOrderItemSchema_closure.prototype={call$1(i){var e=null,r="locationId",n="purchaseOrderId",u="quantity",o="receivedQuantity",s="requestedQuantity",l="effectiveAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Purchase order ID",n,n,e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","sku._id",e,i),t.Field_Field$string(e,!1,"SKU code","skuCode","sku.code",e,i),t.Field_Field$string(e,!1,"SKU name","skuName","sku.name",e,i),t.Field_Field$string(e,!1,"SKU unit ID","skuUnitId","sku.unit._id",e,i),t.Field_Field$string(e,!1,"SKU unit name","skuUnitName","sku.unit.name",e,i),t.Field_Field$string(e,!1,"SKU unit abbrev","skuUnitAbbrev","sku.unit.abbrev",e,i),t.Field_Field$numeric(e,!0,"Qty",u,u,e,i),t.Field_Field$numeric(e,!1,"Received qty",o,o,e,i),t.Field_Field$numeric(e,!1,"Requested qty",s,s,e,i),t.Field_Field$numeric(e,!1,"Cost","cost","totalCost",e,i),t.Field_Field$timestamp(e,!1,"Effective time",l,l,e,i),t.Field_Field$string(e,!1,"Custom attributes","customAttributes","sku.customAttributes",e,i),t.Field_Field$string(e,!1,"Supplier ID","supplierId",e,A.x28selecsup,i)],f.JSArray_Field)},$signature:0},t.purchaseOrderItemSchema_closure0.prototype={call$1(i){var e=null,r="locationId",n="snapshottedAt",u=f.JSArray_String,o=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_27,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["purchaseOrderId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!0,i,e),new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],u),_.COMPARISON_OPERATOR_0,e)],o),!1,i,e),new t.Join(_.SCHEMA_NAME_73,t._setArrayType([new t.JoinCondition(r,t._setArrayType(["supplierId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("skuId",t._setArrayType(["skuId"],u),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["effectiveAt"],u),_.COMPARISON_OPERATOR_5,_.DIMENSION_OPTION_0)],o),!1,i,new t.JoinLateral(t._setArrayType(["mechanism"],u),t._setArrayType([new t.JoinLateralSort(n,_.SORT_TYPE_1)],f.JSArray_JoinLateralSort)))],f.JSArray_Join)},$signature:1},t.recommendationCallSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Path","path","path",e,i)],f.JSArray_Field)},$signature:0},t.recommendationCallSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.recordSchema_closure.prototype={call$1(i){var e=null,r="openedAt",n="closedAt",u="openAmount";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Counter ID","counterId","counter.id",e,i),t.Field_Field$string(e,!1,"Counter","counterName","counter.name",e,i),t.Field_Field$string(e,!0,e,"openById","openedBy.id",e,i),t.Field_Field$string(e,!1,"Open user","openByName","openedBy.name",e,i),t.Field_Field$string(e,!0,e,"closedById","closedBy.id",e,i),t.Field_Field$string(e,!1,"Close user","closedByName","closedBy.name",e,i),t.Field_Field$timestamp(e,!1,"Open time",r,r,e,i),t.Field_Field$timestamp(e,!1,"Close time",n,n,e,i),t.Field_Field$numeric(e,!1,"Open amount",u,u,e,i),t.Field_Field$numeric(e,!1,"Close amount","amount","amount",e,i),t.Field_Field$numeric(e,!1,"Cash sale","cashSale",e,"(select sum(payments.total) from payments where payments.restaurant_id=@restaurant_id and payments.payment_created_at between @opened_at and @closed_at and @counter_id=payments.counter_id and payments.name='CASH' and payments.total>=0)",i),t.Field_Field$numeric(e,!1,"Cash refund","cashRefund",e,"(select sum(payments.total) from payments where payments.restaurant_id=@restaurant_id and payments.payment_created_at between @opened_at and @closed_at and @counter_id=payments.counter_id and payments.name='CASH' and payments.total<0)",i),t.Field_Field$numeric(e,!1,"Member store cash sale","memberStoreCashSale",e,"(select sum(member_store_purchase_payments.total) from member_store_purchase_payments where member_store_purchase_payments.restaurant_id=@restaurant_id and member_store_purchase_payments.created_at between @opened_at and @closed_at and @counter_id=member_store_purchase_payments.counter_id and member_store_purchase_payments.name='CASH' and member_store_purchase_payments.total>=0)",i),t.Field_Field$numeric(e,!1,"Member store cash refund","memberStoreCashRefund",e,"(select sum(member_store_purchase_payments.total) from member_store_purchase_payments where member_store_purchase_payments.restaurant_id=@restaurant_id and member_store_purchase_payments.created_at between @opened_at and @closed_at and @counter_id=member_store_purchase_payments.counter_id and member_store_purchase_payments.name='CASH' and member_store_purchase_payments.total<0)",i),t.Field_Field$numeric(e,!1,"Cash in","cashIn",e,"(select sum(drawers.amount) from drawers where drawers.restaurant_id=@restaurant_id and drawers.created_at between @opened_at and @closed_at and @counter_id=drawers.counter_id and drawers.amount>=0)",i),t.Field_Field$numeric(e,!1,"Cash out","cashOut",e,"(select sum(drawers.amount) from drawers where drawers.restaurant_id=@restaurant_id and drawers.created_at between @opened_at and @closed_at and @counter_id=drawers.counter_id and drawers.amount<0)",i)],f.JSArray_Field)},$signature:0},t.recordSchema_closure0.prototype={call$1(i){var e="restaurantId",r=null,n="counterId",u="createdAt",o=f.JSArray_String,s=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["counterId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(u,t._setArrayType(["openedAt","closedAt"],o),_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_0)],s),!1,i,r),new t.Join(_.SCHEMA_NAME_4,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["counterId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(e,t._setArrayType(["restaurantId"],o),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(u,t._setArrayType(["openedAt","closedAt"],o),_.COMPARISON_OPERATOR_6,_.DIMENSION_OPTION_0)],s),!1,i,r)],f.JSArray_Join)},$signature:1},t.refundBillSchema_closure.prototype={call$1(i){var e=null,r="seqNumber",n="deliveryName",u="isRefund",o="isPickup",s="isInHouseDelivery",l="isDelivery",D="Takeaway",d="completedAt",c="integratedOrderId",p="itemCount",y="taxTotal",g="discountTotal",m="grossTotal",h="rounding",E="takeawayPrice",C="thirdPartyExtraCharge",I="deliveryFee",b="nettTotal";return t._setArrayType([t.Field_Field$string("_",!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"No.",r,r,e,i),t.Field_Field$string(e,!1,"Table","slot","slot",e,i),t.Field_Field$string(e,!1,"Delivery",n,n,e,i),t.Field_Field$string(e,!1,"Refund ID","refundFrom","refundedFrom",e,i),t.Field_Field$bool(e,!1,"Refund",u,u,e,i),t.Field_Field$string(e,!0,e,"refundApprovedById","refund.approvedBy.id",e,i),t.Field_Field$string(e,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,i),t.Field_Field$string(e,!0,e,"refundedById","refund.by.id",e,i),t.Field_Field$string(e,!1,"Refund user","refundedByName","refund.by.name",e,i),t.Field_Field$string(e,!1,"Refund reason","refundReason","refund.reason",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","membership.id",e,i),t.Field_Field$string(e,!1,"Member user ID","memberUserId","membership.userId",e,i),t.Field_Field$string(e,!1,"Member name","memberUserName","membership.name",e,i),t.Field_Field$string(e,!0,"Member phone","memberPhoneNumber","membership.phoneNumber",e,i),t.Field_Field$timestamp(e,!1,"Member birthday","memberBirthday","membership.birthday",e,i),t.Field_Field$string(e,!1,"Remark","remark","remark",e,i),t.Field_Field$string(e,!1,"Source","source","source",e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$bool(e,!1,"Pickup",o,o,e,i),t.Field_Field$bool(e,!1,"Is in house delivery",s,s,e,i),t.Field_Field$bool(e,!1,"Is other delivery",l,l,e,i),t.Field_Field$bool(e,!1,D,"isTakeaway","is.takeaway",e,i),t.Field_Field$timestamp(e,!1,"Closed at",d,d,e,i),t.Field_Field$string(e,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,i),t.Field_Field$string(e,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,i),t.Field_Field$string(e,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,i),t.Field_Field$string(e,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,i),t.Field_Field$numeric("IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,"Pax","pax","person",A.COALESp,i),t.Field_Field$string(e,!1,"Integrated order ID",c,c,e,i),t.Field_Field$numeric(A.IFNULLi,!0,"Item count",p,p,A.COALESi,i),t.Field_Field$numeric("IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!0,e,y,y,A.COALEStax,i),t.Field_Field$numeric(A.IFNULLdiT,!1,"Discount",g,g,A.COALESdit,i),t.Field_Field$numeric(A.IFNULLg,!1,"Gross",m,m,A.COALESg,i),t.Field_Field$numeric("IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,"Rounding",h,h,A.COALESr,i),t.Field_Field$numeric("IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!1,"SST","sstTotal","nettTaxes.SST.total",A.COALESss,i),t.Field_Field$string(e,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,i),t.Field_Field$numeric(A.IFNULLs,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",A.COALESse,i),t.Field_Field$string(e,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,i),t.Field_Field$numeric(A.x28IFNULo,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",A.x28COALEo,i),t.Field_Field$numeric(A.x28IFNULgx2d,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,A.x28COALEgx2d,i),t.Field_Field$numeric(A.IFNULLta,!1,D,E,E,A.COALEStak,i),t.Field_Field$numeric(A.IFNULLth,!1,"Extra charge",C,C,A.COALESth,i),t.Field_Field$numeric(A.IFNULLde_,!1,"Delivery fee",I,I,A.COALESdex2c,i),t.Field_Field$numeric(A.IFNULLn,!1,"Nett",b,b,A.COALESn,i),t.Field_Field$numeric("IFNULL(@grossTotal,0)*IF(@isRefund, -1, 1)+IFNULL(@deliveryFee,0)*IF(@isRefund, -1, 1)+IFNULL(@discountTotal,0)*IF(@isRefund, -1, 1)",!1,"Gross before charges","grossBeforeCharges",e,"COALESCE(@gross_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END+COALESCE(@delivery_fee,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END+COALESCE(@discount_total,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",i),t.Field_Field$numeric(e,!1,"Member Recency","recency",e,A.MIN_EX,i),t.Field_Field$numeric(e,!1,"Member frequency","frequency",e,A.COUNT_,i),t.Field_Field$numeric(e,!1,"Member monetary","monetary",e,A.SUM__n,i)],f.JSArray_Field)},$signature:0},t.refundBillSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.restaurantSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="expiredAt",u="customAttributes";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Name","name","profile.name",e,i),t.Field_Field$string(e,!0,"Reg no","regNo","profile.regNo",e,i),t.Field_Field$string(e,!0,"Legal name","legalName","profile.legalName",e,i),t.Field_Field$string(e,!0,"SST reg no","sstRegNo","profile.sstRegNo",e,i),t.Field_Field$string(e,!0,"Email","email","profile.email",e,i),t.Field_Field$string(e,!0,"Phone","phoneNo","profile.phoneNo",e,i),t.Field_Field$string(e,!1,"State","state","profile.address.state",e,i),t.Field_Field$string(e,!1,"City","city","profile.address.city",e,i),t.Field_Field$string(e,!1,"Postcode","postcode","profile.address.postcode",e,i),t.Field_Field$string(e,!1,"Country","country","profile.address.country",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$timestamp(e,!1,"License Expire",n,n,e,i),t.Field_Field$string(e,!1,"Code","code","profile.code",e,i),t.Field_Field$numeric(e,!1,"Longitude","longitude","profile.address.longitude",e,i),t.Field_Field$numeric(e,!1,"Latitude","latitude","profile.address.latitude",e,i),t.Field_Field$string(e,!1,"Custom attributes",u,u,e,i),t.Field_Field$numeric(e,!1,"Table count","tableCount",e,"(select count(distinct name) from slots where slots.restaurant_id=@id)",i)],f.JSArray_Field)},$signature:0},t.restaurantSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.restaurantFeatureSchema_closure.prototype={call$1(i){var e=null,r="restaurantId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID",r,r,e,i),t.Field_Field$string(e,!1,"Feature","name","name",e,i)],f.JSArray_Field)},$signature:0},t.restaurantFeatureSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.restaurantLocationSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="customAttributes";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Name","name","profile.name",e,i),t.Field_Field$string(e,!1,"State","state","profile.address.state",e,i),t.Field_Field$string(e,!1,"Postcode","postcode","profile.address.postcode",e,i),t.Field_Field$string(e,!1,"Country","country","profile.address.country",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Custom attributes",n,n,e,i),t.Field_Field$string(e,!1,"Code","code","profile.code",e,i)],f.JSArray_Field)},$signature:0},t.restaurantLocationSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.reviewSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","restaurant",e,i),t.Field_Field$string(e,!1,"User ID","userId","user",e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"Message","message","reviews",e,i),t.Field_Field$numeric(e,!1,"rating","rating","rating.overall",e,i)],f.JSArray_Field)},$signature:0},t.reviewSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e)],f.JSArray_Join)},$signature:1},t.slotSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!0,"Created at","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Table","name","name",e,i)],f.JSArray_Field)},$signature:0},t.slotSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("slot",t._setArrayType(["name"],r),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!0,i,e)],f.JSArray_Join)},$signature:1},t.staffSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$timestamp(e,!1,"Created at","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i)],f.JSArray_Field)},$signature:0},t.staffSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.stockSchema_closure.prototype={call$1(i){var e=null,r="locationId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"Warehouse ID","warehouseId","_warehouseId",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$string(e,!1,"Type","type","type",e,i),t.Field_Field$numeric(e,!1,"Balance","balance","balance",e,i)],f.JSArray_Field)},$signature:0},t.stockSchema_closure0.prototype={call$1(i){var e="locationId",r=null,n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_56,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(e,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,r)],u),!0,i,r),new t.Join(_.SCHEMA_NAME_54,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition(e,t._setArrayType(["locationId"],n),_.COMPARISON_OPERATOR_0,r)],u),!0,i,r)],f.JSArray_Join)},$signature:1},t.storeBundleSchema_closure.prototype={call$1(i){var e=null,r="bundleId",n="category",u="coinPrice";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID","businessId","business",e,i),t.Field_Field$string(e,!1,"Bundle ID",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","name",e,i),t.Field_Field$string(e,!1,"Category",n,n,e,i),t.Field_Field$numeric(e,!1,"Price","price","price",e,i),t.Field_Field$numeric(e,!1,"Coin price",u,u,e,i)],f.JSArray_Field)},$signature:0},t.storeBundleSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.storeTransactionSchema_closure.prototype={call$1(i){var e=null,r="grossTotal",n="taxTotal",u="nettTotal";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Business ID","businessId","business",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","location",e,i),t.Field_Field$string(e,!1,"Member ID","memberId","member",e,i),t.Field_Field$string(e,!1,"Bundle ID","bundleId","bundle._id",e,i),t.Field_Field$string(e,!1,"Bundle name","bundleName","bundle.name",e,i),t.Field_Field$string(e,!1,"Status","status","status",e,i),t.Field_Field$string(e,!1,"Source","source","source",e,i),t.Field_Field$string(e,!1,"Ref ID","refId","ref",e,i),t.Field_Field$string(e,!1,"Payment ref ID","paymentRefId","paymentRef",e,i),t.Field_Field$string(e,!1,"Payment type","paymentType","payment.type",e,i),t.Field_Field$numeric(e,!1,"Payment amount","paymentAmount","payment.amount",e,i),t.Field_Field$numeric(e,!1,"Voucher count","voucherCount","bundle.voucherCount",e,i),t.Field_Field$numeric(e,!1,"Title count","titleCount","bundle.titleCount",e,i),t.Field_Field$numeric(e,!1,"Free credit","freeCredit","bundle.freeCredit",e,i),t.Field_Field$numeric(e,!1,"Normal credit","normalCredit","bundle.normalCredit",e,i),t.Field_Field$numeric(e,!1,"Cash amount","cashAmount",e,"case when @payment_type='OFFLINE' or @payment_type='ONLINE' then @payment_amount else 0 end",i),t.Field_Field$numeric(e,!1,"Coin amount","coinAmount",e,"case when @payment_type='COIN' then @payment_amount else 0 end",i),t.Field_Field$numeric(e,!1,"Gross",r,r,e,i),t.Field_Field$numeric(e,!1,"Tax",n,n,e,i),t.Field_Field$numeric(e,!1,"Nett",u,u,e,i),t.Field_Field$string(e,!1,"Payment Extra","paymentExtra","payment.extra",e,i),t.Field_Field$string(e,!1,"Tax code","taxCode","taxCode",e,i)],f.JSArray_Field)},$signature:0},t.storeTransactionSchema_closure0.prototype={call$1(i){var e="businessId",r=null,n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_63,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType(["refId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_42,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r),new t.JoinCondition("id",t._setArrayType(["memberId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r)],f.JSArray_Join)},$signature:1},t.subItemSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id",e,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId",e,e,i),t.Field_Field$string(e,!0,e,"docId",e,e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt",e,e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt",e,e,i),t.Field_Field$timestamp("@itemCreatedAt",!1,"Bill time","subItemCreatedAt",e,"@item_created_at",i),t.Field_Field$timestamp(e,!1,"Bill close time","billCompletedAt",e,e,i),t.Field_Field$string(e,!1,"Bill ID","billId",e,e,i),t.Field_Field$string("@parentId",!1,"Item ID","itemId",e,"@parent_id",i),t.Field_Field$bool(e,!1,"Refund","isRefund",e,e,i),t.Field_Field$string("@addonType",!1,"type","type",e,"@addon_type",i),t.Field_Field$string(e,!1,"Name","name",e,e,i),t.Field_Field$string("@addonId",!1,"Selection ID","selectionId",e,"@addon_id",i),t.Field_Field$numeric("@quantity*IF(@isRefund, -1, 1)",!1,"Qty","quantity",e,A.x40quant,i),t.Field_Field$numeric("@addonPrice*IF(@isRefund, -1, 1)",!1,"Nett","price",e,A.x40addon,i),t.Field_Field$numeric(e,!1,"Layer","layer",e,e,i)],f.JSArray_Field)},$signature:0},t.subItemSchema_closure0.prototype={call$1(i){var e=null,r="restaurantId",n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,e),new t.JoinCondition(r,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!0,i,e),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,e)],u),!1,i,e)],f.JSArray_Join)},$signature:1},t.timesheetSchema_closure.prototype={call$1(i){var e=null,r="startedAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!0,e,"createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","_restaurantId",e,i),t.Field_Field$string(e,!1,"User ID","userId","user.id",e,i),t.Field_Field$string(e,!1,"User","userName","user.name",e,i),t.Field_Field$timestamp(e,!1,"Clock in",r,r,e,i),t.Field_Field$timestamp(e,!1,"Clock out","endedAt","endedAt",e,i),t.Field_Field$numeric("TIMESTAMP_DIFF(IFNULL(@endedAt, CURRENT_TIMESTAMP), @startedAt, SECOND)",!1,"Seconds","seconds",e,"EXTRACT(EPOCH FROM AGE(COALESCE(@ended_at, CURRENT_TIMESTAMP),@started_at))",i),t.Field_Field$numeric("ROUND(TIMESTAMP_DIFF(IFNULL(@endedAt, CURRENT_TIMESTAMP), @startedAt, SECOND)/60, 2)",!1,"Minutes","minutes",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@ended_at, CURRENT_TIMESTAMP),@started_at))/60,2)",i),t.Field_Field$numeric("ROUND(TIMESTAMP_DIFF(IFNULL(@endedAt, CURRENT_TIMESTAMP), @startedAt, SECOND)/60/60, 2)",!1,"Hours","hours",e,"ROUND(EXTRACT(EPOCH FROM AGE(COALESCE(@ended_at, CURRENT_TIMESTAMP),@started_at))/60/60,2)",i)],f.JSArray_Field)},$signature:0},t.timesheetSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.timesheetRecordSchema_closure.prototype={call$1(i){var e=null;return t._setArrayType([t.Field_Field$string(e,!1,"ID","id",e,e,i),t.Field_Field$string(e,!0,e,"docId",e,e,i),t.Field_Field$timestamp(e,!0,e,"createdAt",e,e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt",e,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId",e,e,i),t.Field_Field$string(e,!1,"User ID","userId",e,e,i),t.Field_Field$string(e,!1,"User","userName",e,e,i),t.Field_Field$timestamp(e,!1,"Timestamp","timestamp",e,e,i)],f.JSArray_Field)},$signature:0},t.timesheetRecordSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.unitCostHistorySchema_closure.prototype={call$1(i){var e=null,r="locationId",n="locationType",u="mechanism",o="previousCost",s="transactionId",l="transactionLineId",D="documentNumber",d="quantity";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Location ID",r,r,e,i),t.Field_Field$timestamp(e,!1,"Snapshot time","snapshottedAt","snapshotAt",e,i),t.Field_Field$string(e,!1,"Location type",n,n,e,i),t.Field_Field$string(e,!1,"SKU ID","skuId","skuId",e,i),t.Field_Field$string(e,!1,"Mechanism",u,u,e,i),t.Field_Field$numeric(e,!1,"Previous cost",o,o,e,i),t.Field_Field$numeric(e,!1,"Cost","cost","cost",e,i),t.Field_Field$string(e,!1,"Transaction ID",s,s,e,i),t.Field_Field$string(e,!1,"Transaction line ID",l,l,e,i),t.Field_Field$string(e,!1,"Document No",D,D,e,i),t.Field_Field$numeric(e,!1,"Amount","amount","amount",e,i),t.Field_Field$numeric(e,!1,"Quantity",d,d,e,i)],f.JSArray_Field)},$signature:0},t.unitCostHistorySchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.userSchema_closure.prototype={call$1(i){var e=null,r="birthday",n="phoneNumber";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Birthday",r,r,e,i),t.Field_Field$string(e,!1,"Name","name","displayName",e,i),t.Field_Field$string(e,!1,"Gender","gender","gender",e,i),t.Field_Field$string(e,!0,"Phone no.",n,n,e,i),t.Field_Field$string(e,!0,"Email","email","email",e,i),t.Field_Field$numeric(e,!1,"Age","age",e,"case when @birthday is not null then EXTRACT(YEAR FROM age(@birthday)) else null end",i)],f.JSArray_Field)},$signature:0},t.userSchema_closure0.prototype={call$1(i){return t._setArrayType([],f.JSArray_Join)},$signature:1},t.voucherClaimSchema_closure.prototype={call$1(i){var e=null,r="expiredAt",n="redeemedAt",u="appliedAt";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$timestamp(e,!1,"Expired time",r,r,e,i),t.Field_Field$string(e,!1,"Business ID","businessId","voucher.business",e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","restaurant",e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i),t.Field_Field$string(e,!1,"User ID","userId","user",e,i),t.Field_Field$string(e,!1,"Code","code","code",e,i),t.Field_Field$string(e,!1,"Name","name","voucher.name",e,i),t.Field_Field$string(e,!1,"Description","description","voucher.description",e,i),t.Field_Field$string(e,!1,"Source","source","voucher.options.type",e,i),t.Field_Field$bool("IF(@appliedAt IS NULL AND @expiredAt < CURRENT_TIMESTAMP(), true, false)",!1,"Is expired","isExpired",e,"CASE WHEN @applied_at IS NULL AND @expired_at < CURRENT_TIMESTAMP THEN true ELSE false END",i),t.Field_Field$numeric("IF(@appliedAt IS NULL AND @expiredAt < CURRENT_TIMESTAMP(), 1, 0)",!1,"Expired count","expiredCount",e,"CASE WHEN @applied_at IS NULL AND @expired_at < CURRENT_TIMESTAMP THEN 1 ELSE 0 END",i),t.Field_Field$timestamp(e,!1,"Redeemed time",n,n,e,i),t.Field_Field$timestamp(e,!1,"Applied time",u,u,e,i),t.Field_Field$bool("IF(@appliedAt IS NOT NULL, true, false)",!1,"Is applied","isApplied",e,"CASE WHEN @applied_at IS NOT NULL THEN true ELSE false END",i),t.Field_Field$bool("IF(@redeemedAt IS NOT NULL, true, false)",!1,"Is redeemed","isRedeemed",e,"CASE WHEN @redeemed_at IS NOT NULL THEN true ELSE false END",i),t.Field_Field$numeric("IF(@appliedAt IS NOT NULL, 1, 0)",!0,"Applied count","appliedCount",e,"CASE WHEN @applied_at IS NOT NULL THEN 1 ELSE 0 END",i),t.Field_Field$numeric(e,!1,"redeemed count","redeemedCount",e,"(select count(*) from voucher_claim_redemptions where voucher_claim_id=@id)",i)],f.JSArray_Field)},$signature:0},t.voucherClaimSchema_closure0.prototype={call$1(i){var e="id",r=null,n=f.JSArray_String,u=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_41,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["userId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["billId"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r),new t.Join(_.SCHEMA_NAME_40,t._setArrayType([new t.JoinCondition("voucherClaimId",t._setArrayType(["id"],n),_.COMPARISON_OPERATOR_0,r)],u),!1,i,r)],f.JSArray_Join)},$signature:1},t.voucherClaimRedemptionSchema_closure.prototype={call$1(i){var e=null,r="voucherClaimId",n="businessId";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Voucher claim ID",r,r,e,i),t.Field_Field$string(e,!1,"Restaurant ID","restaurantId","restaurant",e,i),t.Field_Field$string(e,!1,"Business ID",n,n,e,i),t.Field_Field$string(e,!1,"Bill ID","billId","billId",e,i)],f.JSArray_Field)},$signature:0},t.voucherClaimRedemptionSchema_closure0.prototype={call$1(i){var e=null,r=f.JSArray_String,n=f.JSArray_JoinCondition;return t._setArrayType([new t.Join(_.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_39,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["voucherClaimId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e),new t.Join(_.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],r),_.COMPARISON_OPERATOR_0,e)],n),!1,i,e)],f.JSArray_Join)},$signature:1},t.warehouseLocationSchema_closure.prototype={call$1(i){var e=null,r="businessId",n="customAttributes";return t._setArrayType([t.Field_Field$string(e,!1,"ID","id","_id",e,i),t.Field_Field$string(e,!0,e,"docId","_docId",e,i),t.Field_Field$timestamp(e,!1,"Time","createdAt","_createdAt",e,i),t.Field_Field$timestamp(e,!0,e,"publishedAt","_publishedAt",e,i),t.Field_Field$string(e,!1,"Name","name","profile.name",e,i),t.Field_Field$string(e,!1,"State","state","profile.address.state",e,i),t.Field_Field$string(e,!1,"Postcode","postcode","profile.address.postcode",e,i),t.Field_Field$string(e,!1,"Country","country","profile.address.country",e,i),t.Field_Field$string(e,!1,"Business ID",r,r,e,i),t.Field_Field$string(e,!1,"Custom attributes",n,n,e,i),t.Field_Field$string(e,!1,"Code","code","profile.code",e,i)],f.JSArray_Field)},$signature:0},t.warehouseLocationSchema_closure0.prototype={call$1(i){return t._setArrayType([new t.Join(_.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],f.JSArray_String),_.COMPARISON_OPERATOR_0,null)],f.JSArray_JoinCondition),!1,i,null)],f.JSArray_Join)},$signature:1},t.QueryEngine.prototype={getSql$1(i){var e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>");return t.List_List$of(new t.MappedListIterable(i,new t.QueryEngine_getSql_closure(this),e),!0,e._eval$1("ListIterable.E"))}},t.QueryEngine_getSql_closure.prototype={call$1(i){return i.getSqlSelect$1(this.$this.context.schemaLibrary)},$signature:92},t.ChartType.prototype={_enumToString$0(){return"ChartType."+this._name}},t.BaseDatasourceConfigModel.prototype={get$drilledDimensions(){return this.dimensions},get$drilledDimensionIds(){var i=this.get$drilledDimensions(),e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>");return t.List_List$of(new t.MappedListIterable(i,new t.BaseDatasourceConfigModel_drilledDimensionIds_closure,e),!0,e._eval$1("ListIterable.E"))},get$metricIds(){var i=this.metrics,e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>");return t.List_List$of(new t.MappedListIterable(i,new t.BaseDatasourceConfigModel_metricIds_closure,e),!0,e._eval$1("ListIterable.E"))},get$drillDimension(){var i,e=this;return e instanceof t.BaseXYDatasourceConfigModel||e instanceof t.CircularDatasourceConfigModel?i=e.get$drillDimension():i=e instanceof t.TableDatasourceConfigModel?e.get$drillDimension():null,i!=null?t.uniqueAlias(i):i},get$startTimeDimensionUnit(){switch(this.periodType){case _.PERIOD_TYPE_0:return _.Units_6;default:return _.Units_4}},toRequests$1(i){var e,r,n,u,o,s,l,D,d=this,c=null,p=d.schemaNames;return p.length===0?t._setArrayType([],f.JSArray_QueryRequest):(e=i.isCompare?c:d.limit,r=_.JSArray_methods.get$first(p),n=d.get$drilledDimensions(),p=_.JSArray_methods.sublist$1(p,1),u=i.timezone,o=i.dateRange,s=t.IterableExtension_get_firstOrNull(o),s.toString,l=d.get$startTimeDimensionUnit(),D=t.IterableExtension_get_firstOrNull(o),D.toString,D=t.DateTimeExtension_startOfUtc(s,l,D,u)._toString$1$iso8601(!0),l=t.ListExtension_elementAtOrNull(o,1),l.toString,s=d.get$startTimeDimensionUnit(),o=t.ListExtension_elementAtOrNull(o,1),o.toString,o=t.DateTimeExtension_endOfUtc(l,s,o,u)._toString$1$iso8601(!0),s=i.timeRange,l=t.IterableExtension_get_firstOrNull(s),l=l==null?c:t.DateTimeExtension_copyWith(l,0,0,0).toUtc$0().toIso8601String$0(),s=t.ListExtension_elementAtOrNull(s,1),s=s==null?c:t.DateTimeExtension_copyWith(s,0,999,59).toUtc$0().toIso8601String$0(),t._setArrayType([t.QueryRequest$(c,i.businessIds,n,d.filters,p,e,d.metrics,i.restaurantIds,c,c,r,d.sorts,new t.QueryRequestTimeDimension(D,o,l,s),u,i.warehouseIds)],f.JSArray_QueryRequest))},toJson$0(){var i,e,r,n=this,u=n.schemaNames,o=t._arrayInstanceType(u)._eval$1("MappedListIterable<1,String>"),s=o._eval$1("ListIterable.E"),l=t.List_List$of(new t.MappedListIterable(u,new t.BaseDatasourceConfigModel_toJson_closure,o),!0,s);return s=t.List_List$of(new t.MappedListIterable(u,new t.BaseDatasourceConfigModel_toJson_closure0,o),!0,s),o=n.dimensions,u=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,Map<String,@>>"),u=t.List_List$of(new t.MappedListIterable(o,new t.BaseDatasourceConfigModel_toJson_closure1,u),!0,u._eval$1("ListIterable.E")),o=n.metrics,i=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,Map<String,@>>"),i=t.List_List$of(new t.MappedListIterable(o,new t.BaseDatasourceConfigModel_toJson_closure2,i),!0,i._eval$1("ListIterable.E")),o=n.filters,e=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,Map<String,@>>"),e=t.List_List$of(new t.MappedListIterable(o,new t.BaseDatasourceConfigModel_toJson_closure3,e),!0,e._eval$1("ListIterable.E")),o=n.sorts,r=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,Map<String,@>>"),r=t.List_List$of(new t.MappedListIterable(o,new t.BaseDatasourceConfigModel_toJson_closure4,r),!0,r._eval$1("ListIterable.E")),o=n.periodType,o=o==null?null:o._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaNames",l,"schemas",s,"dimensions",u,"metrics",i,"filters",e,"sorts",r,"limit",n.limit,"isComparable",n.isComparable,"periodType",o,"timezone",n.timezone],f.String,f.dynamic)},get$dimensions(){return this.dimensions},get$metrics(){return this.metrics}},t.BaseDatasourceConfigModel_drilledDimensionIds_closure.prototype={call$1(i){return i.get$alias()},$signature:5},t.BaseDatasourceConfigModel_metricIds_closure.prototype={call$1(i){return i.get$alias()},$signature:16},t.BaseDatasourceConfigModel_toJson_closure.prototype={call$1(i){return i._name},$signature:13},t.BaseDatasourceConfigModel_toJson_closure0.prototype={call$1(i){return i._name},$signature:13},t.BaseDatasourceConfigModel_toJson_closure1.prototype={call$1(i){return i.toJson$0()},$signature:44},t.BaseDatasourceConfigModel_toJson_closure2.prototype={call$1(i){return i.toJson$0()},$signature:27},t.BaseDatasourceConfigModel_toJson_closure3.prototype={call$1(i){return i.toJson$0()},$signature:20},t.BaseDatasourceConfigModel_toJson_closure4.prototype={call$1(i){return i.toJson$0()},$signature:29},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure.prototype={call$1(i){return t.EnumByName_byName(_.List_W7J,i)},$signature:24},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure0.prototype={call$1(i){return t.QueryRequestDimension_fromJson(f.Map_String_dynamic._as(i))},$signature:17},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure1.prototype={call$1(i){return t.QueryRequestMetric_fromJson(f.Map_String_dynamic._as(i))},$signature:23},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure2.prototype={call$1(i){return t.QueryRequestFilter_fromJson(f.Map_String_dynamic._as(i))},$signature:19},t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure3.prototype={call$1(i){return t.QueryRequestSort_fromJson(f.Map_String_dynamic._as(i))},$signature:25},t.CircularDatasourceConfigModel.prototype={get$drillDimension(){if(this.get$dimensions().length<=1)return null;var i=this._drillDimension;return i!=null?t.uniqueAlias(i):t.uniqueAlias(_.JSArray_methods.get$first(this.get$dimensions()).get$alias())},toJson$0(){var i=this,e=t.LinkedHashMap_LinkedHashMap$of(i.super$BaseDatasourceConfigModel$toJson(),f.String,f.dynamic);return e.$indexSet(0,"showLabel",i.showLabel),e.$indexSet(0,"drillDimension",i.get$drillDimension()),e.$indexSet(0,"timezone",i.timezone),e}},t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig.prototype={},t.DataSourceDrillConfig.prototype={get$_availableIds(){var i=f.String;return _.JSArray_methods.fold$2(this.get$dimensions(),t.LinkedHashMap_LinkedHashMap$_empty(i,i),new t.DataSourceDrillConfig__availableIds_closure)},get$validatedDrillDimension(){var i=this.get$_availableIds().$index(0,this.get$drillDimension());return i??this.get$drillDimension()},get$drilledDimensions(){var i,e,r=this;return r.get$validatedDrillDimension()!=null?(i=r.get$dimensions(),e=t._arrayInstanceType(i)._eval$1("WhereIterable<1>"),t.List_List$of(new t.WhereIterable(i,new t.DataSourceDrillConfig_drilledDimensions_closure(r),e),!0,e._eval$1("Iterable.E"))):r.get$dimensions()}},t.DataSourceDrillConfig__availableIds_closure.prototype={call$2(i,e){return i.$indexSet(0,e.get$idV1(),t.uniqueAlias(e.get$alias())),i},$signature:41},t.DataSourceDrillConfig_drilledDimensions_closure.prototype={call$1(i){return t.uniqueAlias(i.get$alias())===this.$this.get$validatedDrillDimension()},$signature:9},t.ScorecardDatasourceConfigModel.prototype={toRequests$1(i){var e=this.super$BaseDatasourceConfigModel$toRequests(i)[0],r=t._setArrayType([e],f.JSArray_QueryRequest),n=this.sparklineDimension;return n!=null&&!i.isCompare&&(n.toString,r.push(e.copyWith$2$dimensions$sorts(t._setArrayType([n],f.JSArray_QueryRequestDimension),t._setArrayType([new t.QueryRequestSort(_.SORT_TYPE_0,null,n.option,n.dataFormula,n.schemaName,n.name)],f.JSArray_QueryRequestSort)))),r},toJson$0(){var i,e=this,r=t.LinkedHashMap_LinkedHashMap$of(e.super$BaseDatasourceConfigModel$toJson(),f.String,f.dynamic);return r.$indexSet(0,"isCumulative",e.isCumulative),i=e.sparklineDimension,r.$indexSet(0,"sparklineDimension",i==null?null:i.toJson$0()),r.$indexSet(0,"timezone",e.timezone),r}},t.DataSourceRowColumnConfig.prototype={get$_positionFieldIds(){var i=t.List_List$of(this.get$drilledDimensionIds(),!0,f.String);return _.JSArray_methods.addAll$1(i,this.get$metricIds()),this.get$metrics().length!==0&&i.push("_metric_name"),i},get$_table_datasource_config_model$_availableIds(){var i=f.String,e=t.LinkedHashMap_LinkedHashMap$of(_.JSArray_methods.fold$2(this.get$dimensions(),t.LinkedHashMap_LinkedHashMap$_empty(i,i),new t.DataSourceRowColumnConfig__availableIds_closure),i,i);return e.addAll$1(0,_.JSArray_methods.fold$2(this.get$metrics(),t.LinkedHashMap_LinkedHashMap$_empty(i,i),new t.DataSourceRowColumnConfig__availableIds_closure0)),e},get$rowIds(){var i,e=this,r=e.get$_rowIds(),n=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"),u=t.List_List$of(new t.MappedListIterable(r,new t.DataSourceRowColumnConfig_rowIds_closure(e),n),!0,n._eval$1("ListIterable.E"));return n=e.get$_columnIds(),r=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"),i=t.List_List$of(new t.MappedListIterable(n,new t.DataSourceRowColumnConfig_rowIds_closure0(e),r),!0,r._eval$1("ListIterable.E")),r=e.get$drilledDimensionIds(),n=t.List_List$of(new t.WhereIterable(u,new t.DataSourceRowColumnConfig_rowIds_closure1(e),t._arrayInstanceType(u)._eval$1("WhereIterable<1>")),!0,f.String),_.JSArray_methods.addAll$1(n,new t.WhereIterable(r,new t.DataSourceRowColumnConfig_rowIds_closure2(u,i),t._arrayInstanceType(r)._eval$1("WhereIterable<1>"))),n},get$columnIds(){var i,e,r=this,n="_metric_name",u=r.get$_rowIds(),o=t._arrayInstanceType(u)._eval$1("MappedListIterable<1,String>"),s=t.List_List$of(new t.MappedListIterable(u,new t.DataSourceRowColumnConfig_columnIds_closure(r),o),!0,o._eval$1("ListIterable.E"));return o=r.get$_columnIds(),u=t._arrayInstanceType(o)._eval$1("MappedListIterable<1,String>"),i=t.List_List$of(new t.MappedListIterable(o,new t.DataSourceRowColumnConfig_columnIds_closure0(r),u),!0,u._eval$1("ListIterable.E")),e=t._setArrayType([],f.JSArray_String),r.get$metrics().length!==0?(u=t.List_List$of(s,!0,f.String),_.JSArray_methods.addAll$1(u,i),u=!_.JSArray_methods.contains$1(u,n)):u=!1,u&&e.push(n),u=t.List_List$of(new t.WhereIterable(i,new t.DataSourceRowColumnConfig_columnIds_closure1(r),t._arrayInstanceType(i)._eval$1("WhereIterable<1>")),!0,f.String),_.JSArray_methods.addAll$1(u,e),u}},t.DataSourceRowColumnConfig__availableIds_closure.prototype={call$2(i,e){return i.$indexSet(0,e.get$idV1(),e.get$alias()),i},$signature:41},t.DataSourceRowColumnConfig__availableIds_closure0.prototype={call$2(i,e){return i.$indexSet(0,(e.schemaName._name+"_"+e.name+"_"+e.aggregation._name).toLowerCase(),e.get$alias()),i},$signature:94},t.DataSourceRowColumnConfig_rowIds_closure.prototype={call$1(i){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,i);return e??i},$signature:4},t.DataSourceRowColumnConfig_rowIds_closure0.prototype={call$1(i){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,i);return e??i},$signature:4},t.DataSourceRowColumnConfig_rowIds_closure2.prototype={call$1(i){var e=t.List_List$of(this.validatedRowIds,!0,f.String);return _.JSArray_methods.addAll$1(e,this.validatedColumnIds),!_.JSArray_methods.contains$1(e,i)},$signature:21},t.DataSourceRowColumnConfig_rowIds_closure1.prototype={call$1(i){return _.JSArray_methods.contains$1(this.$this.get$_positionFieldIds(),i)},$signature:21},t.DataSourceRowColumnConfig_columnIds_closure.prototype={call$1(i){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,i);return e??i},$signature:4},t.DataSourceRowColumnConfig_columnIds_closure0.prototype={call$1(i){var e=this.$this.get$_table_datasource_config_model$_availableIds().$index(0,i);return e??i},$signature:4},t.DataSourceRowColumnConfig_columnIds_closure1.prototype={call$1(i){return _.JSArray_methods.contains$1(this.$this.get$_positionFieldIds(),i)},$signature:21},t.TableDatasourceConfigModel.prototype={get$drillDimension(){if(!this.isDrillable)return null;var i=this._table_datasource_config_model$_drillDimension;return i!=null?t.uniqueAlias(i):t.uniqueAlias(_.JSArray_methods.get$first(this.get$dimensions()).get$alias())},get$drilledDimensions(){var i=t.List_List$of(t.DataSourceDrillConfig.prototype.get$drilledDimensions.call(this),!0,f.QueryRequestDimension);return _.JSArray_methods.sort$1(i,new t.TableDatasourceConfigModel_drilledDimensions_closure(this)),i},get$joinDatasources(){var i=this._joinDatasources,e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,JoinDatasourceConfig>");return t.List_List$of(new t.MappedListIterable(i,new t.TableDatasourceConfigModel_joinDatasources_closure(this),e),!0,e._eval$1("ListIterable.E"))},toRequests$1(i){var e=this,r=e.super$BaseDatasourceConfigModel$toRequests(i)[0],n=t._setArrayType([r.copyWith$3$dimensions$rollup$rollupPosition(_.JSArray_methods.fold$2(e.get$joinDatasources(),r.dimensions,new t.TableDatasourceConfigModel_toRequests_closure),e.rollup,e.rollupPosition)],f.JSArray_QueryRequest),u=e.get$joinDatasources();return _.JSArray_methods.addAll$1(n,new t.MappedListIterable(u,new t.TableDatasourceConfigModel_toRequests_closure0(e,i),t._arrayInstanceType(u)._eval$1("MappedListIterable<1,QueryRequest>"))),n},toJson$0(){var i,e,r,n=this,u=n.super$BaseDatasourceConfigModel$toJson(),o=n.rollup;return o==null&&n.showGrandTotal&&(o=0),i=t.LinkedHashMap_LinkedHashMap$of(u,f.String,f.dynamic),e=n.get$joinDatasources(),r=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>"),i.$indexSet(0,"joinDatasources",t.List_List$of(new t.MappedListIterable(e,new t.TableDatasourceConfigModel_toJson_closure,r),!0,r._eval$1("ListIterable.E"))),i.$indexSet(0,"columnIds",n.get$columnIds()),i.$indexSet(0,"rowIds",n.get$rowIds()),i.$indexSet(0,"columnsWidth",n.columnsWidth),i.$indexSet(0,"isDrillable",n.isDrillable),i.$indexSet(0,"showGrandTotal",n.showGrandTotal),i.$indexSet(0,"rowsPerPage",n.rowsPerPage),i.$indexSet(0,"drillDimension",n.get$drillDimension()),i.$indexSet(0,"rollup",o),i.$indexSet(0,"rollupPosition",n.rollupPosition),i.$indexSet(0,"timezone",n.timezone),i},get$_rowIds(){return this._rowIds},get$_columnIds(){return this._columnIds}},t.TableDatasourceConfigModel_drilledDimensions_closure.prototype={call$2(i,e){var r,n=this.$this._rowIds,u=_.JSArray_methods.indexOf$1(n,t.uniqueAlias(i.get$alias()));return u<0&&(u=999),r=_.JSArray_methods.indexOf$1(n,t.uniqueAlias(e.get$alias())),u-(r<0?999:r)},$signature:96},t.TableDatasourceConfigModel_joinDatasources_closure.prototype={call$1(i){return i.copyWith$1$mainDimensions(this.$this.get$dimensions())},$signature:97},t.TableDatasourceConfigModel_toRequests_closure.prototype={call$2(i,e){return _.JSArray_methods.fold$2(e.conditions,i,new t.TableDatasourceConfigModel_toRequests__closure0)},$signature:98},t.TableDatasourceConfigModel_toRequests__closure0.prototype={call$2(i,e){var r,n,u={};return u.conditionDimensions=i,r=f.QueryRequestDimension,n=t.List_List$of(i,!0,r),r=t.IterableNullableExtension_whereNotNull(e.mainDimensions,r),_.JSArray_methods.addAll$1(n,new t.WhereIterable(r,new t.TableDatasourceConfigModel_toRequests___closure(u),r.$ti._eval$1("WhereIterable<Iterable.E>"))),u.conditionDimensions=n},$signature:42},t.TableDatasourceConfigModel_toRequests___closure.prototype={call$1(i){return!a.contains$1$asx(this._box_0.conditionDimensions,i)},$signature:9},t.TableDatasourceConfigModel_toRequests_closure0.prototype={call$1(i){var e=this.$this,r=e.isBlend?i.conditions:null,n=i.toRequests$1(this.globalFilter)[0],u=_.JSArray_methods.fold$2(i.conditions,n.dimensions,new t.TableDatasourceConfigModel_toRequests__closure);return n.copyWith$3$blendConditions$dimensions$rollup(r,u,e.rollup!=null&&a.get$isNotEmpty$asx(u)?a.get$length$asx(u)-1:null)},$signature:100},t.TableDatasourceConfigModel_toRequests__closure.prototype={call$2(i,e){var r,n,u,o,s,l,D,d,c,p,y,g=e.joinDimension;return g!=null&&!a.contains$1$asx(i,g)&&(r=t.List_List$of(i,!0,f.QueryRequestDimension),n=g.option,u=g.schemaName,o=g.name,s=g.label,l=g.decimal,D=g.timeFormatter,d=g.formatter,c=g.fillGap,p=g.dataFormula,y=g.displayFormula,g=g.dateComparison,r.push(new t.QueryRequestDimension(n,s,l,D,d,c,p,y,!0,g,u,o)),i=r),i},$signature:42},t.TableDatasourceConfigModel_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:101},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson_closure.prototype={call$1(i){var e={},r=e.joinDatasourceConfig=t.JoinDatasourceConfig_JoinDatasourceConfig$fromJson(i),n=f.JoinDatasourceCondition;return n=t.ListExtensions_mapIndexed(r.conditions,new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson__closure(e,i,this.baseConfig),n,n),e.joinDatasourceConfig=r.copyWith$1$conditions(t.List_List$of(n,!0,n.$ti._eval$1("Iterable.E")))},$signature:102},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson__closure.prototype={call$2(i,e){var r,n,u,o=e.joinDimension;return o==null&&(r=this.json,n=t.IterableExtension_firstWhereOrNull(this._box_0.joinDatasourceConfig.get$dimensions(),new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure(r,i)),r=t.List_List$from(a.$index$asx(a.$index$asx(r.$index(0,"conditions"),i),"mainFields"),f.String),u=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,QueryRequestDimension?>"),u=t.List_List$of(new t.MappedListIterable(r,new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure0(this.baseConfig),u),!0,u._eval$1("ListIterable.E")),r=e.operator,e=new t.JoinDatasourceCondition(u,n??o,r)),e},$signature:103},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure.prototype={call$1(i){return t.uniqueAlias(i.get$alias())===a.$index$asx(a.$index$asx(this.json.$index(0,"conditions"),this.index),"joinField")},$signature:9},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure0.prototype={call$1(i){return t.IterableExtension_firstWhereOrNull(this.baseConfig.dimensions,new t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson____closure(i))},$signature:104},t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson____closure.prototype={call$1(i){return t.uniqueAlias(i.get$alias())===this.mainField},$signature:9},t.JoinDatasourceConfig.prototype={toJson$0(){var i=this,e=t.LinkedHashMap_LinkedHashMap$of(i.super$BaseDatasourceConfigModel$toJson(),f.String,f.dynamic),r=i.conditions,n=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>");return e.$indexSet(0,"conditions",t.List_List$of(new t.MappedListIterable(r,new t.JoinDatasourceConfig_toJson_closure,n),!0,n._eval$1("ListIterable.E"))),e.$indexSet(0,"rowIds",i.get$rowIds()),e.$indexSet(0,"columnIds",i.get$columnIds()),e},copyWith$2$conditions$mainDimensions(i,e){var r=this,n=r.get$dimensions(),u=r.get$metrics(),o=i??r.conditions,s=e??r.mainDimensions,l=r.get$rowIds(),D=r.get$columnIds();return t.JoinDatasourceConfig$(D,o,n,r.filters,r.isComparable,r.limit,s,u,r.periodType,l,r.schemaNames,r.sorts,r.timezone)},copyWith$1$mainDimensions(i){return this.copyWith$2$conditions$mainDimensions(null,i)},copyWith$1$conditions(i){return this.copyWith$2$conditions$mainDimensions(i,null)},get$_rowIds(){return this._rowIds},get$_columnIds(){return this._columnIds}},t.JoinDatasourceConfig_JoinDatasourceConfig$fromJson_closure.prototype={call$1(i){return t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson(i)},$signature:105},t.JoinDatasourceConfig_toJson_closure.prototype={call$1(i){return i.toJson$0()},$signature:30},t.JoinDatasourceCondition.prototype={toJson$0(){var i,e,r=this.joinDimension;return r=r==null?null:r.toJson$0(),i=this.mainDimensions,e=t._arrayInstanceType(i)._eval$1("MappedListIterable<1,Map<String,@>?>"),e=t.List_List$of(new t.MappedListIterable(i,new t.JoinDatasourceCondition_toJson_closure,e),!0,e._eval$1("ListIterable.E")),t.LinkedHashMap_LinkedHashMap$_literal(["joinDimension",r,"mainDimensions",e,"operator",this.operator._name],f.String,f.dynamic)}},t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson_closure.prototype={call$1(i){return t.QueryRequestDimension_fromJson(f.Map_String_dynamic._as(i))},$signature:17},t.JoinDatasourceCondition_toJson_closure.prototype={call$1(i){return i==null?null:i.toJson$0()},$signature:106},t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig.prototype={},t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig.prototype={},t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig.prototype={},t.BaseXYDatasourceConfigModel.prototype={get$drillDimension(){if(this.get$dimensions().length<=1)return null;var i=this._xy_datasource_config_model$_drillDimension;return i!=null?t.uniqueAlias(i):t.uniqueAlias(_.JSArray_methods.get$first(this.get$dimensions()).get$alias())},toRequests$1(i){var e=this.super$BaseDatasourceConfigModel$toRequests(i)[0],r=t.List_List$of(e.dimensions,!0,f.QueryRequestDimension),n=this.get$dimensions().length!==0?_.JSArray_methods.sublist$2(r,0,1):r;return r=this.breakdownDimension,r!=null&&n.push(r),t._setArrayType([e.copyWith$1$dimensions(n)],f.JSArray_QueryRequest)},toJson$0(){var i,e=this,r=t.LinkedHashMap_LinkedHashMap$of(e.super$BaseDatasourceConfigModel$toJson(),f.String,f.dynamic);return r.$indexSet(0,"isTransposed",e.isTransposed),i=e.breakdownDimension,r.$indexSet(0,"breakdownDimension",i==null?null:i.toJson$0()),r.$indexSet(0,"showLabel",e.showLabel),r.$indexSet(0,"isCumulative",e.isCumulative),r.$indexSet(0,"drillDimension",e.get$drillDimension()),r}},t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig.prototype={},t.GlobalFilterModel.prototype={},t.ReportWidgetModel.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["title",this.title,"type",this.type._name,"config",this.config.toJson$0()],f.String,f.dynamic)}},t.ReCase.prototype={_groupIntoWords$1(i){var e,r,n,u,o,s,l,D,d,c=new t.StringBuffer(""),p=t._setArrayType([],f.JSArray_String);for(e=i.length,r=this.symbolSet,n=this._upperAlphaRegex._nativeRegExp,u=i.toUpperCase()!==i,o=0;o<e;)s=i[o],++o,l=o===e?null:i[o],!r.contains$1(0,s)&&(D=c._contents+=s,l!=null?d=n.test(l)&&u||r.contains$1(0,l):d=!0,d&&(p.push((D.charCodeAt(0)==0,D)),c._contents=""));return p},_getCamelCase$0(){var i,e,r=this.__ReCase__words_A;return r===S&&t.throwUnnamedLateFieldNI(),i=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(r,this.get$_upperCaseFirstLetter(),i),!0,i._eval$1("ListIterable.E")),this.__ReCase__words_A.length!==0&&(e[0]=e[0].toLowerCase()),_.JSArray_methods.join$1(e,"")},_upperCaseFirstLetter$1(i){return _.JSString_methods.substring$2(i,0,1).toUpperCase()+_.JSString_methods.substring$1(i,1).toLowerCase()}},t.TZDateTime.prototype={get$millisecondsSinceEpoch(){return this._native.get$millisecondsSinceEpoch()},get$isUtc(){return this.location===S.$get$_UTC()},toUtc$0(){var i=S.$get$_UTC();return this.location===i?this:t.TZDateTime$from(this._native,i)},toLocal$0(){return this.location===S.___local._readField$0()?this:t.TZDateTime$from(this._native,S.___local._readField$0())},toString$0(i){return this._toString$1$iso8601(!1)},toIso8601String$0(){return this._toString$1$iso8601(!0)},_toString$1$iso8601(i){var e,r=this.timeZone.offset,n=this._localDateTime,u=t.TZDateTime__fourDigits(n.get$year()),o=t.TZDateTime__twoDigits(n.get$month()),s=t.TZDateTime__twoDigits(n.get$day()),l=i?"T":" ",D=t.TZDateTime__twoDigits(n.get$hour()),d=t.TZDateTime__twoDigits(n.get$minute()),c=t.TZDateTime__twoDigits(n.get$second()),p=t.TZDateTime__threeDigits(n.get$millisecond()),y=n.get$microsecond()===0?"":t.TZDateTime__threeDigits(n.get$microsecond());return this.location===S.$get$_UTC()?u+"-"+o+"-"+s+l+D+":"+d+":"+c+"."+p+y+"Z":(r>0?n=1:n=r<0?-1:r,e=n>=0?"+":"-",r=_.JSInt_methods._tdivFast$1(Math.abs(r),1e3),u+"-"+o+"-"+s+l+D+":"+d+":"+c+"."+p+y+e+t.TZDateTime__twoDigits(_.JSInt_methods._tdivFast$1(r,3600))+t.TZDateTime__twoDigits(_.JSInt_methods._tdivFast$1(_.JSInt_methods.$mod(r,3600),60)))},add$1(i,e){return t.TZDateTime$from(this._native.add$1(0,e),this.location)},subtract$1(i){return t.TZDateTime$from(this._native.subtract$1(i),this.location)},$eq(i,e){var r;return e==null?!1:(this!==e?r=e instanceof t.TZDateTime&&this._native.isAtSameMomentAs$1(e._native)&&this.location===e.location:r=!0,r)},isAfter$1(i){var e=i instanceof t.TZDateTime?i._native:i;return this._native.isAfter$1(e)},isAtSameMomentAs$1(i){var e=i instanceof t.TZDateTime?i._native:i;return this._native.isAtSameMomentAs$1(e)},compareTo$1(i,e){var r=e instanceof t.TZDateTime?e._native:e;return this._native.compareTo$1(0,r)},get$hashCode(i){var e=this._native;return e.get$hashCode(e)},get$year(){return this._localDateTime.get$year()},get$month(){return this._localDateTime.get$month()},get$day(){return this._localDateTime.get$day()},get$hour(){return this._localDateTime.get$hour()},get$minute(){return this._localDateTime.get$minute()},get$second(){return this._localDateTime.get$second()},get$millisecond(){return this._localDateTime.get$millisecond()},get$microsecond(){return this._localDateTime.get$microsecond()},get$weekday(){return this._localDateTime.get$weekday()},$isDateTime:1},t.TimeZoneInitException.prototype={toString$0(i){return this.msg}},t.LocationNotFoundException.prototype={toString$0(i){return this.msg}},t.Location.prototype={Location$4(i,e,r,n){var u,o,s,l,D,d,c,p,y=this;for(u=y.transitionAt,o=y.zones,s=y.transitionZone,l=0;D=u.length,l<D;++l)d=u[l],c=S.$get$Location__cacheNow(),d<=c?(p=l+1,c=p===D||c<u[p]):c=!1,c&&(y._cacheStart=d,y._cacheEnd=864e13,c=l+1,c<D&&(y._cacheEnd=u[c]),y.__Location__cacheZone_A=o[s[l]])},lookupTimeZone$1(i){var e,r,n,u,o,s,l,D,d=this,c=864e13,p=d.zones;if(p.length===0)return _.TzInstant_ww8;if(e=d._cacheStart,i>=e&&i<d._cacheEnd)return p=d.__Location__cacheZone_A,p===S&&t.throwUnnamedLateFieldNI(),new t.TzInstant(p,e,d._cacheEnd);if(e=d.transitionAt,r=e.length,r===0||i<e[0])return n=d._firstZone$0(),new t.TzInstant(n,-864e13,e.length===0?c:_.JSArray_methods.get$first(e));for(u=c,o=0;s=r-o,s>1;)l=o+_.JSInt_methods._tdivFast$1(s,2),D=e[l],i<D?(u=D,r=l):o=l;return new t.TzInstant(p[d.transitionZone[o]],e[o],u)},_firstZone$0(){var i,e,r,n,u,o,s=this;if(!s._firstZoneIsUsed$0())return _.JSArray_methods.get$first(s.zones);if(i=s.transitionZone,i.length!==0&&s.zones[_.JSArray_methods.get$first(i)].isDst){for(e=_.JSArray_methods.get$first(i)-1,r=s.zones;e>=0;--e)if(n=r[e],!n.isDst)return n}for(r=i.length,u=s.zones,o=0;o<r;++o)if(n=u[i[o]],!n.isDst)return n;return _.JSArray_methods.get$first(u)},_firstZoneIsUsed$0(){var i,e,r;for(i=this.transitionZone,e=i.length,r=0;r<e;++r)if(i[r]===0)return!0;return!1},toString$0(i){return this.name}},t.TimeZone.prototype={$eq(i,e){var r,n=this;return e==null?!1:(n!==e?r=e instanceof t.TimeZone&&n.offset===e.offset&&n.isDst===e.isDst&&n.abbreviation===e.abbreviation:r=!0,r)},get$hashCode(i){var e=_.JSInt_methods.get$hashCode(this.offset),r=this.isDst?519018:218159;return 37*(37*(629+e)+r)+_.JSString_methods.get$hashCode(this.abbreviation)},toString$0(i){return"["+this.abbreviation+" offset="+this.offset+" dst="+this.isDst+"]"}},t.TzInstant.prototype={},t.LocationDatabase.prototype={$get$1(i){var e,r=this._locations;if(r.__js_helper$_length===0)throw t.wrapException(t.LocationNotFoundException$("Tried to get location before initializing timezone database"));if(e=r.$index(0,i),e==null)throw t.wrapException(t.LocationNotFoundException$('Location with the name "'+i+`" doesn't exist`));return e}},t.TypedDataBuffer.prototype={get$length(i){return this._typed_buffer$_length},$index(i,e){if(e>=this._typed_buffer$_length)throw t.wrapException(t.IndexError$(e,this));return this._buffer[e]},$indexSet(i,e,r){if(e>=this._typed_buffer$_length)throw t.wrapException(t.IndexError$(e,this));this._buffer[e]=r},set$length(i,e){var r,n,u,o=this,s=o._typed_buffer$_length;if(e<s)for(r=o._buffer,n=e;n<s;++n)r[n]=0;else s=o._buffer.length,e>s&&(s===0?u=new Uint8Array(e):u=o._createBiggerBuffer$1(e),_.NativeUint8List_methods.setRange$3(u,0,o._typed_buffer$_length,o._buffer),o._buffer=u);o._typed_buffer$_length=e},_add$1(i){var e=this,r=e._typed_buffer$_length,n=e._buffer;r===n.length&&(n=e._createBiggerBuffer$1(null),_.NativeUint8List_methods.setRange$3(n,0,r,e._buffer),e._buffer=n),r=n,r[e._typed_buffer$_length++]=i},add$1(i,e){var r=this,n=r._typed_buffer$_length,u=r._buffer;n===u.length&&(u=r._createBiggerBuffer$1(null),_.NativeUint8List_methods.setRange$3(u,0,n,r._buffer),r._buffer=u),n=u,n[r._typed_buffer$_length++]=e},addAll$1(i,e){t.RangeError_checkNotNegative(0,"start"),this._addAll$3(e,0,null)},_addAll$3(i,e,r){var n,u,o,s,l,D,d,c=this,p="Too few elements";if(r=i.length,r!=null){n=c._typed_buffer$_length,u=i.length,(e>u||r>u)&&t.throwExpression(t.StateError$(p)),o=r-e,s=n+o,c._ensureCapacity$1(s),u=c._buffer,_.NativeUint8List_methods.setRange$4(u,s,c._typed_buffer$_length+o,u,n),_.NativeUint8List_methods.setRange$4(c._buffer,n,s,i,e),c._typed_buffer$_length=s;return}for(n=i.length,l=0,D=0;D<n;++D)d=i[D],l>=e&&c._add$1(d),++l;if(l<e)throw t.wrapException(t.StateError$(p))},_ensureCapacity$1(i){var e,r=this;i<=r._buffer.length||(e=r._createBiggerBuffer$1(i),_.NativeUint8List_methods.setRange$3(e,0,r._typed_buffer$_length,r._buffer),r._buffer=e)},_createBiggerBuffer$1(i){var e=this._buffer.length*2;return i!=null&&e<i?e=i:e<8&&(e=8),new Uint8Array(e)}},t._IntBuffer.prototype={},t.Uint8Buffer.prototype={},t.getSchemas_closure.prototype={call$1(i){return i.toJson$0()},$signature:107},t.getVisualizationSchemas_closure.prototype={call$1(i){return i.toJson$0()},$signature:108},t.sqlResponsesToQueryResponses_closure.prototype={call$1(i){return t.QueryRequest_fromJson(i)},$signature:109},t.sqlResponsesToQueryResponses_closure0.prototype={call$2(i,e){var r,n,u=null,o=a.$index$asx(this.sqlResponses,i),s=e.getColumns$1(this.engine.context.schemaLibrary),l=e.timeDimension,D=l==null,d=D?u:l.start;return d==null&&(d=""),r=D?u:l.end,r==null&&(r=""),n=D?u:l.timeStart,n==null&&(n=""),l=D?u:l.timeEnd,l==null&&(l=""),t.QueryResponse$map(s,new t.DateTimeRange(d,r),o,new t.DateTimeRange(n,l))},$signature:110},t.sqlResponsesToQueryResponses_closure1.prototype={call$1(i){return i.toJson$0()},$signature:111},t.getQueryRequests_closure.prototype={call$1(i){return a.toString$0$(i)},$signature:7},t.getQueryRequests_closure0.prototype={call$1(i){return a.toString$0$(i)},$signature:7},t.getQueryRequests_closure1.prototype={call$1(i){return a.toString$0$(i)},$signature:7},t.getQueryRequests_closure2.prototype={call$1(i){return a.toString$0$(i)},$signature:7},t.getQueryRequests_closure3.prototype={call$1(i){return a.toString$0$(i)},$signature:7},t.getQueryRequests_closure4.prototype={call$1(i){return a.toString$0$(i)},$signature:7},t.getQueryRequests_closure5.prototype={call$1(i){var e=t.Jiffy$(i).__Jiffy__dateTime_A;return e===S&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure6.prototype={call$1(i){var e=t.Jiffy$(i).__Jiffy__dateTime_A;return e===S&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure7.prototype={call$1(i){var e=t.Jiffy$(i).__Jiffy__dateTime_A;return e===S&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure8.prototype={call$1(i){var e=t.Jiffy$(i).__Jiffy__dateTime_A;return e===S&&t.throwUnnamedLateFieldNI(),e.toUtc$0()},$signature:12},t.getQueryRequests_closure9.prototype={call$1(i){return i.toJson$0()},$signature:113},t.Exports.prototype={},t._Exports.prototype={},function(){var e=a.LegacyJavaScriptObject.prototype;e.super$LegacyJavaScriptObject$toString=e.toString$0,e=t.JsLinkedHashMap.prototype,e.super$JsLinkedHashMap$internalContainsKey=e.internalContainsKey$1,e.super$JsLinkedHashMap$internalGet=e.internalGet$1,e.super$JsLinkedHashMap$internalSet=e.internalSet$2,e=t.Field.prototype,e.super$Field$getSql=e.getSql$3$option$schema$value,e=t.BaseDatasourceConfigModel.prototype,e.super$BaseDatasourceConfigModel$toRequests=e.toRequests$1,e.super$BaseDatasourceConfigModel$toJson=e.toJson$0}(),function(){var e=Q._static_2,r=Q._static_1,n=Q._instance_1u,u=Q._instance_0u;e(t,"collection___defaultEquals$closure","_defaultEquals",33),r(t,"collection___defaultHashCode$closure","_defaultHashCode",22),r(t,"convert___defaultToEncodable$closure","_defaultToEncodable",3),r(t,"core__identityHashCode$closure","identityHashCode",22),r(t,"core_RegExp_escape$closure","RegExp_escape",4),e(t,"core__identical$closure","identical",33);var o;n(o=t.DateBuilder.prototype,"get$setYear","setYear$1",6),n(o,"get$setMonth","setMonth$1",6),n(o,"get$setDay","setDay$1",6),n(o,"get$setDayOfYear","setDayOfYear$1",6),n(o,"get$setHour","setHour$1",6),n(o,"get$setMinute","setMinute$1",6),n(o,"get$setSecond","setSecond$1",6),n(o,"get$setFractionalSecond","setFractionalSecond$1",6),r(t,"date_format_DateFormat_localeExists$closure","DateFormat_localeExists",77),u(t.DateFormat.prototype,"get$_initDigitMatcher","_initDigitMatcher$0",49),n(t.ReCase.prototype,"get$_upperCaseFirstLetter","_upperCaseFirstLetter$1",4),r(t,"js_compiler__getMergeInfoSql$closure","getMergeInfoSql",3),r(t,"js_compiler__getClearTableSql$closure","getClearTableSql",3),r(t,"js_compiler__getMergeSql$closure","getMergeSql",3),r(t,"js_compiler__getSchemas$closure","getSchemas",3),r(t,"js_compiler__getVisualizationSchemas$closure","getVisualizationSchemas",3),r(t,"js_compiler__requestJsonToSql$closure","requestJsonToSql",3),r(t,"js_compiler__sqlResponsesToQueryResponses$closure","sqlResponsesToQueryResponses",3),r(t,"js_compiler__getQueryRequests$closure","getQueryRequests",3),r(t,"js_compiler__getCreateMaterializedTableSql$closure","getCreateMaterializedTableSql",3)}(),function(){var e=Q.mixin,r=Q.inherit,n=Q.inheritMany;r(t.Object,null),n(t.Object,[t.JS_CONST,a.Interceptor,a.ArrayIterator,t.Error,t._ListBase_Object_ListMixin,t.Iterable,t.ListIterator,t.Iterator,t.EmptyIterator,t.FixedLengthListMixin,t.UnmodifiableListMixin,t.Symbol,t.MapView,t.ConstantMap,t.Closure,t.JSInvocationMirror,t.TypeErrorDecoder,t.NullThrownFromJavaScriptException,t._Required,t.MapMixin,t.LinkedHashMapCell,t.LinkedHashMapKeyIterator,t.JSSyntaxRegExp,t._MatchImplementation,t._AllMatchesIterator,t.StringMatch,t._StringAllMatchesIterator,t._Cell,t.Rti,t._FunctionParameters,t._Type,t._IterationMarker,t._SyncStarIterator,t.StreamTransformerBase,t.__SetBase_Object_SetMixin,t._LinkedHashSetCell,t._LinkedHashSetIterator,t.ListMixin,t._UnmodifiableMapMixin,t.SetMixin,t.Codec,t._JsonStringifier,t._Utf8Encoder,t.DateTime,t.Duration,t._Enum,t.OutOfMemoryError,t.StackOverflowError,t._Exception,t.FormatException,t.MapEntry,t.Null,t.Sink,t.StringBuffer,t.Endian,t.Digest,t.HashSink,t.DateSymbols,t.DateBuilder,t.DateFormat,t._DateFormatField,t.StringStack,t.UninitializedLocaleData,t.LocaleDataException,t.Jiffy,t.Locale,t.JiffyException,t.Connection,t.SchemaLibrary,t.QueryEngineContext,t.Permission,t.TopLevelFilters,t.Source,t.Index,t.Schema,t.Field,t.Join,t.JoinLateralSort,t.JoinLateral,t.JoinCondition,t.QueryRequestComparisonTarget,t.QueryRequestComparison,t.QueryRequestCommonField,t._GetSourceTableResponse,t._PlainSqlColumn,t.QueryRequest,t.QueryRequestTimeDimension,t.QueryResponseColumn,t.DateTimeRange,t.QueryResponse,t.QueryResponseRow,t.VisualizationSchema,t.VisualizationField,t.QueryEngine,t.BaseDatasourceConfigModel,t.DataSourceDrillConfig,t.DataSourceRowColumnConfig,t.JoinDatasourceCondition,t.GlobalFilterModel,t.ReportWidgetModel,t.ReCase,t.TZDateTime,t.TimeZoneInitException,t.LocationNotFoundException,t.Location,t.TimeZone,t.TzInstant,t.LocationDatabase]),n(a.Interceptor,[a.JSBool,a.JSNull,a.JavaScriptObject,a.JSArray,a.JSNumber,a.JSString,t.NativeTypedData]),r(a.LegacyJavaScriptObject,a.JavaScriptObject),n(a.LegacyJavaScriptObject,[a.PlainJavaScriptObject,a.UnknownJavaScriptObject,a.JavaScriptFunction,t.BufferModule,t.BufferConstants,t.Buffer,t.ConsoleModule,t.Console,t.EventEmitter,t.Promise,t.Date,t.JsError,t.Atomics,t.Modules,t.Module,t.Net,t.Socket,t.NetAddress,t.NetServer,t.NodeJsError,t.Process,t.CPUUsage,t.Release,t.StreamModule,t.Readable,t.Writable,t.Duplex,t.Transform,t.WritableOptions,t.ReadableOptions,t.Immediate,t.Timeout,t.TTY,t.Util,t.Exports,t._Exports]),r(a.JSUnmodifiableArray,a.JSArray),n(a.JSNumber,[a.JSInt,a.JSNumNotInt]),n(t.Error,[t.LateError,t.TypeError,t.JsNoSuchMethodError,t.UnknownJsTypeError,t.RuntimeError,t._Error,t.JsonUnsupportedObjectError,t.AssertionError,t.NullThrownError,t.ArgumentError,t.NoSuchMethodError,t.UnsupportedError,t.UnimplementedError,t.StateError,t.ConcurrentModificationError,t.CyclicInitializationError]),r(t.ListBase,t._ListBase_Object_ListMixin),n(t.ListBase,[t.UnmodifiableListBase,t.TypedDataBuffer]),r(t.CodeUnits,t.UnmodifiableListBase),n(t.Iterable,[t.EfficientLengthIterable,t.MappedIterable,t.WhereIterable,t._ConstantMapKeyIterable,t.IterableBase,t._StringAllMatchesIterable]),n(t.EfficientLengthIterable,[t.ListIterable,t.EmptyIterable,t.LinkedHashMapKeyIterable]),n(t.ListIterable,[t.SubListIterable,t.MappedListIterable,t.ReversedListIterable,t._JsonMapKeyIterable,t._GeneratorIterable]),r(t.EfficientLengthMappedIterable,t.MappedIterable),n(t.Iterator,[t.MappedIterator,t.WhereIterator]),r(t._UnmodifiableMapView_MapView__UnmodifiableMapMixin,t.MapView),r(t.UnmodifiableMapView,t._UnmodifiableMapView_MapView__UnmodifiableMapMixin),r(t.ConstantMapView,t.UnmodifiableMapView),n(t.Closure,[t.Closure2Args,t.Closure0Args,t.TearOffClosure,t.initHooks_closure,t.initHooks_closure1,t._LinkedCustomHashMap_closure,t.MapMixin_entries_closure,t.DateTime_parse_parseIntOrZero,t.DateTime_parse_parseMilliAndMicroseconds,t.DateFormat_dateTimeConstructor_closure,t.DateFormat__checkDateOnly_closure,t.DateFormat__initDigitMatcher_closure,t.DateFormat__initDigitMatcher_closure0,t._DateFormatPatternField_parseStandaloneDay_closure,t.Jiffy__parseString_closure,t.SchemaLibrary_getSchema_closure,t.SchemaLibrary_visualizationSchemas_closure,t.SchemaLibrary_visualizationSchemas_closure0,t.Materialize_get_createMaterializedTableSql_closure,t.Materialize_get_createMaterializedTableSql_closure0,t.Materialize_get_createMaterializedTableSql_closure1,t.Materialize_get_createMaterializedTableSql_closure2,t.Materialize_getMergeSql_closure,t.Materialize_getMergeSql_closure0,t.Materialize_getMergeSql_closure1,t.Materialize_getMergeSql_closure2,t.Materialize_getMergeSql_closure3,t.Materialize_getMergeSql_closure4,t.TopLevelFilters_fromJson_closure,t.TopLevelFilters_toJson_closure,t.Schema_visualizationSchema_closure,t.Schema_visualizationSchema_closure0,t.Schema_visualizationSchema_closure1,t.Schema_fromJson_closure,t.Schema_fromJson_closure0,t.Schema_fromJson_closure1,t.Schema_fromJson_closure2,t.Schema_toJson_closure,t.Schema_toJson_closure0,t.Schema_toJson_closure1,t.Schema_toJson_closure2,t.Field_getQueryPlainSql_closure,t.Join_fromJson_closure,t.Join_toJson_closure,t.JoinLateral_toJson_closure,t.QueryRequestComparison_QueryRequestComparison$nested_closure,t.QueryRequestComparison_getToValues_closure,t.QueryRequestComparison_getToValues__closure0,t.QueryRequestComparison_getToValues_closure0,t.QueryRequestComparison_getToValues__closure,t.QueryRequestComparison_getFromValue_closure,t.QueryRequestComparison_getSql_closure,t.QueryRequestComparison_getSql_closure0,t.uniqueAlias_closure,t.QueryRequestCommonField_getAggregatedSql_closure,t.QueryRequestDimension_getPlainSql_closure,t.QueryRequestDimension_getColumn_closure,t.QueryRequestMetric_getColumn_closure,t.QueryRequestMetric_getPlainSql_closure,t.QueryRequest__closure0,t.QueryRequest__closure,t.QueryRequest__getJoins_closure,t.QueryRequest__getJoins__closure,t.QueryRequest_fromJson_closure,t.QueryRequest_fromJson_closure0,t.QueryRequest_fromJson_closure1,t.QueryRequest_fromJson_closure2,t.QueryRequest_fromJson_closure3,t.QueryRequest_fromJson_closure4,t.QueryRequest_toJson_closure,t.QueryRequest_toJson_closure0,t.QueryRequest_toJson_closure1,t.QueryRequest_toJson_closure2,t.QueryRequest_toJson_closure3,t.QueryRequest_toJson_closure4,t.QueryRequest_getColumns_closure,t.QueryRequest_getColumns_closure0,t.QueryRequest__getPlainSqlColumns_closure,t.QueryRequest__getPlainSqlColumns_closure0,t.QueryRequest__getPlainSqlColumns_closure1,t.QueryRequest__getPlainSqlColumns__closure,t.QueryRequest__getPlainSqlSorts_closure,t.QueryRequest__getSqlFilters_closure,t.QueryRequest__getSqlFilters_closure0,t.QueryRequest__getSqlFilters_closure1,t.QueryRequest__getSqlFilters_closure2,t.QueryRequest__getSqlFilters_closure3,t.QueryRequest__getSqlFilters_closure4,t.QueryRequest__getSqlJoins__closure,t.QueryRequest__getSqlJoins__closure0,t.QueryRequest__getRollupSelect_closure0,t.QueryRequest__getRollupSelect_closure2,t.QueryRequest__getRollupSelect_closure3,t.QueryRequest__getRollupSelect_closure4,t.QueryRequest__getRollupSelect_closure6,t.QueryRequest__getRollupSelect_closure7,t.QueryRequest__getRollupSelect_closure8,t.QueryRequest__getRollupSelect_closure9,t.QueryRequest__hasFillGap_closure,t.QueryRequest__getSqlSelectSorts_closure,t.QueryRequest__getSqlSelectSorts__closure,t.QueryRequest__getSqlSelectSorts__closure0,t.QueryRequest_getSqlSelect_closure,t.QueryRequest_getSqlSelect_closure0,t.QueryRequest_getSqlSelect_closure1,t.QueryRequest__transformSqlAlias_closure,t.QueryRequest__getSourceTable_closure,t.QueryRequest__getSourceTable_closure0,t.QueryRequest__getFillGapTable_closure0,t.QueryRequest__getFillGapTable__closure1,t.QueryRequest__getFillGapTable__closure2,t.QueryRequest__getFillGapTable_closure2,t.QueryRequest__getFillGapTable__closure,t.QueryRequest__getFillGapTable__closure0,t.QueryRequest__getFillGapTable_closure3,t.QueryRequest__getFillGapTable_closure4,t.QueryRequest__getFullTable_closure,t.QueryRequest__getFullTable_closure1,t.QueryRequest__getFullTable_closure2,t.QueryRequestSort_getPlainSql_closure,t.QueryRequestSort_getSortSql_closure,t.QueryResponse$map_closure,t.QueryResponse_toJson_closure,t.QueryResponse_toJson_closure0,t.VisualizationSchema_toJson_closure,t.VisualizationSchema_toJson_closure0,t.VisualizationField_filterDimensionOptions_closure,t.VisualizationField_fillGapDimensionOptions_closure,t.VisualizationField_isNumericAggregations_closure,t.VisualizationField_toJson_closure,t.VisualizationField_toJson_closure0,t.VisualizationField_toJson_closure1,t.VisualizationField_toJson_closure2,t.VisualizationField_toJson_closure3,t.VisualizationField_toJson_closure4,t.VisualizationField_toJson_closure5,t.VisualizationField_toJson_closure6,t.VisualizationField_toJson_closure7,t.addonFlattenItemSchema_closure,t.addonFlattenItemSchema_closure0,t.adjustmentSchema_closure,t.adjustmentSchema_closure0,t.billSchema_closure,t.billSchema_closure0,t.businessSchema_closure,t.businessSchema_closure0,t.campaignSchema_closure,t.campaignSchema_closure0,t.campaignTierSchema_closure,t.campaignTierSchema_closure0,t.chargeSchema_closure,t.chargeSchema_closure0,t.closingDraftSchema_closure,t.closingDraftSchema_closure0,t.closingDraftSkuSchema_closure,t.closingDraftSkuSchema_closure0,t.closingSkuSchema_closure,t.closingSkuSchema_closure0,t.collectibleCollectionSchema_closure,t.collectibleCollectionSchema_closure0,t.collectibleConfigSchema_closure,t.collectibleConfigSchema_closure0,t.collectibleTransactionSchema_closure,t.collectibleTransactionSchema_closure0,t.completeTimeBillSchema_closure,t.completeTimeBillSchema_closure0,t.counterSchema_closure,t.counterSchema_closure0,t.creditTransactionSchema_closure,t.creditTransactionSchema_closure0,t.drawerSchema_closure,t.drawerSchema_closure0,t.flattenItemSchema_closure,t.flattenItemSchema_closure0,t.internalPurchaseOrderSchema_closure,t.internalPurchaseOrderSchema_closure0,t.internalPurchaseOrderDeliveryFulfillmentSchema_closure,t.internalPurchaseOrderDeliveryFulfillmentSchema_closure0,t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure,t.internalPurchaseOrderDeliveryFulfillmentSkuSchema_closure0,t.internalPurchaseOrderDeliveryOrderSchema_closure,t.internalPurchaseOrderDeliveryOrderSchema_closure0,t.internalPurchaseOrderDeliveryOrderSkuSchema_closure,t.internalPurchaseOrderDeliveryOrderSkuSchema_closure0,t.internalPurchaseOrderItemSchema_closure,t.internalPurchaseOrderItemSchema_closure0,t.inventoryAdjustmentSchema_closure,t.inventoryAdjustmentSchema_closure0,t.inventoryAdjustmentPhysicalSkuSchema_closure,t.inventoryAdjustmentPhysicalSkuSchema_closure0,t.inventoryAdjustmentSkuSchema_closure,t.inventoryAdjustmentSkuSchema_closure0,t.inventoryV1FlattenInventorySchema_closure,t.inventoryV1FlattenInventorySchema_closure0,t.itemSchema_closure,t.itemSchema_closure0,t.itemMovementSchema_closure,t.itemMovementSchema_closure0,t.kitchenStationSchema_closure,t.kitchenStationSchema_closure0,t.memberSchema_closure,t.memberSchema_closure0,t.memberStorePurchaseSchema_closure,t.memberStorePurchaseSchema_closure0,t.memberStorePurchasePaymentSchema_closure,t.memberStorePurchasePaymentSchema_closure0,t.memberTitleSchema_closure,t.memberTitleSchema_closure0,t.memberV2Schema_closure,t.memberV2Schema_closure0,t.membershipSchema_closure,t.membershipSchema_closure0,t.membershipTitleSchema_closure,t.membershipTitleSchema_closure0,t.menuV3GroupSchema_closure,t.menuV3GroupSchema_closure0,t.menuV3ItemSchema_closure,t.menuV3ItemSchema_closure0,t.menuV3SkuSchema_closure,t.menuV3SkuSchema_closure0,t.menuV4CatalogItemSchema_closure,t.menuV4CatalogItemSchema_closure0,t.menuV4GroupSchema_closure,t.menuV4GroupSchema_closure0,t.menuV4ItemSchema_closure,t.menuV4ItemSchema_closure0,t.menuV4ItemInventoryBindingSchema_closure,t.menuV4ItemInventoryBindingSchema_closure0,t.menuV4SkuSchema_closure,t.menuV4SkuSchema_closure0,t.parentFlattenItemSchema_closure,t.parentFlattenItemSchema_closure0,t.paymentSchema_closure,t.paymentSchema_closure0,t.paymentTimePaymentSchema_closure,t.paymentTimePaymentSchema_closure0,t.purchaseOrderSchema_closure,t.purchaseOrderSchema_closure0,t.purchaseOrderDeliveryFulfillmentSchema_closure,t.purchaseOrderDeliveryFulfillmentSchema_closure0,t.purchaseOrderDeliveryFulfillmentSkuSchema_closure,t.purchaseOrderDeliveryFulfillmentSkuSchema_closure0,t.purchaseOrderDeliveryOrderSchema_closure,t.purchaseOrderDeliveryOrderSchema_closure0,t.purchaseOrderDeliveryOrderSkuSchema_closure,t.purchaseOrderDeliveryOrderSkuSchema_closure0,t.purchaseOrderItemSchema_closure,t.purchaseOrderItemSchema_closure0,t.recommendationCallSchema_closure,t.recommendationCallSchema_closure0,t.recordSchema_closure,t.recordSchema_closure0,t.refundBillSchema_closure,t.refundBillSchema_closure0,t.restaurantSchema_closure,t.restaurantSchema_closure0,t.restaurantFeatureSchema_closure,t.restaurantFeatureSchema_closure0,t.restaurantLocationSchema_closure,t.restaurantLocationSchema_closure0,t.reviewSchema_closure,t.reviewSchema_closure0,t.slotSchema_closure,t.slotSchema_closure0,t.staffSchema_closure,t.staffSchema_closure0,t.stockSchema_closure,t.stockSchema_closure0,t.storeBundleSchema_closure,t.storeBundleSchema_closure0,t.storeTransactionSchema_closure,t.storeTransactionSchema_closure0,t.subItemSchema_closure,t.subItemSchema_closure0,t.timesheetSchema_closure,t.timesheetSchema_closure0,t.timesheetRecordSchema_closure,t.timesheetRecordSchema_closure0,t.unitCostHistorySchema_closure,t.unitCostHistorySchema_closure0,t.userSchema_closure,t.userSchema_closure0,t.voucherClaimSchema_closure,t.voucherClaimSchema_closure0,t.voucherClaimRedemptionSchema_closure,t.voucherClaimRedemptionSchema_closure0,t.warehouseLocationSchema_closure,t.warehouseLocationSchema_closure0,t.QueryEngine_getSql_closure,t.BaseDatasourceConfigModel_drilledDimensionIds_closure,t.BaseDatasourceConfigModel_metricIds_closure,t.BaseDatasourceConfigModel_toJson_closure,t.BaseDatasourceConfigModel_toJson_closure0,t.BaseDatasourceConfigModel_toJson_closure1,t.BaseDatasourceConfigModel_toJson_closure2,t.BaseDatasourceConfigModel_toJson_closure3,t.BaseDatasourceConfigModel_toJson_closure4,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure0,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure1,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure2,t.BaseDatasourceConfigModel_BaseDatasourceConfigModel$fromJson_closure3,t.DataSourceDrillConfig_drilledDimensions_closure,t.DataSourceRowColumnConfig_rowIds_closure,t.DataSourceRowColumnConfig_rowIds_closure0,t.DataSourceRowColumnConfig_rowIds_closure2,t.DataSourceRowColumnConfig_rowIds_closure1,t.DataSourceRowColumnConfig_columnIds_closure,t.DataSourceRowColumnConfig_columnIds_closure0,t.DataSourceRowColumnConfig_columnIds_closure1,t.TableDatasourceConfigModel_joinDatasources_closure,t.TableDatasourceConfigModel_toRequests___closure,t.TableDatasourceConfigModel_toRequests_closure0,t.TableDatasourceConfigModel_toJson_closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson_closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson___closure0,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson____closure,t.JoinDatasourceConfig_JoinDatasourceConfig$fromJson_closure,t.JoinDatasourceConfig_toJson_closure,t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson_closure,t.JoinDatasourceCondition_toJson_closure,t.getSchemas_closure,t.getVisualizationSchemas_closure,t.sqlResponsesToQueryResponses_closure,t.sqlResponsesToQueryResponses_closure1,t.getQueryRequests_closure,t.getQueryRequests_closure0,t.getQueryRequests_closure1,t.getQueryRequests_closure2,t.getQueryRequests_closure3,t.getQueryRequests_closure4,t.getQueryRequests_closure5,t.getQueryRequests_closure6,t.getQueryRequests_closure7,t.getQueryRequests_closure8,t.getQueryRequests_closure9]),n(t.Closure2Args,[t.ConstantMap_map_closure,t.Primitives_functionNoSuchMethod_closure,t.JsLinkedHashMap_addAll_closure,t.initHooks_closure0,t.LinkedHashMap_LinkedHashMap$from_closure,t.MapBase_mapToString_closure,t._JsonStringifier_writeMap_closure,t.NoSuchMethodError_toString_closure,t.DateFormat__fieldConstructors_closure,t.DateFormat__fieldConstructors_closure0,t.DateFormat__fieldConstructors_closure1,t.Jiffy__parseMap_closure,t.Join_getConditionsSql_closure,t.QueryRequest_closure,t.QueryRequest_closure0,t.QueryRequest__getPlainSqlColumns_closure2,t.QueryRequest__getSqlJoins_closure,t.QueryRequest__getRollupSelect_closure,t.QueryRequest__getRollupSelect_closure1,t.QueryRequest__getRollupSelect_closure5,t.QueryRequest__getSqlSelectSorts_closure0,t.QueryRequest__getSortedLimitTable_closure,t.QueryRequest__getFillGapTable_closure,t.QueryRequest__getFillGapTable_closure1,t.QueryRequest__getFullTable_closure0,t.VisualizationSchema_closure,t.DataSourceDrillConfig__availableIds_closure,t.DataSourceRowColumnConfig__availableIds_closure,t.DataSourceRowColumnConfig__availableIds_closure0,t.TableDatasourceConfigModel_drilledDimensions_closure,t.TableDatasourceConfigModel_toRequests_closure,t.TableDatasourceConfigModel_toRequests__closure0,t.TableDatasourceConfigModel_toRequests__closure,t.TableDatasourceConfigModel_TableDatasourceConfigModel$fromJson__closure,t.sqlResponsesToQueryResponses_closure0]),r(t.ConstantStringMap,t.ConstantMap),r(t.NullError,t.TypeError),n(t.TearOffClosure,[t.StaticClosure,t.BoundClosure]),r(t.MapBase,t.MapMixin),n(t.MapBase,[t.JsLinkedHashMap,t._JsonMap]),n(t.IterableBase,[t._AllMatchesIterable,t._SyncStarIterable]),r(t.NativeTypedArray,t.NativeTypedData),r(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin,t.NativeTypedArray),r(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin,t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin),r(t.NativeTypedArrayOfInt,t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin),n(t.NativeTypedArrayOfInt,[t.NativeUint16List,t.NativeUint32List,t.NativeUint8List]),r(t._TypeError,t._Error),n(t.JsLinkedHashMap,[t._LinkedIdentityHashMap,t._LinkedCustomHashMap]),r(t._SetBase,t.__SetBase_Object_SetMixin),r(t._LinkedHashSet,t._SetBase),n(t.Codec,[t.Encoding,t.JsonCodec]),n(t.Encoding,[t.AsciiCodec,t.Utf8Codec]),r(t.Converter,t.StreamTransformerBase),n(t.Converter,[t._UnicodeSubsetDecoder,t.JsonEncoder,t.JsonDecoder,t.Utf8Encoder]),r(t.AsciiDecoder,t._UnicodeSubsetDecoder),r(t.JsonCyclicError,t.JsonUnsupportedObjectError),r(t._JsonStringStringifier,t._JsonStringifier),n(t.ArgumentError,[t.RangeError,t.IndexError]),r(t.DigestSink,t.Sink),r(t._Sha1Sink,t.HashSink),n(t._DateFormatField,[t._DateFormatLiteralField,t._DateFormatQuotedField,t._DateFormatPatternField]),n(t._Enum,[t.StartOfWeek,t.Units,t.SOURCE_TYPE,t.SCHEMA_NAME,t.DATA_TYPE,t.AGGREGATION_TYPE,t.COMPARISON_OPERATOR,t.DIMENSION_OPTION,t.TIME_FORMATTER,t.FORMATTER_TYPE,t.PERIOD_TYPE,t.SORT_TYPE,t.PermissionType,t.INDEX_METHOD,t.FIELD_TYPE,t.ChartType]),n(t.Locale,[t.ArLyLocale,t.ArSaMaDzKwTnLocale,t.AzLocale,t.BnLocale,t.DeLocale,t.EnLocale,t.EsLocale,t.FaLocale,t.FrLocale,t.HiLocale,t.IdLocale,t.ItLocale,t.JaLocale,t.KoLocale,t.NbLocale,t.NlLocale,t.PlLocale,t.PtLocale,t.RuLocale,t.SvLocale,t.ThLocale,t.TrLocale,t.UkLocale,t.ZhCnLocale,t.ZhLocale]),n(t.NodeJsError,[t.JsAssertionError,t.JsRangeError,t.JsReferenceError,t.JsSyntaxError,t.JsTypeError,t.JsSystemError]),n(t.Socket,[t.TTYReadStream,t.TTYWriteStream]),n(t.Field,[t._NumericField,t._TimestampField,t._BoolField,t._StringField]),n(t.QueryRequestComparisonTarget,[t._QueryRequestComparisonTargetValue,t._QueryRequestComparisonTargetVariable]),n(t.QueryRequestCommonField,[t.QueryRequestDimension,t.QueryRequestMetric,t.QueryRequestFilter,t.QueryRequestSort]),n(t.Closure0Args,[t.QueryRequestDimension_generateTimestampArraySql_closure,t.QueryRequestDimension_generateTimestampArraySql_closure0,t.QueryRequest__getSqlFilters__closure]),n(t.BaseDatasourceConfigModel,[t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig,t.ScorecardDatasourceConfigModel,t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig]),r(t.CircularDatasourceConfigModel,t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig),r(t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig,t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig),r(t.TableDatasourceConfigModel,t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig),r(t.JoinDatasourceConfig,t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig),r(t.BaseXYDatasourceConfigModel,t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig),r(t._IntBuffer,t.TypedDataBuffer),r(t.Uint8Buffer,t._IntBuffer),e(t.UnmodifiableListBase,t.UnmodifiableListMixin),e(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin,t.ListMixin),e(t._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin,t.FixedLengthListMixin),e(t._ListBase_Object_ListMixin,t.ListMixin),e(t._UnmodifiableMapView_MapView__UnmodifiableMapMixin,t._UnmodifiableMapMixin),e(t.__SetBase_Object_SetMixin,t.SetMixin),e(t._CircularDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig,t.DataSourceDrillConfig),e(t._JoinDatasourceConfig_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t.DataSourceRowColumnConfig),e(t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig,t.DataSourceRowColumnConfig),e(t._TableDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceRowColumnConfig_DataSourceDrillConfig,t.DataSourceDrillConfig),e(t._BaseXYDatasourceConfigModel_BaseDatasourceConfigModel_DataSourceDrillConfig,t.DataSourceDrillConfig)}();var T={typeUniverse:{eC:new Map,tR:{},eT:{},tPV:{},sEA:[]},mangledGlobalNames:{int:"int",double:"double",num:"num",String:"String",bool:"bool",Null:"Null",List:"List"},mangledNames:{},types:["List<Field>(SCHEMA_NAME)","List<Join>(SCHEMA_NAME)","bool(Field)","@(@)","String(String)","String(QueryRequestDimension)","~(int)","String(@)","String(QueryRequestSort)","bool(QueryRequestDimension)","String(Field)","String(QueryRequestFilter)","DateTime(@)","String(SCHEMA_NAME)","List<String>(List<String>,QueryRequestMetric)","String(Match)","String(QueryRequestMetric)","QueryRequestDimension(@)","String(DIMENSION_OPTION)","QueryRequestFilter(@)","Map<String,@>(QueryRequestFilter)","bool(String)","int(Object?)","QueryRequestMetric(@)","SCHEMA_NAME(@)","QueryRequestSort(@)","DateTime()","Map<String,@>(QueryRequestMetric)","bool(Schema)","Map<String,@>(QueryRequestSort)","Map<String,@>(JoinDatasourceCondition)","~(Object?,Object?)","int(String?)","bool(Object?,Object?)","bool(QueryRequestSort)","~(@,@)","List<String>(List<String>,QueryRequestSort)","String(_PlainSqlColumn)","bool(DIMENSION_OPTION)","String(COMPARISON_OPERATOR)","String(AGGREGATION_TYPE)","Map<String,String>(Map<String,String>,QueryRequestDimension)","List<QueryRequestDimension>(List<QueryRequestDimension>,JoinDatasourceCondition)","int(int)","Map<String,@>(QueryRequestDimension)","VisualizationSchema(Schema)","bool(Join)","bool(@)","@(@,String)","RegExp()","DateTime(int,int,int,int,int,int,int,bool)","JoinDatasourceCondition(@)","Permission(@)","Map<String,@>(Permission)","VisualizationField(Field)","SCHEMA_NAME(Join)","Join(@)","QueryResponseColumn(QueryRequestDimension)","QueryResponseColumn(QueryRequestMetric)","_PlainSqlColumn(QueryRequestDimension)","_PlainSqlColumn(QueryRequestMetric)","_PlainSqlColumn(QueryRequestSort)","List<_PlainSqlColumn>(List<_PlainSqlColumn>,QueryRequestMetric)","Index(@)","QueryRequestFilter(Permission)","List<String>()","QueryRequestComparison(QueryRequestFilter)","bool(_DateFormatField)","String(String,Join)","bool(int,QueryRequestDimension)","String(int,QueryRequestDimension)","List<String>(int,List<String>,QueryRequestMetric)","Map<String,@>(Field)","Map<String,@>(Join)","@(String)","Map<String,@>(Index)","String(String,JoinCondition)","bool(String?)","QueryResponseRow(Map<String,@>)","Map<String,@>(QueryResponseColumn)","Map<String,@>(QueryResponseRow)","int(VisualizationField,VisualizationField)","Map<String,@>(VisualizationField)","JoinCondition(@)","bool(AGGREGATION_TYPE)","Map<String,@>(JoinCondition)","Map<String,@>(JoinLateralSort)","String(QueryRequestComparison)","String(TIME_FORMATTER)","String(FORMATTER_TYPE)","_DateFormatQuotedField(String,DateFormat)","~(String,@)","String(QueryRequest)","_DateFormatPatternField(String,DateFormat)","Map<String,String>(Map<String,String>,QueryRequestMetric)","List<QueryRequestDimension>(List<QueryRequestDimension>,QueryRequestDimension)","int(QueryRequestDimension,QueryRequestDimension)","JoinDatasourceConfig(JoinDatasourceConfig)","List<QueryRequestDimension>(List<QueryRequestDimension>,JoinDatasourceConfig)","_DateFormatLiteralField(String,DateFormat)","QueryRequest(JoinDatasourceConfig)","Map<String,@>(JoinDatasourceConfig)","JoinDatasourceConfig(Map<String,@>)","JoinDatasourceCondition(int,JoinDatasourceCondition)","QueryRequestDimension?(String)","JoinDatasourceCondition(Map<String,@>)","Map<String,@>?(QueryRequestDimension?)","Map<String,@>(Schema)","Map<String,@>(VisualizationSchema)","QueryRequest(@)","QueryResponse(int,QueryRequest)","Map<String,@>(QueryResponse)","List<QueryRequestMetric>(List<QueryRequestMetric>,QueryRequestMetric)","Map<String,@>(QueryRequest)","~(Symbol0,@)","Join(SCHEMA_NAME)","String(int,String)"],interceptorsByTag:null,leafTags:null,arrayRti:Symbol("$ti")};t._Universe_addRules(T.typeUniverse,JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","BufferModule":"LegacyJavaScriptObject","BufferConstants":"LegacyJavaScriptObject","Buffer":"LegacyJavaScriptObject","ConsoleModule":"LegacyJavaScriptObject","Console":"LegacyJavaScriptObject","EventEmitter":"LegacyJavaScriptObject","Promise":"LegacyJavaScriptObject","Date":"LegacyJavaScriptObject","JsError":"LegacyJavaScriptObject","Atomics":"LegacyJavaScriptObject","Modules":"LegacyJavaScriptObject","Module":"LegacyJavaScriptObject","Net":"LegacyJavaScriptObject","Socket":"LegacyJavaScriptObject","NetAddress":"LegacyJavaScriptObject","NetServer":"LegacyJavaScriptObject","NodeJsError":"LegacyJavaScriptObject","JsAssertionError":"LegacyJavaScriptObject","JsRangeError":"LegacyJavaScriptObject","JsReferenceError":"LegacyJavaScriptObject","JsSyntaxError":"LegacyJavaScriptObject","JsTypeError":"LegacyJavaScriptObject","JsSystemError":"LegacyJavaScriptObject","Process":"LegacyJavaScriptObject","CPUUsage":"LegacyJavaScriptObject","Release":"LegacyJavaScriptObject","StreamModule":"LegacyJavaScriptObject","Readable":"LegacyJavaScriptObject","Writable":"LegacyJavaScriptObject","Duplex":"LegacyJavaScriptObject","Transform":"LegacyJavaScriptObject","WritableOptions":"LegacyJavaScriptObject","ReadableOptions":"LegacyJavaScriptObject","Immediate":"LegacyJavaScriptObject","Timeout":"LegacyJavaScriptObject","TTY":"LegacyJavaScriptObject","TTYReadStream":"LegacyJavaScriptObject","TTYWriteStream":"LegacyJavaScriptObject","Util":"LegacyJavaScriptObject","Exports":"LegacyJavaScriptObject","_Exports":"LegacyJavaScriptObject","JSBool":{"bool":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSIndexable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSIndexable":["1"]},"JSNumber":{"double":[]},"JSInt":{"double":[],"int":[]},"JSNumNotInt":{"double":[]},"JSString":{"String":[],"JSIndexable":["@"]},"LateError":{"Error":[]},"CodeUnits":{"ListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"ListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2","ListIterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"UnmodifiableListBase":{"ListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"Symbol":{"Symbol0":[]},"ConstantMapView":{"Map":["1","2"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_ConstantMapKeyIterable":{"Iterable":["1"],"Iterable.E":"1"},"NullError":{"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"RuntimeError":{"Error":[]},"JsLinkedHashMap":{"MapMixin":["1","2"],"Map":["1","2"],"MapMixin.V":"2","MapMixin.K":"1"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"JSSyntaxRegExp":{"RegExp":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSIndexable":["1"]},"NativeTypedArrayOfInt":{"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"]},"NativeUint16List":{"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"],"ListMixin.E":"int"},"NativeUint32List":{"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"],"ListMixin.E":"int"},"NativeUint8List":{"ListMixin":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSIndexable":["int"],"ListMixin.E":"int"},"_Error":{"Error":[]},"_TypeError":{"Error":[]},"_SyncStarIterable":{"Iterable":["1"],"Iterable.E":"1"},"_LinkedIdentityHashMap":{"JsLinkedHashMap":["1","2"],"MapMixin":["1","2"],"Map":["1","2"],"MapMixin.V":"2","MapMixin.K":"1"},"_LinkedCustomHashMap":{"JsLinkedHashMap":["1","2"],"MapMixin":["1","2"],"Map":["1","2"],"MapMixin.V":"2","MapMixin.K":"1"},"_LinkedHashSet":{"SetMixin":["1"],"EfficientLengthIterable":["1"]},"IterableBase":{"Iterable":["1"]},"ListBase":{"ListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"]},"MapBase":{"MapMixin":["1","2"],"Map":["1","2"]},"MapMixin":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"Map":["1","2"]},"_SetBase":{"SetMixin":["1"],"EfficientLengthIterable":["1"]},"_JsonMap":{"MapMixin":["String","@"],"Map":["String","@"],"MapMixin.V":"@","MapMixin.K":"String"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"Iterable.E":"String","ListIterable.E":"String"},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"List":{"EfficientLengthIterable":["1"]},"RegExpMatch":{"Match":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"NullThrownError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"NoSuchMethodError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"CyclicInitializationError":{"Error":[]},"_GeneratorIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"_DateFormatLiteralField":{"_DateFormatField":[]},"_DateFormatQuotedField":{"_DateFormatField":[]},"_DateFormatPatternField":{"_DateFormatField":[]},"ArLyLocale":{"Locale":[]},"ArSaMaDzKwTnLocale":{"Locale":[]},"AzLocale":{"Locale":[]},"BnLocale":{"Locale":[]},"DeLocale":{"Locale":[]},"EnLocale":{"Locale":[]},"EsLocale":{"Locale":[]},"FaLocale":{"Locale":[]},"FrLocale":{"Locale":[]},"HiLocale":{"Locale":[]},"IdLocale":{"Locale":[]},"ItLocale":{"Locale":[]},"JaLocale":{"Locale":[]},"KoLocale":{"Locale":[]},"NbLocale":{"Locale":[]},"NlLocale":{"Locale":[]},"PlLocale":{"Locale":[]},"PtLocale":{"Locale":[]},"RuLocale":{"Locale":[]},"SvLocale":{"Locale":[]},"ThLocale":{"Locale":[]},"TrLocale":{"Locale":[]},"UkLocale":{"Locale":[]},"ZhCnLocale":{"Locale":[]},"ZhLocale":{"Locale":[]},"_NumericField":{"Field":[]},"_TimestampField":{"Field":[]},"_BoolField":{"Field":[]},"_StringField":{"Field":[]},"TZDateTime":{"DateTime":[]},"TypedDataBuffer":{"ListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"]},"_IntBuffer":{"TypedDataBuffer":["int"],"ListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"]},"Uint8Buffer":{"TypedDataBuffer":["int"],"ListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"ListMixin.E":"int"}}')),t._Universe_addErasedTypes(T.typeUniverse,JSON.parse('{"ArrayIterator":1,"EfficientLengthIterable":1,"ListIterator":1,"MappedIterator":2,"WhereIterator":1,"EmptyIterator":1,"FixedLengthListMixin":1,"UnmodifiableListMixin":1,"UnmodifiableListBase":1,"LinkedHashMapKeyIterator":1,"NativeTypedArray":1,"_SyncStarIterator":1,"StreamTransformerBase":2,"_LinkedHashSetIterator":1,"IterableBase":1,"ListBase":1,"MapBase":2,"_UnmodifiableMapMixin":2,"MapView":2,"UnmodifiableMapView":2,"_SetBase":1,"_ListBase_Object_ListMixin":1,"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":2,"__SetBase_Object_SetMixin":1,"Codec":2,"Converter":2,"Iterator":1,"Sink":1,"UninitializedLocaleData":1,"ReportWidgetModel":1}'));var A={x28_grosT:"(@grossTotal-IFNULL(@takeawayPrice,0))*IF(@isRefund, -1, 1)",x28_gros_:"(@gross_total-COALESCE(@takeaway_price,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEb:"(COALESCE(@bill_adjustment_total,0)+COALESCE(@item_adjustment_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEgx2bb:"(COALESCE(@gross_total,0)+COALESCE(@bill_adjustment_total,0)+COALESCE(@item_adjustment_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEgx2bd:"(COALESCE(@gross_total,0)+COALESCE(@delivery_fee_with_tax,0)+COALESCE(@other_charge_with_tax,0)+COALESCE(@discount_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEgx2d:"(COALESCE(@gross_total,0)-COALESCE(@takeaway_price,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEn_:"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-(case when @other_charge_with_tax>0 then 0 else COALESCE(@third_party_extra_charge,0) end)-(case when @delivery_fee_with_tax>0 then 0 else COALESCE(@delivery_fee,0) end)-COALESCE(@tax_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEnC:"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-COALESCE(@discount_total,0)-COALESCE(@third_party_extra_charge,0)-COALESCE(@delivery_fee,0)-COALESCE(@tax_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28COALEo:"(COALESCE(@other_charge_total,0)+COALESCE(@third_party_extra_charge,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",x28IFNULb:"(IFNULL(@billAdjustmentTotal,0)+IFNULL(@itemAdjustmentTotal,0))*IF(@isRefund, -1, 1)",x28IFNULgx2bb:"(IFNULL(@grossTotal,0)+IFNULL(@billAdjustmentTotal,0)+IFNULL(@itemAdjustmentTotal,0))*IF(@isRefund, -1, 1)",x28IFNULgx2bd:"(IFNULL(@grossTotal,0)+IFNULL(@deliveryFeeWithTax,0)+IFNULL(@otherChargeWithTax,0)+IFNULL(@discountTotal,0))*IF(@isRefund, -1, 1)",x28IFNULgx2d:"(IFNULL(@grossTotal,0)-IFNULL(@takeawayPrice,0))*IF(@isRefund, -1, 1)",x28IFNULn_:"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-(case when @otherChargeWithTax>0 then 0 else IFNULL(@thirdPartyExtraCharge,0) end)-(case when @deliveryFeeWithTax>0 then 0 else IFNULL(@deliveryFee,0) end)-IFNULL(@taxTotal,0)-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",x28IFNULnI:"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-IFNULL(@discountTotal,0)-IFNULL(@thirdPartyExtraCharge,0)-IFNULL(@deliveryFee,0)-IFNULL(@taxTotal,0)-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",x28IFNULo:"(IFNULL(@otherChargeTotal,0)+IFNULL(@thirdPartyExtraCharge,0))*IF(@isRefund, -1, 1)",x28case_:"(case when (@source='' or @source='POS') then 'FEEDME' else @source end)",x28selecS:`(select SUM(ROUND(
|
|
87
87
|
(case when EXTRACT(EPOCH FROM COALESCE(timesheets.ended_at,!end)-(timesheets.created_at))<86400
|