-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
184 lines (176 loc) · 178 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html manifest="app.manifest">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=yes">
<meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
<title>Animated Logo</title>
<link rel="stylesheet" type="text/css" href="app.css"/>
<script type="text/javascript">
/* This prevents the window being moved by touches,
to give the impression of a native app */
document.ontouchmove = function(e) { e.preventDefault(); }
/* Note: If you build with the CSS as an external file,
the app may execute before the CSS has been properly loaded.
You may want to use a different bootstrap mechanism. jQuery
provides a good preloading mechanism for instance. */
function bootstrap() {
function Trunc(v){return(v>=0)?Math.floor(v):Math.ceil(v)};function Trim$_String_Integer_Integer_(s,a,b){if(a<0)a=0;if(b<0)b=0;return s.substr(a,s.length-a-b)};function Trim$_String_(s){return s.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var TObject={$ClassName:"TObject",$Parent:null,ClassName:function(s){return s.$ClassName},ClassType:function(s){return s},ClassParent:function(s){return s.$Parent},$Init:function(){},Create:function(s){return s},Destroy:function(s){for(var prop in s)if(s.hasOwnProperty(prop))delete s.prop},Destroy$:function(s){return s.ClassType.Destroy(s)},Free:function(s){if(s!==null)s.ClassType.Destroy(s)}};function Odd(v){return(v&1)==1};function Now(){var d=new Date();return d.getTime()/8.64e7+25569};function IntToHex2(v){var r=v.toString(16);return(r.length==1)?"0"+r:r};function IntToHex(v,d){var r=v.toString(16);return"00000000".substr(0,d-r.length)+r};var sprintf=(function(){function get_type(variable){return Object.prototype.toString.call(variable).slice(8,-1).toLowerCase()}
function str_repeat(input,multiplier){for(var output=[];multiplier>0;output[--multiplier]=input){}
return output.join('')}
var str_format=function(){if(!str_format.cache.hasOwnProperty(arguments[0])){str_format.cache[arguments[0]]=str_format.parse(arguments[0])}
return str_format.format.call(null,str_format.cache[arguments[0]],arguments)};str_format.format=function(parse_tree,argv){var cursor=1,tree_length=parse_tree.length,node_type='',arg,output=[],i,k,match,pad,pad_character,pad_length;for(i=0;i<tree_length;i++){node_type=get_type(parse_tree[i]);if(node_type==='string'){output.push(parse_tree[i])}
else if(node_type==='array'){match=parse_tree[i];if(match[2]){arg=argv[cursor];for(k=0;k<match[2].length;k++){if(!arg.hasOwnProperty(match[2][k])){throw(sprintf('[sprintf] property "%s" does not exist',match[2][k]))}
arg=arg[match[2][k]]}}
else if(match[1]){arg=argv[match[1]]}
else{arg=argv[cursor++]}
if(/[^s]/.test(match[8])&&(get_type(arg)!='number')){throw(sprintf('[sprintf] expecting number but found %s',get_type(arg)))}
switch(match[8]){case'b':arg=arg.toString(2);break;case'c':arg=String.fromCharCode(arg);break;case'd':arg=String(parseInt(arg,10));if(match[7]){arg=str_repeat('0',match[7]-arg.length)+arg}break;case'e':arg=match[7]?arg.toExponential(match[7]):arg.toExponential();break;case'f':arg=match[7]?parseFloat(arg).toFixed(match[7]):parseFloat(arg);break;case'o':arg=arg.toString(8);break;case's':arg=((arg=String(arg))&&match[7]?arg.substring(0,match[7]):arg);break;case'u':arg=Math.abs(arg);break;case'x':arg=arg.toString(16);break;case'X':arg=arg.toString(16).toUpperCase();break}
arg=(/[def]/.test(match[8])&&match[3]&&arg>=0?'+'+arg:arg);pad_character=match[4]?match[4]=='0'?'0':match[4].charAt(1):' ';pad_length=match[6]-String(arg).length;pad=match[6]?str_repeat(pad_character,pad_length):'';output.push(match[5]?arg+pad:pad+arg)}}
return output.join('')};str_format.cache={};str_format.parse=function(fmt){var _fmt=fmt,match=[],parse_tree=[],arg_names=0;while(_fmt){if((match=/^[^\x25]+/.exec(_fmt))!==null){parse_tree.push(match[0])}
else if((match=/^\x25{2}/.exec(_fmt))!==null){parse_tree.push('%')}
else if((match=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt))!==null){if(match[2]){arg_names|=1;var field_list=[],replacement_field=match[2],field_match=[];if((field_match=/^([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);while((replacement_field=replacement_field.substring(field_match[0].length))!==''){if((field_match=/^\.([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1])}
else if((field_match=/^\[(\d+)\]/.exec(replacement_field))!==null){field_list.push(field_match[1])}
else{throw('[sprintf] huh?')}}}
else{throw('[sprintf] huh?')}
match[2]=field_list}
else{arg_names|=2}
if(arg_names===3){throw('[sprintf] mixing positional and named placeholders is not (yet) supported')}
parse_tree.push(match)}
else{throw('[sprintf] huh?')}
_fmt=_fmt.substring(match[0].length)}
return parse_tree};return str_format})();function Format(f,a){a.unshift(f);return sprintf.apply(null,a)};var Exception={$ClassName:"Exception",$Parent:TObject,$Init:function(){FMessage=""},Create:function(s,Msg){s.FMessage=Msg;return s}};var EAssertionFailed={$ClassName:"EAssertionFailed",$Parent:Exception,$Init:Exception.$Init};function Delete(s,i,n){var v=s.v;if((i<=0)||(i>v.length)||(n<=0))return;s.v=v.substr(0,i-1)+v.substr(i+n-1)};function ClampInt(v,mi,ma){return v<mi?mi:v>ma?ma:v};function $W(e){return e.ClassType?e:Exception.Create($New(Exception),e.constructor.name+", "+e.message)};function $NewDyn(c,z){if(c==null)throw Exception.Create($New(Exception),"ClassType is nil"+z);var i={ClassType:c};c.$Init(i);return i};function $New(c){var i={ClassType:c};c.$Init(i);return i};function $Is(o,c){if(o===null)return false;return $Inh(o.ClassType,c)};function $Inh(s,c){if(s===null)return false;while((s)&&(s!==c))s=s.$Parent;return(s)?true:false};function $Event2(i,f){var li=i,lf=f;return function(a,b){return lf.call(li,li,a,b)}};function $Event1(i,f){var li=i,lf=f;return function(a){return lf.call(li,li,a)}};function $Event0(i,f){var li=i,lf=f;return function(){return lf.call(li,li)}};function $Div(a,b){var r=a/b;return(r>=0)?Math.floor(r):Math.ceil(r)};function $Assert(b,m,z){if(!b)throw Exception.Create($New(EAssertionFailed),"Assertion failed"+z+((m=="")?"":" : ")+m)};function $AsClass(s,c){if((s===null)||$Inh(s,c))return s;throw Exception.Create($New(Exception),"Cannot cast class \""+s.$ClassName+"\" to class \""+c.$ClassName+"\"")};function $As(o,c){if((o===null)||$Is(o,c))return o;throw Exception.Create($New(Exception),"Cannot cast instance of type \""+o.ClassType.$ClassName+"\" to class \""+c.$ClassName+"\"")};function $ArraySwap(a,i1,i2){var t=a[i1];a[i1]=a[i2];a[i2]=t};function WriteLn(value$2){if(window.console){window.console.log(value$2)}};function w3_setStyle(tagRef,aStyleName,aStyleValue){if(tagRef){tagRef.style[aStyleName]=aStyleValue}};function w3_setProperty(tagRef$1,aPropName,aValue){tagRef$1[aPropName]=aValue};function w3_setElementParentByRef(aElement,aParent){if(VarIsValidRef(aParent)){if(VarIsValidRef(aElement)){aParent.appendChild(aElement)}else{throw Exception.Create($New(Exception),"Failed to add element to parent, element is null")}}};function w3_setAttrib(tagRef$2,aAttribName,aValue$1){if(tagRef$2){tagRef$2.setAttribute(aAttribName,aValue$1)}};function w3_RequestAnimationFrame(aMethod){var R=undefined;if(!vRequestAnimFrame)InitAnimationFrameShim();R=vRequestAnimFrame(aMethod);return R};function w3_RemoveEvent(a_tagRef,a_eventName,a_callback,a_useCapture){if(a_eventName=="mousewheel")a_eventName="DOMMouseScroll";a_tagRef.removeEventListener(a_eventName,a_callback,a_useCapture)};function w3_RemoveElementByRef(aElement$1,aParent$1){if(aParent$1){aParent$1.removeChild(aElement$1)}};function w3_RemoveClass(tagRef$3,aClassName){var reg=undefined;if(w3_HasClass(tagRef$3,aClassName)){reg=new RegExp("(\\s|^)"+aClassName+"(\\s|$)");(tagRef$3).className=(tagRef$3).className.replace(reg," ").replace(' ',' ').trim()}};function w3_RegisterBrowserAPI(aDriver){vDriver=aDriver};function w3_NameToUrlStr(aUrl){return"url("+aUrl+")"};function w3_HasClass(tagRef$4,aClassName$1){var R=false;R=((tagRef$4).className.match(new RegExp("(\\s|^)"+aClassName$1+"(\\s|$)")))?true:false;return R};function w3_GetUniqueObjId(){var R="";++vUniqueNumber;R="OBJ"+vUniqueNumber.toString();return R};function w3_GetUniqueNumber(){var R=0;++vUniqueNumber;R=vUniqueNumber;return R};function w3_getStyleAsStr(tagRef$5,aStyleName$1){var R="";var mData=undefined;mData=w3_getStyle(tagRef$5,aStyleName$1);if(TVariant.IsString(mData)){R=TVariant.AsString(mData)}else if(TVariant.IsNumber(mData))R=TVariant.AsInteger(mData).toString();return R};function w3_getStyleAsInt(tagRef$6,aStyleName$2){var R=0;var mData$1=undefined;mData$1=w3_getStyle(tagRef$6,aStyleName$2);if(TVariant.IsNumber(mData$1)){R=parseInt(mData$1,10)}else if(TVariant.IsString(mData$1))R=parseInt(mData$1,10);if(isNaN(R))R=0;return R};function w3_getStyleAsFloat(tagRef$7,aStyleName$3){var R=0;var mData$2=undefined;mData$2=w3_getStyle(tagRef$7,aStyleName$3);if(VarIsValidRef(mData$2)){try{if(TVariant.IsNumber(mData$2)){R=TVariant.AsFloat(mData$2);if(isNaN(R))R=0}else if(TVariant.IsString(mData$2)){R=Number(mData$2);if(isNaN(R))R=0}}catch($e){var e=$W($e)}}
return R};function w3_getStyle(tagRef$8,aStyleName$4){var R=undefined;var mObj=undefined;mObj=document.defaultView.getComputedStyle(tagRef$8,null);if(mObj)R=mObj.getPropertyValue(aStyleName$4);return R};function w3_getPropertyAsStr(tagRef$9,aPropName$1){var R="";if(tagRef$9)R=""+tagRef$9[aPropName$1];return R};function w3_getPropertyAsInt(tagRef$10,aPropName$2){var R=0;if(tagRef$10)R=parseInt(tagRef$10[aPropName$2],10);return R};function w3_getPropertyAsBool(tagRef$11,aPropName$3){var R=false;if(tagRef$11)R=(tagRef$11[aPropName$3]?true:false);return R};function w3_getIsSafari(){var R=false;if(navigator.userAgent.match(/Safari/i))R=true;return R};function w3_getIsOpera(){var R=false;if(navigator.userAgent.match(/Opera/i))R=true;return R};function w3_getIsIPod(){var R=false;if(navigator.userAgent.match(/iPod/i))R=true;return R};function w3_getIsIPhone(){var R=false;if(navigator.userAgent.match(/iPhone/i))R=true;return R};function w3_getIsIPad(){var R=false;if(navigator.userAgent.match(/iPad/i))R=true;return R};function w3_getIsInternetExplorer(){var R=false;if(navigator.userAgent.match(/MSIE/i))R=true;return R};function w3_getIsFirefox(){var R=false;if(navigator.userAgent.match(/Firefox/i))R=true;return R};function w3_getIsChrome(){var R=false;if(navigator.userAgent.match(/Chrome/i))R=true;return R};function w3_getIsAndroid(){var R=false;if(navigator.userAgent.match(/Android/i))R=true;return R};function w3_getAttribAsStr(tagRef$12,aAttribName$1){var R="";var mValue=undefined;mValue=tagRef$12.getAttribute(aAttribName$1,0);if(mValue)R=""+mValue;return R};function w3_getAttrib(tagRef$13,aAttribName$2){var R=undefined;if(tagRef$13)R=tagRef$13.getAttribute(aAttribName$2);return R};function w3_CSSPrefixDef(aCSS){return"-"+BrowserAPI().FCSSToken+"-"+aCSS};function w3_CSSPrefix(aCSS$1){return BrowserAPI().FCSSToken+aCSS$1};function w3_createHtmlElement(aTypeName){return document.createElement(aTypeName)};function w3_bind2(obj_ref,event_name,callback){obj_ref[event_name]=callback};function w3_AddEvent(a_tagRef$1,a_eventName$1,a_callback$1,a_useCapture$1){if(a_eventName$1=="mousewheel")a_eventName$1="DOMMouseScroll";a_tagRef$1.addEventListener(a_eventName$1,a_callback$1,a_useCapture$1)};function w3_AddClass(tagRef$14,aClassName$2){if(!w3_HasClass(tagRef$14,aClassName$2))tagRef$14.className+=" "+aClassName$2};var TW3CustomBrowserAPI={$ClassName:"TW3CustomBrowserAPI",$Parent:TObject,$Init:function($){TObject.$Init($);$.FCSSAnimation=$.FCSSBackgroundColor=$.FCSSBackgroundImage=$.FCSSBackgroundPos=$.FCSSBackgroundSize=$.FCSSToken=$.FCSSTransform=""},DevicePixelRatio:function(){var R=0;R=window.devicePixelRatio||1;return R},Destroy:TObject.Destroy};var TW3WebkitBrowserAPI={$ClassName:"TW3WebkitBrowserAPI",$Parent:TW3CustomBrowserAPI,$Init:function($){TW3CustomBrowserAPI.$Init($)},Create$3:function(S){S.FCSSToken="webkit";S.FCSSBackgroundImage="background-image";S.FCSSBackgroundSize="webkitbackgroundSize";S.FCSSBackgroundPos="webkitbackgroundPosition";S.FCSSBackgroundColor="webkitbackgroundColor";S.FCSSTransform="webkitTransform";S.FCSSAnimation="webkitAnimation";return S},Destroy:TObject.Destroy};var TW3OwnedObject={$ClassName:"TW3OwnedObject",$Parent:TObject,$Init:function($){TObject.$Init($);$.FOwner=null},AcceptParent:function(S,aObject){return true},Create$4:function(S,AOwner){TObject.Create(S);if(TW3OwnedObject.AcceptParent$(S,AOwner)){S.FOwner=AOwner}else{throw EW3Exception.CreateFmt($New(EW3OwnedObject),"Method %s in class %s threw exception [%s]",["constructor",TObject.ClassName(S.ClassType),"Unsuitable owner object-type error"])}
return S},Destroy:TObject.Destroy,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType,arguments)}};var TW3OperaBrowserAPI={$ClassName:"TW3OperaBrowserAPI",$Parent:TW3CustomBrowserAPI,$Init:function($){TW3CustomBrowserAPI.$Init($)},Create$5:function(S){S.FCSSToken="O";S.FCSSBackgroundImage="OBackgroundImage";S.FCSSBackgroundSize="OBackgroundSize";S.FCSSBackgroundPos="OBackgroundPosition";S.FCSSBackgroundColor="backgroundColor";S.FCSSTransform="OTransform";S.FCSSAnimation="OAnimation";return S},Destroy:TObject.Destroy};var TW3IEBrowserAPI={$ClassName:"TW3IEBrowserAPI",$Parent:TW3CustomBrowserAPI,$Init:function($){TW3CustomBrowserAPI.$Init($)},Create$6:function(S){S.FCSSToken="ms";S.FCSSBackgroundImage="msBackgroundImage";S.FCSSBackgroundSize="msBackgroundSize";S.FCSSBackgroundPos="msBackgroundPosition";S.FCSSBackgroundColor="backgroundColor";S.FCSSTransform="msTransform";S.FCSSAnimation="msAnimation";return S},Destroy:TObject.Destroy};var TW3FirefoxBrowserAPI={$ClassName:"TW3FirefoxBrowserAPI",$Parent:TW3CustomBrowserAPI,$Init:function($){TW3CustomBrowserAPI.$Init($)},Create$7:function(S){S.FCSSToken="Moz";S.FCSSBackgroundImage="backgroundImage";S.FCSSBackgroundSize="backgroundSize";S.FCSSBackgroundPos="backgroundPosition";S.FCSSBackgroundColor="backgroundColor";S.FCSSTransform="MozTransform";S.FCSSAnimation="MozAnimation";return S},Destroy:TObject.Destroy};var TW3BrowserVendor=["bvUnknown","bviOS","bvAndroid","bvChrome","bvSafari","bvFirefox","bvOpera","bvIE"];var EW3Exception={$ClassName:"EW3Exception",$Parent:Exception,$Init:function($){Exception.$Init($)},CreateFmt:function(S,aText,aValues){Exception.Create(S,Format(aText,aValues.slice(0)));return S},Destroy:Exception.Destroy};var EW3OwnedObject={$ClassName:"EW3OwnedObject",$Parent:EW3Exception,$Init:function($){EW3Exception.$Init($)},Destroy:Exception.Destroy};function BrowserAPI(){var R=null;if(vDriver===null)InternalInitVendorInfo();R=vDriver;return R};function InternalInitVendorInfo(){if(w3_getIsAndroid()){vVendor=2}else if(w3_getIsSafari()){vVendor=4}else if(w3_getIsFirefox()){vVendor=5}else if(w3_getIsChrome()){vVendor=3}else if(w3_getIsInternetExplorer()){vVendor=7}else if(w3_getIsOpera())vVendor=6;if(!vVendor){if((w3_getIsIPhone()||w3_getIsIPad())||w3_getIsIPod())vVendor=1}
switch(vVendor){case 1:case 4:case 3:case 2:w3_RegisterBrowserAPI(TW3WebkitBrowserAPI.Create$3($New(TW3WebkitBrowserAPI)));break;case 5:w3_RegisterBrowserAPI(TW3FirefoxBrowserAPI.Create$7($New(TW3FirefoxBrowserAPI)));break;case 7:w3_RegisterBrowserAPI(TW3IEBrowserAPI.Create$6($New(TW3IEBrowserAPI)));break;case 6:w3_RegisterBrowserAPI(TW3OperaBrowserAPI.Create$5($New(TW3OperaBrowserAPI)));break;default:w3_RegisterBrowserAPI(TW3FirefoxBrowserAPI.Create$7($New(TW3FirefoxBrowserAPI)))}};function InitAnimationFrameShim(){vRequestAnimFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){return window.setTimeout(callback,1000/60)}})();vCancelAnimFrame=(function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||function(handle){window.clearTimeout(handle)}})()};function VarIsValidRef(aRef){var R=false;R=!((aRef==null)||(aRef==undefined));return R};var TVariant={$ClassName:"TVariant",$Parent:TObject,$Init:function($){TObject.$Init($)},AsFloat:function(aValue$2){var R=0;if(VarIsValidRef(aValue$2))R=Number(aValue$2);return R},AsInteger:function(aValue$3){var R=0;if(VarIsValidRef(aValue$3))R=parseInt(aValue$3,10);return R},AsObject:function(aValue$4){var R=null;if(VarIsValidRef(aValue$4)){R=aValue$4}else R=null;return R},AsString:function(aValue$5){var R="";if(VarIsValidRef(aValue$5))R=""+aValue$5;return R},IsNumber:function(aValue$6){var R=false;if(aValue$6==null)return false;if(aValue$6==undefined)return false;if(typeof(aValue$6)==="number")return true;return R},IsString:function(aValue$7){var R=false;if(aValue$7==null)return false;if(aValue$7==undefined)return false;if(typeof(aValue$7)==="string")return true;return R},Destroy:TObject.Destroy};function Copy$TRectF(s,d){d.Bottom=s.Bottom;d.Left=s.Left;d.Right=s.Right;d.Top=s.Top;return d}
function Clone$TRectF($){return{Bottom:$.Bottom,Left:$.Left,Right:$.Right,Top:$.Top}}
function CreateBounded(x1,y1,x2,y2){var R={Bottom:0,Left:0,Right:0,Top:0};if(x1<x2){R.Left=x1;R.Right=x2}else{R.Left=x2;R.Right=x1}
if(y1<y2){R.Top=y1;R.Bottom=y2}else{R.Top=y2;R.Bottom=y1}
return R}
function TRectF$Height(Self$1){return Self$1.Bottom-Self$1.Top}
function TRectF$Width(Self$2){return Self$2.Right-Self$2.Left}
function Copy$TRect(s,d){d.Bottom$1=s.Bottom$1;d.Left$1=s.Left$1;d.Right$1=s.Right$1;d.Top$1=s.Top$1;return d}
function Clone$TRect($){return{Bottom$1:$.Bottom$1,Left$1:$.Left$1,Right$1:$.Right$1,Top$1:$.Top$1}}
function TRect$ContainsPos$1(Self$3,aLeft,aTop){return(((aLeft>=Self$3.Left$1)&&(aLeft<=Self$3.Right$1))&&(aTop>=Self$3.Top$1))&&(aTop<=Self$3.Bottom$1)}
function TRect$Height$1(Self$4){return Self$4.Bottom$1-Self$4.Top$1}
function TRect$Width$1(Self$5){return Self$5.Right$1-Self$5.Left$1}
function Copy$TPointF(s,d){d.X=s.X;d.Y=s.Y;return d}
function Clone$TPointF($){return{X:$.X,Y:$.Y}}
function Create$12(aCol,aRow){var R={X:0,Y:0};R.X=aCol;R.Y=aRow;return R}
function Copy$TPoint(s,d){d.X$1=s.X$1;d.Y$1=s.Y$1;return d}
function Clone$TPoint($){return{X$1:$.X$1,Y$1:$.Y$1}}
function Create$13(aCol$1,aRow$1){var R={X$1:0,Y$1:0};R.X$1=aCol$1;R.Y$1=aRow$1;return R}
var TInteger={$ClassName:"TInteger",$Parent:TObject,$Init:function($){TObject.$Init($)},Diff:function(Primary,Secondary){var R=0;if(Primary!=Secondary){if(Primary>Secondary){R=Primary-Secondary}else R=Secondary-Primary;if(R<0)R=(R-1)^(-1)}else R=0;return R},EnsureRange:function(aValue$8,aMin,aMax){return ClampInt(aValue$8,aMin,aMax)},PercentOfValue:function(Value$2,Total$2){var R=0;if(Value$2<=Total$2){R=Trunc((Value$2/Total$2)*100)}else R=0;return R},ToPxStr:function(aValue$9){return aValue$9.toString()+"px"},WrapRange:function(aValue$10,aLowRange,aHighRange){var R=0;if(aValue$10>aHighRange){R=aLowRange+TInteger.Diff(aHighRange,(aValue$10-1));if(R>aHighRange)R=TInteger.WrapRange(R,aLowRange,aHighRange)}else if(aValue$10<aLowRange){R=aHighRange-TInteger.Diff(aLowRange,(aValue$10+1));if(R<aLowRange)R=TInteger.WrapRange(R,aLowRange,aHighRange)}else R=aValue$10;return R},Destroy:TObject.Destroy};var TExposure=["esVisible","esPartly","esNone"];function OffsetPoint(a,b$1){var R={X$1:0,Y$1:0};R.X$1=a.X$1+b$1.X$1;R.Y$1=a.Y$1+b$1.Y$1;return R};function OffsetPoint$1(a$44,b$2){var R={X$1:0,Y$1:0};R.X$1=a$44.X$1+b$2;R.Y$1=a$44.Y$1+b$2;return R};function OffsetPoint$2(a$45,b$3){var R={X:0,Y:0};R.X=a$45.X+b$3.X;R.Y=a$45.Y+b$3.Y;return R};function OffsetPoint$3(a$46,b$4){var R={X:0,Y:0};R.X=a$46.X+b$4;R.Y=a$46.Y+b$4;return R};function OffsetPoint$4(a$47,b$5){var R={X:0,Y:0};R.X=a$47.X+b$5;R.Y=a$47.Y+b$5;return R};function MinusPoint(a$48,b$6){var R={X$1:0,Y$1:0};R.X$1=a$48.X$1-b$6.X$1;R.Y$1=a$48.Y$1-b$6.Y$1;return R};function MinusPoint$1(a$49,b$7){var R={X$1:0,Y$1:0};R.X$1=a$49.X$1-b$7;R.Y$1=a$49.Y$1-b$7;return R};function MinusPoint$2(a$50,b$8){var R={X:0,Y:0};R.X=a$50.X-b$8.X;R.Y=a$50.Y-b$8.Y;return R};function MinusPoint$3(a$51,b$9){var R={X:0,Y:0};R.X=a$51.X-b$9;R.Y=a$51.Y-b$9;return R};function MinusPoint$4(a$52,b$10){var R={X:0,Y:0};R.X=a$52.X-b$10;R.Y=a$52.Y-b$10;return R};function ExpandPoint(a$53,b$11){var R={X$1:0,Y$1:0};R.X$1=Math.round(a$53.X$1*b$11.X$1);R.Y$1=Math.round(a$53.Y$1*b$11.Y$1);return R};function ExpandPoint$1(a$54,b$12){var R={X$1:0,Y$1:0};R.X$1=Math.round(a$54.X$1*b$12);R.Y$1=Math.round(a$54.Y$1*b$12);return R};function ExpandPoint$2(a$55,b$13){var R={X$1:0,Y$1:0};R.X$1=Math.round(a$55.X$1*b$13);R.Y$1=Math.round(a$55.Y$1*b$13);return R};function ExpandPoint$3(a$56,b$14){var R={X:0,Y:0};R.X=a$56.X*b$14.X;R.Y=a$56.Y*b$14.Y;return R};function ExpandPoint$4(a$57,b$15){var R={X:0,Y:0};R.X=a$57.X*b$15;R.Y=a$57.Y*b$15;return R};function ExpandPoint$5(a$58,b$16){var R={X:0,Y:0};R.X=a$58.X*b$16;R.Y=a$58.Y*b$16;return R};var TW3DisplayViewArangeType=["dvaSizeToView","dvaVStack","dvaHStack"];var TW3TagObj={$ClassName:"TW3TagObj",$Parent:TObject,$Init:function($){TObject.$Init($);$.FHandle$1=undefined;$.FObjReady=false;$.FOwner$1=undefined;$.FTagId="";$.FUpdating=0},AfterUpdate:function(S){},BeginUpdate:function(S){++S.FUpdating},Create$17:function(S){TObject.Create(S);S.FObjReady=false;try{S.FTagId=TW3TagObj.MakeElementTagId$(S);S.FHandle$1=TW3TagObj.MakeElementTagObj$(S)}catch($e){var e$1=$W($e);EW3TagObj.RaiseCntErrMethod("TW3TagObj.Create",S,e$1.FMessage)}
if(TVariant.AsObject(S.FHandle$1)!==TVariant.AsObject(document.body)){if(S.FTagId.length>0)w3_setAttrib(S.FHandle$1,"id",S.FTagId)}
TW3TagObj.StyleTagObject$(S);TW3TagObj.BeginUpdate(S);try{TW3TagObj.InitializeObject$(S)}finally{TW3TagObj.EndUpdate(S)}
S.FObjReady=true;return S},Destroy:function(S){if(S.FHandle$1){try{TW3TagObj.UnHookEvents(S);TW3TagObj.RemoveFrom(S)}finally{TW3TagObj.FinalizeObject$(S);S.FTagId="";S.FHandle$1=null}}
TObject.Destroy(S)},EndUpdate:function(S){if(S.FUpdating>0){--S.FUpdating;if(!S.FUpdating)TW3TagObj.AfterUpdate$(S)}},FinalizeObject:function(S){},GetInnerHTML:function(S){var R="";if(S.FHandle$1)R=""+S.FHandle$1.innerHTML;return R},getUpdating:function(S){return S.FUpdating>0},InitializeObject:function(S){},InsertInto:function(S,OwnerHandle){if(OwnerHandle){if(S.FHandle$1){try{if(S.FOwner$1)TW3TagObj.RemoveFrom(S);w3_setElementParentByRef(S.FHandle$1,OwnerHandle);S.FOwner$1=OwnerHandle}catch($e){var e$2=$W($e);EW3TagObj.RaiseCntErrMethod("TW3TagObj.InsertInto",S,e$2.FMessage)}}else EW3TagObj.RaiseCntErrMethod("TW3TagObj.InsertInto",S,"Internal tag-object is null error")}else EW3TagObj.RaiseCntErrMethod("TW3TagObj.InsertInto",S,"owner is NIL error")},MakeElementTagId:function(S){return w3_GetUniqueObjId()},MakeElementTagObj:function(S){return w3_createHtmlElement("div")},RemoveFrom:function(S){if(S.FOwner$1){if(S.FHandle$1){try{w3_RemoveElementByRef(S.FHandle$1,S.FOwner$1)}catch($e){var e$3=$W($e);EW3TagObj.RaiseCntErrMethod("TW3TagObj.RemoveFrom",S,e$3.FMessage)}
S.FOwner$1=undefined}else EW3TagObj.RaiseCntErrMethod("TW3TagObj.RemoveFrom",S,"Internal tag-object is null error")}},SetInnerHTML:function(S,aValue$11){if(S.FHandle$1){S.FHandle$1.innerHTML=aValue$11}},StyleTagObject:function(S){if(S.FHandle$1){S.FHandle$1.style["visibility"]="hidden";S.FHandle$1.style["display"]="none";S.FHandle$1.style["position"]="absolute";S.FHandle$1.style["overflow"]="hidden";S.FHandle$1.style["left"]="0px";S.FHandle$1.style["top"]="0px"}},UnHookEvents:function(S){if(S.FHandle$1){S.FHandle$1.onresize=null;S.FHandle$1.onselectstart=null;S.FHandle$1.onfocus=null;S.FHandle$1.onblur=null;S.FHandle$1.onchange=null;S.FHandle$1.onmousedown=null;S.FHandle$1.onmouseup=null;S.FHandle$1.onmousemove=null;S.FHandle$1.onmouseover=null;S.FHandle$1.onmouseout=null;S.FHandle$1.onclick=null;S.FHandle$1.ondblclick=null;S.FHandle$1.onkeydown=null;S.FHandle$1.onkeyup=null;S.FHandle$1.onkeypress=null;S.FHandle$1.webkitAnimationStart=null;S.FHandle$1.webkitAnimationEnd=null}},Destroy$:function($){return $.ClassType.Destroy($)},AfterUpdate$:function($){return $.ClassType.AfterUpdate($)},FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId$:function($){return $.ClassType.MakeElementTagId($)},MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject$:function($){return $.ClassType.StyleTagObject($)}};var TW3Component={$ClassName:"TW3Component",$Parent:TW3TagObj,$Init:function($){TW3TagObj.$Init($);$.FChildren=[];$.FName="";$.FParent=null},CBNoBehavior:function(S){if(event){event.preventDefault()}},ChildAdded:function(S,aChild){},ChildByName:function(S,compName){var R=null;var lcName="";var i=0;lcName=(Trim$_String_(compName)).toLowerCase();var $t1;for(i=0,$t1=TW3Component.GetChildCount(S);i<$t1;i++){R=TW3Component.GetChildObject(S,i);if((R.FName).toLowerCase()==lcName)return R}
R=null;return R},ChildRemoved:function(S,aChild$1){},Create$18:function(S,AOwner$1){S.FParent=AOwner$1;TW3TagObj.Create$17(S);if(S.FParent!==null)TW3Component.RegisterChild(S.FParent,S);return S},FinalizeObject:function(S){TW3Component.FreeChildren(S);if(S.FParent!==null)TW3Component.UnRegisterChild(S.FParent,S);S.FChildren.length=0;TW3TagObj.FinalizeObject(S)},FreeChildren:function(S){var oldCount=0;try{while(S.FChildren.length>0){oldCount=S.FChildren.length;TObject.Free(S.FChildren[0]);if(oldCount==S.FChildren.length){S.FChildren.shift()}}}finally{S.FChildren.length=0}},GetChildCount:function(S){return S.FChildren.length},GetChildObject:function(S,index){return S.FChildren[index]},InitializeObject:function(S){TW3TagObj.InitializeObject(S)},RegisterChild:function(S,aChild$2){if((aChild$2!==null)&&(S.FChildren.indexOf(aChild$2)<0)){S.FChildren.push(aChild$2);TW3TagObj.InsertInto(aChild$2,S.FHandle$1);TW3Component.ChildAdded(S,aChild$2)}},SetName:function(S,Value$3){S.FName=Value$3},UnRegisterChild:function(S,aChild$3){var mIndex=0;if(aChild$3!==null){mIndex=S.FChildren.indexOf(aChild$3);if(mIndex>=0){S.FChildren.splice(mIndex,1);TW3Component.ChildRemoved(S,aChild$3)}
TW3TagObj.RemoveFrom(aChild$3)}},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3TagObj.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3TagObj.StyleTagObject,Create$18$:function($){return $.ClassType.Create$18.apply($.ClassType,arguments)}};var TW3MovableControl={$ClassName:"TW3MovableControl",$Parent:TW3Component,$Init:function($){TW3Component.$Init($);$.FAdjusted=$.FTransparent=$.FUseAlpha=$.FWasMoved=$.FWasSized=false;$.FAlpha=0;$.FBackground=$.FBorders=$.FConstraints=null;$.FColor=0},AdjustToParentBox:function(S){var x$1=0;var dx=0;var dy=0;var mChild=null;var mCtrl=null;if(S.FHandle$1){if(!S.FAdjusted){S.FAdjusted=true;dx=TW3Borders.getHSpace(TW3MovableControl.getBorder(S));dy=TW3Borders.getVSpace(TW3MovableControl.getBorder(S));var $t2;for(x$1=0,$t2=TW3Component.GetChildCount(S);x$1<$t2;x$1++){mChild=TW3Component.GetChildObject(S,x$1);if($Is(mChild,TW3MovableControl)){mCtrl=$As(mChild,TW3MovableControl);if(TW3MovableControl.supportAdjustment$(mCtrl.ClassType)){if((dx>0)||(dy>0))TW3MovableControl.SetSize(mCtrl,TW3MovableControl.GetWidth$(mCtrl)-dx,TW3MovableControl.GetHeight$(mCtrl)-dy);setTimeout($Event0(mCtrl,TW3MovableControl.AdjustToParentBox),1)}}}}}},AfterUpdate:function(S){S.FWasMoved=false;S.FWasSized=false},ClientHeight:function(S){var R=0;if(S.FHandle$1){if(VarIsValidRef(S.FHandle$1.clientHeight)){R=TVariant.AsInteger(S.FHandle$1.clientHeight);if(isNaN(R)||(R==0))R=TW3MovableControl.GetWidth$(S)}else R=TW3MovableControl.GetWidth$(S)}
return R},ClientWidth:function(S){var R=0;if(S.FHandle$1){if(VarIsValidRef(S.FHandle$1.clientWidth)){R=TVariant.AsInteger(S.FHandle$1.clientWidth);if(isNaN(R)||(R==0))R=TW3MovableControl.GetWidth$(S)}else R=TW3MovableControl.GetWidth$(S)}
return R},DisplayMode:function(S){return"inline-block"},FinalizeObject:function(S){if(S.FBackground)TObject.Free(S.FBackground);if(S.FBorders)TObject.Free(S.FBorders);if(S.FConstraints)TObject.Free(S.FConstraints);TW3Component.FinalizeObject(S)},getBorder:function(S){var R=null;if(S.FBorders===null)S.FBorders=TW3OwnedObject.Create$4$($New(TW3Borders),S);R=S.FBorders;return R},getBoundsRect:function(S){var R={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};R.Left$1=TW3MovableControl.GetLeft(S);R.Top$1=TW3MovableControl.GetTop(S);R.Right$1=R.Left$1+TW3MovableControl.GetWidth$(S);R.Bottom$1=R.Top$1+TW3MovableControl.GetHeight$(S);return R},GetHeight:function(S){var R=0;if(S.FHandle$1)R=parseInt(S.FHandle$1.offsetHeight,10);return R},GetLeft:function(S){return w3_getStyleAsInt(S.FHandle$1,"left")},GetTop:function(S){return w3_getStyleAsInt(S.FHandle$1,"top")},getVisible:function(S){var R=false;var mValue$2="";mValue$2=w3_getStyleAsStr(S.FHandle$1,"visibility");R=(mValue$2).toLowerCase()=="visible";return R},GetWasMoved:function(S){return S.FWasMoved},GetWasSized:function(S){return S.FWasSized},GetWidth:function(S){var R=0;if(S.FHandle$1)R=parseInt(S.FHandle$1.offsetWidth,10);return R},InitializeObject:function(S){TW3Component.InitializeObject(S);S.FAlpha=255;S.FColor=536870911;S.FTransparent=false},MoveTo:function(S,aLeft$1,aTop$1){TW3TagObj.BeginUpdate(S);S.FHandle$1.style["left"]=TInteger.ToPxStr(aLeft$1);S.FHandle$1.style["top"]=TInteger.ToPxStr(aTop$1);TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)},Resize:function(S){},ScreenRect:function(S){var R={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var elem=undefined;if(S.FHandle$1){elem=S.FHandle$1;while(1){R.Left$1+=parseInt(elem.offsetLeft,10);R.Top$1+=parseInt(elem.offsetTop,10);elem=elem.offsetParent;if(elem){R.Left$1-=parseInt(elem.scrollLeft,10);R.Top$1-=parseInt(elem.scrollTop,10)}else break}
R.Right$1=parseInt((R.Left$1+S.FHandle$1.offsetWidth),10);R.Bottom$1=parseInt((R.Top$1+S.FHandle$1.offsetHeight),10)}
return R},setAlpha:function(S,aValue$12){S.FAlpha=ClampInt(aValue$12,0,255);if(S.FUseAlpha){S.FHandle$1.style["opacity"]=S.FAlpha/100}},SetBounds$2:function(S,aLeft$2,aTop$2,aWidth,aHeight){var mSized=false;var mMoved=false;aWidth=Math.max(0,aWidth);aHeight=Math.max(0,aHeight);mMoved=(aLeft$2!=TW3MovableControl.GetLeft(S))||(aTop$2!=TW3MovableControl.GetTop(S));mSized=(aWidth!=TW3MovableControl.GetWidth$(S))||(aHeight!=TW3MovableControl.GetHeight$(S));TW3TagObj.BeginUpdate(S);S.FHandle$1.style["left"]=TInteger.ToPxStr(aLeft$2);S.FHandle$1.style["top"]=TInteger.ToPxStr(aTop$2);S.FHandle$1.style["width"]=TInteger.ToPxStr(aWidth);S.FHandle$1.style["height"]=TInteger.ToPxStr(aHeight);if(mMoved)TW3MovableControl.SetWasMoved(S);if(mSized)TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)},setColor:function(S,aValue$13){var mText="";if(aValue$13!=S.FColor){S.FColor=aValue$13;mText=ColorToWebStr(S.FColor,(S.FTransparent)?0:255);S.FHandle$1.style["backgroundColor"]=mText}},setHeight:function(S,aValue$14){aValue$14=Math.max(aValue$14,0);if(aValue$14!=TW3MovableControl.GetHeight$(S)){TW3TagObj.BeginUpdate(S);S.FHandle$1.style["height"]=TInteger.ToPxStr(aValue$14);TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)}},setLeft:function(S,aValue$15){TW3TagObj.BeginUpdate(S);S.FHandle$1.style["left"]=TInteger.ToPxStr(aValue$15);TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)},SetSize:function(S,aWidth$1,aHeight$1){aWidth$1=Math.max(aWidth$1,0);aHeight$1=Math.max(aHeight$1,0);if((aWidth$1!=TW3MovableControl.GetWidth$(S))||(aHeight$1!=TW3MovableControl.GetHeight$(S))){TW3TagObj.BeginUpdate(S);S.FHandle$1.style["width"]=TInteger.ToPxStr(aWidth$1);S.FHandle$1.style["height"]=TInteger.ToPxStr(aHeight$1);TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)}},setTop:function(S,aValue$16){TW3TagObj.BeginUpdate(S);S.FHandle$1.style["top"]=TInteger.ToPxStr(aValue$16);TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)},setTransparent:function(S,aValue$17){var mText$1="";if(aValue$17!=S.FTransparent){TW3TagObj.BeginUpdate(S);S.FTransparent=aValue$17;mText$1=ColorToWebStr(S.FColor,(aValue$17)?0:255);S.FHandle$1.style["backgroundColor"]=mText$1;TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)}},setUseAlpha:function(S,aValue$18){var mBlend=0;if(aValue$18==S.FUseAlpha)return;S.FUseAlpha=aValue$18;if(aValue$18){mBlend=S.FAlpha/100}else mBlend=1;S.FHandle$1.style["opacity"]=mBlend},SetVisible:function(S,aValue$19){TW3TagObj.BeginUpdate(S);if(aValue$19){S.FHandle$1.style["display"]=TW3MovableControl.DisplayMode(S.ClassType);S.FHandle$1.style["visibility"]="visible";TW3MovableControl.SetWasSized(S)}else{S.FHandle$1.style["display"]="none";S.FHandle$1.style["visibility"]="hidden"}
TW3TagObj.EndUpdate(S)},SetWasMoved:function(S){S.FWasMoved=true},SetWasSized:function(S){S.FWasSized=true},SetWidth:function(S,aValue$20){aValue$20=Math.max(aValue$20,0);if(aValue$20!=TW3MovableControl.GetWidth$(S)){TW3TagObj.BeginUpdate(S);S.FHandle$1.style["width"]=TInteger.ToPxStr(aValue$20);TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)}},supportAdjustment:function(S){return true},Destroy:TW3TagObj.Destroy,AfterUpdate$:function($){return $.ClassType.AfterUpdate($)},FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3TagObj.StyleTagObject,Create$18:TW3Component.Create$18,GetHeight$:function($){return $.ClassType.GetHeight($)},GetWidth$:function($){return $.ClassType.GetWidth($)},Resize$:function($){return $.ClassType.Resize($)},setHeight$:function($){return $.ClassType.setHeight.apply($.ClassType,arguments)},SetWidth$:function($){return $.ClassType.SetWidth.apply($.ClassType,arguments)},supportAdjustment$:function($){return $.supportAdjustment($)}};var TW3CustomControl={$ClassName:"TW3CustomControl",$Parent:TW3MovableControl,$Init:function($){TW3MovableControl.$Init($);$.FAngle=0;$.FClassNames=$.FFont=$.FGestureData=$.FNoBehavior=$.FOnAnimationBegins=$.FOnAnimationEnds=$.FOnChanged=$.FOnClick=$.FOnContextPopup=$.FOnDblClick=$.FOnGestureChange=$.FOnGestureEnd=$.FOnGestureStart=$.FOnGotFocus=$.FOnKeyDown=$.FOnKeyPress=$.FOnKeyUp=$.FOnLostFocus=$.FOnMouseDown=$.FOnMouseEnter=$.FOnMouseExit=$.FOnMouseMove=$.FOnMouseUp=$.FOnMouseWheel=$.FOnResize=$.FOnTouchBegins=$.FOnTouchEnds=$.FOnTouchMoves=$.FScrollInfo=$.FTouchData=null;$.FMouseCaptured=0;$.FTouchBound=false},a$6:function(S){return vCaptureControl===S},AfterUpdate:function(S){if(TW3MovableControl.GetWasSized(S)){if(S.FObjReady)TW3MovableControl.Resize$(S);if(!TW3MovableControl.GetWasMoved(S))TW3MovableControl.SetWasMoved(S)}
if(TW3MovableControl.GetWasMoved(S))TW3CustomControl.Invalidate$(S);TW3MovableControl.AfterUpdate(S)},BindTouch:function(S){if(S.FTouchBound)return;S.FTouchBound=true;S.FHandle$1.addEventListener("touchstart",$Event1(S,TW3CustomControl.CMTouchBegins));S.FHandle$1.addEventListener("touchmove",$Event1(S,TW3CustomControl.CMTouchMove));S.FHandle$1.addEventListener("touchend",$Event1(S,TW3CustomControl.CMTouchEnds))},BringToFront:function(S){if(S.FHandle$1){S.FHandle$1.style.zIndex=(TW3CustomControl.GetMaxZIndex($As(S.FParent,TW3CustomControl))+1)}},CBAnimationBegins:function(S,eventObj){if(S.FOnAnimationBegins)S.FOnAnimationBegins(S)},CBAnimationEnds:function(S,eventObj$1){if(S.FOnAnimationEnds)S.FOnAnimationEnds(S)},CBChanged:function(S,eventObj$2){if(S.FOnChanged)S.FOnChanged(S)},CBClick:function(S,eventObj$3){if(S.FOnClick)S.FOnClick(S)},CBContextPopup:function(S,event){var R=false;var sr={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var mp={X$1:0,Y$1:0};var handled={v:false};sr=TW3MovableControl.ScreenRect(S);mp.X$1=event.clientX-sr.Left$1;mp.Y$1=event.clientY-sr.Top$1;handled.v=false;TW3CustomControl.ContextPopup(S,mp,handled);R=!handled.v;return R},CBDblClick:function(S,eventObj$4){if(S.FOnDblClick)S.FOnDblClick(S)},CBFocused:function(S){if(S.FOnGotFocus)S.FOnGotFocus(S)},CBKeyDown:function(S,eventObj$5){if(S.FOnKeyDown)S.FOnKeyDown(S,eventObj$5.keyCode)},CBKeyPress:function(S,eventObj$6){if(S.FOnKeyPress)S.FOnKeyPress(S,eventObj$6.charCode)},CBKeyUp:function(S,eventObj$7){if(S.FOnKeyUp)S.FOnKeyUp(S,eventObj$7.keyCode)},CBLostFocus:function(S){if(S.FOnLostFocus)S.FOnLostFocus(S)},CBMouseDown:function(S,eventObj$8){var sr$1={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var shiftState=null;sr$1=TW3MovableControl.ScreenRect(S);shiftState=TShiftState.Current();shiftState.FMouseButtons=shiftState.FMouseButtons|(1<<eventObj$8.button);TShiftState.SetMouseEvent(shiftState,eventObj$8);TW3CustomControl.MouseDown(S,eventObj$8.button,shiftState,eventObj$8.clientX-sr$1.Left$1,eventObj$8.clientY-sr$1.Top$1)},CBMouseEnter:function(S,eventObj$9){var sr$2={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var shiftState$1=null;sr$2=TW3MovableControl.ScreenRect(S);shiftState$1=TShiftState.Current();TShiftState.SetMouseEvent(shiftState$1,eventObj$9);TW3CustomControl.MouseEnter(S,shiftState$1,eventObj$9.clientX-sr$2.Left$1,eventObj$9.clientY-sr$2.Top$1)},CBMouseExit:function(S,eventObj$10){var sr$3={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var shiftState$2=null;sr$3=TW3MovableControl.ScreenRect(S);shiftState$2=TShiftState.Current();TShiftState.SetMouseEvent(shiftState$2,eventObj$10);TW3CustomControl.MouseExit(S,shiftState$2,eventObj$10.clientX-sr$3.Left$1,eventObj$10.clientY-sr$3.Top$1)},CBMouseMove:function(S,eventObj$11){var sr$4={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var shiftState$3=null;sr$4=TW3MovableControl.ScreenRect(S);shiftState$3=TShiftState.Current();TShiftState.SetMouseEvent(shiftState$3,eventObj$11);TW3CustomControl.MouseMove(S,shiftState$3,eventObj$11.clientX-sr$4.Left$1,eventObj$11.clientY-sr$4.Top$1)},CBMouseUp:function(S,eventObj$12){var sr$5={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var shiftState$4=null;sr$5=TW3MovableControl.ScreenRect(S);shiftState$4=TShiftState.Current();shiftState$4.FMouseButtons=shiftState$4.FMouseButtons&(~(1<<eventObj$12.button));TShiftState.SetMouseEvent(shiftState$4,eventObj$12);TW3CustomControl.MouseUp(S,eventObj$12.button,shiftState$4,eventObj$12.clientX-sr$5.Left$1,eventObj$12.clientY-sr$5.Top$1)},CBMouseWheel:function(S,eventObj$13){var wheelDelta$1=0;var handled$1={};handled$1.v=false;var sr$6={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var shiftState$5=null;var mousePos={X$1:0,Y$1:0};if(S.FOnMouseWheel){if(eventObj$13.detail){wheelDelta$1=eventObj$13.detail*-40}else wheelDelta$1=eventObj$13.wheelDelta;sr$6=TW3MovableControl.ScreenRect(S);shiftState$5=TShiftState.Current();TShiftState.SetMouseEvent(shiftState$5,eventObj$13);mousePos.X$1=eventObj$13.clientX-sr$6.Left$1;mousePos.Y$1=eventObj$13.clientY-sr$6.Top$1;TW3CustomControl.MouseWheel(S,shiftState$5,wheelDelta$1,mousePos,handled$1);if(handled$1.v){eventObj$13.preventDefault();eventObj$13.stopPropagation()}}},CMGestureChange:function(S){event.preventDefault();if(S.FOnGestureChange){if(S.FGestureData){TW3GestureData.Update$2(S.FGestureData)}else S.FGestureData=TObject.Create($New(TW3GestureData));S.FOnGestureChange(S,S.FGestureData)}},CMGestureEnd:function(S){event.preventDefault();if(S.FOnGestureEnd){if(S.FGestureData){TW3GestureData.Update$2(S.FGestureData)}else S.FGestureData=TObject.Create($New(TW3GestureData));S.FOnGestureEnd(S,S.FGestureData)}},CMGestureStart:function(S){event.preventDefault();if(S.FOnGestureStart){if(S.FGestureData){TW3GestureData.Update$2(S.FGestureData)}else S.FGestureData=TObject.Create($New(TW3GestureData));S.FOnGestureStart(S,S.FGestureData)}},CMTouchBegins:function(S,eventObj$14){eventObj$14.preventDefault();if(S.FOnTouchBegins){if(S.FTouchData){TW3TouchData.Update$1(S.FTouchData,eventObj$14)}else S.FTouchData=TObject.Create($New(TW3TouchData));S.FOnTouchBegins(S,S.FTouchData)}},CMTouchEnds:function(S,eventObj$15){eventObj$15.preventDefault();if(S.FOnTouchEnds){if(S.FTouchData){TW3TouchData.Update$1(S.FTouchData,eventObj$15)}else S.FTouchData=TObject.Create($New(TW3TouchData));S.FOnTouchEnds(S,S.FTouchData)}},CMTouchMove:function(S,eventObj$16){eventObj$16.preventDefault();if(S.FOnTouchMoves){if(S.FTouchData){TW3TouchData.Update$1(S.FTouchData,eventObj$16)}else S.FTouchData=TObject.Create($New(TW3TouchData));S.FOnTouchMoves(S,S.FTouchData)}},ContextPopup:function(S,mousePos$1,handled$2){if(S.FOnContextPopup)S.FOnContextPopup(S,mousePos$1,handled$2)},Create$18:function(S,AOwner$2){TW3Component.Create$18(S,AOwner$2);S.FHandle$1["onclick"]=$Event1(S,TW3CustomControl.CBClick$);return S},FinalizeObject:function(S){TObject.Free(S.FFont);TObject.Free(S.FClassNames);TObject.Free(S.FScrollInfo);TObject.Free(S.FTouchData);TObject.Free(S.FGestureData);TW3MovableControl.FinalizeObject(S)},getBorderRadius:function(S){return w3_getStyleAsInt(S.FHandle$1,"bordertopleftRadius")},GetChildrenSortedByYPos:function(S){var R=[];var mCount=0;var x$2=0;var mAltered=false;var mObj$1=null;var mLast=null;var mCurrent=null;R.length=0;mCount=TW3Component.GetChildCount(S);if(mCount>0){var $t3;for(x$2=0,$t3=mCount;x$2<$t3;x$2++){mObj$1=TW3Component.GetChildObject(S,x$2);if($Is(mObj$1,TW3CustomControl)){R.push(mObj$1)}}
if(R.length>1){do{mAltered=false;var $t4;for(x$2=1,$t4=mCount;x$2<$t4;x$2++){mLast=$As(R[x$2-1],TW3CustomControl);mCurrent=$As(R[x$2],TW3CustomControl);if(TW3MovableControl.GetTop(mCurrent)<TW3MovableControl.GetTop(mLast)){$ArraySwap(R,(x$2-1),x$2);mAltered=true}}}while(!(mAltered==false))}}
return R},getClassNames:function(S){var R=null;if(S.FClassNames===null)S.FClassNames=TW3OwnedObject.Create$4$($New(TW3CSSClassStyleNames),S);R=S.FClassNames;return R},GetEnabled:function(S){return S.FHandle$1.disabled!=true},getFont:function(S){var R=null;if(S.FFont===null)S.FFont=TW3ControlFont.Create$39($New(TW3ControlFont),S);R=S.FFont;return R},gethasFocus:function(S){var R=false;if(S.FHandle$1)R=document.activeElement==S.FHandle$1;return R},GetMaxZIndex:function(S){var R=0;var iChild=0;var obj=null;var objZIndex=0;R=0;var $t5;for(iChild=0,$t5=TW3Component.GetChildCount(S);iChild<$t5;iChild++){obj=TW3Component.GetChildObject(S,iChild);if(((obj!==null)&&$Is(obj,TW3CustomControl))&&obj.FHandle$1){objZIndex=TW3CustomControl.GetZIndexAsInt($As(obj,TW3CustomControl),0);if(objZIndex>R)R=objZIndex;objZIndex=TW3CustomControl.GetMaxZIndex($As(obj,TW3CustomControl));if(objZIndex>R)R=objZIndex}}
return R},getScrollInfo:function(S){var R=null;if(S.FScrollInfo===null)S.FScrollInfo=TW3OwnedObject.Create$4$($New(TW3ScrollInfo),S);R=S.FScrollInfo;return R},getStyleClass:function(S){return w3_getAttribAsStr(S.FHandle$1,"class")},GetZIndexAsInt:function(S,default$1){var R=0;var mData$3=undefined;R=default$1;mData$3=S.FHandle$1.style["zIndex"];if(S.FHandle$1){if(TVariant.IsNumber(mData$3)){R=parseInt(mData$3,10)}else if(TVariant.IsString(mData$3)){R=parseInt(mData$3,10);if(isNaN(R))R=default$1}}
return R},getZoom:function(S){return w3_getStyleAsFloat(S.FHandle$1,"zoom")},InitializeCapture:function(S){var doc$1=undefined;doc$1=document;doc$1.addEventListener("mousedown",function(evt){if(vCaptureControl!==null){TW3CustomControl.CBMouseDown$(vCaptureControl,evt);evt.stopImmediatePropagation()}},true);doc$1.addEventListener("mousemove",function(evt$1){if(vCaptureControl!==null){TW3CustomControl.CBMouseMove$(vCaptureControl,evt$1);evt$1.stopImmediatePropagation()}},true);doc$1.addEventListener("mouseup",function(evt$2){if(vCaptureControl!==null){TW3CustomControl.CBMouseUp$(vCaptureControl,evt$2);evt$2.stopImmediatePropagation()}
vCaptureControl=null},true);doc$1.addEventListener("mouseover",function(evt$3){if(vCaptureControl!==null){TW3CustomControl.CBMouseEnter(vCaptureControl,evt$3);evt$3.stopImmediatePropagation()}},true);doc$1.addEventListener("mouseout",function(evt$4){if(vCaptureControl!==null){TW3CustomControl.CBMouseExit(vCaptureControl,evt$4);evt$4.stopImmediatePropagation()}},true);doc$1.addEventListener("mousewheel",function(evt$5){if(vCaptureControl!==null){TW3CustomControl.CBMouseWheel(vCaptureControl,evt$5);evt$5.stopImmediatePropagation()}},true);doc$1.addEventListener("onclick",function(evt$6){if(vCaptureControl!==null){TW3CustomControl.CBClick$(vCaptureControl,evt$6);evt$6.stopImmediatePropagation()}},true);doc$1.addEventListener("ondblclick",function(evt$7){if(vCaptureControl!==null){TW3CustomControl.CBDblClick(vCaptureControl,evt$7);evt$7.stopImmediatePropagation()}},true);vCaptureInitialized=true},InitializeObject:function(S){TW3MovableControl.InitializeObject(S);S.FNoBehavior=$Event0(S,TW3Component.CBNoBehavior);w3_bind2(S.FHandle$1,"onselectstart",$Event0(S,TW3Component.CBNoBehavior));w3_bind2(S.FHandle$1,"onfocus",$Event0(S,TW3CustomControl.CBFocused));w3_bind2(S.FHandle$1,"onblur",$Event0(S,TW3CustomControl.CBLostFocus))},Invalidate:function(S){},LayoutChildren:function(S){var x$3=0;var mChild$1=null;TW3TagObj.BeginUpdate(S);try{var $t6;for(x$3=0,$t6=TW3Component.GetChildCount(S);x$3<$t6;x$3++){mChild$1=TW3Component.GetChildObject(S,x$3);if($Is(mChild$1,TW3CustomControl))setTimeout($Event0($As(mChild$1,TW3CustomControl),TW3CustomControl.LayoutChildren),10)}}finally{TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)}},MouseDown:function(S,button$1,shiftState$6,x$4,y){if(S.FOnMouseDown)S.FOnMouseDown(S,button$1,shiftState$6,x$4,y)},MouseEnter:function(S,shiftState$7,x$5,y$1){if(S.FOnMouseEnter)S.FOnMouseEnter(S,shiftState$7,x$5,y$1)},MouseExit:function(S,shiftState$8,x$6,y$2){if(S.FOnMouseExit)S.FOnMouseExit(S,shiftState$8,x$6,y$2)},MouseMove:function(S,shiftState$9,x$7,y$3){if(S.FOnMouseMove)S.FOnMouseMove(S,shiftState$9,x$7,y$3)},MouseUp:function(S,button$2,shiftState$10,x$8,y$4){if(S.FOnMouseUp)S.FOnMouseUp(S,button$2,shiftState$10,x$8,y$4)},MouseWheel:function(S,shift,wheelDelta$2,mousePos$2,handled$3){if(S.FOnMouseWheel)S.FOnMouseWheel(S,shift,wheelDelta$2,mousePos$2,handled$3)},ReleaseCapture:function(S){--S.FMouseCaptured;if(!S.FMouseCaptured){if(S.FHandle$1.releaseCapture){S.FHandle$1.releaseCapture()}
vCaptureControl=null}else if(S.FMouseCaptured<0)S.FMouseCaptured=0},SendToBack:function(S){var iChild$1=0;var obj$1=null;var pushUp=0;var minZIndex=0;var objZIndex$1=0;var objZIndex$2=0;if(S.FHandle$1){minZIndex=99999;if((S.FParent!==null)&&$Is(S.FParent,TW3Component)){var $t7;for(iChild$1=0,$t7=TW3Component.GetChildCount(S.FParent);iChild$1<$t7;iChild$1++){obj$1=TW3Component.GetChildObject(S.FParent,iChild$1);if(((obj$1!==null)&&$Is(obj$1,TW3CustomControl))&&obj$1.FHandle$1){objZIndex$1=TW3CustomControl.GetZIndexAsInt($As(obj$1,TW3CustomControl),99999);if(objZIndex$1<minZIndex)minZIndex=objZIndex$1}}}
if(minZIndex==99999)minZIndex=0;if((S.FParent!==null)&&$Is(S.FParent,TW3Component)){if(minZIndex<0){pushUp=-minZIndex}else pushUp=1;var $t8;for(iChild$1=0,$t8=TW3Component.GetChildCount(S.FParent);iChild$1<$t8;iChild$1++){obj$1=TW3Component.GetChildObject(S.FParent,iChild$1);if((((obj$1!==null)&&(obj$1!==S))&&$Is(obj$1,TW3CustomControl))&&obj$1.FHandle$1){objZIndex$2=TW3CustomControl.GetZIndexAsInt($As(obj$1,TW3CustomControl),-1);if(objZIndex$2<0){obj$1.FHandle$1.style.zIndex=(minZIndex+pushUp+1)}else{obj$1.FHandle$1.style.zIndex=(objZIndex$2+pushUp)}}}}
S.FHandle$1.style.zIndex=((minZIndex+pushUp)-1)}},setAngle:function(S,aValue$21){var mStyle="";if(aValue$21!=S.FAngle){S.FAngle=aValue$21;mStyle="rotate("+(aValue$21).toFixed(2)+"deg)";w3_setStyle(S.FHandle$1,w3_CSSPrefix("Transform"),mStyle)}},setBorderRadius:function(S,aNewRadius){TW3TagObj.BeginUpdate(S);w3_setStyle(S.FHandle$1,"borderRadius",TInteger.ToPxStr(aNewRadius));TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)},SetCapture:function(S){if(!S.FMouseCaptured){if(S.FHandle$1.setCapture){S.FHandle$1.setCapture(true)}else if(!vCaptureInitialized)TW3CustomControl.InitializeCapture(S.ClassType);vCaptureControl=S}
++S.FMouseCaptured},SetEnabled:function(S,aValue$22){S.FHandle$1.disabled=(!aValue$22)},SetFocus:function(S){if(S.FHandle$1){S.FHandle$1.focus()}},setStyleClass:function(S,aStyle){w3_setAttrib(S.FHandle$1,"class",aStyle)},setZoom:function(S,aValue$23){w3_setStyle(S.FHandle$1,"zoom",aValue$23)},StyleTagObject:function(S){TW3TagObj.StyleTagObject(S);TW3CustomControl.setStyleClass(S,TObject.ClassName(S.ClassType));TW3MovableControl.SetVisible(S,true)},_setAnimationBegins:function(S,aValue$24){if(aValue$24){S.FHandle$1[w3_CSSPrefix("AnimationStart")]=$Event1(S,TW3CustomControl.CBAnimationBegins)}else{S.FHandle$1[w3_CSSPrefix("AnimationStart")]=S.FNoBehavior}
S.FOnAnimationBegins=aValue$24},_setAnimationEnds:function(S,aValue$25){if(aValue$25){S.FHandle$1[w3_CSSPrefix("AnimationEnd")]=$Event1(S,TW3CustomControl.CBAnimationEnds)}else{S.FHandle$1[w3_CSSPrefix("AnimationEnd")]=S.FNoBehavior}
S.FOnAnimationEnds=aValue$25},_setChanged:function(S,aValue$26){if(aValue$26){S.FHandle$1["onchange"]=$Event1(S,TW3CustomControl.CBChanged)}else{S.FHandle$1["onchange"]=S.FNoBehavior}
S.FOnChanged=aValue$26},_setContextPopup:function(S,aValue$27){var mObj$2=undefined;mObj$2=S.FHandle$1;if(aValue$27){mObj$2["oncontextmenu"]=$Event1(S,TW3CustomControl.CBContextPopup)}else{mObj$2["oncontextmenu"]=S.FNoBehavior}
S.FOnContextPopup=aValue$27},_setGestureChange:function(S,aValue$28){if(S.FOnGestureChange){w3_RemoveEvent(S.FHandle$1,"gesturechange",$Event0(S,TW3CustomControl.CMGestureChange),true);S.FOnGestureChange=null}
if(aValue$28){S.FOnGestureChange=aValue$28;w3_AddEvent(S.FHandle$1,"gesturechange",$Event0(S,TW3CustomControl.CMGestureChange),true)}},_setGestureEnd:function(S,aValue$29){if(S.FOnGestureEnd){w3_RemoveEvent(S.FHandle$1,"gesturestart",$Event0(S,TW3CustomControl.CMGestureEnd),true);S.FOnGestureEnd=null}
if(aValue$29){S.FOnGestureEnd=aValue$29;w3_AddEvent(S.FHandle$1,"gestureend",$Event0(S,TW3CustomControl.CMGestureEnd),true)}},_setGestureStart:function(S,aValue$30){if(S.FOnGestureStart){w3_RemoveEvent(S.FHandle$1,"gesturestart",$Event0(S,TW3CustomControl.CMGestureStart),true);S.FOnGestureStart=null}
if(aValue$30){S.FOnGestureStart=aValue$30;w3_AddEvent(S.FHandle$1,"gesturestart",$Event0(S,TW3CustomControl.CMGestureStart),true)}},_setGotFocus:function(S,aValue$31){S.FOnGotFocus=aValue$31},_setKeyDown:function(S,aValue$32){S.FHandle$1["onkeydown"]=$Event1(S,TW3CustomControl.CBKeyDown$);S.FOnKeyDown=aValue$32},_setKeyPress:function(S,aValue$33){if(aValue$33){S.FHandle$1["onkeypress"]=$Event1(S,TW3CustomControl.CBKeyPress)}else{S.FHandle$1["onkeypress"]=S.FNoBehavior}
S.FOnKeyPress=aValue$33},_setKeyUp:function(S,aValue$34){S.FHandle$1["onkeyup"]=$Event1(S,TW3CustomControl.CBKeyUp$);S.FOnKeyUp=aValue$34},_setLostFocus:function(S,aValue$35){S.FOnLostFocus=aValue$35},_setMouseClick:function(S,aValue$36){S.FOnClick=aValue$36},_setMouseDblClick:function(S,aValue$37){if(aValue$37){S.FHandle$1["ondblclick"]=$Event1(S,TW3CustomControl.CBDblClick)}else{S.FHandle$1["ondblclick"]=S.FNoBehavior}
S.FOnDblClick=aValue$37},_setMouseDown:function(S,aValue$38){S.FHandle$1["onmousedown"]=$Event1(S,TW3CustomControl.CBMouseDown$);S.FOnMouseDown=aValue$38},_setMouseEnter:function(S,aValue$39){if(aValue$39){S.FHandle$1["onmouseover"]=$Event1(S,TW3CustomControl.CBMouseEnter)}else{S.FHandle$1["onmouseover"]=S.FNoBehavior}
S.FOnMouseEnter=aValue$39},_setMouseExit:function(S,aValue$40){if(aValue$40){S.FHandle$1["onmouseout"]=$Event1(S,TW3CustomControl.CBMouseExit)}else{S.FHandle$1["onmouseout"]=S.FNoBehavior}
S.FOnMouseExit=aValue$40},_setMouseMove:function(S,aValue$41){S.FHandle$1["onmousemove"]=$Event1(S,TW3CustomControl.CBMouseMove$);S.FOnMouseMove=aValue$41},_setMouseUp:function(S,aValue$42){S.FHandle$1["onmouseup"]=$Event1(S,TW3CustomControl.CBMouseUp$);S.FOnMouseUp=aValue$42},_setMouseWheel:function(S,aValue$43){var onEventSupported=false;var mObj$3=undefined;mObj$3=S.FHandle$1;onEventSupported='onmousewheel'in mObj$3;if(onEventSupported){if(aValue$43){mObj$3["onmousewheel"]=$Event1(S,TW3CustomControl.CBMouseWheel)}else{mObj$3["onmousewheel"]=S.FNoBehavior}}else if(aValue$43){mObj$3.addEventListener("DOMMouseScroll",$Event1(S,TW3CustomControl.CBMouseWheel),false)}else{mObj$3.removeEventListener("DOMMouseScroll",$Event1(S,TW3CustomControl.CBMouseWheel),false)}
S.FOnMouseWheel=aValue$43},_setResize:function(S,aValue$44){S.FOnResize=aValue$44},_setTouchBegins:function(S,aValue$45){if(aValue$45)TW3CustomControl.BindTouch(S);S.FOnTouchBegins=aValue$45},_setTouchEnds:function(S,aValue$46){if(aValue$46)TW3CustomControl.BindTouch(S);S.FOnTouchEnds=aValue$46},_setTouchMoves:function(S,aValue$47){if(aValue$47)TW3CustomControl.BindTouch(S);S.FOnTouchMoves=aValue$47},Destroy:TW3TagObj.Destroy,AfterUpdate$:function($){return $.ClassType.AfterUpdate($)},FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18$:function($){return $.ClassType.Create$18.apply($.ClassType,arguments)},GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick$:function($){return $.ClassType.CBClick.apply($.ClassType,arguments)},CBKeyDown$:function($){return $.ClassType.CBKeyDown.apply($.ClassType,arguments)},CBKeyUp$:function($){return $.ClassType.CBKeyUp.apply($.ClassType,arguments)},CBMouseDown$:function($){return $.ClassType.CBMouseDown.apply($.ClassType,arguments)},CBMouseMove$:function($){return $.ClassType.CBMouseMove.apply($.ClassType,arguments)},CBMouseUp$:function($){return $.ClassType.CBMouseUp.apply($.ClassType,arguments)},GetEnabled$:function($){return $.ClassType.GetEnabled($)},Invalidate$:function($){return $.ClassType.Invalidate($)},SetEnabled$:function($){return $.ClassType.SetEnabled.apply($.ClassType,arguments)}};var TW3DisplayView={$ClassName:"TW3DisplayView",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FArrange=false;$.FArrangeKind=0},ArrangeChildren:function(S,aKind){var x$9=0;var dx$1=0;var dy$1=0;var mObj$4=null;var mCount$1=0;var mRect={Bottom$1:0,Left$1:0,Right$1:0,Top$1:0};var wd=0;var hd=0;mCount$1=TW3Component.GetChildCount(S);if(mCount$1>0){mRect=TW3MovableControl.getBoundsRect(S);switch(aKind){case 0:wd=TRect$Width$1(mRect);hd=TRect$Height$1(mRect);var $t9;for(x$9=0,$t9=mCount$1;x$9<$t9;x$9++){mObj$4=TW3Component.GetChildObject(S,x$9);if($Is(mObj$4,TW3CustomControl)&&(!$Is(mObj$4,TW3BlockBox)))TW3MovableControl.SetSize($As(mObj$4,TW3CustomControl),wd,hd)}
break;case 1:dy$1=mRect.Top$1;wd=TRect$Width$1(mRect);var $tA;for(x$9=0,$tA=mCount$1;x$9<$tA;x$9++){mObj$4=TW3Component.GetChildObject(S,x$9);if($Is(mObj$4,TW3CustomControl)&&(!$Is(mObj$4,TW3BlockBox))){hd=TW3MovableControl.GetHeight$($As(mObj$4,TW3CustomControl));TW3MovableControl.SetBounds$2($As(mObj$4,TW3CustomControl),mRect.Left$1,dy$1,wd,hd);(dy$1+=hd)}}
break;case 2:dx$1=mRect.Left$1;hd=TRect$Height$1(mRect);var $tB;for(x$9=0,$tB=mCount$1;x$9<$tB;x$9++){mObj$4=TW3Component.GetChildObject(S,x$9);if($Is(mObj$4,TW3CustomControl)&&(!$Is(mObj$4,TW3BlockBox))){wd=TW3MovableControl.GetWidth$($As(mObj$4,TW3CustomControl));TW3MovableControl.SetBounds$2($As(mObj$4,TW3CustomControl),dx$1,mRect.Top$1,wd,hd);(dx$1+=wd)}}
break}}},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FArrange=true;S.FArrangeKind=0},Resize:function(S){TW3MovableControl.Resize(S);if(S.FArrange)TW3DisplayView.ArrangeChildren(S,S.FArrangeKind)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3Display={$ClassName:"TW3Display",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FFooter=$.FHeader=$.FOnOrient=$.FView=null},FinalizeObject:function(S){TObject.Free(S.FView);if(S.FHeader)TObject.Free(S.FHeader);if(S.FFooter)TObject.Free(S.FFooter);TW3CustomControl.FinalizeObject(S)},GetHeightOfChildren:function(S){var R=0;var x$10=0;var mObj$5=null;var $tC;for(x$10=0,$tC=TW3Component.GetChildCount(S);x$10<$tC;x$10++){mObj$5=TW3Component.GetChildObject(S,x$10);if(((mObj$5!==S.FView)&&$Is(mObj$5,TW3CustomControl))&&(!$Is(mObj$5,TW3BlockBox)))(R+=TW3MovableControl.GetHeight$($As(mObj$5,TW3CustomControl)))}
return R},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FView=TW3Component.Create$18$($New(TW3DisplayView),S);TW3MovableControl.setTop(S.FView,5)},PositionFormInView:function(S,aForm){var mApp=null;var dx$2=0;var dy$2=0;if(aForm){mApp=Application();if((mApp!==null)&&(!mApp.FTerminated)){dx$2=TW3ScrollInfo.GetScrollLeft(TW3CustomControl.getScrollInfo(S.FView));dy$2=TW3ScrollInfo.GetScrollTop(TW3CustomControl.getScrollInfo(S.FView));TW3MovableControl.SetBounds$2(aForm,dx$2,dy$2,TW3MovableControl.GetWidth$(S.FView),TW3MovableControl.GetHeight$(S.FView))}}else{throw EW3Exception.CreateFmt($New(EW3Screen),"Method %s in class %s threw exception [%s]",["PositionFormInView",TObject.ClassName(S.ClassType),"Form parameter was NIL error"])}},Resize:function(S){var mTotal=0;var mList=[];var x$11=0;var dy$3=0;var mObj$6=null;TW3MovableControl.Resize(S);mTotal=TW3Display.GetHeightOfChildren(S);TW3MovableControl.setHeight$(S.FView,TW3MovableControl.GetHeight$(S)-mTotal);mList=TW3CustomControl.GetChildrenSortedByYPos(S);dy$3=0;var $tD;for(x$11=0,$tD=mList.length;x$11<$tD;x$11++){mObj$6=$As(mList[x$11],TW3CustomControl);if($Is(mObj$6,TW3BlockBox)){TW3MovableControl.SetBounds$2(mObj$6,0,0,TW3MovableControl.GetWidth$(S),TW3MovableControl.GetHeight$(S))}else{TW3MovableControl.SetBounds$2(mObj$6,0,dy$3,TW3MovableControl.GetWidth$(S),TW3MovableControl.GetHeight$(mObj$6));(dy$3+=TW3MovableControl.GetHeight$(mObj$6));if(!x$11)(dy$3+=2)}}},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3CustomApplication={$ClassName:"TW3CustomApplication",$Parent:TObject,$Init:function($){TObject.$Init($);$.FBody=$.FCurrentForm=$.FDisplay=$.FEnterAnim=$.FLeaveAnim=$.FMainForm=$.FOnBeforeUnload=$.FOnUnload=$.FTransDst=$.FTransSrc=null;$.FEntryEffect=0;$.FFormChangeActive=$.FTerminated=false;$.FForms=[]},AdjustScreen:function(S){TW3ScrollInfo.ScrollTo(TW3CustomControl.getScrollInfo(S.FDisplay),0,0);TW3MovableControl.SetBounds$2(S.FDisplay,0,0,TDocumentBody.getWidth(S.FBody),TDocumentBody.getHeight(S.FBody))},ApplicationClosing:function(S){},ApplicationStarted:function(S){},ApplicationStarting:function(S){TW3CustomApplication.AdjustScreen(S)},CBOnBeforeUnload:function(S){if(S.FOnBeforeUnload)S.FOnBeforeUnload(S)},CBOnOrientationChange:function(S){var mOrientation=0;var mTemp$2=0;var mEntry=null;mTemp$2=parseInt(window.orientation,10);switch(mTemp$2){case 0:mOrientation=0;break;case 90:mOrientation=1;break;case(-90):mOrientation=2;break;case 180:mOrientation=3;break}
try{if(S.FDisplay){mEntry=S.FDisplay.FOnOrient;if(mEntry)mEntry(S.FDisplay,mOrientation,mTemp$2)}}finally{TW3CustomApplication.AdjustScreen(S)}},CBOnReSize:function(S){TW3CustomApplication.AdjustScreen(S)},CBOnUnLoad:function(S){try{if(S.FOnUnload)S.FOnUnload(S)}finally{if(!S.FTerminated)TW3CustomApplication.Terminate(S)}},Create$20:function(S){TObject.Create(S);S.FBody=TW3Component.Create$18$($New(TDocumentBody),null);S.FDisplay=TW3Component.Create$18$($New(TW3Display),S.FBody);if(!Instance)Instance=S;return S},CreateForm:function(S,aForm$1,isMainForm){var R=null;R=TW3Component.Create$18$($NewDyn(aForm$1," in TW3CustomApplication.CreateForm [line: 829, column: 19, file: SmartCL.Application]"),S.FDisplay.FView);TW3CustomApplication.RegisterFormInstance(S,R,isMainForm);return R},Destroy:function(S){if(!S.FTerminated)TW3CustomApplication.Terminate(S);TObject.Free(S.FDisplay);TObject.Free(S.FBody);Instance=null;TObject.Destroy(S)},GotoFormByRef:function(S,aForm$2,Effect){var mIndex$1=0;if(S.FTerminated)return;if(S.FFormChangeActive){throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.GotoFormByRef",TObject.ClassName(S.ClassType),"A form transition is already active error"])}
if(aForm$2===null){throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.GotoFormByRef",TObject.ClassName(S.ClassType),"Form parameter is NIL error"])}
mIndex$1=S.FForms.indexOf(aForm$2);if(mIndex$1<0){throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.GotoFormByRef",TObject.ClassName(S.ClassType),"Form not registered error"])}
if(aForm$2===S.FCurrentForm)return;if(S.FCurrentForm===null){S.FCurrentForm=aForm$2;TW3Display.PositionFormInView(S.FDisplay,aForm$2);TW3MovableControl.SetVisible(aForm$2,true);TW3CustomForm.FormActivated(aForm$2);return}
if(!Effect){TW3CustomForm.FormDeactivated(S.FCurrentForm);TW3MovableControl.SetVisible(S.FCurrentForm,false);TW3MovableControl.SetVisible(aForm$2,true);TW3Display.PositionFormInView(S.FDisplay,aForm$2);TW3CustomForm.FormActivated(aForm$2);S.FCurrentForm=aForm$2;return}
S.FFormChangeActive=true;S.FEntryEffect=Effect;TW3CustomControl.BringToFront(aForm$2);TW3CustomForm.FormDeactivated(S.FCurrentForm);S.FTransSrc=S.FCurrentForm;S.FTransDst=aForm$2;TW3MovableControl.SetVisible(aForm$2,true);TW3Display.PositionFormInView(S.FDisplay,aForm$2);if((S.FEnterAnim===null)||(S.FLeaveAnim===null)){S.FEnterAnim=TW3CustomAnimation.Create$45$($New(TW3NamedAnimation));TW3CustomAnimation.SetDuration(S.FEnterAnim,0.3);S.FLeaveAnim=TW3CustomAnimation.Create$45$($New(TW3NamedAnimation));TW3CustomAnimation.SetDuration(S.FLeaveAnim,0.3)}
switch(Effect){case 1:S.FEnterAnim.FName$2="MOVE-LEFT";S.FLeaveAnim.FName$2="MOVE-OUT-LEFT";break;case 2:S.FEnterAnim.FName$2="MOVE-RIGHT";S.FLeaveAnim.FName$2="MOVE-OUT-RIGHT";break}
TW3CustomAnimation.ExecuteEx(S.FEnterAnim,aForm$2,null,$Event1(S,TW3CustomApplication.HandleEnterAnimEnds));TW3CustomAnimation.ExecuteEx(S.FLeaveAnim,S.FCurrentForm,null,$Event1(S,TW3CustomApplication.HandleLeaveAnimEnds))},HandleEnterAnimEnds:function(S,Sender){var mAnim=null;mAnim=$As(Sender,TW3NamedAnimation);switch(S.FEntryEffect){case 1:TW3MovableControl.MoveTo(S.FTransDst,0,0);S.FCurrentForm=S.FTransDst;TW3CustomForm.FormActivated(S.FCurrentForm);S.FFormChangeActive=false;break;case 2:TW3MovableControl.MoveTo(S.FTransDst,0,0);S.FCurrentForm=S.FTransDst;TW3CustomForm.FormActivated(S.FCurrentForm);TW3MovableControl.SetVisible(S.FTransSrc,false);TW3Display.PositionFormInView(S.FDisplay,S.FTransSrc);S.FFormChangeActive=false;break}
TObject.Free(mAnim);mAnim=null},HandleLeaveAnimEnds:function(S,Sender$1){var mAnim$1=null;mAnim$1=$As(Sender$1,TW3NamedAnimation);TW3MovableControl.SetVisible(S.FTransSrc,false);TObject.Free(mAnim$1)},HookWindowEvents:function(S){w3_bind2(document.body,"onunload",$Event0(S,TW3CustomApplication.CBOnUnLoad));w3_bind2(document.body,"onbeforeunload",$Event0(S,TW3CustomApplication.CBOnBeforeUnload));w3_bind2(window,"onresize",$Event0(S,TW3CustomApplication.CBOnReSize));w3_bind2(window,"onorientationchange",$Event0(S,TW3CustomApplication.CBOnOrientationChange))},RegisterFormInstance:function(S,aForm$3,isMainForm$1){if(!S.FTerminated){if(aForm$3){if(S.FForms.indexOf(aForm$3)<0){try{S.FForms.push(aForm$3)}catch($e){var e$4=$W($e);throw EW3Exception.CreateFmt($New(EW3Exception),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.RegisterFormInstance",TObject.ClassName(S.ClassType),e$4.FMessage])}
w3_RequestAnimationFrame(function(){TW3MovableControl.AdjustToParentBox(aForm$3)});if(isMainForm$1){S.FMainForm=aForm$3}else TW3MovableControl.SetVisible(aForm$3,false)}else{throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.RegisterFormInstance",TObject.ClassName(S.ClassType),"Form already registered"])}}else{throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.RegisterFormInstance",TObject.ClassName(S.ClassType),"Form parameter is NIL error"])}}},RunApp:function(S){var FTemp$1=null;TW3CustomApplication.HookWindowEvents(S);TW3CustomApplication.ApplicationStarting(S);TApplicationFormsList.AutoCreateForms(FormsFactory(),S.FDisplay.FView);if(S.FMainForm){FTemp$1=S.FMainForm;S.FMainForm=null;TW3CustomApplication.GotoFormByRef(S,FTemp$1,0)}
TW3CustomApplication.ApplicationStarted(S)},Terminate:function(S){var x$12=0;if(S.FTerminated)return;S.FTerminated=true;TW3CustomApplication.ApplicationClosing(S);try{var $tE;for(x$12=0,$tE=S.FForms.length;x$12<$tE;x$12++){TObject.Free(S.FForms[x$12]);S.FForms[x$12]=null}
S.FForms.length=0}finally{TObject.Free(S)}},UnRegisterFormInstance:function(S,aForm$4){var mIndex$2=0;if(!S.FTerminated){if(aForm$4){mIndex$2=S.FForms.indexOf(aForm$4);if(mIndex$2>=0){if(S.FMainForm!==aForm$4){if(S.FCurrentForm===aForm$4)TW3CustomApplication.GotoFormByRef(S,S.FMainForm,0);S.FForms.splice(mIndex$2,1);try{TObject.Free(aForm$4)}catch($e){var e$5=$W($e);throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.UnRegisterFormInstance",TObject.ClassName(S.ClassType),e$5.FMessage])}}else{throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.UnRegisterFormInstance",TObject.ClassName(S.ClassType),"Main form cannot be removed error"])}}else{throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.UnRegisterFormInstance",TObject.ClassName(S.ClassType),"Form is not registered"])}}else{throw EW3Exception.CreateFmt($New(EW3Application),"Method %s in class %s threw exception [%s]",["TW3CustomApplication.UnRegisterFormInstance",TObject.ClassName(S.ClassType),"Form parameter is NIL error"])}}},Destroy$:function($){return $.ClassType.Destroy($)}};var TW3BlockBox={$ClassName:"TW3BlockBox",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TModalResult=["mrCancel","mrOK"];var TFormEntryEffect=["feNone","feFromRight","feToLeft"];var TDisplayOrientation=["soPortrait","soLandscapeLeft","soLandscapeRight","soFlipped"];var TApplicationFormsList={$ClassName:"TApplicationFormsList",$Parent:TObject,$Init:function($){TObject.$Init($);$.FFormOwner=null;$.FList=[];$.FNextAutoCreate=0},AutoCreateForm:function(S,aFormInfo){aFormInfo.a$10=TW3Component.Create$18$($NewDyn(aFormInfo.a$8," in TApplicationFormsList.AutoCreateForm [line: 1058, column: 45, file: SmartCL.Application]"),S.FFormOwner);TW3CustomApplication.RegisterFormInstance(Application(),aFormInfo.a$10,aFormInfo.a$12);aFormInfo.a$13=true},AutoCreateForms:function(S,owner){var a$59=0;var info=null;var a$60=[];S.FFormOwner=owner;S.FNextAutoCreate=0;a$60=S.FList;var $tF;for(a$59=0,$tF=a$60.length;a$59<$tF;a$59++){info=a$60[a$59];TApplicationFormsList.AutoCreateForm(S,info);++S.FNextAutoCreate;if(info.a$12)break}
setTimeout($Event0(S,TApplicationFormsList.AutoCreateNextForm),50)},AutoCreateNextForm:function(S){var iForm=0;var info$1=null;var $tG;for(iForm=S.FNextAutoCreate,$tG=S.FList.length;iForm<$tG;iForm++){info$1=S.FList[iForm];if((info$1.a$9&&(!(info$1.a$10!==null)))&&(!info$1.a$13)){TApplicationFormsList.AutoCreateForm(S,info$1);++S.FNextAutoCreate;if(S.FNextAutoCreate<(S.FList.length-1))setTimeout($Event0(S,TApplicationFormsList.AutoCreateNextForm),50);break}}},IndexOfFormClass:function(S,aFormClass){var R=0;var $tH;for(R=0,$tH=S.FList.length;R<$tH;R++){if(S.FList[R].a$8==aFormClass)return R}
R=-1;return R},RegisterFormInstance$1:function(S,aFormClass$1,aFormInstance){var formInfo=null;var idx=0;idx=TApplicationFormsList.IndexOfFormClass(S,aFormClass$1);if(idx>=0){formInfo=S.FList[idx]}else{formInfo=TObject.Create($New(TApplicationFormInfo));formInfo.a$8=aFormClass$1;S.FList.push(formInfo)}
formInfo.a$10=aFormInstance},UnregisterFormInstance:function(S,aFormInstance$1){var i$1=0;var $tI;for(i$1=0,$tI=S.FList.length;i$1<$tI;i$1++){if(S.FList[i$1].a$10===aFormInstance$1)S.FList[i$1].a$10=null}},Destroy:TObject.Destroy};var TApplicationFormInfo={$ClassName:"TApplicationFormInfo",$Parent:TObject,$Init:function($){TObject.$Init($);$.a$13=$.a$12=$.a$9=false;$.a$10=null;$.a$8=null},Destroy:TObject.Destroy};function Forms$2(){return FormsFactory()};var EW3Screen={$ClassName:"EW3Screen",$Parent:EW3Exception,$Init:function($){EW3Exception.$Init($)},Destroy:Exception.Destroy};var EW3Application={$ClassName:"EW3Application",$Parent:EW3Exception,$Init:function($){EW3Exception.$Init($)},Destroy:Exception.Destroy};function Application(){return Instance};var TModalInfo={$ClassName:"TModalInfo",$Parent:TObject,$Init:function($){TObject.$Init($);$.OnOK=null;$.OnCancel=null;$.ModalForm=$.ModalPanel=$.OwnerForm=$.OpaqueMask=null},Destroy:TObject.Destroy};function FormsFactory(){var R=null;if(!GForms)GForms=TObject.Create($New(TApplicationFormsList));R=GForms;return R};var TW3CustomForm={$ClassName:"TW3CustomForm",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FCaption="";$.FInitialized=false},Create$18:function(S,AOwner$3){TW3CustomControl.Create$18(S,AOwner$3);TApplicationFormsList.RegisterFormInstance$1(Forms$2(),$AsClass(TObject.ClassType(S.ClassType),TW3CustomForm),S);return S},Destroy:function(S){TW3CustomApplication.UnRegisterFormInstance(Application(),S);TApplicationFormsList.UnregisterFormInstance(Forms$2(),S)},FormActivated:function(S){var x$13=0;var mObj$7=null;var mControl=null;if(!S.FInitialized){S.FInitialized=true;TW3CustomForm.InitializeForm(S)}
if(S.FObjReady){var $tJ;for(x$13=0,$tJ=TW3Component.GetChildCount(S);x$13<$tJ;x$13++){mObj$7=TW3Component.GetChildObject(S,x$13);if($Is(mObj$7,TW3CustomControl)){mControl=$As(mObj$7,TW3CustomControl);if(mControl.FObjReady&&TW3MovableControl.getVisible(mControl))TW3CustomControl.LayoutChildren(mControl)}}}},FormDeactivated:function(S){},InitializeForm:function(S){},setCaption:function(S,Value$4){S.FCaption=Value$4},StyleTagObject:function(S){TW3CustomControl.StyleTagObject(S);w3_setStyle(S.FHandle$1,w3_CSSPrefix("Transform"),"none");TW3CustomControl.setStyleClass(S,"TW3CustomForm")},Destroy$:function($){return $.ClassType.Destroy($)},AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18$:function($){return $.ClassType.Create$18.apply($.ClassType,arguments)},GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3Form={$ClassName:"TW3Form",$Parent:TW3CustomForm,$Init:function($){TW3CustomForm.$Init($)},Destroy:TW3CustomForm.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomForm.StyleTagObject,Create$18:TW3CustomForm.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3ScrollInfo={$ClassName:"TW3ScrollInfo",$Parent:TW3OwnedObject,$Init:function($){TW3OwnedObject.$Init($)},AcceptParent:function(S,aObject$1){return(aObject$1!==null)&&$Is(aObject$1,TW3TagObj)},GetScrollHeight:function(S){var R=0;var mRef=undefined;mRef=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef){R=TVariant.AsInteger(mRef.scrollHeight)}else EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollHeight",S,"invalid owner handle error");return R},GetScrollLeft:function(S){var R=0;var mRef$1=undefined;mRef$1=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef$1){R=TVariant.AsInteger(mRef$1.scrollLeft)}else EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollLeft",S,"invalid owner handle error");return R},GetScrollTop:function(S){var R=0;var mRef$2=undefined;mRef$2=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef$2){R=TVariant.AsInteger(mRef$2.scrollTop)}else EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollTop",S,"invalid owner handle error");return R},GetScrollWidth:function(S){var R=0;var mRef$3=undefined;mRef$3=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef$3){R=TVariant.AsInteger(mRef$3.scrollWidth)}else EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.GetScrollWidth",S,"invalid owner handle error");return R},ScrollTo:function(S,aLeft$3,aTop$3){var mRef$4=undefined;mRef$4=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef$4){mRef$4.scrollLeft=aLeft$3;mRef$4.scrollTop=aTop$3}else EW3TagObj.RaiseCntErrMethod("TW3ScrollInfo.ScrollTo",S,"invalid owner handle error")},Destroy:TObject.Destroy,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4:TW3OwnedObject.Create$4};var TW3GraphicControl={$ClassName:"TW3GraphicControl",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FCanvas=$.FContext$2=$.FOnPaint=null;$.FDirty$1=false},FinalizeObject:function(S){TObject.Free(S.FCanvas);TObject.Free(S.FContext$2);TW3CustomControl.FinalizeObject(S)},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FContext$2=TW3ControlGraphicContext.Create$32($New(TW3ControlGraphicContext),S.FHandle$1);S.FCanvas=TW3Canvas.Create$34($New(TW3Canvas),S.FContext$2)},Invalidate:function(S){if(!S.FDirty$1){S.FDirty$1=true;TW3AnimationFrame.ScheduleRefresh(S)}},MakeElementTagObj:function(S){return w3_createHtmlElement("canvas")},Paint:function(S){if(S.FOnPaint)S.FOnPaint(S,S.FCanvas)},Refresh:function(S){S.FDirty$1=false;if((((!TW3TagObj.getUpdating(S))&&(S.FCanvas!==null))&&(S.FContext$2!==null))&&TW3MovableControl.getVisible(S))TW3GraphicControl.Paint$(S)},Resize:function(S){TW3MovableControl.Resize(S);w3_setAttrib(S.FHandle$1,"width",w3_getStyle(S.FHandle$1,"width"));w3_setAttrib(S.FHandle$1,"height",w3_getStyle(S.FHandle$1,"height"))},setHeight:function(S,aValue$48){TW3MovableControl.setHeight(S,aValue$48);if(S.FHandle$1){w3_setAttrib(S.FHandle$1,"height",TInteger.ToPxStr(aValue$48))}else EW3TagObj.RaiseCntErrMethod("TW3GraphicControl.SetHeight",S,"invalid control handle error")},SetWidth:function(S,aValue$49){TW3MovableControl.SetWidth(S,aValue$49);if(S.FHandle$1){w3_setAttrib(S.FHandle$1,"width",TInteger.ToPxStr(aValue$49))}else EW3TagObj.RaiseCntErrMethod("TW3GraphicControl.SetWidth",S,"invalid control handle error")},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight$:function($){return $.ClassType.setHeight.apply($.ClassType,arguments)},SetWidth$:function($){return $.ClassType.SetWidth.apply($.ClassType,arguments)},supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate$:function($){return $.ClassType.Invalidate($)},SetEnabled:TW3CustomControl.SetEnabled,Paint$:function($){return $.ClassType.Paint($)}};function Copy$TW3ControlSizeInfo(s,d){d.siClientHeight=s.siClientHeight;d.siClientWidth=s.siClientWidth;d.siHeight=s.siHeight;d.siOffsetHeight=s.siOffsetHeight;d.siOffsetWidth=s.siOffsetWidth;d.siScrollHeight=s.siScrollHeight;d.siScrollWidth=s.siScrollWidth;d.siWidth=s.siWidth;return d}
function Clone$TW3ControlSizeInfo($){return{siClientHeight:$.siClientHeight,siClientWidth:$.siClientWidth,siHeight:$.siHeight,siOffsetHeight:$.siOffsetHeight,siOffsetWidth:$.siOffsetWidth,siScrollHeight:$.siScrollHeight,siScrollWidth:$.siScrollWidth,siWidth:$.siWidth}}
var TW3CustomFont={$ClassName:"TW3CustomFont",$Parent:TObject,$Init:function($){TObject.$Init($);$.FOnChange=null},getColor:function(S){var R={v:0};try{var mRef$5=undefined;var mText$2="";mRef$5=TW3CustomFont.GetHandle$4$(S);if(mRef$5){mText$2=w3_getStyleAsStr(mRef$5,"color");R.v=StrToColor(mText$2)}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.getColor",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}}finally{return R.v}},getName:function(S){var R="";var mHandle=undefined;mHandle=TW3CustomFont.GetHandle$4$(S);if(mHandle){R=w3_getStyleAsStr(mHandle,"fontFamily")}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.getName",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}
return R},getSize:function(S){var R=0;var mRef$6=undefined;mRef$6=TW3CustomFont.GetHandle$4$(S);if(mRef$6){R=w3_getStyleAsInt(mRef$6,"fontSize")}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.getSize",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}
return R},getWeight:function(S){var R="";var mRef$7=undefined;mRef$7=TW3CustomFont.GetHandle$4$(S);if(mRef$7){R=w3_getStyleAsStr(mRef$7,"fontWeight")}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.getWeight",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}
return R},setColor$1:function(S,aNewColor){var mRef$8=undefined;mRef$8=TW3CustomFont.GetHandle$4$(S);if(mRef$8){w3_setStyle(mRef$8,"color",ColorToWebStr(aNewColor,255));if(S.FOnChange)S.FOnChange(S)}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.setColor",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}},setName:function(S,aNewName){var mHandle$1=undefined;mHandle$1=TW3CustomFont.GetHandle$4$(S);if(mHandle$1){w3_setStyle(mHandle$1,"fontFamily",aNewName);if(S.FOnChange)S.FOnChange(S)}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.setName",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}},setSize:function(S,aNewSize){var mRef$9=undefined;mRef$9=TW3CustomFont.GetHandle$4$(S);if(mRef$9){w3_setStyle(mRef$9,"fontSize",TInteger.ToPxStr(aNewSize));if(S.FOnChange)S.FOnChange(S)}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.setSize",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}},setWeight:function(S,aNewWeight){var mRef$10=undefined;mRef$10=TW3CustomFont.GetHandle$4$(S);if(mRef$10){w3_setStyle(mRef$10,"fontWeight",aNewWeight);if(S.FOnChange)S.FOnChange(S)}else{throw EW3Exception.CreateFmt($New(EW3FontError),"Method %s in class %s threw exception [%s]",["TW3CustomFont.setWeight",TObject.ClassName(S.ClassType),"Invalid tag handle error"])}},Destroy:TObject.Destroy,GetHandle$4$:function($){return $.ClassType.GetHandle$4($)}};var TW3ControlFont={$ClassName:"TW3ControlFont",$Parent:TW3CustomFont,$Init:function($){TW3CustomFont.$Init($);$.FOwner$3=null},GetHandle$4:function(S){return S.FOwner$3.FHandle$1},Create$39:function(S,AOwner$4){TObject.Create(S);if(AOwner$4){S.FOwner$3=AOwner$4}else EW3TagObj.RaiseCntErrMethod("TW3ControlFont.Create",S,"Owner was nil error");return S},Destroy:TObject.Destroy,GetHandle$4$:function($){return $.ClassType.GetHandle$4($)}};var TW3ControlBackground={$ClassName:"TW3ControlBackground",$Parent:TW3OwnedObject,$Init:function($){TW3OwnedObject.$Init($)},AcceptParent:function(S,aObject$2){return(aObject$2!==null)&&$Is(aObject$2,TW3MovableControl)},Destroy:TObject.Destroy,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4:TW3OwnedObject.Create$4};var TW3Constraints={$ClassName:"TW3Constraints",$Parent:TW3OwnedObject,$Init:function($){TW3OwnedObject.$Init($)},AcceptParent:function(S,aObject$3){return(aObject$3!==null)&&$Is(aObject$3,TW3TagObj)},GetMaxHeight:function(S){var R=0;var mRef$11=undefined;mRef$11=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$11)R=w3_getStyleAsInt(mRef$11,"max-height");return R},GetMaxWidth:function(S){var R=0;var mRef$12=undefined;mRef$12=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$12)R=w3_getStyleAsInt(mRef$12,"max-width");return R},GetMinHeight:function(S){var R=0;var mRef$13=undefined;mRef$13=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$13)R=w3_getStyleAsInt(mRef$13,"min-height");return R},GetMinWidth:function(S){var R=0;var mRef$14=undefined;mRef$14=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$14)R=w3_getStyleAsInt(mRef$14,"min-width");return R},SetMaxHeight:function(S,aValue$50){var mRef$15=undefined;mRef$15=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$15){mRef$15.style["max-width"]=TInteger.ToPxStr(aValue$50)}},SetMaxWidth:function(S,aValue$51){var mRef$16=undefined;mRef$16=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$16){mRef$16.style["max-width"]=TInteger.ToPxStr(aValue$51)}},SetMinHeight:function(S,aValue$52){var mRef$17=undefined;mRef$17=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$17){mRef$17.style["min-height"]=TInteger.ToPxStr(aValue$52)}},SetMinWidth:function(S,aValue$53){var mRef$18=undefined;mRef$18=$As(S.FOwner,TW3MovableControl).FHandle$1;if(mRef$18){mRef$18.style["min-width"]=TInteger.ToPxStr(aValue$53)}},Destroy:TObject.Destroy,AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4:TW3OwnedObject.Create$4};var TW3AnimationFrame={$ClassName:"TW3AnimationFrame",$Parent:TObject,$Init:function($){TObject.$Init($)},Perform:function(){var i$2=0;var callbacks=[];var controls=[];if(vScheduledCallbacks.length>0){callbacks=vScheduledCallbacks;vScheduledCallbacks=[];var $tK;for(i$2=0,$tK=callbacks.length;i$2<$tK;i$2++){callbacks[i$2]()}}
if(vScheduledControls.length>0){controls=vScheduledControls;vScheduledControls=[];var $tL;for(i$2=0,$tL=controls.length;i$2<$tL;i$2++){TW3GraphicControl.Refresh(controls[i$2])}}
var $tM;for(i$2=0,$tM=vOnPerform.length;i$2<$tM;i$2++){vOnPerform[i$2]()}},ScheduleRefresh:function(control){vScheduledControls.push(control);if(!vPending)w3_RequestAnimationFrame(TW3AnimationFrame.Perform)},Destroy:TObject.Destroy};var TShiftStateEnum=["ssShift","ssAlt","ssCtrl","ssMeta","ssLeft","ssRight","ssMiddle"];var TShiftState={$ClassName:"TShiftState",$Parent:TObject,$Init:function($){TObject.$Init($);$.FEvent=$.FMouseEvent=null;$.FMouseButtons=0},CheckShiftStateEnum:function(S,value$3){var R=false;if(S.FEvent===null){R=false}else{switch(value$3){case 0:R=S.FEvent.shiftKey;break;case 1:R=S.FEvent.altKey;break;case 2:R=S.FEvent.ctrlKey;break;case 3:R=S.FEvent.metaKey;break;case 4:R=((S.FMouseButtons&1)!=0);break;case 5:R=((S.FMouseButtons&4)!=0);break;case 6:R=((S.FMouseButtons&2)!=0);break}}
return R},Current:function(){var R=null;if(vCurrent===null)vCurrent=TObject.Create($New(TShiftState));R=vCurrent;return R},SetKeyStateEvent:function(S,evt$8){S.FEvent=evt$8;S.FMouseEvent=null},SetMouseEvent:function(S,evt$9){S.FEvent=evt$9;S.FMouseEvent=evt$9},Destroy:TObject.Destroy};var TMouseButton=["mbLeft","mbMiddle","mbRight"];var TCustomAppContainer={$ClassName:"TCustomAppContainer",$Parent:TW3Component,$Init:function($){TW3Component.$Init($)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3TagObj.AfterUpdate,FinalizeObject:TW3Component.FinalizeObject,InitializeObject:TW3Component.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3TagObj.StyleTagObject,Create$18:TW3Component.Create$18};var TDocumentBody={$ClassName:"TDocumentBody",$Parent:TCustomAppContainer,$Init:function($){TCustomAppContainer.$Init($)},getHeight:function(S){return parseInt(window.innerHeight,10)},getWidth:function(S){return parseInt(window.innerWidth,10)},MakeElementTagId:function(S){return""},MakeElementTagObj:function(S){return document.body},StyleTagObject:function(S){},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3TagObj.AfterUpdate,FinalizeObject:TW3Component.FinalizeObject,InitializeObject:TW3Component.InitializeObject,MakeElementTagId$:function($){return $.ClassType.MakeElementTagId($)},MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18:TW3Component.Create$18};var EW3TagObj={$ClassName:"EW3TagObj",$Parent:EW3Exception,$Init:function($){EW3Exception.$Init($)},RaiseCntErrMethod:function(methName,instance,msg){throw EW3Exception.CreateFmt($New(EW3TagObj),"Method %s in class %s threw exception [%s]",[methName,(instance!==null)?TObject.ClassName(instance.ClassType):"nil",msg])},Destroy:Exception.Destroy};var TObjectList={$ClassName:"TObjectList",$Parent:TObject,$Init:function($){TObject.$Init($);$.FData$2=[];$.FOnAdded$1=null;$.FOnClear$1=null;$.FOnDeleted$1=null},Add$1:function(S,Value$5){var R=0;R=S.FData$2.length;S.FData$2.push(Value$5);if(S.FOnAdded$1)S.FOnAdded$1(S);return R},Clear$2:function(S){S.FData$2.length=0;if(S.FOnClear$1)S.FOnClear$1(S)},Create$41:function(S){TObject.Create(S);return S},Destroy:function(S){S.FData$2.length=0;TObject.Destroy(S)},GetCount$1:function(S){return S.FData$2.length},GetItem$5:function(S,index$1){return S.FData$2[index$1]},IndexOf$1:function(S,Value$6){return S.FData$2.indexOf(Value$6)},Insert$2:function(S,Index,Value$7){S.FData$2.splice(Index,0,Value$7)},Remove$1:function(S,ondex){S.FData$2.splice(ondex,1);if(S.FOnDeleted$1)S.FOnDeleted$1(S)},SetItem$1:function(S,index$2,value$4){S.FData$2[index$2]=value$4},Swap$1:function(S,aFirst,aSecond){$ArraySwap(S.FData$2,aFirst,aSecond)},Destroy$:function($){return $.ClassType.Destroy($)}};function Copy$TW3RGBA(s,d){d.A$16=s.A$16;d.B$1=s.B$1;d.G$1=s.G$1;d.R$2=s.R$2;return d}
function Clone$TW3RGBA($){return{A$16:$.A$16,B$1:$.B$1,G$1:$.G$1,R$2:$.R$2}}
function StrToColor(aColorStr){aColorStr={v:aColorStr};var R={v:0};try{var mTemp$1="";var xpos=0;var r=0;var g=0;var b=0;aColorStr.v=Trim$_String_(aColorStr.v);if(!aColorStr.v.length)return R.v;if((aColorStr.v.charAt(0)=="#")||(aColorStr.v.charAt(0)=="$")){R.v=parseInt("0x"+Trim$_String_Integer_Integer_(aColorStr.v,1,0),16)}else if((aColorStr.v).substr(0,2)=="0x"){R.v=parseInt(aColorStr.v,16)}else if(((aColorStr.v).substr(0,4)).toLowerCase()=="rgb("){aColorStr.v=Trim$_String_Integer_Integer_(aColorStr.v,4,0);try{xpos=(aColorStr.v.indexOf(",")+1);if(xpos>1){mTemp$1=aColorStr.v.substr(0,(xpos-1));Delete(aColorStr,1,xpos);if(mTemp$1.charAt(0)=="$")mTemp$1="0x"+Trim$_String_Integer_Integer_(mTemp$1,1,0);r=parseInt(mTemp$1,10)}
xpos=(aColorStr.v.indexOf(",")+1);if(xpos>1){mTemp$1=aColorStr.v.substr(0,(xpos-1));Delete(aColorStr,1,xpos);if(mTemp$1.charAt(0)=="$")mTemp$1="0x"+Trim$_String_Integer_Integer_(mTemp$1,1,0);g=parseInt(mTemp$1,10)}
xpos=(aColorStr.v.indexOf(")")+1);if(xpos>1){mTemp$1=aColorStr.v.substr(0,(xpos-1));if(mTemp$1.charAt(0)=="$")mTemp$1="0x"+Trim$_String_Integer_Integer_(mTemp$1,1,0);b=parseInt(mTemp$1,10)}
R.v=RGBToColor(r,g,b)}catch($e){var e$6=$W($e);return R.v}}}finally{return R.v}};function RGBToColor(aRed,aGreen,aBlue){return(aBlue|(aGreen<<8))|(aRed<<16)};function ColorToWebStr(aColor,alpha){return ColorToWebStr$1((aColor>>>16)&255,(aColor>>>8)&255,aColor&255,alpha)};function ColorToWebStr$1(r$1,g$1,b$17,a$61){return(a$61==255)?"#"+IntToHex2(r$1)+IntToHex2(g$1)+IntToHex2(b$17):"rgba("+r$1.toString()+","+g$1.toString()+","+b$17.toString()+","+((a$61/255)).toString()+")"};function ColorToStr(aColor$1){var R="";var rgb=0;rgb=(((aColor$1>>>16)&255)|(aColor$1&65280))|((aColor$1&255)<<16);R="0x"+IntToHex(rgb,6);return R};var EW3FontError={$ClassName:"EW3FontError",$Parent:EW3Exception,$Init:function($){EW3Exception.$Init($)},Destroy:Exception.Destroy};function Copy$TW3TextMetrics(s,d){d.Width$4=s.Width$4;return d}
function Clone$TW3TextMetrics($){return{Width$4:$.Width$4}}
var TW3ImageData={$ClassName:"TW3ImageData",$Parent:TObject,$Init:function($){TObject.$Init($);$.FHandle$2=null},FromImageData:function(S,aImageDataRef){$Assert(aImageDataRef!==null,"Failed to initialize from graphics-context: reference was nil error"," in TW3ImageData.FromImageData [line: 593, column: 3, file: SmartCL.Graphics]");S.FHandle$2=aImageDataRef},Destroy:TObject.Destroy};var TW3CustomGraphicContext={$ClassName:"TW3CustomGraphicContext",$Parent:TObject,$Init:function($){TObject.$Init($)},Allocate$1:function(S,aWidth$2,aHeight$2){if(TW3CustomGraphicContext.GetOwnsReference$(S)){if(VarIsValidRef(TW3CustomGraphicContext.GetDC$(S)))TW3CustomGraphicContext.Release$1(S);TW3CustomGraphicContext.SetSize$1$(S,aWidth$2,aHeight$2)}else{throw Exception.Create($New(Exception),"Cannot modify current graphics context")}},Release$1:function(S){if(TW3CustomGraphicContext.GetOwnsReference$(S)){if(VarIsValidRef(TW3CustomGraphicContext.GetDC$(S)))TW3CustomGraphicContext.ReleaseDC$(S)}else{throw Exception.Create($New(Exception),"Cannot modify current graphics context")}},Destroy:TObject.Destroy,GetDC$:function($){return $.ClassType.GetDC($)},GetHandle$:function($){return $.ClassType.GetHandle($)},GetHeight$1$:function($){return $.ClassType.GetHeight$1($)},GetOwnsReference$:function($){return $.ClassType.GetOwnsReference($)},GetWidth$1$:function($){return $.ClassType.GetWidth$1($)},ReleaseDC$:function($){return $.ClassType.ReleaseDC($)},SetSize$1$:function($){return $.ClassType.SetSize$1.apply($.ClassType,arguments)}};var TW3GraphicContext={$ClassName:"TW3GraphicContext",$Parent:TW3CustomGraphicContext,$Init:function($){TW3CustomGraphicContext.$Init($);$.FObjId="";$.FObjRef=undefined;$.FOwner$2=undefined},Create$31:function(S,AOwner$5){TObject.Create(S);S.FObjRef=w3_createHtmlElement("canvas");S.FObjId=w3_GetUniqueObjId();S.FObjRef.id=S.FObjId;S.FOwner$2=AOwner$5;if(S.FOwner$2)w3_setElementParentByRef(S.FObjRef,S.FOwner$2);return S},Destroy:function(S){if(S.FOwner$2)w3_RemoveElementByRef(S.FObjRef,S.FOwner$2);S.FOwner$2=null;S.FObjRef=null;TObject.Destroy(S)},GetDC:function(S){var R=undefined;if(S.FObjRef){R=S.FObjRef.getContext("2d")}else R=null;return R},GetHandle:function(S){return S.FObjRef},GetHeight$1:function(S){var R=0;if(S.FObjRef)R=parseInt(S.FObjRef.height,10);return R},GetOwnsReference:function(S){return true},GetWidth$1:function(S){var R=0;if(S.FObjRef)R=parseInt(S.FObjRef.width,10);return R},ReleaseDC:function(S){if(S.FObjRef){S.FObjRef.width=0;S.FObjRef.height=0}},SetSize$1:function(S,aNewWidth,aNewHeight){if(S.FObjRef){S.FObjRef.width=aNewWidth;S.FObjRef.height=aNewHeight}},Destroy$:function($){return $.ClassType.Destroy($)},GetDC$:function($){return $.ClassType.GetDC($)},GetHandle$:function($){return $.ClassType.GetHandle($)},GetHeight$1$:function($){return $.ClassType.GetHeight$1($)},GetOwnsReference$:function($){return $.ClassType.GetOwnsReference($)},GetWidth$1$:function($){return $.ClassType.GetWidth$1($)},ReleaseDC$:function($){return $.ClassType.ReleaseDC($)},SetSize$1$:function($){return $.ClassType.SetSize$1.apply($.ClassType,arguments)}};var TW3ControlGraphicContext={$ClassName:"TW3ControlGraphicContext",$Parent:TW3CustomGraphicContext,$Init:function($){TW3CustomGraphicContext.$Init($);$.FCtrlTag=undefined},Create$32:function(S,aControlHandle){TObject.Create(S);if(aControlHandle){S.FCtrlTag=aControlHandle}else{throw Exception.Create($New(Exception),"Control handle is invalid error")}
return S},GetDC:function(S){return S.FCtrlTag.getContext("2d")},GetHandle:function(S){return S.FCtrlTag},GetHeight$1:function(S){return w3_getPropertyAsInt(S.FCtrlTag,"height")},GetOwnsReference:function(S){return false},GetWidth$1:function(S){return w3_getPropertyAsInt(S.FCtrlTag,"width")},ReleaseDC:function(S){},SetSize$1:function(S,aNewWidth$1,aNewHeight$1){},Destroy:TObject.Destroy,GetDC$:function($){return $.ClassType.GetDC($)},GetHandle$:function($){return $.ClassType.GetHandle($)},GetHeight$1$:function($){return $.ClassType.GetHeight$1($)},GetOwnsReference$:function($){return $.ClassType.GetOwnsReference($)},GetWidth$1$:function($){return $.ClassType.GetWidth$1($)},ReleaseDC$:function($){return $.ClassType.ReleaseDC($)},SetSize$1$:function($){return $.ClassType.SetSize$1.apply($.ClassType,arguments)}};var TW3CanvasPattern={$ClassName:"TW3CanvasPattern",$Parent:TObject,$Init:function($){TObject.$Init($)},Destroy:TObject.Destroy};var TW3CanvasGradient={$ClassName:"TW3CanvasGradient",$Parent:TObject,$Init:function($){TObject.$Init($);$.FHandle$4=undefined},Create$33:function(S,aHandle){TObject.Create(S);S.FHandle$4=aHandle;return S},Destroy:TObject.Destroy};var TW3Canvas={$ClassName:"TW3Canvas",$Parent:TObject,$Init:function($){TObject.$Init($);$.FContext=$.FDC=null},ArcF:function(S,x$14,y$5,radius,startAngle,endAngle,anticlockwise){S.FDC.arc(x$14,y$5,radius,startAngle,endAngle,anticlockwise)},BeginPath:function(S){S.FDC.beginPath()},BezierCurveToF:function(S,cp1x,cp1y,cp2x,cp2y,x$15,y$6){S.FDC.bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x$15,y$6)},Clear:function(S){if(S.FContext)S.FDC.clearRect(0,0,TW3CustomGraphicContext.GetWidth$1$(S.FContext),TW3CustomGraphicContext.GetHeight$1$(S.FContext))},Create$34:function(S,Context$2){TObject.Create(S);S.FContext=Context$2;if(S.FContext){S.FDC=TW3CustomGraphicContext.GetDC$(S.FContext)}else{throw Exception.Create($New(Exception),"Invalid canvas context error")}
return S},DrawImageF:function(S,imageHandle,x$16,y$7){S.FDC.drawImage(imageHandle,x$16,y$7)},Fill:function(S){S.FDC.fill()},FillRectF$2:function(S,aLeft$4,aTop$4,aWidth$3,aHeight$3){S.FDC.fillRect(aLeft$4,aTop$4,aWidth$3,aHeight$3)},GetFillStyle:function(S){return""+S.FDC.fillStyle},GetGlobalAlpha:function(S){return S.FDC.globalAlpha},GetLineCap:function(S){return S.FDC.lineCap},GetLineJoin:function(S){return S.FDC.lineJoin},GetLineWidth:function(S){return S.FDC.lineWidth},GetMiterLimit:function(S){return S.FDC.miterLimit},GetStrokeStyle:function(S){return""+S.FDC.strokeStyle},LineToF:function(S,x$17,y$8){S.FDC.lineTo(x$17,y$8)},MoveToF:function(S,x$18,y$9){S.FDC.moveTo(x$18,y$9)},QuadraticCurveToF:function(S,cpx,cpy,x$19,y$10){S.FDC.quadraticCurveTo(cpx,cpy,x$19,y$10)},RectangleF:function(S,aLeft$5,aTop$5,aWidth$4,aHeight$4){S.FDC.rect(aLeft$5,aTop$5,aWidth$4,aHeight$4)},Restore:function(S){if(S.FContext)S.FDC.restore()},Rotate:function(S,angleRad){S.FDC.rotate(angleRad)},Save:function(S){if(S.FContext)S.FDC.save()},Scale:function(S,sx,sy){S.FDC.scale(sx,sy)},SetFillStyle:function(S,aValue$54){S.FDC.fillStyle=aValue$54},SetGlobalAlpha:function(S,aValue$55){S.FDC.globalAlpha=aValue$55},SetLineCap:function(S,aValue$56){S.FDC.lineCap=aValue$56},SetLineJoin:function(S,aValue$57){S.FDC.lineJoin=aValue$57},SetLineWidth:function(S,aValue$58){S.FDC.lineWidth=aValue$58},SetMiterLimit:function(S,aValue$59){S.FDC.miterLimit=aValue$59},SetStrokeStyle:function(S,aValue$60){S.FDC.strokeStyle=aValue$60},Stroke:function(S){S.FDC.stroke()},ToDataURL:function(S,aMimeType){return S.FDC.canvas.toDataURL(aMimeType)},ToImageData:function(S){var R=null;var mTemp$3=null;var wd$1=0;var hd$1=0;wd$1=S.FDC.canvas.width;hd$1=S.FDC.canvas.height;try{mTemp$3=S.FDC.getImageData(0,0,wd$1,hd$1)}catch($e){var e$7=$W($e);throw Exception.Create($New(Exception),"Failed to extract data, browser threw exception: "+e$7.FMessage)}
if(mTemp$3){R=TObject.Create($New(TW3ImageData));TW3ImageData.FromImageData(R,mTemp$3)}
return R},Translate:function(S,tx,ty){S.FDC.translate(tx,ty)},Destroy:TObject.Destroy};var JMouseButton=["Left","Middle","Right"];var TW3CSSClassStyleNames={$ClassName:"TW3CSSClassStyleNames",$Parent:TW3OwnedObject,$Init:function($){TW3OwnedObject.$Init($);$.FCache=[];$.FToken=""},AcceptParent:function(S,aObject$4){return(aObject$4!==null)&&$Is(aObject$4,TW3CustomControl)},Add$2:function(S,aCSSClassName){var R=0;var mRef$19=undefined;if(S.FOwner){mRef$19=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef$19){w3_AddClass(mRef$19,aCSSClassName);S.FCache.push(aCSSClassName);R=S.FCache.length-1}else{throw EW3Exception.CreateFmt($New(EW3TagObj),"Method %s in class %s threw exception [%s]",["TW3CSSClassStyleNames.Add",TObject.ClassName(S.ClassType),"invalid owner handle error"])}}else{throw EW3Exception.CreateFmt($New(EW3CSSClassStyleNames),"Method %s in class %s threw exception [%s]",["TW3CSSClassStyleNames.Add",TObject.ClassName(S.ClassType),"Owner tag-object is NIL error"])}
return R},Create$4:function(S,AOwner$6){TW3OwnedObject.Create$4(S,AOwner$6);S.FToken="class";S.FCache=[];return S},Destroy:function(S){S.FCache.length=0;TObject.Destroy(S)},IndexOf$2:function(S,aCSSClassName$1){var R=0;var x$20=0;R=-1;if(S.FOwner){aCSSClassName$1=(Trim$_String_(aCSSClassName$1)).toLowerCase();if(aCSSClassName$1.length>0){var $tN;for(x$20=0,$tN=S.FCache.length;x$20<$tN;x$20++){if((S.FCache[x$20]).toLowerCase()==aCSSClassName$1){R=x$20;break}}}}else{throw EW3Exception.CreateFmt($New(EW3CSSClassStyleNames),"Method %s in class %s threw exception [%s]",["TW3CSSClassStyleNames.IndexOf",TObject.ClassName(S.ClassType),"Owner tag-object is NIL error"])}
return R},RemoveByName:function(S,aCSSClassName$2){var R="";var mRef$20=undefined;var mIndex$3=0;if(S.FOwner){mRef$20=$As(S.FOwner,TW3TagObj).FHandle$1;if(mRef$20){w3_RemoveClass(mRef$20,aCSSClassName$2);mIndex$3=TW3CSSClassStyleNames.IndexOf$2(S,aCSSClassName$2);if(mIndex$3>=0){S.FCache.splice(mIndex$3,1)}
R=aCSSClassName$2}else{throw EW3Exception.CreateFmt($New(EW3TagObj),"Method %s in class %s threw exception [%s]",["TW3CSSClassStyleNames.RemoveByName",TObject.ClassName(S.ClassType),"invalid owner handle error"])}}else{throw EW3Exception.CreateFmt($New(EW3CSSClassStyleNames),"Method %s in class %s threw exception [%s]",["TW3CSSClassStyleNames.RemoveByName",TObject.ClassName(S.ClassType),"Owner tag-object is NIL error"])}
return R},Destroy$:function($){return $.ClassType.Destroy($)},AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType,arguments)}};var EW3CSSClassStyleNames={$ClassName:"EW3CSSClassStyleNames",$Parent:EW3Exception,$Init:function($){EW3Exception.$Init($)},Destroy:Exception.Destroy};var TW3TouchList={$ClassName:"TW3TouchList",$Parent:TObject,$Init:function($){TObject.$Init($);$.FObjects=[]},a$29:function(S,index$3){return S.FObjects[index$3]},Clear$3:function(S){S.FObjects.length=0},Update:function(S,refObj){var mCount$2=0;var x$21=0;var mObj$8=null;mCount$2=refObj.length;if(mCount$2==S.FObjects.length){var $tO;for(x$21=0,$tO=mCount$2;x$21<$tO;x$21++){TW3Touch.Consume$1(S.FObjects[x$21],refObj[x$21])}}else{TW3TouchList.Clear$3(S);var $tP;for(x$21=0,$tP=mCount$2;x$21<$tP;x$21++){mObj$8=TObject.Create($New(TW3Touch));TW3Touch.Consume$1(mObj$8,refObj[x$21]);S.FObjects.push(mObj$8)}}},Destroy:TObject.Destroy};var TW3TouchData={$ClassName:"TW3TouchData",$Parent:TObject,$Init:function($){TObject.$Init($);$.FChanged=$.FTouches=null},GetChanged:function(S){var R=null;if(!S.FChanged){S.FChanged=TObject.Create($New(TW3TouchList));TW3TouchList.Update(S.FChanged,event.changedTouches)}
R=S.FChanged;return R},Update$1:function(S,eventObj$17){if(S.FTouches)TW3TouchList.Update(S.FTouches,eventObj$17.touches);if(S.FChanged)TW3TouchList.Update(S.FChanged,eventObj$17.changedTouches)},Destroy:TObject.Destroy};var TW3Touch={$ClassName:"TW3Touch",$Parent:TObject,$Init:function($){TObject.$Init($);$.FClientX=$.FClientY=$.FPageX=$.FPageY=$.FScreenX=$.FScreenY=0;$.FIdent=undefined;$.FTarget=null},Consume$1:function(S,touch){S.FScreenX=touch.screenX;S.FScreenY=touch.screenY;S.FClientX=touch.clientX;S.FClientY=touch.clientY;S.FPageX=touch.pageX;S.FPageY=touch.pageY;S.FIdent=touch.identifier;S.FTarget=TVariant.AsObject(touch.target)},Destroy:TObject.Destroy};var TW3GestureData={$ClassName:"TW3GestureData",$Parent:TObject,$Init:function($){TObject.$Init($);$.FRotation=$.FScale=0},Consume$2:function(S,refObj$1){S.FRotation=Number(refObj$1.rotation);S.FScale=Number(refObj$1.scale)},Update$2:function(S){TW3GestureData.Consume$2(S,event)},Destroy:TObject.Destroy};var TW3Borders={$ClassName:"TW3Borders",$Parent:TW3OwnedObject,$Init:function($){TW3OwnedObject.$Init($);$.FBottom=$.FLeft=$.FRight=$.FTop=null},AcceptParent:function(S,aObject$5){return $Is(aObject$5,TW3TagObj)},Create$4:function(S,AOwner$7){TW3OwnedObject.Create$4(S,AOwner$7);S.FLeft=TW3Border.Create$44($New(TW3Border),S,0);S.FTop=TW3Border.Create$44($New(TW3Border),S,1);S.FRight=TW3Border.Create$44($New(TW3Border),S,2);S.FBottom=TW3Border.Create$44($New(TW3Border),S,3);return S},Destroy:function(S){TObject.Free(S.FLeft);TObject.Free(S.FTop);TObject.Free(S.FRight);TObject.Free(S.FBottom);TObject.Destroy(S)},getHSpace:function(S){return TW3Border.getWidth$1(S.FLeft)+TW3Border.getPadding(S.FLeft)+TW3Border.getWidth$1(S.FRight)+TW3Border.getPadding(S.FRight)},getVSpace:function(S){return TW3Border.getWidth$1(S.FTop)+TW3Border.getPadding(S.FTop)+TW3Border.getWidth$1(S.FBottom)+TW3Border.getPadding(S.FBottom)},Destroy$:function($){return $.ClassType.Destroy($)},AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType,arguments)}};var TW3BorderEdgeStyle=["besNone","besSolid","besDotted","besDouble","besGroove","besInset","besOutset"];var TW3BorderEdge=["beLeft","beTop","beRight","beBottom"];var TW3Border={$ClassName:"TW3Border",$Parent:TObject,$Init:function($){TObject.$Init($);$.FEdge=0;$.FEdgeName="";$.FOwner$4=null},Create$44:function(S,AOwner$8,AEdge){TObject.Create(S);S.FOwner$4=AOwner$8;S.FEdge=S.FEdge;switch(AEdge){case 0:S.FEdgeName="Left";break;case 1:S.FEdgeName="Top";break;case 2:S.FEdgeName="Right";break;case 3:S.FEdgeName="Bottom";break}
return S},getPadding:function(S){var R=0;var mRef$21=undefined;var mKey="";R=0;mRef$21=$As(S.FOwner$4.FOwner,TW3TagObj).FHandle$1;if(mRef$21){mKey="padding-"+S.FEdgeName;R=w3_getStyleAsInt(mRef$21,mKey)}
return R},getWidth$1:function(S){var R=0;var mRef$22=undefined;var mKey$1="";R=0;mRef$22=$As(S.FOwner$4.FOwner,TW3TagObj).FHandle$1;if(mRef$22){mKey$1="border-"+S.FEdgeName+"-Width";R=w3_getStyleAsInt(mRef$22,mKey$1)}
return R},setPadding:function(S,aValue$61){var mRef$23=undefined;var mKey$2="";mRef$23=$As(S.FOwner$4.FOwner,TW3TagObj).FHandle$1;if(mRef$23){mKey$2="padding"+S.FEdgeName;mRef$23.style[mKey$2]=TInteger.ToPxStr(aValue$61)}else{throw EW3Exception.CreateFmt($New(EW3TagObj),"Method %s in class %s threw exception [%s]",["TW3Border.setPadding",TObject.ClassName(S.ClassType),"invalid owner handle error"])}},setWidth:function(S,aValue$62){var mRef$24=undefined;var mKey$3="";mRef$24=$As(S.FOwner$4.FOwner,TW3TagObj).FHandle$1;if(mRef$24){mKey$3="border-"+S.FEdgeName+"-Width";w3_setStyle(mRef$24,mKey$3,TInteger.ToPxStr(aValue$62))}else{throw EW3Exception.CreateFmt($New(EW3TagObj),"Method %s in class %s threw exception [%s]",["TW3Border.setWidth",TObject.ClassName(S.ClassType),"invalid owner handle error"])}},Destroy:TObject.Destroy};var TW3CustomAnimation={$ClassName:"TW3CustomAnimation",$Parent:TObject,$Init:function($){TObject.$Init($);$.FBusy=false;$.FDuration=0;$.FInEvnCB=null;$.FOnBegins=null;$.FOnEnds=null;$.FTarget$1=null},CBBegins:function(S){if(S.FOnBegins)S.FOnBegins(S)},CBEnds:function(S){TW3CustomAnimation.FinalizeTransition$(S);if(S.FOnEnds)S.FOnEnds(S)},Create$45:function(S){TObject.Create(S);S.FDuration=DefaultDuration;return S},Destroy:function(S){if(S.FBusy&&(S.FTarget$1!==null)){try{TW3CustomAnimation.FinalizeTransition$(S)}catch($e){var e$8=$W($e)}}
TObject.Destroy(S)},ExecuteEx:function(S,TargetObj,BeginHandler,EndHandler){if(TargetObj){if(S.FBusy){throw Exception.Create($New(Exception),"Transition is already in progress error")}else{S.FTarget$1=TargetObj;S.FOnBegins=BeginHandler;S.FOnEnds=EndHandler;TW3CustomAnimation.SetupTransition$(S)}}else{throw Exception.Create($New(Exception),"Target-object was NIL error")}},FinalizeTransition:function(S){w3_RemoveEvent(S.FTarget$1.FHandle$1,"animationend",S.FInEvnCB,true);w3_RemoveEvent(S.FTarget$1.FHandle$1,"webkitAnimationEnd",S.FInEvnCB,true);S.FBusy=false},SetDuration:function(S,Value$8){if(S.FBusy){throw Exception.Create($New(Exception),"Duration cannot be altered while the transition is active error")}else S.FDuration=Value$8},SetupTransition:function(S){S.FBusy=true;S.FInEvnCB=$Event0(S,TW3CustomAnimation.CBEnds);w3_AddEvent(S.FTarget$1.FHandle$1,"animationend",S.FInEvnCB,true);w3_AddEvent(S.FTarget$1.FHandle$1,"webkitAnimationEnd",S.FInEvnCB,true);TW3CustomAnimation.CBBegins(S)},Destroy$:function($){return $.ClassType.Destroy($)},Create$45$:function($){return $.ClassType.Create$45($)},FinalizeTransition$:function($){return $.ClassType.FinalizeTransition($)},SetupTransition$:function($){return $.ClassType.SetupTransition($)}};var TW3NamedAnimation={$ClassName:"TW3NamedAnimation",$Parent:TW3CustomAnimation,$Init:function($){TW3CustomAnimation.$Init($);$.FName$2=""},SetupTransition:function(S){var mCommand="";TW3CustomAnimation.SetupTransition(S);w3_setStyle(S.FTarget$1.FHandle$1,w3_CSSPrefix("AnimationFillMode"),"both");mCommand=S.FName$2+" "+(S.FDuration).toString()+"s linear";w3_setStyle(S.FTarget$1.FHandle$1,w3_CSSPrefix("Animation"),mCommand)},FinalizeTransition:function(S){TW3CustomAnimation.FinalizeTransition(S);if(S.FTarget$1!==null){S.FTarget$1.FHandle$1.style[w3_CSSPrefix("Animation")]="none";S.FTarget$1.FHandle$1.style[w3_CSSPrefix("AnimationFillMode")]="none"}},Destroy:TW3CustomAnimation.Destroy,Create$45:TW3CustomAnimation.Create$45,FinalizeTransition$:function($){return $.ClassType.FinalizeTransition($)},SetupTransition$:function($){return $.ClassType.SetupTransition($)}};var TW3AnimationTiming=["atEase","atLinear","atEaseIn","atEaseOut","atEaseInOut"];var cW3AnimationTiming=["ease","linear","ease-in","ease-out","ease-in-out"];var TW3AlertResult=["roYes","roNo","roOK","roCancel"];var TW3AlertOptions=["aoYes","aoNo","aoYesNo","aoOK","aoCancel","aoOKCancel"];var TW3AlertDialog={$ClassName:"TW3AlertDialog",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FNo=$.FOnSelect=$.FText=$.FTitle=$.FYes=null;$.FOptions=0;$.FReady=false},FinalizeObject:function(S){TObject.Free(S.FTitle);TObject.Free(S.FText);TObject.Free(S.FYes);TObject.Free(S.FNo);TW3CustomControl.FinalizeObject(S)},HandleNoClick:function(S,Sender$2){if(S.FOnSelect){switch(S.FOptions){case 0:case 2:case 1:S.FOnSelect(S,1);break;case 3:case 4:case 5:S.FOnSelect(S,3);break}}},HandleYesClick:function(S,Sender$3){if(S.FOnSelect){switch(S.FOptions){case 0:case 2:case 1:S.FOnSelect(S,0);break;case 3:case 4:case 5:S.FOnSelect(S,2);break}}},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FYes=TW3Component.Create$18$($New(TW3AlertButton),S);TW3MovableControl.SetSize(S.FYes,120,42);TW3Button.SetCaption(S.FYes,"OK");TW3CustomControl._setMouseClick(S.FYes,$Event1(S,TW3AlertDialog.HandleYesClick));TW3MovableControl.SetVisible(S.FYes,false);S.FNo=TW3Component.Create$18$($New(TW3AlertButton),S);TW3MovableControl.SetSize(S.FNo,120,42);TW3Button.SetCaption(S.FNo,"Cancel");TW3CustomControl._setMouseClick(S.FNo,$Event1(S,TW3AlertDialog.HandleNoClick));TW3MovableControl.SetVisible(S.FNo,false);S.FTitle=TW3Component.Create$18$($New(TW3Label),S);S.FText=TW3Component.Create$18$($New(TW3Label),S)},Resize:function(S){var hd$2=0;var wd$2=0;var dx$3=0;var dy$4=0;TW3MovableControl.Resize(S);wd$2=TW3ScrollInfo.GetScrollWidth(TW3CustomControl.getScrollInfo(S));hd$2=TW3ScrollInfo.GetScrollHeight(TW3CustomControl.getScrollInfo(S));TW3MovableControl.SetBounds$2(S.FTitle,8,8,wd$2-16,32);TW3MovableControl.SetBounds$2(S.FText,8,TW3MovableControl.GetTop(S.FTitle)+TW3MovableControl.GetHeight$(S.FTitle)+2,wd$2-16,92);if(S.FObjReady&&S.FReady){(wd$2-=16);if((1<<S.FOptions&36)!=0)(wd$2-=8);if((1<<S.FOptions&27)!=0){if((1<<S.FOptions&9)!=0){dy$4=TW3MovableControl.GetHeight$(S)-(TW3MovableControl.GetHeight$(S.FYes)+20);TW3MovableControl.SetBounds$2(S.FYes,10,dy$4,wd$2,TW3MovableControl.GetHeight$(S.FYes))}else if((1<<S.FOptions&18)!=0){dy$4=TW3MovableControl.GetHeight$(S)-(TW3MovableControl.GetHeight$(S.FNo)+20);TW3MovableControl.SetBounds$2(S.FNo,10,dy$4,wd$2,TW3MovableControl.GetHeight$(S.FNo))}}else if((1<<S.FOptions&36)!=0){dy$4=hd$2-(TW3MovableControl.GetHeight$(S.FYes)+8);TW3MovableControl.SetBounds$2(S.FYes,8,dy$4,$Div(wd$2,2),TW3MovableControl.GetHeight$(S.FYes));dx$3=TW3ScrollInfo.GetScrollWidth(TW3CustomControl.getScrollInfo(S))-($Div(wd$2,2));(dx$3-=8);TW3MovableControl.SetBounds$2(S.FNo,dx$3,dy$4,$Div(wd$2,2),TW3MovableControl.GetHeight$(S.FNo))}}},SetupDialog:function(S,aTitle,aText$1,aOptions){if(!S.FReady){TW3TagObj.BeginUpdate(S);try{S.FOptions=aOptions;TW3Label.setCaption$1(S.FTitle,aTitle);TW3Label.setCaption$1(S.FText,aText$1);switch(S.FOptions){case 0:case 3:TW3MovableControl.SetVisible(S.FYes,true);TW3MovableControl.SetVisible(S.FNo,false);break;case 1:case 4:TW3MovableControl.SetVisible(S.FNo,true);TW3MovableControl.SetVisible(S.FYes,false);break;case 2:case 5:TW3MovableControl.SetVisible(S.FYes,true);TW3MovableControl.SetVisible(S.FNo,true);break}
switch(S.FOptions){case 0:TW3Button.SetCaption(S.FYes,"Yes");break;case 1:TW3Button.SetCaption(S.FNo,"No");break;case 3:TW3Button.SetCaption(S.FYes,"OK");break;case 4:TW3Button.SetCaption(S.FNo,"Cancel");break;case 2:TW3Button.SetCaption(S.FYes,"Yes");TW3Button.SetCaption(S.FNo,"No");break;case 5:TW3Button.SetCaption(S.FYes,"OK");TW3Button.SetCaption(S.FNo,"Cancel");break}
TW3CustomFont.setName(TW3CustomControl.getFont(S.FTitle),"Helvetica, Arial, sans-serif");TW3CustomFont.setWeight(TW3CustomControl.getFont(S.FTitle),"bold");TW3CustomFont.setSize(TW3CustomControl.getFont(S.FTitle),24);TW3Label.setTextAlign(S.FTitle,1);TW3CustomFont.setColor$1(TW3CustomControl.getFont(S.FTitle),16777215);S.FTitle.FContainer.FHandle$1.style["text-shadow"]="0 -1px 0 rgba(0,0,0,.8)";TW3CustomFont.setSize(TW3CustomControl.getFont(S.FText),16);TW3CustomFont.setName(TW3CustomControl.getFont(S.FText),"Helvetica, Arial, sans-serif");TW3Label.setTextAlign(S.FText,1);S.FReady=true}finally{TW3MovableControl.SetWasSized(S);TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)}}},StyleTagObject:function(S){TW3CustomControl.StyleTagObject(S)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};TW3AlertDialog.$Intf={IW3AlertDialog:[TW3AlertDialog.SetupDialog]}
var TW3Button={$ClassName:"TW3Button",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FIgnoreMouse=0;$.FPressed=false;$.FTouchEnd=null;$.FTouchMove=null;$.FTouchX=$.FTouchY=0},CBClick:function(S,eventObj$18){if(S.FPressed){TW3Button.ResetClick(S);TW3CustomControl.CBClick(S,eventObj$18)}else TW3Button.ResetClick(S)},CBKeyDown:function(S,eventObj$19){TW3CustomControl.CBKeyDown(S,eventObj$19);if(TW3CustomControl.GetEnabled$(S)&&((eventObj$19.keyCode==13)||(eventObj$19.keyCode==32)))TW3Button.SetPressed(S,true)},CBKeyUp:function(S,eventObj$20){TW3CustomControl.CBKeyDown(S,eventObj$20);switch(eventObj$20.keyCode){case 13:case 32:if(TW3CustomControl.GetEnabled$(S)&&S.FPressed)TW3CustomControl.CBClick$(S,eventObj$20);break;case 27:TW3Button.SetPressed(S,false);break}},CBMouseDown:function(S,eventObj$21){TW3CustomControl.CBMouseDown(S,eventObj$21);if(PerformanceTimer.Now$1()<S.FIgnoreMouse)return;if(TW3CustomControl.GetEnabled$(S)&&(eventObj$21.button==0)){TW3Button.SetPressed(S,true);TW3CustomControl.SetCapture(S)}},CBMouseMove:function(S,eventObj$22){TW3CustomControl.CBMouseMove(S,eventObj$22);if(TW3CustomControl.a$6(S))TW3Button.SetPressed(S,TRect$ContainsPos$1(TW3MovableControl.ScreenRect(S),eventObj$22.clientX,eventObj$22.clientY))},CBMouseUp:function(S,eventObj$23){TW3CustomControl.CBMouseUp(S,eventObj$23);if(TW3CustomControl.a$6(S)&&(eventObj$23.button==0))TW3CustomControl.CBClick$(S,eventObj$23)},GetCaption:function(S){var R="";if(S.FHandle$1)R=""+S.FHandle$1.innerHTML;return R},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);TW3MovableControl.SetWidth$(S,100);TW3MovableControl.setHeight$(S,32);S.FHandle$1.addEventListener("touchstart",function(e$9){var t=null;if(!TW3CustomControl.GetEnabled$(S))return;if(S.FPressed)return;TW3Button.SetPressed(S,true);e$9.stopPropagation();S.FHandle$1.addEventListener("touchmove",S.FTouchMove,false);document.body.addEventListener("touchend",S.FTouchEnd,false);t=e$9.touches[0];S.FTouchX=t.clientX;S.FTouchY=t.clientY},false);S.FTouchMove=function(e$10){var t$1=null;t$1=e$10.touches[0];if((Math.abs(t$1.clientX-S.FTouchX)>10)||(Math.abs(t$1.clientY-S.FTouchY)>10))TW3Button.ResetClick(S)};S.FTouchEnd=function(e$11){TW3CustomControl.CBClick$(S,e$11);S.FIgnoreMouse=PerformanceTimer.Now$1()+1000};TW3CustomControl._setMouseDown(S,null);TW3CustomControl._setMouseUp(S,null);TW3CustomControl._setMouseMove(S,null);TW3CustomControl._setKeyDown(S,null);TW3CustomControl._setKeyUp(S,null)},MakeElementTagObj:function(S){return w3_createHtmlElement("button")},ResetClick:function(S){TW3Button.SetPressed(S,false);if(TW3CustomControl.a$6(S)){TW3CustomControl.ReleaseCapture(S)}else{S.FHandle$1.removeEventListener("touchmove",S.FTouchMove,false);document.body.removeEventListener("touchend",S.FTouchEnd,false)}},SetCaption:function(S,Value$9){if(S.FHandle$1){S.FHandle$1.innerHTML=Value$9}},SetPressed:function(S,value$5){if(S.FPressed!=value$5){S.FPressed=value$5;if(value$5){w3_AddClass(S.FHandle$1,PressedCSSClass)}else w3_RemoveClass(S.FHandle$1,PressedCSSClass)}},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick$:function($){return $.ClassType.CBClick.apply($.ClassType,arguments)},CBKeyDown$:function($){return $.ClassType.CBKeyDown.apply($.ClassType,arguments)},CBKeyUp$:function($){return $.ClassType.CBKeyUp.apply($.ClassType,arguments)},CBMouseDown$:function($){return $.ClassType.CBMouseDown.apply($.ClassType,arguments)},CBMouseMove$:function($){return $.ClassType.CBMouseMove.apply($.ClassType,arguments)},CBMouseUp$:function($){return $.ClassType.CBMouseUp.apply($.ClassType,arguments)},GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3AlertButton={$ClassName:"TW3AlertButton",$Parent:TW3Button,$Init:function($){TW3Button.$Init($)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3Button.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3Button.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3Button.CBClick,CBKeyDown:TW3Button.CBKeyDown,CBKeyUp:TW3Button.CBKeyUp,CBMouseDown:TW3Button.CBMouseDown,CBMouseMove:TW3Button.CBMouseMove,CBMouseUp:TW3Button.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3LabelText={$ClassName:"TW3LabelText",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3Label={$ClassName:"TW3Label",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FCaption$1="";$.FContainer=null;$.FTextAlign=0},FinalizeObject:function(S){TObject.Free(S.FContainer);TW3CustomControl.FinalizeObject(S)},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FContainer=TW3Component.Create$18$($New(TW3LabelText),S);w3_setStyle(S.FContainer.FHandle$1,"textOverflow","ellipsis");w3_setStyle(S.FContainer.FHandle$1,"whiteSpace","nowrap");w3_setStyle(S.FContainer.FHandle$1,"overflow","hidden");w3_setStyle(S.FContainer.FHandle$1,w3_CSSPrefixDef("vertical-align"),"middle");TW3Label.setCaption$1(S,"Label");TW3MovableControl.setHeight$(S,12)},MakeElementTagObj:function(S){return w3_createHtmlElement("fieldset")},Resize:function(S){var dx$4=0;var dy$5=0;var wd$3=0;var hd$3=0;TW3MovableControl.Resize(S);TW3TagObj.BeginUpdate(S.FContainer);TW3MovableControl.SetBounds$2(S.FContainer,0,0,2,2);wd$3=ClampInt(TW3ScrollInfo.GetScrollWidth(TW3CustomControl.getScrollInfo(S.FContainer))+2,0,TW3MovableControl.ClientWidth(S));hd$3=ClampInt(TW3ScrollInfo.GetScrollHeight(TW3CustomControl.getScrollInfo(S.FContainer)),0,TW3MovableControl.ClientHeight(S));switch(S.FTextAlign){case 0:dy$5=($Div(TW3MovableControl.ClientHeight(S),2))-($Div(hd$3,2));TW3MovableControl.SetBounds$2(S.FContainer,0,dy$5,wd$3,hd$3);break;case 1:dx$4=($Div(TW3MovableControl.ClientWidth(S),2))-($Div(wd$3,2));dy$5=($Div(TW3MovableControl.ClientHeight(S),2))-($Div(hd$3,2));TW3MovableControl.SetBounds$2(S.FContainer,dx$4,dy$5,wd$3,hd$3);break;case 2:dx$4=TW3MovableControl.ClientWidth(S)-wd$3;dy$5=($Div(TW3MovableControl.ClientHeight(S),2))-($Div(hd$3,2));TW3MovableControl.SetBounds$2(S.FContainer,dx$4,dy$5,wd$3,hd$3);break}
TW3TagObj.EndUpdate(S.FContainer)},setCaption$1:function(S,aValue$63){if(aValue$63!=S.FCaption$1){TW3TagObj.BeginUpdate(S);S.FCaption$1=aValue$63;TW3TagObj.SetInnerHTML(S.FContainer,aValue$63);TW3MovableControl.SetWasSized(S);TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)}},SetEnabled:function(S,aValue$64){TW3CustomControl.SetEnabled(S,aValue$64);TW3CustomControl.SetEnabled$(S.FContainer,aValue$64)},setTextAlign:function(S,aNewAlignment){var mToWrite="";TW3TagObj.BeginUpdate(S);S.FTextAlign=aNewAlignment;switch(aNewAlignment){case 0:mToWrite="left";break;case 1:mToWrite="center";break;case 2:mToWrite="right";break}
w3_setStyle(S.FContainer.FHandle$1,"text-align",mToWrite);TW3MovableControl.SetWasSized(S);TW3MovableControl.SetWasMoved(S);TW3TagObj.EndUpdate(S)},supportAdjustment:function(S){return false},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment$:function($){return $.supportAdjustment($)},CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled$:function($){return $.ClassType.SetEnabled.apply($.ClassType,arguments)}};var TTextAlign=["taLeft","taCenter","taRight"];var PerformanceTimer={$ClassName:"PerformanceTimer",$Parent:TObject,$Init:function($){TObject.$Init($)},PrepareGetNow:function(){if(window.performance&&performance.now){vGetNow=performance;vIsHighResolution=true}else{vIsHighResolution=false;if(!Date.now){Date.now=function(){return+(new Date)}};vGetNow=Date}},Now$1:function(){var R=0;if(!vGetNow)PerformanceTimer.PrepareGetNow();R=Number(vGetNow.now());return R},Destroy:TObject.Destroy};var TMainForm={$ClassName:"TMainForm",$Parent:TW3Form,$Init:function($){TW3Form.$Init($);$.FCanvas$1=$.FLabel=$.FTimer=null;$.FCount=$.FTemp=0},EventRepeatHandler:function(S,Sender$4){var R=false;S.FCount+=0.02;if(S.FCount>5)S.FCount=0;TW3CustomControl.Invalidate$(S.FCanvas$1);R=false;return R},FinalizeObject:function(S){TObject.Free(S.FTimer);TObject.Free(S.FCanvas$1);TObject.Free(S.FLabel);TW3CustomControl.FinalizeObject(S)},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FCanvas$1=TW3Component.Create$18$($New(TW3GraphicControl),S);S.FCanvas$1.FOnPaint=$Event2(S,TMainForm.PaintHandler);S.FTimer=TW3EventRepeater.Create$52($New(TW3EventRepeater),$Event1(S,TMainForm.EventRepeatHandler),50);S.FCount=0;S.FLabel=TW3Component.Create$18$($New(TW3Label),null);TW3MovableControl.setTop(S.FLabel,270);TW3Label.setCaption$1(S.FLabel,"Smart Mobile Studio, a very exciting project\n\rthat allows you to write ordinary pascal\n\rin the flavour made famous by Delphi and\n\rFree pascal, but generate feature rich,\n\rcutting edge HTML5 web applications ready\n\rfor the mobile market.")},PaintHandler:function(S,Sender$5,Canvas$1){var Q1={X:0,Y:0};var Q2={X:0,Y:0};var Q3={X:0,Y:0};var Center={X:0,Y:0};var Value$10=0;var CRPY=[43.77,38.53,29.81,31.98,36.56,54.72,63.25,70.06,47.23,36.7],CRPX=[195.76,204.49,210.33,220.13,240.78,225.14,247.31,264.84,278.19,281.78];TW3Canvas.Clear(Canvas$1);TW3Canvas.Save(Canvas$1);try{TW3Canvas.SetStrokeStyle(Canvas$1,"#231f20");TW3Canvas.SetFillStyle(Canvas$1,"#231f20");TW3Canvas.SetLineJoin(Canvas$1,"round");TW3Canvas.SetLineCap(Canvas$1,"round");TW3Canvas.SetMiterLimit(Canvas$1,4);TW3Canvas.Save(Canvas$1);if(S.FCount>3){Value$10=S.FCount-3;TW3Canvas.Translate(Canvas$1,300*Value$10,-300*Value$10);TW3Canvas.Rotate(Canvas$1,0.5*Value$10)}
TW3Canvas.Translate(Canvas$1,-232.92,-428.48);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.Rotate(Canvas$1,-2.13);TW3Canvas.RectangleF(Canvas$1,-659.07,82.35,59.56,33.33);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,97.15,109.3);TW3Canvas.BeginPath(Canvas$1);if(S.FCount<3){TW3Canvas.ArcF(Canvas$1,0,0,96.98,0,6.28318530717959,false);TW3Canvas.Fill(Canvas$1)}else{Value$10=S.FCount-3;TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,200*Value$10,500*Value$10);TW3Canvas.Translate(Canvas$1,48,55);TW3Canvas.Rotate(Canvas$1,3.14159265358979*Value$10);TW3Canvas.Translate(Canvas$1,-48,-55);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,96.98,0,1.31946891450771,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,-100*Value$10,500*Value$10);TW3Canvas.Translate(Canvas$1,-28,55);TW3Canvas.Rotate(Canvas$1,9.42477796076938*Value$10);TW3Canvas.Translate(Canvas$1,28,-55);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,96.98,1.25663706143592,2.51327412287183,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,-300*Value$10,0);TW3Canvas.Translate(Canvas$1,-48,0);TW3Canvas.Rotate(Canvas$1,6.28318530717959*Value$10);TW3Canvas.Translate(Canvas$1,48,0);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,96.98,2.51327412287183,3.76991118430775,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,20*Value$10,-500*Value$10);TW3Canvas.Translate(Canvas$1,-18,-48);TW3Canvas.Rotate(Canvas$1,6.28318530717959*Value$10);TW3Canvas.Translate(Canvas$1,18,48);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,96.98,3.76991118430775,5.34070751110265,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,200*Value$10,-300*Value$10);TW3Canvas.Translate(Canvas$1,38,-38);TW3Canvas.Rotate(Canvas$1,9.42477796076938*Value$10);TW3Canvas.Translate(Canvas$1,-38,38);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,96.98,5.34070751110265,6.28318530717959,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1)}
TW3Canvas.Restore(Canvas$1);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.SetLineWidth(Canvas$1,11);TW3Canvas.MoveToF(Canvas$1,195.76,43.77);if(S.FCount<1){TW3Canvas.BezierCurveToF(Canvas$1,204.49,38.53,210.33,29.81,220.13,31.98);TW3Canvas.BezierCurveToF(Canvas$1,240.78,36.56,225.14,54.72,247.31,63.25);SubdivideBezier(Create$12(247.31,63.25),Create$12(264.84,70.06),Create$12(278.19,47.23),Create$12(281.78,36.7),Q1,Q2,Q3,1-S.FCount);TW3Canvas.BezierCurveToF(Canvas$1,Q1.X,Q1.Y,Q2.X,Q2.Y,Q3.X,Q3.Y)}else if(S.FCount<2){TW3Canvas.BezierCurveToF(Canvas$1,204.49,38.53,210.33,29.81,220.13,31.98);SubdivideBezier(Create$12(220.13,31.98),Create$12(240.78,36.56),Create$12(225.14,54.72),Create$12(247.31,63.25),Q1,Q2,Q3,2-S.FCount);TW3Canvas.BezierCurveToF(Canvas$1,Q1.X,Q1.Y,Q2.X,Q2.Y,Q3.X,Q3.Y)}else if(S.FCount<3){SubdivideBezier(Create$12(195.76,43.77),Create$12(204.49,38.53),Create$12(210.33,29.81),Create$12(220.13,31.98),Q1,Q2,Q3,3-S.FCount);TW3Canvas.BezierCurveToF(Canvas$1,Q1.X,Q1.Y,Q2.X,Q2.Y,Q3.X,Q3.Y)}
TW3Canvas.Stroke(Canvas$1);if(S.FCount<3){TW3Canvas.BeginPath(Canvas$1);TW3Canvas.SetLineWidth(Canvas$1,7);Copy$TPointF(Q3,Center);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,Q3.X,Q3.Y);Value$10=1.242+Math.atan2(Q3.Y-Q2.Y,Q3.X-Q2.X);Value$10=(0.2*Value$10)+(0.8*S.FTemp);S.FTemp=Value$10;TW3Canvas.Rotate(Canvas$1,Value$10);Value$10=Math.sin(40*S.FCount);TW3Canvas.Scale(Canvas$1,1+(0.1*Value$10),1+(0.1*Value$10));TW3Canvas.MoveToF(Canvas$1,-11.015,-30.845);TW3Canvas.LineToF(Canvas$1,-8.745,-24.425);TW3Canvas.MoveToF(Canvas$1,14.015,-29.595);TW3Canvas.LineToF(Canvas$1,11.095,-23.475);TW3Canvas.MoveToF(Canvas$1,-14.015,29.595);TW3Canvas.LineToF(Canvas$1,-11.095,23.475);TW3Canvas.MoveToF(Canvas$1,-29.595,-14.015);TW3Canvas.LineToF(Canvas$1,-23.435,-11.065);TW3Canvas.MoveToF(Canvas$1,30.845,-11.015);TW3Canvas.LineToF(Canvas$1,24.465,-8.775);TW3Canvas.MoveToF(Canvas$1,-24.425,8.695);TW3Canvas.LineToF(Canvas$1,-30.845,11.015);TW3Canvas.MoveToF(Canvas$1,23.515,11.095);TW3Canvas.LineToF(Canvas$1,29.605,14.015);TW3Canvas.MoveToF(Canvas$1,8.775,24.465);TW3Canvas.LineToF(Canvas$1,11.015,30.845);TW3Canvas.Stroke(Canvas$1);TW3Canvas.Restore(Canvas$1)}
TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,97.15,109.3);if(S.FCount<3){TW3Canvas.SetFillStyle(Canvas$1,"rgb(255, 255, 255)");TW3Canvas.BeginPath(Canvas$1);TW3Canvas.ArcF(Canvas$1,0,0,57.2,0,6.28318530717959,false);TW3Canvas.Fill(Canvas$1)}else{TW3Canvas.SetFillStyle(Canvas$1,"rgb(255, 255, 255)");Value$10=S.FCount-3;TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,25+(100*Value$10),28+(500*Value$10));TW3Canvas.Rotate(Canvas$1,3.14159265358979*Value$10);TW3Canvas.Translate(Canvas$1,-25,-28);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,57.2,-0.314159265358979,0.942477796076938,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,25-(200*Value$10),28+(500*Value$10));TW3Canvas.Rotate(Canvas$1,3.14159265358979*Value$10);TW3Canvas.Translate(Canvas$1,-25,-28);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,57.2,0.942477796076938,2.82743338823081,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,-38-(300*Value$10),30+(30*Value$10));TW3Canvas.Rotate(Canvas$1,6.28318530717959*Value$10);TW3Canvas.Translate(Canvas$1,38,-30);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,57.2,2.82743338823081,3.45575191894877,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,-28-(100*Value$10),-33-(300*Value$10));TW3Canvas.Rotate(Canvas$1,6.28318530717959*Value$10);TW3Canvas.Translate(Canvas$1,28,33);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,57.2,3.45575191894877,5.02654824574367,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1);TW3Canvas.Save(Canvas$1);TW3Canvas.Translate(Canvas$1,38+(200*Value$10),45-(300*Value$10));TW3Canvas.Rotate(Canvas$1,3.14159265358979*Value$10);TW3Canvas.Translate(Canvas$1,-38,-45);TW3Canvas.BeginPath(Canvas$1);TW3Canvas.MoveToF(Canvas$1,0,0);TW3Canvas.ArcF(Canvas$1,0,0,57.2,5.02654824574367,5.96902604182061,false);TW3Canvas.Fill(Canvas$1);TW3Canvas.Restore(Canvas$1)}
TW3Canvas.Restore(Canvas$1);if(S.FCount<3){TW3Canvas.SetFillStyle(Canvas$1,"#231f20");TW3Canvas.BeginPath(Canvas$1);TW3Canvas.ArcF(Canvas$1,126,96.1,8.98,0,6.28318530717959,false);TW3Canvas.Fill(Canvas$1)}}finally{TW3Canvas.Restore(Canvas$1)}
TMainForm.PaintHandlerText(S,Sender$5,Canvas$1)},PaintHandlerText:function(S,Sender$6,Canvas$2){TW3Canvas.Save(Canvas$2);try{TW3Canvas.SetFillStyle(Canvas$2,"#231f20");TW3Canvas.Translate(Canvas$2,0,220);TW3Canvas.Scale(Canvas$2,1.7,1.7);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,1.853,4.08);TW3Canvas.QuadraticCurveToF(Canvas$2,1.913,2.87,2.853,2.46);TW3Canvas.QuadraticCurveToF(Canvas$2,3.783,2.05,4.873,2.08);TW3Canvas.QuadraticCurveToF(Canvas$2,5.943,2.1,6.753,2.36);TW3Canvas.QuadraticCurveToF(Canvas$2,7.573,2.63,8.093,2.96);TW3Canvas.LineToF(Canvas$2,8.093,1.12);TW3Canvas.QuadraticCurveToF(Canvas$2,7.453,0.78,6.583,0.54);TW3Canvas.QuadraticCurveToF(Canvas$2,5.723,0.29,4.653,0.28);TW3Canvas.QuadraticCurveToF(Canvas$2,2.103,0.35,1.033,1.49);TW3Canvas.QuadraticCurveToF(Canvas$2,-0.037,2.64,-0.007,4.08);TW3Canvas.QuadraticCurveToF(Canvas$2,0.053,5.67,1.103,6.4);TW3Canvas.QuadraticCurveToF(Canvas$2,2.163,7.13,3.543,7.52);TW3Canvas.QuadraticCurveToF(Canvas$2,4.933,7.9,5.983,8.46);TW3Canvas.QuadraticCurveToF(Canvas$2,7.043,9.03,7.093,10.28);TW3Canvas.QuadraticCurveToF(Canvas$2,7.033,11.42,6.073,11.81);TW3Canvas.QuadraticCurveToF(Canvas$2,5.103,12.19,3.973,12.16);TW3Canvas.QuadraticCurveToF(Canvas$2,2.893,12.15,1.933,11.84);TW3Canvas.QuadraticCurveToF(Canvas$2,0.973,11.53,0.173,11.04);TW3Canvas.LineToF(Canvas$2,0.173,12.96);TW3Canvas.QuadraticCurveToF(Canvas$2,1.053,13.4,2.043,13.67);TW3Canvas.QuadraticCurveToF(Canvas$2,3.043,13.93,4.133,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,6.423,13.93,7.683,12.97);TW3Canvas.QuadraticCurveToF(Canvas$2,8.933,12.01,8.953,10.28);TW3Canvas.QuadraticCurveToF(Canvas$2,8.903,8.54,7.843,7.65);TW3Canvas.QuadraticCurveToF(Canvas$2,6.793,6.75,5.403,6.28);TW3Canvas.QuadraticCurveToF(Canvas$2,4.023,5.81,2.963,5.36);TW3Canvas.QuadraticCurveToF(Canvas$2,1.913,4.92,1.853,4.08);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,22.423,3.62);TW3Canvas.QuadraticCurveToF(Canvas$2,21.233,3.64,20.283,3.89);TW3Canvas.QuadraticCurveToF(Canvas$2,19.333,4.14,18.763,4.38);TW3Canvas.QuadraticCurveToF(Canvas$2,18.273,4.02,17.603,3.82);TW3Canvas.QuadraticCurveToF(Canvas$2,16.933,3.62,16.103,3.62);TW3Canvas.QuadraticCurveToF(Canvas$2,14.483,3.67,13.363,4.05);TW3Canvas.QuadraticCurveToF(Canvas$2,12.243,4.44,11.943,4.62);TW3Canvas.LineToF(Canvas$2,11.943,13.78);TW3Canvas.LineToF(Canvas$2,13.783,13.78);TW3Canvas.LineToF(Canvas$2,13.783,5.66);TW3Canvas.QuadraticCurveToF(Canvas$2,14.243,5.54,14.793,5.45);TW3Canvas.QuadraticCurveToF(Canvas$2,15.343,5.36,15.963,5.36);TW3Canvas.QuadraticCurveToF(Canvas$2,17.443,5.39,17.883,5.96);TW3Canvas.QuadraticCurveToF(Canvas$2,18.313,6.52,18.263,7.26);TW3Canvas.LineToF(Canvas$2,18.263,13.78);TW3Canvas.LineToF(Canvas$2,20.103,13.78);TW3Canvas.LineToF(Canvas$2,20.103,7.36);TW3Canvas.QuadraticCurveToF(Canvas$2,20.103,6.55,19.863,5.88);TW3Canvas.QuadraticCurveToF(Canvas$2,20.303,5.69,20.993,5.51);TW3Canvas.QuadraticCurveToF(Canvas$2,21.683,5.33,22.543,5.32);TW3Canvas.QuadraticCurveToF(Canvas$2,23.853,5.35,24.253,5.93);TW3Canvas.QuadraticCurveToF(Canvas$2,24.643,6.5,24.603,7.24);TW3Canvas.LineToF(Canvas$2,24.603,13.78);TW3Canvas.LineToF(Canvas$2,26.423,13.78);TW3Canvas.LineToF(Canvas$2,26.423,7.36);TW3Canvas.QuadraticCurveToF(Canvas$2,26.413,5.59,25.373,4.61);TW3Canvas.QuadraticCurveToF(Canvas$2,24.333,3.63,22.423,3.62);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,33.293,3.64);TW3Canvas.QuadraticCurveToF(Canvas$2,32.333,3.65,31.583,3.81);TW3Canvas.QuadraticCurveToF(Canvas$2,30.823,3.96,30.273,4.18);TW3Canvas.LineToF(Canvas$2,30.273,5.74);TW3Canvas.QuadraticCurveToF(Canvas$2,30.753,5.56,31.463,5.41);TW3Canvas.QuadraticCurveToF(Canvas$2,32.173,5.25,33.033,5.24);TW3Canvas.QuadraticCurveToF(Canvas$2,34.483,5.23,35.113,5.81);TW3Canvas.QuadraticCurveToF(Canvas$2,35.753,6.38,35.793,7.6);TW3Canvas.QuadraticCurveToF(Canvas$2,34.923,7.48,33.973,7.48);TW3Canvas.QuadraticCurveToF(Canvas$2,31.753,7.49,30.523,8.32);TW3Canvas.QuadraticCurveToF(Canvas$2,29.293,9.14,29.273,10.64);TW3Canvas.QuadraticCurveToF(Canvas$2,29.243,11.07,29.493,11.84);TW3Canvas.QuadraticCurveToF(Canvas$2,29.743,12.62,30.653,13.26);TW3Canvas.QuadraticCurveToF(Canvas$2,31.563,13.9,33.493,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,35.383,13.9,36.273,13.27);TW3Canvas.QuadraticCurveToF(Canvas$2,37.163,12.64,37.413,11.88);TW3Canvas.QuadraticCurveToF(Canvas$2,37.663,11.12,37.633,10.7);TW3Canvas.LineToF(Canvas$2,37.633,7.82);TW3Canvas.QuadraticCurveToF(Canvas$2,37.623,5.79,36.503,4.72);TW3Canvas.QuadraticCurveToF(Canvas$2,35.383,3.65,33.293,3.64);TW3Canvas.MoveToF(Canvas$2,35.793,10.68);TW3Canvas.QuadraticCurveToF(Canvas$2,35.793,11.5,35.213,11.91);TW3Canvas.QuadraticCurveToF(Canvas$2,34.633,12.32,33.493,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,32.303,12.32,31.703,11.9);TW3Canvas.QuadraticCurveToF(Canvas$2,31.093,11.47,31.093,10.62);TW3Canvas.QuadraticCurveToF(Canvas$2,31.123,9.92,31.663,9.55);TW3Canvas.QuadraticCurveToF(Canvas$2,32.213,9.19,32.903,9.06);TW3Canvas.QuadraticCurveToF(Canvas$2,33.593,8.93,34.053,8.94);TW3Canvas.QuadraticCurveToF(Canvas$2,34.543,8.94,34.993,8.97);TW3Canvas.QuadraticCurveToF(Canvas$2,35.433,9,35.793,9.06);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,42.273,5.74);TW3Canvas.QuadraticCurveToF(Canvas$2,42.863,5.58,43.633,5.46);TW3Canvas.QuadraticCurveToF(Canvas$2,44.403,5.34,45.293,5.32);TW3Canvas.LineToF(Canvas$2,45.293,3.64);TW3Canvas.QuadraticCurveToF(Canvas$2,43.243,3.7,41.893,4.13);TW3Canvas.QuadraticCurveToF(Canvas$2,40.553,4.55,40.433,4.64);TW3Canvas.LineToF(Canvas$2,40.433,13.78);TW3Canvas.LineToF(Canvas$2,42.273,13.78);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,52.393,5.34);TW3Canvas.LineToF(Canvas$2,52.393,3.8);TW3Canvas.LineToF(Canvas$2,49.733,3.8);TW3Canvas.LineToF(Canvas$2,49.733,0.82);TW3Canvas.LineToF(Canvas$2,47.913,0.82);TW3Canvas.LineToF(Canvas$2,47.913,3.8);TW3Canvas.LineToF(Canvas$2,46.173,3.8);TW3Canvas.LineToF(Canvas$2,46.173,5.34);TW3Canvas.LineToF(Canvas$2,47.913,5.34);TW3Canvas.LineToF(Canvas$2,47.913,11.02);TW3Canvas.QuadraticCurveToF(Canvas$2,47.953,12.35,48.563,12.98);TW3Canvas.QuadraticCurveToF(Canvas$2,49.173,13.61,49.893,13.78);TW3Canvas.QuadraticCurveToF(Canvas$2,50.613,13.96,50.973,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,51.393,13.94,51.743,13.86);TW3Canvas.QuadraticCurveToF(Canvas$2,52.093,13.78,52.393,13.66);TW3Canvas.LineToF(Canvas$2,52.393,12.02);TW3Canvas.QuadraticCurveToF(Canvas$2,52.193,12.14,51.903,12.23);TW3Canvas.QuadraticCurveToF(Canvas$2,51.623,12.32,51.233,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,50.523,12.33,50.123,12.05);TW3Canvas.QuadraticCurveToF(Canvas$2,49.733,11.78,49.733,11.14);TW3Canvas.LineToF(Canvas$2,49.733,5.34);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,72.433,0.44);TW3Canvas.LineToF(Canvas$2,68.033,6.2);TW3Canvas.LineToF(Canvas$2,63.653,0.44);TW3Canvas.LineToF(Canvas$2,61.653,0.44);TW3Canvas.LineToF(Canvas$2,61.653,13.78);TW3Canvas.LineToF(Canvas$2,63.493,13.78);TW3Canvas.LineToF(Canvas$2,63.493,3.26);TW3Canvas.LineToF(Canvas$2,68.033,9.24);TW3Canvas.LineToF(Canvas$2,72.593,3.26);TW3Canvas.LineToF(Canvas$2,72.593,13.78);TW3Canvas.LineToF(Canvas$2,74.433,13.78);TW3Canvas.LineToF(Canvas$2,74.433,0.44);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,81.843,3.66);TW3Canvas.QuadraticCurveToF(Canvas$2,80.143,3.58,78.683,4.64);TW3Canvas.QuadraticCurveToF(Canvas$2,77.233,5.7,77.143,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,77.233,11.9,78.683,12.96);TW3Canvas.QuadraticCurveToF(Canvas$2,80.143,14.02,81.843,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,83.533,14.02,84.993,12.96);TW3Canvas.QuadraticCurveToF(Canvas$2,86.443,11.9,86.543,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,86.443,5.7,84.993,4.64);TW3Canvas.QuadraticCurveToF(Canvas$2,83.533,3.58,81.843,3.66);TW3Canvas.MoveToF(Canvas$2,81.843,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,80.673,12.39,79.843,11.72);TW3Canvas.QuadraticCurveToF(Canvas$2,79.013,11.05,78.983,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,79.013,6.55,79.843,5.88);TW3Canvas.QuadraticCurveToF(Canvas$2,80.673,5.21,81.843,5.28);TW3Canvas.QuadraticCurveToF(Canvas$2,83.003,5.21,83.833,5.88);TW3Canvas.QuadraticCurveToF(Canvas$2,84.663,6.55,84.703,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,84.663,11.05,83.833,11.72);TW3Canvas.QuadraticCurveToF(Canvas$2,83.003,12.39,81.843,12.32);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,93.103,3.64);TW3Canvas.QuadraticCurveToF(Canvas$2,92.553,3.64,92.023,3.72);TW3Canvas.QuadraticCurveToF(Canvas$2,91.493,3.79,90.963,3.94);TW3Canvas.LineToF(Canvas$2,90.963,0);TW3Canvas.LineToF(Canvas$2,89.143,0);TW3Canvas.LineToF(Canvas$2,89.143,10.7);TW3Canvas.QuadraticCurveToF(Canvas$2,89.113,11.12,89.363,11.88);TW3Canvas.QuadraticCurveToF(Canvas$2,89.613,12.64,90.503,13.27);TW3Canvas.QuadraticCurveToF(Canvas$2,91.383,13.9,93.263,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,94.133,13.97,95.153,13.59);TW3Canvas.QuadraticCurveToF(Canvas$2,96.173,13.22,96.913,12.07);TW3Canvas.QuadraticCurveToF(Canvas$2,97.653,10.93,97.683,8.66);TW3Canvas.QuadraticCurveToF(Canvas$2,97.593,5.63,96.173,4.6);TW3Canvas.QuadraticCurveToF(Canvas$2,94.763,3.57,93.103,3.64);TW3Canvas.MoveToF(Canvas$2,93.263,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,92.123,12.32,91.543,11.95);TW3Canvas.QuadraticCurveToF(Canvas$2,90.973,11.57,90.963,10.82);TW3Canvas.LineToF(Canvas$2,90.963,5.68);TW3Canvas.QuadraticCurveToF(Canvas$2,91.993,5.26,93.103,5.26);TW3Canvas.QuadraticCurveToF(Canvas$2,94.213,5.19,95.013,5.84);TW3Canvas.QuadraticCurveToF(Canvas$2,95.813,6.49,95.843,8.66);TW3Canvas.QuadraticCurveToF(Canvas$2,95.803,11.02,95.003,11.71);TW3Canvas.QuadraticCurveToF(Canvas$2,94.213,12.4,93.263,12.32);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,100.853,13.78);TW3Canvas.LineToF(Canvas$2,102.693,13.78);TW3Canvas.LineToF(Canvas$2,102.693,3.8);TW3Canvas.LineToF(Canvas$2,100.853,3.8);TW3Canvas.MoveToF(Canvas$2,102.753,0.32);TW3Canvas.LineToF(Canvas$2,100.793,0.32);TW3Canvas.LineToF(Canvas$2,100.793,2.26);TW3Canvas.LineToF(Canvas$2,102.753,2.26);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,106.653,0);TW3Canvas.LineToF(Canvas$2,106.653,13.78);TW3Canvas.LineToF(Canvas$2,108.493,13.78);TW3Canvas.LineToF(Canvas$2,108.493,0);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,116.493,12.38);TW3Canvas.QuadraticCurveToF(Canvas$2,115.473,12.42,114.693,11.89);TW3Canvas.QuadraticCurveToF(Canvas$2,113.913,11.36,113.673,9.84);TW3Canvas.LineToF(Canvas$2,120.553,9.84);TW3Canvas.QuadraticCurveToF(Canvas$2,120.613,9.18,120.613,8.46);TW3Canvas.QuadraticCurveToF(Canvas$2,120.593,6.24,119.423,4.96);TW3Canvas.QuadraticCurveToF(Canvas$2,118.243,3.67,116.213,3.64);TW3Canvas.QuadraticCurveToF(Canvas$2,114.043,3.7,113.103,4.72);TW3Canvas.QuadraticCurveToF(Canvas$2,112.163,5.74,111.953,6.97);TW3Canvas.QuadraticCurveToF(Canvas$2,111.753,8.21,111.793,8.92);TW3Canvas.QuadraticCurveToF(Canvas$2,111.883,11.97,113.303,13);TW3Canvas.QuadraticCurveToF(Canvas$2,114.733,14.04,116.393,13.96);TW3Canvas.QuadraticCurveToF(Canvas$2,117.463,13.96,118.343,13.78);TW3Canvas.QuadraticCurveToF(Canvas$2,119.233,13.6,119.933,13.3);TW3Canvas.LineToF(Canvas$2,119.933,11.64);TW3Canvas.QuadraticCurveToF(Canvas$2,119.303,11.98,118.453,12.18);TW3Canvas.QuadraticCurveToF(Canvas$2,117.603,12.38,116.493,12.38);TW3Canvas.MoveToF(Canvas$2,116.213,5.28);TW3Canvas.QuadraticCurveToF(Canvas$2,117.663,5.35,118.203,6.3);TW3Canvas.QuadraticCurveToF(Canvas$2,118.733,7.24,118.773,8.18);TW3Canvas.LineToF(Canvas$2,113.653,8.18);TW3Canvas.QuadraticCurveToF(Canvas$2,113.763,6.59,114.363,5.93);TW3Canvas.QuadraticCurveToF(Canvas$2,114.963,5.26,116.213,5.28);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,131.463,4.08);TW3Canvas.QuadraticCurveToF(Canvas$2,131.523,2.87,132.453,2.46);TW3Canvas.QuadraticCurveToF(Canvas$2,133.393,2.05,134.483,2.08);TW3Canvas.QuadraticCurveToF(Canvas$2,135.553,2.1,136.363,2.36);TW3Canvas.QuadraticCurveToF(Canvas$2,137.173,2.63,137.703,2.96);TW3Canvas.LineToF(Canvas$2,137.703,1.12);TW3Canvas.QuadraticCurveToF(Canvas$2,137.063,0.78,136.193,0.54);TW3Canvas.QuadraticCurveToF(Canvas$2,135.333,0.29,134.263,0.28);TW3Canvas.QuadraticCurveToF(Canvas$2,131.713,0.35,130.643,1.49);TW3Canvas.QuadraticCurveToF(Canvas$2,129.573,2.64,129.603,4.08);TW3Canvas.QuadraticCurveToF(Canvas$2,129.663,5.67,130.713,6.4);TW3Canvas.QuadraticCurveToF(Canvas$2,131.773,7.13,133.153,7.52);TW3Canvas.QuadraticCurveToF(Canvas$2,134.543,7.9,135.593,8.46);TW3Canvas.QuadraticCurveToF(Canvas$2,136.653,9.03,136.703,10.28);TW3Canvas.QuadraticCurveToF(Canvas$2,136.643,11.42,135.673,11.81);TW3Canvas.QuadraticCurveToF(Canvas$2,134.713,12.19,133.583,12.16);TW3Canvas.QuadraticCurveToF(Canvas$2,132.503,12.15,131.543,11.84);TW3Canvas.QuadraticCurveToF(Canvas$2,130.583,11.53,129.783,11.04);TW3Canvas.LineToF(Canvas$2,129.783,12.96);TW3Canvas.QuadraticCurveToF(Canvas$2,130.653,13.4,131.653,13.67);TW3Canvas.QuadraticCurveToF(Canvas$2,132.653,13.93,133.743,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,136.033,13.93,137.283,12.97);TW3Canvas.QuadraticCurveToF(Canvas$2,138.543,12.01,138.563,10.28);TW3Canvas.QuadraticCurveToF(Canvas$2,138.513,8.54,137.453,7.65);TW3Canvas.QuadraticCurveToF(Canvas$2,136.403,6.75,135.013,6.28);TW3Canvas.QuadraticCurveToF(Canvas$2,133.633,5.81,132.573,5.36);TW3Canvas.QuadraticCurveToF(Canvas$2,131.523,4.92,131.463,4.08);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,146.373,5.34);TW3Canvas.LineToF(Canvas$2,146.373,3.8);TW3Canvas.LineToF(Canvas$2,143.713,3.8);TW3Canvas.LineToF(Canvas$2,143.713,0.82);TW3Canvas.LineToF(Canvas$2,141.893,0.82);TW3Canvas.LineToF(Canvas$2,141.893,3.8);TW3Canvas.LineToF(Canvas$2,140.153,3.8);TW3Canvas.LineToF(Canvas$2,140.153,5.34);TW3Canvas.LineToF(Canvas$2,141.893,5.34);TW3Canvas.LineToF(Canvas$2,141.893,11.02);TW3Canvas.QuadraticCurveToF(Canvas$2,141.933,12.35,142.543,12.98);TW3Canvas.QuadraticCurveToF(Canvas$2,143.153,13.61,143.873,13.78);TW3Canvas.QuadraticCurveToF(Canvas$2,144.593,13.96,144.953,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,145.373,13.94,145.723,13.86);TW3Canvas.QuadraticCurveToF(Canvas$2,146.073,13.78,146.373,13.66);TW3Canvas.LineToF(Canvas$2,146.373,12.02);TW3Canvas.QuadraticCurveToF(Canvas$2,146.183,12.14,145.893,12.23);TW3Canvas.QuadraticCurveToF(Canvas$2,145.603,12.32,145.213,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,144.503,12.33,144.113,12.05);TW3Canvas.QuadraticCurveToF(Canvas$2,143.723,11.78,143.713,11.14);TW3Canvas.LineToF(Canvas$2,143.713,5.34);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,155.373,3.8);TW3Canvas.LineToF(Canvas$2,155.373,9.72);TW3Canvas.QuadraticCurveToF(Canvas$2,155.383,11.08,154.803,11.71);TW3Canvas.QuadraticCurveToF(Canvas$2,154.223,12.35,152.993,12.34);TW3Canvas.QuadraticCurveToF(Canvas$2,151.753,12.35,151.173,11.71);TW3Canvas.QuadraticCurveToF(Canvas$2,150.593,11.08,150.593,9.72);TW3Canvas.LineToF(Canvas$2,150.593,3.8);TW3Canvas.LineToF(Canvas$2,148.773,3.8);TW3Canvas.LineToF(Canvas$2,148.773,9.58);TW3Canvas.QuadraticCurveToF(Canvas$2,148.793,11.68,149.883,12.81);TW3Canvas.QuadraticCurveToF(Canvas$2,150.973,13.95,152.993,13.96);TW3Canvas.QuadraticCurveToF(Canvas$2,155.013,13.95,156.113,12.81);TW3Canvas.QuadraticCurveToF(Canvas$2,157.203,11.68,157.213,9.58);TW3Canvas.LineToF(Canvas$2,157.213,3.8);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,160.193,8.66);TW3Canvas.QuadraticCurveToF(Canvas$2,160.233,10.93,160.973,12.07);TW3Canvas.QuadraticCurveToF(Canvas$2,161.713,13.22,162.733,13.59);TW3Canvas.QuadraticCurveToF(Canvas$2,163.743,13.97,164.613,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,166.493,13.9,167.383,13.27);TW3Canvas.QuadraticCurveToF(Canvas$2,168.263,12.64,168.513,11.88);TW3Canvas.QuadraticCurveToF(Canvas$2,168.763,11.12,168.733,10.7);TW3Canvas.LineToF(Canvas$2,168.733,0);TW3Canvas.LineToF(Canvas$2,166.913,0);TW3Canvas.LineToF(Canvas$2,166.913,3.94);TW3Canvas.QuadraticCurveToF(Canvas$2,166.393,3.79,165.853,3.72);TW3Canvas.QuadraticCurveToF(Canvas$2,165.323,3.64,164.773,3.64);TW3Canvas.QuadraticCurveToF(Canvas$2,163.123,3.57,161.703,4.6);TW3Canvas.QuadraticCurveToF(Canvas$2,160.283,5.63,160.193,8.66);TW3Canvas.MoveToF(Canvas$2,162.013,8.66);TW3Canvas.QuadraticCurveToF(Canvas$2,162.053,6.49,162.863,5.84);TW3Canvas.QuadraticCurveToF(Canvas$2,163.663,5.19,164.773,5.26);TW3Canvas.QuadraticCurveToF(Canvas$2,165.883,5.26,166.913,5.68);TW3Canvas.LineToF(Canvas$2,166.913,10.82);TW3Canvas.QuadraticCurveToF(Canvas$2,166.913,11.57,166.333,11.95);TW3Canvas.QuadraticCurveToF(Canvas$2,165.753,12.32,164.613,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,163.653,12.4,162.853,11.71);TW3Canvas.QuadraticCurveToF(Canvas$2,162.063,11.02,162.013,8.66);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,172.143,13.78);TW3Canvas.LineToF(Canvas$2,173.983,13.78);TW3Canvas.LineToF(Canvas$2,173.983,3.8);TW3Canvas.LineToF(Canvas$2,172.143,3.8);TW3Canvas.MoveToF(Canvas$2,174.043,0.32);TW3Canvas.LineToF(Canvas$2,172.083,0.32);TW3Canvas.LineToF(Canvas$2,172.083,2.26);TW3Canvas.LineToF(Canvas$2,174.043,2.26);TW3Canvas.Fill(Canvas$2);TW3Canvas.BeginPath(Canvas$2);TW3Canvas.MoveToF(Canvas$2,181.603,3.66);TW3Canvas.QuadraticCurveToF(Canvas$2,179.903,3.58,178.453,4.64);TW3Canvas.QuadraticCurveToF(Canvas$2,176.993,5.7,176.903,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,176.993,11.9,178.453,12.96);TW3Canvas.QuadraticCurveToF(Canvas$2,179.903,14.02,181.603,13.94);TW3Canvas.QuadraticCurveToF(Canvas$2,183.303,14.02,184.753,12.96);TW3Canvas.QuadraticCurveToF(Canvas$2,186.213,11.9,186.303,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,186.213,5.7,184.753,4.64);TW3Canvas.QuadraticCurveToF(Canvas$2,183.303,3.58,181.603,3.66);TW3Canvas.MoveToF(Canvas$2,181.603,12.32);TW3Canvas.QuadraticCurveToF(Canvas$2,180.443,12.39,179.613,11.72);TW3Canvas.QuadraticCurveToF(Canvas$2,178.783,11.05,178.743,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,178.783,6.55,179.613,5.88);TW3Canvas.QuadraticCurveToF(Canvas$2,180.443,5.21,181.603,5.28);TW3Canvas.QuadraticCurveToF(Canvas$2,182.763,5.21,183.593,5.88);TW3Canvas.QuadraticCurveToF(Canvas$2,184.423,6.55,184.463,8.8);TW3Canvas.QuadraticCurveToF(Canvas$2,184.423,11.05,183.593,11.72);TW3Canvas.QuadraticCurveToF(Canvas$2,182.763,12.39,181.603,12.32);TW3Canvas.Fill(Canvas$2)}finally{TW3Canvas.Restore(Canvas$2)}},Resize:function(S){TW3MovableControl.SetWidth$(S.FLabel,TW3MovableControl.GetWidth$(S));TW3MovableControl.setHeight$(S.FLabel,TW3MovableControl.GetHeight$(S)-TW3MovableControl.GetTop(S.FLabel));TW3MovableControl.SetBounds$2(S.FCanvas$1,0,0,TW3MovableControl.GetWidth$(S),TW3MovableControl.GetHeight$(S));TW3CustomControl.Invalidate$(S.FCanvas$1);TW3MovableControl.Resize(S)},Destroy:TW3CustomForm.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomForm.StyleTagObject,Create$18:TW3CustomForm.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};function SubdivideBezier(P0,P1,P2,P3,Q1$1,Q2$1,Q3$1,Value$11){var T0={X:0,Y:0};var T1={X:0,Y:0};Copy$TPointF(LinearInterpolation(Clone$TPointF(P0),Clone$TPointF(P1),Value$11),Q1$1);T0=LinearInterpolation(Clone$TPointF(P1),Clone$TPointF(P2),Value$11);T1=LinearInterpolation(Clone$TPointF(P2),Clone$TPointF(P3),Value$11);Copy$TPointF(LinearInterpolation(Clone$TPointF(Q1$1),Clone$TPointF(T0),Value$11),Q2$1);T0=LinearInterpolation(Clone$TPointF(T0),Clone$TPointF(T1),Value$11);Copy$TPointF(LinearInterpolation(Clone$TPointF(Q2$1),Clone$TPointF(T0),Value$11),Q3$1)};function LinearInterpolation(A$17,B$3,P){var R={X:0,Y:0};R.X=A$17.X+(P*(B$3.X-A$17.X));R.Y=A$17.Y+(P*(B$3.Y-A$17.Y));return R};var TW3Panel={$ClassName:"TW3Panel",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3PaintBox={$ClassName:"TW3PaintBox",$Parent:TW3GraphicControl,$Init:function($){TW3GraphicControl.$Init($)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3GraphicControl.FinalizeObject,InitializeObject:TW3GraphicControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3GraphicControl.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3GraphicControl.Resize,setHeight:TW3GraphicControl.setHeight,SetWidth:TW3GraphicControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3GraphicControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled,Paint:TW3GraphicControl.Paint};var TW3CustomRepeater={$ClassName:"TW3CustomRepeater",$Parent:TObject,$Init:function($){TObject.$Init($);$.FDelay$1=0;$.FHandle$5=undefined},AllocTimer:function(S){if(S.FHandle$5!=0)TW3CustomRepeater.ReleaseTimer(S);S.FHandle$5=setInterval($Event0(S,TW3CustomRepeater.CBExecute$),(S.FDelay$1))},Destroy:function(S){if(S.FHandle$5!=0)TW3CustomRepeater.ReleaseTimer(S);TObject.Destroy(S)},ReleaseTimer:function(S){if(S.FHandle$5!=0){clearInterval(S.FHandle$5);S.FHandle$5=0}},setDelay:function(S,aValue$65){S.FDelay$1=Math.max(aValue$65,1);if(S.FHandle$5!=0)TW3CustomRepeater.AllocTimer(S)},Destroy$:function($){return $.ClassType.Destroy($)},CBExecute$:function($){return $.ClassType.CBExecute($)}};var TW3EventRepeater={$ClassName:"TW3EventRepeater",$Parent:TW3CustomRepeater,$Init:function($){TW3CustomRepeater.$Init($);$.FCallBack=null},CBExecute:function(S){if(S.FCallBack(S))TW3CustomRepeater.ReleaseTimer(S)},Create$52:function(S,aCallBack,aDelay){TObject.Create(S);S.FCallBack=aCallBack;TW3CustomRepeater.setDelay(S,aDelay);if((aCallBack!==null)&&(aDelay>0))TW3CustomRepeater.AllocTimer(S);return S},Destroy:TW3CustomRepeater.Destroy,CBExecute$:function($){return $.ClassType.CBExecute($)}};var TControlAnimationList={$ClassName:"TControlAnimationList",$Parent:TObject,$Init:function($){TObject.$Init($);$.FAnimationList=$.FControl=null},Animate:function(S,time_ms,animateProc,config){if((config!==null)&&(config.FStart==0))TObjectList.Clear$2(S.FAnimationList);TObjectList.Add$1(S.FAnimationList,TAnimation.Create$60($New(TAnimation),S.FControl,time_ms,config,animateProc));if(TObjectList.GetCount$1(S.FAnimationList)==1)TAnimation.Start$3($As(TObjectList.GetItem$5(S.FAnimationList,0),TAnimation),$Event1(S,TControlAnimationList.MoveToNext))},Create$58:function(S,ctrl){TObject.Create(S);S.FAnimationList=TObjectList.Create$41($New(TObjectList));S.FControl=ctrl;return S},IsActive:function(S){return(TObjectList.GetCount$1(S.FAnimationList)>0)&&(!$As(TObjectList.GetItem$5(S.FAnimationList,0),TAnimation).FCompleted)},Move$3:function(S,time_ms$1,X$2,Y$2,config$1){TControlAnimationList.PrepareAnimation(S,TMoveAnimation.Create$64($New(TMoveAnimation),S.FControl,time_ms$1,config$1,Create$13(X$2,Y$2)),config$1)},MoveToNext:function(S,animation){var idx$1=0;var onCompleted=null;idx$1=TObjectList.IndexOf$1(S.FAnimationList,animation);TObjectList.Remove$1(S.FAnimationList,idx$1);if((animation.FConfig!==null)&&(animation.FConfig.FNotifyAtEnd!==null)){onCompleted=animation.FConfig.FNotifyAtEnd;onCompleted()}
TObject.Free(animation);if((TObjectList.GetCount$1(S.FAnimationList)>0)&&(!TAnimation.IsActive$1($As(TObjectList.GetItem$5(S.FAnimationList,0),TAnimation))))TAnimation.Start$3($As(TObjectList.GetItem$5(S.FAnimationList,0),TAnimation),$Event1(S,TControlAnimationList.MoveToNext))},PrepareAnimation:function(S,animation$1,config$2){var idx$2=0;idx$2=TObjectList.Add$1(S.FAnimationList,animation$1);if((!(config$2!==null))||(config$2.FStart==0))TAnimation.Start$3($As(TObjectList.GetItem$5(S.FAnimationList,idx$2),TAnimation),$Event1(S,TControlAnimationList.MoveToNext))},Destroy:TObject.Destroy};var TAnimationManager={$ClassName:"TAnimationManager",$Parent:TObject,$Init:function($){TObject.$Init($)},HasAnimationList:function(S,ctrl$1){var R=false;R=(ctrl$1).hasOwnProperty('AM_AL');return R},GetAnimationList:function(S,ctrl$2){var R=null;if(TAnimationManager.HasAnimationList(S,ctrl$2)){R=(ctrl$2).AM_AL}else{R=TControlAnimationList.Create$58($New(TControlAnimationList),ctrl$2);(ctrl$2).AM_AL=R}
return R},Config:function(S){return TAnimationConfig.Create$59($New(TAnimationConfig))},Destroy:TObject.Destroy};var TAnimationConfig={$ClassName:"TAnimationConfig",$Parent:TObject,$Init:function($){TObject.$Init($);$.FLoop=false;$.FNotifyAtEnd=null;$.FStart=0},Create$59:function(S){TObject.Create(S);S.FStart=0;S.FNotifyAtEnd=null;return S},SetOnCompleted:function(S,AProc){var R=null;S.FNotifyAtEnd=AProc;R=S;return R},Destroy:TObject.Destroy};var TAnimation={$ClassName:"TAnimation",$Parent:TObject,$Init:function($){TObject.$Init($);$.FAnimationStep=null;$.FCompleted=false;$.FConfig=$.FControl$1=$.FNotifyAtEnd$1=$.FRepeater$1=null;$.FTimeStart=0;$.FTime_ms=0},AnimationTimer:function(S,Sender$7){var R=false;var progress=0;R=false;progress=((Now()-S.FTimeStart)*86400000)/S.FTime_ms;if(progress>1)progress=1;S.FAnimationStep(progress);if(progress==1){if((S.FConfig!==null)&&S.FConfig.FLoop){S.FTimeStart=Now()-2.31481481481481E-7}else{S.FCompleted=true;S.FNotifyAtEnd$1(S);R=true}}
return R},Create$60:function(S,control$1,time_ms$2,config$3,animationStep){TObject.Create(S);S.FAnimationStep=animationStep;S.FControl$1=control$1;S.FTime_ms=time_ms$2;S.FConfig=config$3;S.FCompleted=false;return S},Destroy:function(S){if(S.FRepeater$1)TObject.Free(S.FRepeater$1);S.FRepeater$1=null;TObject.Destroy(S)},Initialize:function(S,animationStep$1){},Interpolate$1:function(S,vStart,vStop,progress$1){return Math.round(vStart+((vStop-vStart)*progress$1))},IsActive$1:function(S){return S.FRepeater$1!==null},Start$3:function(S,notifyAtEnd){var animationStep$2={v:null};animationStep$2.v=S.FAnimationStep;TAnimation.Initialize$(S,animationStep$2);S.FAnimationStep=animationStep$2.v;S.FTimeStart=Now();S.FNotifyAtEnd$1=notifyAtEnd;S.FRepeater$1=TW3EventRepeater.Create$52($New(TW3EventRepeater),$Event1(S,TAnimation.AnimationTimer),20)},Destroy$:function($){return $.ClassType.Destroy($)},Initialize$:function($){return $.ClassType.Initialize.apply($.ClassType,arguments)}};var AnimationStart=["Immediate","AfterPrevious"];function Animation(){var R=null;if(!GAnimationManager)GAnimationManager=TObject.Create($New(TAnimationManager));R=GAnimationManager;return R};var TMoveAnimation={$ClassName:"TMoveAnimation",$Parent:TAnimation,$Init:function($){TAnimation.$Init($);$.FCachedIndex=0;$.FRelativeMove=false;$.FToPoint={X$1:0,Y$1:0}},Create$66:function(S,control$2,time_ms$3,config$4,path){var i$3=0;var lengths=[];var totalLen=0;S.FRelativeMove=false;$Assert(!Odd(path.length),"Path must contain even number of elements"," in TMoveAnimation.Create [line: 287, column: 3, file: SmartCL.Animation]");$Assert(path.length>=4,"Path must contain at least four elements"," in TMoveAnimation.Create [line: 288, column: 3, file: SmartCL.Animation]");totalLen=0;lengths.push(totalLen);var $tQ;for(i$3=0,$tQ=path.length-4;i$3<=$tQ;i$3+=2){totalLen+=Math.sqrt(Math.pow(path[i$3+2]-path[i$3],2)+Math.pow(path[i$3+3]-path[i$3+1],2));lengths.push(totalLen)}
TAnimation.Create$60(S,control$2,time_ms$3,config$4,function(progress$2){var x$22={};x$22.v=0;var y$11={};y$11.v=0;TMoveAnimation.FindPathCoords(S,progress$2,path,lengths,totalLen,x$22,y$11);TW3TagObj.BeginUpdate(control$2);TW3MovableControl.setLeft(control$2,x$22.v);TW3MovableControl.setTop(control$2,y$11.v);TW3TagObj.EndUpdate(control$2)});return S},Create$65:function(S,control$3,time_ms$4,config$5,fromPoint,toPoint){TAnimation.Create$60(S,control$3,time_ms$4,config$5,function(progress$3){TW3TagObj.BeginUpdate(control$3);TW3MovableControl.setLeft(control$3,TAnimation.Interpolate$1(S.ClassType,fromPoint.X$1,toPoint.X$1,progress$3));TW3MovableControl.setTop(control$3,TAnimation.Interpolate$1(S.ClassType,fromPoint.Y$1,toPoint.Y$1,progress$3));TW3TagObj.EndUpdate(control$3)});S.FRelativeMove=false;return S},Create$64:function(S,control$4,time_ms$5,config$6,toPoint$1){TAnimation.Create$60(S,control$4,time_ms$5,config$6,null);S.FRelativeMove=true;Copy$TPoint(toPoint$1,S.FToPoint);return S},FindPathCoords:function(S,progress$4,path$1,lengths$1,totalLen$1,x$23,y$12){var linePart=0;progress$4*=totalLen$1;if(progress$4>=lengths$1[S.FCachedIndex+1]){while((S.FCachedIndex<(lengths$1.length-2))&&(progress$4>=lengths$1[S.FCachedIndex+1])){++S.FCachedIndex}}
linePart=(progress$4-lengths$1[S.FCachedIndex])/(lengths$1[S.FCachedIndex+1]-lengths$1[S.FCachedIndex]);if(linePart>1)linePart=1;x$23.v=TAnimation.Interpolate$1(S.ClassType,path$1[S.FCachedIndex*2],path$1[(S.FCachedIndex*2)+2],linePart);y$12.v=TAnimation.Interpolate$1(S.ClassType,path$1[(S.FCachedIndex*2)+1],path$1[(S.FCachedIndex*2)+3],linePart)},Initialize:function(S,animationStep$3){var fromPoint$1={X$1:0,Y$1:0};if(S.FRelativeMove){fromPoint$1=Create$13(TW3MovableControl.GetLeft(S.FControl$1),TW3MovableControl.GetTop(S.FControl$1));animationStep$3.v=function(progress$5){TW3TagObj.BeginUpdate(S.FControl$1);TW3MovableControl.setLeft(S.FControl$1,TAnimation.Interpolate$1(S.ClassType,fromPoint$1.X$1,S.FToPoint.X$1,progress$5));TW3MovableControl.setTop(S.FControl$1,TAnimation.Interpolate$1(S.ClassType,fromPoint$1.Y$1,S.FToPoint.Y$1,progress$5));TW3TagObj.EndUpdate(S.FControl$1)}}},Destroy:TAnimation.Destroy,Initialize$:function($){return $.ClassType.Initialize.apply($.ClassType,arguments)}};var TW3Image={$ClassName:"TW3Image",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FOnLoad$1=null},CBOnLoad:function(S){if(S.FOnLoad$1)S.FOnLoad$1(S)},GetEnabled:function(S){return true},GetHeight:function(S){var R=0;R=TW3MovableControl.GetHeight(S);if(!R){if(S.FHandle$1)R=parseInt(S.FHandle$1.height,10)}
return R},getReady:function(S){var R=false;if(S.FHandle$1)R=(S.FHandle$1.complete&&(S.FHandle$1.naturalWidth>0))&&(S.FHandle$1.naturalHeight>0);return R},getSrc:function(S){var R="";if(S.FHandle$1)R=""+S.FHandle$1.src;return R},GetWidth:function(S){var R=0;R=TW3MovableControl.GetWidth(S);if(!R){if(S.FHandle$1)R=parseInt(S.FHandle$1.width,10)}
return R},LoadFromURL:function(S,aURL){w3_setAttrib(S.FHandle$1,"src",aURL)},MakeElementTagObj:function(S){return w3_createHtmlElement("img")},setSrc:function(S,Value$12){if(Value$12!=TW3Image.getSrc(S))TW3Image.LoadFromURL(S,Value$12)},_setOnLoad:function(S,aValue$66){S.FOnLoad$1=aValue$66;w3_bind2(S.FHandle$1,"onload",(aValue$66)?$Event0(S,TW3Image.CBOnLoad):$Event0(S,TW3Component.CBNoBehavior))},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight$:function($){return $.ClassType.GetHeight($)},GetWidth$:function($){return $.ClassType.GetWidth($)},Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled$:function($){return $.ClassType.GetEnabled($)},Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3ListMenu={$ClassName:"TW3ListMenu",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FItems=null},MakeElementTagObj:function(S){return w3_createHtmlElement("ul")},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FItems=TW3OwnedObject.Create$4$($New(TW3ListItems),S)},FinalizeObject:function(S){TObject.Free(S.FItems);TW3CustomControl.FinalizeObject(S)},StyleTagObject:function(S){TW3CustomControl.StyleTagObject(S);TW3CustomControl.setStyleClass(S,"ul")},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3ListItems={$ClassName:"TW3ListItems",$Parent:TW3OwnedObject,$Init:function($){TW3OwnedObject.$Init($);$.FObjects$1=null},AcceptParent:function(S,aObject$6){return(aObject$6!==null)&&$Is(aObject$6,TW3ListMenu)},Clear$5:function(S){var x$24=0;var $tR;for(x$24=0,$tR=TObjectList.GetCount$1(S.FObjects$1);x$24<$tR;x$24++){TObject.Free(TObjectList.GetItem$5(S.FObjects$1,x$24))}
TObjectList.Clear$2(S.FObjects$1)},Create$4:function(S,AOwner$9){TW3OwnedObject.Create$4(S,AOwner$9);S.FObjects$1=TObjectList.Create$41($New(TObjectList));return S},Destroy:function(S){TW3ListItems.Clear$5(S);TObject.Free(S.FObjects$1);TObject.Destroy(S)},Destroy$:function($){return $.ClassType.Destroy($)},AcceptParent$:function($){return $.ClassType.AcceptParent.apply($.ClassType,arguments)},Create$4$:function($){return $.ClassType.Create$4.apply($.ClassType,arguments)}};var TW3ListItem={$ClassName:"TW3ListItem",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($)},MakeElementTagObj:function(S){return w3_createHtmlElement("li")},StyleTagObject:function(S){TW3CustomControl.setStyleClass(S,"li")},GetEnabled:function(S){return true},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject:TW3CustomControl.InitializeObject,MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled$:function($){return $.ClassType.GetEnabled($)},Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3ToolButton={$ClassName:"TW3ToolButton",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($)},getCaption:function(S){return w3_getPropertyAsStr(S.FHandle$1,"innerHTML")},setCaption$2:function(S,aNewCaption){w3_setProperty(S.FHandle$1,"innerHTML",aNewCaption)},MakeElementTagObj:function(S){return w3_createHtmlElement("button")},StyleTagObject:function(S){TW3CustomControl.StyleTagObject(S);w3_setStyle(S.FHandle$1,"fontSmooth","always")},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);TW3MovableControl.SetWidth$(S,70);TW3MovableControl.setHeight$(S,30)},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject$:function($){return $.ClassType.StyleTagObject($)},Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3ToolbarButton={$ClassName:"TW3ToolbarButton",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.a$43=0;$.a$42=false;$.FCaption$2="";$.FGlyph=$.FOnDestroy=null},CBClick:function(S,eventObj$24){if(S.a$43>0){if(TW3ToolbarButton.getDown(S)){if(S.a$42)TW3ToolbarButton.setDown(S,false)}else{TW3ToolbarButton.MakeGroupUp(S,S.a$43);TW3ToolbarButton.setDown(S,true)}}
TW3CustomControl.CBClick(S,eventObj$24)},ChangeCaption:function(S,aNewCaption$1){var mHtml="";S.FCaption$2=aNewCaption$1;if(TW3Image.getReady(S.FGlyph)){mHtml=mHtml+"<img src=\""+TW3Image.getSrc(S.FGlyph)+"\" width=16px height=16px>";mHtml+="<br>"}
mHtml+=S.FCaption$2;TW3TagObj.SetInnerHTML(S,mHtml)},Create$53:function(S,AOwner$10,OnDestroy){TW3CustomControl.Create$18(S,AOwner$10);S.FOnDestroy=OnDestroy;return S},Destroy:function(S){if(S.FOnDestroy)S.FOnDestroy(S);TW3TagObj.Destroy(S)},FinalizeObject:function(S){TObject.Free(S.FGlyph);TW3CustomControl.FinalizeObject(S)},getDown:function(S){return TW3CSSClassStyleNames.IndexOf$2(TW3CustomControl.getClassNames(S),"ButtonDown")>=0},HandleGlyphReady:function(S,Sender$8){var mTemp$4="";mTemp$4=S.FCaption$2;S.FCaption$2="";TW3ToolbarButton.ChangeCaption(S,mTemp$4)},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FGlyph=TW3Component.Create$18$($New(TW3Image),null);TW3Image._setOnLoad(S.FGlyph,$Event1(S,TW3ToolbarButton.HandleGlyphReady))},MakeElementTagObj:function(S){return w3_createHtmlElement("button")},MakeGroupUp:function(S,aGroupIndex){var i$4=0;var btn=null;var $tS;for(i$4=0,$tS=TW3Toolbar.getButtonCount(TW3ToolbarButton.Toolbar(S));i$4<$tS;i$4++){btn=TW3Toolbar.getButton(TW3ToolbarButton.Toolbar(S),i$4);if((btn.a$43==aGroupIndex)&&TW3ToolbarButton.getDown(btn))TW3ToolbarButton.setDown(btn,false)}},SetCaption$1:function(S,aNewCaption$2){if(aNewCaption$2!=S.FCaption$2)TW3ToolbarButton.ChangeCaption(S,aNewCaption$2)},setDown:function(S,Value$13){if(Value$13){if(!TW3ToolbarButton.getDown(S))TW3CSSClassStyleNames.Add$2(TW3CustomControl.getClassNames(S),"ButtonDown")}else if(TW3ToolbarButton.getDown(S))TW3CSSClassStyleNames.RemoveByName(TW3CustomControl.getClassNames(S),"ButtonDown")},Toolbar:function(S){return $As(S.FParent,TW3Toolbar)},Destroy$:function($){return $.ClassType.Destroy($)},AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject$:function($){return $.ClassType.FinalizeObject($)},InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj$:function($){return $.ClassType.MakeElementTagObj($)},StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize:TW3MovableControl.Resize,setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick$:function($){return $.ClassType.CBClick.apply($.ClassType,arguments)},CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3Toolbar={$ClassName:"TW3Toolbar",$Parent:TW3CustomControl,$Init:function($){TW3CustomControl.$Init($);$.FBtnHeight=$.FBtnSpacing=$.FBtnWidth=0;$.FButtons=[]},getButton:function(S,idx$3){return S.FButtons[idx$3]},getButtonCount:function(S){return S.FButtons.length},InitializeObject:function(S){TW3CustomControl.InitializeObject(S);S.FBtnWidth=100;S.FBtnHeight=36;S.FBtnSpacing=2},Resize:function(S){var x$25=0;var dx$5=0;var dy$6=0;var mChild$2=null;dx$5=S.FBtnSpacing;var $tT;for(x$25=0,$tT=TW3Component.GetChildCount(S);x$25<$tT;x$25++){mChild$2=TW3Component.GetChildObject(S,x$25);if($Is(mChild$2,TW3ToolbarButton)){dy$6=0;TW3MovableControl.SetBounds$2($As(mChild$2,TW3ToolbarButton),dx$5,dy$6,S.FBtnWidth,TW3MovableControl.GetHeight$(S));(dx$5+=(S.FBtnWidth+S.FBtnSpacing))}}},setBtnHeight:function(S,Value$14){if(S.FObjReady){Value$14=ClampInt(Value$14,16,TW3MovableControl.GetHeight$(S))}else Value$14=Math.max(Value$14,16);if(Value$14!=S.FBtnHeight){TW3TagObj.BeginUpdate(S);S.FBtnHeight=Value$14;TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)}},setBtnSpacing:function(S,Value$15){Value$15=Math.max(Value$15,1);if(Value$15!=S.FBtnSpacing){S.FBtnSpacing=Value$15;TW3CustomControl.LayoutChildren(S)}},setBtnWidth:function(S,Value$16){Value$16=Math.max(Value$16,16);if(Value$16!=S.FBtnWidth){TW3TagObj.BeginUpdate(S);S.FBtnWidth=Value$16;TW3MovableControl.SetWasSized(S);TW3TagObj.EndUpdate(S)}},Destroy:TW3TagObj.Destroy,AfterUpdate:TW3CustomControl.AfterUpdate,FinalizeObject:TW3CustomControl.FinalizeObject,InitializeObject$:function($){return $.ClassType.InitializeObject($)},MakeElementTagId:TW3TagObj.MakeElementTagId,MakeElementTagObj:TW3TagObj.MakeElementTagObj,StyleTagObject:TW3CustomControl.StyleTagObject,Create$18:TW3CustomControl.Create$18,GetHeight:TW3MovableControl.GetHeight,GetWidth:TW3MovableControl.GetWidth,Resize$:function($){return $.ClassType.Resize($)},setHeight:TW3MovableControl.setHeight,SetWidth:TW3MovableControl.SetWidth,supportAdjustment:TW3MovableControl.supportAdjustment,CBClick:TW3CustomControl.CBClick,CBKeyDown:TW3CustomControl.CBKeyDown,CBKeyUp:TW3CustomControl.CBKeyUp,CBMouseDown:TW3CustomControl.CBMouseDown,CBMouseMove:TW3CustomControl.CBMouseMove,CBMouseUp:TW3CustomControl.CBMouseUp,GetEnabled:TW3CustomControl.GetEnabled,Invalidate:TW3CustomControl.Invalidate,SetEnabled:TW3CustomControl.SetEnabled};var TW3AutoRefresh={$ClassName:"TW3AutoRefresh",$Parent:TObject,$Init:function($){TObject.$Init($);$.a$4=$.a$2="";$.a$3=0;$.FActive=false;$.FPollRequest=null},a$1:function(S,Value$17){if(Value$17){TW3AutoRefresh.Start(S)}else TW3AutoRefresh.Stop(S)},Create$14:function(S){S.FPollRequest=TW3HttpRequest.Create$16($New(TW3HttpRequest));S.FPollRequest.FOnDataReady$1=function(req){if(S.a$4==""){S.a$4=TW3HttpRequest.ResponseText(req)}else if(S.a$4!=TW3HttpRequest.ResponseText(req)){window.location.reload()}
TW3AutoRefresh.NewPolling(S)};S.FPollRequest.FOnError=function(_implicit_Sender){TW3AutoRefresh.NewPolling(S)};S.a$2="/timestamp.txt";return S},NewPolling:function(S){setTimeout(function(){TW3HttpRequest.Abort(S.FPollRequest);if(S.FActive)TW3HttpRequest.Get(S.FPollRequest,S.a$2)},(Math.max(S.a$3,1000)))},Start:function(S){if(S.FActive)return;S.FActive=true;S.a$4="";TW3AutoRefresh.NewPolling(S)},Stop:function(S){if(!S.FActive)return;S.FActive=false;TW3HttpRequest.Abort(S.FPollRequest)},Destroy:TObject.Destroy};var TW3JSONP={$ClassName:"TW3JSONP",$Parent:TObject,$Init:function($){TObject.$Init($);$.FAllocated=false;$.FData=undefined;$.FHandle=undefined;$.FID=0},Create$15:function(S){S.FID=++vJSON_ID;return S},Destroy:function(S){TW3JSONP.Release(S);TObject.Destroy(S)},Release:function(S){if(!S.FAllocated)return;S.FData=null;S.FHandle.parent.removeChild(S.FHandle);S.FHandle=null;S.FAllocated=false},Destroy$:function($){return $.ClassType.Destroy($)}};var TW3HttpRequest={$ClassName:"TW3HttpRequest",$Parent:TObject,$Init:function($){TObject.$Init($);$.FOnDataReady$1=null;$.FOnError=null;$.FOnLoad=null;$.FOnReadyStateChange=null;$.FReqObj=undefined},Abort:function(S){S.FReqObj.abort()},Create$16:function(S){TObject.Create(S);S.FReqObj=new XMLHttpRequest();S.FReqObj.onreadystatechange=$Event0(S,TW3HttpRequest.HandleReadyStateChange);S.FReqObj.onerror=$Event0(S,TW3HttpRequest.HandleOnError);S.FReqObj.onload=$Event0(S,TW3HttpRequest.HandleOnLoad);return S},Destroy:function(S){S.FReqObj.OnReadyStateChange=null;S.FReqObj=null;TObject.Destroy(S)},Get:function(S,aURL$1){TW3HttpRequest.Open(S,"GET",aURL$1);TW3HttpRequest.Send(S)},HandleOnError:function(S){if(S.FOnError)S.FOnError(S)},HandleOnLoad:function(S){if(S.FOnLoad)S.FOnLoad(S)},HandleReadyStateChange:function(S){if((S.FReqObj.readyState==4)&&(S.FOnDataReady$1!==null))S.FOnDataReady$1(S);if(S.FOnReadyStateChange)S.FOnReadyStateChange(S)},Open:function(S,aMeth,aURL$2){S.FReqObj.open(aMeth,aURL$2)},ResponseText:function(S){var R="";var r$2=undefined;r$2=S.FReqObj.responseText;if(r$2)R=""+r$2;return R},Send:function(S){S.FReqObj.send()},Destroy$:function($){return $.ClassType.Destroy($)}};var THttpRequestReadyState=["rrsUnsent","rrsOpened","rrsHeadersReceived","rrsLoading","rrsDone"];var vColorNames=[];var vColorNames=["aqua","black","blue","fuchsia","green","gray","lime","maroon","navy","olive","purple","red","silver","teal","white","yellow"].slice();var vColorValues=[];var vColorValues=["#0ff","#000","#00f","#f0f","#008000","#808080","#0f0","#800000","#000080","#808000","#800080","#f00","#c0c0c0","#008080","#fff","#ff00"].slice();var vCurrent=null;var vScheduledControls=[];var vScheduledCallbacks=[];var vOnPerform=[];var vPending=false;var RegisterComponentsProc=null;var DefaultDuration=2;var DefaultTiming=1;var vGetNow=undefined;var vIsHighResolution=false;var PressedCSSClass="TW3Button_Pressed";var Instance=null;var vCaptureControl=null;var vCaptureInitialized=false;var vJSON_ID=0;var Application$1=null;var GAnimationManager=null;var GlobalRepeaterList=[];var GForms=null;var vUniqueNumber=0;var vVendor=0;var vDriver=null;var vRequestAnimFrame=null;var vCancelAnimFrame=null;var $Application=function(){TW3AutoRefresh.Start(TW3AutoRefresh.Create$14($New(TW3AutoRefresh)));try{Application$1=TW3CustomApplication.Create$20($New(TW3CustomApplication));TW3CustomApplication.CreateForm(Application$1,TMainForm,true);TW3CustomApplication.RunApp(Application$1)}catch($e){var e$12=$W($e);alert(e$12.FMessage)}}
$Application();
}
window.onload = function () { bootstrap(); }
</script>
</head>
<body></body>
</html>