realgrid
Version:
RealGrid is a javascript data grid component with various powerful functions such as editing, row grouping, filtering, and sorting data on web environment.
7 lines (6 loc) • 1.67 MB
JavaScript
/**
* RealGrid v2.10.0.2073
* Copyright (C) 2013-2026 WooriTech Inc.
* All Rights Reserved.
*/
const e={name:"RealGrid2",version:"2.10.0.2073",license:"enterprise",code:null};class t{constructor(e=0,t=0,i=0,s=0){this.x=e,this.y=t,this.width=i,this.height=s}get left(){return this.x}set left(e){const t=e-this.x;this.x+=t,this.width-=t}get right(){return this.x+this.width}set right(e){const t=e-(this.x+this.width);this.width+=t}get top(){return this.y}set top(e){const t=e-this.y;this.y+=t,this.height-=t}get bottom(){return this.y+this.height}set bottom(e){const t=e-(this.y+this.height);this.height+=t}get isEmpty(){return 0===this.width||0===this.height}clone(){return new t(this.x,this.y,this.width,this.height)}leftBy(e){return this.x+=e,this.width-=e,this}topBy(e){return this.y+=e,this.height-=e,this}bottomBy(e){return this.height+=e,this}setEmpty(){return this.width=this.height=0,this}move(e=0,t=0){return this.x=e,this.y=t,this}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}setWidth(e){return this.width=e,this}copy(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}inflate(e=0,t=void 0,i=void 0,s=void 0){return t=void 0!==t?t:e,i=void 0!==i?i:e,s=void 0!==s?s:t,e&&(this.left=this.x-e),t&&(this.top=this.y-t),i&&(this.right=this.right+i),s&&(this.bottom=this.bottom+s),this}offset(e,t){return this.x+=e,this.y+=t,this}union(e){const t=this.clone();return t.left=Math.min(this.x,e.x),t.right=Math.max(this.right,e.right),t.top=Math.min(this.y,e.y),t.bottom=Math.max(this.bottom,e.bottom),t}toString(){return"{x: "+this.x+", y: "+this.y+", width: "+this.width+", height: "+this.height+"}"}}t.Temp=new t;const i="undefined"!=typeof window?window:{},{ua:s,platform:r}=(()=>{const e="undefined"!=typeof window&&window.navigator||{};return{ua:e.userAgent||"",platform:(e.platform||"").toUpperCase()}})(),n=r.indexOf("MAC")>=0,o=r.indexOf("WIN")>=0,l=!!i.chrome,a=void 0!==i.InstallTrigger,h=!!i.safari||!l&&s.indexOf("Safari")>=0,d=/iPad|iPhone|iPod/.test(s)&&!i.MSStream,c=!!s.match(/Trident.*rv\:11\./),u=-1!==s.indexOf("MSIE 10"),_=-1!==s.indexOf("MSIE 9"),g=c||u||_,m=Date.now();let p,f,w,C,y;function x(e){return e&&e.ownerDocument&&(e.ownerDocument.defaultView||e.ownerDocument.parentWindow)}function b(e){return e&&e.ownerDocument}function v(e){return e.defaultView||e.parentWindow}class I{static stopEvent(e,t=!1){e.preventDefault?(e.preventDefault(),e.stopPropagation()):e.returnValue=!1,t&&e.stopImmediatePropagation()}static setDebugging(e,t,i){I.$$_debugging=t,I.$$_keyLog=i}static isDebugging(){return I.$$_debugging}static setSlotMode(e){I.$$_slotMode=e}static setLanguage(e){I.$$_lang=e}static get language(){return this.$$_lang}static isSlotMode(){return I.$$_slotMode}static log(e,...t){I.isDebugging()&&console.log(e,t)}static keyLog(e,...t){I.$$_keyLog&&console.log(e,t)}static isArray(e){return Array.isArray(e)}static isObject(e){return null!=e&&"object"==typeof e}static makeArray(e,t=!1){return null!=e?Array.isArray(e)?e:[e]:t?[]:void 0}static isNumber(e){return"number"==typeof e}static getNumber(e,t){return isNaN(parseFloat(e))?t:parseFloat(e)}static getTimer(){return(new Date).getTime()-m}static isWhiteSpace(e){return!e||!e.trim()}static pad(e,t,i){return t=Math.max(t||2,1),i=i||"0",new Array(t-String(e).length+1).join(i)+e}static pick(...e){let t,i=e.length;for(let s=0;s<i;s++)if(t=e[s],null!=t)return t}static included(e,...t){let i=t.length;for(let s=0;s<i;s++)if(t[s]==e)return!0;return!1}static valueIn(e,t){if("object"==typeof t){const i=Object.keys(t);for(let s=0;s<i.length;s++)if(t[i[s]]===e)return!0}return!1}static compareTextValue(e,t,i,s){if(e===t)return!0;let r=String(e),n=null==t?void 0:String(t);return!r&&!n||!(!r||!n)&&(i||(r=r.toLowerCase(),n=n.toLowerCase()),s?n.indexOf(r)>=0:r==n)}static cast(e,t){return e instanceof t?e:null}static toInt(e,t){const i=parseInt(e,t||10);return isNaN(i)?0:i}static toFloat(e){const t=parseFloat(e);return isNaN(t)?0:t}static hex(e,t=2,i="0"){t=Math.max(t||2,1);const s=e.toString(16);return i=i||"0",new Array(t-s.length+1).join(i)+s}static deepCopy(e){if(null==e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e);const t=I.isArray(e)?[]:{};for(let i of Object.keys(e))e.hasOwnProperty(i)&&(t[i]=I.deepCopy(e[i]));return t}static extendObj(e,t){if(null==e||"object"!=typeof e||null==t||"object"!=typeof t)return t;for(let i of Object.keys(e))e.hasOwnProperty(i)&&void 0===t[i]&&(t[i]=e[i]);return t}static getBounds(e){const i=new t;return i.x=e.offsetLeft,i.y=e.offsetTop,i.width=e.offsetWidth,i.height=e.offsetHeight,i}static toStr(e){return"number"==typeof e?isNaN(e)?"":String(e):null!=e?String(e):""}static setBounds(e,t,i,s,r){const n=e.style;n.left=t+"px",n.top=i+"px",n.width=s+"px",n.height=r+"px"}static getClientRect(e){const i=e.getBoundingClientRect(),s=I.getZoom(e),r=new t(i.left/s,i.top/s,i.width/s,i.height/s);if("BODY"===e.tagName){const t=e.ownerDocument.defaultView;r.height=Math.max(r.height,e.scrollHeight,t.innerHeight),r.width=Math.max(r.width,e.scrollWidth,t.innerWidth)}return r.cx=e.offsetLeft,r.cy=e.offsetTop,r}static adjustZoom(e){let t=1,i=e;for(;i;){if(i.style.zoom){const e=getComputedStyle(i).zoom;if(isNaN(parseFloat(e))){t=1;break}t*=parseFloat(e)}i=i.parentElement}I.$$_zoom=100*t/100}static getZoom(e,t=!1){const i=e.offsetWidth||e.scrollWidth,s=e.offsetHeight||e.scrollHeight,r=e.getBoundingClientRect();let n=NaN;try{if(r.height&&r.width?n=(r.height/s+r.width/i)/2:r.height?n=r.height/s:r.width&&(n=r.width/i),isNaN(n)){const t=getComputedStyle(e).zoom;t&&(n=parseFloat(t))}if(isNaN(n))throw new Error("zomm check fail")}catch(e){n=1}return t&&I.adjustZoom(e),Math.round(100*n)/100}static getMargin(e){let t=0,i=0;if(e instanceof x(e).HTMLBodyElement){let s=e;for(;s;){const e=getComputedStyle(s);"static"===e.position&&(t+=parseFloat(e.marginLeft)||0,i+=parseFloat(e.marginTop)||0),s=s.parentElement}}return{x:t,y:i}}static getChildIndex(e){if(e){let t=e.parentNode;if(t){const i=t.children;for(let t=i.length;t--;)if(i[t]===e)return t}}return-1}static clearChildren(e){let t;for(;t=e.lastChild;)e.removeChild(t)}static clearElements(e){let t;for(;t=e.lastChild;)I.clearElements(t),e.removeChild(t)}static addChild(e,t){return!(!e||!t||t.parentNode===e)&&(e.appendChild(t),!0)}static removeChild(e,t){return!(!e||!t||t.parentNode!==e)&&(e.removeChild(t),!0)}static setTextContent(e,t){const i="string"==typeof t?t:null==t?"":String(t);e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE?e.firstChild.nodeValue=i:e[I.TextProp]=i}static disableSelection(e){const t=e.style;t["-moz-user-select"]="-moz-none",t["-khtml-user-select"]="none",t["-webkit-user-select"]="none",t["-o-user-select"]="none",t["-ms-user-select"]="none",t["user-select"]="none"}static setMobile(e){p=e}static setIECompatMode(e){y=e}static setTablet(e){w=e}static isMobile(){return void 0!==p?p:(void 0===f&&(f=this.$_checkMobile()),f)}static isIEMode(){return!I.isMobile()&&!I.isChromium&&y&&!1===navigator.msPointerEnabled}static isTablet(){return void 0!==w?w:(void 0===C&&(C=this.$_checkTablet()),C)}static $_checkTablet(){return I.isMobile()&&/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(s.toLowerCase())}static $_checkMobile(){let e=!1;return(s.match(/Android/i)||s.match(/webOS/i)||s.match(/iPhone/i)||s.match(/iPad/i)||s.match(/iPod/i)||s.match(/BlackBerry/i)||s.match(/Windows Phone/i))&&(e=!0),e||(e="ontouchstart"in window&&s.indexOf("Macintosh")>=0),e}static getBrowserSize(e){const t=e?e.ownerDocument:document,i=t.defaultView,s=t.body,r=t.documentElement,n=I.getZoom(s);return{width:i.innerWidth/n||r.clientWidth||s.clientWidth,height:i.innerHeight/n||r.clientHeight||s.clientHeight}}static move(e,t,i){e.style.left=t+"px",e.style.top=i+"px"}static htmlEncode(e){return document.createElement("a").appendChild(document.createTextNode(e)).parentNode.innerHTML}static detach(e){const t=e&&e.parentElement;if(t)try{t.contains(e)&&t.removeChild(e)}catch(e){}return null}static getSize(e){return I.getClientRect(e)}static getScrolled(e){const t=e.body,i=v(e),s=e.documentElement;return{sx:i.pageXOffset||s.scrollLeft||t.scrollLeft,sy:i.pageYOffset||s.scrollTop||t.scrollTop}}static getOffset(e){const t=I.getZoom(e),i=e.ownerDocument,s=i.defaultView,r=I.getClientRect(e),n=i.body,o=i.documentElement;let l=s.pageYOffset||o.scrollTop||n.scrollTop,a=s.pageXOffset||o.scrollLeft||n.scrollLeft;1==t&&t!=I.$$_zoom?(l/=I.$$_zoom,a/=I.$$_zoom):(l/=t,a/=t);const h=o.clientTop||n.clientTop||0,d=o.clientLeft||n.clientLeft||0,c=r.left+a-d,u=r.top+l-h;return{x:Math.round(c),y:Math.round(u)}}static isAncestorOf(e,t,i){let s;if(t instanceof HTMLElement)s=t;else{let e=this.getComposedPath(i);for(;e.length;){const t=e.shift();if(t instanceof HTMLElement){s=t;break}}}for(;s;){if(s==e)return!0;s=s.parentElement}return!1}static getComposedPath(e){if(e.composedPath)return e.composedPath();let t=e.target;const i=[];for(;t;)i.push(t),t=t.parentElement||t.parentNode;return i}static equalNumbers(e,t){return isNaN(e)&&isNaN(t)||!isNaN(e)&&e==t}static equalArrays(e,t){if(e===t)return!0;if(null==e||null==t)return!1;let i=e.length;if(i!=t.length)return!1;for(let s=0;s<i;++s)if(e[s]!==t[s])return!1;return!0}static equalObjects(e,t){return e==t||JSON.stringify(e)===JSON.stringify(t)}static isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}static incMonth(e,t){let i=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,I.month_days[I.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static incYear(e,t){let i=e.getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,I.month_days[I.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static setClassName(e,t){(t=t||"")!=e.className&&(e.className=t)}static addClassName(e,t){if(t=t||"",e.classList)e.classList.add(t);else{let i=e.className.split(" ");i.indexOf(t)<0&&i.push(t),e.className=i.join(" ")}}static removeClassName(e,t){if(e.classList)e.classList.remove(t);else{let i,s=e.className.split(" ");(i=s.indexOf(t))>=0&&s.splice(i,1),e.className=s.join(" ")}}static setStyle(e,t){const i=t.style;for(let t in e)null!=e[t]?i[t]=e[t]:(i.removeProperty?i.removeProperty(t):i.removeAttribute&&i.removeAttribute(t),i[t]="")}static getTextLength(e){let t=0,i=0;for(let s=0;e&&(i=e.charCodeAt(s));s++)t+=i>>7?2:1;return t}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static isEmpty(e){return e&&Object.keys(e).length>0}static isPassive(){if(null===I.$_supportPassive){I.$_supportPassive=!1;try{addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){I.$_supportPassive=!0}}))}catch(e){I.log("passive not support")}}return I.$_supportPassive}static hangulToChosungAll(e){let t="";for(let i=0;i<e.length;i++){const s=e.charCodeAt(i)-44032;t+=s>-1&&s<11172?I.cho[Math.floor(s/588)]:e[i]}return t}static hangulToChosung(e){const t={cho:e,org:e};if(/[ㄱ-힝]/.test(e)){const i=I.cho;let s=e.charCodeAt(0);s>=12593&&s<=12622&&(t.org=void 0),s-=44032,s>=0&&s<11172&&(t.cho=i[Math.floor(s/588)])}return t}static addQuot(e,t){return e&&(e.indexOf("\n")>=0||e.indexOf("\r\n")>=0||'"'==e.charAt(0))&&(e='"'+(e=e.replace(/\"/g,'""'))+'"'),e}static addQuatation(e,t,i,s){return null!=e&&((i||s)&&(i&&e&&(e=e.replace(/\n/g,i)),s&&e&&(e=e.replace(/\r/g,s))),(t||e.indexOf("\n")>=0||e.indexOf(",")>=0||e.indexOf('"')>=0)&&(e='"'+e.replace(/\"/g,'""')+'"')),null===e?"":e}static isClickableTemplate(e,t){return Array.prototype.some.call(e.querySelectorAll("input, textarea, a, select, button, [tabindex]"),(e=>t===e))}static isFocusableTemplate(e,t){return Array.prototype.some.call(e.querySelectorAll("input, textarea, select"),(function(e){const i=e.type;return e===t&&"button"!==i&&"checkbox"!==i}))}static objectToCssText(e){return"string"==typeof e?e:e?Object.keys(e).filter((e=>!/\d|length/.test(e))).map((t=>`${t.split(/(?=[A-Z])/).join("-").toLowerCase()}:${e[t]}`)).join(";"):null}static getLast(e){return e[e.length-1]}static camelToHyphen(e,t,i="-"){return e?t?e.split(/(?=[A-Z])/).join(i).toUpperCase():e.split(/(?=[A-Z])/).join(i).toLowerCase():e}static find(e,t){for(let i=0;i<e.length;i++)if(t.call(null,e[i],i,e))return e[i]}static isInteractive(e){const t=x(e);return e instanceof(null==t?void 0:t.HTMLInputElement)&&"checkbox"===e.type||e instanceof(null==t?void 0:t.HTMLAnchorElement)}static assign(e,...t){let i=Object(e);for(let e=0;e<t.length;e++){let s=t[e];if(null!=s)for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=s[e])}return i}static setInert(e,t){t?e.removeAttribute("inert"):e.setAttribute("inert","")}static insertBefore(e,t,i){if(t.nextElementSibling!==i)return e.insertBefore(t,i)}static ctrlKey(e){const t=I.isMac||I.isiOS;return e&&(t&&e.metaKey||!t&&e.ctrlKey)}static specialKey(e){return e&&(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)}static resetPosition(e,t,i,s,r,n,o,l){const a=b(i),h=x(i),d=I.getBrowserSize(),c=I.getSize(e),u=t?I.getSize(t):{left:0,top:0},_=I.getZoom(a.body);let g=d.width,m=d.height;const p=I.getSize(i);let f=h.pageXOffset||a.documentElement.scrollLeft,w=h.pageYOffset||a.documentElement.scrollTop;f/=_,w/=_,a.documentElement.scrollWidth>a.documentElement.clientWidth&&(m-=18),a.documentElement.scrollHeight>a.documentElement.clientHeight&&(g-=18);let{x:C,y:y}=I.getMargin(e);s+=C,r+=y,s+=u.left-c.left,r+=u.top-c.top,(I.ieTen||I.ieOld)&&(s+=a.documentElement.scrollLeft,r+=a.documentElement.scrollTop),r+p.height>m+w&&o&&(r=r-o.height-p.height)<0&&(r=m-p.height-2),I.isMobile()&&!I.isTablet()||!o||(c.bottom<o.bottom+p.height||m+w<o.bottom+p.height)&&(r=o.top-p.height-c.top-2),l?s=Math.max(0,s+n-p.width):s+p.width>g+f&&(s=g-p.width),I.isMobile()&&!I.isTablet()||i.offsetParent||(s+=a.documentElement.offsetLeft,r+=a.documentElement.offsetTop),I.move(i,Math.max(0,s),Math.max(0,r))}static setEvent(e,t){Object.keys(t).forEach((i=>{0===i.indexOf("on")&&(e[i]=t[i])}))}static assignConfig(e,t){t.columns&&e.setColumns(t.columns),t.layout&&e.setColumnLayout(t.layout),t.rowStyleCallback&&e.setRowStyleCallback(t.rowStyleCallback),t.cellStyleCallback&&e.setCellStyleCallback(t.cellStyleCallback),t.contextMenu&&e.setContextMenu(t.contextMenu)}static snapshotStyle(e){const t=["border-left","border-right","border-top","border-bottom","font-family","font-size","font-weight","font-style","text-decoration-line","text-decoration-style","color","background-image","background-color","text-align","vertical-align","white-space-collapse","white-space","text-wrap","text-wrap-mode"],i={};for(const s of t){const t=e.getPropertyValue(s);if(t){if("background-color"===s&&"rgba(0, 0, 0, 0)"===t)continue;i[s]=t}}return i}static cloneCssText(e){const t=document.createElement("div");return t.style.cssText=e,t.style}static getTextWrap(e,t){const i=t=>e.getPropertyValue?e.getPropertyValue(t):e[t];let s=e.textWrapMode||i("text-wrap-mode");return s=s||e.textWrap||i("text-wrap"),s=s||e.whiteSpace||i("white-space"),null==s&&null!=t?t:null!=s&&"nowrap"!=s&&"pre"!=s}}I.isIE=g,I.ieAll=g,I.ieOld=_,I.isMac=n,I.isWin=o,I.isSafari=h,I.isChrome=l,I.isFirefox=a,I.ieTen=u,I.ieNine=_,I.isiOS=d,I.isChromium=l,I.TextProp=I.ieAll?"innerText":"textContent",I.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],I.cho=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],I.colonreg=/;(?=(?:[^"]*"[^"]*")*(?![^"]*"))/,I.$_INVISIBLE_EDIT_BOUNDS=new t(-1e4,-1e4,100,100),I.$$_debugging=!1,I.$$_keyLog=!1,I.$$_slotMode=!1,I.$$_zoom=1,I.$_supportPassive=null;class E{static encode(e){let t,i,s,r,n,o,l,a="",h=0,d=E.CHARACTERS;for(e=E.utf8_encode(e);h<e.length;)t=e.charCodeAt(h++),i=e.charCodeAt(h++),s=e.charCodeAt(h++),r=t>>2,n=(3&t)<<4|i>>4,o=(15&i)<<2|s>>6,l=63&s,isNaN(i)?o=l=64:isNaN(s)&&(l=64),a=a+d.charAt(r)+d.charAt(n)+d.charAt(o)+d.charAt(l);return a}static decode(e){let t,i,s,r,n,o,l,a="",h=0,d=E.CHARACTERS;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<e.length;)r=d.indexOf(e.charAt(h++)),n=d.indexOf(e.charAt(h++)),o=d.indexOf(e.charAt(h++)),l=d.indexOf(e.charAt(h++)),t=r<<2|n>>4,i=(15&n)<<4|o>>2,s=(3&o)<<6|l,a+=String.fromCharCode(t),64!=o&&(a+=String.fromCharCode(i)),64!=l&&(a+=String.fromCharCode(s));return a=E.utf8_decode(a),a}static utf8_encode(e){e=e.replace(/\r\n/g,"\n");let t="";for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);s<128?t+=String.fromCharCode(s):s>127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}static utf8_decode(e){let t="",i=0,s=0,r=0,n=0,o=e.length;for(;i<o;)s=e.charCodeAt(i),s<128?(t+=String.fromCharCode(s),i++):s>191&&s<224?(r=e.charCodeAt(i+1),t+=String.fromCharCode((31&s)<<6|63&r),i+=2):(r=e.charCodeAt(i+1),n=e.charCodeAt(i+2),t+=String.fromCharCode((15&s)<<12|(63&r)<<6|63&n),i+=3);return t}}E.CHARACTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",E.btoa=function(e){const t=E.CHARACTERS;let i,s,r,n,o="",l=0,a=(e=String(e)).length%3;for(;l<e.length;){if((s=e.charCodeAt(l++))>255||(r=e.charCodeAt(l++))>255||(n=e.charCodeAt(l++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");i=s<<16|r<<8|n,o+=t.charAt(i>>18&63)+t.charAt(i>>12&63)+t.charAt(i>>6&63)+t.charAt(63&i)}return a?o.slice(0,a-3)+"===".substring(a):o};const S="$_hash",R="$_view",k="$_row",T="$_idx",D="$_foc",M="$_lev";var O,F,L,A,P,$,N;!function(e){e.TEXT="text",e.NUMBER="number",e.BOOLEAN="boolean",e.DATETIME="datetime",e.OBJECT="object",e.CHAR="char",e.UNUM="unum",e.INT="int",e.UINT="uint",e.DATE="date"}(O||(O={})),function(e){e.ASCENDING="ascending",e.DESCENDING="descending",e.NONE="none"}(F||(F={})),function(e){e.SENSITIVE="sensitive",e.INSENSITIVE="insensitive"}(L||(L={})),function(e){e.ROWS="rows",e.ITEMS="items"}(A||(A={})),function(e){e.AUTO="auto",e.EXPLICIT="explicit"}(P||(P={})),function(e){e.AUTO="auto",e.EXPLICIT="explicit"}($||($={})),function(e){e.NONE="none",e.HEADER="header",e.FOOTER="footer",e.SUMMARY="summary",e.BOTH="both"}(N||(N={}));const B=function(e){return e==N.BOTH||e==N.HEADER};var V,H;!function(e){e.ALWAYS="always",e.UPDATE="update",e.INSERT="insert"}(V||(V={})),function(e){e.ERROR="error",e.WARNING="warning",e.INFO="info",e.IGNORE="ignore"}(H||(H={}));const W={error:1,warning:2,info:3,ignore:4},G=function(e,t){return W[e]-W[t]};var U,z,Y,q,K,j,X,Z,J,Q,ee,te,ie,se,re,ne,oe,le,ae,he,de,ce,ue,_e,ge,me,pe,fe,we,Ce,ye;!function(e){e.NONE="none",e.AGGREGATE="aggregate",e.STATISTICAL="statistical"}(U||(U={})),function(e){e.NONE="none",e.LEFT_EDGE="leftEdge",e.RIGHT_EDGE="rightEdge",e.TOP_EDGE="topEdge",e.BOTTOM_EDGE="bottomEdge",e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e.CENTER="center"}(z||(z={})),function(e){e.NONE="none",e.HEAD="head",e.BODY="body",e.TAIL="tail"}(Y||(Y={})),function(e){e.NONE="none",e.EVEN="even",e.EVEN_FILL="evenFill",e.FILL="fill"}(q||(q={})),function(e){e.START="start",e.END="end",e.SELECT="select"}(K||(K={})),function(e){e.DATA="data",e.HEADER="header",e.FOOTER="footer",e.SUMMARY="summary",e.ROW_BAR="rowBar",e.INDICATOR="indicator",e.STATE="state",e.CHECK="check",e.HEAD="head",e.FOOT="foot",e.SUM="sum",e.FIXED_BAR="fixedbar",e.GROUP_HEADER="groupHeader",e.GROUP_FOOTER="groupFooter",e.GROUP_BAR="groupBar",e.GROUP_HEAD="groupHead",e.GROUP_FOOT="groupFoot",e.GROUP_PANEL="groupPanel",e.GROUP_COLUMN="groupColumn",e.GRID_EMPTY="gridEmpty",e.LAYOUT_HEADER="layoutHeader",e.FILTER="filter",e.INLINE_FILTER="inlineFilter",e.SCROLL_BAR="scrollBar",e.SCROLL_TRACK="scrollTrack",e.SCROLL_THUMB="scrollThumb",e.SCROLL_BUTTON="scrollButton",e.SCROLL_EDGE="scrollEdge"}(j||(j={})),function(e){e.NONE="none",e.ROW="row",e.DATA="data",e.FILL="fill",e.CELL="cell"}(X||(X={})),function(e){e.NORMAL="normal",e.UPPER="upper",e.LOWER="lower",e.DEFAULT="default"}(Z||(Z={})),function(e){e.NORMAL="normal",e.TODAY="today",e.TODAY_WHEN_NULL="todayWhenNull",e.DEFAULT="default",e.DEFAULT_WHEN_NULL="defaultWhenNull"}(J||(J={})),function(e){e.NONE="none",e.EXCLUSIVE="exclusive",e.INCLUSIVE="inclusive",e.REVERSE="reverse"}(Q||(Q={})),function(e){e.NORMAL="normal",e.CHECK="check",e.RADIO="radio",e.SEPARATOR="separator"}(ee||(ee={})),function(e){e.VISIBLE="visible",e.HOVERED="hovered",e.ALWAYS="always",e.HIDDEN="hidden",e.ACTIVE_OR_HOVERED="activeOrHovered"}(te||(te={})),function(e){e.NONE="none",e.ACTION="action",e.POPUP="popup"}(ie||(ie={})),function(e){e.ALWAYS="always",e.DEFAULT="default",e.VISIBLE="visible",e.HIDDEN="hidden",e.ROWFOCUSED="rowfocused"}(se||(se={})),function(e){e.LEFT="left",e.RIGHT="right",e.LEFT_EDGE="leftEdge",e.RIGHT_EDGE="rightEdge",e.TOP="top",e.BOTTOM="bottom",e.TOP_EDGE="topEdge",e.BOTTOM_EDGE="bottomEdge",e.CENTER="center"}(re||(re={})),function(e){e.ALL="all",e.VISIBLE_ONLY="visibleOnly",e.RECYCLE="recycle"}(ne||(ne={})),function(e){e.CANCEL="cancel",e.COMMIT="commit",e.DEFAULT="default"}(oe||(oe={})),function(e){e.ROW="row",e.GROUP="group",e.FOOTER="footer",e.TREE="tree"}(le||(le={})),function(e){e.COUNT="count",e.SUM="sum",e.MAX="max",e.MIN="min",e.AVG="avg",e.VAR="var",e.VARP="varp",e.STDEV="stdev",e.STDEVP="stdevp",e.DATACOUNT="datacount",e.DATAAVG="dataavg"}(ae||(ae={})),function(e){e.ALWAYS="always",e.DEFAULT="default",e.NONE="none"}(he||(he={})),function(e){e.ROW="row",e.GRID="grid",e.NONE="none"}(de||(de={})),function(e){e.LAYER="layer",e.LINE="line"}(ce||(ce={})),function(e){e.LEFT_TOP="leftTop",e.LEFT_BOTTOM="leftBottom",e.RIGHT_TOP="rightTop",e.RIGHT_BOTTOM="rightBottom"}(ue||(ue={})),function(e){e.EXPAND="expand",e.COLLAPSE="collapse",e.ALWAYS="always"}(_e||(_e={})),function(e){e.NONE="none",e.OVER="over",e.ALWAYS="always"}(ge||(ge={})),function(e){e.EQUAL="equal",e.NOT_EQUAL="notEqual",e.CONTAINS="contains",e.NOT_CONTAINS="notContains",e.STARTS_WITH="startsWith",e.ENDS_WITH="endsWith",e.RESET="reset",e.GREATER="greater",e.GREATER_EQUAL="greaterEqual",e.LOWER="lower",e.LOWER_EQUAL="lowerEqual",e.BETWEEN="between",e.EMPTY="empty"}(me||(me={})),function(e){e.TRIANGLE="triangle",e.SQUARE="square"}(pe||(pe={})),function(e){e.FIRST="first",e.LAST="last",e.DEFAULT="default"}(fe||(fe={})),function(e){e.EXPAND="expand",e.COLLAPSE="collapse",e.REMAIN_AND_EXPAND="remainAndExpand",e.REMAIN_AND_COLLAPSE="remainAndCollapse"}(we||(we={})),function(e){e.NONE="none",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second",e.AUTO="auto"}(Ce||(Ce={})),function(e){e.VERTICAL="vertical",e.HORIZONTAL="horizontal"}(ye||(ye={}));const xe=e=>I.included(e,j.DATA,j.ROW_BAR),be=e=>I.included(e,j.DATA,j.SUMMARY,j.HEADER,j.FOOTER,j.INLINE_FILTER,j.GROUP_HEADER),ve=e=>I.included(e,j.FOOTER,j.SUMMARY),Ie=e=>I.included(e,j.SUM,j.FOOT,j.HEAD,j.FILTER);var Ee;!function(e){e.NONE="none",e.CREATED="created",e.UPDATED="updated",e.DELETED="deleted",e.CREATE_AND_DELETED="createAndDeleted"}(Ee||(Ee={}));let Se=e=>e==Ee.DELETED||e==Ee.CREATE_AND_DELETED;class Re{constructor(e){this.format=e}get format(){return this._format}set format(e){e!=this._format&&(this._format=e,this.parse(e))}toBool(e){return!!this.toBoolStrict(e)}toBoolEx(e){const t=this._sensitive?e:e.toLowerCase(),i=this.$_toBool(e);return null!=i?i:t?Boolean(t):void 0}toBoolStrict(e){return this.$_toBool(e)}toText(e){return e?this._trueText:this._falseText}$_toBool(e){if(this._values){const t=this._sensitive?e:e.toLowerCase();if(t in this._values)return this._values[t]}}parse(e){if(this._values={},e){this._trueText=this._falseText=null;const t=e.split(/[;\:]/),i=this._sensitive="0"!=t[2],s=t[0]?i?t[0].split(","):t[0].toLowerCase().split(","):null,r=t[1]?i?t[1].split(","):t[1].toLowerCase().split(","):null;s&&s.forEach((e=>{this._values[e]=!1,this._falseText=this._falseText||e})),r&&r.forEach((e=>{this._values[e]=!0,this._trueText=this._trueText||e}))}else this._values[this._trueText="true"]=!0,this._values[this._falseText="false"]=!1}}Re.Default=new Re("false,f,0:true,t,1:0");class ke{constructor(e){this._format=null,this._baseYear=2e3,this._patterns=[],this._amText="AM",this._pmText="PM",this._matchPattern=!1,e&&(this.format=e)}get format(){return this._format}set format(e){if(e!=this._format){if(!e)throw new Error("Invalid empty date format");this._format=e,this.parseFormat(e)}}get baseYear(){return this._baseYear}set baseYear(e){e!=this._baseYear&&(this._baseYear=e)}get amText(){return this._amText}set amText(e){e!=this._amText&&(this._amText=e)}get pmText(){return this._pmText}set pmText(e){e!=this._pmText&&(this._pmText=e)}parse(e,t){try{let n=0,o=1,l=1,a=0,h=0,d=0,c=0,u=0,_=0,g=this._patterns.length,m=0;const p=e.length,f=this._matchPattern,w=this.getStrPattern(e);for(let C=0;C<g&&m<p;C++){var i=this._patterns[C],s=i.c,r=i.len;switch(s){case"y":n=parseInt(f?w[C]:e.substr(m,r));break;case"M":o=parseInt(f?w[C]:e.substr(m,r));break;case"d":l=parseInt(f?w[C]:e.substr(m,r));break;case"a":if(this._amText&&(f?w[C]===this._amText:e.indexOf(this._amText,m)==m))u=12,r=this._amText.length;else if(f?"am"===w[C].toLocaleLowerCase():"am"===e.substr(m,2).toLocaleLowerCase())u=12,r=2;else if(this._pmText&&(f?w[C]===this._pmText:e.indexOf(this._pmText,m)==m))_=12,r=this._pmText.length;else{if(f?"pm"!==w[C].toLocaleLowerCase():"pm"!==e.substr(m,2).toLocaleLowerCase()){if(t)throw"Invalid date value: "+e;return null}_=12,r=2}break;case"H":case"h":a=parseInt(f?w[C]:e.substr(m,r));break;case"m":h=parseInt(f?w[C]:e.substr(m,r));break;case"s":d=parseInt(f?w[C]:e.substr(m,r));break;case"S":c=parseInt(f?w[C]:e.substr(m,r));break;case".":case"/":case"-":case":":case" ":if(ke.DATE_SEPARATORS.indexOf(f?w[C]:e.charAt(m))<0){if(t)throw`Invalid date value: ${e}, invalid token[${f?w[C]:e.charAt(m)}]`;return null}break;default:if(t)throw`Invalid date value: ${e}, invalid pattern[${f?w[C]:e.charAt(m)}]`;return null}m+=r}n<100&&(n+=this._baseYear),u>0?12==a&&(a=0):_>0&&a<12&&(a+=12);const C=new Date(n,o-1,l,a,h,d,c);return C.getFullYear()===n&&C.getMonth()===o-1&&C.getDate()===l?C:null}catch(e){if(t)throw e;return null}}parseFormat(e){let t=0;const i=e=>{e&&!isNaN(parseInt(e))&&(this._baseYear=parseInt(e))},s=e=>{if(e){const t=e.split(",");t.length>0&&t[0]&&(this._amText=t[0]||this._amText),t.length>1&&t[1]&&(this._pmText=t[1]||this._pmText)}},r=e.split(";");if(r.length>2)i(r[1]),s(r[2]);else if(r.length>1){const e=r[1];isNaN(parseInt(e))?e&&s(e):i(e)}let n=r[0];const o=n.length;let l,a,h,d=0;for(this._patterns=[];d<o;)if(l=d,a=n.charAt(d),I.isWhiteSpace(a)){for(d++;d<o&&I.isWhiteSpace(n.charAt(d));)d++;this._patterns.push({c:" ",p:l,len:d-l}),t++}else{switch(h=0,a){case"y":h=this.getPattern(n,d,a),4!=h&&2!=h&&this.throwInvalidFormat(n);break;case"M":case"d":case"H":case"h":case"m":case"s":case"S":h=this.getPattern(n,d,a);break;case".":case"/":case"-":case":":t++;case"a":h=this.getPattern(n,d,a),1!=h&&this.throwInvalidFormat(n);break;default:this.throwInvalidFormat(n)}h>0&&(this._patterns.push({c:a,p:d,len:h}),d+=h)}this._matchPattern=2*t+1===this._patterns.length}throwInvalidFormat(e){throw new Error("Invalid date format: "+e)}throwInvalidValue(e){throw new Error("Invalid date format: "+e)}getPattern(e,t,i){for(var s=1;++t<e.length&&e.charAt(t)==i;)s++;return s}getStrPattern(e){const t=e.length;let i=0,s=0;const r=[];for(;t>i;){const n=e[i];if(/-|\.|\/|:| /.test(n))if(r.push(e.substr(s,i-s)),r.push(n),I.isWhiteSpace(n)){for(;I.isWhiteSpace(e[++i])&&t>i;);s=i}else s=i+1;i++}return r.push(e.substr(s,i-s)),r}}ke.DATE_SEPARATORS="./-: ";class Te{static initialize(){Te.Default.amText="AM",Te.Default.pmText="PM",Te.Default.baseYear=2e3}static getReader(e){let t=Te.Formatters[e];return t||(Te.Formatters[e]=t=new Te(e)),t}static getSimpleDateNull(e){if(e instanceof Date)return e;if("number"==typeof e)return new Date(e);if("string"!=typeof e)return null;const t=(e=8===e.length&&/^[0-9]*$/.test(e)?e.replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3"):e).split(/[.//-]/);if(3!=t.length)return null;const i=parseInt(t[0]),s=parseInt(t[1])-1,r=parseInt(t[2]);return i==(e=new Date(i,s,r)).getFullYear()&&s==e.getMonth()&&r==e.getDate()?e:null}constructor(e){this._format="",this._type=0,this._parser=new ke(null),this.format=e}get format(){return this._format}set format(e){e!=this._format&&(this._format=e,this.parse(e))}get amText(){return this._parser.amText}set amText(e){this._parser.amText=e}get pmText(){return this._parser.pmText}set pmText(e){this._parser.pmText=e}get baseYear(){return this._parser.baseYear}set baseYear(e){this._parser.baseYear=e}toDate(e,t){if(!e)return null;var i=null;switch(this._type){case 0:i=this._parser.parse(e,t);break;case 2:const s=parseInt(e);i=new Date(s);break;default:i=new Date(e)}return i&&!isNaN(i.getTime())?i:null}parse(e){if(e){if(e.indexOf("T")>0||e.indexOf("Z")>0||/([+\-])(\d\d)?(:)?(\d\d)?$/.test(e))this._type=Te.Formats.indexOf("iso");else{const t=e.toLowerCase();this._type=Math.max(0,Te.Formats.indexOf(t))}0==this._type&&(this._parser.format=e)}}}Te.Formats=["custom","iso","timestamp","platform"],Te.Default=new Te("yyyy/MM/dd HH:mm:ss"),Te.Formatters={},Te.initialize();let De=0;class Me{constructor(e){this.$_disposed=!1,e||(this.$_hash=De++)}dispose(){return this.$_disposed||this.$_disposing||(this.$_disposed=!0,this.$_disposing=!0,this._doDispose()),null}_doDispose(){}get disposing(){return this.$_disposing}isMe(e){return e==this.$_hash}$_getters(e){const t=[],i=Object.getOwnPropertyNames(e);for(let s=0,r=i.length;s<r;s++){const r=i[s],n=Object.getOwnPropertyDescriptor(e,r);n&&n.get&&t.push(r)}return t}doAssignSimple(e){return!1}assignFrom(e){let t=Object.getPrototypeOf(this);if(e instanceof Me){let i=Object.getPrototypeOf(e),s={};for(;i&&i.constructor!=Me;){let r=this.$_getters(i);for(let n=0,o=r.length;n<o;n++){const o=r[n];if(!(o in s)){s[o]=null;let r=Object.getOwnPropertyDescriptor(t,o);if(r){if(r.set){const t=Object.getOwnPropertyDescriptor(i,o).get;t&&r.set.call(this,t.call(e))}}else{let s=Object.getPrototypeOf(t);for(;s;){let t=Object.getOwnPropertyDescriptor(s,o);if(t){if(t.set){const s=Object.getOwnPropertyDescriptor(i,o).get;s&&t.set.call(this,s.call(e))}s=null}else s=Object.getPrototypeOf(s)}}}}i=Object.getPrototypeOf(i)}}else if(!this.doAssignSimple(e))for(let i in e){let s=Object.getOwnPropertyDescriptor(t,i);if(s)s.set&&s.set.call(this,e[i]);else{let s=Object.getPrototypeOf(t);for(;s;){let t=Object.getOwnPropertyDescriptor(s,i);t?(t.set&&t.set.call(this,e[i]),s=null):s=Object.getPrototypeOf(s)}}}}extend(e){for(let t in e)this.hasOwnProperty(t)&&(this[t]=e[t])}toProxy(e=!0){const t={};let i=Object.getPrototypeOf(this);const s=[];for(;i&&i.constructor!=Me;){let r=this.$_getters(i);for(let n=0,o=r.length;n<o;n++){const o=r[n];let l=Object.getOwnPropertyDescriptor(i,o);if(l){if(l.get&&l.set&&s.indexOf(o)<0){s.push(o);const i=l.get.call(this);(e||void 0!==i)&&(null!==i&&"object"==typeof i&&Object.getPrototypeOf(i).hasOwnProperty("toProxy")?t[o]=i.toProxy():t[o]=i)}}else{let r=Object.getPrototypeOf(i);for(;r;){let i=Object.getOwnPropertyDescriptor(r,o);if(i){if(i.get&&i.set&&s.indexOf(o)<0){s.push(o);const r=i.get.call(this);(e||void 0!==r)&&(t[o]=r)}r=null}else r=Object.getPrototypeOf(r)}}}i=Object.getPrototypeOf(i)}return t}}class Oe extends Error{constructor(e,t){super(e),this.message=e,this.tokenPos=t}}class Fe extends Error{constructor(e){super(e),this.message=e}}const Le=function(...e){let t=[];for(let i of e)t[i]=!0;return t},Ae=Le(26,27),Pe=Le(40,45,46,47,48,49,50,51,52,53,54,55,56,57,41,42,43,44),$e=Le(4,5,18,19),Ne=Le(11,3,2,14,15,16,17);class Be{constructor(){this.IS_IDENT=[],this.IS_INTEGER=[],this.IS_NUMBER=[],this.IS_WHITE=[],this.IS_END=[],this.QUOTATION='"'.charCodeAt(0),this.SQUOTATION="'".charCodeAt(0),this.BACKSLASH="\\".charCodeAt(0),this.Keywords={str:20,num:21,bool:23,not:13,len:24,and:11,in:12,mod:15,or:18,div:14,shl:16,shr:17,xor:19,trim:25,is:26,like:46,ilike:48,match:50,imatch:52,likehan:54,ilikehan:55,defined:35,null:34,empty:36,nan:37,datestr:90,year:91,month:92,day:93,hour:94,rounddown:95,timestamp:96},this._procs=null,this._source=null,this._len=0,this._tokenId=0,this._run=0,this._runAhead=0,this._nextRun=0,this._lineNo=0,this._linePos=0,this._tokenPos=0;for(let e=0;e<256;e++)this.IS_IDENT[e]=e=="_".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0),this.IS_INTEGER[e]=e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="a".charCodeAt(0)&&e<="f".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="F".charCodeAt(0),this.IS_NUMBER[e]=e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e==".".charCodeAt(0)||e=="e".charCodeAt(0)||e=="E".charCodeAt(0),this.IS_WHITE[e]=e>=1&&e<=9||11==e||e>=14&&e<=32,this.IS_END[e]=0==e;this.initProcs()}clear(){this._source=null}next(){let e=this._source.charCodeAt(this._run);this._tokenPos=this._run,e<256?this._procs[e].call(this):this.identProc()}unkownProc(){this._tokenId=0,this._run++}symbolProc(){this._tokenId=80,this._run++}commaProc(){this._tokenId=32,this._run++}crProc(){this._tokenId=33,10==this._source.charCodeAt(this._run+1)?this._run+=2:this._run++,this._lineNo++,this._linePos=this._run}lfProc(){this._tokenId=33,this._run++,this._lineNo++,this._linePos=this._run}equalProc(){this._tokenId=40,"="==this._source.charAt(++this._run)&&"="==this._source.charAt(++this._run)&&this._run++}notProc(){this._tokenId=13,"="==this._source.charAt(++this._run)&&(this._tokenId=45,"="==this._source.charAt(++this._run)&&this._run++)}greaterProc(){"="==this._source.charAt(this._run+1)?(this._tokenId=42,this._run+=2):(this._tokenId=41,this._run++)}lowerProc(){"="==this._source.charAt(this._run+1)?(this._tokenId=44,this._run+=2):">"==this._source.charAt(this._run+1)?(this._tokenId=45,this._run+=2):(this._tokenId=43,this._run++)}nextIdent(){let e=this._run;for(;e<this._len&&!this.IS_IDENT[this._source.charCodeAt(e)];)e++;let t=e;for(;e<this._len&&this.IS_IDENT[this._source.charCodeAt(e)];)e++;return e>t?(this._nextRun=e,this._source.substr(t,e-t).toLowerCase()):null}identProc(){let e=this._run;for(;this._run<this._len&&(this.IS_IDENT[this._source.charCodeAt(this._run)]||this._source.charCodeAt(this._run)>255);)this._run++;let t=this._source.substr(e,this._run-e).toLowerCase();if(this.Keywords.hasOwnProperty(t))switch(this._tokenId=this.Keywords[t],this._tokenId){case 13:if(t=this.nextIdent(),t)switch(t){case"like":this._tokenId=47,this._run=this._nextRun;break;case"ilike":this._tokenId=49,this._run=this._nextRun;break;case"match":this._tokenId=51,this._run=this._nextRun;break;case"imatch":this._tokenId=53,this._run=this._nextRun;break;case"likehan":this._tokenId=56,this._run=this._nextRun;break;case"ilikehan":this._tokenId=57,this._run=this._nextRun}break;case 26:t=this.nextIdent(),"not"==t&&(this._tokenId=27,this._run=this._nextRun)}else this._tokenId=10}integerProc(){for(this._tokenId=64,this._run++;this._run<this._len&&this.IS_INTEGER[this._source.charCodeAt(this._run)];)this._run++}numberProc(){for(this._tokenId=64,this._run++;this._run<this._len&&this.IS_NUMBER[this._source.charCodeAt(this._run)];){if("."==this._source.charAt(this._run)){if("."==this._source.charAt(this._run+1))break;this._tokenId=63}this._run++}}minusProc(){this._tokenId=4,this._run++}plusProc(){this._tokenId=5,this._run++}pointProc(){"."==this._source.charAt(this._run+1)?(this._tokenId=68,this._run+=2):(this._tokenId=65,this._run++)}roundOpenProc(){this._tokenId=66,this._run++}roundCloseProc(){this._tokenId=67,this._run++}slashProc(){this._tokenId=2,this._run++}spaceProc(){for(this._tokenId=71,this._run++;this._run<this._len&&this.IS_WHITE[this._source.charCodeAt(this._run)];)this._run++}bracketOpenProc(){this._tokenId=69,this._run++}bracketCloseProc(){this._tokenId=70,this._run++}starProc(){this._tokenId=3,this._run++}modProc(){this._tokenId=15,this._run++}stringProc(){this._tokenId=61;do{let e=this._source.charCodeAt(this._run);if(this.IS_END[e])throw new Oe("Untermintated string",e);e==this.BACKSLASH&&this._run++,this._run++}while(this._run<this._len&&this._source.charCodeAt(this._run)!=this.QUOTATION);this._run++}smallStringProc(){this._tokenId=61;do{let e=this._source.charCodeAt(this._run);if(this.IS_END[e])throw new Oe("Untermintated string",e);e==this.BACKSLASH&&this._run++,this._run++}while(this._run<this._len&&this._source.charCodeAt(this._run)!=this.SQUOTATION);this._run++}initProcs(){this._procs=[];for(let e=1;e<=255;e++)this._procs[e]=this.symbolProc;for(let e=1;e<=32;e++)this._procs[e]=this.spaceProc;this._procs[10]=this.lfProc,this._procs[13]=this.crProc,this._procs["$".charCodeAt(0)]=this.integerProc,this._procs[this.QUOTATION]=this.stringProc,this._procs[this.SQUOTATION]=this.smallStringProc;for(let e=0;e<=9;e++)this._procs["0".charCodeAt(0)+e]=this.numberProc;for(let e="A".charCodeAt(0);e<="Z".charCodeAt(0);e++)this._procs[e]=this.identProc;for(let e="a".charCodeAt(0);e<="z".charCodeAt(0);e++)this._procs[e]=this.identProc;this._procs["_".charCodeAt(0)]=this.identProc,this._procs["(".charCodeAt(0)]=this.roundOpenProc,this._procs[")".charCodeAt(0)]=this.roundCloseProc,this._procs["*".charCodeAt(0)]=this.starProc,this._procs["+".charCodeAt(0)]=this.plusProc,this._procs[",".charCodeAt(0)]=this.commaProc,this._procs["-".charCodeAt(0)]=this.minusProc,this._procs[".".charCodeAt(0)]=this.pointProc,this._procs["/".charCodeAt(0)]=this.slashProc,this._procs["%".charCodeAt(0)]=this.modProc,this._procs["<".charCodeAt(0)]=this.lowerProc,this._procs["=".charCodeAt(0)]=this.equalProc,this._procs[">".charCodeAt(0)]=this.greaterProc,this._procs["[".charCodeAt(0)]=this.bracketOpenProc,this._procs["]".charCodeAt(0)]=this.bracketCloseProc,this._procs["!".charCodeAt(0)]=this.notProc}get tokenId(){return this._tokenId}get tokenLoc(){return{x:this._tokenPos-this._linePos,y:this._lineNo}}get tokenLen(){return this._run-this._tokenPos}get token(){return this._source.substr(this._tokenPos,this.tokenLen)}get isSpace(){return 71==this._tokenId}init(e){this._source=e,this._len=e.length,this._lineNo=0,this._linePos=0,this._tokenPos=0,this._runAhead=this._run=0,this._tokenId=0}charAhread(){for(this._runAhead=this._run;this._runAhead<this._len&&this._source.charCodeAt(this._runAhead)>0&&this._source.charCodeAt(this._runAhead)<=32;)this._runAhead++;return this._source.charCodeAt(this._runAhead)}nextId(e){do{this.next()}while(this._run<this._len&&this._tokenId!=e);return null}nextNoSpace(){if(this._run<this._len)do{this.next()}while(this._run<this._len&&this.isSpace);return null}isFirstInLine(){if(0==this._tokenPos)return!0;let e,t=this._tokenPos;for(t--;t>0&&this.IS_WHITE[this._source.charCodeAt(t)];)t--;return 0==t||(e=this._source.charCodeAt(t),10==e||13==e)}}class Ve extends Me{constructor(){super()}isIdentifier(e){throw new Error("Token is not a valid Identifier: "+e)}evaluateIdentifier(e){throw new Error("Invalid identifier key: "+e)}evaluateIndexerI(e,t){throw new Error("Invalid identifier indexer: "+e)}evaluateIndexerS(e,t,i){throw new Error("Invalid identifier indexer: "+e)}}class He{constructor(){}get value(){}get asLiteral(){return null}prepareValue(){}getLiteral(){}isIdentifier(e){return!1}toString(){return String(this)}}class We extends He{}class Ge extends He{constructor(){super()}evaluate(e){}toString(){return""}}Ge.Default=new Ge;class Ue extends He{constructor(){super(),this._operator=0}evaluate(e){if(this._literal)return this._literal.value;if(!this._rightExpr)return this._leftExpr.evaluate(e);{let t=this._leftExpr.evaluate(e),i=this._rightExpr.evaluate(e);switch(this._operator){case 40:return t==i;case 45:return t!=i;case 41:return t>i;case 42:return t>=i;case 43:return t<i;case 44:return t<=i;case 46:return this.calcLike(t,i,!1);case 47:return!this.calcLike(t,i,!1);case 48:return this.calcLike(t,i,!0);case 49:return!this.calcLike(t,i,!0);case 54:return this.calcLikeHan(t,i,!1);case 56:return!this.calcLikeHan(t,i,!1);case 55:return this.calcLikeHan(t,i,!0);case 57:return!this.calcLikeHan(t,i,!0);case 50:return this.calcMatch(t,i,!1);case 51:return!this.calcMatch(t,i,!1);case 52:return this.calcMatch(t,i,!0);case 53:return!this.calcMatch(t,i,!0);default:throw new Fe("Unknown operator: "+this._operator)}}}toString(){let e="";if(this._literal)e=this._literal.toString();else if(this._rightExpr){let t,i=this._leftExpr.toString(),s=this._rightExpr.toString();switch(this._operator){case 40:t="=";break;case 45:t="<>";break;case 41:t=">";break;case 42:t=">=";break;case 43:t="<";break;case 44:t="<=";break;case 46:t="like";break;case 47:t="not like";break;case 48:t="ilike";break;case 49:t="not ilike";break;case 50:t="match";break;case 51:t="not match";break;case 52:t="imatch";break;case 53:t="not imatch";break;case 54:t="likeHan";break;case 56:t="not likehan";break;case 55:t="ilikeHan";break;case 57:t="not ilikehan";break;case 32:t=",";break;default:t="<<ERROR>>"}e="("+i+" "+t+" "+s+")"}else e=this._leftExpr.toString();return e}isIdentifier(e){return this._leftExpr&&!this._rightExpr&&this._leftExpr.isIdentifier(e)}prepareValue(){this._leftExpr.prepareValue(),null==this._rightExpr?this._literal=this._leftExpr.getLiteral():this._rightExpr.prepareValue()}getLiteral(){return this._literal}calcLike(e,t,i){let s=String(e),r=String(t);if(s&&r){i&&(s=s.toLowerCase(),r=r.toLowerCase());let e=r.length;if(e>1){const t="%"==r.charAt(0),i="%"==r.charAt(e-1);if(t&&i)return r=r.substr(1,e-2),s.indexOf(r,0)>=0;if(t){r=r.substr(1,e-1);const t=s.lastIndexOf(r);return t>=0&&t==s.length-r.length}return i?(r=r.substr(0,e-1),0==s.indexOf(r,0)):s==r}return"%"!=r&&s==r}return!1}calcLikeHan(e,t,i){if(e&&t){e=String(e);let s=(t=String(t)).length;const r="%"==t.charAt(0),n="%"==t.charAt(s-1);if(t=r&&n?t.substr(1,s-2):r?t.substr(1,s-1):n?t.substr(0,s-1):t,e.length<t.length)return;i&&(e=e.toLowerCase(),t=t.toLowerCase());const o=I.hangulToChosungAll(e),l=I.hangulToChosungAll(t);let a,h=-1;if(r&&n){for(;(h=o.indexOf(l,h+1))>=0;){for(let i=0;i<l.length&&i+h<o.length;i++){const s=I.hangulToChosung(e[i+h]),r=I.hangulToChosung(t[i]);if(r.org&&r.org!==s.org||!r.cho||r.cho!==s.cho){a=!1;break}a=!0}if(a)return!0}return!1}if(r){if(h=o.lastIndexOf(l),h>=0&&h===o.length-l.length){for(let i=0;i<l.length;i++){const s=I.hangulToChosung(e[h+i]),r=I.hangulToChosung(t[i]);if(r.org&&r.org!==s.org||!r.cho||r.cho!==s.cho){a=!1;break}a=!0}if(a)return!0}return!1}if(n){if(0===o.indexOf(l)){for(let i=0;i<l.length;i++){const s=I.hangulToChosung(e[i]),r=I.hangulToChosung(t[i]);if(r.org&&r.org!==s.org||!r.cho||r.cho!==s.cho){a=!1;break}a=!0}if(a)return!0}return!1}return e==t}return!1}calcMatch(e,t,i){return new RegExp(t,"m"+(i?"i":"")).test(e)}}class ze extends He{get value(){}get asLiteral(){return this}evaluate(e){}}class Ye extends ze{toString(){return"defined"}}class qe extends ze{toString(){return"empty"}}class Ke extends ze{get value(){return NaN}toString(){return"null"}}class je extends ze{toString(){return"NaN"}}class Xe extends Ue{constructor(e,t,i){super(),this._leftExpr=e,this._operator=t,this._isNot=27==t,this._value=-1,i instanceof Ye?this._value=Xe.DEFINED:i instanceof Ke?this._value=Xe.NULL:i instanceof qe?this._value=Xe.EMPTY:i instanceof je&&(this._value=Xe.NAN)}prepareValue(){this._leftExpr.prepareValue(),this._literal=this._leftExpr.getLiteral()}getLiteral(){return null}evaluate(e){let t,i=this._literal?this._literal.value:this._leftExpr.evaluate(e);switch(this._value){case Xe.DEFINED:t=void 0!==i;break;case Xe.NULL:t=null==i;break;case Xe.EMPTY:t=null==i||0==String(i).length;break;case Xe.NAN:t=null===i||isNaN(i);break;default:return}return this._isNot?!t:t}toString(){let e="<<ERROR>>";switch(this._value){case Xe.DEFINED:e="defined";break;case Xe.NULL:e="null";break;case Xe.EMPTY:e="empty";break;case Xe.NAN:e="NaN"}return"("+(this._isNot?"is not ":"is ")+e+")"}}Xe.DEFINED=0,Xe.NULL=1,Xe.EMPTY=2,Xe.NAN=3;class Ze extends We{constructor(e){super(),this._value=Number(e)}get value(){return this._value}get asLiteral(){return this}evaluate(e){return this._value}toString(){return String(this._value)}}class Je extends We{constructor(e){super(),this._value=parseInt(e)}get value(){return this._value}get asLiteral(){return this}evaluate(e){return this._value}toString(){return String(this._value)}}class Qe extends We{constructor(e){super(),this._value=e.substr(1,e.length-2);let t="",i=0,s=!1;for(;i<this._value.length;)"\\"!=this._value[i]||s?(s=!1,t+=this._value[i++]):(s=!0,i++);this._value=t}get value(){return this._value}get asLiteral(){return this}evaluate(e){return this._value}toString(){return"'"+this._value+"'"}}class et extends He{constructor(e){super(),this._idKey=-651212,this._literal=e}get identifier(){return this._literal}evaluate(e){return-651212==this._idKey&&(this._idKey=e.isIdentifier(this._literal)),e.evaluateIdentifier(this._idKey)}toString(){return this._literal}}class tt extends Ue{constructor(e,t,i){super(),this._idKey=-1490313,this._intIndex=NaN,this._strIndex=null,this._ident=e,this._indexer=t,this._capital=i}prepareValue(){let e=this._indexer.asLiteral;if(e||this._indexer instanceof Ue&&(this._indexer.prepareValue(),e=this._indexer.getLiteral()),e){const t=e.value;"string"==typeof t?this._strIndex=t:this._intIndex=parseInt(t),this._capital&&this._strIndex&&(this._strIndex=this._strIndex.toUpperCase())}}getLiteral(){return null}evaluate(e){if(-1490313==this._idKey&&(this._idKey=e.isIdentifier(this._ident)),this._strIndex)return e.evaluateIndexerS(this._idKey,this._strIndex,this._capital);if(isNaN(this._intIndex)){let t=this._indexer.evaluate(e);return"string"==typeof t?e.evaluateIndexerS(this._idKey,t,this._capital):e.evaluateIndexerI(this._idKey,t)}return e.evaluateIndexerI(this._idKey,this._intIndex)}toString(){return this._ident+"["+this._indexer.toString()+"]"}}class it extends He{constructor(e){super(),this._factor=e}prepareValue(){this._literal=this._factor.asLiteral,!this._literal&&this._factor instanceof He&&(this._factor.prepareValue(),this._literal=this._factor.getLiteral())}getLiteral(){return null}}class st extends it{constructor(e){super(e)}evaluate(e){const t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return t?t.length:0}toString(){return"(len "+this._factor+")"}}class rt extends it{constructor(e){super(e)}evaluate(e){const t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return t?t.trim():t}toString(){return"(trim "+this._factor+")"}}class nt extends it{constructor(e){super(e)}evaluate(e){return-(this._literal instanceof We?this._literal.value:this._factor.evaluate(e))}toString(){return"-"+this._factor}}class ot extends it{constructor(e){super(e)}evaluate(e){return this._literal instanceof We?this._literal.value:this._factor.evaluate(e)}toString(){return"+"+this._factor}}class lt extends it{constructor(e){super(e)}evaluate(e){return!(this._literal instanceof We?this._literal.value:this._factor.evaluate(e))}toString(){return"(not "+this._factor+")"}}class at extends it{constructor(e){super(e)}evaluate(e){let t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return Boolean(t)}toString(){return"(bool "+this._factor+")"}}class ht extends it{constructor(e){super(e)}evaluate(e){let t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return Number(t)}toString(){return"(num "+this._factor+")"}}class dt extends it{constructor(e){super(e)}evaluate(e){let t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return String(t)}toString(){return"(str "+this._factor+")"}}class ct extends it{constructor(e){super(e)}evaluate(e){let t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);if(t instanceof Date){const e=I.pad;t=e(t.getFullYear(),4)+e(t.getMonth()+1,2)+e(t.getDate(),2)}return String(t)}toString(){return"(datestr "+this._factor+")"}}class ut extends it{constructor(e){super(e)}evaluate(e){const t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return t instanceof Date?t.getFullYear():null}toString(){return"(year "+this._factor+")"}}class _t extends it{constructor(e){super(e)}evaluate(e){const t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return t instanceof Date?t.getMonth()+1:null}toString(){return"(month "+this._factor+")"}}class gt extends it{constructor(e){super(e)}evaluate(e){const t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return t instanceof Date?t.getDate():null}toString(){return"(day "+this._factor+")"}}class mt extends it{constructor(e){super(e)}evaluate(e){const t=this._literal instanceof We?this._literal.value:this._factor.evaluate(e);return t instanceof Date?t.getHours():null}toString(){return"(hour "+this._factor+")"}}class pt extends it{constructor(e){super(e)}evaluate(e){const t=this._factor,i=t.getLiteral();if(t.getLiteral())return i.value;if(t._rightExpr){const i=t._leftExpr.evaluate(e),s=t._rightExpr.evaluate(e);if(32===t._operator){let e=Math.pow(10,s);return Math.floor(i*e)/e}throw new Fe("Unknown operator: "+t._operator)}return t._leftExpr.evaluate(e)}toString(){return"(rounddown "+this._factor+")"}}class ft extends it{evaluate(e){const t=this._factor,i=t.getLiteral();if(i)return i.value;if(t._rightExpr){const i=t._leftExpr.evaluate(e),s=t._rightExpr.evaluate(e);if(null==i)return;if(!(i instanceof Date))throw new Fe("value not date: "+i);if(32===t._operator){let e=1;switch(s){case 4:e*=24;case 3:e*=60;case 2:e*=60;case 1:e*=1e3}return Math.floor(i.getTime()/e)*e}throw new Fe("Unknown operator: "+t._operator)}{const i=t._leftExpr.evaluate(e);if(null==i)return;if(!(i instanceof Date))throw new Fe("value not date: "+i);return i.getTime()}}toString(){return"(timestamp "+this._factor+")"}}class wt extends He{constructor(){super(),this._factors=[],this._operators=[],this._literal=null}addFactor(e){this._factors.push(e)}addOperator(e){this._operators.push(e)}isIdentifier(e){return 1==this._factors.length&&this._factors[0]instanceof et&&this._factors[0].identifier==e}prepareValue(){for(let e=0,t=this._factors.length;e<t;e++)this._factors[e].prepareValue();if(0==this._operators.length){let e=this._factors[0];this.