UNPKG

realgrid-touch

Version:

RealGrid-Touch is a data list component library for developing mobile web applications for business purposes.

7 lines (6 loc) 779 kB
/** * RealGrid-Touch v1.0.6 * Copyright (C) 2020-2024 WooriTech Inc. * All Rights Reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealTouch={})}(this,(function(t){"use strict";const e=/[;\:]/;class s{static getFormatter(t){let e=s.Formatters[t];return e||(s.Formatters[t]=e=new s(t)),e}constructor(t){this.$_parse(this._format=t)}get format(){return this._format}toStr(t){return!0===t?this._trueText:this._falseText}$_parse(t){if(this._falseText=this._trueText=null,t){const s=t.split(e);this._falseText=s[0],s.length>0&&(this._trueText=s[1])}}}s.Formatters={};const i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=Array.isArray,n=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t};class h{static setLogging(t=!0){this._logging=t}static log(...t){this._logging&&console.log.apply(console,t)}}h._logging=!1;class a{static setDebugging(t=!0){this._debugging=t}static debugging(){this._debugging}}a._debugging=!1;const l=new Error("Not Implemented."),d={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidFieldIndex:"잘못된 데이터필드 index입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",canNotModifyData:"읽기 전용 데이터를 변경할 수 없습니다.",canNotModifyDeleted:"삭제 상태 행을 변경할 수 없습니다: %1",requiredField:"반드시 값을 지정해야 하는 필드입니다: %1",invalidValueInDomain:"값이 필드 값 도메인에 포함되지 않습니다: %1",invalidValueInRange:"값이 필드 값 범위에 포함되지 않습니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",alreadyEditing:"이미 데이터 편집 중입니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",canNotHorzGrouping:"수평 모드일 때 그룹핑할 수 없습니다.",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireGroupingInfos:"하나 이상의 행 그룹핑 정보가 설정돼야 합니다.",canNotRowGrouping:"데이터링크 view에 대해 행그룹핑 할 수 없습니다. dataGroupBy()를 사용하세요.",canNotDataGrouping:"데이터링크 view가 아니면 데이터그룹핑할 수 없습니다. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"그룹핑 상태일 때 수평모드로 변경할 수 없습니다.",unknownLayoutType:"잘못된 layout 종류입니다: %1",layoutMustSet:"레이아웃 모델이 반드시 설정돼야 합니다.",unknownItemViewType:"잘못된 item view 종류입니다: %1",requireCommandName:"Command 이름이 지정돼야 합니다.",commandNameDuplicated:"이미 존재하는 command 이름입니다: %1",requireDataOrGroup:"데이터소스나 그룹 모델이 반드시 지정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존해하는 테이블모델입니다: %1",selectEditRowFirst:"수정하거나 삽입할 행을 먼저 선택하세요."},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidFieldIndex:"Invalid field index: %1",invalidRowIndex:"Invalid row index: %1",canNotModifyData:"Can not modify a readonly data.",canNotModifyDeleted:"Can not modify a deleted row: %1",requiredField:"Required field: %1",invalidValueInDomain:"The value is not int the domain: %1",invalidValueInRange:"The value is not int the range: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",alreadyEditing:"DataView is already editing.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",canNotHorzGrouping:"Can not row grouping in horz mode.",dataMustSet:"A data must be set first.",requireGroupingInfos:"At least one grouping info must be set.",canNotRowGrouping:"Can not row grouping by data link view. use dataGroupBy().",canNotDataGrouping:"Can not data grouping without data link view. rowGroupBy()를 사용하세요.",canNotHorzInGrouping:"Can not change to horz mode while grouping",unknownLayoutType:"Invalid layout: %1",layoutMustSet:"A layout model must be set.",unknownItemViewType:"Unknow item view type: %1",requireCommandName:"Command name must be supplied.",commandNameDuplicated:"Command name is already exists: %1",requireDataOrGroup:"A data or group view must be set.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1",selectEditRowFirst:"First select the row you want to edit or insert."}};let _="ko",c=d[_];const u=(t,e)=>{if(t&&i(e)&&(c=d[t]=e,"en"!==t)){const t=d.en;for(const e in t)c[e]=c[e]||t[e]}},g=void 0,p="①".charCodeAt(0),f="*".charCodeAt(0),w="%".charCodeAt(0),m=function(t){return t.fixed?t.size+"px":t.size+"%"},y=function(t){return t?t.fixed?t.size+"px":t.size+"%":""};function b(t){return t?{size:t.size,fixed:t.fixed}:null}function v(t,e){let s,i;if(null==t||Number.isNaN(t)){if(e)return null;i=0,s=!0}else if(!(s=!isNaN(i=+t))){const s=t.trim();if(s.charCodeAt(s.length-1)===w&&(i=1===s.length?NaN:parseFloat(s)),isNaN(i)){if(e)return null;P(c.invalidSizeValue,t)}}return{size:i,fixed:s}}function C(t,e){return t?t.fixed?t.size:t.size*e/100:NaN}function S(t,e){let s,i,r;if(null==t||Number.isNaN(t)){if(e)return null;r=0,s=!0}else if(!(s=!isNaN(r=+t))){const s=t.trim(),n=s.charCodeAt(s.length-1);if(n===w?r=1===s.length?NaN:parseFloat(s):n===f&&(r=1===s.length?1:parseFloat(s),i=!0),isNaN(r)){if(e)return null;P(c.invalidSizeValue,t)}}return{size:r,rated:i,fixed:s}}function R(t){return t&&!t.fixed?t.size:NaN}class V extends Error{static check(t){if(t instanceof V)return!0;throw t}}class E extends Error{}const x=function(t,e){if(!t)throw new E(e)},A=Object.freeze({width:0,height:0});const $=Object.freeze({left:0,right:0,top:0,bottom:0,horz:0,vert:0}),T=Object.freeze({left:0,right:0,top:0,bottom:0,borderLeft:0,borderRight:0,borderTop:0,borderBottom:0,horz:0,vert:0});var L;!function(t){t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right"}(L||(L={}));const k=(t,e)=>t.replace("%1",e),D=t=>{throw new Error(t)},P=(t,e)=>{throw new Error(k(t,e))},M=(new Date).getTime();Element.prototype.animate||(Element.prototype.animate=function(t){});const I=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,N=!!window.chrome&&!I,O=Object.prototype.toString.call(HTMLElement).indexOf("Constructor")>0||!N&&!I&&navigator.userAgent.indexOf("Safari")>=0;navigator.userAgent.toLocaleLowerCase().indexOf("samsungbrowser"),navigator.userAgent.toLocaleLowerCase().indexOf("miuibrowser");const F=/\r\n|\n/g,B=/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)(?=(?:[^\']*\'[^\']*\')*[^\']*$)/,H=/\t/g,W=/\t+/g,z=/"([^"]*(?="))"/,G=/'([^']*(?='))'/,U='"'.charCodeAt(0),j="'".charCodeAt(0);let Y=class t{static now(){return+new Date}static stopEvent(t,e=!1){t.preventDefault?(t.preventDefault(),t.stopPropagation()):t.returnValue=!1,e&&t.stopImmediatePropagation()}static getErrorStack(t){const e=t.stack;return e?e.split("\n").map((t=>t+"<br/>")):""}static getBaseClassName(t){return Object.getPrototypeOf(t.constructor).name}static isObject(t){return t&&"object"==typeof t&&!r(t)}static assign(t,e){this.isObject(e)&&Object.assign(t,e)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!r(t))return Object.assign({},t)}static checkArray(t){return r(t)?t:void 0}static makeArray(t,e=!1){return null!=t?r(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return r(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(r(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return r(t)?t:null!=t?[t]:null}static copyArray(t){return r(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static isValidNumber(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static getEnumValues(t){return Object.keys(t).map((e=>t[e]))}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-M}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=Math.max(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=Math.max(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static pickNum(...t){const e=t.length;for(let s=0;s<e;s++)if(!isNaN(t[s])&&null!==t[s])return t[s];return NaN}static included(t,...e){const s=e.length;for(let i=0;i<s;i++)if(e[i]==t)return!0;return!1}static compareTextValue(t,e,s,i){if(t===e)return!0;let r=String(t),n=null==e?void 0:String(e);return!r&&!n||!(!r||!n)&&(s||(r=r.toLowerCase(),n=n.toLowerCase()),i?n.indexOf(r)>=0:r==n)}static cast(t,e){return t instanceof e?t:null}static irandom(t,e){if(void 0!==e){const s=t>>0,i=e>>0;return Math.random()*(i-s)+s>>>0}{const e=t>>0;return Math.random()*e>>0}}static irandomExcept(t,e,s){if(0===t&&1===e&&isNaN(s))throw new Error("Invalid irandom2");for(;;){const i=this.irandom(e,s);if(i!==t)return i}}static brandom(){return Math.random()>.5}static srandom(t,e){let s="";const i=this.irandom(t,e);for(let t=0;t<i;t++)s+=String.fromCharCode(this.irandom(97,123));return s}static erandom(t){const e=Object.values(t);return e[this.irandom(e.length)]}static arandom(t){return t[Math.random()*t.length>>0]}static iarandom(e,s,i){const r=new Array;for(let t=e;t<s;t++)r.push(t);for(;r.length>i;)r.splice(t.irandom(r.length),1);return r}static alert(t){window.alert(t)}static toInt(t,e){const s=parseInt(t,e||10);return isNaN(s)?0:s}static toFloat(t){const e=parseFloat(t);return isNaN(e)?0:e}static toEven(t){return 1&t?t+1:t}static hex(t,e=2,s="0"){e=Math.max(e||2,1);const i=t.toString(16);return s=s||"0",new Array(e-i.length+1).join(s)+i}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static extend(t,e){t=t||{};for(let s in e)t[s]=e[s];return t}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static equalObjects(t,e){if(t===e)return!0;if(!t&&!e)return!0;if(!t||!e)return!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s]!==e[s])return!1;for(var s in e)if(e.hasOwnProperty(s)&&t[s]!==e[s])return!1;return!0}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static incMonth(e,s){const i=e.getDate();return e.setDate(1),e.setMonth(e.getMonth()+s),e.setDate(Math.min(i,t.month_days[t.isLeapYear(e.getFullYear())?1:0][e.getMonth()])),e}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static getTextLength2(t){let e=0,s=0,i=0;for(;i=t.charCodeAt(s++);e+=i>>7?2:1);return e}static getClassName(t){if(t&&t.constructor)return t.constructor.name||function(t){let e=t.toString();return e=e.substring("function ".length),e=e.substring(0,e.indexOf("(")),e}(t.constructor)}static isInteger(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static capitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)}static uncapitalize(t){if("string"!=typeof t)return"";const e=t.charAt(0);return e>="a"&&e<="z"?t:e.toLowerCase()+t.slice(1)}static labelize(t){if("string"!=typeof t)return"";const e=t.charAt(0);let s=(t=e>="A"&&e<="Z"?t:e.toUpperCase()+t.slice(1)).charAt(0);for(let e=1;e<t.length;e++){const i=t.charAt(e);i>="A"&&i<="Z"&&(s+=" "),s+=i}return s}static deepClone(e){if(e instanceof Date)return new Date(e);if(null==e||"object"!=typeof e)return e;{const s=r(e)?[]:{};for(let i of Object.keys(e))s[i]=t.deepClone(e[i]);return s}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static hasSetter(t,e){for(;t;){const s=Reflect.getOwnPropertyDescriptor(t,e);if(s)return s.writable||!!s.set;t=Object.getPrototypeOf(t)}return!1}static dataUriToBinary(t){const e=";base64,",s=t.indexOf(e)+e.length,i=t.substring(s),r=window.atob(i),n=r.length,o=new Uint8Array(new ArrayBuffer(n));for(let t=0;t<n;t++)o[t]=r.charCodeAt(t);return o}static assignProps(t,e){let s=!1;if(e)for(let i in e)e[i]!==t[i]&&(t[i]=e[i],s=!0);return s}static assignStyleAndProps(t,e){let s=!1;if(e)for(let i in e)("style"===i||t.hasOwnProperty(i))&&(t[i]=e[i],s=!0);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static isUnique(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)if(t[s]===t[s-1])return!1;return!0}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),console.log(t,+new Date-s+"ms")}static clamp(t,e,s){return isNaN(s)||(t=Math.min(t,s)),isNaN(e)||(t=Math.max(t,e)),t}static splice(t,e,s,i){const r=[e,s].concat(i);Array.prototype.splice.apply(t,r)}static makeIntArray(t,e){const s=new Array(Math.max(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static setInterval(t,e){return setInterval(t,e)}static clearInterval(t){clearInterval(t)}static isStringArray(t){return r(t)&&t.every((t=>"string"==typeof t))}static isNumberArray(t){return r(t)&&t.every((t=>"number"==typeof t))}static makeLineSeparator(t){if(r(t)){if(t.length>0){let e=t[0];for(let s=1,i=t.length;s<i;s++)e+="|"+t[s];return new RegExp(e,"g")}}else if(t)return new RegExp(t,"g")}static stripQuotes(t){const e=t.charCodeAt(0);return e===U?t=t.replace(z,"$1"):e===j&&(t=t.replace(G,"$1")),t}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static watch(){return new q}};Y.week_days=["일","월","화","수","목","금","토"],Y.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]];class q{constructor(){this._started=+new Date}elapsed(t=!1){const e=+new Date-this._started;return t&&(this._started=+new Date),e}elapsedText(t=!1,e="ms."){return this.elapsed(t)+e}}const Z=["yy","yyyy","M","MM","d","dd","a","H","HH","h","hh","m","mm","s","ss","S","SS","SSS"],Q=[".","/","-",":"],X="Z".charCodeAt(0),K="z".charCodeAt(0),J="A".charCodeAt(0),tt="a".charCodeAt(0),et="y".charCodeAt(0),st="M".charCodeAt(0),it="m".charCodeAt(0),rt="d".charCodeAt(0),nt="H".charCodeAt(0),ot="h".charCodeAt(0),ht="S".charCodeAt(0),at="s".charCodeAt(0),lt=function(t){return t<10?"0"+t:String(t)},dt=function(t){return t<10?"00"+t:t<100?"0":String(t)};class _t{static getFormatter(t){let e=_t.Formatters[t];return e||(_t.Formatters[t]=e=new _t(t)),e}static get Default(){return _t.getFormatter(c.dateFormat)}constructor(t){this._baseYear=2e3,this._preserveTime=!1,this._hasAmPm=!1,this._formatString="",this.formatString=t}get format(){return this._format}get formatString(){return this._formatString}set formatString(t){(t=t||c.dateFormat)!=this._formatString&&(this._tokens=[],this.parse(t),this._formatString=t)}toStr(t){if(!this._tokens)return"";const e=this._tokens;let s="";for(var i=0,r=e.length;i<r;i++){var n=e[i],o=n.length;switch(n.charCodeAt(0)){case et:s+=o>2?t.getFullYear():lt(t.getFullYear()%100);break;case st:s+=o>1?lt(t.getMonth()+1):t.getMonth()+1;break;case rt:s+=o>1?lt(t.getDate()):t.getDate();break;case nt:s+=o>1?lt(t.getHours()):t.getHours();break;case ot:if(this._hasAmPm){let e=t.getHours();0==e?e=12:e>12&&(e-=12),s+=o>1?lt(e):e}else s+=o>1?lt(t.getHours()):t.getHours();break;case it:s+=o>1?lt(t.getMinutes()):t.getMinutes();break;case at:s+=o>1?lt(t.getSeconds()):t.getSeconds();break;case tt:case J:t.getHours()<12?s+=c.am:s+=c.pm;break;case ht:let e=t.getMilliseconds();s+=3==o?dt(e):2==o?lt(e):e.toString().substr(0,o);break;default:s+=n}}return s}parseDateFormatTokens(t){var e=[];if(t){const s=t.trim(),i=s.length;let r=0;for(;r<i;){let n=s.charAt(r);if(Q.indexOf(n)>=0)e.push(n),r++;else{let o=r++;for(;r<i&&s.charAt(r)==n;)r++;if(n=s.substring(o,r),Z.indexOf(n)<0){let e=n.charCodeAt(0);(e>=J&&e<=X||e>=tt&&e<=K)&&P(c.invalidDateFormat,t)}e.push(n)}if(r<i&&Y.isWhiteSpace(n=s.charAt(r)))for(e.push(n);r<i&&Y.isWhiteSpace(s.charAt(r));)r++}}return e}parse(t){t&&(this._format=t||c.dateFormat,this._tokens=this.parseDateFormatTokens(this._format),this._hasAmPm=this._tokens.indexOf("a")>=0||this._tokens.indexOf("A")>=0)}}_t.Formatters={};let ct=0;class ut{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(ct++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroyed=!0,this.$_destroying=!0,this._doDestory()),null}_doDestory(){}get destroying(){return this.$_destroying}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}_doAssignProps(t){return!1}assignProps(t){if(!0===this._doAssignProps(t))return this;if(t){const e=Object.getPrototypeOf(this);for(let s in t){const i=t[s];let r=Object.getOwnPropertyDescriptor(e,s);if(r){if(r.set)r.set.call(this,i);else if(r.get){const t=r.get.call(this);t instanceof ut&&t.assignProps(i)}}else{let t=Object.getPrototypeOf(e);for(;t;){let e=Object.getOwnPropertyDescriptor(t,s);if(e){if(e.set)e.set.call(this,i);else if(e.get){const t=e.get.call(this);t instanceof ut&&t.assignProps(i)}break}t=Object.getPrototypeOf(t)}}}}return this}assignObject(t,e){if(!0!==this._doAssignProps(t)&&i(t))if(Array.isArray(e)&&e.length>0){const s=Object.assign({},t);e.forEach((t=>delete s[t])),Object.assign(this,s)}else Object.assign(this,t);return this}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class gt extends ut{wrapper(){return this._wrapper}wrapperOrThis(){return this._wrapper||this}createWrapper(t){const e=this._wrapper=new t;return e.$_c=this,e}setWrapper(t){return this._wrapper=t,t.$_c=this,t}isWrapper(t){return t===this._wrapper}}class pt extends ut{_doDestory(){this.$_c=null}}class ft extends ut{constructor(){super(...arguments),this._listeners=[]}addListener(t){t&&this._listeners.indexOf(t)<0&&this._listeners.push(t)}removeListener(t){const e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}_fireEvent(t,...e){const s=Array.prototype.slice.call(arguments,0);s[0]=this;for(const e of this._listeners){const i=e[t];if(i){const t=i.apply(e,s);if(void 0!==t)return t}}}}const wt="0".charCodeAt(0),mt="#".charCodeAt(0),yt=",".charCodeAt(0),bt="s".charCodeAt(0),vt="a".charCodeAt(0);class Ct{static getFormatter(t){let e=Ct.Formatters[t];return e||(Ct.Formatters[t]=e=new Ct(t)),e}static get Default(){return Ct.getFormatter(Ct.DEFAULT_FORMAT)}constructor(t){t=t.trim(),this._options=t?this.$_parse(this._format=t):{useGrouping:!1}}get format(){return this._format}toStr(t){return t.toLocaleString(void 0,this._options)}$_parse(t){const e=t.length;if(e>0){const s={useGrouping:!1,minimumIntegerDigits:0,minimumFractionDigits:0,maximumFractionDigits:0};let i=t.indexOf(".");if(i>=0){let r=i+1;for(;r<e&&t.charCodeAt(r)===wt;)s.minimumFractionDigits++,r++;for(s.maximumFractionDigits=s.minimumFractionDigits;r<e&&t.charCodeAt(r)===mt;)s.maximumFractionDigits++,r++;i-=1}else i=e-1;let r=i;for(;r>=0&&t.charCodeAt(r)===wt;)s.minimumIntegerDigits++,r--;for(;r>=0;){if(t.charCodeAt(r--)===yt){s.useGrouping=!0;break}}for(r=i;r>=0;){if(t.charCodeAt(r--)===bt){s.signDisplay="always";break}}if(!s.signDisplay)for(r=i;r>=0;){if(t.charCodeAt(r--)===vt){s.signDisplay="never";break}}return s.minimumIntegerDigits=Math.max(1,s.minimumIntegerDigits),s}}}Ct.DEFAULT_FORMAT="",Ct.Formatters={};const St=/(.*)/,Rt=new RegExp(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))');class Vt{static getFormatter(t){let e=Vt.Formatters[t];return e||(Vt.Formatters[t]=e=new Vt(t)),e}constructor(t){this._pattern=St,this._replace="$1",this.$_parse(this._format=t)}get format(){return this._format}toStr(t){return t&&t.replace(this._pattern,this._replace)}$_parse(t){if(t){const e=t.trim().split(Rt);if(e.length>1){let t=e[0].trim(),s=e[1].trim();t&&s&&('"'==t.charAt(0)&&(t=t.substr(1,t.length-2)),t&&('"'==s.charAt(0)&&(s=t.substr(1,s.length-2)),s&&(this._pattern=new RegExp(t,e[2]||""),this._replace=s)))}}}}Vt.Formatters={};const Et="_rnd_",xt="_fld_",At="_row_",$t="_idx_",Tt="_url_",Lt="_width_",kt="_height_",Dt="_name_",Pt="_sts_",Mt="_sts_",It="_value_",Nt="_span",Ot="_img",Ft="_btn",Bt="_box",Ht="_group",Wt="_bar",zt="_shape",Gt="_svg",Ut="_clkable",jt="hgrow",Yt="vgrow",qt=/(\$|%)\{[^(\$|%)\{\}\;\|]+[\;\|]*[\w\s\-#@,\.\:가-힇ㄱ-ㅎㅏ-ㅣぁ-ゔァ-ヴー々〆〤一-龥]*[\;\|]*[\w\s\-#@,\.\:가-힇ㄱ-ㅎㅏ-ㅣぁ-ゔァ-ヴー々〆〤一-龥]*\}/g,Zt="@".charCodeAt(0);class Qt{static create(t,e,s){return new Qt(void 0,t,e,s)}constructor(t,e,s,i){this.source=t,this.stock=e.charCodeAt(0)===Zt,this.default=s,this.format=i;const r=(e=this.stock?e.substring(1):e).indexOf(".");r>=0?(this.field=e.substring(r+1),this.name=e.substring(0,r)):this.name=e}}class Xt{static parse(t){if("string"==typeof t){const e=t.match(qt);if(e)return new Xt(t,e)}return t}static load(t){const e={};for(const s in t){const i=t[s];e[s]="string"==typeof i?Xt.parse(i):i}return e}constructor(t,e){function s(t,e){let s=t.indexOf("|",e),i=t.indexOf(";",e);return s>=0&&i>=0?Math.min(s,i):s>=0?s:i}this._params=[],this._args={context:void 0,field:void 0};const i=this._params;let r=0;for(let n of e){const e=t.indexOf(n,r),o=n.substring(2,n.length-1),h=s(o);let a;if(e>r&&(i.push(t.substring(r,e)),r=e),h>=0){const t=o.substring(0,h),e=s(o,h+1);let i,r;e>=0?(i=o.substring(h+1,e),r=o.substring(e+1)):i=o.substring(h+1),a=new Qt(n,t,i,r)}else a=new Qt(n,o,void 0,void 0);i.push(a),r+=n.length}r<t.length&&i.push(t.substring(r))}get count(){return this._params.length}get(t){return this._params[t]}inflate(t,e,s,i){const r=this._args,n=this._params;let o="";r.context=t,r.field=s;for(let t=0,h=n.length;t<h;t++){const a=n[t];if(a instanceof Qt){let t;if(i.inflateParam)if(a.stock){if(t=i.inflateStock(e,s,a),a.format){const e=typeof t;if(("number"===e||"bigint"===e)&&!Number.isNaN(t)){const e=Ct.getFormatter(a.format);e&&(t=e.toStr(t))}}}else t=i.inflateParam(e,s,a);else t=i[a.name],"function"==typeof t&&(t=t(r));if(1===h)return null!=t?t:a.default;o+=null!=t?t:a.default||""}else o+=a}return o}}var Kt,Jt,te,ee,se;t.RtRowType=void 0,(Kt=t.RtRowType||(t.RtRowType={})).NORMAL="normal",Kt.TABLE="table",t.RtOrientation=void 0,(Jt=t.RtOrientation||(t.RtOrientation={})).HORIZONTAL="horizontal",Jt.VERTICAL="vertical",function(t){t.PORTRAIT="portrait",t.LANDSCAPE="landscape"}(te||(te={})),t.RtItemsAlign=void 0,(ee=t.RtItemsAlign||(t.RtItemsAlign={})).START="start",ee.CENTER="center",ee.END="end",t.RtHorizontalAlign=void 0,(se=t.RtHorizontalAlign||(t.RtHorizontalAlign={})).LEFT="left",se.CENTER="center",se.RIGHT="right";const ie={left:"flex-start",center:"center",right:"flex-end","":""};var re;t.RtVerticalAlign=void 0,(re=t.RtVerticalAlign||(t.RtVerticalAlign={})).TOP="top",re.MIDDLE="middle",re.BOTTOM="bottom";const ne={top:"flex-start",middle:"center",bottom:"flex-end","":""};var oe,he,ae;!function(t){t.DEFAULT="default",t.ROW="row",t.PIXEL="pixel"}(oe||(oe={})),t.RtItemsArrange=void 0,(he=t.RtItemsArrange||(t.RtItemsArrange={})).START="start",he.END="end",he.CENTER="center",he.SPACE_BETWEEN="spaceBetween",he.SPACE_AROUND="spaceAround";class le extends ut{constructor(t){super(),this._icons={},i(t)&&(this._width=+t.width,this._height=+t.height,this._root=t.root,Object.assign(this._icons,t.icons))}get width(){return this._width}get height(){return this._height}getUrl(t){let e=this._icons[t];if(e)return this._root&&(e=this._root+e),e}get(t){return this._icons[t]}set(t,e){this._icons[t]=e}}t.RtSortDirection=void 0,(ae=t.RtSortDirection||(t.RtSortDirection={})).ASCENDING="ascending",ae.DESCENDING="descending";const de=function(t,e){return void 0===t?e:t},_e=function(t,e,s){return void 0===t?void 0===e?s:e:t},ce=function(t,e){return t=parseFloat(t),isNaN(t)?e:t},ue=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t},ge=function(t,e,s){return isNaN(t)?isNaN(e)?s:e:t},pe=function(t){return t+"px"},fe=function(t){return isNaN(t)?t:t+"px"},we=function(t){return t+"%"},me="0px",ye="가나다라마바사아자차카타파하힣";class be{}var ve,Ce;t.RtMode=void 0,(ve=t.RtMode||(t.RtMode={})).DEFAULT="default",ve.CARD="card",t.RtRenderMode=void 0,(Ce=t.RtRenderMode||(t.RtRenderMode={})).DEFAULT="default",Ce.PRE="pre",Ce.FULL="full";const Se={},Re={},Ve={},Ee=function(t){let e=Se[t];if(e)return e;if(t){const s=Vt.getFormatter(t);return Se[t]=e=t=>s.toStr(t),e}return null},xe=function(t){let e=Re[t];if(e)return e;if(t){const i=s.getFormatter(t);return Re[t]=e=t=>i.toStr(t),e}return null},Ae=function(t){let e=Ve[t];if(e)return e;if(t){const s=Ct.getFormatter(t);return Ve[t]=e=t=>s.toStr(t),e}return null},$e=function(t){let e=Ve[t];if(e)return e;if(t){const s=_t.getFormatter(t);return e=t=>s.toStr(t),e}return null};var Te,Le,ke,De,Pe,Me,Ie,Ne,Oe,Fe,Be;t.RtRowClickAction=void 0,(Te=t.RtRowClickAction||(t.RtRowClickAction={})).NONE="none",Te.CHECK="check",Te.COMMAND="command",Te.EXPAND="expand",Te.DETAIL="detail",Te.DETAILEX="detailex",Te.INFO="info",Te.EDIT="edit",Te.LINK="link",Te.SELECT="select",Te.MOVE="move",Te.MENU="menu",t.RtOverScrollEffect=void 0,(Le=t.RtOverScrollEffect||(t.RtOverScrollEffect={})).NONE="none",Le.BALLOON="balloon",t.RtRowSwipeAction=void 0,(ke=t.RtRowSwipeAction||(t.RtRowSwipeAction={})).NONE="none",ke.COMMAND="command",ke.PAGE="page",ke.TAP="tap",ke.INFO="info",ke.EDIT="edit",ke.ROW_BAR="rowBar",ke.ACTION_BAR="actionBar",t.RtRowChangeDirection=void 0,(De=t.RtRowChangeDirection||(t.RtRowChangeDirection={})).DEFAULT="default",De.HORIZONTAL="horizontal",De.VERTICAL="vertical",De.BOTH="both",t.RtPanelType=void 0,(Pe=t.RtPanelType||(t.RtPanelType={})).FORM="form",Pe.BUTTON="button",Pe.SEARCH="search",t.RtButtonLabelPosition=void 0,(Me=t.RtButtonLabelPosition||(t.RtButtonLabelPosition={})).NONE="none",Me.LEFT="left",Me.RIGHT="right",Me.TOP="top",Me.BOTTOM="bottom";class He extends gt{constructor(t,e){super(),this._owner=t,this._defs=e||void 0,!e&&this._doInitDefaults()}owner(){return this._owner}_changed(){this._owner&&this._owner.optionItemChanged(this)}}t.RtSlideDirection=void 0,(Ie=t.RtSlideDirection||(t.RtSlideDirection={})).DEFAULT="default",Ie.RANDOM="random",Ie.LEFT="left",Ie.RIGHT="right",Ie.UP="up",Ie.DOWN="down",function(t){t.GRID="grid",t.LIST="list",t.MENU="menu"}(Ne||(Ne={})),t.RtGroupIndentMode=void 0,(Oe=t.RtGroupIndentMode||(t.RtGroupIndentMode={})).ROW="row",Oe.BODY="body",t.RtRowIndents=void 0,(Fe=t.RtRowIndents||(t.RtRowIndents={})).NONE="none",Fe.PARENT="parent",Fe.INNER="inner",t.RtBadgePosition=void 0,(Be=t.RtBadgePosition||(t.RtBadgePosition={})).TOP_LEFT="topLeft",Be.TOP_RIGHT="topRight",Be.BOTTOM_LEFT="bottomLeft",Be.BOTTOM_RIGHT="bottomRight";class We{constructor(t){this._style={},this._baseCls=t}update(t,e,s,i,r){for(let t in this._style)e[t]="";Object.assign(e,this._style=Object.assign({},i,r)),t.className=s?this._baseCls+" "+s:this._baseCls}updateClass(t){this._class?t.className=this._baseCls+" "+this._class:t.className=this._baseCls}updateSvgClass(t){if(this._class!=this._prevClass){const e=t.classList;this._prevClasses&&this._prevClasses.forEach((t=>e.remove(t))),this._class?(this._prevClasses=this._class.split(/\s+/),this._prevClasses.forEach((t=>e.add(t)))):this._prevClasses=void 0,this._prevClass=this._class}}updateStyle(t,e,s,i){for(let e in this._style)t[e]="";Object.assign(t,this._style=Object.assign({},s,i)),this._class=e}setClass(t){this._class=t}}let ze=651212;const Ge="div",Ue={t:"borderTop",b:"borderBottom",l:"borderLeft",r:"borderRight"};class je{static getWin(t){return t.defaultView||t.parentWindow}static isVisible(t){return t&&"none"!==t.style.display}static setVisible(t,e,s=""){return t.style.display=e?s||"":"none",e}static hide(t){t.style.display="none"}static show(t,e=""){t.style.display=e}static addClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.add(e)))}return t}static removeClass(t,e){if(e){e.split(/\s+/g).forEach((e=>t.classList.remove(e)))}return t}static getImageUrl(t){const e=t.backgroundImage;if(e&&e.startsWith('url("'))return e.substring(5,e.length-2)}static getFocused(){let t=document.getSelection().focusNode;for(;t;){if(t instanceof HTMLElement)return t;t=t.parentElement}}static isAncestorOf(t,e){let s=e;for(;s;){if(s==t)return!0;s=s.parentElement}return!1}static getOffset(t){const e=t.ownerDocument,s=e.defaultView,i=t.getBoundingClientRect(),r=e.body,n=e.documentElement,o=s.pageYOffset||n.scrollTop||r.scrollTop,h=s.pageXOffset||n.scrollLeft||r.scrollLeft,a=n.clientTop||r.clientTop||0,l=n.clientLeft||r.clientLeft||0,d=i.left+h-l,_=i.top+o-a;return{x:Math.round(d),y:Math.round(_)}}static getSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}static moveX(t,e){t.style.left=e+"px"}static moveY(t,e){t.style.top=e+"px"}static move(t,e,s){t.style.left=e+"px",t.style.top=s+"px"}static moveI(t,e,s){t.style.left=(e>>>0)+"px",t.style.top=(s>>>0)+"px"}static resize(t,e,s){t.style.width=e+"px",t.style.height=s+"px"}static resizeSVG(t,e,s){t.setAttribute("viewBox",`0 0 ${e} ${s}`)}static setWidth(t,e){t.style.width=e+"px"}static setHeight(t,e){t.style.height=e+"px"}static getBrowserSize(t){const e=t?t.ownerDocument:document,s=e.defaultView;return{width:s.innerWidth||e.documentElement.clientWidth||e.body.clientWidth,height:s.innerHeight||e.documentElement.clientHeight||e.body.clientHeight}}static setRect(t,e){const s=t.style;s.left=e.x+"px",s.top=e.y+"px",s.width=e.width+"px",s.height=e.height+"px"}static setBounds(t,e,s,i,r){const n=t.style;n.left=e+"px",n.top=s+"px",n.width=i+"px",n.height=r+"px"}static setBoundsEx(t,e,s,i,r){const n=t.style;!isNaN(e)&&(n.left=e+"px"),!isNaN(s)&&(n.top=s+"px"),!isNaN(e)&&(n.width=i+"px"),!isNaN(e)&&(n.height=r+"px")}static getClientRect(t){const e=t.getBoundingClientRect();return e.cx=t.offsetLeft,e.cy=t.offsetTop,e}static getChildIndex(t){if(t){const e=t.parentNode;if(e){const s=e.children;for(let e=s.length;e--;)if(s[e]===t)return e}}return-1}static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static clearElements(t){let e;for(;e=t.lastChild;)je.clearElements(e),t.removeChild(e)}static append(t,e){e.parentNode!==t&&t.appendChild(e)}static addChild(t,e){return!(!t||!e||e.parentNode===t)&&(t.appendChild(e),!0)}static removeChild(t,e){return!(!t||!e||e.parentNode!==t)&&(t.removeChild(e),!0)}static removeChildren(t,e){e.forEach((e=>{e instanceof Element?e.parentNode===t&&t.removeChild(e):e&&e.dom().parentNode==t&&t.removeChild(e.dom())}))}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static clearStyle(t){t.style.cssText=""}static removeStyles(t,e){if(e)for(const s in e)t[s]=""}static setStyle(t,e){e&&Object.assign(t.style,e)}static replaceStyle(t,e,s){if(e!=s){if(s)for(const e in s)t[e]="";return e&&Object.assign(t,e),e}return s}static createElement(t,e,s){const i=t.createElement(e);return s&&Object.assign(i.style,s),i}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setData(t,e,s){null==s||""===s?delete t.dataset[e]:t.dataset[e]=s}static toggleData(t,e,s){s?t.dataset[e]="1":delete t.dataset[e]}static getData(t,e){return t.dataset[e]}static hasData(t,e){return void 0!==t.dataset[e]}static setVar(t,e,s){t.style.setProperty(e,s)}static animate(t,e,s,i,r=150,n="none"){const o={},h={};return o[e]=s,h[e]=i,t.animate([o,h],{duration:r,fill:n})}static setAttr(t,e,s){null!=s&&""!==s?t.setAttribute(e,s):t.removeAttribute(e)}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static getDomId(){return"-rtc-"+ze++}static createBR(t,e){const s=t.createElement("br");return s.className=e,s}static createSpan(t,e){const s=t.createElement("span");return e&&Object.assign(s.style,e),s}static createCheckBox(t,e){const s=t.createElement("input");return s.type="checkbox",e&&Object.assign(s.style,e),s}static createRadio(t,e){const s=t.createElement("input");return s.type="radio",e&&Object.assign(s.style,e),s}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}static getPaddingEx(t){const e=this.getPadding(t);return e.horz=e.left+e.right,e.vert=e.top+e.bottom,e}static getPaddingBorder(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0,borderLeft:parseFloat(e.borderLeftWidth)||0,borderRight:parseFloat(e.borderRightWidth)||0,borderTop:parseFloat(e.borderTopWidth)||0,borderBottom:parseFloat(e.borderBottomWidth)||0}}static stopAnimation(t){if(t)try{t.finish()}catch(t){a.debugging(),console.error(t)}return null}static childByPath(t,e){let s=t;if(e){let t=0;for(;t<e.length;)s=s.childNodes[e[t++]]}return s}static childByClass(t,e){return t.getElementsByClassName(e)[0]}static setDisabled(t,e){this.setAttr(t,"disabled",!!e||void 0)}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}}class Ye extends gt{constructor(t,e,s){super(),this._syncOrientation=!0,this._syncScreenOrientation=!0,this.longPressDelay=1e3,this._inited=!1,this._testing=!1,this._dirty=!0,this._invalidElements=[],this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._screenOrientationChangeHandler=t=>{this._screenOrientation=this.$_getScreenOrientation(),this.$_checkOrientation()},this._windowResizeHandler=t=>{this.$_checkOrientation(),this._windowResized()},this._clickHandler=t=>{this._doClick(t),this._tool.click(t)},this._dblClickHandler=t=>{this._doDblClick(t),this._tool.dblClick(t)},this._touchMoveHandler=t=>{this._doTouchMove(t),this._tool.touchMove(t)},this._touchEndHandler=t=>{this._doTouchEnd(t),this._tool.touchEnd(t)},this._touchStartHandler=t=>this._tool.touchStart(t),this._pointerDownHandler=t=>{this._doPointerDown(t)||this._tool.pointerDown(t)},this._pointerMoveHandler=t=>{this._doPointerMove(t),this._tool.pointerMove(t)},this._pointerUpHandler=t=>{this._doPointerUp(t),this._tool.pointerUp(t)},this._pointerCancelHandler=t=>{this._doPointerCancel(t),this._tool.pointerCancel(t)},this._pointerLeaveHandler=t=>{this._doPointerLeave(t),this._tool.pointerLeave(t)},this._keyPressHandler=t=>{this._doKeyPress(t),this._tool.keyPress(t)},this._wheelHandler=t=>{this._doWheel(t),this._tool.wheel(t)},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this.$_initControl(t||document,e,s),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestory(){this._unresigterEventHandlers(this._dom),je.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}activeTool(){return this._activeTool||this._tool}setSctiveTool(t){t!==this._activeTool&&(this._activeTool=t,this._tool=t||this._defaultTool)}orientation(){return this._orientation}setOrientation(t){t!==this._orientation&&(this._orientation=t,this.$_orientationChanged(t))}isPortrait(){return this._orientation!==te.LANDSCAPE}isLandscape(){return this._orientation===te.LANDSCAPE}syncOrientation(){return this._syncOrientation}setSyncOrientation(t){this._syncOrientation=t}screenOrientation(){return this._screenOrientation}syncScreenOrientation(){return this._syncScreenOrientation}setScreenSyncOrientation(t){this._syncScreenOrientation=t}addElement(t){t&&this._root.addChild(t)}removeElement(t){this._root.removeChild(t)}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}elementOfDom(t){return t&&this._root.childOfDom(t)}getBounds(){return this._dom.getBoundingClientRect()}toElement(t,e,s){const i=this.getBounds(),r=t.getClientRect();return{x:e-=r.left-i.left,y:s-=r.top-i.top}}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}_setTesting(){this._testing=!0,qe.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_getScreenOrientation(){return window.screen.orientation?window.screen.orientation.type.startsWith("landscape")?te.LANDSCAPE:te.PORTRAIT:"orientation"in window?90===Math.abs(+window.orientation)?te.LANDSCAPE:te.PORTRAIT:window.innerWidth>window.innerHeight?te.LANDSCAPE:te.PORTRAIT}$_getOrientation(){return this._dom.clientWidth>this._dom.clientHeight?te.LANDSCAPE:te.PORTRAIT}$_checkOrientation(){this._syncOrientation&&(this._syncScreenOrientation?this.setOrientation(this._screenOrientation):this.setOrientation(this.$_getOrientation()))}$_addListener(t,e,s){t.addEventListener(e,s)}_resigterEventHandlers(t){window.screen&&window.screen.orientation?window.screen.orientation.addEventListener("change",this._screenOrientationChangeHandler):"orientation"in window&&window.addEventListener("orientationchange",this._screenOrientationChangeHandler),window.addEventListener("resize",this._windowResizeHandler),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchstart",this._touchStartHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler),this.$_addListener(t,"touchend",this._touchEndHandler),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler)}_unresigterEventHandlers(t){window.screen&&window.screen.orientation&&window.screen.orientation.removeEventListener("change",this._screenOrientationChangeHandler),window.removeEventListener("resize",this._windowResizeHandler),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchstart",this._touchStartHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}$_orientationChanged(t){this._doOrientationChanged(t);const e=this.onOrientationChanged;e&&e(t)}_doOrientationChanged(t){}_prepareRenderers(t){}$_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||P(c.invalidOuterDiv,e);const i=this._container.getElementsByClassName("rtc-renderers")[0];i&&(this._prepareRenderers(i),i.remove());const r=this._dom=t.createElement("div");if(Object.assign(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden"}),r.className=s,this._container.appendChild(r),this._screenOrientation=this.$_getScreenOrientation(),this._orientation=this.$_getOrientation(),this._root=new Qe(t,this),r.appendChild(this._root._dom),this._defaultTool=this._tool=this._creatDefaultTool(),void 0===qe.ANIMATABLE){const t=r.animate&&r.animate([{left:0},{left:0}],{duration:0,fill:"none"});qe.ANIMATABLE=!!t}}_render(){this.$_render()}$_invalidateElement(t){this._invalidElements.push(t),this.invalidate()}$_requestRender(){window.requestAnimationFrame?this._requestTimer=requestAnimationFrame((()=>this.$_render())):setTimeout((()=>{this.$_render()}),0)}updateNow(){this.$_render()}$_render(){const t=+new Date;if(t<=this._toAnimation)this.$_requestRender();else{try{this._doBeforeRender();const t=this._dom.clientWidth,e=this._dom.clientHeight;this._doRender({x:0,y:0,width:t,height:e})}finally{this._dirty=!1,this._requestTimer=null,this._invalidElements.forEach((t=>t.validate())),this._invalidElements=[],this._doAfterRender()}h.log("render in "+(+new Date-t)+"ms.")}}_doBeforeRender(){}_doAfterRender(){}_doControlObjectChanged(t,e){}_doClick(t){}_doDblClick(t){}_doTouchMove(t){return!1}_doTouchEnd(t){}_doPointerDown(t){return!1}_doPointerMove(t){}_doPointerUp(t){}_doPointerCancel(t){}_doPointerLeave(t){}_doKeyPress(t){}_doWheel(t){}_windowResized(){this.invalidateLayout()}}class qe extends ut{constructor(t,e,s,i){super(),this._visible=!0,this._dirty=!1;const r=this._dom=t.createElement(i||"div");s&&(r.className=s);const n={display:this._getDisplayStyle(),position:this._getPositionStyle(),boxSizing:"border-box",overflow:this._getOverflow()};this._doInitStyle(n),Object.assign(r.style,n),e&&(r.appendChild(this._content=t.createElement("div")),this._content.className="rtc-view-content",this._content.style.position=this._getContentPosition()),this._doInitDom(t,r),this._content&&this._doInitContent(t,this._content)}_doDestory(){this._dom=null}get doc(){return this._dom.ownerDocument}get win(){const t=this._dom.ownerDocument;return t.defaultView||t.parentWindow}get dom(){return this._dom}get content(){return this._content}get parent(){return this._parent}get childCount(){return this._children?this._children.length:0}get control(){return this._parent&&this._parent.control}get x(){return this._x}right(){return this._x+this._width}get y(){return this._y}bottom(){return this._y+this._height}get width(){return this._width}get height(){return this._height}get visHeight(){return this._visible?this._height:0}get visible(){return this._visible}set visible(t){t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?this._getDisplayStyle():"none"),this._changed())}setVisible(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=this._visible?this._getDisplayStyle():"none"),this._changed()),this._visible}_internalVisible(t){return this._visible=t,this._dom.style.display=this._visible?this._getDisplayStyle():"none",t}setHidden(t){this._dom.style.visibility=t?"hidden":""}canAnimate(){return qe.ANIMATABLE&&void 0!==Element.prototype.animate}setAnimating(t){this._dom.dataset.animating=t?"1":"0"}animating(){return"1"===this._dom.dataset.animating}get hidden(){return"hidden"===this._dom.style.visibility}set hidden(t){this._dom.style.visibility=t?"hidden":"visible"}setStyles(t){return Object.assign(this._dom.style,t),this}getClientSize(){return{width:this._dom.clientWidth,height:this._dom.clientHeight}}getOffsetSize(){return{width:this._dom.offsetWidth,height:this._dom.offsetHeight}}getOffsetBounds(){return{x:this._dom.offsetLeft,y:this._dom.offsetTop,width:this._dom.offsetWidth,height:this._dom.offsetHeight}}getClientRect(){return this._dom.getBoundingClientRect()}getSize(){return{width:this._width,height:this._height}}getBounds(){return{x:this._x,y:this._y,width:this._width,height:this._height}}validate(){this._dirty=!1}getLabel(){}getChildren(){return this._children&&this._children.slice(0)}getChild(t){return this._children&&this._children[t]}indexOf(t){return this._children?this._children.indexOf(t):-1}contains(t,e=!1){const s=this._children;if(s){if(s.indexOf(t)>=0)return!0;if(e)for(const e of s){if(e.contains(t,!0))return!0}}}insertChild(t,e){if(e&&!this.contains(e)){e._parent&&e._parent.removeChild(e),this._children||(this._children=[]);const s=this._children,i=this._content||this._dom,r=e.getLabel();t<0||t>=s.length?(r&&i.appendChild(r),i.appendChild(e._dom),s.push(e)):(i.insertBefore(e._dom,s[t]._dom),r&&i.insertBefore(r,e._dom),s.splice(t,0,e)),e._parent=this,e.$_attached(),this._changed()}}insertBefore(t,e){this.insertChild(this.indexOf(e),t)}addChild(t){this.insertChild(-1,t)}remove(){this._parent&&this._parent.removeChild(this)}removeChildAt(t){if(this._children&&t>=0&&t<this._children.length){const e=this._children[t],s=e.getLabel();return s&&(this._content||this._dom).removeChild(s),(this._content||this._dom).removeChild(e._dom),this._children.splice(t,1),this.$_removeChild(e),this._changed(),e}}removeChild(t){return this.removeChildAt(this.indexOf(t))}removeLast(){const t=this._children;return t&&this.removeChildAt(t.length-1)}clear(){const t=this._children;if(t&&t.length>0){for(let e of t)this.$_removeChild(e);this._children=[];const e=this._content||this._dom;let s;for(;s=e.lastChild;)e.removeChild(s);return this._changed(),!0}return!1}moveIndex(t,e){const s=this._children,i=s.indexOf(t);if(e=Math.max(0,Math.min(s.length-1)),i>=0&&i!==e){const r=s[i]._dom;return s.splice(i,1),s.splice(e,0,t),this._dom.insertBefore(r,t._dom),this._changed(),!0}}isDom(t){return this._dom===t||this._content&&this._content===t}containsDom(t){return(this._content||this._dom).contains(t)}isView(t){return this.isDom(t)||this.containsDom(t)}containsClass(t){return(this._content||this._dom).classList.contains(t)}domByClass(t,e){const s=this._dom.getElementsByClassName(t),i=s?s.length:0;if(i>0){if(!e)return s[0];for(let t=0;t<i;t++){const i=s[t];if(Array.isArray(e)){if(e.indexOf(i.textContent)>=0)return i}else if(i.textContent===e)return i}}}childOfDom(t){const e=this._children;if(e&&e.length>0)for(const s of e){if(s.isDom(t))return s;const e=s.childOfDom(t);if(e)return e}}hasData(t){return!!this._dom.dataset[t]}setData(t,e){null==e||""===e?delete this._dom.dataset[t]:this._dom.dataset[t]=e}setBounds(t,e,s,i){return this.move(t,e).resize(s,i)}setRect(t){return this.move(t.x,t.y).resize(t.width,t.height)}moveX(t){return isNaN(t)?(this._x=t,this._dom.style.left=""):t!=this._x&&(this._x=t,this._dom.style.left=t+"px"),this}moveY(t){return isNaN(t)?(this._y=t,this._dom.style.top=""):t!==this._y&&(this._y=t,this._dom.style.top=t+"px"),this}move(t,e){return this.moveX(t).moveY(e)}center(t,e,s,i){return this.moveX(t+(s-this.width)/2).moveY(e+(i-this.height)/2)}moveI(t,e){return this.moveX(t>>0).moveY(e>>0)}resetPosition(){isNaN(this._x)&&(this._dom.style.left=this._x+"px"),isNaN(this._y)&&(this._dom.style.top=this._y+"px")}setWidth(t){return t!==this._width&&(this._width=t,this._dom.style.width=isNaN(t)?"":t+"px"),this}setHeight(t){return t!==this._height&&(this._height=t,this._dom.style.height=isNaN(t)?"":t+"px"),this}clearSize(){this._width=this._height=NaN,this._dom.style.width=this._dom.style.height="",this._content&&(this._content.style.width=this._dom.style.height="")}resize(t,e){return this.setWidth(t).setHeight(e)}internalClearSize(){return this._dom.style.width=this._dom.style.height="",this._content&&(this._content.style.width=this._dom.style.height=""),this}internalResize(t,e){return this._dom.style.width=t+"px",this._dom.style.height=e+"px",this}internalSetSize(t,e){return this._width=t,this._height=e,this}syncSize(){this.resize(Math.ceil(this._dom.offsetWidth),Math.ceil(this._dom.offsetHeight))}resizeContent(t,e){this._content.style.width=isNaN(t)?"":t+"px",this._content.style.height=isNaN(e)?"":e+"px"}setContentBounds(t,e,s,i){const r=this._content.style;r.left=t+"px",r.top=e+"px",r.width=s+"px",r.height=i+"px"}saveSize(){return this._width=this._dom.offsetWidth,this._height=this._dom.offsetHeight,this}forEach(t){const e=this._children;if(e)for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}some(t){const e=this._children;if(e)for(let s=0,i=e.length;s<i&&!0!==t(e[s],s,i);s++);}findChild(t){const e=this._children;if(e)for(let s=0,i=e.length;s<i;s++)if(1==t(e[s],s,i))return e[s]}findDescendant(t){const e=this._children;if(e)for(let s=0,i=e.length;s<i;s++){if(1==t(e[s]))return e[s];const i=e[s].findDescendant(t);if(i)return i}}findDescendants(t,e){const s=this._children;if(s)for(const i of s)1==t(i)&&e.push(i),i.findDescendants(t,e)}applyStyle(t){t&&Object.assign(this._dom.style,t)}setImportantStyle(t,e,s){return t.setProperty(e,s,"important"),this}setPressed(t){t?this._dom.dataset.pressed="1":delete this._dom.dataset.pressed}appendSpan(t,e){const s=(t||this.doc).createElement("span");return this._dom.appendChild(s),e&&(s.className=e),s}appendDom(t){return this._dom.appendChild(t),t}removeDom(t){this._dom.removeChild(t)}detachDom(){this._dom.remove()}createElement(t){return this._dom.ownerDocument.createElement(t)}setClassName(t){this._dom.className=t}_testing(){return qe.TESTING}_doInitStyle(t){}_doInitDom(t,e){}_doInitContent(t,e){}_getPositionStyle(){return"absolute"}_getDisplayStyle(){return"block"}_getContentPosition(){return"relative"}_getOverflow(){return""}$_attached(){this._doAttached()}_doAttached(){}$_detached(t){this._doDetached(t)}_doDetached(t){}$_removeChild(t){t.validate(),t._parent=null,t.$_detached(this)}_changed(){var t;this._dirty||(this._dirty=!0,null===(t=this.control)||void 0===t||t.$_invalidateElement(this))}_getRenderSize(){return{w