this.THCEmrViewLib=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=130)}([function(t,e,i){var n=i(2),o=i(18),r=i(11),s=i(12),a=i(19),l=function(t,e,i){var h,c,u,f,d=t&l.F,m=t&l.G,y=t&l.S,p=t&l.P,S=t&l.B,v=m?n:y?n[e]||(n[e]={}):(n[e]||{}).prototype,F=m?o:o[e]||(o[e]={}),I=F.prototype||(F.prototype={});for(h in m&&(i=e),i)u=((c=!d&&v&&void 0!==v[h])?v:i)[h],f=S&&c?a(u,n):p&&"function"==typeof u?a(Function.call,u):u,v&&s(v,h,u,t&l.U),F[h]!=u&&r(F,h,f),p&&I[h]!=u&&(I[h]=u)};n.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,i){var n=i(4);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){var n=i(47)("wks"),o=i(33),r=i(2).Symbol,s="function"==typeof r;(t.exports=function(t){return n[t]||(n[t]=s&&r[t]||(s?r:o)("Symbol."+t))}).store=n},function(t,e,i){var n=i(21),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,i){t.exports=!i(3)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,i){var n=i(1),o=i(94),r=i(23),s=Object.defineProperty;e.f=i(7)?Object.defineProperty:function(t,e,i){if(n(t),e=r(e,!0),n(i),o)try{return s(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var n=i(24);t.exports=function(t){return Object(n(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var n=i(8),o=i(32);t.exports=i(7)?function(t,e,i){return n.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var n=i(2),o=i(11),r=i(14),s=i(33)("src"),a=i(134),l=(""+a).split("toString");i(18).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,i,a){var h="function"==typeof i;h&&(r(i,"name")||o(i,"name",e)),t[e]!==i&&(h&&(r(i,s)||o(i,s,t[e]?""+t[e]:l.join(String(e)))),t===n?t[e]=i:a?t[e]?t[e]=i:o(t,e,i):(delete t[e],o(t,e,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(t,e,i){var n=i(0),o=i(3),r=i(24),s=/"/g,a=function(t,e,i,n){var o=String(r(t)),a="<"+e;return""!==i&&(a+=" "+i+'="'+String(n).replace(s,""")+'"'),a+">"+o+""};t.exports=function(t,e){var i={};i[t]=e(a),n(n.P+n.F*o((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",i)}},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var n=i(48),o=i(24);t.exports=function(t){return n(o(t))}},function(t,e,i){var n=i(49),o=i(32),r=i(15),s=i(23),a=i(14),l=i(94),h=Object.getOwnPropertyDescriptor;e.f=i(7)?h:function(t,e){if(t=r(t),e=s(e,!0),l)try{return h(t,e)}catch(t){}if(a(t,e))return o(!n.f.call(t,e),t[e])}},function(t,e,i){var n=i(14),o=i(9),r=i(68)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){var i=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=i)},function(t,e,i){var n=i(10);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){"use strict";var n=i(3);t.exports=function(t,e){return!!t&&n((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var n=i(4);t.exports=function(t,e){if(!n(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!n(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var n=i(0),o=i(18),r=i(3);t.exports=function(t,e){var i=(o.Object||{})[t]||Object[t],s={};s[t]=e(i),n(n.S+n.F*r((function(){i(1)})),"Object",s)}},function(t,e,i){var n=i(19),o=i(48),r=i(9),s=i(6),a=i(84);t.exports=function(t,e){var i=1==t,l=2==t,h=3==t,c=4==t,u=6==t,f=5==t||u,d=e||a;return function(e,a,m){for(var y,p,S=r(e),v=o(S),F=n(a,m,3),I=s(v.length),g=0,w=i?d(e,I):l?d(e,0):void 0;I>g;g++)if((f||g in v)&&(p=F(y=v[g],g,S),t))if(i)w[g]=p;else if(p)switch(t){case 3:return!0;case 5:return y;case 6:return g;case 2:w.push(y)}else if(c)return!1;return u?-1:h||c?c:w}}},function(t,e,i){"use strict";if(i(7)){var n=i(29),o=i(2),r=i(3),s=i(0),a=i(62),l=i(92),h=i(19),c=i(39),u=i(32),f=i(11),d=i(41),m=i(21),y=i(6),p=i(122),S=i(35),v=i(23),F=i(14),I=i(44),g=i(4),w=i(9),C=i(81),k=i(36),P=i(17),D=i(37).f,b=i(83),R=i(33),_=i(5),x=i(26),A=i(52),T=i(51),O=i(86),N=i(46),B=i(57),E=i(38),M=i(85),L=i(111),G=i(8),H=i(16),U=G.f,V=H.f,W=o.RangeError,z=o.TypeError,j=o.Uint8Array,X=Array.prototype,K=l.ArrayBuffer,Y=l.DataView,J=x(0),Z=x(2),q=x(3),Q=x(4),$=x(5),tt=x(6),et=A(!0),it=A(!1),nt=O.values,ot=O.keys,rt=O.entries,st=X.lastIndexOf,at=X.reduce,lt=X.reduceRight,ht=X.join,ct=X.sort,ut=X.slice,ft=X.toString,dt=X.toLocaleString,mt=_("iterator"),yt=_("toStringTag"),pt=R("typed_constructor"),St=R("def_constructor"),vt=a.CONSTR,Ft=a.TYPED,It=a.VIEW,gt=x(1,(function(t,e){return Dt(T(t,t[St]),e)})),wt=r((function(){return 1===new j(new Uint16Array([1]).buffer)[0]})),Ct=!!j&&!!j.prototype.set&&r((function(){new j(1).set({})})),kt=function(t,e){var i=m(t);if(i<0||i%e)throw W("Wrong offset!");return i},Pt=function(t){if(g(t)&&Ft in t)return t;throw z(t+" is not a typed array!")},Dt=function(t,e){if(!g(t)||!(pt in t))throw z("It is not a typed array constructor!");return new t(e)},bt=function(t,e){return Rt(T(t,t[St]),e)},Rt=function(t,e){for(var i=0,n=e.length,o=Dt(t,n);n>i;)o[i]=e[i++];return o},_t=function(t,e,i){U(t,e,{get:function(){return this._d[i]}})},xt=function(t){var e,i,n,o,r,s,a=w(t),l=arguments.length,c=l>1?arguments[1]:void 0,u=void 0!==c,f=b(a);if(null!=f&&!C(f)){for(s=f.call(a),n=[],e=0;!(r=s.next()).done;e++)n.push(r.value);a=n}for(u&&l>2&&(c=h(c,arguments[2],2)),e=0,i=y(a.length),o=Dt(this,i);i>e;e++)o[e]=u?c(a[e],e):a[e];return o},At=function(){for(var t=0,e=arguments.length,i=Dt(this,e);e>t;)i[t]=arguments[t++];return i},Tt=!!j&&r((function(){dt.call(new j(1))})),Ot=function(){return dt.apply(Tt?ut.call(Pt(this)):Pt(this),arguments)},Nt={copyWithin:function(t,e){return L.call(Pt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return Q(Pt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return M.apply(Pt(this),arguments)},filter:function(t){return bt(this,Z(Pt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return $(Pt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Pt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return it(Pt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Pt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Pt(this),arguments)},lastIndexOf:function(t){return st.apply(Pt(this),arguments)},map:function(t){return gt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return at.apply(Pt(this),arguments)},reduceRight:function(t){return lt.apply(Pt(this),arguments)},reverse:function(){for(var t,e=Pt(this).length,i=Math.floor(e/2),n=0;n1?arguments[1]:void 0)},sort:function(t){return ct.call(Pt(this),t)},subarray:function(t,e){var i=Pt(this),n=i.length,o=S(t,n);return new(T(i,i[St]))(i.buffer,i.byteOffset+o*i.BYTES_PER_ELEMENT,y((void 0===e?n:S(e,n))-o))}},Bt=function(t,e){return bt(this,ut.call(Pt(this),t,e))},Et=function(t){Pt(this);var e=kt(arguments[1],1),i=this.length,n=w(t),o=y(n.length),r=0;if(o+e>i)throw W("Wrong length!");for(;r255?255:255&n),o.v[d](i*e+o.o,n,wt)}(this,i,t)},enumerable:!0})};F?(m=i((function(t,i,n,o){c(t,m,h,"_d");var r,s,a,l,u=0,d=0;if(g(i)){if(!(i instanceof K||"ArrayBuffer"==(l=I(i))||"SharedArrayBuffer"==l))return Ft in i?Rt(m,i):xt.call(m,i);r=i,d=kt(n,e);var S=i.byteLength;if(void 0===o){if(S%e)throw W("Wrong length!");if((s=S-d)<0)throw W("Wrong length!")}else if((s=y(o)*e)+d>S)throw W("Wrong length!");a=s/e}else a=p(i),r=new K(s=a*e);for(f(t,"_d",{b:r,o:d,l:s,e:a,v:new Y(r)});udocument.F=Object<\/script>"),t.close(),l=t.F;n--;)delete l.prototype[r[n]];return l()};t.exports=Object.create||function(t,e){var i;return null!==t?(a.prototype=n(t),i=new a,a.prototype=null,i[s]=t):i=l(),void 0===e?i:o(i,e)}},function(t,e,i){var n=i(96),o=i(69).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},function(t,e,i){"use strict";var n=i(2),o=i(8),r=i(7),s=i(5)("species");t.exports=function(t){var e=n[t];r&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,i,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(i+": incorrect invocation!");return t}},function(t,e,i){var n=i(19),o=i(109),r=i(81),s=i(1),a=i(6),l=i(83),h={},c={};(e=t.exports=function(t,e,i,u,f){var d,m,y,p,S=f?function(){return t}:l(t),v=n(i,u,e?2:1),F=0;if("function"!=typeof S)throw TypeError(t+" is not iterable!");if(r(S)){for(d=a(t.length);d>F;F++)if((p=e?v(s(m=t[F])[0],m[1]):v(t[F]))===h||p===c)return p}else for(y=S.call(t);!(m=y.next()).done;)if((p=o(y,v,m.value,e))===h||p===c)return p}).BREAK=h,e.RETURN=c},function(t,e,i){var n=i(12);t.exports=function(t,e,i){for(var o in e)n(t,o,e[o],i);return t}},function(t,e,i){var n=i(4);t.exports=function(t,e){if(!n(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,i){var n=i(8).f,o=i(14),r=i(5)("toStringTag");t.exports=function(t,e,i){t&&!o(t=i?t:t.prototype,r)&&n(t,r,{configurable:!0,value:e})}},function(t,e,i){var n=i(20),o=i(5)("toStringTag"),r="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?i:r?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,i){var n=i(0),o=i(24),r=i(3),s=i(72),a="["+s+"]",l=RegExp("^"+a+a+"*"),h=RegExp(a+a+"*$"),c=function(t,e,i){var o={},a=r((function(){return!!s[t]()||"​…"!="​…"[t]()})),l=o[t]=a?e(u):s[t];i&&(o[i]=l),n(n.P+n.F*a,"String",o)},u=c.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(h,"")),t};t.exports=c},function(t,e){t.exports={}},function(t,e,i){var n=i(18),o=i(2),r=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:n.version,mode:i(29)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,i){var n=i(20);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){"use strict";var n=i(1);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,i){var n=i(1),o=i(10),r=i(5)("species");t.exports=function(t,e){var i,s=n(t).constructor;return void 0===s||null==(i=n(s)[r])?e:o(i)}},function(t,e,i){var n=i(15),o=i(6),r=i(35);t.exports=function(t){return function(e,i,s){var a,l=n(e),h=o(l.length),c=r(s,h);if(t&&i!=i){for(;h>c;)if((a=l[c++])!=a)return!0}else for(;h>c;c++)if((t||c in l)&&l[c]===i)return t||c||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,i){var n=i(20);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){var n=i(21),o=i(24);t.exports=function(t){return function(e,i){var r,s,a=String(o(e)),l=n(i),h=a.length;return l<0||l>=h?t?"":void 0:(r=a.charCodeAt(l))<55296||r>56319||l+1===h||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):r:t?a.slice(l,l+2):s-56320+(r-55296<<10)+65536}}},function(t,e,i){var n=i(4),o=i(20),r=i(5)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==o(t))}},function(t,e,i){var n=i(5)("iterator"),o=!1;try{var r=[7][n]();r.return=function(){o=!0},Array.from(r,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var i=!1;try{var r=[7],s=r[n]();s.next=function(){return{done:i=!0}},r[n]=function(){return s},t(r)}catch(t){}return i}},function(t,e,i){"use strict";var n=i(44),o=RegExp.prototype.exec;t.exports=function(t,e){var i=t.exec;if("function"==typeof i){var r=i.call(t,e);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==n(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e,i){"use strict";i(113);var n=i(12),o=i(11),r=i(3),s=i(24),a=i(5),l=i(87),h=a("species"),c=!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),u=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();t.exports=function(t,e,i){var f=a(t),d=!r((function(){var e={};return e[f]=function(){return 7},7!=""[t](e)})),m=d?!r((function(){var e=!1,i=/a/;return i.exec=function(){return e=!0,null},"split"===t&&(i.constructor={},i.constructor[h]=function(){return i}),i[f](""),!e})):void 0;if(!d||!m||"replace"===t&&!c||"split"===t&&!u){var y=/./[f],p=i(s,f,""[t],(function(t,e,i,n,o){return e.exec===l?d&&!o?{done:!0,value:y.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}})),S=p[0],v=p[1];n(String.prototype,t,S),o(RegExp.prototype,f,2==e?function(t,e){return v.call(t,this,e)}:function(t){return v.call(t,this)})}}},function(t,e,i){var n=i(2).navigator;t.exports=n&&n.userAgent||""},function(t,e,i){"use strict";var n=i(2),o=i(0),r=i(12),s=i(41),a=i(30),l=i(40),h=i(39),c=i(4),u=i(3),f=i(57),d=i(43),m=i(73);t.exports=function(t,e,i,y,p,S){var v=n[t],F=v,I=p?"set":"add",g=F&&F.prototype,w={},C=function(t){var e=g[t];r(g,t,"delete"==t||"has"==t?function(t){return!(S&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return S&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,i){return e.call(this,0===t?0:t,i),this})};if("function"==typeof F&&(S||g.forEach&&!u((function(){(new F).entries().next()})))){var k=new F,P=k[I](S?{}:-0,1)!=k,D=u((function(){k.has(1)})),b=f((function(t){new F(t)})),R=!S&&u((function(){for(var t=new F,e=5;e--;)t[I](e,e);return!t.has(-0)}));b||((F=e((function(e,i){h(e,F,t);var n=m(new v,e,F);return null!=i&&l(i,p,n[I],n),n}))).prototype=g,g.constructor=F),(D||R)&&(C("delete"),C("has"),p&&C("get")),(R||P)&&C(I),S&&g.clear&&delete g.clear}else F=y.getConstructor(e,t,p,I),s(F.prototype,i),a.NEED=!0;return d(F,t),w[t]=F,o(o.G+o.W+o.F*(F!=v),w),S||y.setStrong(F,t,p),F}},function(t,e,i){for(var n,o=i(2),r=i(11),s=i(33),a=s("typed_array"),l=s("view"),h=!(!o.ArrayBuffer||!o.DataView),c=h,u=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(n=o[f[u++]])?(r(n.prototype,a,!0),r(n.prototype,l,!0)):c=!1;t.exports={ABV:h,CONSTR:c,TYPED:a,VIEW:l}},function(t,e,i){"use strict";t.exports=i(29)||!i(3)((function(){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete i(2)[t]}))},function(t,e,i){"use strict";var n=i(0);t.exports=function(t){n(n.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,i){"use strict";var n=i(0),o=i(10),r=i(19),s=i(40);t.exports=function(t){n(n.S,t,{from:function(t){var e,i,n,a,l=arguments[1];return o(this),(e=void 0!==l)&&o(l),null==t?new this:(i=[],e?(n=0,a=r(l,arguments[2],2),s(t,!1,(function(t){i.push(a(t,n++))}))):s(t,!1,i.push,i),new this(i))}})}},function(t,e,i){var n=i(4),o=i(2).document,r=n(o)&&n(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},function(t,e,i){var n=i(2),o=i(18),r=i(29),s=i(95),a=i(8).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=r?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,i){var n=i(47)("keys"),o=i(33);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var n=i(2).document;t.exports=n&&n.documentElement},function(t,e,i){var n=i(4),o=i(1),r=function(t,e){if(o(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=i(19)(Function.call,i(16).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return r(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:r}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,i){var n=i(4),o=i(71).set;t.exports=function(t,e,i){var r,s=e.constructor;return s!==i&&"function"==typeof s&&(r=s.prototype)!==i.prototype&&n(r)&&o&&o(t,r),t}},function(t,e,i){"use strict";var n=i(21),o=i(24);t.exports=function(t){var e=String(o(this)),i="",r=n(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(i+=e);return i}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var i=Math.expm1;t.exports=!i||i(10)>22025.465794806718||i(10)<22025.465794806718||-2e-17!=i(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:i},function(t,e,i){"use strict";var n=i(29),o=i(0),r=i(12),s=i(11),a=i(46),l=i(78),h=i(43),c=i(17),u=i(5)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,i,m,y,p,S){l(i,e,m);var v,F,I,g=function(t){if(!f&&t in P)return P[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},w=e+" Iterator",C="values"==y,k=!1,P=t.prototype,D=P[u]||P["@@iterator"]||y&&P[y],b=D||g(y),R=y?C?g("entries"):b:void 0,_="Array"==e&&P.entries||D;if(_&&(I=c(_.call(new t)))!==Object.prototype&&I.next&&(h(I,w,!0),n||"function"==typeof I[u]||s(I,u,d)),C&&D&&"values"!==D.name&&(k=!0,b=function(){return D.call(this)}),n&&!S||!f&&!k&&P[u]||s(P,u,b),a[e]=b,a[w]=d,y)if(v={values:C?b:g("values"),keys:p?b:g("keys"),entries:R},S)for(F in v)F in P||r(P,F,v[F]);else o(o.P+o.F*(f||k),e,v);return v}},function(t,e,i){"use strict";var n=i(36),o=i(32),r=i(43),s={};i(11)(s,i(5)("iterator"),(function(){return this})),t.exports=function(t,e,i){t.prototype=n(s,{next:o(1,i)}),r(t,e+" Iterator")}},function(t,e,i){var n=i(56),o=i(24);t.exports=function(t,e,i){if(n(e))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(t))}},function(t,e,i){var n=i(5)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[n]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,i){var n=i(46),o=i(5)("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||r[o]===t)}},function(t,e,i){"use strict";var n=i(8),o=i(32);t.exports=function(t,e,i){e in t?n.f(t,e,o(0,i)):t[e]=i}},function(t,e,i){var n=i(44),o=i(5)("iterator"),r=i(46);t.exports=i(18).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||r[n(t)]}},function(t,e,i){var n=i(223);t.exports=function(t,e){return new(n(t))(e)}},function(t,e,i){"use strict";var n=i(9),o=i(35),r=i(6);t.exports=function(t){for(var e=n(this),i=r(e.length),s=arguments.length,a=o(s>1?arguments[1]:void 0,i),l=s>2?arguments[2]:void 0,h=void 0===l?i:o(l,i);h>a;)e[a++]=t;return e}},function(t,e,i){"use strict";var n=i(31),o=i(112),r=i(46),s=i(15);t.exports=i(77)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])}),"values"),r.Arguments=r.Array,n("keys"),n("values"),n("entries")},function(t,e,i){"use strict";var n,o,r=i(50),s=RegExp.prototype.exec,a=String.prototype.replace,l=s,h=(n=/a/,o=/b*/g,s.call(n,"a"),s.call(o,"a"),0!==n.lastIndex||0!==o.lastIndex),c=void 0!==/()??/.exec("")[1];(h||c)&&(l=function(t){var e,i,n,o,l=this;return c&&(i=new RegExp("^"+l.source+"$(?!\\s)",r.call(l))),h&&(e=l.lastIndex),n=s.call(l,t),h&&n&&(l.lastIndex=l.global?n.index+n[0].length:e),c&&n&&n.length>1&&a.call(n[0],i,(function(){for(o=1;oi;)e.push(arguments[i++]);return S[++p]=function(){a("function"==typeof t?t:Function(t),e)},n(p),p},d=function(t){delete S[t]},"process"==i(20)(u)?n=function(t){u.nextTick(s(v,t,1))}:y&&y.now?n=function(t){y.now(s(v,t,1))}:m?(r=(o=new m).port2,o.port1.onmessage=F,n=s(r.postMessage,r,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(t){c.postMessage(t+"","*")},c.addEventListener("message",F,!1)):n="onreadystatechange"in h("script")?function(t){l.appendChild(h("script")).onreadystatechange=function(){l.removeChild(this),v.call(t)}}:function(t){setTimeout(s(v,t,1),0)}),t.exports={set:f,clear:d}},function(t,e,i){var n=i(2),o=i(89).set,r=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,l="process"==i(20)(s);t.exports=function(){var t,e,i,h=function(){var n,o;for(l&&(n=s.domain)&&n.exit();t;){o=t.fn,t=t.next;try{o()}catch(n){throw t?i():e=void 0,n}}e=void 0,n&&n.enter()};if(l)i=function(){s.nextTick(h)};else if(!r||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var c=a.resolve(void 0);i=function(){c.then(h)}}else i=function(){o.call(n,h)};else{var u=!0,f=document.createTextNode("");new r(h).observe(f,{characterData:!0}),i=function(){f.data=u=!u}}return function(n){var o={fn:n,next:void 0};e&&(e.next=o),t||(t=o,i()),e=o}}},function(t,e,i){"use strict";var n=i(10);function o(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=n})),this.resolve=n(e),this.reject=n(i)}t.exports.f=function(t){return new o(t)}},function(t,e,i){"use strict";var n=i(2),o=i(7),r=i(29),s=i(62),a=i(11),l=i(41),h=i(3),c=i(39),u=i(21),f=i(6),d=i(122),m=i(37).f,y=i(8).f,p=i(85),S=i(43),v=n.ArrayBuffer,F=n.DataView,I=n.Math,g=n.RangeError,w=n.Infinity,C=v,k=I.abs,P=I.pow,D=I.floor,b=I.log,R=I.LN2,_=o?"_b":"buffer",x=o?"_l":"byteLength",A=o?"_o":"byteOffset";function T(t,e,i){var n,o,r,s=new Array(i),a=8*i-e-1,l=(1<>1,c=23===e?P(2,-24)-P(2,-77):0,u=0,f=t<0||0===t&&1/t<0?1:0;for((t=k(t))!=t||t===w?(o=t!=t?1:0,n=l):(n=D(b(t)/R),t*(r=P(2,-n))<1&&(n--,r*=2),(t+=n+h>=1?c/r:c*P(2,1-h))*r>=2&&(n++,r/=2),n+h>=l?(o=0,n=l):n+h>=1?(o=(t*r-1)*P(2,e),n+=h):(o=t*P(2,h-1)*P(2,e),n=0));e>=8;s[u++]=255&o,o/=256,e-=8);for(n=n<0;s[u++]=255&n,n/=256,a-=8);return s[--u]|=128*f,s}function O(t,e,i){var n,o=8*i-e-1,r=(1<>1,a=o-7,l=i-1,h=t[l--],c=127&h;for(h>>=7;a>0;c=256*c+t[l],l--,a-=8);for(n=c&(1<<-a)-1,c>>=-a,a+=e;a>0;n=256*n+t[l],l--,a-=8);if(0===c)c=1-s;else{if(c===r)return n?NaN:h?-w:w;n+=P(2,e),c-=s}return(h?-1:1)*n*P(2,c-e)}function N(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function E(t){return[255&t,t>>8&255]}function M(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function L(t){return T(t,52,8)}function G(t){return T(t,23,4)}function H(t,e,i){y(t.prototype,e,{get:function(){return this[i]}})}function U(t,e,i,n){var o=d(+i);if(o+e>t[x])throw g("Wrong index!");var r=t[_]._b,s=o+t[A],a=r.slice(s,s+e);return n?a:a.reverse()}function V(t,e,i,n,o,r){var s=d(+i);if(s+e>t[x])throw g("Wrong index!");for(var a=t[_]._b,l=s+t[A],h=n(+o),c=0;cX;)(W=j[X++])in v||a(v,W,C[W]);r||(z.constructor=v)}var K=new F(new v(2)),Y=F.prototype.setInt8;K.setInt8(0,2147483648),K.setInt8(1,2147483649),!K.getInt8(0)&&K.getInt8(1)||l(F.prototype,{setInt8:function(t,e){Y.call(this,t,e<<24>>24)},setUint8:function(t,e){Y.call(this,t,e<<24>>24)}},!0)}else v=function(t){c(this,v,"ArrayBuffer");var e=d(t);this._b=p.call(new Array(e),0),this[x]=e},F=function(t,e,i){c(this,F,"DataView"),c(t,v,"DataView");var n=t[x],o=u(e);if(o<0||o>n)throw g("Wrong offset!");if(o+(i=void 0===i?n-o:f(i))>n)throw g("Wrong length!");this[_]=t,this[A]=o,this[x]=i},o&&(H(v,"byteLength","_l"),H(F,"buffer","_b"),H(F,"byteLength","_l"),H(F,"byteOffset","_o")),l(F.prototype,{getInt8:function(t){return U(this,1,t)[0]<<24>>24},getUint8:function(t){return U(this,1,t)[0]},getInt16:function(t){var e=U(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=U(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return N(U(this,4,t,arguments[1]))},getUint32:function(t){return N(U(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return O(U(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return O(U(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){V(this,1,t,B,e)},setUint8:function(t,e){V(this,1,t,B,e)},setInt16:function(t,e){V(this,2,t,E,e,arguments[2])},setUint16:function(t,e){V(this,2,t,E,e,arguments[2])},setInt32:function(t,e){V(this,4,t,M,e,arguments[2])},setUint32:function(t,e){V(this,4,t,M,e,arguments[2])},setFloat32:function(t,e){V(this,4,t,G,e,arguments[2])},setFloat64:function(t,e){V(this,8,t,L,e,arguments[2])}});S(v,"ArrayBuffer"),S(F,"DataView"),a(F.prototype,s.VIEW,!0),e.ArrayBuffer=v,e.DataView=F},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){t.exports=!i(7)&&!i(3)((function(){return 7!=Object.defineProperty(i(66)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){e.f=i(5)},function(t,e,i){var n=i(14),o=i(15),r=i(52)(!1),s=i(68)("IE_PROTO");t.exports=function(t,e){var i,a=o(t),l=0,h=[];for(i in a)i!=s&&n(a,i)&&h.push(i);for(;e.length>l;)n(a,i=e[l++])&&(~r(h,i)||h.push(i));return h}},function(t,e,i){var n=i(8),o=i(1),r=i(34);t.exports=i(7)?Object.defineProperties:function(t,e){o(t);for(var i,s=r(e),a=s.length,l=0;a>l;)n.f(t,i=s[l++],e[i]);return t}},function(t,e,i){var n=i(15),o=i(37).f,r={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==r.call(t)?function(t){try{return o(t)}catch(t){return s.slice()}}(t):o(n(t))}},function(t,e,i){"use strict";var n=i(7),o=i(34),r=i(53),s=i(49),a=i(9),l=i(48),h=Object.assign;t.exports=!h||i(3)((function(){var t={},e={},i=Symbol(),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach((function(t){e[t]=t})),7!=h({},t)[i]||Object.keys(h({},e)).join("")!=n}))?function(t,e){for(var i=a(t),h=arguments.length,c=1,u=r.f,f=s.f;h>c;)for(var d,m=l(arguments[c++]),y=u?o(m).concat(u(m)):o(m),p=y.length,S=0;p>S;)d=y[S++],n&&!f.call(m,d)||(i[d]=m[d]);return i}:h},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,i){"use strict";var n=i(10),o=i(4),r=i(102),s=[].slice,a={},l=function(t,e,i){if(!(e in a)){for(var n=[],o=0;o>>0||(s.test(i)?16:10))}:n},function(t,e,i){var n=i(2).parseFloat,o=i(45).trim;t.exports=1/n(i(72)+"-0")!=-1/0?function(t){var e=o(String(t),3),i=n(e);return 0===i&&"-"==e.charAt(0)?-0:i}:n},function(t,e,i){var n=i(20);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=n(t))throw TypeError(e);return+t}},function(t,e,i){var n=i(4),o=Math.floor;t.exports=function(t){return!n(t)&&isFinite(t)&&o(t)===t}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,i){var n=i(75),o=Math.pow,r=o(2,-52),s=o(2,-23),a=o(2,127)*(2-s),l=o(2,-126);t.exports=Math.fround||function(t){var e,i,o=Math.abs(t),h=n(t);return oa||i!=i?h*(1/0):h*i}},function(t,e,i){var n=i(1);t.exports=function(t,e,i,o){try{return o?e(n(i)[0],i[1]):e(i)}catch(e){var r=t.return;throw void 0!==r&&n(r.call(t)),e}}},function(t,e,i){var n=i(10),o=i(9),r=i(48),s=i(6);t.exports=function(t,e,i,a,l){n(e);var h=o(t),c=r(h),u=s(h.length),f=l?u-1:0,d=l?-1:1;if(i<2)for(;;){if(f in c){a=c[f],f+=d;break}if(f+=d,l?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?f>=0:u>f;f+=d)f in c&&(a=e(a,c[f],f,h));return a}},function(t,e,i){"use strict";var n=i(9),o=i(35),r=i(6);t.exports=[].copyWithin||function(t,e){var i=n(this),s=r(i.length),a=o(t,s),l=o(e,s),h=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===h?s:o(h,s))-l,s-a),u=1;for(l0;)l in i?i[a]=i[l]:delete i[a],a+=u,l+=u;return i}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,i){"use strict";var n=i(87);i(0)({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},function(t,e,i){i(7)&&"g"!=/./g.flags&&i(8).f(RegExp.prototype,"flags",{configurable:!0,get:i(50)})},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,i){var n=i(1),o=i(4),r=i(91);t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var i=r.f(t);return(0,i.resolve)(e),i.promise}},function(t,e,i){"use strict";var n=i(118),o=i(42);t.exports=i(61)("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=n.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return n.def(o(this,"Map"),0===t?0:t,e)}},n,!0)},function(t,e,i){"use strict";var n=i(8).f,o=i(36),r=i(41),s=i(19),a=i(39),l=i(40),h=i(77),c=i(112),u=i(38),f=i(7),d=i(30).fastKey,m=i(42),y=f?"_s":"size",p=function(t,e){var i,n=d(e);if("F"!==n)return t._i[n];for(i=t._f;i;i=i.n)if(i.k==e)return i};t.exports={getConstructor:function(t,e,i,h){var c=t((function(t,n){a(t,c,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[y]=0,null!=n&&l(n,i,t[h],t)}));return r(c.prototype,{clear:function(){for(var t=m(this,e),i=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete i[n.i];t._f=t._l=void 0,t[y]=0},delete:function(t){var i=m(this,e),n=p(i,t);if(n){var o=n.n,r=n.p;delete i._i[n.i],n.r=!0,r&&(r.n=o),o&&(o.p=r),i._f==n&&(i._f=o),i._l==n&&(i._l=r),i[y]--}return!!n},forEach:function(t){m(this,e);for(var i,n=s(t,arguments.length>1?arguments[1]:void 0,3);i=i?i.n:this._f;)for(n(i.v,i.k,this);i&&i.r;)i=i.p},has:function(t){return!!p(m(this,e),t)}}),f&&n(c.prototype,"size",{get:function(){return m(this,e)[y]}}),c},def:function(t,e,i){var n,o,r=p(t,e);return r?r.v=i:(t._l=r={i:o=d(e,!0),k:e,v:i,p:n=t._l,n:void 0,r:!1},t._f||(t._f=r),n&&(n.n=r),t[y]++,"F"!==o&&(t._i[o]=r)),t},getEntry:p,setStrong:function(t,e,i){h(t,e,(function(t,i){this._t=m(t,e),this._k=i,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?c(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,c(1))}),i?"entries":"values",!i,!0),u(e)}}},function(t,e,i){"use strict";var n=i(118),o=i(42);t.exports=i(61)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return n.def(o(this,"Set"),t=0===t?0:t,t)}},n)},function(t,e,i){"use strict";var n,o=i(2),r=i(26)(0),s=i(12),a=i(30),l=i(99),h=i(121),c=i(4),u=i(42),f=i(42),d=!o.ActiveXObject&&"ActiveXObject"in o,m=a.getWeak,y=Object.isExtensible,p=h.ufstore,S=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(c(t)){var e=m(t);return!0===e?p(u(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return h.def(u(this,"WeakMap"),t,e)}},F=t.exports=i(61)("WeakMap",S,v,h,!0,!0);f&&d&&(l((n=h.getConstructor(S,"WeakMap")).prototype,v),a.NEED=!0,r(["delete","has","get","set"],(function(t){var e=F.prototype,i=e[t];s(e,t,(function(e,o){if(c(e)&&!y(e)){this._f||(this._f=new n);var r=this._f[t](e,o);return"set"==t?this:r}return i.call(this,e,o)}))})))},function(t,e,i){"use strict";var n=i(41),o=i(30).getWeak,r=i(1),s=i(4),a=i(39),l=i(40),h=i(26),c=i(14),u=i(42),f=h(5),d=h(6),m=0,y=function(t){return t._l||(t._l=new p)},p=function(){this.a=[]},S=function(t,e){return f(t.a,(function(t){return t[0]===e}))};p.prototype={get:function(t){var e=S(this,t);if(e)return e[1]},has:function(t){return!!S(this,t)},set:function(t,e){var i=S(this,t);i?i[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,i,r){var h=t((function(t,n){a(t,h,e,"_i"),t._t=e,t._i=m++,t._l=void 0,null!=n&&l(n,i,t[r],t)}));return n(h.prototype,{delete:function(t){if(!s(t))return!1;var i=o(t);return!0===i?y(u(this,e)).delete(t):i&&c(i,this._i)&&delete i[this._i]},has:function(t){if(!s(t))return!1;var i=o(t);return!0===i?y(u(this,e)).has(t):i&&c(i,this._i)}}),h},def:function(t,e,i){var n=o(r(e),!0);return!0===n?y(t).set(e,i):n[t._i]=i,t},ufstore:y}},function(t,e,i){var n=i(21),o=i(6);t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=o(e);if(e!==i)throw RangeError("Wrong length!");return i}},function(t,e,i){var n=i(37),o=i(53),r=i(1),s=i(2).Reflect;t.exports=s&&s.ownKeys||function(t){var e=n.f(r(t)),i=o.f;return i?e.concat(i(t)):e}},function(t,e,i){"use strict";var n=i(54),o=i(4),r=i(6),s=i(19),a=i(5)("isConcatSpreadable");t.exports=function t(e,i,l,h,c,u,f,d){for(var m,y,p=c,S=0,v=!!f&&s(f,d,3);S0)p=t(e,i,m,r(m.length),p,u-1)-1;else{if(p>=9007199254740991)throw TypeError();e[p]=m}p++}S++}return p}},function(t,e,i){var n=i(6),o=i(74),r=i(24);t.exports=function(t,e,i,s){var a=String(r(t)),l=a.length,h=void 0===i?" ":String(i),c=n(e);if(c<=l||""==h)return a;var u=c-l,f=o.call(h,Math.ceil(u/h.length));return f.length>u&&(f=f.slice(0,u)),s?f+a:a+f}},function(t,e,i){var n=i(7),o=i(34),r=i(15),s=i(49).f;t.exports=function(t){return function(e){for(var i,a=r(e),l=o(a),h=l.length,c=0,u=[];h>c;)i=l[c++],n&&!s.call(a,i)||u.push(t?[i,a[i]]:a[i]);return u}}},function(t,e,i){var n=i(44),o=i(128);t.exports=function(t){return function(){if(n(this)!=t)throw TypeError(t+"#toJSON isn't generic");return o(this)}}},function(t,e,i){var n=i(40);t.exports=function(t,e){var i=[];return n(t,!1,i.push,i,e),i}},function(t,e){t.exports=Math.scale||function(t,e,i,n,o){return 0===arguments.length||t!=t||e!=e||i!=i||n!=n||o!=o?NaN:t===1/0||t===-1/0?t:(t-e)*(o-n)/(i-e)+n}},function(t,e,i){i(131),t.exports=i(333)},function(t,e,i){"use strict";(function(t){if(i(132),i(329),i(330),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;function e(t,e,i){t[e]||Object.defineProperty(t,e,{writable:!0,configurable:!0,value:i})}e(String.prototype,"padLeft","".padStart),e(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach((function(t){[][t]&&e(Array,t,Function.call.bind([][t]))}))}).call(this,i(93))},function(t,e,i){i(133),i(136),i(137),i(138),i(139),i(140),i(141),i(142),i(143),i(144),i(145),i(146),i(147),i(148),i(149),i(150),i(151),i(152),i(153),i(154),i(155),i(156),i(157),i(158),i(159),i(160),i(161),i(162),i(163),i(164),i(165),i(166),i(167),i(168),i(169),i(170),i(171),i(172),i(173),i(174),i(175),i(176),i(177),i(178),i(179),i(180),i(181),i(182),i(183),i(184),i(185),i(186),i(187),i(188),i(189),i(190),i(191),i(192),i(193),i(194),i(195),i(196),i(197),i(198),i(199),i(200),i(201),i(202),i(203),i(204),i(205),i(206),i(207),i(208),i(209),i(210),i(211),i(213),i(214),i(216),i(217),i(218),i(219),i(220),i(221),i(222),i(224),i(225),i(226),i(227),i(228),i(229),i(230),i(231),i(232),i(233),i(234),i(235),i(236),i(86),i(237),i(113),i(238),i(114),i(239),i(240),i(241),i(242),i(243),i(117),i(119),i(120),i(244),i(245),i(246),i(247),i(248),i(249),i(250),i(251),i(252),i(253),i(254),i(255),i(256),i(257),i(258),i(259),i(260),i(261),i(262),i(263),i(264),i(265),i(266),i(267),i(268),i(269),i(270),i(271),i(272),i(273),i(274),i(275),i(276),i(277),i(278),i(279),i(280),i(281),i(282),i(283),i(284),i(285),i(286),i(287),i(288),i(289),i(290),i(291),i(292),i(293),i(294),i(295),i(296),i(297),i(298),i(299),i(300),i(301),i(302),i(303),i(304),i(305),i(306),i(307),i(308),i(309),i(310),i(311),i(312),i(313),i(314),i(315),i(316),i(317),i(318),i(319),i(320),i(321),i(322),i(323),i(324),i(325),i(326),i(327),i(328),t.exports=i(18)},function(t,e,i){"use strict";var n=i(2),o=i(14),r=i(7),s=i(0),a=i(12),l=i(30).KEY,h=i(3),c=i(47),u=i(43),f=i(33),d=i(5),m=i(95),y=i(67),p=i(135),S=i(54),v=i(1),F=i(4),I=i(9),g=i(15),w=i(23),C=i(32),k=i(36),P=i(98),D=i(16),b=i(53),R=i(8),_=i(34),x=D.f,A=R.f,T=P.f,O=n.Symbol,N=n.JSON,B=N&&N.stringify,E=d("_hidden"),M=d("toPrimitive"),L={}.propertyIsEnumerable,G=c("symbol-registry"),H=c("symbols"),U=c("op-symbols"),V=Object.prototype,W="function"==typeof O&&!!b.f,z=n.QObject,j=!z||!z.prototype||!z.prototype.findChild,X=r&&h((function(){return 7!=k(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=x(V,e);n&&delete V[e],A(t,e,i),n&&t!==V&&A(V,e,n)}:A,K=function(t){var e=H[t]=k(O.prototype);return e._k=t,e},Y=W&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},J=function(t,e,i){return t===V&&J(U,e,i),v(t),e=w(e,!0),v(i),o(H,e)?(i.enumerable?(o(t,E)&&t[E][e]&&(t[E][e]=!1),i=k(i,{enumerable:C(0,!1)})):(o(t,E)||A(t,E,C(1,{})),t[E][e]=!0),X(t,e,i)):A(t,e,i)},Z=function(t,e){v(t);for(var i,n=p(e=g(e)),o=0,r=n.length;r>o;)J(t,i=n[o++],e[i]);return t},q=function(t){var e=L.call(this,t=w(t,!0));return!(this===V&&o(H,t)&&!o(U,t))&&(!(e||!o(this,t)||!o(H,t)||o(this,E)&&this[E][t])||e)},Q=function(t,e){if(t=g(t),e=w(e,!0),t!==V||!o(H,e)||o(U,e)){var i=x(t,e);return!i||!o(H,e)||o(t,E)&&t[E][e]||(i.enumerable=!0),i}},$=function(t){for(var e,i=T(g(t)),n=[],r=0;i.length>r;)o(H,e=i[r++])||e==E||e==l||n.push(e);return n},tt=function(t){for(var e,i=t===V,n=T(i?U:g(t)),r=[],s=0;n.length>s;)!o(H,e=n[s++])||i&&!o(V,e)||r.push(H[e]);return r};W||(a((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(i){this===V&&e.call(U,i),o(this,E)&&o(this[E],t)&&(this[E][t]=!1),X(this,t,C(1,i))};return r&&j&&X(V,t,{configurable:!0,set:e}),K(t)}).prototype,"toString",(function(){return this._k})),D.f=Q,R.f=J,i(37).f=P.f=$,i(49).f=q,b.f=tt,r&&!i(29)&&a(V,"propertyIsEnumerable",q,!0),m.f=function(t){return K(d(t))}),s(s.G+s.W+s.F*!W,{Symbol:O});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)d(et[it++]);for(var nt=_(d.store),ot=0;nt.length>ot;)y(nt[ot++]);s(s.S+s.F*!W,"Symbol",{for:function(t){return o(G,t+="")?G[t]:G[t]=O(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in G)if(G[e]===t)return e},useSetter:function(){j=!0},useSimple:function(){j=!1}}),s(s.S+s.F*!W,"Object",{create:function(t,e){return void 0===e?k(t):Z(k(t),e)},defineProperty:J,defineProperties:Z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:$,getOwnPropertySymbols:tt});var rt=h((function(){b.f(1)}));s(s.S+s.F*rt,"Object",{getOwnPropertySymbols:function(t){return b.f(I(t))}}),N&&s(s.S+s.F*(!W||h((function(){var t=O();return"[null]"!=B([t])||"{}"!=B({a:t})||"{}"!=B(Object(t))}))),"JSON",{stringify:function(t){for(var e,i,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);if(i=e=n[1],(F(e)||void 0!==t)&&!Y(t))return S(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!Y(e))return e}),n[1]=e,B.apply(N,n)}}),O.prototype[M]||i(11)(O.prototype,M,O.prototype.valueOf),u(O,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},function(t,e,i){t.exports=i(47)("native-function-to-string",Function.toString)},function(t,e,i){var n=i(34),o=i(53),r=i(49);t.exports=function(t){var e=n(t),i=o.f;if(i)for(var s,a=i(t),l=r.f,h=0;a.length>h;)l.call(t,s=a[h++])&&e.push(s);return e}},function(t,e,i){var n=i(0);n(n.S,"Object",{create:i(36)})},function(t,e,i){var n=i(0);n(n.S+n.F*!i(7),"Object",{defineProperty:i(8).f})},function(t,e,i){var n=i(0);n(n.S+n.F*!i(7),"Object",{defineProperties:i(97)})},function(t,e,i){var n=i(15),o=i(16).f;i(25)("getOwnPropertyDescriptor",(function(){return function(t,e){return o(n(t),e)}}))},function(t,e,i){var n=i(9),o=i(17);i(25)("getPrototypeOf",(function(){return function(t){return o(n(t))}}))},function(t,e,i){var n=i(9),o=i(34);i(25)("keys",(function(){return function(t){return o(n(t))}}))},function(t,e,i){i(25)("getOwnPropertyNames",(function(){return i(98).f}))},function(t,e,i){var n=i(4),o=i(30).onFreeze;i(25)("freeze",(function(t){return function(e){return t&&n(e)?t(o(e)):e}}))},function(t,e,i){var n=i(4),o=i(30).onFreeze;i(25)("seal",(function(t){return function(e){return t&&n(e)?t(o(e)):e}}))},function(t,e,i){var n=i(4),o=i(30).onFreeze;i(25)("preventExtensions",(function(t){return function(e){return t&&n(e)?t(o(e)):e}}))},function(t,e,i){var n=i(4);i(25)("isFrozen",(function(t){return function(e){return!n(e)||!!t&&t(e)}}))},function(t,e,i){var n=i(4);i(25)("isSealed",(function(t){return function(e){return!n(e)||!!t&&t(e)}}))},function(t,e,i){var n=i(4);i(25)("isExtensible",(function(t){return function(e){return!!n(e)&&(!t||t(e))}}))},function(t,e,i){var n=i(0);n(n.S+n.F,"Object",{assign:i(99)})},function(t,e,i){var n=i(0);n(n.S,"Object",{is:i(100)})},function(t,e,i){var n=i(0);n(n.S,"Object",{setPrototypeOf:i(71).set})},function(t,e,i){"use strict";var n=i(44),o={};o[i(5)("toStringTag")]="z",o+""!="[object z]"&&i(12)(Object.prototype,"toString",(function(){return"[object "+n(this)+"]"}),!0)},function(t,e,i){var n=i(0);n(n.P,"Function",{bind:i(101)})},function(t,e,i){var n=i(8).f,o=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in o||i(7)&&n(o,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){"use strict";var n=i(4),o=i(17),r=i(5)("hasInstance"),s=Function.prototype;r in s||i(8).f(s,r,{value:function(t){if("function"!=typeof this||!n(t))return!1;if(!n(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,i){var n=i(0),o=i(103);n(n.G+n.F*(parseInt!=o),{parseInt:o})},function(t,e,i){var n=i(0),o=i(104);n(n.G+n.F*(parseFloat!=o),{parseFloat:o})},function(t,e,i){"use strict";var n=i(2),o=i(14),r=i(20),s=i(73),a=i(23),l=i(3),h=i(37).f,c=i(16).f,u=i(8).f,f=i(45).trim,d=n.Number,m=d,y=d.prototype,p="Number"==r(i(36)(y)),S="trim"in String.prototype,v=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){var i,n,o,r=(e=S?e.trim():f(e,3)).charCodeAt(0);if(43===r||45===r){if(88===(i=e.charCodeAt(2))||120===i)return NaN}else if(48===r){switch(e.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+e}for(var s,l=e.slice(2),h=0,c=l.length;ho)return NaN;return parseInt(l,n)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof d&&(p?l((function(){y.valueOf.call(i)})):"Number"!=r(i))?s(new m(v(e)),i,d):v(e)};for(var F,I=i(7)?h(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),g=0;I.length>g;g++)o(m,F=I[g])&&!o(d,F)&&u(d,F,c(m,F));d.prototype=y,y.constructor=d,i(12)(n,"Number",d)}},function(t,e,i){"use strict";var n=i(0),o=i(21),r=i(105),s=i(74),a=1..toFixed,l=Math.floor,h=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",u=function(t,e){for(var i=-1,n=e;++i<6;)n+=t*h[i],h[i]=n%1e7,n=l(n/1e7)},f=function(t){for(var e=6,i=0;--e>=0;)i+=h[e],h[e]=l(i/t),i=i%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==h[t]){var i=String(h[t]);e=""===e?i:e+s.call("0",7-i.length)+i}return e},m=function(t,e,i){return 0===e?i:e%2==1?m(t,e-1,i*t):m(t*t,e/2,i)};n(n.P+n.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!i(3)((function(){a.call({})}))),"Number",{toFixed:function(t){var e,i,n,a,l=r(this,c),h=o(t),y="",p="0";if(h<0||h>20)throw RangeError(c);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(y="-",l=-l),l>1e-21)if(i=(e=function(t){for(var e=0,i=t;i>=4096;)e+=12,i/=4096;for(;i>=2;)e+=1,i/=2;return e}(l*m(2,69,1))-69)<0?l*m(2,-e,1):l/m(2,e,1),i*=4503599627370496,(e=52-e)>0){for(u(0,i),n=h;n>=7;)u(1e7,0),n-=7;for(u(m(10,n,1),0),n=e-1;n>=23;)f(1<<23),n-=23;f(1<0?y+((a=p.length)<=h?"0."+s.call("0",h-a)+p:p.slice(0,a-h)+"."+p.slice(a-h)):y+p}})},function(t,e,i){"use strict";var n=i(0),o=i(3),r=i(105),s=1..toPrecision;n(n.P+n.F*(o((function(){return"1"!==s.call(1,void 0)}))||!o((function(){s.call({})}))),"Number",{toPrecision:function(t){var e=r(this,"Number#toPrecision: incorrect invocation!");return void 0===t?s.call(e):s.call(e,t)}})},function(t,e,i){var n=i(0);n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,i){var n=i(0),o=i(2).isFinite;n(n.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},function(t,e,i){var n=i(0);n(n.S,"Number",{isInteger:i(106)})},function(t,e,i){var n=i(0);n(n.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,i){var n=i(0),o=i(106),r=Math.abs;n(n.S,"Number",{isSafeInteger:function(t){return o(t)&&r(t)<=9007199254740991}})},function(t,e,i){var n=i(0);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,i){var n=i(0);n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,i){var n=i(0),o=i(104);n(n.S+n.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(t,e,i){var n=i(0),o=i(103);n(n.S+n.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(t,e,i){var n=i(0),o=i(107),r=Math.sqrt,s=Math.acosh;n(n.S+n.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+r(t-1)*r(t+1))}})},function(t,e,i){var n=i(0),o=Math.asinh;n(n.S+n.F*!(o&&1/o(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},function(t,e,i){var n=i(0),o=Math.atanh;n(n.S+n.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,i){var n=i(0),o=i(75);n(n.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,i){var n=i(0),o=Math.exp;n(n.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},function(t,e,i){var n=i(0),o=i(76);n(n.S+n.F*(o!=Math.expm1),"Math",{expm1:o})},function(t,e,i){var n=i(0);n(n.S,"Math",{fround:i(108)})},function(t,e,i){var n=i(0),o=Math.abs;n(n.S,"Math",{hypot:function(t,e){for(var i,n,r=0,s=0,a=arguments.length,l=0;s0?(n=i/l)*n:i;return l===1/0?1/0:l*Math.sqrt(r)}})},function(t,e,i){var n=i(0),o=Math.imul;n(n.S+n.F*i(3)((function(){return-5!=o(4294967295,5)||2!=o.length})),"Math",{imul:function(t,e){var i=+t,n=+e,o=65535&i,r=65535&n;return 0|o*r+((65535&i>>>16)*r+o*(65535&n>>>16)<<16>>>0)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,i){var n=i(0);n(n.S,"Math",{log1p:i(107)})},function(t,e,i){var n=i(0);n(n.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,i){var n=i(0);n(n.S,"Math",{sign:i(75)})},function(t,e,i){var n=i(0),o=i(76),r=Math.exp;n(n.S+n.F*i(3)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(r(t-1)-r(-t-1))*(Math.E/2)}})},function(t,e,i){var n=i(0),o=i(76),r=Math.exp;n(n.S,"Math",{tanh:function(t){var e=o(t=+t),i=o(-t);return e==1/0?1:i==1/0?-1:(e-i)/(r(t)+r(-t))}})},function(t,e,i){var n=i(0);n(n.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,i){var n=i(0),o=i(35),r=String.fromCharCode,s=String.fromCodePoint;n(n.S+n.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,i=[],n=arguments.length,s=0;n>s;){if(e=+arguments[s++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");i.push(e<65536?r(e):r(55296+((e-=65536)>>10),e%1024+56320))}return i.join("")}})},function(t,e,i){var n=i(0),o=i(15),r=i(6);n(n.S,"String",{raw:function(t){for(var e=o(t.raw),i=r(e.length),n=arguments.length,s=[],a=0;i>a;)s.push(String(e[a++])),a=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},function(t,e,i){"use strict";var n=i(0),o=i(55)(!1);n(n.P,"String",{codePointAt:function(t){return o(this,t)}})},function(t,e,i){"use strict";var n=i(0),o=i(6),r=i(79),s="".endsWith;n(n.P+n.F*i(80)("endsWith"),"String",{endsWith:function(t){var e=r(this,t,"endsWith"),i=arguments.length>1?arguments[1]:void 0,n=o(e.length),a=void 0===i?n:Math.min(o(i),n),l=String(t);return s?s.call(e,l,a):e.slice(a-l.length,a)===l}})},function(t,e,i){"use strict";var n=i(0),o=i(79);n(n.P+n.F*i(80)("includes"),"String",{includes:function(t){return!!~o(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,i){var n=i(0);n(n.P,"String",{repeat:i(74)})},function(t,e,i){"use strict";var n=i(0),o=i(6),r=i(79),s="".startsWith;n(n.P+n.F*i(80)("startsWith"),"String",{startsWith:function(t){var e=r(this,t,"startsWith"),i=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return s?s.call(e,n,i):e.slice(i,i+n.length)===n}})},function(t,e,i){"use strict";i(13)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},function(t,e,i){"use strict";i(13)("big",(function(t){return function(){return t(this,"big","","")}}))},function(t,e,i){"use strict";i(13)("blink",(function(t){return function(){return t(this,"blink","","")}}))},function(t,e,i){"use strict";i(13)("bold",(function(t){return function(){return t(this,"b","","")}}))},function(t,e,i){"use strict";i(13)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},function(t,e,i){"use strict";i(13)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},function(t,e,i){"use strict";i(13)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},function(t,e,i){"use strict";i(13)("italics",(function(t){return function(){return t(this,"i","","")}}))},function(t,e,i){"use strict";i(13)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},function(t,e,i){"use strict";i(13)("small",(function(t){return function(){return t(this,"small","","")}}))},function(t,e,i){"use strict";i(13)("strike",(function(t){return function(){return t(this,"strike","","")}}))},function(t,e,i){"use strict";i(13)("sub",(function(t){return function(){return t(this,"sub","","")}}))},function(t,e,i){"use strict";i(13)("sup",(function(t){return function(){return t(this,"sup","","")}}))},function(t,e,i){var n=i(0);n(n.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(23);n(n.P+n.F*i(3)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=o(this),i=r(e);return"number"!=typeof i||isFinite(i)?e.toISOString():null}})},function(t,e,i){var n=i(0),o=i(212);n(n.P+n.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},function(t,e,i){"use strict";var n=i(3),o=Date.prototype.getTime,r=Date.prototype.toISOString,s=function(t){return t>9?t:"0"+t};t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!=r.call(new Date(-50000000000001))}))||!n((function(){r.call(new Date(NaN))}))?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),i=t.getUTCMilliseconds(),n=e<0?"-":e>9999?"+":"";return n+("00000"+Math.abs(e)).slice(n?-6:-4)+"-"+s(t.getUTCMonth()+1)+"-"+s(t.getUTCDate())+"T"+s(t.getUTCHours())+":"+s(t.getUTCMinutes())+":"+s(t.getUTCSeconds())+"."+(i>99?i:"0"+s(i))+"Z"}:r},function(t,e,i){var n=Date.prototype,o=n.toString,r=n.getTime;new Date(NaN)+""!="Invalid Date"&&i(12)(n,"toString",(function(){var t=r.call(this);return t==t?o.call(this):"Invalid Date"}))},function(t,e,i){var n=i(5)("toPrimitive"),o=Date.prototype;n in o||i(11)(o,n,i(215))},function(t,e,i){"use strict";var n=i(1),o=i(23);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return o(n(this),"number"!=t)}},function(t,e,i){var n=i(0);n(n.S,"Array",{isArray:i(54)})},function(t,e,i){"use strict";var n=i(19),o=i(0),r=i(9),s=i(109),a=i(81),l=i(6),h=i(82),c=i(83);o(o.S+o.F*!i(57)((function(t){Array.from(t)})),"Array",{from:function(t){var e,i,o,u,f=r(t),d="function"==typeof this?this:Array,m=arguments.length,y=m>1?arguments[1]:void 0,p=void 0!==y,S=0,v=c(f);if(p&&(y=n(y,m>2?arguments[2]:void 0,2)),null==v||d==Array&&a(v))for(i=new d(e=l(f.length));e>S;S++)h(i,S,p?y(f[S],S):f[S]);else for(u=v.call(f),i=new d;!(o=u.next()).done;S++)h(i,S,p?s(u,y,[o.value,S],!0):o.value);return i.length=S,i}})},function(t,e,i){"use strict";var n=i(0),o=i(82);n(n.S+n.F*i(3)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,i=new("function"==typeof this?this:Array)(e);e>t;)o(i,t,arguments[t++]);return i.length=e,i}})},function(t,e,i){"use strict";var n=i(0),o=i(15),r=[].join;n(n.P+n.F*(i(48)!=Object||!i(22)(r)),"Array",{join:function(t){return r.call(o(this),void 0===t?",":t)}})},function(t,e,i){"use strict";var n=i(0),o=i(70),r=i(20),s=i(35),a=i(6),l=[].slice;n(n.P+n.F*i(3)((function(){o&&l.call(o)})),"Array",{slice:function(t,e){var i=a(this.length),n=r(this);if(e=void 0===e?i:e,"Array"==n)return l.call(this,t,e);for(var o=s(t,i),h=s(e,i),c=a(h-o),u=new Array(c),f=0;f1&&(n=Math.min(n,r(arguments[1]))),n<0&&(n=i+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}})},function(t,e,i){var n=i(0);n(n.P,"Array",{copyWithin:i(111)}),i(31)("copyWithin")},function(t,e,i){var n=i(0);n(n.P,"Array",{fill:i(85)}),i(31)("fill")},function(t,e,i){"use strict";var n=i(0),o=i(26)(5),r=!0;"find"in[]&&Array(1).find((function(){r=!1})),n(n.P+n.F*r,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(31)("find")},function(t,e,i){"use strict";var n=i(0),o=i(26)(6),r="findIndex",s=!0;r in[]&&Array(1)[r]((function(){s=!1})),n(n.P+n.F*s,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(31)(r)},function(t,e,i){i(38)("Array")},function(t,e,i){var n=i(2),o=i(73),r=i(8).f,s=i(37).f,a=i(56),l=i(50),h=n.RegExp,c=h,u=h.prototype,f=/a/g,d=/a/g,m=new h(f)!==f;if(i(7)&&(!m||i(3)((function(){return d[i(5)("match")]=!1,h(f)!=f||h(d)==d||"/a/i"!=h(f,"i")})))){h=function(t,e){var i=this instanceof h,n=a(t),r=void 0===e;return!i&&n&&t.constructor===h&&r?t:o(m?new c(n&&!r?t.source:t,e):c((n=t instanceof h)?t.source:t,n&&r?l.call(t):e),i?this:u,h)};for(var y=function(t){t in h||r(h,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})},p=s(c),S=0;p.length>S;)y(p[S++]);u.constructor=h,h.prototype=u,i(12)(n,"RegExp",h)}i(38)("RegExp")},function(t,e,i){"use strict";i(114);var n=i(1),o=i(50),r=i(7),s=/./.toString,a=function(t){i(12)(RegExp.prototype,"toString",t,!0)};i(3)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?a((function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!r&&t instanceof RegExp?o.call(t):void 0)})):"toString"!=s.name&&a((function(){return s.call(this)}))},function(t,e,i){"use strict";var n=i(1),o=i(6),r=i(88),s=i(58);i(59)("match",1,(function(t,e,i,a){return[function(i){var n=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},function(t){var e=a(i,t,this);if(e.done)return e.value;var l=n(t),h=String(this);if(!l.global)return s(l,h);var c=l.unicode;l.lastIndex=0;for(var u,f=[],d=0;null!==(u=s(l,h));){var m=String(u[0]);f[d]=m,""===m&&(l.lastIndex=r(h,o(l.lastIndex),c)),d++}return 0===d?null:f}]}))},function(t,e,i){"use strict";var n=i(1),o=i(9),r=i(6),s=i(21),a=i(88),l=i(58),h=Math.max,c=Math.min,u=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;i(59)("replace",2,(function(t,e,i,m){return[function(n,o){var r=t(this),s=null==n?void 0:n[e];return void 0!==s?s.call(n,r,o):i.call(String(r),n,o)},function(t,e){var o=m(i,t,this,e);if(o.done)return o.value;var u=n(t),f=String(this),d="function"==typeof e;d||(e=String(e));var p=u.global;if(p){var S=u.unicode;u.lastIndex=0}for(var v=[];;){var F=l(u,f);if(null===F)break;if(v.push(F),!p)break;""===String(F[0])&&(u.lastIndex=a(f,r(u.lastIndex),S))}for(var I,g="",w=0,C=0;C=w&&(g+=f.slice(w,P)+x,w=P+k.length)}return g+f.slice(w)}];function y(t,e,n,r,s,a){var l=n+t.length,h=r.length,c=d;return void 0!==s&&(s=o(s),c=f),i.call(a,c,(function(i,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(l);case"<":a=s[o.slice(1,-1)];break;default:var c=+o;if(0===c)return i;if(c>h){var f=u(c/10);return 0===f?i:f<=h?void 0===r[f-1]?o.charAt(1):r[f-1]+o.charAt(1):i}a=r[c-1]}return void 0===a?"":a}))}}))},function(t,e,i){"use strict";var n=i(1),o=i(100),r=i(58);i(59)("search",1,(function(t,e,i,s){return[function(i){var n=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},function(t){var e=s(i,t,this);if(e.done)return e.value;var a=n(t),l=String(this),h=a.lastIndex;o(h,0)||(a.lastIndex=0);var c=r(a,l);return o(a.lastIndex,h)||(a.lastIndex=h),null===c?-1:c.index}]}))},function(t,e,i){"use strict";var n=i(56),o=i(1),r=i(51),s=i(88),a=i(6),l=i(58),h=i(87),c=i(3),u=Math.min,f=[].push,d="length",m=!c((function(){RegExp(4294967295,"y")}));i(59)("split",2,(function(t,e,i,c){var y;return y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[d]||2!="ab".split(/(?:ab)*/)[d]||4!=".".split(/(.?)(.?)/)[d]||".".split(/()()/)[d]>1||"".split(/.?/)[d]?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!n(t))return i.call(o,t,e);for(var r,s,a,l=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),u=0,m=void 0===e?4294967295:e>>>0,y=new RegExp(t.source,c+"g");(r=h.call(y,o))&&!((s=y.lastIndex)>u&&(l.push(o.slice(u,r.index)),r[d]>1&&r.index=m));)y.lastIndex===r.index&&y.lastIndex++;return u===o[d]?!a&&y.test("")||l.push(""):l.push(o.slice(u)),l[d]>m?l.slice(0,m):l}:"0".split(void 0,0)[d]?function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)}:i,[function(i,n){var o=t(this),r=null==i?void 0:i[e];return void 0!==r?r.call(i,o,n):y.call(String(o),i,n)},function(t,e){var n=c(y,t,this,e,y!==i);if(n.done)return n.value;var h=o(t),f=String(this),d=r(h,RegExp),p=h.unicode,S=(h.ignoreCase?"i":"")+(h.multiline?"m":"")+(h.unicode?"u":"")+(m?"y":"g"),v=new d(m?h:"^(?:"+h.source+")",S),F=void 0===e?4294967295:e>>>0;if(0===F)return[];if(0===f.length)return null===l(v,f)?[f]:[];for(var I=0,g=0,w=[];gr;)s(i[r++]);t._c=[],t._n=!1,e&&!t._h&&N(t)}))}},N=function(t){S.call(l,(function(){var e,i,n,o=t._v,r=B(t);if(r&&(e=I((function(){R?k.emit("unhandledRejection",o,t):(i=l.onunhandledrejection)?i({promise:t,reason:o}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",o)})),t._h=R||B(t)?2:1),t._a=void 0,r&&e.e)throw e.v}))},B=function(t){return 1!==t._h&&0===(t._a||t._c).length},E=function(t){S.call(l,(function(){var e;R?k.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})}))},M=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),O(e,!0))},L=function(t){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw C("Promise can't be resolved itself");(e=T(t))?v((function(){var n={_w:i,_d:!1};try{e.call(t,h(L,n,1),h(M,n,1))}catch(t){M.call(n,t)}})):(i._v=t,i._s=1,O(i,!1))}catch(t){M.call({_w:i,_d:!1},t)}}};A||(b=function(t){m(this,b,"Promise","_h"),d(t),n.call(this);try{t(h(L,this,1),h(M,this,1))}catch(t){M.call(this,t)}},(n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(41)(b.prototype,{then:function(t,e){var i=x(p(this,b));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=R?k.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&O(this,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new n;this.promise=t,this.resolve=h(L,t,1),this.reject=h(M,t,1)},F.f=x=function(t){return t===b||t===s?new r(t):o(t)}),u(u.G+u.W+u.F*!A,{Promise:b}),i(43)(b,"Promise"),i(38)("Promise"),s=i(18).Promise,u(u.S+u.F*!A,"Promise",{reject:function(t){var e=x(this);return(0,e.reject)(t),e.promise}}),u(u.S+u.F*(a||!A),"Promise",{resolve:function(t){return w(a&&this===s?b:this,t)}}),u(u.S+u.F*!(A&&i(57)((function(t){b.all(t).catch(_)}))),"Promise",{all:function(t){var e=this,i=x(e),n=i.resolve,o=i.reject,r=I((function(){var i=[],r=0,s=1;y(t,!1,(function(t){var a=r++,l=!1;i.push(void 0),s++,e.resolve(t).then((function(t){l||(l=!0,i[a]=t,--s||n(i))}),o)})),--s||n(i)}));return r.e&&o(r.v),i.promise},race:function(t){var e=this,i=x(e),n=i.reject,o=I((function(){y(t,!1,(function(t){e.resolve(t).then(i.resolve,n)}))}));return o.e&&n(o.v),i.promise}})},function(t,e,i){"use strict";var n=i(121),o=i(42);i(61)("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return n.def(o(this,"WeakSet"),t,!0)}},n,!1,!0)},function(t,e,i){"use strict";var n=i(0),o=i(62),r=i(92),s=i(1),a=i(35),l=i(6),h=i(4),c=i(2).ArrayBuffer,u=i(51),f=r.ArrayBuffer,d=r.DataView,m=o.ABV&&c.isView,y=f.prototype.slice,p=o.VIEW;n(n.G+n.W+n.F*(c!==f),{ArrayBuffer:f}),n(n.S+n.F*!o.CONSTR,"ArrayBuffer",{isView:function(t){return m&&m(t)||h(t)&&p in t}}),n(n.P+n.U+n.F*i(3)((function(){return!new f(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(t,e){if(void 0!==y&&void 0===e)return y.call(s(this),t);for(var i=s(this).byteLength,n=a(t,i),o=a(void 0===e?i:e,i),r=new(u(this,f))(l(o-n)),h=new d(this),c=new d(r),m=0;n=e.length)return{value:void 0,done:!0}}while(!((t=e[this._i++])in this._t));return{value:t,done:!1}})),n(n.S,"Reflect",{enumerate:function(t){return new r(t)}})},function(t,e,i){var n=i(16),o=i(17),r=i(14),s=i(0),a=i(4),l=i(1);s(s.S,"Reflect",{get:function t(e,i){var s,h,c=arguments.length<3?e:arguments[2];return l(e)===c?e[i]:(s=n.f(e,i))?r(s,"value")?s.value:void 0!==s.get?s.get.call(c):void 0:a(h=o(e))?t(h,i,c):void 0}})},function(t,e,i){var n=i(16),o=i(0),r=i(1);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return n.f(r(t),e)}})},function(t,e,i){var n=i(0),o=i(17),r=i(1);n(n.S,"Reflect",{getPrototypeOf:function(t){return o(r(t))}})},function(t,e,i){var n=i(0);n(n.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,i){var n=i(0),o=i(1),r=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(t){return o(t),!r||r(t)}})},function(t,e,i){var n=i(0);n(n.S,"Reflect",{ownKeys:i(123)})},function(t,e,i){var n=i(0),o=i(1),r=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(t){o(t);try{return r&&r(t),!0}catch(t){return!1}}})},function(t,e,i){var n=i(8),o=i(16),r=i(17),s=i(14),a=i(0),l=i(32),h=i(1),c=i(4);a(a.S,"Reflect",{set:function t(e,i,a){var u,f,d=arguments.length<4?e:arguments[3],m=o.f(h(e),i);if(!m){if(c(f=r(e)))return t(f,i,a,d);m=l(0)}if(s(m,"value")){if(!1===m.writable||!c(d))return!1;if(u=o.f(d,i)){if(u.get||u.set||!1===u.writable)return!1;u.value=a,n.f(d,i,u)}else n.f(d,i,l(0,a));return!0}return void 0!==m.set&&(m.set.call(d,a),!0)}})},function(t,e,i){var n=i(0),o=i(71);o&&n(n.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},function(t,e,i){"use strict";var n=i(0),o=i(52)(!0);n(n.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(31)("includes")},function(t,e,i){"use strict";var n=i(0),o=i(124),r=i(9),s=i(6),a=i(10),l=i(84);n(n.P,"Array",{flatMap:function(t){var e,i,n=r(this);return a(t),e=s(n.length),i=l(n,0),o(i,n,n,e,0,1,t,arguments[1]),i}}),i(31)("flatMap")},function(t,e,i){"use strict";var n=i(0),o=i(124),r=i(9),s=i(6),a=i(21),l=i(84);n(n.P,"Array",{flatten:function(){var t=arguments[0],e=r(this),i=s(e.length),n=l(e,0);return o(n,e,e,i,0,void 0===t?1:a(t)),n}}),i(31)("flatten")},function(t,e,i){"use strict";var n=i(0),o=i(55)(!0);n(n.P,"String",{at:function(t){return o(this,t)}})},function(t,e,i){"use strict";var n=i(0),o=i(125),r=i(60),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r);n(n.P+n.F*s,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,i){"use strict";var n=i(0),o=i(125),r=i(60),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r);n(n.P+n.F*s,"String",{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,i){"use strict";i(45)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},function(t,e,i){"use strict";i(45)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},function(t,e,i){"use strict";var n=i(0),o=i(24),r=i(6),s=i(56),a=i(50),l=RegExp.prototype,h=function(t,e){this._r=t,this._s=e};i(78)(h,"RegExp String",(function(){var t=this._r.exec(this._s);return{value:t,done:null===t}})),n(n.P,"String",{matchAll:function(t){if(o(this),!s(t))throw TypeError(t+" is not a regexp!");var e=String(this),i="flags"in l?String(t.flags):a.call(t),n=new RegExp(t.source,~i.indexOf("g")?i:"g"+i);return n.lastIndex=r(t.lastIndex),new h(n,e)}})},function(t,e,i){i(67)("asyncIterator")},function(t,e,i){i(67)("observable")},function(t,e,i){var n=i(0),o=i(123),r=i(15),s=i(16),a=i(82);n(n.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,i,n=r(t),l=s.f,h=o(n),c={},u=0;h.length>u;)void 0!==(i=l(n,e=h[u++]))&&a(c,e,i);return c}})},function(t,e,i){var n=i(0),o=i(126)(!1);n(n.S,"Object",{values:function(t){return o(t)}})},function(t,e,i){var n=i(0),o=i(126)(!0);n(n.S,"Object",{entries:function(t){return o(t)}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(10),s=i(8);i(7)&&n(n.P+i(63),"Object",{__defineGetter__:function(t,e){s.f(o(this),t,{get:r(e),enumerable:!0,configurable:!0})}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(10),s=i(8);i(7)&&n(n.P+i(63),"Object",{__defineSetter__:function(t,e){s.f(o(this),t,{set:r(e),enumerable:!0,configurable:!0})}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(23),s=i(17),a=i(16).f;i(7)&&n(n.P+i(63),"Object",{__lookupGetter__:function(t){var e,i=o(this),n=r(t,!0);do{if(e=a(i,n))return e.get}while(i=s(i))}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(23),s=i(17),a=i(16).f;i(7)&&n(n.P+i(63),"Object",{__lookupSetter__:function(t){var e,i=o(this),n=r(t,!0);do{if(e=a(i,n))return e.set}while(i=s(i))}})},function(t,e,i){var n=i(0);n(n.P+n.R,"Map",{toJSON:i(127)("Map")})},function(t,e,i){var n=i(0);n(n.P+n.R,"Set",{toJSON:i(127)("Set")})},function(t,e,i){i(64)("Map")},function(t,e,i){i(64)("Set")},function(t,e,i){i(64)("WeakMap")},function(t,e,i){i(64)("WeakSet")},function(t,e,i){i(65)("Map")},function(t,e,i){i(65)("Set")},function(t,e,i){i(65)("WeakMap")},function(t,e,i){i(65)("WeakSet")},function(t,e,i){var n=i(0);n(n.G,{global:i(2)})},function(t,e,i){var n=i(0);n(n.S,"System",{global:i(2)})},function(t,e,i){var n=i(0),o=i(20);n(n.S,"Error",{isError:function(t){return"Error"===o(t)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{clamp:function(t,e,i){return Math.min(i,Math.max(e,t))}})},function(t,e,i){var n=i(0);n(n.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,e,i){var n=i(0),o=180/Math.PI;n(n.S,"Math",{degrees:function(t){return t*o}})},function(t,e,i){var n=i(0),o=i(129),r=i(108);n(n.S,"Math",{fscale:function(t,e,i,n,s){return r(o(t,e,i,n,s))}})},function(t,e,i){var n=i(0);n(n.S,"Math",{iaddh:function(t,e,i,n){var o=t>>>0,r=i>>>0;return(e>>>0)+(n>>>0)+((o&r|(o|r)&~(o+r>>>0))>>>31)|0}})},function(t,e,i){var n=i(0);n(n.S,"Math",{isubh:function(t,e,i,n){var o=t>>>0,r=i>>>0;return(e>>>0)-(n>>>0)-((~o&r|~(o^r)&o-r>>>0)>>>31)|0}})},function(t,e,i){var n=i(0);n(n.S,"Math",{imulh:function(t,e){var i=+t,n=+e,o=65535&i,r=65535&n,s=i>>16,a=n>>16,l=(s*r>>>0)+(o*r>>>16);return s*a+(l>>16)+((o*a>>>0)+(65535&l)>>16)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,e,i){var n=i(0),o=Math.PI/180;n(n.S,"Math",{radians:function(t){return t*o}})},function(t,e,i){var n=i(0);n(n.S,"Math",{scale:i(129)})},function(t,e,i){var n=i(0);n(n.S,"Math",{umulh:function(t,e){var i=+t,n=+e,o=65535&i,r=65535&n,s=i>>>16,a=n>>>16,l=(s*r>>>0)+(o*r>>>16);return s*a+(l>>>16)+((o*a>>>0)+(65535&l)>>>16)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}})},function(t,e,i){"use strict";var n=i(0),o=i(18),r=i(2),s=i(51),a=i(116);n(n.P+n.R,"Promise",{finally:function(t){var e=s(this,o.Promise||r.Promise),i="function"==typeof t;return this.then(i?function(i){return a(e,t()).then((function(){return i}))}:t,i?function(i){return a(e,t()).then((function(){throw i}))}:t)}})},function(t,e,i){"use strict";var n=i(0),o=i(91),r=i(115);n(n.S,"Promise",{try:function(t){var e=o.f(this),i=r(t);return(i.e?e.reject:e.resolve)(i.v),e.promise}})},function(t,e,i){var n=i(28),o=i(1),r=n.key,s=n.set;n.exp({defineMetadata:function(t,e,i,n){s(t,e,o(i),r(n))}})},function(t,e,i){var n=i(28),o=i(1),r=n.key,s=n.map,a=n.store;n.exp({deleteMetadata:function(t,e){var i=arguments.length<3?void 0:r(arguments[2]),n=s(o(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var l=a.get(e);return l.delete(i),!!l.size||a.delete(e)}})},function(t,e,i){var n=i(28),o=i(1),r=i(17),s=n.has,a=n.get,l=n.key,h=function(t,e,i){if(s(t,e,i))return a(t,e,i);var n=r(e);return null!==n?h(t,n,i):void 0};n.exp({getMetadata:function(t,e){return h(t,o(e),arguments.length<3?void 0:l(arguments[2]))}})},function(t,e,i){var n=i(119),o=i(128),r=i(28),s=i(1),a=i(17),l=r.keys,h=r.key,c=function(t,e){var i=l(t,e),r=a(t);if(null===r)return i;var s=c(r,e);return s.length?i.length?o(new n(i.concat(s))):s:i};r.exp({getMetadataKeys:function(t){return c(s(t),arguments.length<2?void 0:h(arguments[1]))}})},function(t,e,i){var n=i(28),o=i(1),r=n.get,s=n.key;n.exp({getOwnMetadata:function(t,e){return r(t,o(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,i){var n=i(28),o=i(1),r=n.keys,s=n.key;n.exp({getOwnMetadataKeys:function(t){return r(o(t),arguments.length<2?void 0:s(arguments[1]))}})},function(t,e,i){var n=i(28),o=i(1),r=i(17),s=n.has,a=n.key,l=function(t,e,i){if(s(t,e,i))return!0;var n=r(e);return null!==n&&l(t,n,i)};n.exp({hasMetadata:function(t,e){return l(t,o(e),arguments.length<3?void 0:a(arguments[2]))}})},function(t,e,i){var n=i(28),o=i(1),r=n.has,s=n.key;n.exp({hasOwnMetadata:function(t,e){return r(t,o(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,i){var n=i(28),o=i(1),r=i(10),s=n.key,a=n.set;n.exp({metadata:function(t,e){return function(i,n){a(t,e,(void 0!==n?o:r)(i),s(n))}}})},function(t,e,i){var n=i(0),o=i(90)(),r=i(2).process,s="process"==i(20)(r);n(n.G,{asap:function(t){var e=s&&r.domain;o(e?e.bind(t):t)}})},function(t,e,i){"use strict";var n=i(0),o=i(2),r=i(18),s=i(90)(),a=i(5)("observable"),l=i(10),h=i(1),c=i(39),u=i(41),f=i(11),d=i(40),m=d.RETURN,y=function(t){return null==t?void 0:l(t)},p=function(t){var e=t._c;e&&(t._c=void 0,e())},S=function(t){return void 0===t._o},v=function(t){S(t)||(t._o=void 0,p(t))},F=function(t,e){h(t),this._c=void 0,this._o=t,t=new I(this);try{var i=e(t),n=i;null!=i&&("function"==typeof i.unsubscribe?i=function(){n.unsubscribe()}:l(i),this._c=i)}catch(e){return void t.error(e)}S(this)&&p(this)};F.prototype=u({},{unsubscribe:function(){v(this)}});var I=function(t){this._s=t};I.prototype=u({},{next:function(t){var e=this._s;if(!S(e)){var i=e._o;try{var n=y(i.next);if(n)return n.call(i,t)}catch(t){try{v(e)}finally{throw t}}}},error:function(t){var e=this._s;if(S(e))throw t;var i=e._o;e._o=void 0;try{var n=y(i.error);if(!n)throw t;t=n.call(i,t)}catch(t){try{p(e)}finally{throw t}}return p(e),t},complete:function(t){var e=this._s;if(!S(e)){var i=e._o;e._o=void 0;try{var n=y(i.complete);t=n?n.call(i,t):void 0}catch(t){try{p(e)}finally{throw t}}return p(e),t}}});var g=function(t){c(this,g,"Observable","_f")._f=l(t)};u(g.prototype,{subscribe:function(t){return new F(t,this._f)},forEach:function(t){var e=this;return new(r.Promise||o.Promise)((function(i,n){l(t);var o=e.subscribe({next:function(e){try{return t(e)}catch(t){n(t),o.unsubscribe()}},error:n,complete:i})}))}}),u(g,{from:function(t){var e="function"==typeof this?this:g,i=y(h(t)[a]);if(i){var n=h(i.call(t));return n.constructor===e?n:new e((function(t){return n.subscribe(t)}))}return new e((function(e){var i=!1;return s((function(){if(!i){try{if(d(t,!1,(function(t){if(e.next(t),i)return m}))===m)return}catch(t){if(i)throw t;return void e.error(t)}e.complete()}})),function(){i=!0}}))},of:function(){for(var t=0,e=arguments.length,i=new Array(e);t2,o=!!n&&s.call(arguments,2);return t(n?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,i)}};o(o.G+o.B+o.F*a,{setTimeout:l(n.setTimeout),setInterval:l(n.setInterval)})},function(t,e,i){var n=i(0),o=i(89);n(n.G+n.B,{setImmediate:o.set,clearImmediate:o.clear})},function(t,e,i){for(var n=i(86),o=i(34),r=i(12),s=i(2),a=i(11),l=i(46),h=i(5),c=h("iterator"),u=h("toStringTag"),f=l.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=o(d),y=0;y=0;--o){var r=this.tryEntries[o],s=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var a=n.call(r,"catchLoc"),l=n.call(r,"finallyLoc");if(a&&l){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),k(i),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;k(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:D(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),c}}}function y(t,e,i,n){var o=e&&e.prototype instanceof S?e:S,r=Object.create(o.prototype),s=new P(n||[]);return r._invoke=function(t,e,i){var n="suspendedStart";return function(o,r){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw r;return b()}for(i.method=o,i.arg=r;;){var s=i.delegate;if(s){var a=w(s,i);if(a){if(a===c)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=p(t,e,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(t,i,s),r}function p(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}function S(){}function v(){}function F(){}function I(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function g(t){function i(e,o,r,s){var a=p(t[e],t,o);if("throw"!==a.type){var l=a.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?Promise.resolve(h.__await).then((function(t){i("next",t,r,s)}),(function(t){i("throw",t,r,s)})):Promise.resolve(h).then((function(t){l.value=t,r(l)}),s)}s(a.arg)}var o;"object"==typeof e.process&&e.process.domain&&(i=e.process.domain.bind(i)),this._invoke=function(t,e){function n(){return new Promise((function(n,o){i(t,e,n,o)}))}return o=o?o.then(n,n):n()}}function w(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=p(i,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function D(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++it.length)&&(e=t.length);for(var i=0,n=new Array(e);i1){var e=t[0],i=t[1].toString(),n=i.indexOf(".");if(n>=0){var o=i.substr(0,n);""==o&&(o="0");var r=i.substr(n+1,e);return""==r.replace("0","")?o:o+"."+r}return i}}},{key:"stringFormat",value:function(){var t=arguments;if(t.length>0){if(t.length>1){var e=-1;return t[0].replace(/\{(\d+)\}/g,(function(i,n){return e=parseInt(n),t.length>e+1?t[e+1]:""}))}return t[0]}}},{key:"stringInsert",value:function(t,e,i){return t.slice(0,e)+i+t.slice(e)}},{key:"stringDelete",value:function(t,e,i){return t.substring(0,e)+t.substring(e+i,t.length)}},{key:"stringRemove",value:function(e,i,n){return t.stringDelete(e,i,n)}},{key:"setIntersection",value:function(t,e){return new Set(d(t).filter((function(t){return e.has(t)})))}},{key:"setDifference",value:function(t,e){return new Set(d(t).filter((function(t){return!e.has(t)})))}},{key:"setCompare",value:function(t,e){if(t.size!=e.size)return!1;var i,n=function(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=m(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}(t);try{for(n.s();!(i=n.n()).done;){var o=i.value;if(!e.has(o))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"setUnion",value:function(t,e){return new Set([].concat(d(t),d(e)))}},{key:"setRemove",value:function(t,e){t.delete(e)}},{key:"setCount",value:function(t){return t.size}}]),t}(),k=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(null),n}return i}(l(Array)),P=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(0),n}return i}(l(Array)),D=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(0),n}return i}(l(Array)),b=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(0),n}return S(i,[{key:"toText",value:function(){for(var t="",e=0,i=this.length;e=0&&e<=127?i+=1:e>=128&&e<=2047?i+=2:e>=2048&&e<=65535?i+=3:e>65536&&e<=2097151?i+=4:e>2097152&&e<=67108863?i+=5:e>67108864&&e<=2147483647&&(i+=6);return i}}],[{key:"getBytes",value:function(t){for(var e,i=new b(0),n=0,o=t.length;n=0&&e<=127?i.push(e):e>=128&&e<=2047?(i.push(192|e>>6&31),i.push(128|63&e)):e>=2048&&e<=65535&&(i.push(224|e>>12&15),i.push(128|e>>6&63),i.push(128|63&e));return i}},{key:"getString",value:function(t){var e=t instanceof Uint8Array?t:new Uint8Array(t),i=new Uint16Array(e.buffer);return String.fromCharCode.apply(null,i)}}]),i}(R),A=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,null,[{key:"getBytes",value:function(t){for(var e,i=new b(0),n=0,o=t.length;n>8)):(i.push(255&e),i.push((65280&e)>>8),i.push((16711680&e)>>16),i.push((4278190080&e)>>24));return i}},{key:"getByteCount",value:function(t){for(var e=0,i=0,n=t.length;i=0&&e<=127?i.push(e):e>=128&&e<=2047?(i.push(192|31&e>>6),i.push(128|63&e)):e>=2048&&e<=65535?(i.push(224|15&e>>12),i.push(128|63&e>>6),i.push(128|63&e)):e>=65536&&e<=1114111?(i.push(240|7&e>>18),i.push(128|63&e>>12),i.push(128|63&e>>6),i.push(128|63&e)):e>2097152&&e<=67108863?(i.push(248|3&e>>24),i.push(128|63&e>>18),i.push(128|63&e>>12),i.push(128|63&e>>6),i.push(128|63&e)):e>67108864&&e<=2147483647&&(i.push(252|1&e>>30),i.push(128|63&e>>24),i.push(128|63&e>>18),i.push(128|63&e>>12),i.push(128|63&e>>6),i.push(128|63&e));return i}}]),i}(R),T=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<-32768||e>32767)throw C.stringFormat("值 {0} 不在 -32768..32767内!",e);this._val=new Int16Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt16",value:function(){return this._val[0]<0?this._val[0]+65536:this._val[0]}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return-32768}},{key:"max",get:function(){return 32767}}]),t}(),O=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<0||e>65536)throw C.stringFormat("值 {0} 不在 0..65535内!",e);this._val=new Uint16Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt16",value:function(){return this._val[0]<32768?this._val[0]:this._val[0]-65536}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return 0}},{key:"max",get:function(){return 65535}}]),t}(),N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<-2147483648||e>2147483647)throw C.stringFormat("值 {0} 不在 -2147483648..2147483647内!",e);this._val=new Int32Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt16",value:function(){var t=new Int16Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt16",value:function(){var t=new Uint16Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt32",value:function(){return this._val[0]<0?this._val[0]+4294967296:this._val[0]}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return-2147483648}},{key:"max",get:function(){return 2147483647}}]),t}(),B=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<0||e>4294967295)throw C.stringFormat("值 {0} 不在 0..4294967295内!",e);this._val=new Uint32Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt16",value:function(){var t=new Int16Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt16",value:function(){var t=new Uint16Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt32",value:function(){return this._val[0]<2147483648?this._val[0]:this._val[0]-4294967296}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return 0}},{key:"max",get:function(){return 4294967295}}]),t}(),E=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),eNumber.MAX_SAFE_INTEGER)throw C.stringFormat("值 {0} 不在 {1}..{2}内!",e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);if(e>B.max){var i=e.toString(2);this.hi32=parseInt(i.substr(0,i.length-32),2),this.lo32=parseInt(i.substr(i.length-32),2)}else this.hi32=0,this.lo32=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT+this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return((this._val[1]<<32)+this.val[0]).toString()}},{key:"buffer",get:function(){var t=new Array(8),e=new Uint8Array(1);return e[0]=this.lo32,t[0]=e[0],e[0]=this.lo32>>8,t[1]=e[0],e[0]=this.lo32>>16,t[2]=e[0],e[0]=this.lo32>>24,t[3]=e[0],e[0]=this.hi32,t[4]=e[0],e[0]=this.hi32>>8,t[5]=e[0],e[0]=this.hi32>>16,t[6]=e[0],e[0]=this.hi32>>24,t[7]=e[0],t}}]),t}(),M=function(){function t(){v(this,t),this.value=0}return S(t,[{key:"has",value:function(t){return(this.value&t)==t}},{key:"add",value:function(t){this.value=this.value|t}},{key:"remove",value:function(t){this.value=this.value&~t}},{key:"clear",value:function(){this.value=0}}]),t}(),L=function(){function t(){v(this,t),this.createBefor(),this._className=this.constructor.name}return S(t,[{key:"createBefor",value:function(){}},{key:"dispose",value:function(){}},{key:"isClass",value:function(t){return this instanceof t}},{key:"isSubClass",value:function(e){return e===t||Object.getPrototypeOf(this).isClass(e)}},{key:"newInstance",value:function(){return new this.constructor}},{key:"className",get:function(){return this._className}}]),t}(),G=function(){function t(){v(this,t),this.x=0,this.y=0}return S(t,[{key:"reset",value:function(t,e){this.x=t,this.y=e}},{key:"resetByPoint",value:function(t){this.reset(t.x,t.y)}},{key:"equal",value:function(t){return this.x==t.x&&this.y==t.y}},{key:"offset",value:function(e,i,n){if(n)return t.Create(this.x+e,this.y+i);this.x+=e,this.y+=i}}],[{key:"Create",value:function(e,i){var n=new t;return n.x=e,n.y=i,n}},{key:"CreateByPoint",value:function(e){return t.Create(e.x,e.y)}},{key:"inPoly",value:function(e,i){return t.inPolyAt(e.x,e.y,i)}},{key:"inPolyAt",value:function(t,e,i){for(var n,o,r,s,a=!1,l=0,h=i.length-1;le!=(s=i[h].y)>e&&t<(o-n)*(e-r)/(s-r)+n&&(a=!a);return a}}]),t}(),H=function(){function t(){v(this,t),this.width=0,this.height=0}return S(t,[{key:"reset",value:function(t,e){this.width=t,this.height=e}}]),t}(),U=function(){function t(){v(this,t),this.left=0,this.top=0,this.right=0,this.bottom=0}return S(t,[{key:"reset",value:function(t,e,i,n){this.left=t,this.top=e,this.right=i,this.bottom=n}},{key:"resetRect",value:function(t){this.reset(t.left,t.top,t.right,t.bottom)}},{key:"resetBounds",value:function(t,e,i,n){this.reset(t,e,t+i,e+n)}},{key:"resetSize",value:function(t){this.right=this.left+t.width,this.bottom=this.top+t.height}},{key:"offset",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return t.Create(this.left+e,this.top+i,this.right+e,this.bottom+i);this.left=this.left+e,this.top=this.top+i,this.right=this.right+e,this.bottom=this.bottom+i}},{key:"intersection",value:function(e){var i=new t;return e.right<=this.left||e.top>=this.bottom||e.left>=this.right||e.bottom<=this.top||(e.left>this.left?i.left=e.left:i.left=this.left,e.top>this.top?i.top=e.top:i.top=this.top,e.right>this.right?i.right=this.right:i.right=e.right,e.bottom>this.bottom?i.bottom=this.bottom:i.bottom=e.bottom),i}},{key:"union",value:function(e){var i=new t;return e.leftthis.right?i.right=e.right:i.right=this.right,e.bottom>this.bottom?i.bottom=e.bottom:i.bottom=this.bottom,i}},{key:"inFlate",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return t.Create(this.left-e,this.top-i,this.right+e,this.bottom+i);this.left-=e,this.right+=e,this.top-=i,this.bottom+=i}},{key:"pointInAt",value:function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom}},{key:"pointIn",value:function(t){return this.pointInAt(t.x,t.y)}},{key:"isIntersect",value:function(t){var e=this.left>t.left?this.left:t.left,i=this.top>t.top?this.top:t.top,n=this.right0&&void 0!==arguments[0])||arguments[0];return v(this,i),(t=e.call(this))._onAdded=null,t._onRemoved=null,t.ownsObjects=null==n||n,t}return S(i,[{key:"doAdded_",value:function(t){null!=this._onAdded&&this._onAdded(t)}},{key:"doRemoved_",value:function(t){(null!=this._onRemoved&&this._onRemoved(t),this.ownsObjects)&&(Object.getPrototypeOf(t)instanceof L&&t.dispose())}},{key:"doClear_",value:function(){}},{key:"add",value:function(t){this[this.length]=t,this.doAdded_(t)}},{key:"indexOf",value:function(t){for(var e=0;e=0){var e=this[t];return this.splice(t,1),this.doRemoved_(e),e=null,!0}return!1}},{key:"remove",value:function(t){return this.removeAt(this.indexOf(t))}},{key:"removeRange",value:function(t,e){if(t>=0){for(var i=null,n=t;n=0&&t<=this.length&&(this.splice(t,0,e),this.doAdded_(e),!0)}},{key:"clear",value:function(){for(var t=null,e=this.length-1;e>=0;e--)t=this[e],this.splice(e,1),this.doRemoved_(t),t=null;this.doClear_()}},{key:"contains",value:function(t){return this.indexOf(t)>=0}},{key:"first",get:function(){return this[0]}},{key:"last",get:function(){return this[this.length-1]}},{key:"count",get:function(){return this.length}},{key:"onAdded",get:function(){return this._onAdded},set:function(t){this._onAdded=t}},{key:"onRemoved",get:function(){return this._onRemoved},set:function(t){this._onRemoved=t}}]),i}(l(Array)),W=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,[{key:"peek",value:function(){return this[this.length-1]}},{key:"clear",value:function(){this.splice(0,this.length)}},{key:"count",get:function(){return this.length}}]),i}(l(Array)),z=function(t){r(i,t);var e=s(i);function i(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return v(this,i),e.call(this,t)}return S(i,[{key:"add",value:function(t,e){var n={};n.key=t,n.val=e,o(f(i.prototype),"add",this).call(this,n)}},{key:"remove",value:function(t){var e=this.indexOfKey(t);e>=0&&o(f(i.prototype),"removeAt",this).call(this,e)}},{key:"indexOfKey",value:function(t){for(var e=0;e=0}}]),i}(V),j=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,[{key:"append",value:function(t){this.add(t)}},{key:"text",get:function(){var t="";if(this.length>0){t=this[0];for(var e=1,i=this.length;e1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=new t;return l.year=e,l.day=1,l.month=i,l.day=n,l.hour=o,l.minute=r,l.second=s,l.millisecond=a,l}},{key:"CreateByDateTime",value:function(e){var i=new t;return i.year=e.year,i.day=1,i.month=e.month,i.day=e.day,i.hour=e.hour,i.minute=e.minute,i.second=e.second,i.millisecond=e.millisecond,i}},{key:"CreateByString",value:function(e){var i=new t;return i.fromString(e)?i:null}},{key:"Now",value:function(){return new t}},{key:"DaysInMonth",value:function(t,e){switch(e){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;case 4:case 6:case 9:case 11:return 30;case 2:return t%4==0&&t%100!=0||t%400==0?29:28;default:return 0}}}]),t}(),K=function(){function t(){v(this,t),this._size=0,this._position=0,this._bytes=new b(0),this.onLoadStart=null,this.onLoadProgress=null,this.onLoadFinish=null}return S(t,[{key:"clear",value:function(){this._bytes.length=0,this._size=0,this._position=0}},{key:"copyFrom",value:function(t,e){0==e&&(t.position=0,e=t.size);var i=t.readBuffer(e);this.writeBuffer(i)}},{key:"loadFromFile",value:function(t){var e=this,i=new FileReader;i.onloadstart=function(){e._size=0,e._position=0,e._buffer=null,null!=e.onLoadStart&&e.onLoadStart()},i.onload=function(t){e._bytes=Array.prototype.slice.call(new Uint8Array(t.target.result)),e._size=t.total,e._position=0,null!=e.onLoadFinish&&e.onLoadFinish()},i.onloadend=function(){},i.onabort=function(){},i.onprogress=function(t){null!=e.onLoadProgress&&e.onLoadProgress(t.loaded,t.total)},i.onerror=function(){},i.readAsArrayBuffer(t)}},{key:"readBuffer",value:function(t){var e=this._bytes.slice(this._position,this._position+t);return this._position+=t,e}},{key:"writeBuffer",value:function(t){for(var e=0,i=t.length;e0&&(t+=this._bytes[e-1]),'{"hcstream":['+t+"]}"}},{key:"fromJSONString",value:function(t){var e=JSON.parse(t);e.hcstream&&(this._bytes=Array.prototype.slice.call(new Uint8Array(e.hcstream)),this._size=e.hcstream.length,this._position=0)}},{key:"size",get:function(){return this._size}},{key:"buffer",get:function(){return this._bytes}},{key:"position",get:function(){return this._position},set:function(t){t<0?this._position=0:t>this._size?this._position=this._size:this._position=t}}],[{key:"loadFromFile",value:function(e,i){var n=new t;n.onLoadFinish=function(){i(n)},n.loadFromFile(e)}}]),t}();function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function J(t,e,i){return(J=it()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return i&&$(o,i.prototype),o}).apply(null,arguments)}function Z(t){return function(t){if(Array.isArray(t))return q(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return q(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return q(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:1;return"rgba("+t.toString()+", "+e.toString()+", "+i.toString()+", "+n.toString()+")"}},{key:"getColorPad",value:function(e){var i=e+e;Rt.clearRect(0,0,i,i);var n=255,o=0,r=0,s=t.rgbaToColor(n,o,r);_t.brush.color=s;var a,l,h,c,u=i+1,f=e+1,d=U.Create(i,e,u,f);_t.fillRect(d);for(var m=0;m<=i;m++){l=(a=(i-m)*Math.PI+1)/6,h=1530/a;for(var y=0;y<=a;y++)c=360/a*y,u=Math.cos(c*Math.PI/180)*(i-m+1)/2+e,f=Math.sin(c*Math.PI/180)*(i-m+1)/2+e,c>0&&c<=60&&(n=255,o=0,r=h*y),c>60&&c<=120&&(n=a/3/120*(c-60)>1?255-h*(y-l):255-h*Math.abs(y-l),o=0,r=255),c>120&&c<=180&&(n=0,o=a/3/120*(c-120)>1?h*(y-2*l):h*Math.abs(y-2*l),r=255),c>180&&c<=240&&(n=0,o=255,r=a/3/120*(c-120)>1?255-h*(y-a/2):255-h*Math.abs(y-a/2)),c>240&&c<=300&&(n=a/3/120*(c-240)>1?h*(y-4*l):h*Math.abs(y-4*l),o=255,r=0),c>300&&c<=360&&(n=255,o=a/3/120*(c-300)>1?255-h*(y-5*l):255-h*Math.abs(y-5*l),r=0),s=t.rgbaToColor(Math.round(n+(255-n)/i*m),Math.round(o+(255-o)/i*m),Math.round(r+(255-r)/i*m)),_t.brush.color=s,c>=0&&c<=45&&(d.reset(u,f,u-2,f-1),_t.fillRect(d)),c>45&&c<=135&&(d.reset(u,f,u-1,f-2),_t.fillRect(d)),c>135&&c<=225&&(d.reset(u,f,u+2,f+1),_t.fillRect(d)),c>215&&c<=315&&(d.reset(u,f,u+1,f+2),_t.fillRect(d)),c>315&&c<=360&&(d.reset(u,f,u-2,f-1),_t.fillRect(d))}return Rt.getImageData(0,0,i,i)}},{key:"sameColor",value:function(t,e){var i=this.colorToRGBA(t),n=this.colorToRGBA(e);return i.r==n.r&&i.g==n.g&&i.b==n.b&&i.a==n.a}}]),t}();at.Transparent="",at.Red="rgb(255, 0, 0)",at.Green="rgb(0, 255, 0)",at.Blue="rgb(0, 0, 255)",at.Black="rgb(0, 0, 0)",at.White="rgb(255, 255, 255)",at.Yellow="rgb(255, 255, 0)",at.Gray="gray",at.Pink="rgb(255, 192, 203)",at.Crimson="rgb(220, 20, 60)",at.Violet="rgb(238, 130, 238)",at.Magenta="rgb(255, 0, 255)",at.Purple="rgb(128, 0, 128)",at.MediumBlue="rgb(0, 0, 205)",at.DarkBlue="rgb(0, 0, 139)",at.Navy="rgb(0, 0, 128)",at.Cyan="rgb(0, 255, 255)",at.Teal="rgb(0, 128, 128)",at.Lime="rgb(0, 255, 0)",at.DarkGreen="rgb(0, 100, 0)",at.Gold="rgb(255, 215, 0)",at.Orange="rgb(255, 165, 0)",at.DarkOrange="rgb(255, 140, 0)",at.OrangeRed="rgb(255, 69, 0)",at.Brown="rgb(165, 42, 42)",at.DarkRed="rgb(139, 0, 0)",at.DarkGray="rgb(169, 169, 169)",at.LightGray="rgb(211, 211, 211)",at.Silver="rgb(192, 192, 192)";var lt=function(){function t(){ot(this,t),this.FUpdateCount=0}return st(t,[{key:"beginUpdate",value:function(){this.FUpdateCount++}},{key:"endUpdate",value:function(){this.FUpdateCount--,0===this.FUpdateCount&&this.doChange_()}},{key:"onChange",value:function(){}},{key:"doChange_",value:function(){this.onChange()}}]),t}(),ht={Bold:1,Italic:2,Underline:4,StrikeOut:8,SuperScript:16,SubScript:32,Emphasize:64},ct=function(){function t(){for(var e in ot(this,t),this._baseFonts=["monospace","sans-serif","serif"],this._body=document.body,this._span=document.createElement("span"),this._span.style.fontSize="72px",this._span.innerHTML="mmmmmmmmmmlli",this.defaultWidth=[],this.defaultHeight=[],this._baseFonts)this._span.style.fontFamily=this._baseFonts[e],this._body.appendChild(this._span),this.defaultWidth[this._baseFonts[e]]=this._span.offsetWidth,this.defaultHeight[this._baseFonts[e]]=this._span.offsetHeight,this._body.removeChild(this._span)}return st(t,[{key:"detect",value:function(t){var e,i=!1;for(var n in this._baseFonts)this._span.style.fontFamily=t+","+this._baseFonts[n],this._body.appendChild(this._span),e=this._span.offsetWidth!=this.defaultWidth[this._baseFonts[n]]||this._span.offsetHeight!=this.defaultHeight[this._baseFonts[n]],this._body.removeChild(this._span),i=i||e;return i}}],[{key:"getFontIndex",value:function(t){switch(t){case"宋体":return"1";case"幼圆":return"2";case"楷体":return"3";case"隶书":return"4";case"黑体":return"5";case"Arial":return"6";case"Tahoma":return"7";case"Courier New":return"8";case"Microsoft Himalaya":return"9";default:return"0"}}}]),t}(),ut=function(){function t(){ot(this,t),this._value=0,this.onChange=null}return st(t,[{key:"doChange_",value:function(){null!=this.onChange&&this.onChange()}},{key:"has",value:function(t){return(this._value&t)==t}},{key:"add",value:function(t){this._value=this._value|t,this.doChange_()}},{key:"remove",value:function(t){this._value=this._value&~t,this.doChange_()}},{key:"clear",value:function(){this._value=0,this.doChange_()}},{key:"bold",get:function(){return this.has(ht.Bold)}},{key:"italic",get:function(){return this.has(ht.Italic)}},{key:"value",get:function(){return this._value},set:function(t){this._value!=t&&(this._value=t,this.doChange_())}}]),t}(),ft=function t(){ot(this,t),this.name="宋体",this.size=10,this.measured=!1,this.height=13,this.ascent=11,this.advCharWidth=7,this.color=at.Black,this.stylesv=0},dt=function t(){ot(this,t),this.width=1,this.color=at.Black,this.style=pt.Solid,this.capType=yt.Square,this.userStyleDash=new Array(0)},mt=function(t){Q(i,t);var e=tt(i);function i(){var t;return ot(this,i),(t=e.call(this))._name="宋体",t._size=10,t._measured=!1,t._height=13,t._ascent=11,t._otmMacAscent=0,t._otmMacDescent=0,t._externalLeading=2,t._color=at.Black,t._advCharWidth=7,t._CJK=!0,t._trueType=!0,t._styles=new ut,t._styles.onChange=function(){t.doChange_()},t.onColorChange=null,t}return st(i,[{key:"_getMeasure",value:function(){var t=i.fontSizeToPt(this._size);switch(this._measured=!1,this._height=0,this._name){case"宋体":case"幼圆":case"楷体":case"隶书":case"黑体":switch(this._trueType=!0,this._CJK=!0,this._advCharWidth=6,t){case 5:case 5.5:this._height=7,this._ascent=6;break;case 6.5:this._height=9,this._ascent=8;break;case 7.5:this._height=10,this._ascent=9;break;case 8:this._height=11,this._ascent=9;break;case 9:this._height=12,this._ascent=10;break;case 10:this._height=13,this._ascent=11;break;case 10.5:this._height=14,this._ascent=12;break;case 11:this._height=15,this._ascent=13;break;case 12:this._height=16,this._ascent=14;break;case 14:this._height=19,this._ascent=16;break;case 15:this._height=20,this._ascent=17;break;case 16:this._height=21,this._ascent=18;break;case 18:this._height=24,this._ascent=21;break;case 20:this._height=27,this._ascent=23;break;case 22:this._height=29,this._ascent=25;break;case 24:this._height=33,this._ascent=28;break;case 26:this._height=35,this._ascent=30;break;case 28:this._height=37,this._ascent=32;break;case 36:this._height=48,this._ascent=41;break;case 42:this._height=56,this._ascent=48;break;case 48:this._height=64,this._ascent=55;break;case 72:this._height=97,this._ascent=83}break;case"Arial":switch(this._trueType=!0,this._CJK=!1,this._advCharWidth=5,t){case 5:case 5.5:this._height=7,this._ascent=6;break;case 6.5:this._styles.bold?(this._height=11,this._ascent=9):(this._height=12,this._ascent=9);break;case 7.5:this._styles.bold&&this._styles.italic?(this._height=11,this._ascent=9):this._styles.bold?(this._height=12,this._ascent=10):(this._height=13,this._ascent=10);break;case 8:this._styles.bold&&this._styles.italic?(this._height=13,this._ascent=11):(this._height=14,this._ascent=11);break;case 9:this._height=15,this._ascent=12;break;case 10:case 10.5:this._height=16,this._ascent=13;break;case 11:this._styles.bold&&!this._styles.italic?(this._height=18,this._ascent=14):(this._height=17,this._ascent=14);break;case 12:this._styles.bold&&!this._styles.italic?(this._height=19,this._ascent=15):!this._styles.bold&&this._styles.italic?(this._height=19,this._ascent=16):(this._height=18,this._ascent=15);break;case 14:this._styles.italic?(this._height=23,this._ascent=18):(this._height=22,this._ascent=18);break;case 15:0==this._styles.value?(this._height=23,this._ascent=19):(this._height=24,this._ascent=19);break;case 16:this._height=24,this._ascent=19;break;case 18:this._styles.italic?(this._height=28,this._ascent=22):this._styles.bold?(this._height=29,this._ascent=23):(this._height=27,this._ascent=21);break;case 20:this._styles.bold&&!this._styles.italic?(this._height=32,this._ascent=25):!this._styles.bold&&this._styles.italic?(this._height=31,this._ascent=25):(this._height=32,this._ascent=26);break;case 22:this._styles.bold||this._styles.italic?(this._height=34,this._ascent=27):(this._height=33,this._ascent=27);break;case 24:this._styles.bold&&!this._styles.italic?(this._height=37,this._ascent=30):!this._styles.bold&&this._styles.italic?(this._height=37,this._ascent=29):(this._height=36,this._ascent=29);break;case 26:this._styles.bold&&!this._styles.italic?(this._height=41,this._ascent=32):(this._height=40,this._ascent=32);break;case 28:this._styles.bold&&!this._styles.italic?(this._height=44,this._ascent=35):!this._styles.bold&&this._styles.italic?(this._height=43,this._ascent=34):(this._height=42,this._ascent=34);break;case 36:this._styles.bold&&!this._styles.italic?(this._height=56,this._ascent=45):!this._styles.bold&&this._styles.italic?(this._height=55,this._ascent=44):(this._height=55,this._ascent=45);break;case 42:!this._styles.bold&&this._styles.italic?(this._height=64,this._ascent=51):(this._height=65,this._ascent=52);break;case 48:this._styles.italic?(this._height=74,this._ascent=59):this._styles.bold?(this._height=75,this._ascent=60):(this._height=72,this._ascent=58);break;case 72:this._styles.bold&&!this._styles.italic?(this._height=111,this._ascent=89):!this._styles.bold&&this._styles.italic?(this._height=109,this._ascent=87):this._styles.bold&&this._styles.italic?(this._height=110,this._ascent=88):(this._height=107,this._ascent=86)}break;case"Tahoma":switch(this._trueType=!0,this._CJK=!1,this._advCharWidth=5,t){case 5:case 5.5:this._height=8,this._ascent=7;break;case 6.5:this._height=11,this._ascent=9;break;case 7.5:this._height=12,this._ascent=10;break;case 8:this._height=13,this._ascent=11;break;case 9:this._height=14,this._ascent=12;break;case 10:this._height=16,this._ascent=13;break;case 10.5:this._height=17,this._ascent=14;break;case 11:this._height=18,this._ascent=15;break;case 12:this._height=19,this._ascent=16;break;case 14:this._height=23,this._ascent=19;break;case 15:this._height=24,this._ascent=20;break;case 16:this._height=25,this._ascent=21;break;case 18:this._height=29,this._ascent=24;break;case 20:this._height=33,this._ascent=27;break;case 22:this._height=35,this._ascent=29;break;case 24:this._height=39,this._ascent=32;break;case 26:this._height=42,this._ascent=35;break;case 28:this._height=45,this._ascent=37;break;case 36:this._height=58,this._ascent=48;break;case 42:this._height=68,this._ascent=56;break;case 48:this._height=77,this._ascent=64;break;case 72:this._height=116,this._ascent=96}break;case"Courier New":switch(this._trueType=!0,this._CJK=!1,this._advCharWidth=5,t){case 5:case 5.5:this._height=8,this._ascent=6;break;case 6.5:this._height=12,this._ascent=9;break;case 7.5:this._styles.bold?(this._height=13,this._ascent=10):(this._height=12,this._ascent=9);break;case 8:!this._styles.bold&&this._styles.italic?(this._height=15,this._ascent=11):(this._height=14,this._ascent=11);break;case 9:this._styles.bold||this._styles.italic?(this._height=16,this._ascent=12):(this._height=15,this._ascent=12);break;case 10:!this._styles.bold&&this._styles.italic?(this._height=17,this._ascent=13):(this._height=16,this._ascent=12);break;case 10.5:this._styles.bold&&!this._styles.italic?(this._height=16,this._ascent=12):(this._height=17,this._ascent=13);break;case 11:this._styles.italic?(this._height=18,this._ascent=13):this._styles.bold?(this._height=17,this._ascent=12):(this._height=17,this._ascent=13);break;case 12:this._styles.italic?(this._height=19,this._ascent=14):this._styles.bold?(this._height=18,this._ascent=13):(this._height=18,this._ascent=14);break;case 14:this._styles.bold?(this._height=22,this._ascent=16):(this._height=21,this._ascent=16);break;case 15:this._styles.bold||this._styles.italic?(this._height=23,this._ascent=17):(this._height=22,this._ascent=17);break;case 16:!this._styles.bold&&this._styles.italic?(this._height=24,this._ascent=18):(this._height=23,this._ascent=17);break;case 18:this._styles.bold&&this._styles.italic?(this._height=28,this._ascent=21):(this._height=27,this._ascent=20);break;case 20:this._styles.bold?(this._height=31,this._ascent=23):(this._height=30,this._ascent=23);break;case 22:this._styles.bold?(this._height=33,this._ascent=24):this._styles.italic?(this._height=33,this._ascent=25):(this._height=32,this._ascent=24);break;case 24:this._styles.bold&&this._styles.italic?(this._height=37,this._ascent=27):this._styles.bold?(this._height=36,this._ascent=26):this._styles.italic?(this._height=35,this._ascent=27):(this._height=36,this._ascent=27);break;case 26:this._styles.bold?(this._height=40,this._ascent=29):this._styles.italic?(this._height=38,this._ascent=29):(this._height=39,this._ascent=29);break;case 28:this._styles.bold?(this._height=41,this._ascent=30):this._styles.italic?(this._height=40,this._ascent=30):(this._height=39,this._ascent=29);break;case 36:this._styles.bold&&this._styles.italic?(this._height=55,this._ascent=41):this._styles.bold?(this._height=54,this._ascent=40):this._styles.italic?(this._height=54,this._ascent=41):(this._height=50,this._ascent=37);break;case 42:this._styles.bold&&this._styles.italic?(this._height=64,this._ascent=47):this._styles.bold?(this._height=63,this._ascent=46):this._styles.italic?(this._height=62,this._ascent=47):(this._height=60,this._ascent=45);break;case 48:this._styles.bold&&this._styles.italic?(this._height=73,this._ascent=55):this._styles.bold?(this._height=73,this._ascent=54):this._styles.italic?(this._height=73,this._ascent=55):(this._height=69,this._ascent=51);break;case 72:this._styles.bold&&this._styles.italic?(this._height=111,this._ascent=82):this._styles.bold?(this._height=110,this._ascent=81):this._styles.italic?(this._height=107,this._ascent=81):(this._height=103,this._ascent=77)}break;default:var e=or.textMetricsIndexOf(this._name,t,this._styles.value);if(e>=0){var n=or.textMetrics[e];this._trueType=n.trueType,this._CJK=n.CJK,this._advCharWidth=n.advCharWidth,this._height=n.height,this._ascent=n.ascent}}this._measured=this._height>0}},{key:"_reSetSize",value:function(){if(!(this.FUpdateCount>0||(this._getMeasure(),this._measured))){var t=document.createElement("span");t.style.font=this.contextFont_(),t.innerText="M";var e=document.createElement("div");e.style.display="inline-block",e.style.width="1px",e.style.height="0px";var i=document.createElement("div");i.style.position="absolute",i.style.left="-100px",i.append(e,t),document.body.append(i);try{e.style.verticalAlign="baseline",this._ascent=this._styles.has(ht.SuperScript)||this._styles.has(ht.SubScript)?Math.trunc((e.offsetTop-t.offsetTop)/2):e.offsetTop-t.offsetTop,e.style.verticalAlign="bottom";var n=t.getBoundingClientRect();this._height=this._styles.has(ht.SuperScript)||this._styles.has(ht.SubScript)?Math.trunc(n.height/2):n.height,this._advCharWidth=this._styles.has(ht.SuperScript)||this._styles.has(ht.SubScript)?Math.trunc(n.width/2):n.width}finally{document.body.removeChild(i)}}}},{key:"endUpdate",value:function(){this.FUpdateCount--,0===this.FUpdateCount&&(this._reSetSize(),this.doChange_())}},{key:"assign",value:function(t){this._name=t.name,this._size=t.size,this._color=t.color,this._styles.value=t.styles.value,this._measured=t._measured,this._height=t.height,this._ascent=t.ascent,this._externalLeading=t.externalLeading,this._advCharWidth=t.advCharWidth,this._CJK=t.CJK,this._trueType=t.trueType,this.doChange_()}},{key:"saveInfo",value:function(t){t.name=this._name,t.size=this._size,t.measured=this._measured,t.height=this._height,t.ascent=this._ascent,t.advCharWidth=this._advCharWidth,t.color=this._color,t.stylesv=this._styles.value}},{key:"restoreInfo",value:function(t){this._name=t.name,this._size=t.size,this._measured=t.measured,this._height=t.height,this._ascent=t.ascent,this._advCharWidth=t.advCharWidth,this._color=t.color,this._styles.value=t.stylesv,this.doChange_()}},{key:"toContext",value:function(t){t.font=this.contextFont_(),null!=this._color?t.fillStyle=this._color:t.fillStyle=at.Black}},{key:"contextFont_",value:function(){return(this._styles.has(ht.Italic)?"italic ":"")+(this._styles.has(ht.Bold)?"bold ":"")+this._size+'pt "'+this._name+'"'}},{key:"name",get:function(){return this._name},set:function(t){this._name!=t&&(this._name=t,this._CJK=/^[\u3220-\uFA29]+$/.test(t),this._reSetSize(),this.doChange_())}},{key:"size",get:function(){return this._size},set:function(t){var e=t;this._size!=e&&(this._size=e,this._reSetSize(),this.doChange_())}},{key:"color",get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this.doChange_(),null!=this.onColorChange&&this.onColorChange())}},{key:"styles",get:function(){return this._styles},set:function(t){this._styles=t,this._reSetSize(),this.doChange_()}},{key:"height",get:function(){return this._height}},{key:"advCharWidth",get:function(){return this._advCharWidth}},{key:"CJK",get:function(){return this._CJK}},{key:"trueType",get:function(){return this._trueType}},{key:"ascent",get:function(){return this._ascent}},{key:"descent",get:function(){return this._height-this._ascent}},{key:"externalLeading",get:function(){return this._externalLeading}},{key:"measureName",get:function(){return i.getMeasureName(this.name,this.size,this.styles.value.toString())}}],[{key:"fontSizeToPt",value:function(t){return"初号"==t?42:"小初"==t?36:"一号"==t?26:"小一"==t?24:"二号"==t?22:"小二"==t?18:"三号"==t?16:"小三"==t?15:"四号"==t?14:"小四"==t?12:"五号"==t?10.5:"小五"==t?9:"六号"==t?7.5:"小六"==t?6.5:"七号"==t?5.5:"八号"==t?5:or.system.isNumber(t)?t:void or.exception("无法识别的字号:"+t)}},{key:"fontPtToSize",value:function(t){return 42==t?"初号":36==t?"小初":26==t?"一号":24==t?"小一":22==t?"二号":18==t?"小二":16==t?"三号":15==t?"小三":14==t?"四号":12==t?"小四":10.5==t?"五号":9==t?"小五":7.5==t?"六号":6.5==t?"小六":5.5==t?"七号":5==t?"八号":t.toString()}},{key:"fontPixToPt",value:function(t){return 56==t?42:48==t?36:45==t?34:42==t?32:40==t?30:38==t?29:37==t?28:36==t?27:35==t?26:34==t?25:32==t?24:29==t?22:26==t?20:24==t?18:23==t?17:22==t?16:21==t?15:20==t?14.5:19==t?14:18==t?13.5:17==t?13:16==t?12:15==t?11:14==t?10.5:13==t?10:12==t?9:11==t?8:10==t?7.5:9==t?7:8==t?6.5:7==t?5.5:6==t?5:Math.round(t/or.system.dpi*72).toString()}},{key:"hasFont",value:function(t){if("string"!=typeof t)return!1;if(t.toLowerCase()=="Arial".toLowerCase())return!0;var e=function(t){Rt.clearRect(0,0,32,32),Rt.font="20px "+t+", Arial",Rt.fillText("a",16,16);var e=Rt.getImageData(0,0,32,32).data;return[].slice.call(e).filter((function(t){return 0!=t}))};return e("Arial").join("")!==e(t).join("")}},{key:"getMeasureName",value:function(t,e,n){return n&=~(ht.Underline|ht.StrikeOut|ht.SubScript|ht.SuperScript),ct.getFontIndex(t)+"_"+i.fontSizeToPt(e).toString().replace(".","")+"_"+n.toString()}}]),i}(lt),yt={Square:0,Butt:1,Round:2},pt={Solid:0,Dash:1,Dot:2,DashDot:3,DashDotDot:4,Clear:5,InsideFrame:6,UserStyle:7,Alternate:8},St=function(t){Q(i,t);var e=tt(i);function i(){var t;return ot(this,i),(t=e.call(this))._width=1,t._color=at.Black,t._style=pt.Solid,t._capType=yt.Square,t._userStyleDash=new Array(0),t}return st(i,[{key:"assign",value:function(t){this._width=t._width,this._color=t._color,this._style=t._style,this._capType=t._capType,this._userStyleDash=J(Array,Z(t._userStyleDash))}},{key:"saveInfo",value:function(t){t.width=this._width,t.color=this._color,t.style=this._style,t.capType=this._capType,t.userStyleDash=this._userStyleDash}},{key:"restoreInfo",value:function(t){this._width=t.width,this._color=t.color,this._style=t.style,this._capType=t.capType,this._userStyleDash=t.userStyleDash,this.doChange_()}},{key:"fromContext",value:function(t){switch(this._width=t.lineWidth,t.lineCap){case"butt":this._capType=yt.Butt;break;case"round":this._capType=yt.Round;break;default:this._capType=yt.Square}t.getLineDash().length>0?this._style=pt.Dash:this._style=pt.Solid,this._color=t.strokeStyle,this.doChange_()}},{key:"toContext",value:function(t){switch(t.lineWidth=this._width,this._capType){case yt.Butt:t.lineCap="butt";break;case yt.Round:t.lineCap="round";break;default:t.lineCap="square"}switch(this._style){case pt.Dash:t.setLineDash([5*this._width,5*this._width]),t.lineDashOffset=0;break;case pt.Dot:t.setLineDash([2*this._width,4*this._width]),t.lineDashOffset=0;break;default:t.setLineDash([])}t.strokeStyle=this._color}},{key:"width",get:function(){return this._width},set:function(t){this._width!=t&&(this._width=t,this.doChange_())}},{key:"color",get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this._style!=pt.Clear&&this.doChange_())}},{key:"style",get:function(){return this._style},set:function(t){this._style!=t&&(this._style=t,this.doChange_())}}],[{key:"Create",value:function(t){var e=new i;return e.fromContext(t),e}}]),i}(lt),vt=0,Ft=1,It=2,gt=function(t){Q(i,t);var e=tt(i);function i(){var t;return ot(this,i),(t=e.call(this))._color="White",t._style=vt,t.onColorChange=null,t}return st(i,[{key:"fromContext",value:function(t){this.color=t.fillStyle}},{key:"toContext",value:function(t){t.fillStyle=this._color}},{key:"color",get:function(){return this._color},set:function(t){this._color!=t?(this._color=t,this._style=vt,this.doChange_(),null!=this.onColorChange&&this.onColorChange()):this._style!=vt&&(this._style=vt,this.doChange_())}},{key:"style",get:function(){return this._style},set:function(t){this._style!=t&&(this._style=t,this.doChange_())}}],[{key:"Create",value:function(t){var e=new i;return e.fromContext(t),e}}]),i}(lt),wt=1,Ct=2,kt=3,Pt=function(t){Q(i,t);var e=tt(i);function i(t,n){var o;return ot(this,i),(o=e.call(this)).x=t,o.y=n,o}return st(i,[{key:"scale",value:function(t){this.x+=t,this.y*=t}},{key:"add",value:function(t){this.x+=t.x,this.y=t.y}},{key:"sub",value:function(t){this.x-=t.x,this.y-=t.y}},{key:"negate",value:function(){this.x=-this.x,this.y=-this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"legnthSquared",value:function(){return this.x*this.x+this.y*this.y}},{key:"normalize",value:function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);return t&&(this.x/=t,this.y/=t),t}},{key:"rotate",value:function(t){var e=this.x,i=this.y,n=Math.cos(t),o=Math.sin(t);this.x=e*n-i*o,this.y=e*o+i*n}}]),i}(L),Dt=function(){function t(e){var i=this;ot(this,t),this.h5context=e,this._scale=1,this._states=new Set([]),this._pfrist=!1,this._px1=-1,this._py1=-1,this._px2=-1,this._py2=-1,this._pywidth=0,this.pen=new St,this.pen.onChange=function(){i._penChanged()},this._penStack=new W,this._fontStack=new W,this.gradientBrush=null,this.brush=new gt,this.brush.onChange=function(){i._brushChanged()},this.brush.onColorChange=function(){i._fontChanged()},this.font=new mt,this.font.onChange=function(){i._fontChanged()},this.font.onColorChange=function(){i._brushChanged()},this.scaleSize=G.Create(1,1),this.prepareConext(1)}return st(t,[{key:"_penChanged",value:function(){this._states.delete(Ct)}},{key:"_brushChanged",value:function(){this._states.delete(kt)}},{key:"_fontChanged",value:function(){this._states.delete(wt)}},{key:"_requiredState",value:function(t){var e=C.setDifference(t,this._states);e.size>0?(e.has(Ct)&&this.pen.toContext(this.h5context),e.has(kt)&&(this.brush.toContext(this.h5context),this.brush.style==It&&(this.h5context.fillStyle=this.gradientBrush)),e.has(wt)&&this.font.toContext(this.h5context),this._states=C.setUnion(this._states,e)):(t.has(kt)&&(this.brush.toContext(this.h5context),this.brush.style==It&&(this.h5context.fillStyle=this.gradientBrush),this._states=C.setUnion(this._states,[kt])),t.has(wt)&&(this.font.toContext(this.h5context),this._states=C.setUnion(this._states,[wt])))}},{key:"_pointConnect",value:function(t,e,i,n){if(this.pen.style>pt.Solid&&this.pen.styleo?(r+=this.font.height+this.font.ascent,s>0&&(o=i[s-1]+e.width)):s++;e.height=r+this.font.height+this.font.ascent}}},{key:"textOutRect",value:function(t,e){if(""!=t&&0!=e.width){for(var i=this.getTextExtentExPoint(t),n=i.length,o=e.width,r=e.top,s=0,a=0;so?(this.textOut(e.left,r,t.substr(a,s-a)),r+=this.font.height+this.font.ascent,a=s,s>0&&(o=i[s-1]+e.width)):s++;this.textOut(e.left,r,t.substr(a,s-a+1))}}},{key:"findUnPlace",value:function(t,e,i){for(var n=t;n=0;)n++;return n}},{key:"textOut",value:function(t,e,i,n){this._requiredState(new Set([wt]));var o=!1;this.font.styles.has(ht.SuperScript)?(this.h5context.scale(.5,.5),t+=t,e+=e,o=!0):this.font.styles.has(ht.SubScript)&&(this.h5context.scale(.5,.5),t+=t,e+=e+this.font.height,o=!0);var r=0;if(null!=n){var s=n.length,a=0,l=this.findUnPlace(0,i,s);if(this.h5context.fillText(i.substring(a,l+1),t,e),a=l+1,o)for(;a1&&void 0!==arguments[1]?arguments[1]:0;this._requiredState(new Set([wt]));var i=new Array,n=t.length;e>0&&e1&&void 0!==arguments[1]?arguments[1]:0;this._requiredState(new Set([wt]));var i=new Array,n=t.length;e>0&&e=0)d.push(u),u++,y=!0;else{if(y=!1,r=c[t.charCodeAt(f)],i[u]=o+r,d.length>0){for(var p=r/((m=d.length)+1),S=o,v=0;v0){for(var F=r/((m=d.length)+1),I=o,g=0;g=0)P.push(k),k++;else{if(r=this.h5context.measureText(C).width,i[k]=o+r,P.length>0){for(var b=r/((D=P.length)+1),R=o,_=0;_0){for(var x=r/((D=P.length)+1),A=o,T=0;T5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;this.h5context.shadowBlur=o,this.h5context.shadowColor=this.brush.color,this.h5context.shadowOffsetX=r,this.h5context.shadowOffsetY=s,this.fillBounds(t,e,i,n),this.h5context.shadowBlur=0,this.h5context.shadowOffsetX=0,this.h5context.shadowOffsetY=0}},{key:"fillRectShadow",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.fillBoundShadow(t.left,t.top,t.width,t.height,e,i,n)}},{key:"fillEllipseRect",value:function(t){this.fillEllipseBounds(t.left,t.top,t.width,t.height)}},{key:"fillEllipseBounds",value:function(t,e,i,n){this._requiredState(new Set([Ct,kt]));var o=Math.trunc(i/2),r=Math.trunc(n/2);this.beginPath(),this.h5context.ellipse(t+o,e+r,o,r,0,0,2*Math.PI),this.closePath(),this.h5context.fill()}},{key:"scale",value:function(t,e){this.scaleSize.reset(t,e),this.h5context.scale(t,e)}},{key:"alpha",get:function(){return this.h5context.globalAlpha},set:function(t){this.h5context.globalAlpha=t}}],[{key:"textWidth",value:function(e,i){return null!=e?_t.font.assign(e):_t.font.assign(t.DefaultFont),Math.round(_t.textWidth(i))}},{key:"getTextExtent",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _t.font.assign(t),_t.getTextExtent(e,i)}},{key:"getTextExtentExPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _t.font.assign(t),_t.getTextExtentExPoint(e,i)}},{key:"getCanvasTemp",value:function(){return _t}},{key:"pointInPath",value:function(e,i){return t.pointInPathAt(i.x,i.y)}},{key:"pointInPathAt",value:function(t,e,i){Rt.beginPath(),Rt.moveTo(t[0].x,t[0].y);for(var n=1;nt.length)&&(e=t.length);for(var i=0,n=new Array(e);i1&&void 0!==arguments[1]?arguments[1]:0;switch(t){case Qe:this.designState=e}}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){this.killFocus()}},{key:"reAlign",value:function(){this.update()}},{key:"offset",value:function(t,e){this.left_=this.left_+t,this.top_=this.top_+e,this._setBounds()}},{key:"setLocal",value:function(t,e){this.left_=t,this.top_=e,this._setBounds()}},{key:"clientToScreenAt",value:function(t,e){return this.clientToScreen(G.Create(t,e))}},{key:"clientToScreen",value:function(t){return t.x+=this.left_,t.y+=this.top_,null!=this.parent?this.parent.clientToScreen(t):t}},{key:"isChildControl",value:function(t){for(var e=this;null!=e.parent;)if((e=e.parent)===t)return!0;return!1}},{key:"getHintRect",value:function(){return this.clientRect()}},{key:"paint",value:function(t){if(!(this.updateCount_>0))if(1!=this.alpha_){t.save();try{t.alpha=this.alpha_,this._paintexec(t)}finally{t.restore()}}else this._paintexec(t)}},{key:"paintTo",value:function(t,e,i){t.save();try{t.translate(e,i),this.paint(t)}finally{t.restore()}}},{key:"updateRect",value:function(t){this.updateCount_>0||this.state_.has(vi.Aligning)||(this.visible_||this.state_.has(vi.VisibleChange))&&(null!=this.parent?this.parent.updateRect(t.offset(this.left,this.top,!0)):this.onUpdate(t))}},{key:"update",value:function(){this.updateRect(this.clientRect())}},{key:"setFocus",value:function(){this._focused||(this.canFocus?(this.doSetFocus_(!0),this._focused&&this.update()):this.doSetFocus_(!1))}},{key:"tabSetFocus",value:function(){this.setFocus()}},{key:"killFocus",value:function(){this._focused&&(this.doKillFocus_(),this.mouseStates.clear(),this.update())}},{key:"beginUpdate",value:function(){this.updateCount_++}},{key:"endUpdate",value:function(){this.updateCount_>0&&(this.updateCount_--,0==this.updateCount_&&this.update())}},{key:"onResize",value:function(){}},{key:"onContextmenu",value:function(){}},{key:"onMouseEnter",value:function(){}},{key:"onMouseLeave",value:function(){}},{key:"onPaintBackground",value:function(t){}},{key:"onUpdate",value:function(t){}},{key:"onPaint",value:function(t){}},{key:"onMouseWheel",value:function(t){}},{key:"onMouseDown",value:function(t){}},{key:"onMouseMove",value:function(t){}},{key:"onClick",value:function(t){}},{key:"onDblClick",value:function(t){}},{key:"onMouseUp",value:function(t){}},{key:"onKeyDown",value:function(t){}},{key:"onKeyPress",value:function(t){}},{key:"onKeyUp",value:function(t){}},{key:"onCopy",value:function(t){}},{key:"onCut",value:function(t){}},{key:"onPaste",value:function(t){}},{key:"left",get:function(){return this.left_},set:function(t){this.left_!=t&&(this.left_=t,this._setBounds())}},{key:"top",get:function(){return this.top_},set:function(t){this.top_!=t&&(this.top_=t,this._setBounds())}},{key:"right",get:function(){return this.left_+this.width_},set:function(t){t>this.left_&&(this.width=t-this.left_)}},{key:"bottom",get:function(){return this.top_+this.height_},set:function(t){t>this.top_&&(this.height=t-this.top_)}},{key:"width",get:function(){return this.width_},set:function(t){this.width_!=t&&(this.width_=t,this._setBounds())}},{key:"height",get:function(){return this.height_},set:function(t){this.height_!=t&&(this.height_=t,this._setBounds())}},{key:"alpha",get:function(){return this.alpha_},set:function(t){this.alpha_!=t&&(this.alpha_=t,this.update())}},{key:"color",get:function(){return this.color_},set:function(t){this.color_!=t&&(this.color_=t,this.update())}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate!=t&&(this._rotate=t,this._setBounds())}},{key:"hint",get:function(){return this.getHint_()},set:function(t){this.setHint_(t)}},{key:"tab",get:function(){return this.tab_},set:function(t){this.tab_!=t&&this.parent.setTab(this,t)}},{key:"mouseIn",get:function(){return this.mouseStates.has(Zt)}},{key:"align",get:function(){return this.align_},set:function(t){this.align_!=t&&(this.align_=t,null!=this.parent&&this.parent.reAlign())}},{key:"marginLeft",get:function(){return this._marginLeft},set:function(t){this.doSetMarginLeft_(t)}},{key:"marginTop",get:function(){return this._marginTop},set:function(t){this.doSetMarginTop_(t)}},{key:"marginRight",get:function(){return this._marginRight},set:function(t){this.doSetMarginRight_(t)}},{key:"marginBottom",get:function(){return this._marginBottom},set:function(t){this.doSetMarginBottom_(t)}},{key:"paddingLeft",get:function(){return this._paddingLeft},set:function(t){this.doSetPaddingLeft_(t)}},{key:"paddingTop",get:function(){return this._paddingTop},set:function(t){this.doSetPaddingTop_(t)}},{key:"paddingRight",get:function(){return this._paddingRight},set:function(t){this.doSetPaddingRight_(t)}},{key:"paddingBottom",get:function(){return this._paddingBottom},set:function(t){this.doSetPaddingBottom_(t)}},{key:"enabled",get:function(){return this.enabled_},set:function(t){this.enabled_!=t&&(this.enabled_=t,this.doEnableChange_(t))}},{key:"visible",get:function(){return this.visible_},set:function(t){this.visible_!=t&&(this.visible_=t,this.doVisibleChange_(t))}},{key:"focused",get:function(){return this._focused}},{key:"parent",get:function(){return this._parent},set:function(t){this.doSetParent_(t)}},{key:"cursor",get:function(){return this.cursor_},set:function(t){this.cursor_!=t&&(this.cursor_=t,or.application.setCursorBy(this))}},{key:"popupMenu",get:function(){return this.doGetPopupMenu()},set:function(t){this.doSetPopupMenu(t)}}]),i}($e),oi=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).width_=100,t.height_=100,t.dropDownStyle=!1,t.popupLinkedList=null,t.forward=null,t.next=null,t.onClose=null,t.onDone=null,t}return Et(i,[{key:"doPaintBackground_",value:function(t){var e=this.clientRect();or.theme.drawShadow(t,e,this.dropDownStyle),t.brush.color=or.theme.backgroundStaticColor,t.fillRect(e),xt(Ut(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"getControlAtPos",value:function(t,e){return this}},{key:"updateRect",value:function(t){or.application.updateRect(t.offset(this.left,this.top,!0))}},{key:"update",value:function(){this.updateRect(this.clientRect())}},{key:"popup",value:function(t,e,i){this.left=t,this.top=e,this.visible=!0,or.application.trackPopupControl(this,i)}},{key:"popupControl",value:function(t){var e=t.clientToScreenAt(0,0);this.popup(e.x,e.y+t.height,!0)}},{key:"closePopup",value:function(){null!=this.onClose&&this.onClose()}},{key:"donePopup",value:function(){or.application.closePopupControl(this.popupLinkedList.first),null!=this.onDone&&this.onDone()}},{key:"close",value:function(){or.application.closePopupControl(this)}}]),i}(ni),ri=0,si=1,ai=2,li=3,hi=0,ci=1,ui=2,fi=3,di=4,mi=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).width_=100,t.height_=20,t.min_=0,t.max_=0,t.pageSize_=0,t.position_=0,t.range_=0,t.precent_=0,t.leftBlank_=0,t.rightBlank_=0,t.buttonSize=20,t.btnStep_=5,t.thumRect_=new U,t.leftBtnRect_=new U,t.rightBtnRect_=new U,t.mouseDownPt_=new G,t.mouseDownControl_=ri,t.orientation_=Yt,t.align_=Xt,t._onScroll=null,t}return Et(i,[{key:"_reCalcButtonRect",value:function(){this.orientation_==Yt?(this.leftBtnRect_=U.CreateByBounds(this.leftBlank_,0,this.buttonSize,this.height),this.rightBtnRect_=U.CreateByBounds(this.width-this.rightBlank_-this.buttonSize,0,this.buttonSize,this.height)):(this.leftBtnRect_=U.CreateByBounds(0,this.leftBlank_,this.width,this.buttonSize),this.rightBtnRect_=U.CreateByBounds(0,this.height-this.rightBlank_-this.buttonSize,this.width,this.buttonSize))}},{key:"_reCalcThumRect",value:function(){var t=0,e=0;if(this.orientation_==Yt)if(this.thumRect_.top=0,this.thumRect_.bottom=this.height,this.pageSize_this.max_?this.min_=this.max_:this.min_=t,this.position_this.max_&&(this.position_=Math.max(this.max_-this.pageSize_,this.min_)),this.range_=this.max_-this.min_,this._reCalcThumRect(),this._updateRangRect())}},{key:"_setPageSize",value:function(t){this.pageSize_!=t&&(this.pageSize_=t,this._reCalcThumRect(),this._updateRangRect())}},{key:"_setPosition",value:function(t){var e=0;e=tthis.max_?Math.max(this.max_-this.pageSize_,this.min_):t,this.position_!=e&&(this.position_=e,this._reCalcThumRect(),this._updateRangRect(),null!=this._onScroll&&this._onScroll(di,this.position_))}},{key:"scrollStep_",value:function(t){var e=0;switch(t){case hi:(e=this.position_-this.btnStep_)this.range_-this.pageSize_&&(e=this.range_-this.pageSize_),this.position_!=e&&(this.position=e);break;case ui:(e=this.position_-this.pageSize_)this.range_-this.pageSize_&&(e=this.range_-this.pageSize_),this.position_!=e&&(this.position=e)}}},{key:"doMouseDown_",value:function(t){xt(Ut(i.prototype),"doMouseDown_",this).call(this,t),this.mouseDownPt_.x=t.x,this.mouseDownPt_.y=t.y,this.leftBtnRect_.pointIn(this.mouseDownPt_)?(this.mouseDownControl_=si,this.scrollStep_(hi)):this.thumRect_.pointIn(this.mouseDownPt_)?this.mouseDownControl_=ai:this.rightBtnRect_.pointIn(this.mouseDownPt_)?(this.mouseDownControl_=li,this.scrollStep_(ci)):this._ptInLeftBlankArea(t.x,t.y)||this._ptInRightBlankArea(t.x,t.y)||(this.mouseDownControl_=ri,this.thumRect_.top>t.y||this.thumRect_.left>t.x?this.scrollStep_(ui):(this.thumRect_.bottomthis.max_&&(this.position_=Math.max(this.max_-this.pageSize_,this.min_)),this._reCalcThumRect(),this._reCalcButtonRect()}},{key:"doPaint_",value:function(t){this.paintToEx(t)}},{key:"doDrawThumBefor_",value:function(t,e){}},{key:"paintToEx",value:function(t){t.brush.color=or.theme.backgroundStaticColor,t.fillBounds(0,0,this.width,this.height);var e=U.CreateByRect(this.thumRect_);t.pen.width=1,this.orientation_==Yt?(e.inFlate(0,-1),this.doDrawThumBefor_(t,e),t.brush.color=or.theme.backgroundHotColor,t.fillRect(e),t.pen.color=or.theme.borderColor,t.beginPath(),t.drawLine(e.left,e.top,e.right,e.top),t.drawLine(e.right,e.top,e.right,e.bottom),t.drawLine(e.right,e.bottom-1,e.left,e.bottom-1),t.drawLine(e.left,e.bottom,e.left,e.top),e.left=e.left+Math.trunc(e.width/2),t.drawLine(e.left,5,e.left,this.height-5),t.drawLine(e.left+3,5,e.left+3,this.height-5),t.drawLine(e.left-3,5,e.left-3,this.height-5),t.paintPath(),t.pen.color=or.theme.backgroundHotColor,t.beginPath(),e.left=this.leftBtnRect_.left+Math.trunc((this.leftBtnRect_.width-4)/2)+4,e.top=this.leftBtnRect_.top+Math.trunc((this.leftBtnRect_.height-7)/2),t.drawLine(e.left,e.top,e.left,e.top+7),t.drawLine(e.left-1,e.top+1,e.left-1,e.top+6),t.drawLine(e.left-2,e.top+2,e.left-2,e.top+5),t.drawLine(e.left-3,e.top+3,e.left-3,e.top+4),e.left=this.rightBtnRect_.left+Math.trunc((this.rightBtnRect_.width-4)/2),e.top=this.rightBtnRect_.top+Math.trunc((this.rightBtnRect_.height-7)/2),t.drawLine(e.left,e.top,e.left,e.top+7),t.drawLine(e.left+1,e.top+1,e.left+1,e.top+6),t.drawLine(e.left+2,e.top+2,e.left+2,e.top+5),t.drawLine(e.left+3,e.top+3,e.left+3,e.top+4),t.paintPath()):(e.inFlate(-1,0),this.doDrawThumBefor_(t,e),t.brush.color=or.theme.backgroundHotColor,t.fillRect(e),t.pen.color=or.theme.borderColor,t.beginPath(),t.drawLine(e.left,e.top,e.right,e.top),t.drawLine(e.right-1,e.top,e.right-1,e.bottom),t.drawLine(e.right,e.bottom,e.left,e.bottom),t.drawLine(e.left,e.bottom,e.left,e.top),e.top=e.top+Math.trunc(e.height/2),t.drawLine(5,e.top,this.width-5,e.top),t.drawLine(5,e.top-3,this.width-5,e.top-3),t.drawLine(5,e.top+3,this.width-5,e.top+3),t.paintPath(),t.pen.color=or.theme.backgroundHotColor,t.beginPath(),e.left=this.leftBtnRect_.left+Math.trunc((this.leftBtnRect_.width-7)/2),e.top=this.leftBtnRect_.top+Math.trunc((this.leftBtnRect_.height-4)/2)+4,t.drawLine(6,12,13,12),t.drawLine(e.left,e.top,e.left+7,e.top),t.drawLine(e.left+1,e.top-1,e.left+6,e.top-1),t.drawLine(e.left+2,e.top-2,e.left+5,e.top-2),t.drawLine(e.left+3,e.top-3,e.left+4,e.top-3),e.left=this.rightBtnRect_.left+Math.trunc((this.rightBtnRect_.width-7)/2),e.top=this.rightBtnRect_.top+Math.trunc((this.rightBtnRect_.height-4)/2),t.drawLine(e.left,e.top,e.left+7,e.top),t.drawLine(e.left+1,e.top+1,e.left+6,e.top+1),t.drawLine(e.left+2,e.top+2,e.left+5,e.top+2),t.drawLine(e.left+3,e.top+3,e.left+4,e.top+3),t.paintPath())}},{key:"orientation",get:function(){return this.orientation_},set:function(t){this._setOrientation(t)}},{key:"min",get:function(){return this.min_},set:function(t){this._setMin(t)}},{key:"max",get:function(){return this.max_},set:function(t){this._setMax(t)}},{key:"pageSize",get:function(){return this.pageSize_},set:function(t){this._setPageSize(t)}},{key:"range",get:function(){return this.range_}},{key:"position",get:function(){return this.position_},set:function(t){this._setPosition(t)}},{key:"btnStep",get:function(){return this.btnStep_},set:function(t){this.btnStep_!=t&&(this.btnStep_=t)}},{key:"onScroll",get:function(){return this._onScroll},set:function(t){this._onScroll=t}}]),i}(ni),yi=0,pi=1,Si=2,vi={Creating:1,Removing:2,Aligning:3,VisibleChange:4,KeyDown:5},Fi=1,Ii=2,gi=function(t){Mt(i,t);var e=Gt(i);function i(){return Nt(this,i),e.call(this)}return i}(function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).state_.add(vi.Creating),t.handle_=0,t.image=null,t.controls=new V,t.controls.onAdded=function(e){t.doAddControl_(e)},t.controls.onRemoved=function(e){t.doRemoveControl_(e)},t._focusControl=null,t._captureControl=null,t._mouseMoveControl=null,t.state_.delete(vi.Creating),t}return Et(i,[{key:"doResize_",value:function(){this.reAlign(),xt(Ut(i.prototype),"doResize_",this).call(this)}},{key:"doAddControl_",value:function(t){t.tab_=this.controls.count-1,t.added_(this),this.reAlignControl(t)}},{key:"doAlign_",value:function(){for(var t=this.paddingLeft,e=this.paddingTop,i=this.width-this.paddingRight,n=this.height-this.paddingBottom,o=null,r=0;r=0;n--)if((i=this.controls[n]).visible&&i.bounds().pointInAt(t,e))return n;return-1}},{key:"getControlAt",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getControlIndexAt(t,e);if(n>=0){var o=this.controls[n];return i&&!o.enabled?null:o}return null}},{key:"getControlAtPos",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this.getControlAt(t,e,n);return null!=o?o.isClass(i)?o.getControlAtPos(t-o.left,e-o.top,n):o:this}},{key:"doMouseLeave_",value:function(){null!=this._mouseMoveControl&&(this._mouseMoveControl.mouseLeave(),this._mouseMoveControl=null),xt(Ut(i.prototype),"doMouseLeave_",this).call(this)}},{key:"doMouseWheel_",value:function(t){if(this.enabled_)if(null!=this._mouseMoveControl){var e=new ei;e.assign(t),e.x=t.x-this._mouseMoveControl.left,e.y=t.y-this._mouseMoveControl.top,this._mouseMoveControl.mouseWheel(e)}else xt(Ut(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"mouseDown",value:function(t){if(this.enabled_){var e=this.getControlAt(t.x,t.y);if(this.designState&&(null!=e?e.hclSelect():this.hclSelect()),null!=e){this._captureControl=e;var n=new ei;n.assign(t),n.x=t.x-this._captureControl.left,n.y=t.y-this._captureControl.top,this._captureControl.mouseDown(n)}else null!=this._focusControl&&this._focusControl.killFocus(),xt(Ut(i.prototype),"mouseDown",this).call(this,t)}}},{key:"mouseMove",value:function(t){if(this.enabled_){if(t.button==ee&&null!=this._captureControl){var e=new ei;return e.assign(t),e.x=t.x-this._captureControl.left,e.y=t.y-this._captureControl.top,void this._captureControl.mouseMove(e)}var n=this.getControlAt(t.x,t.y);if(n!=this._mouseMoveControl&&(null!=this._mouseMoveControl&&this._mouseMoveControl.mouseLeave(),this._mouseMoveControl=n,null!=this._mouseMoveControl&&this._mouseMoveControl.mouseEnter()),null!=this._mouseMoveControl){var o=new ei;o.assign(t),o.x=t.x-this._mouseMoveControl.left,o.y=t.y-this._mouseMoveControl.top,this._mouseMoveControl.mouseMove(o)}else or.application.setCursorBy(this),xt(Ut(i.prototype),"mouseMove",this).call(this,t)}}},{key:"mouseUp",value:function(t){if(this.enabled_){if(null!==this._captureControl){var e=new ei;e.assign(t),e.x=t.x-this._captureControl.left,e.y=t.y-this._captureControl.top,this._captureControl.mouseUp(e)}else xt(Ut(i.prototype),"mouseUp",this).call(this,t);this._captureControl=null}}},{key:"doDblClick_",value:function(t){if(this.enabled_){var e=this.getControlAt(t.x,t.y);if(null!=e){var n=new ei;n.assign(t),n.x-=e.left,n.y-=e.top,e.dblClick(n)}else xt(Ut(i.prototype),"doDblClick_",this).call(this,t)}}},{key:"setTab",value:function(t,e){e>this.controls.count-1&&(e=this.controls.count-1),t.tab_=e}},{key:"tabNext",value:function(t){for(var e=0;et.tab&&this.controls[e].canFocus&&this.controls[e].visible&&this.controls[e].enabled){this.controls[e].tabSetFocus();break}}},{key:"tabPrev",value:function(t){for(var e=this.controls.count-1;e>=0;e--)if(this.controls[e].tab1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=0;o0&&void 0!==arguments[0]?arguments[0]:1e3;return ki(this,i),(t=e.call(this))._handle=0,t._lastExecTime=0,t._stoped=!0,t.loop=!1,t._interval=n,t.onExecute=null,t}return Di(i,[{key:"_execute",value:function(t){var e=this;if(0==this._lastExecTime)this._lastExecTime=t;else if(t-this._lastExecTime>=this._interval){if(this.doExecute_(),!this.loop)return void this.doStop_();this._lastExecTime=t}this._stoped||(this._handle=window.requestAnimationFrame((function(t){return e._execute(t)})))}},{key:"doStop_",value:function(){this._stoped=!0}},{key:"doExecute_",value:function(){null!=this.onExecute&&this.onExecute()}},{key:"start",value:function(){var t=this;0==this._handle&&(this._stoped=!1,this._lastExecTime=0,this._handle=window.requestAnimationFrame((function(e){return t._execute(e)})))}},{key:"stop",value:function(){this._handle>0&&(window.cancelAnimationFrame(this._handle),this.doStop_(),this._handle=0)}},{key:"enabled",get:function(){return!this._stoped},set:function(t){t?this._stoped&&this.start():this._stoped||this.stop()}}]),i}($e),Oi=function(t){bi(i,t);var e=_i(i);function i(){var t;return ki(this,i),(t=e.call(this)).rect=new U,t.text="",t.visible=!1,t.control=null,t}return i}(L),Ni=(window.AudioContext||window.webkitAudioContext,function(t){bi(i,t);var e=_i(i);function i(){return ki(this,i),e.call(this)}return Di(i,null,[{key:"request",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=null;if(window.XMLHttpRequest?r=new XMLHttpRequest:window.ActiveXObject&&(r=new ActiveXObject("Microsoft.XMLHTTP")),null!=r){var s=i.toUpperCase(),a=t,l=o,h=e||[],c=[];for(var u in h)c.push(u+"="+h[u]);var f=c.join("&");r.onreadystatechange=function(){4==r.readyState&&200==r.status&&null!=n&&n(r.responseText)},r.onloadend=function(t){},"GET"==s?(r.open("GET",a+"?"+f,l),r.send(null)):"POST"==s&&(r.open("POST",a,l),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(f))}else alert("你的浏览器不支持XMLHttp")}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];i.request(t,e,"GET",n,o)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];i.request(t,e,"POST",n,o)}}]),i}(L));function Bi(t,e){for(var i=0;i-1){this._srcType=Qi;var t=this.image.src.split(",");this._imageType=t[0].match(/:(.*?);/)[1]}else{this._srcType=qi;var e=this.image.src.lastIndexOf(".");this._imageType=this.image.src.substring(e)}null!=this._onImageLoaded&&this._onImageLoaded(),this.update()}},{key:"doPaint_",value:function(t){this.loaded&&t.drawImage(0,0,this.image)}},{key:"doPaintBackground_",value:function(t){}},{key:"saveToStream",value:function(t){var e;switch(t.writeByte(this._srcType),this._srcType){case qi:e=A.getBytes(this.image.src);break;case Qi:var i=this.image.src.split(",");e=b.fromBase64(i[1]);break;default:return}t.writeUInt32(e.length),t.writeBuffer(e)}},{key:"loadFromStream",value:function(t){if(this._srcType=t.readByte(),this._srcType!=Zi){var e=t.readUInt32();if(e>0){var i=t.readBuffer(e);switch(this._srcType){case qi:this.image.src=i.toText();break;case Qi:this.image.src="data:image/png;base64,"+i.toBase64();break;default:return}}}}},{key:"src",get:function(){return this.image.src},set:function(t){this.image.src=t}},{key:"srcType",get:function(){return this._srcType}},{key:"imageType",get:function(){return this._imageType}},{key:"onImageLoaded",get:function(){return this._onImageLoaded},set:function(t){this._onImageLoaded=t}}],[{key:"Create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=new i;return n.width=t,n.height=e,n}}]),i}(ni),tn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).text_=null!=t?t:"",n.font=new mt,n.font.onChange=function(){n.doFontChange()},n.borderVisible_=!1,n.borderWidth_=1,n._horiAlign=Fe,n._vertAlign=Ce,n._autoWidth=!1,n._autoHeight=!1,n.width_=75,n.height_=20,n._onChange=null,n}return Vi(i,[{key:"doSetPaddingLeft_",value:function(t){this.paddingLeft!=t&&(Hi(Yi(i.prototype),"doSetPaddingLeft_",this).call(this,t),this._autoWidth&&this.doSetAutoWidth_())}},{key:"doSetPaddingTop_",value:function(t){this.paddingTop!=t&&(Hi(Yi(i.prototype),"doSetPaddingTop_",this).call(this,t),this._autoHeight&&this.doSetAutoHeight_())}},{key:"doSetPaddingRight_",value:function(t){this.paddingRight!=t&&(Hi(Yi(i.prototype),"doSetPaddingRight_",this).call(this,t),this._autoWidth&&this.doSetAutoWidth_())}},{key:"doSetPaddingBottom_",value:function(t){this.paddingBottom!=t&&(Hi(Yi(i.prototype),"doSetPaddingBottom_",this).call(this,t),this._autoHeight&&this.doSetAutoHeight_())}},{key:"doCalcWidth_",value:function(){return this.paddingLeft+this.paddingRight+Dt.textWidth(this.font,this.text)}},{key:"doSetAutoWidth_",value:function(){var t=this.doCalcWidth_();this.width!=t&&(this.width=t)}},{key:"doCalcHeight_",value:function(){return this.paddingTop+this.paddingBottom+this.font.height}},{key:"doSetAutoHeight_",value:function(){var t=this.doCalcHeight_();this.height!=t&&(this.height=t)}},{key:"reCalcSize_",value:function(){this.beginUpdate();try{this._autoWidth&&this.doSetAutoWidth_(),this._autoHeight&&this.doSetAutoHeight_()}finally{this.endUpdate()}}},{key:"doFontChange",value:function(){this.reCalcSize_()}},{key:"doChange_",value:function(){this.reCalcSize_(),null!=this._onChange&&this._onChange()}},{key:"doPaintText_",value:function(t,e,i){t.textOut(e,i,this.text_)}},{key:"doPaint_",value:function(t){if(this.text_.length>0){t.font.assign(this.font),this.enabled||(t.font.color=or.theme.textDisableColor);var e=0;switch(this._vertAlign){case we:e=this.height-this.paddingBottom;break;case Ce:e=Math.max(0,(this.height-this.font.height)/2);break;default:e=this.paddingTop}var i=0,n=Dt.textWidth(this.font,this.text_);switch(this._horiAlign){case Ie:i=this.width-n-this.paddingRight;break;case ge:i=this.paddingLeft+Math.max(0,(this.width-this.paddingLeft-this.paddingRight-n)/2);break;default:i=this.paddingLeft}this.doPaintText_(t,i,e)}}},{key:"doSetBorderVisible_",value:function(){this.update()}},{key:"getText_",value:function(){return this.text_}},{key:"setText_",value:function(t){this.text_!=t&&(this.text_=t.toString(),this.doSetText_())}},{key:"doSetText_",value:function(){this.doChange_()}},{key:"textArea",value:function(){return U.Create(this.paddingLeft+(this.borderVisible_?this.borderWidth_:0),this.paddingTop+(this.borderVisible_?this.borderWidth_:0),this.width-(this.borderVisible_?this.borderWidth_:0)-this.paddingRight,this.height-(this.borderVisible_?this.borderWidth_:0)-this.paddingBottom)}},{key:"clear",value:function(){this.text=""}},{key:"autoWidth",get:function(){return this._autoWidth},set:function(t){this._autoWidth!=t&&(this._autoWidth=t,t&&this.doSetAutoWidth_())}},{key:"autoHeight",get:function(){return this._autoHeight},set:function(t){this._autoHeight!=t&&(this._autoHeight=t,t&&this.doSetAutoHeight_())}},{key:"autoSize",get:function(){return this._autoWidth&&this._autoHeight},set:function(t){this.autoWidth=t,this.autoHeight=t}},{key:"text",get:function(){return this.getText_()},set:function(t){this.setText_(t)}},{key:"borderVisible",get:function(){return this.borderVisible_},set:function(t){this.borderVisible_!=t&&(this.borderVisible_=t,this.doSetBorderVisible_())}},{key:"onChange",get:function(){return this._onChange},set:function(t){this._onChange=t}}]),i}(ni),en=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._vertAlign=Ce,n.transparent=!0,n.autoWidth=!0,n.autoHeight=!0,n}return i}(tn),nn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._horiAlign=ge,n._vertAlign=Ce,n._paddingLeft=5,n._paddingTop=5,n._paddingRight=5,n._paddingBottom=5,n.textVisible_=!0,n.canFocus=!0,n.width=75,n}return Vi(i,[{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.update()}},{key:"doMouseLeave_",value:function(){Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this.update()}},{key:"doMouseDown_",value:function(t){Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),this.update()}},{key:"doMouseUp_",value:function(t){Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),this.update()}},{key:"doSetAutoWidth_",value:function(){this.textVisible_?Hi(Yi(i.prototype),"doSetAutoWidth_",this).call(this):this.width=this.paddingLeft+this.paddingRight,this.width1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=new sn(t);return o.textVisible=i,o.onCheckChange=function(t){if(t.checked&&t.group>0)for(var i=0;ie.bottom||(this._checkByText?this._downInCheck=!0:this._downInCheck=e.pointInAt(t.x,t.y),Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t))}},{key:"doMouseUp_",value:function(t){var e=this._getBoxRect();t.ye.bottom||(this._downInCheck&&(this._checkByText||e.pointInAt(t.x,t.y))&&(this.useCheckState?this._state==yi?this.state=pi:this._state==pi?this.state=Si:this.state=yi:this.checked=!this._checked,null!=this.onSwitch&&this.onSwitch()),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t))}},{key:"doPaint_",value:function(t){this.mouseIn?t.pen.color=or.theme.borderHotColor:t.pen.color=or.theme.borderColor;var e=this._getBoxRect();this._state==yi?or.theme.drawFrameControl(t,e,new Set([yi]),Ii):this._state==pi?or.theme.drawFrameControl(t,e,new Set([pi]),Ii):this._state==Si&&or.theme.drawFrameControl(t,e,new Set([]),Ii),Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"checked",get:function(){return this._checked},set:function(t){this._checked!=t&&(this._checked=t,this._state=t?yi:Si,this.updateRect(this._getBoxRect()))}},{key:"state",get:function(){return this._state},set:function(t){this._state!=t&&(this._state=t,this._checked=t==yi,this.updateRect(this._getBoxRect()))}}]),i}(en),fn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;Ji(this,i),(n=e.call(this,t))._readOnly=!1,n.cursor_=ue,n.imeMode=Ei,n.popupMenuEnable=!0,n.popupMenu=new _n,n._copyMenuItem=n.popupMenu.addItem("复制"),n._copyMenuItem.onClick=function(){n.doCopy_()},n._copyToBrowerMenuItem=n.popupMenu.addItem("复制到浏览器"),n._copyToBrowerMenuItem.onClick=function(){n.doCopyToBrower_()},n._cutMenuItem=n.popupMenu.addItem("剪切"),n._cutMenuItem.onClick=function(){n.doCut_()},n._pasteMenuItem=n.popupMenu.addItem("粘贴"),n._pasteMenuItem.onClick=function(){n.doPaste_()},n.popupMenu.addSpliter();var o=n.popupMenu.addItem("删除");o.addItem("全部删除");var r=o.addItem("增量删除");return r.addItem("1111111"),r.addItem("2222222"),r.addItem("3333333"),(r=o.addItem("删除选中")).addItem("aaaa"),r.addItem("bbbb"),r.addItem("cccc"),n}return Vi(i,[{key:"removed_",value:function(){Hi(Yi(i.prototype),"removed_",this).call(this),or.ime.removeControl(this)}},{key:"doContextMenu_",value:function(t,e){this.popupMenuEnable&&(this._copyMenuItem.enabled=this.canCopy_(),this._cutMenuItem.enabled=this.canCut_(),this._pasteMenuItem.enabled=this.canPaste_(),Hi(Yi(i.prototype),"doContextMenu_",this).call(this,t,e))}},{key:"doCheckImeMode_",value:function(){this._readOnly||this.imeMode!=Ei&&or.ime.setControl(this)}},{key:"doMouseDown_",value:function(t){Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),this.doCheckImeMode_()}},{key:"doMouseUp_",value:function(t){!this._readOnly&&this.mouseStates.has(qt)&&this.imeMode!=Ei&&or.ime.setControl(this),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doSetReadOnly_",value:function(){}},{key:"doCopy_",value:function(){}},{key:"doCopyToBrower_",value:function(){}},{key:"doCut_",value:function(){}},{key:"doPaste_",value:function(){}},{key:"canCopy_",value:function(){return!1}},{key:"canCut_",value:function(){return!1}},{key:"canPaste_",value:function(){return!1}},{key:"imeActive",value:function(){}},{key:"insertText",value:function(t,e){this.text=C.stringInsert(this.text,t,e)}},{key:"deleteText",value:function(t,e){this.text=C.stringDelete(this.text,t,e)}},{key:"imeInput",value:function(t){}},{key:"readOnly",get:function(){return this._readOnly},set:function(t){this._readOnly!=t&&(this._readOnly=t,this.doSetReadOnly_())}}]),i}(tn),dn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).canFocus=!0,n.borderVisible_=!0,n._vertAlign=Ce,n._selStart=-1,n._selEnd=-1,n._selMove=-1,n._leftOffset=0,n._marginLeft=2,n._marginTop=2,n._marginRight=2,n._marginBottom=2,n._paddingLeft=2,n._paddingTop=2,n._paddingRight=2,n._paddingBottom=2,n._textPrompt="",n.imeMode=Mi,n}return Vi(i,[{key:"_selectActionLeft",value:function(){this.selectExists()?(this._selMove==this._selStart&&this._selStart>0?(this._selStart--,this._selMove=this._selStart):this._selMove==this._selEnd&&this._selEnd<=this.text.length&&(this._selEnd--,this._selEnd==this._selStart?(this._selEnd=-1,this._selMove=this._selStart):this._selMove=this._selEnd),this.scrollAdjust_(this._selMove),this.resetSelect_()):this._selStart>0&&(this._selEnd=this._selStart,this._selStart--,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"_selectActionRight",value:function(){this.selectExists()?(this._selMove==this._selStart&&this._selStart0){for(var n=Dt.getTextExtent(this.font,this.text),o=0,r=0;r=i)return Math.trunc(o-n[r]/2)>i?r:r+1;if(i>o)return this.text.length}return 0}},{key:"getCharLeft_",value:function(t){var e=0;if(t>0)for(var i=Dt.getTextExtent(this.font,this.text,t),n=0;n=0&&this.showCaret_(),this.update()}},{key:"scrollAdjust_",value:function(t){var e=this.textArea(),i=Dt.textWidth(this.font,this.text);if(ie.right?this._leftOffset+=o-e.right:o0&&(this._selStart--,this.deleteText(this._selStart,1),this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_())}finally{this.endUpdate()}}},{key:"doDeleteKeyDown_",value:function(){this.beginUpdate();try{this.selectExists()?this.deleteSelect():this._selStart0&&this._selStart--,this._selEnd=-1,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"doRightKeyDown_",value:function(){this.beginUpdate();try{!this.selectExists()&&this._selStart0&&t.x0){var n=Dt.textWidth(this.font,this.text_);t.x>e.right&&(this._leftOffset=Math.max(0,Math.min(n-e.width,this._leftOffset+this.font.advCharWidth)))}this._selEnd=this.getCharOffsetAt_(t.x,t.y),this._selMove=this._selEnd,this.selectExists()||this._selEnd>=0&&(this._selEnd=-1,this._selMove=this._selStart),this.scrollAdjust_(this._selMove),this.resetSelect_()}e.pointInAt(t.x,t.y)?this.cursor=ue:this.cursor=oe,Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){if(t.button==ee&&this._selEnd>=0&&this._selEnd0&&(t.brush.color=this.font.color,t.fillBounds(e.left-1,e.top+1,1,e.height-2)),Dt.textWidth(this.font,this.text_)>this._leftOffset+e.width&&(t.brush.color=this.font.color,t.fillBounds(e.right+1,e.top+1,1,e.height-2))}},{key:"doPaintText_",value:function(t,e,i){""!=this.text_&&t.textOut(e-this._leftOffset,i,this.text_)}},{key:"doPaint_",value:function(t){t.save();try{var e=this.textArea();t.clipRect(e),""!=this.text?Hi(Yi(i.prototype),"doPaint_",this).call(this,t):""!=this._textPrompt&&(t.font.styles.value=ht.Italic,t.font.color=at.Gray,t.textOut(this.getCharLeft_(0),this.getCharTop_(),this._textPrompt))}finally{t.restore()}}},{key:"doSetText_",value:function(){this.disSelect(),this._selStart>this.text.length&&(this._selStart=this.text.length),Hi(Yi(i.prototype),"doSetText_",this).call(this)}},{key:"doInsertText",value:function(t,e){Hi(Yi(i.prototype),"insertText",this).call(this,t,e),this._selStart>=0&&(this._selStart+=e.length,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_())}},{key:"dispose",value:function(){this._destroyCaret()}},{key:"insertText",value:function(t,e){this.beginUpdate();try{this.selectExists()&&this.deleteSelect(),this.doInsertText(t,e)}finally{this.endUpdate()}}},{key:"copy",value:function(){or.clipboard.clear(),this.selectExists()&&or.clipboard.setText(this.selectText())}},{key:"copyToBrower",value:function(){this.selectExists()&&or.clipboard.toBrowerClipboard(this.selectText())}},{key:"cut",value:function(){this.copy(),this.deleteSelect()}},{key:"paste",value:function(){var t=or.localStorage.getString(g);null!=t&&this.insertText(this._selStart,t)}},{key:"deleteSelect",value:function(){this.beginUpdate();try{this.deleteText(this._selStart,this.selLength),this._selEnd=-1,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"disSelect",value:function(){this._selMove=this._selStart,this.selectExists()&&(this._selEnd=-1,this.resetSelect_())}},{key:"select",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t<0||(this._selStart=t,e>0?(this._selEnd=t+e,this._selMove=this._selEnd):(this._selEnd=-1,this._selMove=this._selStart),this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"selectAll",value:function(){this.select(0,this.text.length)}},{key:"selectText",value:function(){return this._selEnd>=0?this.text.substring(this._selStart,this._selEnd):""}},{key:"selectExists",value:function(){return this._selEnd>=0&&this._selEnd!=this._selStart}},{key:"imeInput",value:function(t){this.readOnly||this.insertText(this._selStart,t)}},{key:"tabSetFocus",value:function(){Hi(Yi(i.prototype),"tabSetFocus",this).call(this),this.selectAll()}},{key:"selStart",get:function(){return this.selectExists()&&this._selEndthis.max||Hi(Yi(i.prototype),"setText_",this).call(this,t)}},{key:"number",get:function(){return this.getNumber(this.text)}},{key:"valueMask",get:function(){return this.valueMask_},set:function(t){this.valueMask_=t}}]),i}(dn),Sn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._paddingRight=10,n.FIncrement=1,n.btnUpRect=new U,n.btnDownRect=new U,n.calcButtonRect_(),n}return Vi(i,[{key:"calcButtonRect_",value:function(){this.btnUpRect.reset(this.width-this._paddingRight+1,this.borderWidth_,this.width-this.borderWidth_,this.height/2-this.borderWidth_),this.btnDownRect.reset(this.btnUpRect.left,this.height/2-this.borderWidth_,this.btnUpRect.right,this.height-this.borderWidth_)}},{key:"doPaintBackground_",value:function(t){Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),t.brush.color=or.theme.backgroundHotColor,t.fillRect(this.btnUpRect),t.fillRect(this.btnDownRect),or.theme.drawDropUp(t,this.btnUpRect),or.theme.drawDropDown(t,this.btnDownRect)}},{key:"doUpButtonClick_",value:function(){this.onUpButtonClick?this.onUpButtonClick():this.text=this.number+this.FIncrement,this.doChange_()}},{key:"doDownButtonClick_",value:function(){this.onDownButtonClick?this.onDownButtonClick():this.text=this.number-this.FIncrement,this.doChange_()}},{key:"doMouseUp_",value:function(t){this.readOnly?Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t):this.btnUpRect.pointInAt(t.x,t.y)?this.doUpButtonClick_():this.btnDownRect.pointInAt(t.x,t.y)?this.doDownButtonClick_():Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this.calcButtonRect_()}}]),i}(pn),vn=function(t){Wi(i,t);var e=ji(i);function i(t,n){var o;return Ji(this,i),(o=e.call(this,n))._lableText=t,o._paddingLeft=or.theme.marginSpaceDouble+Dt.textWidth(o.font,o._lableText),o.width_=Dt.textWidth(Dt.DefaultFont,t)+75,o}return Vi(i,[{key:"doPaintBackground_",value:function(t){t.font.assign(Dt.DefaultFont),t.textOut(or.theme.marginSpace,this.getCharTop_(),this._lableText),Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"lableText",get:function(){return this._lableText},set:function(t){this._lableText=t}}]),i}(dn),Fn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).image=new Image(or.theme.iconSize,or.theme.iconSize),n.image.onload=function(t){n._updateButtonRect()},n._paddingRight=or.theme.iconSize,n._buttonMouseIn=!1,n._buttonDown=!1,n._buttonRect=new U,n.calcButtonRect_(),n}return Vi(i,[{key:"doButtonClick_",value:function(){this.onButtonClick&&this.onButtonClick()}},{key:"_updateButtonRect",value:function(){this.updateRect(this._buttonRect)}},{key:"calcButtonRect_",value:function(){this._buttonRect.reset(this.width-this._paddingRight+1,this.borderWidth_,this.width-this.borderWidth_,this.height-this.borderWidth_)}},{key:"doPaintBackground_",value:function(t){Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),this._buttonMouseIn&&(this._buttonDown?t.brush.color=or.theme.backgroundDownColor:t.brush.color=or.theme.backgroundHotColor,t.fillRect(this._buttonRect)),this.image.loaded?t.drawImage(this._buttonRect.left,this._buttonRect.top,this.image):or.theme.drawDropDown(t,this._buttonRect)}},{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.cursor=ue}},{key:"doMouseLeave_",value:function(){this._buttonMouseIn=!1,this._buttonDown=!1,Hi(Yi(i.prototype),"doMouseLeave_",this).call(this)}},{key:"doMouseDown_",value:function(t){this._buttonRect.pointInAt(t.x,t.y)?(this.hideCaret_(),this._buttonDown=!0,this._updateButtonRect(),this.focused||Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)):(this._buttonDown=!1,Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t))}},{key:"doMouseMove_",value:function(t){this._buttonRect.pointInAt(t.x,t.y)?this._buttonMouseIn||(this._buttonMouseIn=!0,this._updateButtonRect(),this.cursor=oe):this._buttonMouseIn&&(this._buttonMouseIn=!1,this._updateButtonRect(),this.cursor=ue),this._buttonDown||Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){this._buttonDown?(this._buttonDown=!1,this._updateButtonRect(),this._buttonRect.pointInAt(t.x,t.y)&&!this.readOnly&&this.doButtonClick_()):Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doDblClick_",value:function(t){this._buttonRect.pointInAt(t.x,t.y)||Hi(Yi(i.prototype),"doDblClick_",this).call(this,t)}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this.calcButtonRect_()}},{key:"onButtonClick",value:function(){}}]),i}(dn),In=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).text="",t.object=null,t}return Vi(i,null,[{key:"Create",value:function(t,e){var n=new i;return n.text=t,n.object=e,n}}]),i}(L),gn=function(t){Wi(i,t);var e=ji(i);function i(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Ji(this,i),e.call(this,t)}return Vi(i,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Hi(Yi(i.prototype),"add",this).call(this,In.Create(t,e))}},{key:"indexOf",value:function(t){for(var e=0;e0){this._displayFirst=0;for(var t=this.paddingTop-this._getTopOffset()+this.font.height+or.theme.marginSpaceDouble,e=0;e0){this._displayFirst=e;break}t=t+this.font.height+or.theme.marginSpaceDouble}this._displayLast=this._items.count-1;for(var i=this._displayFirst;ithis.height_-this.paddingBottom){this._displayLast=i;break}t=t+this.font.height+or.theme.marginSpaceDouble}}else this._displayFirst=-1,this._displayLast=-1}},{key:"_getItemRect",value:function(t){return U.CreateByBounds(this.paddingLeft,t*(this.font.height+or.theme.marginSpaceDouble)-this._getTopOffset()+this.paddingTop+(this.borderVisible_?this.borderWidth_:0),this.width-this._paddingLeft-this.paddingRight,this.font.height+or.theme.marginSpaceDouble)}},{key:"_getItemIndexAt",value:function(t,e){if(t>0&&t<(this._scrollBar.visible?this._scrollBar.left:this.width))for(var i=-this._getTopOffset(),n=0;ni&&e<=i+this.font.height+or.theme.marginSpaceDouble)return n;i+=this.font.height+or.theme.marginSpaceDouble}return-1}},{key:"_getContentHeight",value:function(){return this._items.count*(this.font.height+or.theme.marginSpaceDouble)}},{key:"_setHotIndex",value:function(t){if(t!=this._hotIndex){var e=this._hotIndex;this._hotIndex=t,e>=0&&this.updateRect(this._getItemRect(e)),this._hotIndex>=0&&this.updateRect(this._getItemRect(this._hotIndex))}}},{key:"doSelectedIndexChange_",value:function(){null!=this._onSelectedIndexChange&&this._onSelectedIndexChange()}},{key:"_setItemIndex",value:function(t){if(t!=this._itemIndex){var e=this._itemIndex;if(this._itemIndex=t,e>=0&&this.updateRect(this._getItemRect(e)),this._itemIndex>=0&&this._itemIndexthis.height-this.paddingBottom?this._scrollBar.position+=i.bottom-this.height+this.paddingBottom:this.update()}else this.text="";this.doSelectedIndexChange_()}}},{key:"_reSetContent",value:function(){var t=this._getContentHeight();t>this.height?(this.borderVisible_?(this._scrollBar.height=this.height-this.borderWidth_-this.borderWidth_-1,this._scrollBar.left=this.width-this._scrollBar.width-this._paddingRight-this.borderWidth_+2,this._scrollBar.top=this.borderWidth_+1):(this._scrollBar.height=this.height,this._scrollBar.left=this.width-this._scrollBar.width-this._paddingRight,this._scrollBar.top=0),this._scrollBar.max=t,this._scrollBar.visible=!0):this._scrollBar.visible=!1,this._calcDisplayItem(),this.update()}},{key:"doSetPaddingRight_",value:function(t){Hi(Yi(i.prototype),"doSetPaddingRight_",this).call(this,t)}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this._reSetContent()}},{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.update()}},{key:"doMouseLeave_",value:function(){this._hotIndex=-1,Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this.update()}},{key:"doMouseWheel_",value:function(t){this._scrollBar.visible&&(t.delta<0?this._scrollBar.position+=20:this._scrollBar.position-=20),Hi(Yi(i.prototype),"doMouseWheel_",this).call(this,t)}},{key:"doMouseDown_",value:function(t){if(this._mouseDownScrollBar=!1,this._scrollBar.visible){var e=this._scrollBar.bounds();if(e.pointInAt(t.x,t.y)){this._mouseDownScrollBar=!0;var n=new ei;return n.assign(t),n.x-=e.left,n.y-=e.top,void this._scrollBar.mouseDown(n)}}this.textArea().pointInAt(t.x,t.y)&&Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseMove_",value:function(t){var e=!1;if(this._scrollBar.visible){var n=this._scrollBar.bounds();if(n.pointInAt(t.x,t.y)){e=!0;var o=new ei;o.assign(t),o.x-=n.left,o.y-=n.top,this._scrollBar.mouseMove(o)}else if(this._mouseDownScrollBar){e=!0;var r=new ei;r.assign(t),r.x=n.left,r.y-=n.top,this._scrollBar.mouseMove(r)}}e&&this._hotIndex>=0?this._setHotIndex(-1):(this._mouseDownScrollBar?this._setHotIndex(-1):this._setHotIndex(this._getItemIndexAt(t.x,t.y)),Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t))}},{key:"doMouseUp_",value:function(t){if(this._mouseDownScrollBar){if(this._scrollBar.visible){var e=this._scrollBar.bounds();if(e.pointInAt(t.x,t.y)){var n=new ei;n.assign(t),n.x-=e.left,n.y-=e.top,this._scrollBar.mouseUp(n)}}this._mouseDownScrollBar=!1}else{if(this._scrollBar.visible)if(this._scrollBar.bounds().pointInAt(t.x,t.y))return;t.button==ee&&this.textArea().pointInAt(t.x,t.y)&&(this.itemIndex=this._getItemIndexAt(t.x,t.y)),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}}},{key:"_doPaintBorder",value:function(t,e){t.pen.width=this.borderWidth_,this._readOnly?t.pen.color=or.theme.borderColor:this.focused?t.pen.color=or.theme.borderActiveColor:this.mouseIn?t.pen.color=or.theme.borderHotColor:t.pen.color=or.theme.borderColor,t.rectangleRect(e)}},{key:"_doPaintSelected",value:function(t){}},{key:"doPaintBackground_",value:function(t){var e=this.clientRect();if(t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this._itemIndex>=0||this._hotIndex>=0){var i=this.textArea();if(this._itemIndex>=0){var n=this._getItemRect(this._itemIndex);n=i.intersection(n),t.brush.color=or.theme.backgroundSelectColor,t.fillRect(n)}if(this._hotIndex>=0&&this._hotIndex!=this._itemIndex){var o=this._getItemRect(this._hotIndex);o=i.intersection(o),t.brush.color=or.theme.backgroundHotColor,t.fillRect(o)}}this.borderVisible_&&this._doPaintBorder(t,e)}},{key:"doPaintText_",value:function(t,e,i){var n=this.paddingLeft+or.theme.marginSpace+(this.borderVisible_?this.borderWidth_:0);if(!(this._displayLast<0)){t.font.assign(Dt.DefaultFont);for(var o=this._getItemRect(this._displayFirst).top,r=this._displayFirst;r<=this._displayLast;r++)t.textOut(n,o+or.theme.marginSpace,this._items[r].text),o+=this.font.height+or.theme.marginSpaceDouble}}},{key:"doSetBorderVisible_",value:function(){this._reSetContent(),Hi(Yi(i.prototype),"doSetBorderVisible_",this).call(this)}},{key:"doPaint_",value:function(t){var e=this.textArea();t.save();try{t.clipRect(e),this.doPaintText_(t,this.paddingLeft,this.paddingTop)}finally{t.restore()}if(this._scrollBar.visible){e=this.clientRect(),t.save();try{t.clipRect(e),this._scrollBar.paintTo(t,this._scrollBar.left,this._scrollBar.top)}finally{t.restore()}}}},{key:"dispose",value:function(){this._items.clear()}},{key:"textArea",value:function(){var t=Hi(Yi(i.prototype),"textArea",this).call(this);return this._scrollBar.visible&&(t.right=t.right-this._scrollBar.width+2),t}},{key:"addItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._items.add(t,e)}},{key:"deleteItem",value:function(t){t>=0&&t=0?this._items[this._itemIndex]:null}},{key:"itemIndex",get:function(){return this._itemIndex},set:function(t){this._setItemIndex(t)}},{key:"contentHeight",get:function(){return this._getContentHeight()}},{key:"onSelectedIndexChange",get:function(){return this._onSelectedIndexChange},set:function(t){this._onSelectedIndexChange=t}}]),i}(tn),Cn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).popupAlign_=Wt,n.DropDownWidth_=100,n.dropDownCount_=8,n.static_=!1,n.popupDownInTextArea_=!1,n.onSelectedIndexChange_=null,n._listBox=new wn,n._listBox.paddingLeft=0,n._listBox.paddingTop=0,n._listBox.paddingRight=0,n._listBox.paddingBottom=0,n._listBox.onUpdate=function(t){n._listBoxUpdate(t)},n._popupControl=null,n}return Vi(i,[{key:"doKeyDown_",value:function(t){!this.readOnly&&this.items.count>0&&(t.keyCode==Ee&&this.itemIndex>0?this.itemIndex--:t.keyCode==Le&&this.itemIndexe?e:i,this._popupControl=new oi,this._popupControl.width=this._listBox.width,this._popupControl.height=this._listBox.height,this._popupControl.dropDownStyle=!0,this._popupControl.onClose=function(){t._popupControl=null},this._popupControl.onDone=function(){t.doSelectedIndexChange_()},this._popupControl.onPaint=function(e){t._listBox.paintTo(e,0,0)},this._popupControl.onMouseEnter=function(){t._listBox.mouseEnter()},this._popupControl.onMouseLeave=function(){t._listBox.mouseLeave()},this._popupControl.onMouseWheel=function(e){t._listBox.mouseWheel(e)},this._popupControl.onMouseDown=function(e){t.popupDownInTextArea_=t._listBox.textArea().pointInAt(e.x,e.y),t._listBox.mouseDown(e)},this._popupControl.onMouseMove=function(e){t._listBox.mouseMove(e)},this._popupControl.onMouseUp=function(e){t._listBox.mouseUp(e),t.popupDownInTextArea_&&t._listBox.textArea().pointInAt(e.x,e.y)&&t.doDonePopup_()}}var n=this.clientToScreen(G.Create(0,0));this.popupAlign_==Wt?n.x+=this.paddingLeft-(this.borderVisible_?this.borderWidth_:0):n.x+=this.width-this._popupControl.width,this._popupControl.popup(n.x,n.y+this.height,!0)}},{key:"doDonePopup_",value:function(){this._popupControl.donePopup()}},{key:"doSelectedIndexChange_",value:function(){this.text=this._listBox.text,null!=this.onSelectedIndexChange_&&this.onSelectedIndexChange_()}},{key:"doButtonClick_",value:function(){this.readOnly||this._popup(),Hi(Yi(i.prototype),"doButtonClick_",this).call(this)}},{key:"addItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._listBox.addItem(t,e)}},{key:"removeItem",value:function(t){this._listBox.removeItem(t)}},{key:"itemIndexOf",value:function(t){return this._listBox.itemIndexOf(t)}},{key:"dropDownWidth",get:function(){return this.DropDownWidth_},set:function(t){this.DropDownWidth_=t}},{key:"itemIndex",get:function(){return this._listBox.itemIndex},set:function(t){this._listBox.itemIndex=t,this.text=this._listBox.text}},{key:"items",get:function(){return this._listBox.items}},{key:"static",get:function(){return this.static_},set:function(t){this.static_=t}},{key:"onSelectedIndexChange",get:function(){return this.onSelectedIndexChange_},set:function(t){this.onSelectedIndexChange_=t}}]),i}(Fn),kn=function(t){Wi(i,t);var e=ji(i);function i(){var t;Ji(this,i),(t=e.call(this)).FDateTime=X.Now(),t.width_=170,t.height_=185,t.edtHour=new Sn(0),t.edtHour.min=0,t.edtHour.max=23,t.edtHour.left=5,t.edtHour.top=162,t.edtHour.width=28,t.edtHour.onChange=function(){t.doChange_()};var n=new en("时");n.left=34,n.top=166,t.edtMinute=new Sn(0),t.edtMinute.min=0,t.edtMinute.max=59,t.edtMinute.left=48,t.edtMinute.top=162,t.edtMinute.width=28,t.edtMinute.onChange=function(){t.doChange_()};var o=new en("分");o.left=77,o.top=166,t.edtSecond=new Sn(0),t.edtSecond.min=0,t.edtSecond.max=59,t.edtSecond.left=90,t.edtSecond.top=162,t.edtSecond.width=28,t.edtSecond.onChange=function(){t.doChange_()};var r=new en("秒");r.left=118,r.top=166,t.btnDone=new nn("确定"),t.btnDone.left=t.width-38,t.btnDone.top=162,t.btnDone.width=35,t.btnDone.onClick=function(){t.doDone_()},t.beginUpdate();try{t.addControl(t.edtHour),t.addControl(n),t.addControl(t.edtMinute),t.addControl(o),t.addControl(t.edtSecond),t.addControl(r),t.addControl(t.btnDone)}finally{t.endUpdate()}return t._initNewDT(),t}return Vi(i,[{key:"_initNewDT",value:function(){this.newYear_=this.FDateTime.year,this.newMonth_=this.FDateTime.month,this.newDay_=this.FDateTime.day,this.newHour_=this.FDateTime.hour,this.newMinute_=this.FDateTime.minute,this.newSecond_=this.FDateTime.second,this.edtHour.text=this.newHour_.toString(),this.edtMinute.text=this.newMinute_.toString(),this.edtSecond.text=this.newSecond_.toString()}},{key:"doPaint_",value:function(t){t.brush.color=at.White,t.fillBounds(0,0,this.width_,this.height_-25),t.textOut(3,3,"<"),t.textOut(13,3,this.newYear_),t.textOut(45,3,">"),t.textOut(63,3,"<"),t.textOut(72,3,this.newMonth_),t.textOut(89,3,">"),t.textOut(this.width-30,3,"今天"),t.brush.color=at.LightGray,t.fillBounds(0,20,this.width_,20),t.textOut(5,23,"日"),t.textOut(29,23,"一"),t.textOut(53,23,"二"),t.textOut(77,23,"三"),t.textOut(101,23,"四"),t.textOut(125,23,"五"),t.textOut(149,23,"六");for(var e=new X,n=this.newYear_==e.year&&this.newMonth_==e.month,o=new Date(this.newYear_,this.newMonth_,0),r=o.getDate(),s=(o=new Date(this.newYear_,this.newMonth_-1,1)).getDay(),a=24*s+3,l=43,h=1;h<=r;h++)n&&h==e.day&&(t.brush.color=at.Gray,t.fillBounds(a,l,20,20)),h==this.newDay_&&(t.brush.color=or.theme.backgroundSelectColor,t.fillBounds(a,l,20,20)),t.textOut(a+3,l+3,h),7==++s?(s=0,a=3,l+=20):a+=24;Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){if(t.x>0&&t.x<12&&t.y>0&&t.y<20)this.newYear_--,this.doChange_();else if(t.x>42&&t.x<54&&t.y>0&&t.y<20)this.newYear_++,this.doChange_();else if(t.x>60&&t.x<72&&t.y>0&&t.y<20){this.newMonth_>1?this.newMonth_--:(this.newYear_--,this.newMonth_=12);var e=new Date(this.newYear_,this.newMonth_,0).getDate();this.newDay_>e&&(this.newDay_=e),this.doChange_()}else if(t.x>86&&t.x<98&&t.y>0&&t.y<20){this.newMonth_<12?this.newMonth_++:(this.newYear_++,this.newMonth_=1);var n=new Date(this.newYear_,this.newMonth_,0).getDate();this.newDay_>n&&(this.newDay_=n),this.doChange_()}else if(t.x>this.width_-30&&t.y<20){var o=new X;this.newYear_=o.year,this.newMonth_=o.month,this.newDay_=o.day,this.doChange_()}else for(var r=new Date(this.newYear_,this.newMonth_,0),s=r.getDate(),a=(r=new Date(this.newYear_,this.newMonth_-1,1)).getDay(),l=24*a+3,h=43,c=1;c<=s;c++){if(t.x>l&&t.xh&&t.y0&&void 0!==arguments[0]?arguments[0]:200;return Ji(this,i),(t=e.call(this))._colorBand=50,t.width_=n,t.height_=n+t._colorBand,t._color=at.White,t._iniHotColor(),t._imageData=at.getColorPad(Math.round(n/2)),t._edtR=new dn,t._edtR.hint="颜色的R值",t._edtR.parent=Ki(t),t._edtR.left=20,t._edtR.top=n+5,t._edtR.width=40,t}return Vi(i,[{key:"_iniHotColor",value:function(){var t=at.colorToRGBA(this._color);this._R=t.r,this._G=t.g,this._B=t.b,this._A=t.a}},{key:"_setColor",value:function(t){this._color!=t&&(this._color=t,this._iniHotColor(),this.update())}},{key:"doPaintBackground_",value:function(t){t.brush.color=this.hotColor,t.fillRect(this.clientRect()),t.drawImageData(this._imageData,0,0,this.width,this.height)}},{key:"doPaint_",value:function(t){Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"doMouseLeave_",value:function(){Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this._iniHotColor(),this.update()}},{key:"doMouseMove_",value:function(t){if(Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t),Dt.pointInEllipseBounds(0,0,this.width_,this.width_,t.x,t.y)){var e=4*(this.width_*t.y+t.x);this._R=this._imageData.data[e],this._G=this._imageData.data[e+1],this._B=this._imageData.data[e+2],this._A=this._imageData.data[e+3]}else this._iniHotColor();this.update()}},{key:"doClick_",value:function(){this._color=this.hotColor,Hi(Yi(i.prototype),"doClick_",this).call(this)}},{key:"hotColor",get:function(){return at.rgbaToColor(this._R,this._G,this._B,this._A)}},{key:"color",get:function(){return this._color},set:function(t){this._setColor(t)}}]),i}(gi),Rn=function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgb(0, 0, 0)";return Ji(this,i),(t=e.call(this,n)).width_=36,t.height_=20,t.canFocus=!1,t.dropDownCount_=16,t.imeMode=Ei,t.dropDownWidth=64,t.addItem(at.Black),t.addItem(at.Red),t.addItem(at.Green),t.addItem(at.Blue),t.addItem(at.Yellow),t.addItem(at.Gray),t.addItem(at.Orange),t.addItem("更多..."),t._listBox.doPaintBackground_=function(e){t._listBoxPaintBackground(e)},t._listBox.doPaintText_=function(e,i,n){t._listBoxPaintText(e,i,n)},setTimeout((function(){t._pad=new bn,t._pad.align=Kt,t._pad.paddingLeft=0,t._pad.paddingTop=0,t._pad.paddingRight=0,t._pad.paddingBottom=0,t._pad.onClick=function(){t._padClick()}}),0),t._popupPadControl=null,t}return Vi(i,[{key:"_listBoxPaintBackground",value:function(t){var e=this._listBox.clientRect();t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this._listBox.borderVisible_&&this._listBox._doPaintBorder(t,e)}},{key:"_listBoxPaintText",value:function(t,e,i){if(!(this._listBox._displayLast<0)){var n=new U,o=this._listBox._getItemRect(this._listBox._displayFirst);o.inFlate(-1,0);for(var r=this._listBox._displayFirst;r<=this._listBox._displayLast;r++)r==this._listBox.items.count-1?(t.brush.color=at.White,n.resetRect(o),t.textOut(o.left+this._listBox.paddingLeft+or.theme.marginSpace,o.top+or.theme.marginSpace,this._listBox._items[r].text)):(t.brush.color=this._listBox._items[r].text,n.resetRect(o),n.inFlate(-1,0),t.fillRect(n)),this._listBox._itemIndex==r&&(t.pen.color=or.theme.borderActiveColor,t.rectangleRect(o)),this._listBox._hotIndex==r&&(t.pen.color=or.theme.borderHotColor,t.rectangleRect(o)),o.offset(0,this._listBox.font.height+or.theme.marginSpaceDouble)}}},{key:"_padClick",value:function(){this._popupPadControl.donePopup(),this._listBox.text=this._pad.color,Hi(Yi(i.prototype),"doSelectedIndexChange_",this).call(this)}},{key:"doDonePopup_",value:function(){this._listBox.itemIndex==this._listBox.items.count-1?this._popupPad():Hi(Yi(i.prototype),"doDonePopup_",this).call(this)}},{key:"_popupPad",value:function(){var t=this;if(null==this._popupPadControl)if(this._pad.color=this.text,this._popupPadControl=new wi,this._popupPadControl.width=this._pad.width,this._popupPadControl.height=this._pad.height,this._pad.parent=this._popupPadControl,this._popupPadControl.onClose=function(){t._popupPadControl=null},this._popupPadControl.onDone=function(){t._listBox.text=t._pad.color},null!=this._popupControl)this._popupPadControl.popup(this._popupControl.right,this._popupControl.top,!1);else{var e=this.clientToScreen(G.Create(0,0));this.popupAlign_==Wt?e.x+=this.paddingLeft-(this.borderVisible_?this.borderWidth_:0):e.x+=this.width-this._popupControl.width,this._popupPadControl.popup(e.x,e.y+this.height,!0)}}},{key:"doSetFocus_",value:function(){}},{key:"showCaret_",value:function(){}},{key:"doPaintSelected_",value:function(t){}},{key:"doPaintBackground_",value:function(t){var e=this.clientRect();e.left=this.paddingLeft,t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this.borderVisible_&&(e.left-=this.borderWidth_,this.doPaintBorder_(t,e)),this._buttonMouseIn&&(this._buttonDown?t.brush.color=or.theme.backgroundDownColor:t.brush.color=or.theme.backgroundHotColor,t.fillRect(this._buttonRect)),this.image.loaded?t.drawImage(this._buttonRect.left,this._buttonRect.top,this.image):or.theme.drawDropDown(t,this._buttonRect),e=this.textArea(),t.brush.color=this.color,t.fillRect(e)}},{key:"doPaint_",value:function(t){}},{key:"doMouseMove_",value:function(t){Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t),this.cursor=oe}},{key:"doMouseUp_",value:function(t){this._buttonDown?Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t):this.doButtonClick_()}},{key:"color",get:function(){return this.text},set:function(t){this.text=t}}]),i}(Cn),_n=function(t){Wi(i,t);var e=ji(i);function i(){return Ji(this,i),e.call(this,"")}return i}(function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._popupControl=null,n.dropDownStyle=!1,n.image=$i.Create(16,16),n.image.onImageLoaded=function(){n.doImageLoaded_()},n._onClick=null,n.onPopup=null,n}return Vi(i,[{key:"doImageLoaded_",value:function(){this.image.left=Math.trunc((or.theme.popupMenuImagePadding-this.image.width)/2),this.image.top=Math.trunc((this.height-this.image.height)/2)}},{key:"_closePopupControl_",value:function(){null!=this._popupControl&&this._popupControl.close(),this.hasSubItem&&this.onPopupClose&&this.onPopupClose()}},{key:"paint",value:function(t){""!=this.image.src&&this.image.paintTo(t,this.image.left,this.top+this.image.top),this.enabled?t.font.color=or.theme.textColor:t.font.color=or.theme.textDisableColor,Hi(Yi(i.prototype),"paint",this).call(this,t)}},{key:"visibleCount",value:function(){for(var t=0,e=0;e2&&void 0!==arguments[2])||arguments[2];null==this._popupControl&&(null!=this.onPopup&&this.onPopup(t,e,n),this.subItems.count>0&&(this._popupControl=new xn(this),this._popupControl.dropDownStyle=this.dropDownStyle,this._popupControl.onClose=function(){i._popupControl=null},this._popupControl.popup(t,e,n)))}},{key:"popupControl",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.clientToScreen(G.Create(0,0));this.popup(i.x,i.y+t.height,e)}},{key:"onClick",get:function(){return this._onClick},set:function(t){this._onClick=t}}]),i}(function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).hasSubItem_=!1,n.text=t,n.subItems=new V,n.enabled=!0,n.visible=!0,n.left=0,n.top=0,n.shortCut=0,n.width=or.theme.popupMenuImagePadding+or.theme.marginSpaceDouble,n.height=or.theme.itemHeight,n}return Vi(i,[{key:"paint",value:function(t){var e;this.isSpliter?(t.pen.width=1,t.pen.color=at.Gray,e=this.top+Math.trunc(this.height/2),t.drawLineDriect(this.left+or.theme.popupMenuImagePadding,e,this.left+this.width-or.theme.marginSpace,e)):(e=this.top+Math.trunc((this.height-t.font.height)/2),t.textOut(this.left+or.theme.popupMenuImagePadding+or.theme.marginSpace,e,this.text),this.hasSubItem_&&or.theme.drawDropRight(t,U.CreateByBounds(this.left+this.width-or.theme.iconSize,this.top,or.theme.iconSize,this.height)))}},{key:"bounds",value:function(){return U.CreateByBounds(this.left,this.top,this.width,this.height)}},{key:"subItemByText",value:function(t){for(var e=0,i=this.subItems.count;e=0?this.items[i]:null}},{key:"getHint_",value:function(){if(this._mouseMoveIndex>=0){var t=this.menuItem.subItems[this._mouseMoveIndex].hint;return or.system.assigned(t)&&""!=t?t:Hi(Yi(i.prototype),"getHint_",this).call(this)}return Hi(Yi(i.prototype),"getHint_",this).call(this)}},{key:"doMouseMove_",value:function(t){Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t);var e=this._getItemIndexAt(t.x,t.y);if(this._mouseMoveIndex!=e){if(this._mouseMoveIndex>=0&&this.menuItem.subItems[this._mouseMoveIndex]._closePopupControl_(),this._mouseMoveIndex=e,this._mouseMoveIndex>=0){var n=this.menuItem.subItems[this._mouseMoveIndex];n.visible&&n.enabled&&n.popup(this.left+this.width,this.top+n.top,!1)}this.update()}}},{key:"doMouseUp_",value:function(t){if(Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),this._mouseMoveIndex>=0){var e=this.menuItem.subItems[this._mouseMoveIndex];e.enabled&&null!=e.onClick&&(e.onClick(),this.donePopup())}}},{key:"doPaintBackground_",value:function(t){if(Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),this._mouseMoveIndex>=0){var e=this.menuItem.subItems[this._mouseMoveIndex];!e.isSpliter&&e.visible&&(e.enabled?t.brush.color=or.theme.backgroundSelectColor:t.brush.color=or.theme.backgroundHotColor,t.fillRect(e.bounds()))}t.pen.width=1,t.pen.color=at.Gray,t.drawLineDriect(or.theme.popupMenuImagePadding,0,or.theme.popupMenuImagePadding,this.height)}},{key:"doPaint_",value:function(t){Hi(Yi(i.prototype),"doPaint_",this).call(this,t),t.font.assign(this.font);for(var e=0,n=this.menuItem.subItems.count;e=0){var t=this.menuItem.subItems[this._mouseMoveIndex].hint;return or.system.assigned(t)&&""!=t?this.menuItem.subItems[this._mouseMoveIndex].bounds():Hi(Yi(i.prototype),"getHintRect",this).call(this)}return Hi(Yi(i.prototype),"getHintRect",this).call(this)}}]),i}(oi),An=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).state_.add(vi.Creating),t.contentHeight_=0,t.contentWidth_=0,t.HScroll_=new mi,t.HScroll_.orientation=Yt,t.HScroll_.align=Xt,t.HScroll_.onScroll=function(){t.viewScroll_()},t.VScroll_=new mi,t.VScroll_.orientation=Jt,t.VScroll_.onScroll=function(){t.viewScroll_()},t.addControl(t.VScroll_),t.addControl(t.HScroll_),t.state_.delete(vi.Creating),t}return Vi(i,[{key:"viewScroll_",value:function(){this.update()}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this.doContentResize_()}},{key:"doAlign_",value:function(){Hi(Yi(i.prototype),"doAlign_",this).call(this),this.VScroll_.visible?this.HScroll_.width=this.width-this.VScroll_.width:this.HScroll_.width=this.width,this.HScroll_.visible?this.VScroll_.height=this.height-this.HScroll_.height:this.VScroll_.height=this.height}},{key:"calcContentSize_",value:function(){this.contentHeight_=0,this.contentWidth_=0}},{key:"doContentResize_",value:function(){this.calcContentSize_(),this.VScroll_.visible=this.contentHeight_>this.height,this.VScroll_.max=this.contentHeight_,this.HScroll_.visible=this.contentWidth_>this.width,this.HScroll_.max=this.contentWidth_,this.HScroll_.visible&&this.contentHeight_+this.HScroll_.height>this.height&&(this.VScroll_.visible=!0,this.VScroll_.max=this.contentHeight_+this.HScroll_.height),this.VScroll_.visible&&this.contentWidth_+this.VScroll_.width>this.width&&(this.HScroll_.visible=!0,this.HScroll_.max=this.contentWidth_+this.VScroll_.width),this.HScroll_.visible?this.VScroll_.visible?this.HScroll_.width=this.width-this.VScroll_.width:this.HScroll_.width=this.width:this.HScroll_.position=0,this.VScroll_.visible?this.HScroll_.visible?this.VScroll_.height=this.height-this.HScroll_.height:this.VScroll_.height=this.height:this.VScroll_.position=0}},{key:"doMouseWheel_",value:function(t){or.keyDownStates[Re]?this.HScroll_.position-=t.delta:this.VScroll_.position-=t.delta}}]),i}(hn),Tn=function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"page";return Ji(this,i),(t=e.call(this))._headerRect_=new U,t._visible=!0,t.text_=n,t.onUpdateText=null,t}return Vi(i,[{key:"doPaintBackground_",value:function(t){}},{key:"updateText",value:function(){null!=this.onUpdateText&&this.onUpdateText(this)}},{key:"text",get:function(){return this.text_},set:function(t){this.text_!=t&&(this.text_=t,this.updateText())}}]),i}(gi),On=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).width=200,t.height=200,t._showCloseButton=!1,t._headerHeight=20,t._headerOffset=0,t._headerVisible=!0,t._activePageIndex=-1,t._hotHeaderIndex=-1,t._hotBtnPageIndex=-1,t.paddingTop=t._headerHeight,t}return Vi(i,[{key:"doPageUpdateHeaderText",value:function(t){t.visible&&(this._formatHeader(t),this.updateRect(U.CreateByBounds(0,0,this.width,this._headerHeight)))}},{key:"_formatHeader",value:function(t){var e=Dt.textWidth(Dt.DefaultFont,t.text);this._showCloseButton&&(e+=or.theme.iconWidth),t._headerRect_.resetBounds(0,0,e+or.theme.marginSpaceDouble,this._headerHeight);for(var i,n=0,o=0;othis.controls.count-1&&(this.pageIndex=this.controls.count-1),Hi(Yi(i.prototype),"doRemoveControl_",this).call(this,t)}},{key:"doPaintBorder_",value:function(t){this._headerVisible?this.borderVisible_&&(this.controls.count>0?(t.pen.color=or.theme.borderColor,t.pen.width=or.theme.borderWidth,t.beginPath(),t.moveTo(0,this._headerHeight),t.lineTo(0,this.height-1),t.lineTo(this.width,this.height-1),t.lineTo(this.width,this._headerHeight),t.paintPath()):Hi(Yi(i.prototype),"doPaintBorder_",this).call(this,t)):Hi(Yi(i.prototype),"doPaintBorder_",this).call(this,t)}},{key:"doPaintPageHeader",value:function(t){var e;t.font.assign(Dt.DefaultFont);for(var i=0;i=0){var e=this.controls[this._activePageIndex];t.save();try{t.translate(e.left,e.top),t.clip(0,0,e.width,e.height),e.paint(t)}finally{t.restore()}}this.borderVisible&&this.doPaintBorder_(t),this._headerVisible&&this.doPaintPageHeader(t)}},{key:"_pageHeaderIndexAt",value:function(t,e){if(this._headerVisible)for(var i=new U,n=0;n2&&void 0!==arguments[2])||arguments[2];if(this._headerVisible&&e=0){var o=this.controls[this._activePageIndex];if(n&&o.enabled)return o}return Hi(Yi(i.prototype),"getControlAt",this).call(this,t,e,n)}},{key:"doMouseDown_",value:function(t){if(this._headerVisible&&t.y=0&&e!=this._activePageIndex&&(this.pageIndex=e)}else Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseMove_",value:function(t){if(this._headerVisible){var e=!1,n=-1,o=this._pageHeaderIndexAt(t.x,t.y);if(o!=this._hotHeaderIndex&&(this._hotHeaderIndex=o,e=!0),this._hotHeaderIndex>=0){var r=this.controls[this._hotHeaderIndex];t.x>r._headerRect_.right-or.theme.iconWidth&&r._headerRect_.pointInAt(t.x,t.y)&&(n=this._hotHeaderIndex)}this._hotBtnPageIndex!=n&&(this._hotBtnPageIndex=n,e=!0),e&&this.updateRect(U.CreateByBounds(0,0,this.width,this._headerHeight))}Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){if(this._showCloseButton&&this._headerVisible&&t.y=0&&t.x>e._headerRect_.right-or.theme.iconWidth&&t.x=0&&t=0&&this._activePageIndex=0?this.controls[this._activePageIndex]:null}},{key:"headerVisible",get:function(){return this._headerVisible},set:function(t){this._headerVisible!=t&&(this._headerVisible=t,this.paddingTop=t?this._headerHeight:0)}},{key:"pageCount",get:function(){return this.controls.count}},{key:"pages",get:function(){return this.controls}},{key:"showCloseButton",get:function(){return this._showCloseButton},set:function(t){this._showCloseButton!=t&&(this._showCloseButton=t,this._formatAllHeader(),this.updateRect(U.CreateByBounds(0,0,this.width,this._headerHeight)))}}]),i}(hn),Nn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).onAdded=function(t){t.onUpdate=function(){null!=n.onUpdate&&n.onUpdate()}},n.initCol(t),n}return Vi(i,[{key:"createNewCell",value:function(){return new Bn}},{key:"initCol",value:function(t){var e;this.clear();for(var i=0;i0&&void 0!==arguments[0])||arguments[0];this.FEditRow>=0&&this.FEditRowthis.fixRowCount_-1&&this.col_>=0&&e==this.row_&&n==this.col_){this.FInnerEdit_.text=this.rows[this.row_][this.col_].value;var o=this.getCellRect(this.row_,this.col_);o.left-=or.theme.borderWidth,o.top-=or.theme.borderWidth,this.FInnerEdit_.left=o.left,this.FInnerEdit_.top=o.top,this.FInnerEdit_.width_=o.width,this.FInnerEdit_.height_=o.height,this.FInnerEdit_.visible=!0,this.FEditRow=e,this.FEditCol=n;var r=new ei;r.assign(t),r.x-=this.FInnerEdit_.left,r.y-=this.FInnerEdit_.top,this.FInnerEdit_.mouseDown(r)}}}},{key:"doMouseUp_",value:function(t){if(Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),!this.readOnly&&this.FInnerEdit_.visible_){var e=new ei;e.assign(t),e.x-=this.FInnerEdit_.left,e.y-=this.FInnerEdit_.top,this.FInnerEdit_.mouseUp(e)}}}]),i}(function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Ji(this,i),(t=e.call(this)).state_.add(vi.Creating),t.canFocus=!0,t.defaultRowHeight=22,t.defaultColWidth=30,t._colWidths=new Array,t.row_=-1,t.col_=-1,t.width_=200,t.height_=200,t.leftOffset_=0,t.topOffset_=0,t.fixRowCount_=0,t.FRowDispRange=null,t.FColDispRange=null,t.option=new En,t.rows=new V,t.rows.onAdded=function(e){e.onUpdate=function(){t.update()},t.doContentResize_()},t.rows.onRemoved=function(e){t.doContentResize_()},t.initRowCol(n,o),t.state_.delete(vi.Creating),t}return Vi(i,[{key:"_calcDisplayRow",value:function(){for(var t=0,e=this.rows.count-1,i=0,n=0;nthis.VScroll_.position){t=n,i-=this.getRowHeight_(n);break}for(var o=t;othis.height){e=o;break}return{first:t,last:e}}},{key:"_calcDisplayCol",value:function(){for(var t=0,e=this._colWidths.length-1,i=0,n=0;nthis.HScroll_.position){t=n,i-=this._colWidths[n];break}for(var o=t;othis.width){e=o;break}return{first:t,last:e}}},{key:"_calcDisplayRowAndCol",value:function(){this.FRowDispRange=this._calcDisplayRow(),this.FColDispRange=this._calcDisplayCol(),this.topOffset_=0,this.leftOffset_=0;for(var t=0;tthis._colWidths.length-1&&(this.col_=-1),this.row_>this.rows.count-1&&(this.row_=-1),this.contentHeight_=0;for(var t=0;t0||(Hi(Yi(i.prototype),"doContentResize_",this).call(this),this._calcDisplayRowAndCol(),this.update())}},{key:"endUpdate",value:function(){Hi(Yi(i.prototype),"doContentResize_",this).call(this),this._calcDisplayRowAndCol(),Hi(Yi(i.prototype),"endUpdate",this).call(this)}},{key:"getRowHeight_",value:function(t){return this.defaultRowHeight}},{key:"getCellWidth_",value:function(t,e){return this._colWidths[e]}},{key:"doKeyDown_",value:function(t){Hi(Yi(i.prototype),"doKeyDown_",this).call(this,t),t.keyCode==Le?this.row_0&&this.row_0&&(this.fixRowCount_>0&&this.rows.count>this.fixRowCount_?this.row=this.fixRowCount_:this.row=0):t.keyCode==Ee&&this.rows.count>0&&(this.row_>0?this.fixRowCount_>0?this.row_>this.fixRowCount_?this.row=this.row_-1:this.row=this.rows.count-1:this.row_>0&&(this.row=this.row_-1):this.row=this.rows.count-1)}},{key:"doMouseDown_",value:function(t){if(Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),null==this.getControlAt(t.x,t.y,!0)){var e=this.getCellAt(t.x,t.y);this.row_==e.row&&this.col_==e.col||(this.row_=e.row,this.col_=e.col,this.update())}}},{key:"doRowPaint_",value:function(t,e,i){return null!=this.onRowPaint&&this.onRowPaint(t,e,i)}},{key:"doCellPaint_",value:function(t,e,i,n){if(null==this.onCellPaint)return!1;t.save();try{return this.onCellPaint(t,e,i,n)}finally{t.restore()}}},{key:"doPaint_",value:function(t){if(0!=this.rows.count){var e,n,o=0,r=0;t.font.assign(Dt.DefaultFont),t.pen.width=or.theme.borderWidth,t.pen.color=or.theme.borderColor;var s=new U;if(this.fixRowCount_){r=0,t.brush.color=or.theme.backgroundDownColor;for(var a=0;a0&&(s.resetBounds(o,r,e,n),t.fillRect(s),this.doCellPaint_(t,s,a,l)||this.rows[a][l].paintTo(t,s),s.left-=or.theme.borderWidth,s.top-=or.theme.borderWidth,t.rectangleRect(s),o+=e);r+=n}}this.HScroll_.visible&&this.VScroll_.visible&&(t.brush.color=or.theme.backgroundStaticColor,t.fillBounds(this.VScroll_.left,this.HScroll_.top,this.VScroll_.width,this.HScroll_.height)),t.save();try{t.clip(this.borderVisible?or.theme.borderWidth:0,r,this.VScroll_.visible?this.width-this.VScroll_.width:this.width-or.theme.borderWidth,this.HScroll_.visible?this.height-r-this.HScroll_.height:this.height-r-or.theme.borderWidth),o=this.leftOffset_,r=this.topOffset_;for(var h=this.FRowDispRange.first;h<=this.FRowDispRange.last;h++){n=this.getRowHeight_(h),o=this.leftOffset_,s.resetBounds(o,r,this.width,n),this.doRowPaint_(t,s,h)||(t.brush.color=or.theme.backgroundContentColor,t.fillRect(s));for(var c=this.FColDispRange.first;c<=this.FColDispRange.last;c++)(e=this.getCellWidth_(h,c))>0&&(s.resetBounds(o,r,e,n),h==this.row_&&(this.option.rowSelect||c==this.col_)&&(t.brush.color=or.theme.backgroundSelectColor,t.fillRect(s)),this.doCellPaint_(t,s,h,c)||this.rows[h][c].paintTo(t,s),s.left-=or.theme.borderWidth,s.top-=or.theme.borderWidth,t.rectangleRect(s),o+=e);r+=n}}finally{t.restore()}Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}}},{key:"doCreateNewRow_",value:function(t){return new Nn(t)}},{key:"initRowCol",value:function(t,e){var i;this.rows.clear();for(var n=0;nt){this.beginUpdate();try{for(;this.rows.count>t;)this.rows.removeAt(this.rows.count-1)}finally{this.endUpdate()}}else{var e;this.beginUpdate();try{for(;this.rows.countt)for(;this._colWidths.length>t;){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:1;if(!(t=0&&t=0&&t0&&void 0!==arguments[0]?arguments[0]:"";return Ji(this,i),(t=e.call(this)).text_=n,t.level=0,t._expand=!1,t.parent=null,t.object=null,t.onChange=null,t.onPaint=null,t.childs=new V,t.childs.onAdded=function(e){e.parent=Ki(t),e.level=t.level+1,e.onChange=function(e){t.doChange_(e)},e.onPaint=function(e,i,n,o){t.doPaint_(e,i,n,o)},t.doChange_()},t.childs.onRemoved=function(e){t.doChange_(e)},t}return Vi(i,[{key:"doChange_",value:function(t){null!=this.onChange&&this.onChange(t)}},{key:"doPaint_",value:function(t,e,i,n){null!=this.onPaint&&this.onPaint(t,e,i,n)}},{key:"setText",value:function(t){this.text_!=t&&(this.text_=t,this.doChange_())}},{key:"getNodeAt",value:function(t,e,i){if(e>i&&e<=i+or.theme.itemHeight)return{node:this,top:i+or.theme.itemHeight};if(i+=or.theme.itemHeight,this._expand)for(var n,o=0,r=this.childCount;o0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=new i(t);return n.object=e,this.childs.add(n),n}},{key:"getHeight",value:function(){var t=or.theme.itemHeight;if(this._expand)for(var e=0,i=this.childCount;e0&&this._expand!=t&&(this._expand=t,this.doChange_())}}]),i}(L),Gn=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).state_.add(vi.Creating),t.canFocus=!0,t.selectNode=null,t.nodes=new V,t.nodes.onAdded=function(e){e.parent=null,e.level=0,e.onPaint=function(e,i,n,o){t._doNodePaint(e,i,n,o)},e.onChange=function(e){t._doNodeChange(e)},t.doContentResize_()},t.nodes.onRemoved=function(e){t.doContentResize_()},t.width=200,t.height=200,t.onNodePaint=null,t.onCollaps=null,t.onExpand=null,t.onSelectChanged=null,t.state_.delete(vi.Creating),t}return Vi(i,[{key:"_doNodePaint",value:function(t,e,i,n){n+or.theme.itemHeight<0||n>this.height||(e===this.selectNode&&(t.brush.color=or.theme.backgroundSelectColor,t.fillBounds(0,n,this.width,or.theme.itemHeight)),e.childCount>0&&(e._expand?t.drawImage(i+2,n+2,or.theme.expandImage):t.drawImage(i+2,n+2,or.theme.foldImage)),null!=this.onNodePaint&&this.onNodePaint(t,e,i,n)||t.textOut(i+or.theme.iconWidth,n+3,e.text))}},{key:"_doNodeChange",value:function(t){this.doContentResize_()}},{key:"calcContentSize_",value:function(){Hi(Yi(i.prototype),"calcContentSize_",this).call(this);for(var t=0,e=this.nodes.count;te.level*or.theme.iconWidth&&t.x<(e.level+1)*or.theme.iconWidth&&this.expandSwitch(e),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doDblClick_",value:function(t){null!=this.selectNode&&this.expandSwitch(this.selectNode),Hi(Yi(i.prototype),"doDblClick_",this).call(this,t)}},{key:"expandSwitch",value:function(t){t.expand&&null!=this.onCollaps?this.onCollaps(t):t.expand||null==this.onExpand||this.onExpand(t),t.expand=!t.expand}},{key:"getNodeAt",value:function(t,e){var i=this.borderVisible?or.theme.borderWidth:0;i-=this.VScroll_.position;for(var n=null,o=0,r=this.nodes.count;o0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=new Ln(t);return i.object=e,this.nodes.add(i),i}},{key:"deleteNode",value:function(t){null!=t&&(null!=t.parent?t.parent.deleteNode(t):this.nodes.remove(t),this.selectNode=null)}}]),i}(An);function Hn(t){return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Un(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vn(t,e){for(var i=0;i0&&t.fillBounds(0,0,this.paddingLeft,this.height),this.paddingTop&&t.fillBounds(0,0,this.width,this.paddingTop),this.paddingRight>0&&t.fillBounds(this.width-this.paddingRight,0,this.paddingRight,this.height),this.paddingBottom>0&&t.fillBounds(0,this.height-this.paddingBottom,this.width,this.paddingBottom)}},{key:"_checkParent",value:function(){null==this.parent&&or.application.addForm(this)}},{key:"doVisibleChange_",value:function(t){t||this.showState==eo||(this.showState=Qn),zn(Zn(i.prototype),"doVisibleChange_",this).call(this,t)}},{key:"doCloseQuery",value:function(){return null==this.onCloseQuery||this.onCloseQuery()}},{key:"doClose_",value:function(){this.doCloseQuery()&&(this.visible=!1,this.showState=qn,this.onClose(),this.modalResult==no&&null!=this._modalOkEvent&&this._modalOkEvent(this),this.modalResult=io,this.closeFree&&this.dispose())}},{key:"hide",value:function(){this.visible=!1}},{key:"show",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$n;this.visible_||(this._checkParent(),this.showState=t,this.visible=!0)}},{key:"showNoActive",value:function(){this.show(to)}},{key:"showModal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._modalOkEvent=t,this.modalResult=io,this.show(eo)}},{key:"moveCenter",value:function(){this.left=Math.trunc((or.width-this.width)/2),this.top=Math.trunc((or.height-this.height)/2)}},{key:"close",value:function(){this.doClose_()}},{key:"onClose",value:function(){}}]),i}(gi),ro=function(t){jn(i,t);var e=Kn(i);function i(t,n){var o,r,s;return Un(this,i),(s=e.call(this,t,n)).canFocus=!1,s.captionBar=new cn,s.captionBar.transparent=!0,s.captionBar.align=zt,s.captionBar.paddingLeft=5,s.captionBar.paddingRight=5,s.captionBar.width=t,s.lblCaption=new en("form"+(or.application.forms.count+1).toString()),s.lblCaption.align=Wt,s.captionBar.addControl(s.lblCaption),s.btnClose=new nn("关闭"),s.btnClose.autoWidth=!0,s.btnClose.align=jt,s.btnClose.onClick=function(){s.close()},s.captionBar.addControl(s.btnClose),zn((o=Jn(s),Zn(i.prototype)),"addControl",o).call(o,s.captionBar),s.clientArea=new hn,s.clientArea.borderVisible=!1,s.clientArea.transparent=!0,s.clientArea.align=Kt,s.clientArea.onPaint=function(t){s.doClientPaint_(t)},zn((r=Jn(s),Zn(i.prototype)),"addControl",r).call(r,s.clientArea),s}return Wn(i,[{key:"doClientPaint_",value:function(t){}},{key:"doGetPopupMenu",value:function(){return this.clientArea.popupMenu}},{key:"doSetPopupMenu",value:function(t){this.clientArea.popupMenu=t}},{key:"doSetColor_",value:function(){this.clientArea.color=this.color}},{key:"insertControl",value:function(t,e){this.clientArea.insertControl(t,e)}},{key:"addControl",value:function(t){this.clientArea.addControl(t)}},{key:"caption",get:function(){return this.lblCaption.text},set:function(t){this.lblCaption.text=t}}]),i}(oo),so=function(t){jn(i,t);var e=Kn(i);function i(){var t;return Un(this,i),(t=e.call(this,200,120)).moveCenter(),t}return Wn(i,[{key:"doPaintBackground_",value:function(t){t.brush.color=or.theme.backgroundStaticColor,t.fillRectShadow(this.clientRect(),or.theme.shadow)}}]),i}(ro),ao=function(t){jn(i,t);var e=Kn(i);function i(){var t;return Un(this,i),(t=e.call(this))._reset(),t._onExecute=null,t}return Wn(i,[{key:"_reset",value:function(){this._fileName="",this._firstFile=null,this._files=null}},{key:"execute",value:function(t){var e=this;this._reset();var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("style","visibility:hidden"),i.setAttribute("accept",null!=t?t:""),i.onchange=function(t){i.files.length>0&&(e._fileName=i.value,e._firstFile=i.files[0],e._files=i.files,null!=e._onExecute&&e._onExecute())},document.body.appendChild(i);try{i.click()}finally{document.body.removeChild(i)}}},{key:"fileName",get:function(){return this._fileName}},{key:"firstFile",get:function(){return this._firstFile}},{key:"files",get:function(){return this._files}},{key:"onExecute",get:function(){return this._onExecute},set:function(t){this._onExecute=t}}],[{key:"execute",value:function(t,e){var n=new i;n.onExecute=function(){e(n)},n.execute(t)}}]),i}(so),lo=1,ho=2,co=4,uo=8,fo=16,mo=32,yo=64,po=128,So=256,vo=512,Fo=function(t){jn(i,t);var e=Kn(i);function i(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Un(this,i),(o=e.call(this)).caption=t,o.text=n,o.dlgBtn=null;for(var s=n.split(or.system.lineBreak),a=0,l=0,h=0;h2&&void 0!==arguments[2]&&arguments[2];if(t.brush.color=this.ShadowColor,i){t.save();try{t.clip(e.left-this.shadow,e.top,e.width+this.shadow+this.shadow,e.bottom+this.shadow),t.fillRectShadow(e,this.shadow)}finally{t.restore()}}else t.fillRectShadow(e,this.shadow)}},{key:"path",get:function(){return this._path},set:function(t){this._path!=t&&(this._path=t,this.expandImage.src=this.path+"image/minus.png",this.foldImage.src=this.path+"image/plus.png",this.closeImage.src=this.path+"image/close.png")}}])&&Io(e.prototype,i),n&&Io(e,n),t}();function wo(t){return(wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Co(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ko(t,e){for(var i=0;i=0&&(this._formats.delete(e),this._datas.delete(e))}},{key:"hasFormat",value:function(t){return this._getFormatIndex(t)>=0}},{key:"clear",value:function(){this._formats.clear(),this._datas.clear()}},{key:"registerFormat",value:function(){return this._customFormatID++}},{key:"getData",value:function(t){var e=this._getFormatIndex(t);return e>=0?this._datas[e]:null}},{key:"getAnsiText",value:function(){var t=this._getFormatIndex(xo);return t>=0?_.getString(this._datas[t]):null}},{key:"getUnicodeText",value:function(){var t=this._getFormatIndex(Ao);return t>=0?A.getString(this._datas[t]):null}},{key:"getText",value:function(){var t=this.getUnicodeText();return null==t&&(t=this.getAnsiText()),t}},{key:"setText",value:function(t){this.setFormatData(Ao,A.getBytes(t))}},{key:"setEncodeText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.Utf16;e==F.Ansi?this.setFormatData(xo,_.getBytes(t)):this.setFormatData(Ao,A.getBytes(t))}},{key:"getEncodeText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F.Utf16;switch(t){case F.Ansi:return this.getAnsiText();case F.Unicode:return this.getUnicodeText();default:var e=this._getFormatIndex(Ao);return x.getString(this._datas[e])}}},{key:"toBrowerClipboard",value:function(t){var e=document.createElement("input");try{document.body.appendChild(e),e.setAttribute("value",t),e.setAttribute("readonly","readonly"),e.select(),document.execCommand("copy")}finally{document.body.removeChild(e)}}},{key:"fromBrowerClipboard",value:function(){}}]),i}(L),Lo=function(){function t(){Co(this,t)}return Po(t,[{key:"removeItem",value:function(t){localStorage.removeItem(t)}},{key:"setString",value:function(t,e){localStorage.setItem(t,e)}},{key:"getString",value:function(t){return localStorage.getItem(t)}},{key:"setStream",value:function(t,e){this.setString(t,e.buffer.toString())}},{key:"getStream",value:function(t){for(var e=this.getString(t).split(","),i=new K,n=0,o=e.length;n=0;t--)if(this.forms[t].visible)return this.forms[t];return null}},{key:"_showForm",value:function(t){this.beginUpdate();try{null!=this._activeForm&&this._activeForm.deactivate(),this._mouseMoveForm=t,this._activeForm=t,t.activate()}finally{this.endUpdate()}}},{key:"_hideForm",value:function(t){this.beginUpdate();try{null!=this._activeForm&&this._activeForm.deactivate(),this._activeForm=this._getActiveForm(),null!=this._activeForm&&this._activeForm.activate()}finally{this.endUpdate()}}},{key:"_resize_",value:function(){this.mainForm&&(this.mainForm.width=or.width,this.mainForm.height=or.height)}},{key:"setFocusControl_",value:function(t,e){}},{key:"killFocusControl_",value:function(t){or._killFocusControl_(this,t)}},{key:"hclSelectControl",value:function(t){this.hclDesignControl=t!==this?t:null,or.update()}},{key:"controlVisible_",value:function(t,e){e?this._showForm(t):this._hideForm(t)}},{key:"doRequestFocus_",value:function(){return!0}},{key:"beginUpdate",value:function(){this._updateCount++}},{key:"endUpdate",value:function(){this._updateCount>0&&(this._updateCount--,0==this._updateCount&&this.update())}},{key:"addControl",value:function(t){this.addForm(t)}},{key:"addForm",value:function(t){t.isClass(oo)?(this.forms.add(t),t.added_(this)):or.exception("application只能添加TCustomForm的子类!")}},{key:"removeControl",value:function(t){this.beginUpdate();try{this.forms.remove(t),t.removed_(),this._activeForm=this._getActiveForm(),null!=this._activeForm&&this._activeForm.activate()}finally{this.endUpdate()}}},{key:"getFormAt",value:function(t,e){for(var i=null,n=this.forms.count-1;n>=0;n--)if((i=this.forms[n]).visible&&i.bounds().pointInAt(t,e))return i;return null}},{key:"getControlAtPos",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getFormAt(t,e);return null!=n?(t-=n.left,e-=n.top,n.getControlAtPos(t,e,i)):null}},{key:"pointAtDesignControl",value:function(t,e){if(null!=this.hclDesignControl){var i=this.hclDesignControl.clientToScreen(G.Create(0,0)),n=this.hclDesignControl.clientRect();if(n.offset(i.x,i.y),n.pointInAt(t,e))return!0}return!1}},{key:"removeForm",value:function(t){this.removeControl(t)}},{key:"setCapture",value:function(t){this._captureControl=t}},{key:"releaseCapture",value:function(){this._captureControl=null}},{key:"clientToScreen",value:function(t){return t}},{key:"mouseWheel",value:function(t){this._activeForm=this._mouseMoveForm;var e=new ei;e.assign(t),e.x-=this._mouseMoveForm.left,e.y-=this._mouseMoveForm.top,this._mouseMoveForm.mouseWheel(e)}},{key:"mouseDown",value:function(t){if(this._activeForm=this._mouseMoveForm,this._mouseMoveForm){var e=new ei;e.assign(t),e.x-=this._mouseMoveForm.left,e.y-=this._mouseMoveForm.top,this._mouseMoveForm.mouseDown(e)}if(or.design&&this.pointAtDesignControl(t.x,t.y))return this.hclDesignPt.reset(t.x,t.y),this.hclDesignDown=t.button==ee,void(null!=this._activeForm&&this._activeForm.deactivate())}},{key:"doMouseMoveFromChange",value:function(t){this._mouseMoveForm!==t&&(null!==this._mouseMoveForm&&this._mouseMoveForm.mouseLeave(),this._mouseMoveForm=t,null!==this._mouseMoveForm&&this._mouseMoveForm.mouseEnter())}},{key:"doFormMouseMove",value:function(t){for(var e=null,i=this.forms.count-1;i>=0;i--)if((e=this.forms[i]).visible){if(e.showState==eo)return this.doMouseMoveFromChange(e),t.x-=e.left,t.y-=e.top,void e.mouseMove(t);if(e.bounds().pointInAt(t.x,t.y))return this.doMouseMoveFromChange(e),t.x-=e.left,t.y-=e.top,void e.mouseMove(t)}}},{key:"doCaptureMouseMove",value:function(t){this.doMouseMoveFromChange(this._captureControl);var e=this._captureControl.clientToScreen(G.Create(0,0));t.x-=e.x,t.y-=e.y,this._captureControl.mouseMove(t)}},{key:"mouseMove",value:function(t){if(or.design){if(this.hclDesignDown)return this.hclDesignControl.left+=t.x-this.hclDesignPt.x,this.hclDesignControl.top+=t.y-this.hclDesignPt.y,void this.hclDesignPt.reset(t.x,t.y);this.pointAtDesignControl(t.x,t.y)}null!=this._captureControl?this.doCaptureMouseMove(t):this.doFormMouseMove(t)}},{key:"doCaptureMouseUp",value:function(t){var e=this._captureControl.clientToScreen(G.Create(0,0));t.x-=e.x,t.y-=e.y,this._captureControl.mouseUp(t)}},{key:"doMouseUp",value:function(t){if(null!=this._activeForm)return t.x-=this._activeForm.left,t.y-=this._activeForm.top,void this._activeForm.mouseUp(t);this._mouseMoveForm&&(t.x-=this._mouseMoveForm.left,t.y-=this._mouseMoveForm.top,this._mouseMoveForm.mouseUp(t))}},{key:"mouseUp",value:function(t){or.design&&(this.hclDesignDown=!1,this.pointAtDesignControl(t.x,t.y))||(null!=this._captureControl?this.doCaptureMouseUp(t):this.doMouseUp(t))}},{key:"mouseEnter",value:function(t){null!=this._activeForm&&this._activeForm.mouseEnter()}},{key:"mouseLeave",value:function(t){null!=this._activeForm&&this._activeForm.mouseLeave()}},{key:"dblClick",value:function(t){if(null!=this._activeForm){var e=new ei;e.assign(t),e.x-=this._activeForm.left,e.y-=this._activeForm.top,this._activeForm.dblClick(e)}}},{key:"keyDown",value:function(t){if(or.design&&null!=this.hclDesignControl)switch(t.keyCode){case Be:return void this.hclDesignControl.left--;case Ee:return void this.hclDesignControl.top--;case Me:return void this.hclDesignControl.left++;case Le:return void this.hclDesignControl.top++;case Ae:return void this.hclSelectControl(this.hclDesignControl.parent)}null!=this._activeForm?this._activeForm.keyDown(t):this.mainForm.keyDown(t)}},{key:"keyPress",value:function(t){null!=this._activeForm?this._activeForm.keyPress(t):this.mainForm.keyPress(t)}},{key:"keyUp",value:function(t){null!=this._activeForm?this._activeForm.keyUp(t):this.mainForm.keyUp(t)}},{key:"copy",value:function(t){null!=this._activeForm?this._activeForm.copy(t):this.mainForm.copy(t)}},{key:"cut",value:function(t){null!=this._activeForm?this._activeForm.cut(t):this.mainForm.cut(t)}},{key:"paste",value:function(t){null!=this._activeForm?this._activeForm.paste(t):this.mainForm.paste(t)}},{key:"update",value:function(){this.updateRect(U.CreateByBounds(0,0,or.width,or.height))}},{key:"updateRect",value:function(t){this._updateCount>0||or.updateRect(t)}},{key:"createCaret",value:function(t,e,i,n){or.__createCaret(t,e,i,n)}},{key:"setCaretPos",value:function(t,e){or._setCaretPos_(t,e)}},{key:"setCursorBy",value:function(t){or._setCursorBy_(t)}},{key:"showCaret",value:function(t){or._showCaret_(t)}},{key:"hideCaret",value:function(t){or._hideCaret_(t)}},{key:"destroyCaret",value:function(t){or._destroyCaret_(t)}},{key:"trackPopupControl",value:function(t,e){or._trackPopupControl_(t,e)}},{key:"closePopupControl",value:function(t){or._closePopupControl_(t)}},{key:"paint",value:function(t){if(0!==this.forms.count&&!(this._updateCount>0)){for(var e=null,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.forms.count-1;n>=0;n--)this.forms[n].broadcast(t,e,i)}},{key:"run",value:function(){or.applicationRun(),this._runing=!0,this.mainForm&&this.mainForm.show()}},{key:"runing",get:function(){return this._runing}}])&&Ho(e.prototype,i),n&&Ho(e,n),r}(L);function Xo(t,e){for(var i=0;i0&&void 0!==arguments[0])||arguments[0];return Yo(this,i),(t=e.call(this,n)).rect=U.CreateByBounds(0,0,300,20),t}return i}(V),nr=function(t){Jo(r,t);var e,i,n,o=qo(r);function r(){var t;return Yo(this,r),(t=o.call(this)).debug=!1,t.meaChr=!1,t.brower=t.__GetBrowerType(),t.system=new C,t.ime=new Li,t.clipboard=new Mo,t.localStorage=new Lo,t.theme=new go,t.theme.onImageLoad=function(){t.update()},t._curApplication=null,t._updateCount=0,t._handleSeq=1e3,t._cursorPos=new G,t._cursor=oe,t._cursorControl=null,t._caret=new ti,t._idle=!1,t._idleInterval=new Ti(500),t._idleInterval.loop=!0,t._idleInterval.onExecute=function(){t._doIdle()},t._idleInterval.enabled=!0,t.keyDownStates=new Array(255),t.width_=854,t.height_=400,t.left_=t._getAdjustLeft(),t.top_=0,t.design_=!1,t._focus=!1,t._mouseIn=!1,t._horizontalCenter=!0,t._autoWidth=!1,t._autoHeight=!0,t._focusLayer=null,t._captureLayer=null,t._mouseMoveLayer=null,t._capturePopupControl=null,t._mouseMovePopupControl=null,t._waitList=new ir,t._waitList.onAdded=function(e){t.update()},t._waitList.onRemoved=function(){t.update()},t._applicationLayer=new V,t._popupLayer=new V,t._popupLayer.onAdded=function(e){t.update()},t._popupLayer.onRemoved=function(e){e.clear(),t.update()},t.__windowKeyDown=function(e){t.windowKeyDown_(e)},t.__windowKeyPress=function(e){t.windowKeyPress_(e)},t.__windowKeyUp=function(e){t.windowKeyUp_(e)},t.__windowResize=function(e){t.windowResize_(e)},t.__windowFocus=function(e){t.windowFocus_(e)},t.__windowFocuOut=function(e){t.windowFocusOut_(e)},t.__windowMouseMove=function(e){t.windowMouseMove_(e)},t.__windowMouseDown=function(e){t.windowMouseDown_(e)},t.__windowMouseWheel=function(e){e.target===t._hclH5Canvas&&t._mouseWheel(e)},t.__windowLoad=function(e){t.windowLoad_(e)},t.__windowDocVisibilitychange=function(e){t.windowDocVisibilitychange_(e)},t.__windowDocCopy=function(e){t.windowDocCopy_(e)},t.__windowDocCut=function(e){t.windowDocCut_(e)},t.__windowDocPaste=function(e){t.windowDocPaste_(e)},t._hoverHintInfo=new Oi,t._scale=1,t._hclH5Canvas=null,t._hclCanvas=null,t._appH5Canvas=null,t._appCanvas=null,t._popupH5Canvas=null,t._popupCanvas=null,t.parentElement=null,t.textMetrics=new V,t}return e=r,n=[{key:"createInstance",value:function(){or||(or=new r)}},{key:"disposeInstance",value:function(){or&&(or.dispose(),or=null)}}],(i=[{key:"textMetricsIndexOf",value:function(t,e,i){for(var n=null,o=0;o=0?tr.FireFox:t.indexOf("Chrome")>=0?tr.Chrome:t.indexOf("Opera")>=0?tr.Opera:t.indexOf("Safari")>=0?tr.Safari:void 0}},{key:"__createCaret",value:function(t,e,i,n){if(this._resetCaret_(),this._caret.reset(),this._caret.control=t,this._focusLayer=this._applicationLayer,this._popupLayer.count>0)for(var o=this._caret.control.parent;null!=o;){if(o.isClass(wi)){this._focusLayer=this._popupLayer;break}o=o.parent}this._caret.image=e,i>0&&(this._caret.width=i),n>t.height?this._caret.height=t.height:this._caret.height=n}},{key:"_setCaretPos_",value:function(t,e){if(null!=this._caret.control){this._resetCaret_();var i=this._caret.control.clientToScreenAt(0,0);this._caret.left=i.x+t,this._caret.top=i.y+e,this._caret.controlScreenRect.resetBounds(i.x,i.y,this._caret.control.width,this._caret.control.height)}}},{key:"_showCaret_",value:function(t){this._focus&&null!=this._caret.control&&(this._caret.visible=!0)}},{key:"_hideCaret_",value:function(t){this._caret.control==t&&this._caret.visible&&(this._resetCaret_(),this._caret.visible=!1)}},{key:"_destroyCaret_",value:function(t){this._caret.control==t&&(this._hideCaret_(t),this._caret.control=null)}},{key:"_paintCaretShan",value:function(){this._hclCanvas.brush.color=this._caret.color,this._hclCanvas.fillRect(this._caret.rect.intersection(this._caret.controlScreenRect)),this._popupLayer.count>0&&this._focusLayer!=this._popupLayer&&this._hclCanvas.bitBlt(this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2,this._popupCanvas,this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2)}},{key:"_doCaretShan_",value:function(){this._caret.shan=!1,this._paintCaretShan(),this._hoverHintInfo.visible&&this._hoverHintInfo.rect.isIntersect(this._caret.rect)&&this._paintHintLayer()}},{key:"_paintCaretShuo",value:function(){this._hclCanvas.bitBlt(this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2,this._appCanvas,this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2),this._popupLayer.count>0&&this._focusLayer!=this._popupLayer&&this._hclCanvas.bitBlt(this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2,this._popupCanvas,this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2)}},{key:"_doCaretShuo_",value:function(){this._caret.shan=!0,this._paintCaretShuo(),this._hoverHintInfo.visible&&this._hoverHintInfo.rect.isIntersect(this._caret.rect)&&this._paintHintLayer()}},{key:"_resetCaret_",value:function(){this._caret.visible&&!this._caret.shan&&this._doCaretShuo_()}},{key:"_doCaretTimer_",value:function(){this._caret.visible&&(this._caret.shan?this._doCaretShan_():this._doCaretShuo_())}},{key:"_closeHoverHint",value:function(){this._hoverHintInfo.visible&&(this._hoverHintInfo.visible=!1,this.updateRect(this._hoverHintInfo.rect))}},{key:"showHoverHint",value:function(t){if(this._hoverHintInfo.visible){if(this._hoverHintInfo.control===t)return;this._hoverHintInfo.visible=!1,this.updateRect(this._hoverHintInfo.rect)}if(this._hoverHintInfo.control=t,this._hoverHintInfo.text=t.hint,""!=this._hoverHintInfo.text){if(this._hoverHintInfo.rect=t.getHintRect(),this._hoverHintInfo.rect){var e=t.clientToScreenAt(0,0);this._hoverHintInfo.rect.bottom+this._hoverHintInfo.rect.height+e.y+this.theme.marginSpace>this.height_?this._hoverHintInfo.rect.offset(e.x,e.y-this._hoverHintInfo.rect.height-this.theme.marginSpace):this._hoverHintInfo.rect.offset(e.x,e.y+this._hoverHintInfo.rect.height+this.theme.marginSpace),this._hoverHintInfo.rect.resetSize(this.theme.getHoverHintSize(this._hoverHintInfo.text)),this._hoverHintInfo.rect.left<0?e.x=this._hoverHintInfo.rect.left:this._hoverHintInfo.rect.right>this.width_?e.x=this._hoverHintInfo.rect.right-this.width_:e.x=0,this._hoverHintInfo.rect.top<0?e.y=this._hoverHintInfo.rect.top:this._hoverHintInfo.rect.bottom>this.height_?e.y=this._hoverHintInfo.rect.bottom-this.height_:e.y=0,this._hoverHintInfo.rect.offset(-e.x,-e.y)}else{var i=this.theme.getHoverHintSize(this._hoverHintInfo.text);this._hoverHintInfo.rect=U.CreateByBounds(this.cursorPos.x,this.cursorPos.y+this.theme.itemHeight,i.width,i.height)}this._hoverHintInfo.visible=!0,this.updateRect(this._hoverHintInfo.rect)}}},{key:"_doIdle",value:function(){this._doCaretTimer_(),this._idle&&this._mouseIn?null!=this._cursorControl&&this.showHoverHint(this._cursorControl):this._idle=!0}},{key:"_cancelIdle",value:function(){this._idle=!1,this._closeHoverHint()}},{key:"_setCursorBy_",value:function(t){this._getControlAtPos(this._cursorPos.x,this._cursorPos.y)===t&&(this._cursorControl=t,this._cursor!=t.cursor&&(this._cursor=t.cursor,this._hclH5Canvas.style.cursor=this.theme.getCSSCursor(this._cursor)))}},{key:"_isPreventKeyDown",value:function(t){return t==Pe||t==Ge||t==Be||t==Me||t==Ee||t==Le||t==be||t==Ne||t==Oe||t==De}},{key:"_setFocus",value:function(){this._focus=!0,this._idleInterval.enabled||(this._idleInterval.enabled=!0)}},{key:"_killFocus",value:function(){this._focus=!1,this._caret.visible=!1,null!=this._caret.control&&this._caret.control.killFocus(),this._idleInterval.enabled&&(this._idleInterval.enabled=!1,this._cancelIdle()),this.ime.killFocus()}},{key:"_killFocusControl_",value:function(t,e){this._caret.visible&&this._destroyCaret_(this._caret.control),this.ime.removeControl(e)}},{key:"_closePopupControl_",value:function(t){if(null!=t){t.closePopup();var e=t.popupLinkedList;if(null!=t.forward){for(var i,n=t;null!==n.next;)n=n.next;for(;n!==t;)(i=n.forward).next=null,n.forward=null,n.closePopup(),e.remove(n),n=i;t.forward.next=null,t.forward=null,e.remove(t),this.update(),0==e.count&&(this._popupLayer.remove(e),this._reAdjustMouseMove())}else this._popupLayer.remove(e),this.update(),this._reAdjustMouseMove()}}},{key:"_trackPopupControl_",value:function(t,e){var i=this,n=Math.min(this.width_,this._getViewPortWidth()),o=Math.min(this.height_,this._getViewPortHeight());if(e){t.adjustPosition&&(t.left+t.width+this.theme.shadow>n&&(t.left=n-t.width-this.theme.shadow),t.top+t.height+this.theme.shadow>o&&(t.top=o-t.height-this.theme.shadow));var r=new V;r.onAdded=function(t){i.update()},r.onRemoved=function(t){t.onClose()},t.popupLinkedList=r,r.add(t),this._popupLayer.add(r)}else this._popupLayer.count>0&&(t.forward=this._popupLayer.last.last,this._popupLayer.last.last.next=t,t.adjustPosition&&(t.left+t.width+this.theme.shadow>n&&(t.left=t.forward.left-t.width),t.top+t.height+this.theme.shadow>o&&(t.top=o-t.height-this.theme.shadow)),t.popupLinkedList=this._popupLayer.last,this._popupLayer.last.add(t));this._reAdjustMouseMove()}},{key:"_getControlAtPos",value:function(t,e){var i=this._getPopupControlAtPos(t,e);return null!==i?i:this.application.getControlAtPos(t,e)}},{key:"_reAdjustMouseMove",value:function(){var t=new ei;t.x=this._cursorPos.x,t.y=this._cursorPos.y,this._mouseMove(t)}},{key:"_getPopupControlAt",value:function(t,e){if(this._popupLayer.count>0)for(var i=null,n=this._popupLayer.count-1;n>=0;n--)for(var o=(i=this._popupLayer[n]).count-1;o>=0;o--)if(i[o].bounds().pointInAt(t,e))return i[o];return null}},{key:"_popupMouseWheel",value:function(t){var e=this._mouseMovePopupControl;if(null!==e){var i=new ei;return i.assign(t),i.x-=e.left,i.y-=e.top,e.mouseWheel(i),!0}return!1}},{key:"_popupMouseDown",value:function(t){if(this._capturePopupControl=this._getPopupControlAt(t.x,t.y),null!==this._capturePopupControl)return t.x-=this._capturePopupControl.left,t.y-=this._capturePopupControl.top,this._capturePopupControl.mouseDown(t),!0;if(this._popupLayer.count>0)for(var e=this._popupLayer.count-1;e>=0;e--)this._closePopupControl_(this._popupLayer[e].first);return!1}},{key:"_waitListResponsive",value:function(t){return this._waitList.count>0&&this._waitList.rect.pointInAt(t.x,t.y)}},{key:"_waitListMouseDown",value:function(t){return this._waitListResponsive(t)}},{key:"_waitListMouseMove",value:function(t){return!!this._waitListResponsive(t)&&(this._cursor=re,this._hclH5Canvas.style.cursor=this.theme.getCSSCursor(this._cursor),!0)}},{key:"_waitListMouseUp",value:function(t){return!!this._waitListResponsive(t)&&(this._waitList.delete(this._waitList.count-1),this.update(),!0)}},{key:"_popupMouseMove",value:function(t){if(null!==this._capturePopupControl){var e=new ei;return e.assign(t),e.x-=this._capturePopupControl.left,e.y-=this._capturePopupControl.top,this._capturePopupControl.mouseMove(e),!0}var i=this._getPopupControlAt(t.x,t.y);if(i!=this._mouseMovePopupControl&&(null!=this._mouseMovePopupControl&&this._mouseMovePopupControl.mouseLeave(),this._mouseMovePopupControl=i,null!=this._mouseMovePopupControl&&this._mouseMovePopupControl.mouseEnter()),null!==this._mouseMovePopupControl){var n=new ei;return n.assign(t),n.x-=this._mouseMovePopupControl.left,n.y-=this._mouseMovePopupControl.top,this._mouseMovePopupControl.mouseMove(n),!0}return!1}},{key:"_popupMouseUp",value:function(t){if(null!==this._capturePopupControl){var e=new ei;return e.assign(t),e.x=t.x-this._capturePopupControl.left,e.y=t.y-this._capturePopupControl.top,this._capturePopupControl.mouseUp(e),this._capturePopupControl=null,this._mouseMovePopupControl=null,!0}var i=this._mouseMovePopupControl;return null!==i&&(t.x-=i.left,t.y-=i.top,i.mouseUp(t),!0)}},{key:"_popupKeyDown",value:function(t){return this._focusLayer==this._popupLayer&&(null!=this._caret.control&&this._caret.control.keyDown(t),!0)}},{key:"_popupKeyPress",value:function(t){return this._focusLayer==this._popupLayer&&(null!=this._caret.control&&this._caret.control.keyPress(t),!0)}},{key:"_getPopupControlAtPos",value:function(t,e){var i=this._getPopupControlAt(t,e);return null!==i?i.getControlAtPos(t-i.left,e-i.top):null}},{key:"windowKeyDown_",value:function(t){this._focus&&this._keyDown(t)}},{key:"windowKeyPress_",value:function(t){this._focus&&this._keyPress(t)}},{key:"windowKeyUp_",value:function(t){this._focus&&this._keyUp(t)}},{key:"windowResize_",value:function(t){this.resize()}},{key:"windowFocus_",value:function(t){this._clearKeyState()}},{key:"windowFocusOut_",value:function(t){t.relatedTarget!=this.ime._input&&t.relatedTarget!=this._hclH5Canvas&&this._killFocus()}},{key:"_removeBindEvent",value:function(){window.removeEventListener("keydown",this.__windowKeyDown),window.removeEventListener("keypress",this.__windowKeyPress,!1),window.removeEventListener("keyup",this.__windowKeyUp),window.removeEventListener("resize",this.__windowResize),window.removeEventListener("focus",this.__windowFocus),window.removeEventListener("focusout",this.__windowFocuOut),window.removeEventListener("mousedown",this.__windowMouseDown),window.removeEventListener("mousemove",this.__windowMouseMove),window.removeEventListener("load",this.__windowLoad),window.document.removeEventListener("visibilitychange",this.__windowDocVisibilitychange),window.document.removeEventListener("copy",this.__windowDocCopy),window.document.removeEventListener("cut",this.__windowDocCut),window.document.removeEventListener("paste",this.__windowDocPaste),this.brower==tr.Firefox&&window.removeEventListener("DOMMouseScroll",this.__windowMouseWheel)}},{key:"_initBindEvent",value:function(){var t=this;this._removeBindEvent(),window.addEventListener("keydown",this.__windowKeyDown,!1),window.addEventListener("keypress",this.__windowKeyPress,!1),window.addEventListener("keyup",this.__windowKeyUp,!1),window.addEventListener("resize",this.__windowResize,!1),window.addEventListener("focus",this.__windowFocus,!1),window.addEventListener("focusout",this.__windowFocuOut,!1),window.addEventListener("mousedown",this.__windowMouseDown,!1),window.addEventListener("mousemove",this.__windowMouseMove,!1),window.addEventListener("load",this.__windowLoad,!1),window.document.addEventListener("visibilitychange",this.__windowDocVisibilitychange,!1),window.document.addEventListener("copy",this.__windowDocCopy,!1),window.document.addEventListener("cut",this.__windowDocCut,!1),window.document.addEventListener("paste",this.__windowDocPaste,!1),this._hclH5Canvas.onmousedown=function(e){t._focus||t.windowMouseDown_(e),t._mouseDown(t._makeMouseEventArgs(e))},this._hclH5Canvas.onmousemove=function(e){t._mouseMove(t._makeMouseEventArgs(e))},this._hclH5Canvas.onmouseup=function(e){var i=t._makeMouseEventArgs(e);0===e.buttons&&(0===e.button?i.button=ee:1===e.button?i.button=ne:2===e.button&&(i.button=ie)),t._mouseUp(i)},this._hclH5Canvas.onmouseenter=function(e){t._mouseEnter(t._makeMouseEventArgs(e))},this.brower==tr.Firefox?window.addEventListener("DOMMouseScroll",this.__windowMouseWheel,!1):this._hclH5Canvas.onmousewheel=function(e){t._mouseWheel(e)},this._hclH5Canvas.onmouseleave=function(e){t._mouseLeave(t._makeMouseEventArgs(e))},this._hclH5Canvas.ondblclick=function(e){t._dblClick(t._makeMouseEventArgs(e))},this._parentElement===document.body&&(document.body.parentNode.style.overflowY="hidden"),this._parentElement.oncontextmenu=function(t){t.returnValue=!1},this.ime.__hclLoaded(this)}},{key:"windowMouseDown_",value:function(t){t.target!=this._hclH5Canvas?this._killFocus():this._setFocus()}},{key:"windowMouseMove_",value:function(t){t.target!=this._hclH5Canvas?(this._mouseIn=!1,this._cancelIdle()):this._mouseIn=!0}},{key:"windowLoad_",value:function(t){this._loaded=!0,t.preventDefault()}},{key:"windowDocVisibilitychange_",value:function(t){window.document.hidden?this._deactivate():this._activate(),t.preventDefault()}},{key:"windowDocCopy_",value:function(t){this._focus&&(this._copy(t),t.preventDefault())}},{key:"windowDocCut_",value:function(t){this._focus&&(this._cut(t),t.preventDefault())}},{key:"windowDocPaste_",value:function(t){this._focus&&(this._paste(t),t.preventDefault())}},{key:"dispose",value:function(){this._removeBindEvent(),null!=this._parentElement&&(this.ime.__hclUnLoaded(this),this._parentElement.removeChild(this._hclH5Canvas)),this.ime=null,this.system=null,this.clipboard=null,this.localStorage.clear(),this.localStorage=null,this.theme=null}},{key:"_windowToCanvas",value:function(t,e,i){var n=t.getBoundingClientRect();return{x:(e-n.left)*(t.width/n.width)/this._scale,y:(i-n.top)*(t.height/n.height)/this._scale}}},{key:"_getAdjustLeft",value:function(){var t=(this._getViewPortWidth()-this.width_)/2;return this._loaded&&t0){this._hclCanvas.font.name="宋体",this._hclCanvas.font.size=12,this._hclCanvas.font.color="white",this._hclCanvas.brush.color="black";var t=this._hclCanvas.alpha;this._hclCanvas.alpha=.6,this._hclCanvas.fillRect(this._waitList.rect),this._hclCanvas.alpha=t,this._hclCanvas.textOut(2,2,"["+this._waitList.count.toString()+"] "+this._waitList.last.text)}}},{key:"_paintApplicationLayer",value:function(t){this._appCanvas.save();try{this._appCanvas.clearRect(t),this._appCanvas.clipRect(t),this.application.paint(this._appCanvas)}finally{this._appCanvas.restore()}this._hclCanvas.bitBltRect(t,this._appCanvas,t)}},{key:"_paintPopupLayer",value:function(t){if(0!=this._popupLayer.count){this._popupCanvas.clearRect(t);for(var e=null,i=null,n=0;n0&&(this._updateCount--,0==this._updateCount&&this.update())}},{key:"update",value:function(){this._updateCount>0||this._paint(U.CreateByBounds(0,0,this.width_,this.height_))}},{key:"updateRect",value:function(t){this._updateCount>0||(this.brower==tr.IE?this._paint(t):this._paint(t.inFlate(this.theme.shadow,this.theme.shadow,!0)))}},{key:"showMessage",value:function(t){new Fo("提示",t).showModal()}},{key:"messageDlg",value:function(t,e,i,n){new Fo("提示",t,i,e).showModal(n)}},{key:"waitMessage",value:function(t,e){var i=new er(t);return this._waitList.add(i),setTimeout(e,0),i}},{key:"endWaitMessage",value:function(t){this._waitList.remove(t)}},{key:"broadcast",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.application.broadcast(t,e,i)}},{key:"exception",value:function(t){throw"HCL异常:"+t}},{key:"log",value:function(t){console.log(t)}},{key:"returnFalseLog",value:function(t){return console.log(t),!1}},{key:"returnTrueLog",value:function(t){return console.log(t),!0}},{key:"debugLog",value:function(t){this.debug&&console.log("hcl_debug:"+t)}},{key:"onCatch",value:function(t){}},{key:"parentElement",get:function(){return this._parentElement},set:function(t){t&&this._parentElement!=t&&(this._parentElement=t,this._hclH5Canvas=document.createElement("canvas"),this._hclH5Canvas.setAttribute("id","hclH5canvas_"+this.system.Timestamp),this._hclH5Canvas.width=this.width_,this._hclH5Canvas.height=this.height_,this._hclH5Canvas.style.position="absolute",this._hclH5Canvas.style.left=this.left_+"px",this._hclH5Canvas.style.top="0px",this._hclH5Canvas.style.imeMode="active",this._hclH5Canvas.tabIndex="-1",this._hclH5Canvas.style.outline="none",this._hclCanvas=new Dt(this._hclH5Canvas.getContext("2d")),this._appH5Canvas=document.createElement("canvas"),this._appCanvas=new Dt(this._appH5Canvas.getContext("2d")),this._popupH5Canvas=document.createElement("canvas"),this._popupCanvas=new Dt(this._popupH5Canvas.getContext("2d")),t.appendChild(this._hclH5Canvas),this.resize(),this._initBindEvent())}},{key:"autoWidth",get:function(){return this._autoWidth},set:function(t){this._autoWidth!=t&&(this._autoWidth=t,this.resize())}},{key:"autoHeight",get:function(){return this._autoHeight},set:function(t){this._autoHeight!=t&&(this._autoHeight=t,this.resize())}},{key:"design",get:function(){return this.design_},set:function(t){this.design_!=t&&(this.design_=t,this.broadcast(Qe,t),this.update())}},{key:"left",get:function(){return this.left_}},{key:"top",get:function(){return this.top_}},{key:"width",get:function(){return this.width_}},{key:"height",get:function(){return this.height_}},{key:"cursorPos",get:function(){return this._cursorPos}},{key:"cursor",get:function(){return this._cursor}},{key:"homePath",get:function(){return this.theme.path},set:function(t){this.theme.path=t}},{key:"application",get:function(){return this._curApplication||(this._curApplication=new jo),this._curApplication}}])&&Xo(e.prototype,i),n&&Xo(e,n),r}(L),or=new nr;function rr(t,e){for(var i=0;i16&&(this.FLineSpaceMode=t.readByte()),e>30?this.FLineSpace=t.readSingle():this.FLineSpaceMode==gr.Fix&&(this.FLineSpace=12),e<22?(this.FFirstIndentPix=t.readInt32(),this.FLeftIndentPix=t.readInt32()):(this.FFirstIndent=t.readSingle(),this.FFirstIndentPix=sr.millimeterToPixX(this.FFirstIndent),this.FLeftIndent=t.readSingle(),this.FLeftIndentPix=sr.millimeterToPixX(this.FLeftIndent),this.FRightIndent=t.readSingle(),this.FRightIndentPix=sr.millimeterToPixX(this.FRightIndent)),this.FBackColor=lp.HCLoadColorFromStream(t);var i=0;e>31&&(i=t.readByte(),this.FBreakRough=or.system.isOdd(i>>7)),this.FAlignHorz=t.readByte(),e>17&&(this.FAlignVert=t.readByte())}},{key:"ToCSS",value:function(){var t=" text-align: ";switch(this.FAlignHorz){case dr:t+="left";break;case yr:t+="right";break;case mr:t+="center";break;case pr:case Sr:t+="justify"}switch(this.FLineSpaceMode){case gr.PLS100:t+="; line-height: 100%";break;case gr.PLS115:t+="; line-height: 115%";break;case gr.PLS150:t+="; line-height: 150%";break;case gr.PLS200:t+="; line-height: 200%";break;case gr.PLSFix:t+="; line-height: 10px"}return t}},{key:"GetLineSpaceModeXML_",value:function(){switch(this.FLineSpaceMode){case gr.PLS100:return"100";case gr.PLS115:return"115";case gr.PLS150:return"150";case gr.PLS200:return"200";case gr.PLSMin:return"min";case gr.PLSMult:return"mult";case gr.PLSFix:return"fix";default:return"100"}}},{key:"GetHorzXML_",value:function(){switch(this.FAlignHorz){case dr:return"left";case yr:return"right";case mr:return"center";case pr:return"justify";default:return"scatter"}}},{key:"GetVertXML_",value:function(){switch(this.FAlignVert){case vr:return"top";case Fr:return"center";default:return"bottom"}}},{key:"ToXml",value:function(t){t.SetAttribute("firstindent",C.stringFormatFloat(1,this.FFirstIndent)),t.SetAttribute("leftindent",C.stringFormatFloat(1,this.FLeftIndent)),t.SetAttribute("rightindent",C.stringFormatFloat(1,this.FRightIndent)),t.SetAttribute("bkcolor",lp.HCColorToRGBString(this.FBackColor)),this.FBreakRough&&t.SetAttribute("breakrough","1"),t.SetAttribute("spacemode",this.GetLineSpaceModeXML_()),t.SetAttribute("horz",this.GetHorzXML_()),t.SetAttribute("vert",this.GetVertXML_())}},{key:"ParseXml",value:function(t){this.FirstIndent=t.GetAttribute("firstindent"),this.LeftIndent=t.GetAttribute("leftindent"),this.RightIndent=t.GetAttribute("rightindent"),this.FBackColor=lp.HCRGBStringToColor(t.GetAttribute("bkcolor")),this.FBreakRough="1"==t.GetAttribute("breakrough"),"100"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS100:"115"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS115:"150"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS150:"200"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS200:"min"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLSMin:"mult"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLSMult:"fix"==t.GetAttribute("spacemode")&&(this.FLineSpaceMode=gr.PLSFix),"left"==t.GetAttribute("horz")?this.FAlignHorz=dr:"right"==t.GetAttribute("horz")?this.FAlignHorz=yr:"center"==t.GetAttribute("horz")?this.FAlignHorz=mr:"justify"==t.GetAttribute("horz")?this.FAlignHorz=pr:"scatter"==t.GetAttribute("horz")&&(this.FAlignHorz=Sr),"top"==t.GetAttribute("vert")?this.FAlignVert=vr:"center"==t.GetAttribute("vert")?this.FAlignVert=Fr:"bottom"==t.GetAttribute("vert")&&(this.FAlignVert=Ir)}},{key:"LineSpaceMode",get:function(){return this.FLineSpaceMode},set:function(t){this.FLineSpaceMode=t}},{key:"LineSpace",get:function(){return this.FLineSpace},set:function(t){this.FLineSpace=t}},{key:"FirstIndent",get:function(){return this.FFirstIndent},set:function(t){this.SetFirstIndent(t)}},{key:"LeftIndent",get:function(){return this.FLeftIndent},set:function(t){this.SetLeftIndent(t)}},{key:"RightIndent",get:function(){return this.FRightIndent},set:function(t){this.SetRightIndent(t)}},{key:"FirstIndentPix",get:function(){return this.FFirstIndentPix}},{key:"LeftIndentPix",get:function(){return this.FLeftIndentPix}},{key:"RightIndentPix",get:function(){return this.FRightIndentPix}},{key:"BackColor",get:function(){return this.FBackColor},set:function(t){this.FBackColor=t}},{key:"BreakRough",get:function(){return this.FBreakRough},set:function(t){this.FBreakRough=t}},{key:"AlignHorz",get:function(){return this.FAlignHorz},set:function(t){this.FAlignHorz=t}},{key:"AlignVert",get:function(){return this.FAlignVert},set:function(t){this.FAlignVert=t}}])&&lr(e.prototype,i),n&&lr(e,n),r}(L);function Cr(t){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kr(t,e){for(var i=0;i0)for(var e=0;e0)for(var i=0;i"}}],[{key:"Create",value:function(t,e){var n=new i;return n.Name=t,e&&(n.Value=e),n}}]),i}(Xr),Yr=0,Jr=1,Zr=2,qr=3,Qr=function(t){Ur(i,t);var e=Wr(i);function i(){var t;return Hr(this,i),(t=e.call(this)).Version="1.0",t.Encoding="UTF-8",t}return Gr(i,[{key:"CreateNode",value:function(t,e){return Kr.Create(t,e)}},{key:"ToString",value:function(){var t='';if(this.ChildNodes&&this.ChildNodes.count>0)for(var e=0;e",t,e+1,i);if(o>0){if("?"==t[e+1])return o;var r=new Kr;null!=n&&n.AppendChild(r);for(var s="",a="",l=Yr,h=e+1;h=0)this.FStates[e].Count++;else{var i=new ls;i.State=t,i.Count=1,this.FStates.add(i)}}},{key:"Exclude",value:function(t){var e=this._getStateIndex(t);e>=0&&(this.FStates[e].Count>1?this.FStates[e].Count--:this._deleteState(e))}},{key:"Contain",value:function(t){return this._getStateIndex(t)>=0}},{key:"UndoRedo",value:function(){return this.Contain(Ip.Undoing)||this.Contain(Ip.Redoing)}}]),t}(),cs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ts(t,e)}(i,t);var e=es(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ss(this,i),(t=e.call(this)).FTempCanvas=t.CreateStyleCanvas(),t.FTempStyleNo=i.Null,t.FBackgroundColor="#ffffff",t.FSelColor="#a6caf0",t.FLineSpaceMin=8,t.FShowParaLastMark=!0,t.FDrawActiveDomainRegion=!0,t.FDrawHotDomainRegion=!0,t.FFormatVersion=2,t.FStates=new hs,t.FUpdateInfo=new as,t.FDefaultTextStyle=new Er,t.FDefaultTextStyle.ApplyStyle(t.FTempCanvas),t.FTextStyles=new V,t.FParaStyles=new V,t.SkipFormat=!1,t.FormatBrushStyleNo=0,n&&t.NewDefaultTextStyle(),o&&t.NewDefaultParaStyle(),t.FOnInvalidateRect=null,t}return rs(i,[{key:"SetShowParaLastMark",value:function(t){this.FShowParaLastMark!=t&&(this.FShowParaLastMark=t,this.UpdateInfoRePaint())}},{key:"Initialize",value:function(){this.FTextStyles.removeRange(1,this.FTextStyles.count-1),this.FParaStyles.removeRange(1,this.FParaStyles.count-1)}},{key:"UpdateInfoRePaint",value:function(){this.FUpdateInfo.RePaint=!0}},{key:"UpdateInfoReStyle",value:function(){this.FUpdateInfo.ReStyle=!0}},{key:"UpdateInfoReScroll",value:function(){this.FUpdateInfo.ReScroll=!0}},{key:"UpdateInfoReCaret",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.FUpdateInfo.ReCaret=!0,this.FUpdateInfo.ReStyle=t}},{key:"AddTextStyle",value:function(t){return this.FTextStyles.add(t),this.FTextStyles.count-1}},{key:"CreateStyleCanvas",value:function(){var t=document.createElement("canvas").getContext("2d");return new Dt(t)}},{key:"DestroyStyleCanvas",value:function(t){t.h5context.canvas=null}},{key:"NewDefaultTextStyle",value:function(){var t=new Er;return this.FTextStyles.add(t),t.ApplyStyle(this.TempCanvas),this.FTempStyleNo=this.FTextStyles.count-1,this.FTextStyles.count-1}},{key:"NewDefaultParaStyle",value:function(){var t=new wr;return this.FParaStyles.add(t),this.FParaStyles.count-1}},{key:"GetDefaultStyleNo",value:function(){return this.GetStyleNo(this.FDefaultTextStyle,!0)}},{key:"GetStyleNo",value:function(t,e){for(var i=-1,n=0;n<=this.FTextStyles.count-1;n++)if(this.FTextStyles[n].EqualsEx(t))return i=n;if(e&&i<0){var o=new Er;o.AssignEx(t),this.FTextStyles.add(o),o.ApplyStyle(this.TempCanvas),i=this.FTextStyles.count-1,this.FTempStyleNo=i}return i}},{key:"GetParaNo",value:function(t,e){for(var i=-1,n=0;n<=this.FParaStyles.count-1;n++)if(this.FParaStyles[n].EqualsEx(t))return i=n;if(e&&i<0){var o=new wr;o.AssignEx(t),this.FParaStyles.add(o),i=this.FParaStyles.count-1}return i}},{key:"ApplyTempStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.FTempStyleNo!=t&&(this.FTempStyleNo=t,t>i.Null&&this.FTextStyles[t].ApplyStyle(this.FTempCanvas,e))}},{key:"SaveParaStyles",value:function(t){var e=this.FParaStyles.count;t.writeInt32(e);for(var i=0;i<=this.FParaStyles.count-1;i++)this.FParaStyles[i].SaveToStream(t)}},{key:"SaveTextStyles",value:function(t){var e=this.TextStyles.count;t.writeInt32(e);for(var i=0;i<=this.FTextStyles.count-1;i++)this.FTextStyles[i].SaveToStream(t)}},{key:"SaveToStream",value:function(t){var e=t.position;t.writeUInt64(e),t.writeByte(this.FFormatVersion),t.writeByte(this.FLineSpaceMin);var i=0;this.FShowParaLastMark&&(i|=128),t.writeByte(i),this.SaveParaStyles(t),this.SaveTextStyles(t);var n=t.position;t.position=e,e=n-e-8,t.writeUInt64(e),t.position=n}},{key:"LoadParaStyles",value:function(t,e){this.FParaStyles.clear();for(var i=t.readInt32(),n=0;n<=i-1;n++)this.FParaStyles[this.NewDefaultParaStyle()].LoadFromStream(t,e)}},{key:"LoadTextStyles",value:function(t,e){this.FTextStyles.clear();for(var i=t.readInt32(),n=0;n<=i-1;n++)this.FTextStyles[this.NewDefaultTextStyle()].LoadFromStream(t,e)}},{key:"LoadFromStream",value:function(t,e){if(t.readInt64(),this.FFormatVersion=e>33?t.readByte():1,this.FLineSpaceMin=e>49?t.readByte():8,e>53){var i=t.readByte();this.FShowParaLastMark=or.system.isOdd(i>>7)}else this.FShowParaLastMark=!0;this.LoadParaStyles(t,e),this.LoadTextStyles(t,e)}},{key:"GetHtmlFileTempName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?this.FHtmlFileTempName=0:this.FHtmlFileTempName++,this.FHtmlFileTempName.toString()}},{key:"ToCSS",value:function(){for(var t='"}},{key:"ToXml",value:function(t){t.SetAttribute("fscount",this.FTextStyles.count.toString()),t.SetAttribute("pscount",this.FParaStyles.count.toString()),t.SetAttribute("fmtver",this.FFormatVersion.toString()),t.SetAttribute("linespacemin",this.FLineSpaceMin.toString()),t.SetAttribute("showplm",this.FShowParaLastMark.toString());for(var e,i,n=Kr.Create("textstyles"),o=0;o25?this.FOptions.value=t.readByte():this.ParaFirst=t.readBoolean(),i>33){var n=t.readByte();this.FPrintInvisible=or.system.isOdd(n>>7)}}},{key:"ToHtml",value:function(){return""}},{key:"ToXml",value:function(t){t.SetAttribute("sno",this.FStyleNo.toString()),t.SetAttribute("pno",this.FParaNo.toString()),t.SetAttribute("parafirst",this.ParaFirst.toString()),t.SetAttribute("pagebreak",this.PageBreak.toString()),this.FPrintInvisible&&t.SetAttribute("printvisible","1")}},{key:"ParseXml",value:function(t){this.FStyleNo=t.GetAttribute("sno"),this.FParaNo=t.GetAttribute("pno"),this.ParaFirst="true"==t.GetAttribute("parafirst"),this.PageBreak="true"==t.GetAttribute("pagebreak"),this.FPrintInvisible="1"==t.GetAttribute("printvisible")}},{key:"ToJSONString",value:function(){return'"StyleNo":'+this.StyleNo}},{key:"ToJSONObject",value:function(){return JSON.parse("{"+this.ToJSONString()+"}")}},{key:"ParseJSONOjbect",value:function(t){this.FStyleNo=t.styleno}},{key:"Undo",value:function(t){}},{key:"Redo",value:function(t){}},{key:"Options",get:function(){return this.FOptions}},{key:"Text",get:function(){return this.GetText()},set:function(t){this.SetText(t)}},{key:"Length",get:function(){return this.GetLength()}},{key:"ParaFirst",get:function(){return this.GetParaFirst()},set:function(t){this.SetParaFirst(t)}},{key:"PageBreak",get:function(){return this.GetPageBreak()},set:function(t){this.SetPageBreak(t)}},{key:"HyperLink",get:function(){return this.GetHyperLink()},set:function(t){this.SetHyperLink(t)}},{key:"IsSelectComplate",get:function(){return this.GetSelectComplate()}},{key:"IsSelectPart",get:function(){return this.GetSelectPart()}},{key:"StyleNo",get:function(){return this.FStyleNo},set:function(t){this.FStyleNo=t}},{key:"ParaNo",get:function(){return this.FParaNo},set:function(t){this.FParaNo=t}},{key:"FirstDItemNo",get:function(){return this.FFirstDItemNo},set:function(t){this.FFirstDItemNo=t}},{key:"Active",get:function(){return this.FActive},set:function(t){this.SetActive(t)}},{key:"Visible",get:function(){return this.FVisible},set:function(t){this.FVisible=t}},{key:"PrintInvisible",get:function(){return this.FPrintInvisible},set:function(t){this.FPrintInvisible=t}}]),i}(L),Ws=function(t){Ds(i,t);var e=Rs(i);function i(){return Os(this,i),e.call(this)}return i}(V);function zs(t){return(zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function js(t,e,i){return(js="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$s(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Xs(t,e){for(var i=0;i0?(this[this.FSeek].IsUndo&&this.FSeek++,this.removeRange(this.FSeek,this.count-this.FSeek)):this.clear()),this.count>this.FMaxUndoCount&&!this.FGroupWorking){var e=0,i=-1;if(this[0].isClass(Da)){for(var n=1;n<=this.count-1;n++)if(this[n].isClass(_a)){if(0==e){i=n;break}e--}else this[n].isClass(Da)&&e++;this.removeRange(0,i+1)}else this.removeAt(0)}this.add(t),this.FSeek=this.count-1}},{key:"UndoGroupBegin",value:function(t,e){this.FGroupWorking=!0;var i=null;(i=null!=this.FOnUndoGroupStart?this.FOnUndoGroupStart(t,e):new Da).ItemNo=t,i.Offset=e,this.DoNewUndo(i)}},{key:"UndoGroupEnd",value:function(t,e){if(this.last.isClass(Da))this.last.isClass(Da)&&this.delete(this.count-1);else{var i=null;(i=null!=this.FOnUndoGroupEnd?this.FOnUndoGroupEnd(t,e):new _a).ItemNo=t,i.Offset=e,this.DoNewUndo(i)}this.FGroupWorking=!1}},{key:"UndoNew",value:function(){var t=null;return t=null!=this.FOnUndoNew?this.FOnUndoNew():new wa,this.DoNewUndo(t),t}},{key:"DoSeekUndoEx",value:function(t){return null!=this.FOnUndo&&this.FOnUndo(this[t]),this[t].IsUndo=!1,--t}},{key:"Undo",value:function(){if(this.FSeek>=0){var t=0,e=-1;if(this[this.FSeek].isClass(_a)){t=0,e=0;for(var i=this.FSeek-1;i>=0;i--)if(this[i].isClass(Da)){if(0==t){e=i;break}t--}else this[i].isClass(_a)&&t++;this.FGroupBeginIndex=e,this.FGroupEndIndex=this.FSeek;try{for(this.FGroupWorking=!0;this.FSeek>=e;)this.FSeek==e&&(this.FGroupWorking=!1),this.FSeek=this.DoSeekUndoEx(this.FSeek)}finally{this.FGroupWorking=!1,this.FGroupBeginIndex=-1,this.FGroupEndIndex=-1}}else this.FSeek=this.DoSeekUndoEx(this.FSeek)}}},{key:"DoSeekRedoEx",value:function(t){return t++,null!=this.FOnRedo&&this.FOnRedo(this[t]),this[t].IsUndo=!0,t}},{key:"Redo",value:function(){if(this.FSeek0&&(this.FEnable=this.FEnableStateStack.pop())}},{key:"Enable",get:function(){return this.FEnable},set:function(t){this.FEnable=t}},{key:"MaxUndoCount",get:function(){return this.FMaxUndoCount},set:function(t){this.FMaxUndoCount=t}},{key:"Seek",get:function(){return this.FSeek}},{key:"GroupWorking",get:function(){return this.FGroupWorking}},{key:"CurGroupBeginIndex",get:function(){return this.FGroupBeginIndex}},{key:"CurGroupEndIndex",get:function(){return this.FGroupEndIndex}},{key:"OnUndoNew",get:function(){return this.FOnUndoNew},set:function(t){this.FOnUndoNew=t}},{key:"OnUndoGroupStart",get:function(){return this.FOnUndoGroupStart},set:function(t){this.FOnUndoGroupStart=t}},{key:"OnUndoGroupEnd",get:function(){return this.FOnUndoGroupEnd},set:function(t){this.FOnUndoGroupEnd=t}},{key:"OnUndoDestroy",get:function(){return this.FOnUndoDestroy},set:function(t){this.FOnUndoDestroy=t}},{key:"OnUndo",get:function(){return this.FOnUndo},set:function(t){this.FOnUndo=t}},{key:"OnRedo",get:function(){return this.FOnRedo},set:function(t){this.FOnRedo=t}}]),i}(V);function Oa(t){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Na(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ba(t,e){for(var i=0;i0&&t.last.Actions.count>0&&t.last.Actions.last.isClass(Ia)){var e=t.last.Actions.last;null==e.Object&&(e.Object=new Ta,this.SelfUndoListInitializate(e.Object)),t=e.Object}return t}},{key:"DoSelfUndoDestroy",value:function(t){null!=t.Data&&(t.Data.Dispose(),t.Data=null)}},{key:"DoSelfUndoNew",value:function(){return new wa}},{key:"DoSelfUndo",value:function(t){}},{key:"DoSelfRedo",value:function(t){}},{key:"GetPageBreakCount",value:function(){return 0}},{key:"ApplySelectParaStyle",value:function(t,e){}},{key:"MatchTextStyle",value:function(t,e){return!1}},{key:"ApplySelectTextStyle",value:function(t,e){}},{key:"ApplyContentAlign",value:function(t){}},{key:"FormatToDrawItem",value:function(t,e){}},{key:"ClearFormatExtraHeight",value:function(){return 0}},{key:"ReFormatActiveItem",value:function(){}},{key:"ReFormatRequest",value:function(){}},{key:"ActiveItemReAdaptEnvironment",value:function(){}},{key:"DeleteSelected",value:function(){return!1}},{key:"InsertAnnotate",value:function(t,e){return!1}},{key:"DeleteActiveAnnotate",value:function(){return!1}},{key:"DeleteActiveDomain",value:function(){return!1}},{key:"DeleteActiveDataItems",value:function(t,e,i){}},{key:"SetActiveItemText",value:function(t){}},{key:"MarkStyleUsed",value:function(t){}},{key:"SaveSelectToStream",value:function(t){}},{key:"SaveSelectToText",value:function(){return""}},{key:"GetActiveItem",value:function(){return this}},{key:"GetTopLevelItem",value:function(){return this}},{key:"GetTopLevelDrawItem",value:function(){return null}},{key:"GetTopLevelDrawItemCoord",value:function(){return G.Create(-1,-1)}},{key:"GetTopLevelRectDrawItem",value:function(){return null}},{key:"GetTopLevelRectDrawItemCoord",value:function(){return G.Create(-1,-1)}},{key:"GetOffsetAt",value:function(t){return t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"CoordInSelect",value:function(t,e){return!!this.IsSelectComplate&&U.Create(0,0,this.FWidth,this.FHeight).pointInAt(t,e)}},{key:"WantKeyDown",value:function(t){return!1}},{key:"JustifySplit",value:function(){return!0}},{key:"GetCaretInfo",value:function(t){t.Visible=!1}},{key:"CheckFormatPageBreakBefor",value:function(){}},{key:"CheckFormatPageBreak",value:function(t,e,i,n,o,r,s,a,l){return s=-1,a=0,l=0,this.FCanPageBreak?(s=this.Height-r-(o-e),i>o&&(l=o-i)):(s=0,i>o&&(a=o-e)),{breakSeat:s,fmtOffset:a,fmtHeightInc:l}}},{key:"CheckPageSurplus",value:function(t){return 0}},{key:"InsertItem",value:function(t){return!1}},{key:"InsertText",value:function(t){return!1}},{key:"InsertGraphic",value:function(t,e){return!1}},{key:"InsertStream",value:function(t,e,i){return!1}},{key:"KeyDown",value:function(t){t.Handled=!0}},{key:"KeyPress",value:function(t){return 0}},{key:"IsSelectComplateTheory",value:function(){return this.IsSelectComplate||this.Active}},{key:"SelectExists",value:function(){return!1}},{key:"Search",value:function(t,e,i){return!1}},{key:"Clear",value:function(){}},{key:"GetActiveData",value:function(){return null}},{key:"GetTopLevelDataAt",value:function(t,e){return null}},{key:"GetTopLevelData",value:function(){return null}},{key:"FormatDirty",value:function(){this.FIsFormatDirty=!0}},{key:"TraverseItem",value:function(t){}},{key:"SaveToImage",value:function(t){if(0==this.FWidth||0==this.FHeight)return null;var e=new Us;e.Print=!0,e.WindowWidth=this.FWidth,e.WindowHeight=this.FHeight,e.ScaleX=1,e.ScaleY=1,e.Zoom=1;var i=null,n=Dt.CreateTemp(this.FWidth,this.FHeight);try{n.clear(0,0,this.FWidth,this.FHeight),this.DoPaint(this.OwnerData.Style,U.Create(0,0,this.FWidth,this.FHeight),0,this.FHeight,0,this.FHeight,n,e),i=n.toImage(t)}finally{Dt.DestroyTemp(n)}return i}},{key:"MouseDown",value:function(t){return this.Active=U.CreateByBounds(0,0,this.FWidth,this.FHeight).pointInAt(t.x,t.y),this.Active}},{key:"BreakByOffset",value:function(t){return null}},{key:"CanConcatItems",value:function(t){return!1}},{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FWidth=t.Width,this.FHeight=t.Height}},{key:"Undo",value:function(t){if(t.isClass(Ia)){var e=t.Object;null!=e?e.Undo():Ma(Va(i.prototype),"Undo",this).call(this,t)}else Ma(Va(i.prototype),"Undo",this).call(this,t)}},{key:"Redo",value:function(t){if(t.isClass(Ia)){var e=t.Object;null!=e?(e.Seek<0&&this.SelfUndoListInitializate(e),e.Redo()):Ma(Va(i.prototype),"Redo",this).call(this,t)}else Ma(Va(i.prototype),"Redo",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeInt32(this.FWidth),t.writeInt32(this.FHeight)}},{key:"LoadFromStream",value:function(t,e,n){Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.FWidth=t.readInt32(),this.FHeight=t.readInt32(),this.FormatDirty()}},{key:"ToHtml",value:function(){var t=this.SaveToImage();return t?''+this.className+'':""}},{key:"ToXml",value:function(t){Ma(Va(i.prototype),"ToXml",this).call(this,t),t.SetAttribute("width",this.FWidth.toString()),t.SetAttribute("height",this.FHeight.toString())}},{key:"ParseXml",value:function(t){}},{key:"ToJSONString",value:function(){return Ma(Va(i.prototype),"ToJSONString",this).call(this)+',"Width":"'+this.FWidth+'","Height":"'+this.FHeight+'"'}},{key:"ParseJSONOjbect",value:function(t){Ma(Va(i.prototype),"ParseJSONOjbect",this).call(this,t),this.FWidth=t.width,this.FHeight=t.height}},{key:"GetLength",value:function(){return 1}},{key:"Width",get:function(){return this.GetWidth()},set:function(t){this.SetWidth(t)}},{key:"Height",get:function(){return this.GetHeight()},set:function(t){this.SetHeight(t)}},{key:"TextWrapping",get:function(){return this.FTextWrapping},set:function(t){this.FTextWrapping=t}},{key:"IsFormatDirty",get:function(){return this.FIsFormatDirty},set:function(t){this.FIsFormatDirty=t}},{key:"CanPageBreak",get:function(){return this.FCanPageBreak},set:function(t){this.FCanPageBreak=t}},{key:"PageBreakCount",get:function(){return this.GetPageBreakCount()}},{key:"OwnerData",get:function(){return this.FOwnerData}},{key:"MangerUndo",get:function(){return this.FMangerUndo}}],[{key:"Create",value:function(t,e,n){var o=new i(t);return o.Width=e,o.Height=n,o}}]),i}(Vs),za=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).StyleNo=cs.Domain,n.FMarkType=Pp.Beg,n.FDrawRect=new U,n.FLevel=0,n.Width=0,n.Height=t.Style.TextStyles[0].FontHeight,n.Empty=!0,n}return Ea(i,[{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){Ma(Va(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),l.Print||(this.FDrawRect.resetRect(e),l.topItems.add(this))}},{key:"GetOffsetAt",value:function(t){return t>=0&&t<=this.Width?this.FMarkType==Pp.Beg?lp.OffsetAfter:lp.OffsetBefor:Ma(Va(i.prototype),"GetOffsetAt",this).call(this,t)}},{key:"JustifySplit",value:function(){return!1}},{key:"FormatToDrawItem",value:function(t,e){if(this.Width=0,this.Height=t.Style.TextStyles[0].FontHeight,this.Empty=!1,this.MarkType==Pp.Beg)if(ecs.Null&&(this.Height=t.Style.TextStyles[i.StyleNo].FontHeight)}else this.Width=10;else{var n=t.Items[e-1];n.StyleNo==this.StyleNo&&n.MarkType==Pp.Beg?(this.Width=10,this.Empty=!0):this.ParaFirst?this.Width=10:n.StyleNo>cs.Null&&(this.Height=t.Style.TextStyles[n.StyleNo].FontHeight)}}},{key:"PaintTop",value:function(t){Ma(Va(i.prototype),"PaintTop",this).call(this,t),t.pen.width=1,this.FMarkType==Pp.Beg?(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Blue,t.drawLineByPointsDriect(new Array(G.Create(this.FDrawRect.left+3,this.FDrawRect.top-1),G.Create(this.FDrawRect.left,this.FDrawRect.top-1),G.Create(this.FDrawRect.left,this.FDrawRect.bottom+1))),t.moveTo(this.FDrawRect.left,this.FDrawRect.bottom+1),t.lineTo(this.FDrawRect.left+3,this.FDrawRect.bottom+1)):(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Blue,t.drawLineByPointsDriect(new Array(G.Create(this.FDrawRect.right-3,this.FDrawRect.top-1),G.Create(this.FDrawRect.right,this.FDrawRect.top-1),G.Create(this.FDrawRect.right,this.FDrawRect.bottom+1))),t.moveTo(this.FDrawRect.right,this.FDrawRect.bottom+1),t.lineTo(this.FDrawRect.right-3,this.FDrawRect.bottom+1))}},{key:"SaveToBitmap",value:function(t){return!1}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeByte(this.FMarkType),t.writeByte(this.FLevel)}},{key:"LoadFromStream",value:function(t,e,n){Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.FMarkType=t.readByte(),n>38&&(this.FLevel=t.readByte())}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"MarkType",get:function(){return this.FMarkType},set:function(t){this.FMarkType=t}},{key:"Level",get:function(){return this.FLevel},set:function(t){this.FLevel=t}}],[{key:"IsBeginMark",value:function(t){return t.isClass(i)&&t.MarkType==Pp.Beg}},{key:"IsEndMark",value:function(t){return t.isClass(i)&&t.MarkType==Pp.End}}]),i}(Wa),ja=0,Xa=1,Ka=2,Ya=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FTextStyleNo=0,t.CurStyleNo>cs.Null&&(n.FTextStyleNo=t.CurStyleNo),n}return Ea(i,[{key:"SetTextStyleNo",value:function(t){this.FTextStyleNo!=t&&(this.FTextStyleNo=t)}},{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FTextStyleNo=t.TextStyleNo}},{key:"GetOffsetAt",value:function(t){return te.TextStyles.count-1&&(this.FTextStyleNo=0):this.FTextStyleNo=null!=e?this.OwnerData.Style.GetStyleNo(e.TextStyles[this.FTextStyleNo],!0):0}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"ToJSONString",value:function(){return Ma(Va(i.prototype),"ToJSONString",this).call(this)+',"Text":"'+this.FText+'"'}},{key:"ParseJSONOjbect",value:function(t){Ma(Va(i.prototype),"ParseJSONOjbect",this).call(this,t),this.Text=t.text}},{key:"TextStyleNo",get:function(){return this.FTextStyleNo},set:function(t){this.SetTextStyleNo(t)}}]),i}(Wa),Ja=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FMouseIn=!1,n.FAutoSize=!0,n.FEnabled=!0,n.FPaddingLeft=5,n.FPaddingRight=5,n.FPaddingTop=5,n.FPaddingBottom=5,n.FMinWidth=20,n.FMinHeight=10,n.Tag=0,n}return Ea(i,[{key:"DoClick",value:function(){null!=this.OnClick&&this.OwnerData.CanEdit()&&this.OnClick()}},{key:"KeyDown",value:function(t){null!=this.OnKeyDown&&this.OnKeyDown(t)}},{key:"SetActive",value:function(t){t||(this.FMouseIn=!1),Ma(Va(i.prototype),"SetActive",this).call(this,t)}},{key:"MouseEnter",value:function(){this.FMouseIn=!0,Ma(Va(i.prototype),"MouseEnter",this).call(this)}},{key:"MouseLeave",value:function(){this.FMouseIn=!1,Ma(Va(i.prototype),"MouseLeave",this).call(this)}},{key:"MouseUp",value:function(t){t.button==ee&&this.FEnabled&&this.ClientRect().pointInAt(t.x,t.y)&&this.DoClick()}},{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FAutoSize=t.AutoSize,this.FEnabled=t.Enabled}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FAutoSize&&(o|=128),this.FEnabled&&(o|=64),t.writeByte(o),t.writeInt32(this.Tag)}},{key:"LoadFromStream",value:function(t,e,n){if(Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),n<51)this.FAutoSize=t.readBoolean();else{var o=t.readByte();this.FAutoSize=or.system.isOdd(o>>7),this.FEnabled=or.system.isOdd(o>>6),this.Tag=n>53?t.readInt32():0}}},{key:"ToXml",value:function(t){Ma(Va(i.prototype),"ToXml",this).call(this,t),this.FAutoSize&&t.SetAttribute("autosize","1"),this.FEnabled&&t.SetAttribute("enabled","1"),t.SetAttribute("tag",this.Tag.toString())}},{key:"ParseXml",value:function(t){Ma(Va(i.prototype),"ParseXml",this).call(this,t),t.HasAttribute("autosize")?this.FAutoSize="1"==t.GetAttribute("autosize"):this.FAutoSize=!1,t.HasAttribute("enabled")?this.FEnabled="1"==t.GetAttribute("enabled"):this.FEnabled=!0,t.HasAttribute("tag")?this.Tag=parseInt(t.GetAttribute("tag")):this.Tag=0}},{key:"ClientRect",value:function(){return U.Create(0,0,this.Width,this.Height)}},{key:"AutoSize",get:function(){return this.FAutoSize},set:function(t){this.FAutoSize=t}},{key:"Enabled",get:function(){return this.FEnabled},set:function(t){this.FEnabled=t}}]),i}(Ya),Za=0,qa=1,Qa=2,$a=3,tl=4,el=5,il=6,nl=7,ol=8,rl=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FCanResize=!0,n.FGripSize=8,n.FResizing=!1,n.FResizeRect=null,n.FResizeWidth=0,n.FResizeHeight=0,n.FResizeX=0,n.FResizeY=0,n}return Ea(i,[{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FCanResize=t.CanResize}},{key:"GetGripType",value:function(t,e){var i=G.Create(t,e);return U.CreateByBounds(0,0,this.GripSize,this.GripSize).pointIn(i)?qa:U.CreateByBounds(this.Width-this.GripSize,0,this.GripSize,this.GripSize).pointIn(i)?Qa:U.CreateByBounds(0,this.Height-this.GripSize,this.GripSize,this.GripSize).pointIn(i)?$a:U.CreateByBounds(this.Width-this.GripSize,this.Height-this.GripSize,this.GripSize,this.GripSize).pointIn(i)?tl:Za}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){if(Ma(Va(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),!l.Print&&this.Active){if(this.Resizing){switch(this.FResizeGrip){case qa:this.FResizeRect=U.CreateByBounds(e.left+this.Width-this.FResizeWidth,e.top+this.Height-this.FResizeHeight,this.FResizeWidth,this.FResizeHeight);break;case Qa:this.FResizeRect=U.CreateByBounds(e.left,e.top+this.Height-this.FResizeHeight,this.FResizeWidth,this.FResizeHeight);break;case $a:this.FResizeRect=U.CreateByBounds(e.left+this.Width-this.FResizeWidth,e.top,this.FResizeWidth,this.FResizeHeight);break;case tl:this.FResizeRect=U.CreateByBounds(e.left,e.top,this.FResizeWidth,this.FResizeHeight)}l.topItems.add(this)}this.AllowResize&&(a.brush.color=at.Gray,a.fillRect(U.CreateByBounds(e.left,e.top,this.GripSize,this.GripSize)),a.fillRect(U.CreateByBounds(e.right-this.GripSize,e.top,this.GripSize,this.GripSize)),a.fillRect(U.CreateByBounds(e.left,e.bottom-this.GripSize,this.GripSize,this.GripSize)),a.fillRect(U.CreateByBounds(e.right-this.GripSize,e.bottom-this.GripSize,this.GripSize,this.GripSize)))}}},{key:"MouseDown",value:function(t){this.FResizeGrip=Za;var e=Ma(Va(i.prototype),"MouseDown",this).call(this,t);return this.Active&&this.AllowResize&&(this.FResizeGrip=this.GetGripType(t.x,t.y),this.FResizing=this.FResizeGrip!=Za,this.FResizing&&(this.FResizeX=t.x,this.FResizeY=t.y,this.FResizeWidth=this.Width,this.FResizeHeight=this.Height)),e}},{key:"SelfUndo_Resize",value:function(t,e){var i=this.GetSelfUndoList();if(null!=i&&i.Enable){this.SelfUndo_New();var n=i.last;if(null!=n){var o=new sa;o.OldWidth=this.Width,o.OldHeight=this.Height,o.NewWidth=t,o.NewHeight=e,n.Data=o}}}},{key:"DoSelfUndoDestroy",value:function(t){null!=t.Data&&t.Data.isClass(sa)&&(t.Data.Dispose(),t.Data=null),Ma(Va(i.prototype),"DoSelfUndoDestroy",this).call(this,t)}},{key:"DoSelfUndo",value:function(t){if(t.Data)if(t.Data.isClass(sa)){var e=t.Data;this.Width=e.OldWidth,this.Height=e.OldHeight}else Ma(Va(i.prototype),"DoSelfUndo",this).call(this,t);else Ma(Va(i.prototype),"DoSelfUndo",this).call(this,t)}},{key:"DoSelfRedo",value:function(t){if(t.Data)if(t.Data.isClass(sa)){var e=t.Data;this.Width=e.NewWidth,this.Height=e.NewHeight}else Ma(Va(i.prototype),"DoSelfRedo",this).call(this,t);else Ma(Va(i.prototype),"DoSelfRedo",this).call(this,t)}},{key:"GetResizing",value:function(){return this.FResizing}},{key:"SetResizing",value:function(t){this.FResizing!=t&&(this.FResizing=t)}},{key:"GetAllowResize",value:function(){return this.FCanResize&&this.OwnerData.CanEdit()}},{key:"CoordInSelect",value:function(t,e){return this.SelectExists()&&U.CreateByBounds(0,0,this.Width,this.Height).pointInAt(t,e)&&this.GetGripType(t,e)==Za}},{key:"PaintTop",value:function(t){Ma(Va(i.prototype),"PaintTop",this).call(this,t),this.FResizing&&(t.brush.style=Ft,t.rectangleRect(this.FResizeRect),t.brush.color=at.White,t.font.size=8,t.font.color=at.Black,t.font.styles.value=0,t.textOut(this.FResizeRect.left+2,this.FResizeRect.top+2,this.FResizeWidth+" x "+this.FResizeHeight))}},{key:"MouseMove",value:function(t){var e=Ma(Va(i.prototype),"MouseMove",this).call(this,t);if(lp.GCursor=oe,this.Active&&this.AllowResize){var n=0,o=0,r=0,s=0,a=0;if(this.FResizing)switch(a=this.Width/this.Height,n=t.x-this.FResizeX,o=t.y-this.FResizeY,this.FResizeGrip){case qa:r=Math.round(o*a),s=Math.round(n/a),r>n?o=s:n=r,this.FResizeWidth=this.Width-n,this.FResizeHeight=this.Height-o;break;case Qa:r=Math.abs(Math.round(o*a)),s=Math.abs(Math.round(n/a)),n<0?o>s?o=s:n=o>0?-r:r:-or||o>s?n=o<0?r:-r:o=-s,this.FResizeWidth=this.Width-n,this.FResizeHeight=this.Height+o;break;case tl:r=Math.round(o*a),s=Math.round(n/a),r>n?n=r:o=s,this.FResizeWidth=this.Width+n,this.FResizeHeight=this.Height+o}else switch(this.GetGripType(t.x,t.y)){case qa:case tl:lp.GCursor=pe;break;case Qa:case $a:lp.GCursor=me;break;case el:case nl:lp.GCursor=Se;break;case il:case ol:lp.GCursor=ye}}return e}},{key:"MouseUp",value:function(t){var e=Ma(Va(i.prototype),"MouseUp",this).call(this,t);if(this.FResizing){if(this.FResizeWidth<0||this.FResizeHeight<0)return this.FResizing=!1,e;this.SelfUndo_Resize(this.FResizeWidth,this.FResizeHeight),this.Width=this.FResizeWidth,this.Height=this.FResizeHeight,this.FResizing=!1}return e}},{key:"CanDrag",value:function(){return!this.FResizing}},{key:"SelectExists",value:function(){return this.IsSelectComplateTheory()}},{key:"IsSelectComplateTheory",value:function(){return!!this.AllowResize&&Ma(Va(i.prototype),"IsSelectComplateTheory",this).call(this)}},{key:"GetOffsetAt",value:function(t){return this.AllowResize?Ma(Va(i.prototype),"GetOffsetAt",this).call(this,t):t44&&(this.FCanResize=t.readBoolean())}},{key:"ToXml",value:function(t){Ma(Va(i.prototype),"ToXml",this).call(this,t),t.SetAttribute("canresize",this.FCanResize.toString())}},{key:"ParseXml",value:function(t){Ma(Va(i.prototype),"ParseXml",this).call(this,t),this.FCanResize=t.GetAttribute("canresize")}},{key:"RestrainSize",value:function(t,e){}},{key:"ResizeGrip",get:function(){return this.FResizeGrip}},{key:"ResizeRect",get:function(){return this.FResizeRect}},{key:"GripSize",get:function(){return this.FGripSize},set:function(t){this.FGripSize=t}},{key:"Resizing",get:function(){return this.GetResizing()},set:function(t){this.SetResizing(t)}},{key:"ResizeWidth",get:function(){return this.FResizeWidth}},{key:"ResizeHeight",get:function(){return this.FResizeHeight}},{key:"CanResize",get:function(){return this.FCanResize},set:function(t){this.FCanResize=t}},{key:"AllowResize",get:function(){return this.GetAllowResize()}}],[{key:"Create",value:function(t,e,n){var o=new i(t);return o.Width=e,o.Height=n,o.CanResize=!0,o.GripSize=8,o}}]),i}(Wa),sl=function(t){La(i,t);var e=Ha(i);function i(t){return Na(this,i),e.call(this,t)}return Ea(i,[{key:"GetOffsetAt",value:function(t){return t=this.Length||t<=0||((e=Bl(Gl(r.prototype),"BreakByOffset",this).call(this,t)).Text=this.SubString(t+1,this.Length-t),this.FText=this.FText.substr(0,t)),e}},{key:"CanConcatItems",value:function(t){var e=Bl(Gl(r.prototype),"CanConcatItems",this).call(this,t);return e&&(e=this.FHyperLink==t.HyperLink),e}},{key:"AcceptAction",value:function(t,e,i){var n=Bl(Gl(r.prototype),"AcceptAction",this).call(this,t,e,i);return n&&""!=this.FHyperLink&&i==wp.ConcatText&&(n=!1),n}},{key:"SaveToStreamRange",value:function(t,e,i){Bl(Gl(r.prototype),"SaveToStreamRange",this).call(this,t,e,i);var n=this.SubString(e+1,i-e),o=A.getBytes(n),s=o.length;s>lp.HC_TEXTMAXSIZE&&or.exception(lp.HCS_EXCEPTION_TEXTOVER),t.writeUInt32(s),s>0&&t.writeBuffer(o),lp.HCSaveTextToStream(t,this.FHyperLink)}},{key:"LoadFromStream",value:function(t,e,i){Bl(Gl(r.prototype),"LoadFromStream",this).call(this,t,e,i);var n=t.readUInt32();if(n>0){var o=t.readBuffer(n);this.FText=A.getString(o)}this.FHyperLink=i>34?lp.HCLoadTextFromStream(t,i):""}},{key:"ToHtml",value:function(){return''+this.Text+""}},{key:"ToXml",value:function(t){Bl(Gl(r.prototype),"ToXml",this).call(this,t),""!=this.FHyperLink&&t.SetAttribute("link",this.FHyperLink),t.Value=this.FText}},{key:"ParseXml",value:function(t){Bl(Gl(r.prototype),"ParseXml",this).call(this,t),t.HasAttribute("link")&&(this.FHyperLink=t.GetAttribute("link")),this.FText=t.Value}},{key:"ToJSONString",value:function(){return Bl(Gl(r.prototype),"ToJSONString",this).call(this)+',"Text":"'+this.FText+'","HyperLink":"'+this.FHyperLink+'"'}},{key:"ParseJSONOjbect",value:function(t){Bl(Gl(r.prototype),"ParseJSONOjbect",this).call(this,t),this.FText=t.text,this.FHyperLink=t.hyperlink}},{key:"SubString",value:function(t,e){return this.FText.substr(t-1,e)}}])&&Nl(e.prototype,i),n&&Nl(e,n),r}(Vs);function Ul(t){return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vl(t,e,i){return(Vl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zl(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Wl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zl(t,e){for(var i=0;i=this.BeginNo&&t<=this.EndNo}}]),i}(L),Ql=function(t){Xl(i,t);var e=Yl(i);function i(){var t;return Wl(this,i),(t=e.call(this)).Parent=null,t.Childs=new V(!1),t}return jl(i,[{key:"Clear",value:function(){if(Vl(Zl(i.prototype),"Clear",this).call(this),null!=this.Childs){for(var t=0;t0&&!this.FItems[t].ParaFirst&&this.MergeItemText(this.FItems[t-1],this.FItems[t])}},{key:"MergeItemToNext",value:function(t){return t0?this.FDrawItems.last.rect.bottom-this.FDrawItems[0].rect.top:0}},{key:"CheckItemSelectedState",value:function(t){t>this.FSelectInfo.StartItemNo&&tlp.OffsetBefor&&this.FItems[t].SelectPart():this.FSelectInfo.EndItemOffset==this.FItems[t].Length?this.FItems[t].SelectComplate():this.FItems[t].SelectPart()}},{key:"MatchItemSelectState",value:function(){if(this.SelectExists())for(var t=this.FSelectInfo.StartItemNo;t<=this.FSelectInfo.EndItemNo;t++)this.CheckItemSelectedState(t)}},{key:"GetParaItemRang",value:function(t,e,i){for(e=t;e>0&&!this.FItems[e].ParaFirst;)e--;for(i=t+1;i0&&!this.FItems[e].ParaFirst;)e--;return e}},{key:"GetParaLastItemNo",value:function(t){for(var e=t+1;e0&&!this.FDrawItems[i].LineFirst;)i--;return i}},{key:"GetLineLastItemNo",value:function(t,e){for(var i=this.GetDrawItemNoByOffset(t,e)+1;i0&&!this.FDrawItems[t].LineFirst;)t--;for(e=t+1;e=0;t--)this.FItems[t].StyleNo>cs.Null&&0==this.FItems[t].Length&&(this.FItems[t].ParaFirst?t=0&&this.FCaretDrawItemNo=0&&e!=this.FDrawItems[t].ItemNo&&(this.FItems[e].Active=!1)}this.FCaretDrawItemNo=t,this.FStyle.States.Contain(Ip.Loading)||(this.SetCurStyleNo(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].StyleNo),this.SetCurParaNo(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].ParaNo),this.FCaretDrawItemNo>=0&&(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].StyleNo0&&t.CJKFont)if(0!=(128&t.OutlineTextmetric_otmfsSelection))o=t.OutlineTextmetric_otmAscent,r=-t.OutlineTextmetric_otmDescent;else{o=t.Textmetric_tmAscent,r=t.Textmetric_tmDescent;var s=Math.ceil(1.3*(o+r))-(o+r),a=Math.trunc(s/2);switch(i=(o+=a)+(r+=s-a),e.LineSpaceMode){case gr.PLS115:i+=Math.trunc(3*i/20);break;case gr.PLS150:i=Math.trunc(3*i/2);break;case gr.PLS200:i*=2;break;case gr.PLSMult:i=Math.trunc(i*e.LineSpace)}}else switch(e.LineSpaceMode){case gr.PLS100:i+=t.TextMetric_tmExternalLeading;break;case gr.PLS115:i=i+t.TextMetric_tmExternalLeading+Math.round(.15*(t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading));break;case gr.PLS150:i=i+t.TextMetric_tmExternalLeading+Math.round(.5*(t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading));break;case gr.PLS200:i=i+t.TextMetric_tmExternalLeading+t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading;break;case gr.PLSMult:i=i+t.TextMetric_tmExternalLeading+Math.round((t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading)*e.LineSpace)}}return i}},{key:"GetUndoList",value:function(){return null!=this.OnGetUndoList?this.OnGetUndoList():null}},{key:"DoSaveItem",value:function(t){return null==this.OnSaveItem||this.OnSaveItem(this,t)}},{key:"DoInsertItem",value:function(t){null!=this.OnInsertItem&&this.OnInsertItem(this,t)}},{key:"DoRemoveItem",value:function(t){null!=this.OnRemoveItem&&this.OnRemoveItem(this,t)}},{key:"DoItemAction",value:function(t,e,i){}},{key:"DoDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintBefor&&this.OnDrawItemPaintBefor(t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoDrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){null!=this.OnDrawItemPaintContent&&this.OnDrawItemPaintContent(t,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintAfter&&this.OnDrawItemPaintAfter(t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoLoadFromStream",value:function(t,e,i){this.Clear()}},{key:"DoCaretItemChanged",value:function(){}},{key:"CanEdit",value:function(){return null==this.ParentData||this.ParentData.CanEdit()}},{key:"SelectAll",value:function(){this.FItems.count>0&&(this.FSelectInfo.StartItemNo=0,this.FSelectInfo.StartItemOffset=0,this.IsEmptyData()?(this.FSelectInfo.EndItemNo=-1,this.FSelectInfo.EndItemOffset=-1):(this.FSelectInfo.EndItemNo=this.FItems.count-1,this.FSelectInfo.EndItemOffset=this.GetItemOffsetAfter(this.FSelectInfo.EndItemNo)),this.MatchItemSelectState())}},{key:"SelectedAll",value:function(){return 0==this.FSelectInfo.StartItemNo&&0==this.FSelectInfo.StartItemOffset&&this.FSelectInfo.EndItemNo==this.FItems.count-1&&this.FSelectInfo.EndItemOffset==this.GetItemOffsetAfter(this.FItems.count-1)}},{key:"Clear",value:function(){this.FSelectInfo.Initialize(),this.FCaretDrawItemNo=-1,this.FDrawItems.clear(),this.FItems.clear(),this.FCurStyleNo=0,this.FCurParaNo=0}},{key:"InitializeField",value:function(){this.FCaretDrawItemNo=-1}},{key:"Change",value:function(){null!=this.OnChange&&this.OnChange()}},{key:"Clone",value:function(t){this.InitializeField(),this.FItems.clear();for(var e=0;e0&&this.FItems[t-1].StyleNo>cs.Null&&(o=t-1),this.CurStyleNo=this.MatchTextStyleNoAt(o,this.FSelectInfo.StartItemOffset),this.CurParaNo=this.FItems[o].ParaNo),this.FItems[t].StyleNo(l=this.FDrawItems.last.rect).bottom)s=this.FDrawItems.count-1;else for(s=0,h=this.FDrawItems.count-1;;){if(h-s>1){if(a=Math.trunc(s+(h-s)/2),e>this.FDrawItems[a].rect.bottom){s=a+1;continue}if(e=this.FDrawItems[h].rect.bottom||e>this.FDrawItems[h].rect.top)&&(s=h);break}e=this.FDrawItems[h].rect.right)o=h,i=this.FDrawItems[h].ItemNo,n=this.FItems[i].StyleNo=(l=this.FDrawItems[u].rect).left&&tl.bottom,o=u,i=this.FDrawItems[u].ItemNo,n=this.FItems[i].StyleNo2&&void 0!==arguments[2]?arguments[2]:null;if(0==e)return 0;if(!this.Items[this.FDrawItems[t].ItemNo].Visible)return 0;var n=0,o=this.FDrawItems[t],r=this.FItems[o.ItemNo].StyleNo;if(rlp.OffsetBefor&&(n=this.FDrawItems[t].width);else{var s=null;null!=i?s=i:(s=this.FStyle.TempCanvas,this.FStyle.ApplyTempStyle(r));var a=this.FStyle.ParaStyles[this.GetDrawItemParaStyle(t)].AlignHorz;switch(a){case dr:case yr:case mr:n=this._GetNorAlignDrawItemOffsetWidth(t,e,s);break;case pr:case Sr:if(a==pr&&this.IsParaLastDrawItem(t))return n=this._GetNorAlignDrawItemOffsetWidth(t,e,s);var l=this.GetDrawItemText(t),h=l.length,c=s.getTextExtentExPoint(l,h),u=o.width-c[h-1],f=0,d=new V,m=this.GetJustifyCount(l,d),y=this.IsLineLastDrawItem(t);y&&m>0&&m--,m>0&&(f=u%m,u=Math.trunc(u/m));for(var p=0,S=0,v=0;v<=d.count-2;v++){if(y&&v==d.count-2||(f>0?(p+=u+1,f--):p+=u),(S=d[v+1]-1)==e){n=c[S-1]+p;break}if(S>e){n=c[e-d[v]]+p;break}}}}return n}},{key:"GetRectItemInnerCaretInfo",value:function(t,e,i,n,o){t.GetCaretInfo(o);var r=Math.trunc(this.GetLineBlankSpace(i)/2),s=n.rect.inFlate(0,-r,!0);switch(this.FStyle.ParaStyles[this.FItems[e].ParaNo].AlignVert){case Fr:o.Y=o.Y+r+(s.height-t.Height)/2;break;case vr:o.Y=o.Y+r;break;default:o.Y=o.Y+r+s.height-t.Height}}},{key:"GetItemActualOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return lp.GetTextActualOffset(this.FItems[t].Text,e,i)}},{key:"GetItemOffsetAfter",value:function(t){return this.FItems[t].StyleNot&&this.FDrawItems[o].rect.top=e){n=r-1;break}return n<0&&(n=this.FDrawItems.count-1),{a:i,b:n}}},{key:"GetItemLastDrawItemNo",value:function(t){var e=-1;if(this.FItems[t].FirstDItemNo<0)return e;for(e=this.FItems[t].FirstDItemNo+1;ethis.FSelectInfo.StartItemNo&&t=this.FSelectInfo.StartItemOffset&&e<=this.FSelectInfo.EndItemOffset:e>=this.FSelectInfo.StartItemOffset:t==this.FSelectInfo.EndItemNo&&(i=e<=this.FSelectInfo.EndItemOffset)),i)}},{key:"CoordToDrawItem",value:function(t,e,i,n,o){n=t,o=e;var r=this.FDrawItems[i].rect.inFlate(0,-Math.trunc(this.GetLineBlankSpace(i)/2),!0);if(n-=r.left,o-=r.top,this.FItems[this.FDrawItems[i].ItemNo].StyleNocs.Null&&this.FItems[t].Length>0)for(var n,o=this.FItems[t].FirstDItemNo;o<=this.FDrawItems.count-1&&(n=this.FDrawItems[o]).ItemNo==t;o++)if(e-n.CharOffs=0&&this.FSelectInfo.EndItemNo<0&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo=0&&this.FItems[n].StyleNo=0)return this.FCaretDrawItemNo;var t=-1;if(this.FSelectInfo.StartItemNo<0);else{var e=-1;if(e=this.SelectExists()&&this.FSelectInfo.EndItemNo>=0?this.FSelectInfo.EndItemNo:this.FSelectInfo.StartItemNo,this.FItems[e].StyleNo=0&&(i.y=i.y+Math.trunc(this.FStyle.LineSpaceMin/2),t.x=t.x+i.x,t.y=t.y+i.y)}return t}},{key:"IsRectItem",value:function(t){return this.FItems[t].StyleNo0&&d--,d>0&&(u=c%d,c=Math.trunc(c/d));for(var y=0,p=0,S=0;S<=f.count-2;S++)if(m&&S==f.count-2?p=0:(u>0?(p=c+1,u--):p=c,y+=p),h[f[S+1]-1-1]+y>a){for(var v=f[S];va){a>(lp.UNPLACEHOLDERCHAR?y-Math.trunc(p/2)+lp.GetCharHalfFarfromUN(r,v,h):y-Math.trunc(p/2)+lp.GetCharHalfFarfrom(v,h))?i=v:(i=v-1,lp.UNPLACEHOLDERCHAR&&lp.IsUnPlaceHolderChar(r[i+1-1])&&(i=lp.GetTextActualOffset(r,i)-1));break}break}}}return i}},{key:"GetSelectStartDrawItemNo",value:function(){var t=-1;return this.FSelectInfo.StartItemNo<0||(t=this.GetDrawItemNoByOffset(this.FSelectInfo.StartItemNo,this.FSelectInfo.StartItemOffset),this.FSelectInfo.EndItemNo>=0&&t=0&&((t=this.FItems[this.FSelectInfo.StartItemNo]).Active=!1,t.DisSelect());var e=this.SelectExists();if(e){for(var i=this.FSelectInfo.StartItemNo+1;i<=this.FSelectInfo.EndItemNo;i++)(t=this.FItems[i]).Active=!1,t.DisSelect();this.FSelectInfo.EndItemNo=-1,this.FSelectInfo.EndItemOffset=-1}return this.FSelectInfo.StartItemNo=-1,this.FSelectInfo.StartItemOffset=-1,e}},{key:"SelectedCanDrag",value:function(){var t=!0;if(this.FSelectInfo.EndItemNo<0)this.FSelectInfo.StartItemNo>=0&&(t=this.FItems[this.FSelectInfo.StartItemNo].CanDrag());else for(var e=this.FSelectInfo.StartItemNo;e<=this.FSelectInfo.EndItemNo;e++){if(this.FItems[e].StyleNo=0&&(this.FSelectInfo.EndItemNo<0||this.FSelectInfo.StartItemNo==this.FSelectInfo.EndItemNo)&&this.FItems[this.FSelectInfo.StartItemNo].isClass(rl))&&this.FItems[this.FSelectInfo.StartItemNo].Resizing}},{key:"IsEmptyData",value:function(){return 1==this.FItems.count&&this.IsEmptyLine(0)}},{key:"IsEmptyLine",value:function(t){return this.FItems[t].StyleNo>cs.Null&&""==this.FItems[t].Text}},{key:"ApplyParaAlignHorz",value:function(t){var e=new Pl;e.Align=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaAlignVert",value:function(t){var e=new Dl;e.Align=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaBackColor",value:function(t){var e=new Rl;e.BackColor=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaBreakRough",value:function(t){var e=new _l;e.BreakRough=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaLineSpace",value:function(t,e){var i=new bl;i.SpaceMode=t,i.Space=e,this.ApplySelectParaStyle(i)}},{key:"ApplyParaLeftIndent",value:function(t){var e=new Al;e.Indent=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaRightIndent",value:function(t){var e=new Tl;e.Indent=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaFirstIndent",value:function(t){var e=new xl;e.Indent=t,this.ApplySelectParaStyle(e)}},{key:"ApplyBullet",value:function(t,e,i,n){}},{key:"ApplySelectTextStyle",value:function(t){}},{key:"ApplySelectParaStyle",value:function(t){}},{key:"ApplyTableCellAlign",value:function(t){}},{key:"DeleteSelected",value:function(){return!1}},{key:"DeleteItemDirect",value:function(t){this.FItems.delete(t)}},{key:"ApplyTextStyle",value:function(t){var e=new vl;e.FontStyle=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextStyleNo",value:function(t){var e=new Cl;e.StyleNo=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextFontName",value:function(t){var e=new Fl;e.FontName=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextFontSize",value:function(t){var e=new Il;e.FontSize=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextColor",value:function(t){var e=new gl;e.Color=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextBackColor",value:function(t){var e=new wl;e.Color=t,this.ApplySelectTextStyle(e)}},{key:"DrawItemSelectAll",value:function(t,e){var i=this.GetSelectStartDrawItemNo(),n=this.GetSelectEndDrawItemNo();return(ie||n==e&&this.SelectInfo.EndItemOffset==this.FDrawItems[n].CharOffsetEnd())}},{key:"DrawTextJsutify",value:function(t,e,i,n,o){var r=e.left,s=i.length,a=t.getTextExtentExPoint(i,s),l=e.width-a[s-1];if(l>0){var h=new V,c=this.GetJustifyCount(i,h);n&&c>0&&c--;var u=0;c>0&&(u=l%c,l=Math.trunc(l/c)),r=0;for(var f,d=0,m=0;m<=h.count-2;m++)s=h[m+1]-h[m],f=i.substr(h[m]-1,s),m>0&&(r=a[h[m]-2]+d),t.textOut(e.left+r,o,f),n&&m==h.count-2||(u>0?(d+=l+1,u--):d+=l)}else t.textOut(r,o,i,a)}},{key:"PaintDataRange",value:function(t,e,i,n,o,r,s,a,l,h,c){if(!(a<0||l<0)){var u=-1,f=-1,d=-1,m=-1,y=!1;c.Print||(f=(u=this.GetSelectStartDrawItemNo())<0?-1:this.FSelectInfo.StartItemOffset-this.FDrawItems[u].CharOffs+1,m=(d=this.GetSelectEndDrawItemNo())<0?-1:this.FSelectInfo.EndItemOffset-this.FDrawItems[d].CharOffs+1,y=this.DrawItemSelectAll(a,l));var p=cs.Null,S=cs.Null,v=0,F=e-s;h.save();try{var I,g,w,C=-1;this.FDrawItems[a].LineFirst||(C=this.GetLineBlankSpace(a));for(var k,P,D,b=dr,R=a;R<=l;R++)if(I=this.FDrawItems[R],k=this.FItems[I.ItemNo],g=I.rect.offset(t,F,!0),I.LineFirst&&(C=this.GetLineBlankSpace(R)),w=g.inFlate(0,-Math.trunc(C/2),!0),k.Visible){if(this.DrawItemPaintBefor(this,I.ItemNo,R,g,w,t,i,n,o,r,h,c),S!=k.ParaNo&&(S=k.ParaNo,b=this.FStyle.ParaStyles[k.ParaNo].AlignHorz),k.StyleNo=0&&(h.brush.color=this.FStyle.SelColor,u==d&&R==u?h.fillRect(U.Create(g.left+this.GetDrawItemOffsetWidth(R,f),g.top,g.left+this.GetDrawItemOffsetWidth(R,m,this.FStyle.TempCanvas),Math.min(g.bottom,r))):R==u?h.fillRect(U.Create(g.left+this.GetDrawItemOffsetWidth(R,f,this.FStyle.TempCanvas),g.top,g.right,Math.min(g.bottom,r))):R==d?h.fillRect(U.Create(g.left,g.top,g.left+this.GetDrawItemOffsetWidth(R,m,this.FStyle.TempCanvas),Math.min(g.bottom,r))):R>u&&Rs&&(s=r,o=a);var l=this.GetDrawItemStyle(o);return l=cs.Null?e=this.CalculateLineHeight(this.FStyle.TextStyles[this.GetDrawItemStyle(t)],this.FStyle.ParaStyles[this.GetDrawItemParaStyle(t)]):i==cs.Bullet&&(i=this.FItems[this.FDrawItems[t].ItemNo].TextStyleNo,e=this.CalculateLineHeight(this.FStyle.TextStyles[i],this.FStyle.ParaStyles[this.GetDrawItemParaStyle(t)])),e}},{key:"SelectStartItemBoundary",value:function(){return this.FSelectInfo.StartItemNo>=0&&(0==this.FSelectInfo.StartItemOffset||(this.FSelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.FSelectInfo.StartItemNo)))}},{key:"SelectExists",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!1;return this.FSelectInfo.StartItemNo>=0&&(this.FSelectInfo.EndItemNo>=0?e=this.FSelectInfo.StartItemNo!=this.FSelectInfo.EndItemNo||this.FSelectInfo.StartItemOffset!=this.FSelectInfo.EndItemOffset:t&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo0)if(e!=n){var l=!1;this.DoSaveItem(e)?(this.FItems[e].SaveToStreamRange(t,i,this.FItems[e].Length),a++):l=this.FItems[e].ParaFirst;for(var h=e+1;h<=n-1;h++)if(this.DoSaveItem(h)){if(l&&!this.FItems[h].ParaFirst){this.FItems[h].ParaFirst=!0;try{this.FItems[h].SaveToStream(t)}finally{this.FItems[h].ParaFirst=!1}l=!1}else this.FItems[h].SaveToStream(t);a++}else l=l||this.FItems[h].ParaFirst;if(this.DoSaveItem(n)){if(l&&!this.FItems[n].ParaFirst){this.FItems[n].ParaFirst=!0;try{this.FItems[n].SaveToStreamRange(t,0,o)}finally{this.FItems[n].ParaFirst=!1}}else this.FItems[n].SaveToStreamRange(t,0,o);a++}}else this.DoSaveItem(e)&&(this.FItems[e].SaveToStreamRange(t,i,o),a++);var c=t.position;t.position=r,r=c-r-8,t.writeUInt64(r),s!=a&&t.writeInt32(a),t.position=c}},{key:"SaveToStream",value:function(t){this.SaveToStreamRange(t,0,0,this.FItems.count-1,this.FItems.last.Length)}},{key:"SaveToStreamRange",value:function(t,e,i,n,o){this.SaveItemToStream(t,e,i,n,o)}},{key:"SaveToText",value:function(){return this.SaveToTextRange(0,0,this.FItems.count-1,this.GetItemOffsetAfter(this.FItems.count-1))}},{key:"SaveToTextRange",value:function(t,e,i,n){var o="";if(i-t+1>0)if(t!=i){var r=!1;this.FItems[t].Visible&&this.DoSaveItem(t)?o=this.FItems[t].StyleNo>cs.Null?this.FItems[t].SubStringEffective(e+1,this.FItems[t].Length-e):this.FItems[t].SelectExists()?this.FItems[t].SaveSelectToText():this.FItems[t].Text:r=this.FItems[t].ParaFirst;for(var s="",a=t+1;a<=i-1;a++)this.FItems[a].Visible&&this.DoSaveItem(a)?(s=this.FItems[a].StyleNo>cs.Null?this.FItems[a].TextEffective():this.FItems[a].Text,r||this.FItems[a].ParaFirst?o+=lp.sLineBreak+s:o+=s,r&&!this.FItems[a].ParaFirst&&(r=!1)):r=r||this.FItems[a].ParaFirst;this.FItems[i].Visible&&this.DoSaveItem(i)&&(this.FItems[i].StyleNo>cs.Null?((r||this.FItems[i].ParaFirst)&&(o+=lp.sLineBreak),o+=this.FItems[i].SubStringEffective(1,n)):((r||this.FItems[i].ParaFirst)&&(o+=lp.sLineBreak),n==lp.OffsetAfter?o+=this.FItems[i].Text:o+=this.FItems[i].SaveSelectToText()))}else this.FItems[t].Visible&&this.DoSaveItem(t)&&(o=this.FItems[t].StyleNo>cs.Null?this.FItems[t].SubStringEffective(e+1,n-e):this.FItems[t].SelectExists()?this.FItems[t].SaveSelectToText():this.FItems[t].Text);return o}},{key:"SaveSelectToStream",value:function(t){this.SelectExists()?this.FSelectInfo.EndItemNo<0&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo"),i+=lp.sLineBreak+'

'),i+=lp.sLineBreak+this.FItems[r].ToHtml());return i+lp.sLineBreak+"

"}},{key:"ToXml",value:function(t){var e;t.SetAttribute("itemcount",this.FItems.count.toString());for(var i=0;i0)return 1;var n=t.x-e.x;return n<0?-1:n>0?1:0}},{key:"_addRectPath",value:function(t){var e,i=G.CreateByPoint(t.leftTop),n=G.CreateByPoint(t.rightTop),o=G.CreateByPoint(t.rightBottom),r=G.CreateByPoint(t.leftBottom);if(0==this.count)return(e=new ch).add(i),e.add(n),e.add(o),e.add(r),e.rbIndex=2,void this.add(e);var s,a=!1;if(s=(e=this.last)[e.rbIndex],(r.equal(s)||r.equal(e[e.rbIndex+1]))&&(e[e.rbIndex-1].resetByPoint(n),s.resetByPoint(o),a=!0),a||((e=new ch).add(i),e.add(n),e.add(o),e.add(r),e.rbIndex=2,this.add(e)),this.count>1){e=this.last;var l=this[this.count-2],h=e[0],c=e[1];h.y==l[l.rbIndex].y&&c.x>l[l.rbIndex+1].x&&(h.x==l[l.rbIndex+1].x?l[l.rbIndex+1].resetByPoint(e[3]):(l.insert(l.rbIndex+1,e[0]),l.insert(l.rbIndex+1,e[3])),l.insert(l.rbIndex+1,e[2]),l.insert(l.rbIndex+1,e[1]),l.rbIndex+=2,this.delete(this.count-1))}}},{key:"combineRect",value:function(t){this._addRectPath(t)}},{key:"frameRgn",value:function(t){for(var e,i=0;i=0&&this.EndRow<0}},{key:"SameRow",value:function(){return this.StartRow>=0&&this.StartRow==this.EndRow}},{key:"SameCol",value:function(){return this.StartCol>=0&&this.StartCol==this.EndCol}},{key:"SelectExists",value:function(){return this.StartRow>=0&&this.EndRow>=0}}]),i}(L),Ah=0,Th=1,Oh=2,Nh=function(t){ph(i,t);var e=vh(i);function i(t){var n;return gh(this,i),(n=e.call(this)).FCellData=new lp.TableCellData(t),n.FAlignVert=Ah,n.FBorderSides=new Dp,n.FBorderSides.add(fp.Left),n.FBorderSides.add(fp.Top),n.FBorderSides.add(fp.Right),n.FBorderSides.add(fp.Bottom),n.FBackgroundColor=t.BackgroundColor,n.FRowSpan=0,n.FColSpan=0,n.FWidth=0,n.FHeight=0,n}return yh(i,[{key:"GetActive",value:function(){return null!=this.FCellData&&this.FCellData.Active}},{key:"SetActive",value:function(t){null!=this.FCellData&&(this.FCellData.Active=t)}},{key:"SetHeight",value:function(t){this.FHeight!=t&&(this.FHeight=t,null!=this.FCellData&&(this.FCellData.CellHeight=t))}},{key:"dispose",value:function(){dh(Ih(i.prototype),"dispose",this).call(this),null!=this.FCellData&&this.FCellData.dispose()}},{key:"MouseDown",value:function(t,e,i){if(this.Active=!0,null!=this.FCellData){var n=new ei;n.assign(t),n.x-=e,n.y-=this.GetCellDataTop(i),this.FCellData.MouseDown(n)}}},{key:"MouseMove",value:function(t,e,i){if(null!=this.FCellData){var n=new ei;n.assign(t),n.x-=e,n.y-=this.GetCellDataTop(i),this.FCellData.MouseMove(n)}}},{key:"MouseUp",value:function(t,e,i){if(null!=this.FCellData){var n=new ei;n.assign(t),n.x-=e,n.y-=this.GetCellDataTop(i),this.FCellData.MouseUp(n)}}},{key:"IsMergeSource",value:function(){return null==this.FCellData}},{key:"IsMergeDest",value:function(){return this.FRowSpan>0||this.FColSpan>0}},{key:"ClearFormatExtraHeight",value:function(){return null!=this.FCellData?this.FCellData.ClearFormatExtraHeight():0}},{key:"SaveToStream",value:function(t){t.writeInt32(this.FWidth),t.writeInt32(this.FHeight),t.writeInt32(this.FRowSpan),t.writeInt32(this.FColSpan),t.writeByte(this.FAlignVert),lp.HCSaveColorToStream(t,this.FBackgroundColor),t.writeByte(this.FBorderSides.value);var e=null==this.FCellData;t.writeBoolean(e),e||this.FCellData.SaveToStream(t)}},{key:"LoadFromStream",value:function(t,e,i){this.FWidth=t.readInt32(),this.FHeight=t.readInt32(),this.FRowSpan=t.readInt32(),this.FColSpan=t.readInt32(),i>11&&(this.FAlignVert=t.readByte(),this.FBackgroundColor=lp.HCLoadColorFromStream(t)),i>13&&(this.FBorderSides.value=t.readByte()),t.readBoolean()?(this.FRowSpan<0||this.FColSpan<0)&&(this.FCellData.dispose(),this.FCellData=null):(this.FCellData.LoadFromStream(t,e,i),this.FCellData.CellHeight=this.FHeight)}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"GetCellDataTop",value:function(t){switch(this.FAlignVert){case Ah:return t;case Th:return t+Math.trunc((this.FHeight-t-this.FCellData.height-t)/2);default:return this.FHeight-t-this.FCellData.height}}},{key:"GetCaretInfo",value:function(t,e,i,n,o){null!=this.FCellData?(this.FCellData.GetCaretInfo(t,e,o),o.Visible&&(o.X+=i,o.Y+=this.GetCellDataTop(n))):o.Visible=!1}},{key:"PaintTo",value:function(t,e,i,n,o,r,s,a,l,h,c){if(null!=this.FCellData){if(!c.Print&&""!=this.FCellData.Script){h.pen.width=1,h.pen.color=at.Gray,h.pen.style=pt.Solid,h.beginPath();try{h.moveTo(i-5,e),h.lineTo(i,e),h.moveTo(i-4,e+1),h.lineTo(i,e+1),h.moveTo(i-3,e+2),h.lineTo(i,e+2),h.moveTo(i-2,e+3),h.lineTo(i,e+3),h.moveTo(i-1,e+4),h.lineTo(i,e+4),h.moveTo(i,e+5),h.lineTo(i,e+5)}finally{h.paintPath()}}var u=e+this.GetCellDataTop(l);this.FCellData.PaintData(t+a,u,i-a,n,o,r,s,h,c)}}},{key:"CellData",get:function(){return this.FCellData},set:function(t){this.FCellData=t}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.FWidth=t}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.SetHeight(t)}},{key:"RowSpan",get:function(){return this.FRowSpan},set:function(t){this.FRowSpan=t}},{key:"ColSpan",get:function(){return this.FColSpan},set:function(t){this.FColSpan=t}},{key:"BackgroundColor",get:function(){return this.FBackgroundColor},set:function(t){this.FBackgroundColor=t}},{key:"Active",get:function(){return this.GetActive()},set:function(t){this.SetActive(t)}},{key:"AlignVert",get:function(){return this.FAlignVert},set:function(t){this.FAlignVert=t}},{key:"BorderSides",get:function(){return this.FBorderSides},set:function(t){this.FBorderSides=t}}]),i}(L);function Bh(t){return(Bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eh(t,e){for(var i=0;it&&(t=this[e].CellData.height);return t}},{key:"SetRowWidth",value:function(t){for(var e=Math.trunc(t/this.count),i=0;i<=this.count-2;i++)this[i].Width=e;this.last.Width=t-(this.count-1)*e}},{key:"SetHeight",value:function(t){if(this.FHeight!=t){var e=this.CalcMaxCellDataHeight()+this.GetVPadding()+this.GetVPadding();this.FHeight=ethis.FRows.count-1)&&!(e<0||e>this.FColWidths.count-1)}},{key:"getCellText",value:function(t,e){if(this._safeRowCol(t,e))return null!=this.FRows[t][e].CellData?this.FRows[t][e].CellData.Items[0].Text:""}},{key:"setCellText",value:function(t,e,i){this._safeRowCol(t,e)&&""!=i&&null!=this.FRows[t][e].CellData&&(this.FRows[t][e].CellData.Items[0].Text=i)}},{key:"setCellColor",value:function(t,e,i){this._safeRowCol(t,e)&&(this.FRows[t][e].BackgroundColor=i)}},{key:"DoCheckCellScript",value:function(t,e){for(var i=this.FRows.count,n=this.FColWidths.count,o=!1,r=null,s=0;s=0);r++)for(var s=0;s=0&&(this.FSelectCellRang.SetStart(n,o),this.OwnerData.ItemSetCaretRequest(this.OwnerData.GetItemNo(this),lp.OffsetInner))}},{key:"DoCellDataGetFormatTop",value:function(t){for(var e=0,i=!1,n=0;n=0&&e>=0&&this.DoCheckCellScript(t,e)}},{key:"DoRowAdd",value:function(t){var e=this;t.OnGetVPaddingPix=function(){return e.DoRowGetVPaddingPix()},t.OnGetDefaultRowHeight=function(){return e.DoRowGetDefaultRowHeight()};for(var i=null,n=0;nthis.FRows[t].Height&&(this.FRows[t].AutoHeight=!0,this.FRows[t].Height=e)}},{key:"CalcMergeRowHeightFrom",value:function(t){for(var e=-1,i=-1,n=0,o=0,r=-1,s=-1,a=t;athis.FRows[a].FmtOffset+this.FRows[a].Height){o=n-this.FRows[a].FmtOffset-this.FRows[a].Height,this.FRows[a].Height=n-this.FRows[a].FmtOffset;for(var u=0;ue;)i+=this.FRows[n].Height+this.FBorderWidthPix+this.FRows[n].FmtOffset,n--;return i+this.FRows[e].Height}},{key:"GetCellPostion",value:function(t,e){for(var i=G.Create(this.FBorderWidthPix,this.FBorderWidthPix),n=0;n0&&void 0!==arguments[0]?arguments[0]:-1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(this.FSelectCellRang.StartRow>=0){var i=null;this.FSelectCellRang.StartRow==t&&this.FSelectCellRang.StartCol==e||(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1);for(var n=this.FSelectCellRang.StartRow;n<=this.FSelectCellRang.EndRow;n++)for(var o=this.FSelectCellRang.StartCol;o<=this.FSelectCellRang.EndCol;o++)n==t&&o==e||(this.FRows[n][o].Active=!1,null!=(i=this.FRows[n][o].CellData)&&(i.DisSelect(),i.InitializeField()))}}},{key:"SetBorderWidthPt",value:function(t){this.FBorderWidthPt!=t&&(this.FBorderWidthPt=t,this.FBorderWidthPix=sr.ptToPixel(this.FBorderWidthPt,sr.PixelsPerInchX),this.FormatDirty())}},{key:"SetCellVPaddingMM",value:function(t){this.FCellVPaddingMM!=t&&(this.FCellVPaddingMM=t,this.FCellVPaddingPix=sr.millimeterToPixY(this.FCellVPaddingMM),this.FormatDirty())}},{key:"SetCellHPaddingMM",value:function(t){this.FCellHPaddingMM!=t&&(this.FCellHPaddingMM=t,this.FCellHPaddingPix=sr.millimeterToPixX(this.FCellHPaddingMM),this.FormatDirty())}},{key:"CanDrag",value:function(){var t=jh(Zh(i.prototype),"CanDrag",this).call(this);return t&&(t=this.FSelectCellRang.EditCell()?this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectedCanDrag():this.IsSelectComplate||this.IsSelectPart),t}},{key:"GetSelectComplate",value:function(){return 0==this.FSelectCellRang.StartRow&&0==this.FSelectCellRang.StartCol&&this.FSelectCellRang.EndRow==this.FRows.count-1&&this.FSelectCellRang.EndCol==this.FColWidths.count-1}},{key:"SelectComplate",value:function(){this.SelectRange(0,0,this.RowCount-1,this.FColWidths.count-1)}},{key:"GetResizing",value:function(){return jh(Zh(i.prototype),"GetResizing",this).call(this)||this.ActiveDataResizing()}},{key:"SetResizing",value:function(t){jh(Zh(i.prototype),"SetResizing",this).call(this,t)}},{key:"DoCreateRow",value:function(t,e){return new Uh(t,e)}},{key:"CheckRowBorderShouLian",value:function(t,e,i,n,o,r){if(0==o){for(var s=n.top+this.FBorderWidthPix-1,a=0;a0){if(t!=r)return{shouLian:o=s-this.FBorderWidthPix,firstDrawRow:r};if(s+this.FRows[t].FmtOffset+this.FRows[t].Height<=e)return{shouLian:o=s+this.FRows[t].FmtOffset+this.FRows[t].Height,firstDrawRow:r}}s+=this.FRows[t].FmtOffset;for(var l,h,c,u=0,f=0,d=-1,m=-1,y=0,p=null,S=this.FRows[t].ColCount,v=!1,F=0;Fe){o=I>0?e-f-c-p.DrawItems[I-1].rect.bottom>this.FCellVPaddingPix?Math.max(o,f+c+p.DrawItems[I-1].rect.bottom+this.FCellVPaddingPix):Math.max(o,f+c+p.DrawItems[I-1].rect.bottom):Math.max(o,f-this.FBorderWidthPix),v=!0;break}u=Math.max(u,f+c+h.bottom)}}o=v?Math.max(o,u):Math.min(i,s+this.FRows[t].FmtOffset+this.FRows[t].Height)}return{shouLian:o,firstDrawRow:r}}},{key:"DoDrawPageBreakMark",value:function(t,e,i,n,o){e.pen.color="gray",e.pen.style=pt.Dot,e.pen.width=1,t?(e.drawLineDriect(i+5,n-1,i+20,n-1),e.pen.style=pt.Solid,e.drawLineByPointsDriect([G.Create(i+19,n-2),G.Create(i+19,n-10),G.Create(i+5,n-10),G.Create(i+5,n-2)])):(e.drawLineDriect(i+5,o+1,i+20,o+1),e.pen.style=pt.Solid,e.drawLineByPointsDriect([G.Create(i+19,o+3),G.Create(i+19,o+10),G.Create(i+5,o+10),G.Create(i+5,o+3)])),e.pen.color="black"}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){for(var l,h,c,u,f,d,m=-1,y=0,p=0,S=0,v=0,F=0,I=0,g=0,w=0,C=0,k=0,P=0,D=0,b=0,R=0,_=!1,x=Math.trunc(this.FBorderWidthPix/2),A=!1,T=e.top+this.FBorderWidthPix,O=this.FRows.count,N=0,B=this.FColWidths.length,E=0;E=r){m<0&&this.IsBreakRow(E)&&(A=this.FFixRow>=0&&E>this.FFixRow+this.FFixRowCount-1);break}if((y=T-this.FCellVPaddingPix+this.FRows[E].Height-this.FCellVPaddingPix)<=o)T=y+this.FCellVPaddingPix+this.FBorderWidthPix;else{m<0&&(m=E,A=this.FFixRow>=0&&E>this.FFixRow+this.FFixRowCount-1),p=e.left+this.FBorderWidthPix,S=0,N=this.FRows[E].ColCount;for(var M=0;Mr)if(D=0,this.FRows[E][M].RowSpan>0)for(D=l,g=E;gr){D>n&&(S=(h=this.CheckRowBorderShouLian(g,n,r,e,S,m)).shouLian,m=h.firstDrawRow,C=S);break}g++}else if(this.FRows[E][M].RowSpan<0)if(E!=m)d=!1;else{D=l;for(var L=F;Lr){D>n&&(S=(h=this.CheckRowBorderShouLian(g,n,r,e,S,m)).shouLian,m=h.firstDrawRow,C=S);break}g++}}else this.IsBreakRow(E)&&(S=(h=this.CheckRowBorderShouLian(E,n,r,e,S,m)).shouLian,m=h.firstDrawRow,C=S);_&&(k=Math.min(r,T+Math.max(this.FRows[E].Height,this.FRows[F][I].Height)-this.FCellVPaddingPix),c=this.FRows[F][I].CellData,(P=Math.max(o,T-this.FCellVPaddingPix))-vthis.FCellVPaddingPix&&(this.DoCellPaintDataBefor(F,I,u,s,a),this.FRows[F][I].PaintTo(p,v-this.FCellVPaddingPix,p+this.FColWidths[M]+this.GetColSpanWidth(F,I),n,o,r,0,this.FCellHPaddingPix,this.FCellVPaddingPix,s,a),null!=this.FOnCellPaintData&&this.FOnCellPaintData(this,e,u,F,I,v,n,o,r,s,a)))),d&&(a.Print?s.pen.width=Math.max(1,sr.ptToPixel(this.FBorderWidthPt,a.DPI)):s.pen.width=this.FBorderWidthPix,this.FBorderVisible?(s.pen.color=at.Black,s.pen.style=pt.Solid):a.Print||(s.pen.color=lp.clActiveBorder,s.pen.style=pt.Dot,s.pen.width=1),b=p-this.FBorderWidthPix,R=p+this.FColWidths[M]+this.GetColSpanWidth(F,I),this.IsBreakRow(E)&&E==m&&(l-=1),l=0&&(l=o),l+this.FBorderWidthPix>0&&this.FRows[E][M].BorderSides.has(fp.Top)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,l+x),G.Create(R+x,l+x)]):s.drawLineDriect(b+x,l+x,R+x,l+x)),this.FRows[E][M].BorderSides.has(fp.Right)&&(a.Print?a.drawNoScaleLine(s,[G.Create(R+x,l+x),G.Create(R+x,C+x)]):s.drawLineDriect(R+x,l+x,R+x,C+x)),C<=r&&this.FRows[E][M].BorderSides.has(fp.Bottom)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,C+x),G.Create(R+x,C+x)]):s.drawLineDriect(b+x,C+x,R+x+1,C+x)),this.FRows[E][M].BorderSides.has(fp.Left)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,l+x),G.Create(b+x,C+x)]):s.drawLineDriect(b+x,l+x,b+x,C+x)),this.FRows[E][M].BorderSides.has(fp.LTRB)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,l+x),G.Create(R+x,C+x)]):s.drawLineDriect(b+x,l+x,R+x,C+x)),this.FRows[E][M].BorderSides.has(fp.RTLB)&&(a.Print?a.drawNoScaleLine(s,[G.Create(R+x,l+x),G.Create(b+x,C+x)]):s.drawLineDriect(R+x,l+x,b+x,C+x)),this.DoPaintCellBorderSides(s,E,M,b+x,l+x,R+x,C+x),w=M+this.FRows[E][M].ColSpan,a.Print||w!=B-1||((T+this.FRows[E].Height-this.FCellVPaddingPix>n||En&&(this.FRows[E+1].FmtOffset>0||C==n))&&this.DoDrawPageBreakMark(!0,s,R,C,i),0!=m&&E==m&&e.top=0&&this.GetFixColLeft()+e.left<0&&this.PaintFixCols(e.top,0,i,r,s,a),this.Resizing&&this.FResizeInfo.TableSite==Dh?(s.pen.color=this.FBorderColor,s.pen.style=pt.Dot,s.pen.width=1,s.drawLineDriect(e.left+this.FResizeInfo.DestX,Math.max(i,e.top),e.left+this.FResizeInfo.DestX,Math.min(n,Math.min(e.bottom,C)))):this.Resizing&&this.FResizeInfo.TableSite==bh&&(s.pen.color=this.FBorderColor,s.pen.style=pt.Dot,s.pen.width=1,s.drawLineDriect(e.left,e.top+this.FResizeInfo.DestY,e.right,e.top+this.FResizeInfo.DestY))}},{key:"DoCellPaintDataBefor",value:function(t,e,i,n,o){}},{key:"DoCellDataDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OwnerData.OnDrawItemPaintAfter&&this.OwnerData.OnDrawItemPaintAfter(t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoPaintCellBorderSides",value:function(t,e,i,n,o,r,s){}},{key:"DoFormatToDrawItem",value:function(){}},{key:"MouseDown",value:function(t){var e,n=jh(Zh(i.prototype),"MouseDown",this).call(this,t),o=-1,r=-1,s=null,a=new G;this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FSelecting=!1,this.FDraging=!1,this.FOutsideInfo.Row=-1;var l=this.GetCellAt(t.x,t.y,o,r);return this.FResizeInfo=l.resizeInfo,o=l.row,r=l.col,this.Resizing=t.button==ee&&(this.FResizeInfo.TableSite==Dh||this.FResizeInfo.TableSite==bh)&&this.AllowResize,this.Resizing?(this.FMouseDownRow==o&&this.FMouseDownCol==r||(this.FMouseDownRow>=0&&(this.FRows[this.FMouseDownRow][this.FMouseDownCol].Active=!1),this.FMouseDownRow=o,this.FMouseDownCol=r),this.FMouseDownX=t.x,this.FMouseDownY=t.y,this.OwnerData.Style.UpdateInfoRePaint(),n):(this.FResizeInfo.TableSite==Ch?this.CoordInSelect(t.x,t.y)?(this.FMouseLBDowning&&(this.FDraging=!0),this.FMouseDownRow==o&&this.FMouseDownCol==r||(this.FMouseDownRow>=0&&t.button!=ie&&(this.FRows[this.FMouseDownRow][this.FMouseDownCol].Active=!1),this.FMouseDownRow=o,this.FMouseDownCol=r),a=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(e=new ei).assign(t),e.x-=a.x,e.y-=a.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseDown(e,this.FCellHPaddingPix,this.FCellVPaddingPix)):(o==this.FMouseDownRow&&r==this.FMouseDownCol||(null!=(s=this.GetEditCell())&&(s.Active=!1),this.DoSelectCellChange(this.FMouseDownRow,this.FMouseDownCol,o,r),this.OwnerData.Style.UpdateInfoReCaret()),t.button==ee&&or.keyDownStates[Re]||this.DisSelect(),o==this.FMouseDownRow&&r==this.FMouseDownCol||(this.FMouseDownRow=o,this.FMouseDownCol=r),this.FSelectCellRang.SetStart(this.FMouseDownRow,this.FMouseDownCol),a=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(e=new ei).assign(t),e.x-=a.x,e.y-=a.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseDown(e,this.FCellHPaddingPix,this.FCellVPaddingPix)):(this.DisSelect(),this.InitializeMouseInfo(),this.FResizeInfo.TableSite==wh&&(this.FOutsideInfo.Row=o,this.FOutsideInfo.Leftside=t.x<0)),n)}},{key:"AdjustSelectRang",value:function(t,e){if(this.FSelectCellRang.StartRow>=0)for(var i=this.FSelectCellRang.StartRow;i<=this.FSelectCellRang.EndRow;i++)for(var n=this.FSelectCellRang.StartCol;n<=this.FSelectCellRang.EndCol;n++)i==this.FMouseDownRow&&n==this.FMouseDownCol||null!=this.FRows[i][n].CellData&&this.FRows[i][n].CellData.DisSelect();var o,r=-1,s=-1;this.FMouseDownRow<0?(0==t?(this.FMouseDownRow=0,this.FMouseDownCol=0,this.FSelectCellRang.SetStart(this.FMouseDownRow,this.FMouseDownCol),this.FSelectCellRang.SetEnd(t,e)):(r=(o=this.GetDestCell(this.RowCount-1,this.FColWidths.count-1)).row,s=o.col,this.FMouseDownRow=r,this.FMouseDownCol=s,this.FSelectCellRang.SetStart(t,e),this.FSelectCellRang.SetEnd(this.FMouseDownRow,this.FMouseDownCol)),this.FOutSelectInto=!0):this.FMouseMoveRow>this.FMouseDownRow?(this.FSelectCellRang.StartRow=this.FMouseDownRow,this.FSelectCellRang.EndRow=this.FMouseMoveRow,this.FMouseMoveColthis.FMouseDownCol?(this.FSelectCellRang.StartCol=this.FMouseDownCol,this.FSelectCellRang.EndCol=this.FMouseMoveCol):this.FMouseMoveCol=0&&this.FMouseMoveCol>=0&&null!=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData&&this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData.MouseLeave(),this.FMouseMoveRow=o,this.FMouseMoveCol=r),this.FMouseMoveRow<0||this.FMouseMoveCol<0)return!0;e=this.GetCellPostion(this.FMouseMoveRow,this.FMouseMoveCol),(n=new ei).assign(t),n.x-=e.x,n.y-=e.y,this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].MouseMove(n,this.FCellHPaddingPix,this.FCellVPaddingPix)}else this.FMouseMoveRow>=0&&this.FMouseMoveCol>=0&&null!=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData&&this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData.MouseLeave(),this.FMouseMoveRow=-1,this.FMouseMoveCol=-1,this.AllowResize&&(a.TableSite==Dh?lp.GCursor=ce:a.TableSite==bh&&(lp.GCursor=ve));return this.OwnerData.Style.UpdateInfo.DragingSelected&&this.FSelectCellRang.SetStart(this.FMouseMoveRow,this.FMouseMoveCol),!0}},{key:"MouseUp",value:function(t){var e=new G;if(this.FMouseLBDowning=!1,this.ActiveDataResizing()){e=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol);var i=new ei;return i.assign(t),i.x-=e.x,i.y-=e.y,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].MouseUp(i,this.FCellHPaddingPix,this.FCellVPaddingPix),!0}var n,o,r,s=-1,a=-1;return this.Resizing?(this.FResizeInfo.TableSite==Dh?(e.x=t.x-this.FMouseDownX,0!=e.x&&(n=(o=this.GetCellAt(this.FMouseDownX,this.FMouseDownY,s,a,!1)).resizeInfo,s=o.row,a=o.col,n.TableSite!=wh&&0!=e.x&&(e.x>0?athis.OwnerData.Width&&(e.x=this.OwnerData.Width-this.FColWidths[a+1]),this.Undo_ColResize(a,this.FColWidths[a],this.FColWidths[a]+e.x),this.FColWidths[a]=this.FColWidths[a]+e.x):(this.FColWidths[a]+e.x=0&&!this.FOutSelectInto&&(e=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix)),n=(o=this.GetCellAt(t.x,t.y,s,a)).resizeInfo,s=o.row,a=o.col,n.TableSite==Ch&&(s==this.FMouseDownRow&&a==this.FMouseDownCol||(e=this.GetCellPostion(s,a),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[s][a].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix)))):this.FDraging||this.OwnerData.Style.UpdateInfo.DragingSelected?(this.FDraging=!1,n=(o=this.GetCellAt(t.x,t.y,s,a)).resizeInfo,s=o.row,a=o.col,n.TableSite==Ch&&(this.DisSelect(),this.FMouseMoveRow=s,this.FMouseMoveCol=a,this.FSelectCellRang.StartRow=s,this.FSelectCellRang.StartCol=a,e=this.GetCellPostion(s,a),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[s][a].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix))):this.FMouseDownRow>=0&&(e=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix)),!0)}},{key:"MouseLeave",value:function(){jh(Zh(i.prototype),"MouseLeave",this).call(this),this.FMouseMoveRow<0||this.FMouseMoveCol<0||(null!=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData&&this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData.MouseLeave(),this.SelectExists()||this.InitializeMouseInfo())}},{key:"ClearFormatExtraHeight",value:function(){if(this.Height==this.FFormatHeight)return 0;for(var t,e=this.Height,i=-1,n=0,o=this.FRows.count-1;o>=0;o--){0!=this.FRows[o].FmtOffset&&(i=o,this.FRows[o].FmtOffset=0);for(var r=0;r=0&&(this.CalcMergeRowHeightFrom(i),this.Height=this.GetFormatHeight(),n=e-this.Height),n}},{key:"DeleteSelected",value:function(){var t=this,e=jh(Zh(i.prototype),"DeleteSelected",this).call(this);if(this.FSelectCellRang.StartRow>=0)if(this.FSelectCellRang.EndRow>=0){this.FMulCellUndo.Enable=!0;try{var n=this.GetSelfUndoList();n.UndoGroupBegin(0,0);try{for(var o=this.FSelectCellRang.StartRow;o<=this.FSelectCellRang.EndRow;o++)for(var r=this.FSelectCellRang.StartCol;r<=this.FSelectCellRang.EndCol;r++)null!=this.FRows[o][r].CellData&&(this.FMulCellUndo.Init(o,r),this.FRows[o][r].CellData.DeleteSelected())}finally{n.UndoGroupEnd(0,0)}}finally{this.FMulCellUndo.Enable=!1}this.FormatDirty(),e=!0}else{this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e=t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol].CellData.DeleteSelected()}))}return e}},{key:"DisSelect",value:function(){jh(Zh(i.prototype),"DisSelect",this).call(this),this.DisSelectSelectedCell(),this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.FSelecting=!1,this.FDraging=!1,this.FOutSelectInto=!1}},{key:"MarkStyleUsed",value:function(t){jh(Zh(i.prototype),"MarkStyleUsed",this).call(this,t);for(var e=0;e<=this.FRows.count-1;e++)for(var n=0;n=0?this.FOutsideInfo.Row:this.FRows.count-1,this.FOutsideInfo.Leftside&&(t.X=t.X-2),o=0;for(var s=this.FPageBreaks.count-1;s>=0;s--)if(this.FPageBreaks[s].Row<=e&&this.FPageBreaks[s].PageIndex==t.PageIndex-1){o=this.FPageBreaks[s].BreakBottom;break}r=this.Height;for(var a=0;a<=this.FPageBreaks.count-1;a++)if(this.FPageBreaks[a].Row>=e&&this.FPageBreaks[a].PageIndex==t.PageIndex){r=this.FPageBreaks[a].BreakSeat;break}return t.Y=t.Y+o,void(t.Height=r-o)}if(n=this.FRows[e][i],this.OwnerData.Style.UpdateInfo.DragingSelected){if(n.CellData.MouseMoveItemNo<0||n.CellData.MouseMoveItemOffset<0)return void(t.Visible=!1);n.GetCaretInfo(n.CellData.MouseMoveItemNo,n.CellData.MouseMoveItemOffset,this.FCellHPaddingPix,this.FCellVPaddingPix,t)}else{if(n.CellData.SelectInfo.StartItemNo<0||n.CellData.SelectInfo.StartItemOffset<0)return void(t.Visible=!1);n.GetCaretInfo(n.CellData.SelectInfo.StartItemNo,n.CellData.SelectInfo.StartItemOffset,this.FCellHPaddingPix,this.FCellVPaddingPix,t)}var l=this.GetCellPostion(e,i);t.X=l.x+t.X,t.Y=l.y+t.Y}},{key:"SetActive",value:function(t){if(this.Active!=t){var e=this.GetEditCell();null!=e&&(e.Active=t),t||(this.DoSelectCellChange(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,-1,-1),this.InitializeMouseInfo()),jh(Zh(i.prototype),"SetActive",this).call(this,t)}}},{key:"DoSelfUndoNew",value:function(){if(this.FMulCellUndo.Enable){var t=new Ca,e=new na;return e.Row=this.FMulCellUndo.Row,e.Col=this.FMulCellUndo.Col,t.Data=e,t}if(this.FSelectCellRang.EditCell()){var n=new Ca,o=new ia;return o.Row=this.FSelectCellRang.StartRow,o.Col=this.FSelectCellRang.StartCol,n.Data=o,n}return jh(Zh(i.prototype),"DoSelfUndoNew",this).call(this)}},{key:"DoSelfUndoDestroy",value:function(t){t.Data.isClass(ia)&&(t.Data.dispose(),t.Data=null),jh(Zh(i.prototype),"DoSelfUndoDestroy",this).call(this,t)}},{key:"DoSelfUndo",value:function(t){var e=this;if(this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),t.Data)if(t.Data.isClass(na)){var n=t.Data;this.FRows[n.Row][n.Col].CellData.Undo(t),this.FormatDirty()}else if(t.Data.isClass(ia)){var o=t.Data;this.FSelectCellRang.StartRow=o.Row,this.FSelectCellRang.StartCol=o.Col;this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.FRows[o.Row][o.Col].CellData.Undo(t)}))}else if(t.Data.isClass(oa)){var r=t.Data;this.FResizeKeepWidth&&r.Col=t&&(this.FFixCol=-1,this.FFixColCount=0)}},{key:"CheckFixRowSafe",value:function(t){this.FFixRow+this.FFixRowCount-1>=t&&(this.FFixRow=-1,this.FFixRowCount=0)}},{key:"AdjustCellRange",value:function(t,e,i,n){for(var o,r=i,s=n,a=null,l=-1,h=-1,c=t;c<=i;c++)for(var u=e;u<=n;u++)((a=this.FRows[c][u]).RowSpan>0||a.ColSpan>0)&&(l=(o=this.GetDestCell(c,u)).row,h=o.col,r<(l+=(a=this.FRows[l][h]).RowSpan)&&(r=l),s<(h+=a.ColSpan)&&(s=h));return{row:r,col:s}}},{key:"DeleteEmptyRows",value:function(t,e){for(var i,n=e;n>=t;n--){i=!0;for(var o=0;o=n&&r.RowSpan--;for(var l=n+1;l=t;n--){i=!0;for(var o=0;o=0;s--){for(var a=0;a=n&&(r.ColSpan=r.ColSpan-1);for(var l=n;lthis.FRows.count-1)return!1;var i,n=-1,o=-1;this.Undo_Mirror();for(var r=e;r>=t;r--){if(!this.RowCanDelete(r))return!1;for(var s=0;s=0)if(this.FSelectCellRang.EndRow>=0)n=o>=this.FSelectCellRang.StartRow&&o<=this.FSelectCellRang.EndRow&&r>=this.FSelectCellRang.StartCol&&r<=this.FSelectCellRang.EndCol;else{var l=this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol];if(l.CellData.SelectExists()){var h=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol),c=t-h.x-this.FCellHPaddingPix,u=e-h.y-l.GetCellDataTop(this.FCellVPaddingPix),f=-1,d=-1,m=-1,y=!1;f=(s=l.CellData.GetItemAt(c,u,f,d,m,y)).itemNo,d=s.offset,m=s.drawItemNo,y=s.restrain,n=l.CellData.CoordInSelect(c,u,f,d,y)}}}return n}},{key:"GetTopLevelDataAt",value:function(t,e){var i=null,n=-1,o=-1,r=this.GetCellAt(t,e,n,o);if(n=r.row,o=r.col,n<0||o<0)return i;var s=this.GetCellPostion(n,o);return i=this.FRows[n][o].CellData.GetTopLevelDataAt(t-s.x-this.FCellHPaddingPix,e-s.y-this.FCellVPaddingPix)}},{key:"GetTopLevelData",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetTopLevelData():jh(Zh(i.prototype),"GetTopLevelData",this).call(this)}},{key:"GetActiveData",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetTopLevelData():jh(Zh(i.prototype),"GetActiveData",this).call(this)}},{key:"GetActiveItem",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetActiveItem():jh(Zh(i.prototype),"GetActiveItem",this).call(this)}},{key:"GetTopLevelItem",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetTopLevelItem():jh(Zh(i.prototype),"GetTopLevelItem",this).call(this)}},{key:"GetTopLevelDrawItem",value:function(){var t=this.GetActiveData();return null!=t?t.GetTopLevelDrawItem():jh(Zh(i.prototype),"GetTopLevelDrawItem",this).call(this)}},{key:"GetTopLevelDrawItemCoord",value:function(){var t=G.Create(0,0),e=this.GetEditCell();if(null!=e){t=e.CellData.GetTopLevelDrawItemCoord();var i=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol);t.x=t.x+i.x+this.FCellHPaddingPix,t.y=t.y+i.y+e.GetCellDataTop(this.FCellVPaddingPix)}return t}},{key:"GetTopLevelRectDrawItem",value:function(){var t=this.GetActiveData();return null!=t?t.GetTopLevelRectDrawItem():jh(Zh(i.prototype),"GetTopLevelRectDrawItem",this).call(this)}},{key:"GetTopLevelRectDrawItemCoord",value:function(){var t=G.Create(-1,-1),e=this.GetEditCell();if(null!=e){var i=e.CellData.GetTopLevelRectDrawItemCoord();i.x>=0&&((t=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol)).x=t.x+i.x+this.FCellHPaddingPix,t.y=t.y+i.y+e.GetCellDataTop(this.FCellVPaddingPix))}return t}},{key:"GetHint",value:function(){var t=jh(Zh(i.prototype),"GetHint",this).call(this);if(this.FMouseMoveRow<0||this.FMouseMoveCol<0)return t;var e=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol];return null!=e&&null!=e.CellData&&(t=e.CellData.GetHint()),t}},{key:"InsertText",value:function(t){var e=this,n=!1;if(this.FSelectCellRang.EditCell()){return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=e.FRows[e.FSelectCellRang.StartRow][e.FSelectCellRang.StartCol];n=i.CellData.InsertText(t)})),n}return jh(Zh(i.prototype),"InsertText",this).call(this,t)}},{key:"InsertItem",value:function(t){var e=this.GetEditCell();if(null==e)return!1;var i=!1;return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){i=e.CellData.InsertItem(t)})),i}},{key:"InsertStream",value:function(t,e,n){var o=this,r=!1;if(this.FSelectCellRang.EditCell()){return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=o.FRows[o.FSelectCellRang.StartRow][o.FSelectCellRang.StartCol];r=i.CellData.InsertStream(t,e,n)})),r}return jh(Zh(i.prototype),"InsertStream",this).call(this,t,e,n)}},{key:"ReFormatActiveItem",value:function(){var t=this;if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol].CellData.ReFormatActiveItem()}))}this.FormatDirty()}},{key:"ReFormatRequest",value:function(){this.FormatDirty(),this.OwnerData.ItemReFormatRequest(this)}},{key:"ActiveItemReAdaptEnvironment",value:function(){var t=this;if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol].CellData.ActiveItemReAdaptEnvironment()}))}}},{key:"DeleteActiveDomain",value:function(){var t=this,e=jh(Zh(i.prototype),"DeleteActiveDomain",this).call(this);if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol];e=i.CellData.DeleteActiveDomain()}))}return e}},{key:"InsertAnnotate",value:function(t,e){var i=this.GetEditCell();if(null==i)return!1;var n=!1;return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){n=i.CellData.InsertAnnotate(t,e)})),n}},{key:"DeleteActiveAnnotate",value:function(){var t=this,e=jh(Zh(i.prototype),"DeleteActiveAnnotate",this).call(this);if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol];e=i.CellData.DeleteActiveAnnotate()}))}return e}},{key:"DeleteActiveDataItems",value:function(t,e,i){var n=this;if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){n.FRows[n.FSelectCellRang.StartRow][n.FSelectCellRang.StartCol].CellData.DeleteActiveDataItems(t,e,i)}))}}},{key:"SetActiveItemText",value:function(t){var e=this;if(jh(Zh(i.prototype),"SetActiveItemText",this).call(this,t),this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.FRows[e.FSelectCellRang.StartRow][e.FSelectCellRang.StartCol].CellData.SetActiveItemText(t)}))}}},{key:"DoCrossCellKey",value:function(t,e){var i=!1,n=-1,o=-1,r=this.FSelectCellRang.StartRow,s=this.FSelectCellRang.StartCol;if(t==Be){if(e.CellData.SelectFirstItemOffsetBefor()){for(var a=this.FSelectCellRang.StartCol-1;a>=0;a--)if(this.FRows[this.FSelectCellRang.StartRow][a].ColSpan>=0){this.FRows[this.FSelectCellRang.StartRow][a].RowSpan<0&&(this.FSelectCellRang.StartRow+=this.FRows[this.FSelectCellRang.StartRow][a].RowSpan),o=a;break}o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectLastItemAfterWithCaret(),i=!0)}}else if(t==Me){if(e.CellData.SelectLastItemOffsetAfter()){for(var l=this.FSelectCellRang.StartCol+1;l=0){this.FRows[this.FSelectCellRang.StartRow][l].RowSpan<0&&(this.FSelectCellRang.StartRow+=this.FRows[this.FSelectCellRang.StartRow][l].RowSpan),o=l;break}o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectFirstItemBeforWithCaret(),i=!0)}}else if(t==Ee){if(e.CellData.SelectFirstLine()&&this.FSelectCellRang.StartRow>0){var h=this.GetDestCell(this.FSelectCellRang.StartRow-1,this.FSelectCellRang.StartCol);n=h.row,o=h.col,n>=0&&o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartRow=n,this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectLastItemAfterWithCaret(),i=!0)}}else if(t==Le&&e.CellData.SelectLastLine()&&this.FSelectCellRang.StartRow=0&&o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartRow=n,this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectFirstItemBeforWithCaret(),i=!0)}return i}},{key:"KeyDown",value:function(t){var e=this.GetEditCell();if(null!=e){var i=t.keyCode;switch(t.keyCode){case Pe:case Ge:case be:case De:this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.CellData.KeyDown(t)}));break;case Be:case Me:case Ee:case Le:case Ne:case Oe:e.CellData.KeyDown(t),t.Handled&&lp.IsDirectionKey(t.keyCode)&&this.DoCrossCellKey(t.keyCode,e)&&(this.OwnerData.Style.UpdateInfoReCaret(),t.keyCode=i);break;default:e.CellData.KeyDown(t)}null!=this.OnKeyDown&&this.OnKeyDown(t)}else t.Handled=!0}},{key:"KeyPress",value:function(t){var e=this.GetEditCell();if(null!=e){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.CellData.KeyPress(t)}))}}},{key:"GetText",value:function(){for(var t=jh(Zh(i.prototype),"GetText",this).call(this),e=0;e<=this.FRows.count-1;e++)for(var n=0;n=0&&(t=this.FSelectCellRang.EndRow>=0||this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectExists()),t}},{key:"GetOffsetAt",value:function(t){return t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"TraverseItem",value:function(t){for(var e=0;e=0&&r>=0){if(null!=this.FRows[o][r].CellData&&(n=this.FRows[o][r].CellData.Search(t,e,i)),!n)for(var a=r-1;a>=0&&(this.FRows[o][a].ColSpan<0||this.FRows[o][a].RowSpan<0||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartCol=a,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,(s=this.FRows[o][a].CellData).SelectInfo.StartItemNo=s.Items.count-1,s.SelectInfo.StartItemOffset=s.GetItemOffsetAfter(s.Items.count-1),!(n=this.FRows[o][a].CellData.Search(t,e,i))));a--);if(!n)for(var l=this.FSelectCellRang.StartRow-1;l>=0;l--){for(var h=this.FColWidths.count-1;h>=0&&(this.FRows[l][h].ColSpan<0||this.FRows[l][h].RowSpan<0||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartRow=l,this.FSelectCellRang.StartCol=h,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,(s=this.FRows[l][h].CellData).SelectInfo.StartItemNo=s.Items.count-1,s.SelectInfo.StartItemOffset=s.GetItemOffsetAfter(s.Items.count-1),!(n=this.FRows[l][h].CellData.Search(t,e,i))));h--);if(n)break}}}else if(this.FSelectCellRang.StartRow<0&&(this.FSelectCellRang.StartRow=0,this.FSelectCellRang.StartCol=0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[0][0].CellData.SelectInfo.StartItemNo=0,this.FRows[0][0].CellData.SelectInfo.StartItemOffset=0),o=this.FSelectCellRang.StartRow,r=this.FSelectCellRang.StartCol,o>=0&&r>=0){if(!(n=this.FRows[o][r].CellData.Search(t,e,i)))for(var c=r+1;c=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartCol=c,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[o][c].CellData.SelectInfo.StartItemNo=0,this.FRows[o][c].CellData.SelectInfo.StartItemOffset=0,!(n=this.FRows[o][c].CellData.Search(t,e,i))));c++);if(!n)for(var u=this.FSelectCellRang.StartRow+1;u=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartRow=u,this.FSelectCellRang.StartCol=f,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[u][f].CellData.SelectInfo.StartItemNo=0,this.FRows[u][f].CellData.SelectInfo.StartItemOffset=0,!(n=this.FRows[u][f].CellData.Search(t,e,i))));f++);if(n)break}}return n||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.Initialize()),n}},{key:"CheckFormatPageBreakBefor",value:function(){this.FPageBreaks.clear()}},{key:"ApplySelectTextStyle",value:function(t,e){var i=null;if(this.FSelectCellRang.EditCell())(i=this.GetEditCell().CellData).ApplySelectTextStyle(e),this.IsFormatDirty=i.FormatHeightChange||i.FormatDrawItemCountChange;else if(this.FSelectCellRang.StartRow>=0)for(var n=this.FSelectCellRang.StartRow;n<=this.FSelectCellRang.EndRow;n++)for(var o=this.FSelectCellRang.StartCol;o<=this.FSelectCellRang.EndCol;o++)if(null!=(i=this.FRows[n][o].CellData))if(this.IsFormatDirty){i.BeginFormat();try{i.ApplySelectTextStyle(e)}finally{i.EndFormat(!1)}}else i.ApplySelectTextStyle(e),this.IsFormatDirty=i.FormatHeightChange|i.FormatDrawItemCountChange}},{key:"ApplySelectParaStyle",value:function(t,e){if(jh(Zh(i.prototype),"ApplySelectParaStyle",this).call(this,t,e),this.FSelectCellRang.StartRow>=0){var n=null;if(this.FSelectCellRang.EndRow>=0){for(var o=this.FSelectCellRang.StartRow;o<=this.FSelectCellRang.EndRow;o++)for(var r=this.FSelectCellRang.StartCol;r<=this.FSelectCellRang.EndCol;r++)if(null!=(n=this.FRows[o][r].CellData))if(this.IsFormatDirty){n.BeginFormat();try{n.ApplySelectParaStyle(e)}finally{n.EndFormat(!1)}}else n.ApplySelectParaStyle(e),this.IsFormatDirty=n.FormatHeightChange||n.FormatDrawItemCountChange}else(n=this.GetEditCell().CellData).ApplySelectParaStyle(e),this.IsFormatDirty=n.FormatHeightChange||n.FormatDrawItemCountChange}else this.ParaNo=e.GetMatchParaNo(this.OwnerData.Style,this.ParaNo)}},{key:"ApplyCellAlign_",value:function(t,e){switch(e){case yp.TopLeft:case yp.TopCenter:case yp.TopRight:t.AlignVert=Ah;break;case yp.CenterLeft:case yp.CenterCenter:case yp.CenterRight:t.AlignVert=Th;break;default:t.AlignVert=Oh}var i=t.CellData;if(null!=i){i.BeginFormat();try{switch(e){case yp.TopLeft:case yp.CenterLeft:case yp.BottomLeft:i.ApplyParaAlignHorz(dr);break;case yp.TopCenter:case yp.CenterCenter:case yp.BottomCenter:i.ApplyParaAlignHorz(mr);break;default:i.ApplyParaAlignHorz(yr)}}finally{i.EndFormat(!0)}}}},{key:"ApplyContentAlign",value:function(t){if(jh(Zh(i.prototype),"ApplyContentAlign",this).call(this,t),this.FSelectCellRang.StartRow>=0)if(this.FSelectCellRang.EndRow>=0)for(var e=this.FSelectCellRang.StartRow;e<=this.FSelectCellRang.EndRow;e++)for(var n=this.FSelectCellRang.StartCol;n<=this.FSelectCellRang.EndCol;n++)this.ApplyCellAlign_(this.FRows[e][n],t);else this.ApplyCellAlign_(this.GetEditCell(),t);else for(var o=0;oo){s=u;break}h=f,u++}if(s<0)return{breakSeat:s,fmtOffset:a,fmtHeightInc:l};if(!this.CanPageBreak&&0==s)return{breakSeat:s,fmtOffset:a=o-e,fmtHeightInc:l};for(var d,m,y=!0,p=!1,S=o,v=-1,F=-1,I=0,g=null,w=null,C=0;Co){p=!0,0==k&&(y=!1,S=h);break}if(!y)break}y&&!p&&(y=!1);for(var P,D=0,b=0,R=0,_=0,x=new V,A=0;AS){D=(R=o-(I+w.rect.top)+this.FBorderWidthPix+this.FCellVPaddingPix-1)>_?R-_:0,P.DrawItemNo=T,P.VDrawOffset=R,T>0?I+g.DrawItems[T-1].rect.bottom+this.FCellVPaddingPix+this.FBorderWidthPix>b&&(b=I+g.DrawItems[T-1].rect.bottom+this.FCellVPaddingPix+this.FBorderWidthPix):I>b&&(b=I-this.FCellVPaddingPix);break}l=0&&s>this.FFixRow+this.FFixRowCount-1&&(l+=O=this.GetFixRowHeight()),y)this.FRows[s].Height=this.FRows[s].Height+l;else{if(0==s)return{breakSeat:s,fmtOffset:a=o-e,fmtHeightInc:l=0};for(var N=0;N0?(this.FRows[s].FmtOffset=x[N].VDrawOffset+O,x[N].VDrawOffset=0):this.FRows[s].FmtOffset=O)}this.AddPageBreak(s,b,t,o,e);for(var B=0;B55){var o=t.readByte();this.FBorderVisible=or.system.isOdd(o>>7),this.FResizeKeepWidth=or.system.isOdd(o>>6)}else this.FBorderVisible=t.readBoolean();n>31?this.BorderWidthPt=t.readSingle():n>29&&(this.FBorderWidthPix=t.readByte(),this.FBorderWidthPt=Math.min(.5,sr.pixelToPt(this.FBorderWidthPix,sr.PixelsPerInchX))),n>34?(this.FCellVPaddingMM=t.readSingle(),this.FCellVPaddingPix=sr.millimeterToPixY(this.FCellVPaddingMM),this.FCellHPaddingMM=t.readSingle(),this.FCellHPaddingPix=sr.millimeterToPixY(this.FCellHPaddingMM)):(this.FCellVPaddingMM=sr.pixYToMillimeter(2),this.FCellVPaddingPix=2,this.FCellHPaddingMM=sr.pixXToMillimeter(2),this.FCellHPaddingPix=2);var r,s=t.readInt32(),a=t.readInt32();n>24&&(this.FFixRow=t.readInt8(),this.FFixRowCount=t.readByte(),this.FFixCol=t.readInt8(),this.FFixColCount=t.readByte());for(var l=0;l";for(var n=0;n',t.RowSpan+1,t.ColSpan+1,t.Width,t.Height),null!=t.CellData&&(e+=t.CellData.ToHtml()),e+=lp.sLineBreak+"");e+=lp.sLineBreak+""}return e+=lp.sLineBreak+""}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){this.DoColCountChange()}},{key:"ResetRowCol",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.FFixRow=-1,this.FFixRowCount=0,this.FFixCol=-1,this.FFixColCount=0,this.FDefaultRowHeight=lp.MinRowHeight,this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.Width=t;var o=-1;lp.RESETTABLEUSEFIRSTROWHEIGHT&&this.FRows.count>0&&(o=this.FRows[0].Height),this.Height=e*(this.FDefaultRowHeight+this.FBorderWidthPix)+this.FBorderWidthPix;var r,s=t-(i+1)*this.FBorderWidthPix;this.FRows.clear();for(var a=0;a0?(this.FColWidths[o]+=1,n--):(this.FColWidths[o]-=1,n++));t&&this.ReFormatRequest()}}},{key:"CheckRowBorderRang",value:function(t,e){return t>=e-this.GripSize&&t<=e+this.GripSize}},{key:"CheckColBorderRang",value:function(t,e){return t>=e-this.GripSize&&t<=e+this.GripSize}},{key:"GetCellAt",value:function(t,e,i,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=new Rh;if(r.TableSite=wh,r.DestX=-1,r.DestY=-1,i=-1,n=-1,e<0||e>this.Height)return{resizeInfo:r,row:i,col:n};var s=0,a=0;if(t<0||t>this.Width){s=this.FBorderWidthPix;for(var l=0;le){i=l;break}s=a}return{resizeInfo:r,row:i,col:n}}if(s=this.FBorderWidthPix,this.CheckRowBorderRang(e,s))return r.TableSite=Ph,{resizeInfo:r,row:i,col:n};if(this.CheckColBorderRang(t,s))return r.TableSite=kh,{resizeInfo:r,row:i,col:n};for(var h=0;he){i=h;break}s=a}if(i<0)return{resizeInfo:r,row:i,col:n};for(var c,u=this.FBorderWidthPix,f=0,d=-1,m=-1,y=0;yt){n=y,r.TableSite==bh&&d+this.FRows[d][m].RowSpan!=i&&(r.TableSite=Ch);break}u=f}return n>=0&&(r.TableSite==wh&&(r.TableSite=Ch),o&&null==this.FRows[i][n].CellData&&(i=(c=this.GetDestCell(i,n)).row,n=c.col)),{resizeInfo:r,row:i,col:n}}},{key:"GetDestCell",value:function(t,e){var i=t,n=e;return this.FRows[t][e].RowSpan<0&&(i+=this.FRows[t][e].RowSpan),this.FRows[t][e].ColSpan<0&&(n+=this.FRows[t][e].ColSpan),{row:i,col:n}}},{key:"GetSourceCell",value:function(t,e){if(null!=this.FRows[t][e].CellData)return{row:t+this.FRows[t][e].RowSpan,col:e+this.FRows[t][e].ColSpan};or.exception(lp.HCS_EXCEPTION_VOIDSOURCECELL)}},{key:"SelectRange",value:function(t,e,n,o){0==t&&0==e&&n==this.RowCount-1&&o==this.FColWidths.count-1&&jh(Zh(i.prototype),"SelectComplate",this).call(this),this.FSelectCellRang.SetStart(t,e),this.FSelectCellRang.SetEnd(n,o);for(var r=t;r<=n;r++)for(var s=e;s<=o;s++)null!=this.FRows[r][s].CellData&&this.FRows[r][s].CellData.SelectAll()}},{key:"SelectAll",value:function(){this.SelectComplate()}},{key:"PaintRow",value:function(t,e,i,n,o,r){for(var s,a=Math.trunc(this.FBorderWidthPix/2),l=e+this.FBorderWidthPix,h=i+this.FBorderWidthPix+this.FCellVPaddingPix,c=-1,u=-1,f=-1,d=-1,m=-1,y=null,p=!1,S=0;Sthis.FCellVPaddingPix&&this.FRows[t][S].PaintTo(l,h-this.FCellVPaddingPix,s.right,c,i,n,0,this.FCellHPaddingPix,this.FCellVPaddingPix,o,r),!this.FBorderVisible&&r.Print||(r.Print?o.pen.width=Math.max(1,sr.ptToPixel(this.FBorderWidthPt,r.DPI)):o.pen.width=this.FBorderWidthPix,this.FBorderVisible?(o.pen.color="black",o.pen.style=pt.Solid):r.Print||(o.pen.color=lp.clActiveBorder,o.pen.style=pt.Dot),f=(u=h-this.FCellVPaddingPix-this.FBorderWidthPix)+this.FBorderWidthPix+Math.max(this.FRows[t].Height,this.FRows[t][S].Height),d=l-this.FBorderWidthPix,m=l+this.FColWidths[S]+this.GetColSpanWidth(t,S),u>=0&&this.FRows[t][S].BorderSides.has(fp.Top)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+a,u+a),G.Create(m+a,u+a)]):o.drawLineDriect(d+a,u+a,m+a,u+a)),this.FRows[t][S].BorderSides.has(fp.Right)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+a,u+a),G.Create(m+a,f+a)]):o.drawLineDriect(m+a,u+a,m+a,f+a)),this.FRows[t][S].BorderSides.has(fp.Bottom)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+a,f+a),G.Create(m+a,f+a)]):o.drawLineDriect(d+a,f+a,m+a,f+a)),this.FRows[t][S].BorderSides.has(fp.Left)&&(r.Print?r.drawNoScaleLine(o,[G(d+a,u+a),G.Create(d+a,f+a)]):o.drawLineDriect(d+a,u+a,d+a,f+a)),this.FRows[t][S].BorderSides.has(fp.LTRB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+a,u+a),G(m+a,f+a)]):o.drawLineDriect(d+a,u+a,m+a,f+a)),this.FRows[t][S].BorderSides.has(fp.RTLB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+a,u+a),G.Create(d+a,f+a)]):o.drawLineDriect(m+a,u+a,d+a,f+a)))),l=l+this.FColWidths[S]+this.FBorderWidthPix}},{key:"PaintFixRows",value:function(t,e,i,n,o){var r=this.GetFixRowHeight();if(!(e+r<0)){var s=U.CreateByBounds(t,e,this.Width,r);this.DoPaint(this.OwnerData.Style,s,e,e+r,e,e+r,n,o)}}},{key:"PaintFixCols",value:function(t,e,i,n,o,r){for(var s=Math.max(i,t)+this.FBorderWidthPix,a=0;an);S++)l.bottom>n&&(l.bottom=n),this.FRows[p][S].PaintTo(c,s,l.right,h,i,n,0,this.FCellHPaddingPix,this.FCellVPaddingPix,o,r),!this.FBorderVisible&&r.Print||(r.Print?o.pen.width=Math.max(1,sr.ptToPixel(this.FBorderWidthPt,r.DPI)):o.pen.width=this.FBorderWidthPix,this.FBorderVisible?(o.pen.color="black",o.pen.style=pt.Solid):r.Print||(o.pen.color=lp.clActiveBorder,o.pen.style=pt.Dot),f=(u=s-this.FBorderWidthPix)+this.FBorderWidthPix+Math.max(this.FRows[p].Height,this.FRows[p][S].Height),d=c-this.FBorderWidthPix,m=c+this.FColWidths[S]+this.GetColSpanWidth(p,S),u>=0&&this.FRows[p][S].BorderSides.has(fp.Top)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,u+y),G.Create(m+y,u+y)]):o.drawLineDriect(d+y,u+y,m+y,u+y)),this.FRows[p][S].BorderSides.has(fp.Right)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+y,u+y),G.Create(m+y,f+y)]):o.drawLineDriect(m+y,u+y,m+y,f+y)),f<=n&&this.FRows[p][S].BorderSides.has(fp.Bottom)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,f+y),G.Create(m+y,f+y)]):o.drawLineDriect(d+y,f+y,m+y,f+y)),this.FRows[p][S].BorderSides.has(fp.Left)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,u+y),G.Create(d+y,f+y)]):o.drawLineDriect(d+y,u+y,d+y,f+y)),this.FRows[p][S].BorderSides.has(fp.LTRB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,u+y),G.Create(m+y,f+y)]):o.drawLineDriect(d+y,u+y,m+y,f+y)),this.FRows[p][S].BorderSides.has(fp.RTLB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+y,u+y),G.Create(d+y,f+y)]):o.drawLineDriect(m+y,u+y,d+y,f+y))),c=c+this.FColWidths[S]+this.FBorderWidthPix;s=h+this.FBorderWidthPix}}},{key:"FormatRow",value:function(t){var e,i=this.FRows[t];i.FmtOffset=0,i.FormatInit();for(var n=0;ni||o.coln))return!1;return!0}},{key:"RowCanDelete",value:function(t){for(var e=!1,i=0;i0)return e;return e=!0}},{key:"CurRowCanDelete",value:function(){return this.FSelectCellRang.EndRow<0&&this.FSelectCellRang.StartRow>=0&&this.RowCanDelete(this.FSelectCellRang.StartRow)}},{key:"ColCanDelete",value:function(t){for(var e=!1,i=0;i0)return e;return e=!0}},{key:"CurColCanDelete",value:function(){return this.FSelectCellRang.EndCol<0&&this.FSelectCellRang.StartCol>=0&&this.ColCanDelete(this.FSelectCellRang.StartCol)}},{key:"SetFixRowAndCount",value:function(t,e){if(t<0||0==e)this.FFixRow=-1,this.FFixRowCount=0;else{var i=t;t>this.FRows.count-1&&(i=this.FRows.count-1);var n=e;i+e>this.FRows.count&&(n=this.FRows.count-i),this.FFixRow==i&&this.FFixRowCount==n||(this.FFixRow=i,this.FFixRowCount=n,this.FormatDirty())}}},{key:"SetFixColAndCount",value:function(t,e){if(t<0||0==e)this.FFixCol=-1,this.FFixColCount=0;else{var i=t;t>this.FColWidths.count-1&&(i=this.FColWidths.count-1);var n=e;i+e>this.FColWidths.count&&(n=this.FColWidths.count-i),this.FFixCol==i&&this.FFixColCount==n||(this.FFixCol=i,this.FFixColCount=n,this.FormatDirty())}}},{key:"MergeSelectCells",value:function(){var t=!1;if(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.EndRow>=0){if(this.Undo_Mirror(),t=this.MergeCells(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,this.FSelectCellRang.EndRow,this.FSelectCellRang.EndCol)){this.FormatDirty();var e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol;this.FSelectCellRang.InitializeEnd(),this.DisSelect(),this.FSelectCellRang.SetStart(e,i),this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.InitializeField()}}else t=!!this.FSelectCellRang.EditCell()&&this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.MergeTableSelectCells();return t}},{key:"SelectedCellCanMerge",value:function(){return!!this.FSelectCellRang.SelectExists()&&this.CellsCanMerge(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,this.FSelectCellRang.EndRow,this.FSelectCellRang.EndCol)}},{key:"GetEditCell",value:function(){return this.FSelectCellRang.EditCell()?this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol]:null}},{key:"GetEditCellWith",value:function(){var t=-1,e=-1,i=!1;return this.FSelectCellRang.EditCell()&&(t=this.FSelectCellRang.StartRow,e=this.FSelectCellRang.StartCol,i=!0),{result:i,row:t,col:e}}},{key:"_CacheDynamicAppendRow",value:function(t){var e=this;t&&this.FRowCache.splice(0,this.FRowCache.length),this.FRowCache.length0?this.InsertRow(this.FSelectCellRang.StartRow+e.RowSpan+1,t):this.InsertRow(this.FSelectCellRang.StartRow+1,t))}},{key:"InsertRowBefor",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),this.InsertRow(this.FSelectCellRang.StartRow,t))}},{key:"InsertColAfter",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),e.ColSpan>0?this.InsertCol(this.FSelectCellRang.StartCol+e.ColSpan+1,t):this.InsertCol(this.FSelectCellRang.StartCol+1,t))}},{key:"InsertColBefor",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),this.InsertCol(this.FSelectCellRang.StartCol,t))}},{key:"DeleteCurCol",value:function(){var t=this.GetEditCell();return null!=t&&(t.CellData.InitializeField(),this.FColWidths.count>1&&this.DeleteCol(this.FSelectCellRang.StartCol))}},{key:"DeleteCurRow",value:function(){var t=this.GetEditCell();return null!=t&&(t.CellData.InitializeField(),this.DeleteRow(this.FSelectCellRang.StartRow))}},{key:"SplitCurRow",value:function(){var t=this.GetEditCell();if(null==t)return!1;t.CellData.InitializeField();var e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol,n=-1,o=-1,r=-1,s=-1;if(this.Undo_Mirror(),this.FRows[e][i].RowSpan>0){var a=this.GetSourceCell(e,i);n=a.row,o=a.col,this.FRows[e][i].RowSpan=0;for(var l=e;l<=n;l++)for(var h=i;h<=o;h++)this.FRows[l][h].RowSpan=this.FRows[l][h].RowSpan+1;this.FRows[e+1][i].CellData=new lp.TableCellData(this.OwnerData.Style),this.FRows[e+1][i].RowSpan=n-(e+1),this.FRows[e+1][i].ColSpan=o-i}else if(this.InsertRow(e+1,1))for(var c=0;c0)for(o=i+t.ColSpan;c<=o;)this.FRows[e+1][c].ColSpan=this.FRows[e][c].ColSpan,this.FRows[e+1][c].ColSpan<0&&(this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null),c++;else c++;else if(0==t.ColSpan)0==t.RowSpan?(this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null,this.FRows[e+1][c].RowSpan=-1,t.RowSpan=1,c++):t.RowSpan<0?(e==(n=(r=e+t.RowSpan)+this.FRows[r][c].RowSpan)&&(this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null,this.FRows[e+1][c].RowSpan=t.RowSpan-1,this.FRows[r][c].RowSpan=this.FRows[r][c].RowSpan+1),c++):c++;else if(t.ColSpan>0)if(0==t.RowSpan)for(t.RowSpan=1,s=c,o=c+t.ColSpan;c<=o;)this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null,this.FRows[e+1][c].ColSpan=s-c,this.FRows[e+1][c].RowSpan=-1,c++;else c++;else c++;return this.FormatDirty(),!0}},{key:"SplitCurCol",value:function(){var t=this.GetEditCell();if(null==t)return!1;t.CellData.InitializeField();var e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol,n=-1,o=-1,r=-1,s=-1;if(this.Undo_Mirror(),this.FRows[e][i].ColSpan>0){var a=this.GetSourceCell(e,i);n=a.row,o=a.col,this.FRows[e][i].ColSpan=0;for(var l=i;l<=o;l++)for(var h=e;h<=n;h++)this.FRows[h][l].ColSpan=this.FRows[h][l].ColSpan+1;this.FRows[e][i+1].CellData=new lp.TableCellData(this.OwnerData.Style),this.FRows[e][i+1].RowSpan=n-e,this.FRows[e][i+1].ColSpan=o-(i+1)}else if(this.InsertCol(i+1,1))for(var c=0;c0)for(n=e+t.RowSpan;c<=n;)this.FRows[c][i+1].RowSpan=this.FRows[c][i].RowSpan,this.FRows[c][i+1].RowSpan<0&&(this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null),c++;else c++;else if(0==t.RowSpan)0==t.ColSpan?(this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null,this.FRows[c][i+1].ColSpan=-1,t.ColSpan=1,c++):t.ColSpan<0?(i==(o=(s=i+t.ColSpan)+this.FRows[c][s].ColSpan)&&(this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null,this.FRows[c][i+1].ColSpan=t.ColSpan-1,this.FRows[c][s].ColSpan=this.FRows[c][s].ColSpan+1),c++):c++;else if(t.RowSpan>0)if(0==t.ColSpan)for(t.ColSpan=1,r=c,n=c+t.RowSpan;c<=n;)this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null,this.FRows[c][i+1].RowSpan=r-c,this.FRows[c][i+1].ColSpan=-1,c++;else c++;else c++;return this.FormatDirty(),!0}},{key:"IsBreakRow",value:function(t){for(var e=!1,i=0;i=0&&(t>=this.FFixRow&&t=0&&(t>=this.FFixCol&&t0?(i--,n=this.Items[i].StyleNo>cs.Null?this.Items[i].Length:lp.OffsetAfter):n=0;return{itemNo:i,offset:n}}},{key:"UndoRedoInsertItem",value:function(t,e,i,n,o,r){var s=e;if(n=s.ItemNo,i)ncs.Null?this.Items[n].Length:lp.OffsetAfter,r=t.CaretDrawItemNo):n>0?(n--,o=this.Items[n].StyleNo>cs.Null?this.Items[n].Length:lp.OffsetAfter,r=t.CaretDrawItemNo-1):o=0,this.Items.delete(s.ItemNo),this.FItemAddCount--;else{var a=this.LoadItemFromStreamAlone(s.ItemStream);this.Items.insert(s.ItemNo,a),this.FItemAddCount++,n=s.ItemNo,o=this.Items[n].StyleNo>cs.Null?this.Items[n].Length:lp.OffsetAfter,r=t.CaretDrawItemNo+1}return{itemNo:n,offset:o,drawItemNo:r}}},{key:"UndoRedoItemProperty",value:function(t,e,i,n){var o=t;i=o.ItemNo,n=o.Offset;var r=this.Items[o.ItemNo];switch(o.ItemProperty){case ca:r.StyleNo=e?o.OldStyleNo:o.NewStyleNo;break;case ua:var s=this.GetParaLastItemNo(o.ItemNo);if(e)for(var a=o.ItemNo;a<=s;a++)this.Items[a].ParaNo=o.OldParaNo;else for(var l=o.ItemNo;l<=s;l++)this.Items[l].ParaNo=o.NewParaNo;break;case fa:r.ParaFirst=e?o.OldParaFirst:o.NewParaFirst;break;case da:this.FForceClearExtra=!0,r.PageBreak=e?o.OldPageBreak:o.NewPageBreak}return{itemNo:i,offset:n}}},{key:"UndoRedoItemSelf",value:function(t,e,i,n){var o=t;return i=o.ItemNo,n=o.Offset,e?this.Items[i].Undo(o):this.Items[i].Redo(o),{itemNo:i,offset:n}}},{key:"UndoRedoItemMirror",value:function(t,e,i,n){var o=t;return i=o.ItemNo,n=o.Offset,this.Items[i]=this.LoadItemFromStreamAlone(o.ItemStream),{itemNo:i,offset:n}}},{key:"DoUndoRedoAction",value:function(t,e,i,n,o,r){var s;switch(e.Tag){case wp.BackDeleteText:n=(s=this.UndoRedoDeleteBackText(e,i,n,o)).itemNo,o=s.offset;break;case wp.DeleteText:n=(s=this.UndoRedoDeleteText(e,i,n,o)).itemNo,o=s.offset;break;case wp.InsertText:n=(s=this.UndoRedoInsertText(e,i,n,o)).itemNo,o=s.offset;break;case wp.SetItemText:n=(s=this.UndoRedoSetItemText(e,i,n,o)).itemNo,o=s.offset;break;case wp.DeleteItem:n=(s=this.UndoRedoDeleteItem(e,i,n,o)).itemNo,o=s.offset;break;case wp.InsertItem:n=(s=this.UndoRedoInsertItem(t,e,i,n,o,r)).itemNo,o=s.offset,r=s.drawItemNo;break;case wp.ItemProperty:n=(s=this.UndoRedoItemProperty(e,i,n,o)).itemNo,o=s.offset;break;case wp.ItemSelf:n=(s=this.UndoRedoItemSelf(e,i,n,o)).itemNo,o=s.offset;break;case wp.ItemMirror:n=(s=this.UndoRedoItemMirror(e,i,n,o)).itemNo,o=s.offset}return{itemNo:n,offset:o,drawItemNo:r}}},{key:"GetActionAffectFirst",value:function(t,e){var i=t.ItemNo;switch(t.Tag){case wp.DeleteItem:i>0&&i--;break;case wp.InsertItem:e?i>0&&i--:i>this.Items.count-1&&i--;break;case wp.ItemProperty:var n=t;n.ItemProperty!=fa&&n.ItemProperty!=da&&n.ItemProperty!=ca||i>0&&i--}return i>this.Items.count-1&&(i=this.Items.count-1),i}},{key:"GetActionAffectLast",value:function(t,e){var i=t.ItemNo;switch(t.Tag){case wp.DeleteItem:e?i>0&&i--:ithis.Items.count-1&&i--;break;case wp.ItemProperty:var n=t;n.ItemProperty!=fa&&n.ItemProperty!=da&&n.ItemProperty!=ca||ithis.Items.count-1&&(i=this.Items.count-1),i}},{key:"CalcAffectRange",value:function(t){this.FFormatFirstItemNo=this.GetActionAffectFirst(t.Actions.first,t.IsUndo),this.FFormatLastItemNo=this.GetActionAffectLast(t.Actions.first,t.IsUndo);var e=-1,i=-1,n=0;t.Actions.first.Tag==wp.InsertItem&&n++;for(var o=1;oe&&(this.FFormatFirstItemNo=e),this.FFormatLastItemNothis.Items.count-1&&(this.FFormatLastItemNo=this.Items.count-1)}},{key:"DoUndoRedo",value:function(t){if(this.FForceClearExtra=!1,t.isClass(_a))if(t.IsUndo){if(0==this.FUndoGroupCount){var e=this.GetUndoList();if(this.FFormatFirstItemNo=e[e.CurGroupBeginIndex].ItemNo,this.FFormatLastItemNo=e[e.CurGroupEndIndex].ItemNo,this.FFormatFirstItemNo>0&&this.FFormatFirstItemNo--,this.FFormatLastItemNon[r].ItemNo&&(this.FFormatFirstItemNo=n[r].ItemNo):n[r].isClass(_a)?this.FFormatLastItemNoo&&(this.FFormatFirstItemNo=o),o=this.GetParaLastItemNo(this.GetActionAffectLast(n[r].Actions.last,n[r].IsUndo)),this.FFormatLastItemNothis.Items.count-1&&(this.FFormatLastItemNo=this.Items.count-1),this.FFormatFirstDrawItemNo=this.GetFormatFirstDrawItem(this.Items[this.FFormatFirstItemNo].FirstDItemNo),this.FormatPrepare(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo),this.SelectInfo.Initialize(),this.InitializeField(),this.FItemAddCount=0}this.FUndoGroupCount++}else if(0!=t.Actions.count){var s,a=-1,l=-1,h=-1;if(0==this.FUndoGroupCount&&(this.SelectInfo.Initialize(),this.InitializeField(),this.FItemAddCount=0,a=t.CaretDrawItemNo,this.CalcAffectRange(t),this.FFormatLastItemNo=this.GetParaLastItemNo(this.FFormatLastItemNo),this.FFormatFirstDrawItemNo=this.GetFormatFirstDrawItem(this.FFormatFirstItemNo),this.FormatPrepare(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo)),t.IsUndo)for(var c=t.Actions.count-1;c>=0;c--)l=(s=this.DoUndoRedoAction(t,t.Actions[c],!0,l,h,a)).itemNo,h=s.offset,a=s.drawItemNo;else for(var u=0;u<=t.Actions.count-1;u++)l=(s=this.DoUndoRedoAction(t,t.Actions[u],!1,l,h,a)).itemNo,h=s.offset,a=s.drawItemNo;if(0==this.FUndoGroupCount){this.ReFormatData(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo+this.FItemAddCount,this.FItemAddCount,this.FForceClearExtra);var f=this.GetDrawItemNoByOffset(l,h);a<0||a>this.DrawItems.count-1?a=f:f!=a&&(this.DrawItems[a].ItemNo==l&&this.DrawItems[a].CharOffs==h||(a=f)),this.CaretDrawItemNo=a,this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoRePaint()}this.SelectInfo.StartItemNo=l,this.SelectInfo.StartItemOffset=h}}},{key:"GetUndoList",value:function(){return this.Loading?null:fc(pc(r.prototype),"GetUndoList",this).call(this)}},{key:"Undo_New",value:function(){var t=this.GetUndoList();if(null!=t&&t.Enable){var e=t.UndoNew();e.isClass(Ca)&&(e.CaretDrawItemNo=this.CaretDrawItemNo)}}},{key:"Undo_GroupBegin",value:function(t,e){var i=this.GetUndoList();null!=i&&i.Enable&&i.UndoGroupBegin(t,e)}},{key:"Undo_GroupEnd",value:function(t,e){var i=this.GetUndoList();null!=i&&i.Enable&&i.UndoGroupEnd(t,e)}},{key:"UndoAction_DeleteBackText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;null!=o&&(o.ActionAppend(wp.BackDeleteText,t,e,this.Items[t].ParaFirst).Text=i)}}},{key:"UndoAction_DeleteText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;null!=o&&(o.ActionAppend(wp.DeleteText,t,e,this.Items[t].ParaFirst).Text=i)}}},{key:"UndoAction_InsertText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;null!=o&&(o.ActionAppend(wp.InsertText,t,e,this.Items[t].ParaFirst).Text=i)}}},{key:"UndoAction_SetItemText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=o.ActionAppend(wp.SetItemText,t,e,this.Items[t].ParaFirst);r.Text=this.Items[t].Text,r.NewText=i}}}},{key:"UndoAction_DeleteItem",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;if(null!=n){var o=n.ActionAppend(wp.DeleteItem,t,e,this.Items[t].ParaFirst);this.SaveItemToStreamAlone(o.ItemStream,this.Items[t])}}}},{key:"UndoAction_InsertItem",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;if(null!=n){var o=n.ActionAppend(wp.InsertItem,t,e,this.Items[t].ParaFirst);this.SaveItemToStreamAlone(o.ItemStream,this.Items[t])}}}},{key:"UndoAction_ItemStyle",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new ya;r.ItemNo=t,r.Offset=e,r.OldStyleNo=this.Items[t].StyleNo,r.NewStyleNo=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemParaNo",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new pa;r.ItemNo=t,r.Offset=e,r.OldParaNo=this.Items[t].ParaNo,r.NewParaNo=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemParaFirst",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new Sa;r.ItemNo=t,r.Offset=e,r.OldParaFirst=this.Items[t].ParaFirst,r.NewParaFirst=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemPageBreak",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new va;r.ItemNo=t,r.Offset=e,r.OldPageBreak=this.Items[t].PageBreak,r.NewPageBreak=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemSelf",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;null!=n&&n.ActionAppend(wp.ItemSelf,t,e,this.Items[t].ParaFirst)}}},{key:"UndoAction_ItemMirror",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;if(null!=n){var o=n.ActionAppend(wp.ItemMirror,t,e,this.Items[t].ParaFirst);this.SaveItemToStreamAlone(o.ItemStream,this.Items[t])}}}},{key:"Clear",value:function(){if(this.Items.count>0){var t=this.GetUndoList();if(null!=t&&t.Enable){this.Undo_New();for(var e=this.Items.count-1;e>=0;e--)this.UndoAction_DeleteItem(e,0)}}fc(pc(r.prototype),"Clear",this).call(this)}},{key:"Undo",value:function(t){this.DoUndoRedo(t)}},{key:"Redo",value:function(t){this.DoUndoRedo(t)}},{key:"UndoItemMirror",value:function(t,e){this.UndoAction_ItemMirror(t,e)}},{key:"SaveItemToStreamAlone",value:function(t,e){lp._SaveFileFormatAndVersion(t),this.Style.SaveToStream(t),e.SaveToStream(t)}},{key:"LoadItemFromStreamAlone",value:function(t,e){t.position=0;var i=lp._LoadFileFormatAndVersion(t),n=i.fileExt,o=i.fileVersion;n!=lp.HC_EXT&&"cff."!=n&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!");var r=new cs;r.LoadFromStream(t,o);var s=t.readInt32();if(s>cs.Null){var a=r.TextStyles[s];s=this.Style.GetStyleNo(a,!0)}null==e&&(e=this.CreateItemByStyle(s)),e.LoadFromStream(t,r,o),e.StyleNo=s;var l=e.ParaNo,h=r.ParaStyles[l];return l=this.Style.GetParaNo(h,!0),e.ParaNo=l,e}}])&&uc(e.prototype,i),n&&uc(e,n),r}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sc(t,e)}(r,t);var e,i,n,o=ac(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).FormatTextCut=8192,e.FWidth=0,e.FFormatCount=0,e.FItemFormatHeight=0,e.FFormatChange=!1,e.OnItemReFormatRequest=null,e.OnItemSetCaretRequest=null,e.FormatInit(),e}return e=r,(i=[{key:"FormatRange",value:function(t,e){var i=-1,n=-1,o=-1,r=null,s=new G;this.FFormatChange?this.FFormatStartDrawItemNo0?(i=t-1,n=this.DrawItems[t].ItemNo,o=this.DrawItems[t].CharOffs,r=this.Style.ParaStyles[this.Items[n].ParaNo],this.DrawItems[t].LineFirst?(s.x=r.LeftIndentPix,s.y=this.DrawItems[i].rect.bottom):(s.x=this.DrawItems[i].rect.right,s.y=this.DrawItems[i].rect.top)):(i=-1,n=0,o=1,r=this.Style.ParaStyles[this.Items[n].ParaNo],s.x=r.LeftIndentPix,s.y=0),this.Style.ApplyTempStyle(cs.Null);var a=this.FormatItemToDrawItems(n,o,r.LeftIndentPix,this.FWidth-r.RightIndentPix,this.FWidth,s,i);s=a.pos,i=a.drawItemNo;for(var l=n+1;l<=e;l++)this.Items[l].ParaFirst&&(r=this.Style.ParaStyles[this.Items[l].ParaNo],s.x=r.LeftIndentPix),s=(a=this.FormatItemToDrawItems(l,1,r.LeftIndentPix,this.FWidth-r.RightIndentPix,this.FWidth,s,i)).pos,i=a.drawItemNo;this.DrawItems.DeleteFormatMark()}},{key:"FormatItem",value:function(t){var e=this.GetItemNo(t);e>=0&&this.FormatItemNo(e)}},{key:"FormatItemNo",value:function(t){if(t>=0){var e=this.GetFormatRange(t,0);this.FormatPrepare(e.firstDrawItemNo,e.lastItemNo),this.ReFormatData(e.firstDrawItemNo,e.lastItemNo),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.SelectInfo.StartItemNo==t&&this.SelectInfo.StartItemOffset>this.Items[t].Length&&this.ReSetSelectAndCaret(t)}}},{key:"CalcItemFormatHeigh",value:function(t){this.Style.TempStyleNo!=t.StyleNo?(this.Style.ApplyTempStyle(t.StyleNo),this.FLastFormatParaNo=t.ParaNo,this.FItemFormatHeight=this.CalculateLineHeight(this.Style.TextStyles[t.StyleNo],this.Style.ParaStyles[t.ParaNo])):this.FLastFormatParaNo!=t.ParaNo&&(this.FLastFormatParaNo=t.ParaNo,this.FItemFormatHeight=this.CalculateLineHeight(this.Style.TextStyles[t.StyleNo],this.Style.ParaStyles[t.ParaNo]))}},{key:"FinishLine",value:function(t,e,i){for(var n=e,o=e;o>=0;o--)if(this.DrawItems[o].LineFirst){n=o;break}for(var r=-1,s=n;s<=e;s++)if(this.Items[this.DrawItems[s].ItemNo].Visible){r=s;break}var a=r>=0;if(!a)return!1;for(var l,h=this.DrawItems[e].rect.bottom,c=e-1;c>=n;c--)this.DrawItems[c].rect.bottom>h&&(h=this.DrawItems[c].rect.bottom);for(var u=e;u>=n;u--)this.DrawItems[u].rect.bottom=h;var f=this.Style.ParaStyles[this.Items[t].ParaNo];switch(f.AlignHorz){case dr:break;case yr:for(var d=e;d>=n;d--)this.DrawItems[d].rect.offset(i,0);break;case mr:l=Math.trunc(i/2);for(var m=e;m>=n;m--)this.DrawItems[m].rect.offset(l,0);break;case pr:case Sr:if(f.AlignHorz==pr){if(this.IsParaLastDrawItem(e))return a}else if(n==e&&this.Items[this.DrawItems[n].ItemNo].Length<2)return g=Math.trunc(i/2),this.DrawItems[n].rect.offset(g,0),a;for(var y,p,S,v=0,F=0,I=0,g=i,w=new Array(e-n+1),C=n;C<=e;C++)this.Items[this.DrawItems[C].ItemNo].Visible&&(this.GetDrawItemStyle(C)0&&y--),w[C-n]=y,v+=y);v>1&&(g=Math.trunc(i/v),I=i%v),w[0]>0&&(this.DrawItems[n].rect.width+=w[0]*g,I>0&&(I>(S=this.DrawItems[n].CharLen)?(this.DrawItems[n].rect.right+=S,I-=S):(this.DrawItems[n].rect.right+=I,I=0)));for(var k=n+1;k<=e;k++)this.Items[this.DrawItems[k].ItemNo].Visible?(p=this.DrawItems[k].width,w[k-n]>0?(F=w[k-n]*g,I>0&&(this.GetDrawItemStyle(k)(S=this.DrawItems[k].CharLen)?(F+=S,I-=S):(F+=I,I=0))):F=0,this.DrawItems[k].rect.left=this.DrawItems[k-1].rect.right,this.DrawItems[k].rect.right=this.DrawItems[k].rect.left+p+F):(this.DrawItems[k].rect.left=this.DrawItems[k-1].rect.right,this.DrawItems[k].rect.right=this.DrawItems[k].rect.left)}return a}},{key:"NewDrawItem",value:function(t,e,i,n,o,r,s){var a=new Cs;return a.ItemNo=t,a.CharOffs=e,a.CharLen=i,a.ParaFirst=o,a.LineFirst=r,a.rect.resetRect(n),s++,this.DrawItems.insert(s,a),1==e&&(this.Items[t].FirstDItemNo=s),s}},{key:"GetHeadTailBreak",value:function(t,e){if(e<1)return e;var i=t[e+1-1];return lp.PosCharHC(i,lp.DontLineFirstChar)>0?(e--,e=this.GetHeadTailBreak(t,e)):(i=t[e-1],lp.PosCharHC(i,lp.DontLineLastChar)>0&&(e--,e=this.GetHeadTailBreak(t,e))),e}},{key:"MatchBreak",value:function(t,e,i,n){switch(e){case gp.HZ:if(t==gp.ZM||t==gp.SZ||t==gp.HZ||t==gp.FH)return mp.Prev;break;case gp.ZW:if(t!=gp.ZW&&t!=gp.ZM&&t!=gp.SZ)return mp.Prev;break;case gp.ZM:if(t!=gp.ZM&&t!=gp.SZ)return mp.Prev;break;case gp.SZ:switch(t){case gp.ZM:case gp.SZ:break;case gp.FH:var o=i[n-1-1];if("¢"==o);else if("."!=o&&":"!=o&&"-"!=o&&"^"!=o&&"*"!=o&&"/"!=o)return mp.Prev;break;default:return mp.Prev}break;case gp.FH:switch(t){case gp.FH:break;case gp.SZ:var r=i[n-1];if("."!=r&&":"!=r&&"-"!=r&&"^"!=r&&"*"!=r&&"/"!=r)return mp.Prev;break;case gp.ZM:if(":"!=i[n-1])return mp.Prev;break;default:return mp.Prev}}return mp.None}},{key:"FindLineBreak",value:function(t,e,i,n){if((n=this.GetHeadTailBreak(t,n))<1)return n;if(e)return n;var o=lp.GetUnicodeCharType(t[n-1]),r=lp.GetUnicodeCharType(t[n+1-1]);if(this.MatchBreak(o,r,t,n+1)!=mp.Prev&&o!=gp.Break){for(var s,a=!1,l=n-1;l>=i;l--){if(s=lp.GetUnicodeCharType(t[l-1]),this.MatchBreak(s,o,t,l+1)==mp.Prev){n=l,a=!0;break}o=s}a||(n=0)}return n}},{key:"DoFormatRectItemToDrawItem",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){t.FormatToDrawItem(this,e);var d=o-l.x;return t.Width>d&&!c&&(this.FinishLine(e,u,d),l.x=i,l.y=this.DrawItems[u].rect.bottom,c=!0),h.left=l.x,h.top=l.y,h.right=h.left+t.Width,t.StyleNo==cs.Bullet?h.bottom=h.top+t.Height:h.bottom=h.top+t.Height+this.Style.LineSpaceMin,u=this.NewDrawItem(e,r,1,h,s,c,u),t.IsFormatDirty=!1,{pos:l,rect:h,lineFirst:c,drawItemNo:u,remainderWidth:o-h.right}}},{key:"_FormatBreakTextDrawItem",value:function(t,e,i,n,o,r,s,a){var l=this.DrawItems[n],h=this.Items[l.ItemNo],c=h.Text.length;this.CalcItemFormatHeigh(h);var u=this.Style.TempCanvas.textWidth(h.Text[c-1]);return l.CharLen=l.CharLen-1,l.rect.right=l.rect.right-u,s=i-l.rect.right,this.FinishLine(t,n,s),o.x=e,o.y=l.rect.bottom,r.left=o.x,r.top=o.y,r.right=r.left+u,r.bottom=r.top+this.FItemFormatHeight,n=this.NewDrawItem(l.ItemNo,c,1,r,!1,!0,n),o.x=r.right,{drawItemNo:n,point:o,rect:r,remainderWidth:s=i-r.right,paraFirst:!1}}},{key:"DoFormatTextItemToDrawItems",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f,d,m,y,p,S,v){var F,I,g,w=!1;if(m=d||y.x==l&&(0!=this.DrawItems[v].width||!this.DrawItems[v].LineFirst),I=0,g=u[n-1]-r,o<0)I=n;else if(2==this.Style.FormatVersion){w=!1;for(var C=n-1;C<=a-1;C++)if(u[C]-r>o){if(!w&&lp.PosCharHC(i[C],lp.LineSqueezeChar)>0&&u[C]-r-o>3){w=!0;continue}I=C+1;break}}else for(var k=n-1;k<=a-1;k++)if(u[k]-r>o){I=k+1;break}if(0==I)p.left=y.x,p.top=y.y,p.right=p.left+u[a-1]-r,p.bottom=p.top+this.FItemFormatHeight,v=this.NewDrawItem(s,e+n-1,a-n+1,p,d,m,v),d=!1,S=c-p.right;else if(I==n)if(g>c-l){if(p.left=y.x,p.top=y.y,p.right=p.left+u[a-1]-r,p.bottom=p.top+this.FItemFormatHeight,v=this.NewDrawItem(s,e+n-1,1,p,d,m,v),d=!1,S=c-p.right,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom,n0&&this.Items[s-1].StyleNo>cs.Null&&this.DrawItems[v].CharLen>1){var D=this._FormatBreakTextDrawItem(s,l,c,v,y,p,S,d);v=D.drawItemNo,y=D.point,p=D.rect,S=D.remainderWidth,d=D.paraFirst,this.CalcItemFormatHeigh(t);var b=this.DoFormatTextItemToDrawItems(t,e,i,n,c-y.x,r,s,a,l,h,c,u,f,d,m,y,p,S,v);d=b.paraFirst,m=b.lineFirst,y=b.pos,p=b.rect,S=b.remainderWidth,v=b.drawItemNo}else{S=o,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom;var R=this.DoFormatTextItemToDrawItems(t,e,i,n,c-y.x,r,s,a,l,h,c,u,f,d,m,y,p,S,v);d=R.paraFirst,m=R.lineFirst,y=R.pos,p=R.rect,S=R.remainderWidth,v=R.drawItemNo}else if(F=g>c-l?I:I-1,0==(F=this.FindLineBreak(i,f.BreakRough,n,F))&&!m&&y.x>l){S=o,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom;var _=this.DoFormatTextItemToDrawItems(t,e,i,n,c-y.x,r,s,a,l,h,c,u,f,d,m,y,p,S,v);d=_.paraFirst,m=_.lineFirst,y=_.pos,p=_.rect,S=_.remainderWidth,v=_.drawItemNo}else if(Fc-l?I:I-1),p.left=y.x,p.top=y.y,p.right=p.left+u[F-1]-r,p.bottom=p.top+this.FItemFormatHeight,v=this.NewDrawItem(s,e+n-1,F-n+1,p,d,m,v),d=!1,S=w?0:c-p.right,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom,Fthis.FormatTextCut;){v=this.Style.TempCanvas.getTextExtentExPoint(c.substr(I,this.FormatTextCut),this.FormatTextCut);for(var w=0;w<=this.FormatTextCut-1;w++)S[I+w]=v[w]+g;F-=this.FormatTextCut,g=S[(I+=this.FormatTextCut)-1]}v=this.Style.TempCanvas.getTextExtentExPoint(c.substr(I,F),F);for(var C=0;C<=F-1;C++)S[I+C]=v[C]+g;var k=this.DoFormatTextItemToDrawItems(d,e,c,1,n-r.x,0,t,p,i,o,n,S,m,a,l,r,u,f,s);a=k.paraFirst,l=k.lineFirst,r=k.pos,u=k.rect,f=k.remainderWidth,s=k.drawItemNo}else u.left=r.x,u.top=r.y,u.right=u.left,u.bottom=u.top+this.FItemFormatHeight,s=this.NewDrawItem(t,e,d.Length,u,a,l,s);return t==this.Items.count-1?this.FinishLine(t,s,f):this.Items[t+1].ParaFirst?(this.FinishLine(t,s,f),r.x=0,r.y=this.DrawItems[s].rect.bottom):r.x=u.right,{pos:r,drawItemNo:s}}},{key:"FormatInit",value:function(){this.FFormatChange||(this.FFormatHeightChange=!1,this.FFormatStartDrawItemNo=-1),this.FFormatDrawItemCountChange=!1,this.FFormatStartTop=0,this.FFormatEndBottom=0,this.FLastFormatParaNo=cs.Null}},{key:"Clear",value:function(){this.FFormatChange=!1,this.FormatInit(),rc(hc(r.prototype),"Clear",this).call(this)}},{key:"ReSetSelectAndCaret",value:function(t){this.ReSetSelectAndCaretByOffset(t,this.GetItemOffsetAfter(t))}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,0!=this.FFormatCount)return this.FCurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,void(this.FCurParaNo=this.Items[this.SelectInfo.StartItemNo].ParaNo);var n=0;n=this.Items[t].StyleNo>cs.Null&&this.SelectInfo.StartItemOffset>this.Items[t].Length?this.Items[t].Length:e;var o=this.GetDrawItemNoByOffset(t,n);i&&o0&&!this.DrawItems[e].LineFirst;)e--;return e>0&&this.GetDrawItemStyle(e-1)0&&e--,e}},{key:"FormatPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==this.FFormatCount){if(this.FormatInit(),t>0&&!this.DrawItems[t].LineFirst)throw"行中格式化必需从行首开始,否则会影响分散的计算!";var i=-1,n=-1;i=e<0?this.DrawItems[t].ItemNo:e;var o=this.GetItemLastDrawItemNo(i);this.DrawItems.MarkFormatDelete(t,o),t>0?(this.FFormatStartTop=this.DrawItems[t-1].rect.bottom,n=this.DrawItems[t].rect.top-this.FFormatStartTop):(this.FFormatStartTop=0,n=0);for(var r=t+1;r<=o;r++)this.DrawItems[r].LineFirst&&(n=n+this.DrawItems[r].rect.top-this.DrawItems[r-1].rect.bottom);this.FFormatEndBottom=0!=n?-1:this.DrawItems[o].rect.bottom-n}}},{key:"ReFormatData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0==this.FFormatCount){var o=-1;o=e<0?this.DrawItems[t].ItemNo:e;var r=this.DrawItems.count;this.FormatRange(t,o),this.FFormatDrawItemCountChange=this.DrawItems.count!=r;var s=!1,a=this.GetItemLastDrawItemNo(o);if((s=!!(this.Items[o].StyleNo=0&&this.SelectInfo.StartItemNo=0&&this.SelectInfo.StartItemOffset<=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)?this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset):this.ReSetSelectAndCaretByOffset(0,0)}},{key:"ReFormatActiveParagraph",value:function(){if(this.SelectInfo.StartItemNo>=0){var t=-1,e=-1,i=this.GetParaItemRang(this.SelectInfo.StartItemNo,t,e);t=i.a,e=i.b,this.FormatPrepare(this.Items[t].FirstDItemNo,e),this.ReFormatData(this.Items[t].FirstDItemNo,e),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo)}}},{key:"ReFormatActiveItem",value:function(){if(!this.SelectExists()&&this.SelectInfo.StartItemNo>=0){var t=-1,e=-1,i=this.GetFormatRange(t,e);t=i.firstDrawItemNo,e=i.lastItemNo,this.FormatPrepare(t,e),this.Items[this.SelectInfo.StartItemNo].StyleNothis.Items[this.SelectInfo.StartItemNo].Length&&this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo)}}},{key:"ItemReFormatRequest",value:function(t){null!=this.OnItemReFormatRequest&&this.OnItemReFormatRequest(this,t)}},{key:"ItemReFormatResponse",value:function(t){this.FormatItem(t)}},{key:"ItemSetCaretRequest",value:function(t,e){t>=0&&(this.DisSelect(),this.ReSetSelectAndCaretByOffset(t,e),this.Style.UpdateInfoReCaret(!0),null!=this.OnItemSetCaretRequest&&this.OnItemSetCaretRequest(this,t,e))}},{key:"SetFormatHeightChange",value:function(){this.FFormatChange=!0}},{key:"GetDrawItemFormatTop",value:function(t){return this.DrawItems[t].rect.top}},{key:"Clone",value:function(t){rc(hc(r.prototype),"Clone",this).call(this,t),this.ReFormat()}},{key:"GetItemNo",value:function(t){for(var e=0;e0&&void 0!==arguments[0])||arguments[0];this.FFormatCount>0&&this.FFormatCount--,0==this.FFormatCount&&t&&this.ReFormat()}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.FWidth=t}},{key:"FormatStartDrawItemNo",get:function(){return this.FFormatStartDrawItemNo}},{key:"FormatHeightChange",get:function(){return this.FFormatHeightChange}},{key:"FormatDrawItemCountChange",get:function(){return this.FFormatDrawItemCountChange}},{key:"FormatChange",get:function(){return this.FFormatChange},set:function(t){this.FFormatChange=t}},{key:"FormatCount",get:function(){return this.FFormatCount}}])&&oc(e.prototype,i),n&&oc(e,n),r}(eh));function vc(t){return(vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fc(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ic(t,e)}function Ic(t,e){return(Ic=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=bc(t);if(e){var o=bc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return wc(this,i)}}function wc(t,e){return!e||"object"!==vc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Cc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kc(t,e){for(var i=0;i=0&&(t.pen.color=at.Red,this.StructState==Bc&&(t.pen.style=pt.Dot),t.rectangle(this.FPoints[this.FActivePointIndex].x+e.left-this.PointSize,this.FPoints[this.FActivePointIndex].y+e.top-this.PointSize,this.FPoints[this.FActivePointIndex].x+e.left+this.PointSize,this.FPoints[this.FActivePointIndex].y+e.top+this.PointSize))}},{key:"SetActive",value:function(t){Dc(bc(i.prototype),"SetActive",this).call(this,t),this.Active||(this.FActivePointIndex=-1,this.FActiveLineIndex=-1)}},{key:"GetPointAt",value:function(t,e){for(var i=null,n=0;n=0,i=this.Active):i=n>=0,i||(n=this.GetLineAt(t.x,t.y),this.FActiveLineIndex!=n?(this.FActiveLineIndex=n,this.Active=this.FActiveLineIndex>=0,i=this.Active):i=n>=0),i&&this.FMousePt.reset(t.x,t.y)}return i}},{key:"MouseMove",value:function(t){if(this.StructState==Bc)return this.FPoints[this.FActivePointIndex].reset(t.x,t.y),!0;if(t.button!=ee||or.keyDownStates[Re]){var e=this.GetPointAt(t.x,t.y);if(e>=0)return this.Cursor=se,!0;if((e=this.GetLineAt(t.x,t.y))>=0)return this.Cursor=de,!0}else{if(this.FActivePointIndex>=0)return this.FPoints[this.FActivePointIndex].reset(t.x,t.y),!0;if(this.FActiveLineIndex>=0)return this.OffsetPoints(t.x-this.FMousePt.x,t.y-this.FMousePt.y),this.FMousePt.reset(t.x,t.y),!0}return!1}},{key:"MouseUp",value:function(t){return!1}},{key:"KeyDown",value:function(t){return(t.keyCode==Pe||t.keyCode==Ge)&&this.StructState==Oc&&this.FActivePointIndex>=0&&this.FPoints.count>2&&(this.FPoints.removeAt(this.FActivePointIndex),this.FActivePointIndex=-1,!0)}},{key:"PaintTo",value:function(t,e,i){t.pen.color=this.Color,t.pen.width=this.FWidth,t.pen.style=this.FLineStyle,t.beginPath(),t.drawLineByPoints(this.FPoints),this.FPoints.count>1&&t.lineTo(this.FPoints[0].x+e.left,this.FPoints[0].y+e.top),t.paintPath(),!i.Print&&this.Active&&this.PaintAnchor(t,e)}},{key:"PointInClient",value:function(t,e){var i=this.GetPointAt(t,e);return i>=0||(i=this.GetLineAt(t,e))>=0}},{key:"StructOver",value:function(){this.FActivePointIndex=-1,this.FActiveLineIndex=-1,this.FPoints.count>2&&this.FPoints.removeAt(this.FPoints.count-1),Dc(bc(i.prototype),"StructOver",this).call(this)}},{key:"SaveToStream",value:function(t){Dc(bc(i.prototype),"SaveToStream",this).call(this,t),t.writeByte(this.FWidth),t.writeByte(this.FLineStyle),t.writeInt32(this.FPoints.count);for(var e=0;e=0&&(this[this.FActiveIndex].Active=!1),this.FActiveIndex=t,this.FActiveIndex>=0&&(this[this.FActiveIndex].Active=!0))}},{key:"MouseDown",value:function(t){var e=!1;if(this.FOperStyle!=Rc)this.FActiveIndex<0&&(this.ActiveIndex=this.NewShape(this.FOperStyle),this[this.FActiveIndex].StructStart()),this.FActiveIndex>=0&&(e=this[this.FActiveIndex].MouseDown(t));else{for(var i=-1,n=0;n=0&&this[this.FActiveIndex].MouseMove(t))return this.FHotIndex=this.FActiveIndex,!0;this.FHotIndex=-1;for(var e=0;e=0){if(this[this.FActiveIndex].KeyDown(t))return!0;if(t.keyCode==Pe||t.keyCode==Ge)return this.removeAt(this.FActiveIndex),this.FActiveIndex=-1,!0}return!1}},{key:"DisActive",value:function(){this.FOperStyle=Rc,this.FActiveIndex>=0&&(this[this.FActiveIndex].Active=!1)}},{key:"PaintTo",value:function(t,e,i){for(var n=0;nt){var i=this.Width/t;this.Width=t,this.Height=Math.round(this.Height/i)}if(this.Height>e){var n=this.Height/e;this.Height=e,this.Width=Math.round(this.Width/n)}}},{key:"LoadGraphicFile",value:function(t,e){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=new FileReader;o.readAsDataURL(t),o.onload=function(t){i.FImage=new $i,i.FImage.onImageLoaded=function(){n&&(i.Width=i.FImage.width,i.Height=i.FImage.height),i.FEmpty=!1,e(!0)},i.FImage.src=o.result},o.onerror=function(t){e(!1)}}},{key:"LoadGraphicStream",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null==this.FImage&&(this.FImage=new $i);var n=t.buffer;this.FImage.onImageLoaded=function(){i&&(e.Width=e.FImage.width,e.Height=e.FImage.height),e.FEmpty=!1},this.FImage.src="data:image/png;base64,"+n.toBase64()}},{key:"LoadFromBase64",value:function(t,e,i){var n=this;null==this.FImage&&(this.FImage=new $i),this.FImage.onImageLoaded=function(){n.Width=n.FImage.width,n.Height=n.FImage.height,n.FEmpty=!1,i&&i()},t?0!=t.indexOf("data:")?this.FImage.src="data:image/"+e+";base64,"+t:this.FImage.src=t:(this.Clear(),i&&i())}},{key:"SaveToStreamRange",value:function(t,e,i){if(Yc(Qc(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),""!=this.FImage.src){var n=this.FImage.src.split(","),o=b.fromBase64(n[1]);t.writeUInt32(o.length),o.length>0&&t.writeBuffer(o)}else t.writeUInt32(0);this.FShapeManager.SaveToStream(t)}},{key:"LoadFromStream",value:function(t,e,i){var n=this;Yc(Qc(r.prototype),"LoadFromStream",this).call(this,t,e,i);var o=t.readUInt32();if(o>0){null==this.FImage&&(this.FImage=new $i);var s=t.readBuffer(o);this.FImage.src="data:image/png;base64,"+b.fromBuffer(s).toBase64(),this.FEmpty=!1}else this.FImage=$i.Create(this.Width,this.Height),this.FEmpty=!0;this.FImage.onImageLoaded=function(){n.OwnerData.Style.InvalidateRect(null)},i>26&&this.FShapeManager.LoadFromStream(t)}},{key:"ToHtml",value:function(){return Yc(Qc(r.prototype),"ToHtml",this).call(this)}},{key:"ToXml",value:function(t){Yc(Qc(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Yc(Qc(r.prototype),"ParseXml",this).call(this,t)}},{key:"RecoverOrigianlSize",value:function(){this.Width=this.FImage.width,this.Height=this.FImage.height}},{key:"Image",get:function(){return this.FImage},set:function(t){this.FImage=t}},{key:"Empty",get:function(){return this.FEmpty}},{key:"ShapeManager",get:function(){return this.FShapeManager}}])&&Kc(e.prototype,i),n&&Kc(e,n),r}(rl);function tu(t){return(tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eu(t,e){for(var i=0;ir?o+4*this.FPadding:r+4*this.FPadding,this.Height=2*n+4*this.FPadding,this.FTopRect.resetBounds(this.FPadding+Math.trunc((this.Width-this.FPadding-this.FPadding-o)/2),this.FPadding,o,n),this.FBottomRect.resetBounds(this.FPadding+Math.trunc((this.Width-this.FPadding-this.FPadding-r)/2),this.Height-this.FPadding-n,r,n)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),this.FLineHide||(s.pen.color=at.Black,s.drawLineDriect(e.left+this.FPadding,e.top+this.FTopRect.bottom+this.FPadding,e.left+this.Width-this.FPadding,e.top+this.FTopRect.bottom+this.FPadding)),!a.Print){var l=new U;this.FActiveArea!=up.None&&(this.FActiveArea==up.Top?l.resetRect(this.FTopRect):this.FActiveArea==up.Bottom&&l.resetRect(this.FBottomRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)),this.FMouseMoveArea!=up.None&&this.FMouseMoveArea!=this.FActiveArea&&(this.FMouseMoveArea==up.Top?l.resetRect(this.FTopRect):this.FMouseMoveArea==up.Bottom&&l.resetRect(this.FBottomRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=lp.clMedGray,s.rectangleRect(l))}t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),s.textOut(e.left+this.FTopRect.left,e.top+this.FTopRect.top,this.FTopText),s.textOut(e.left+this.FBottomRect.left,e.top+this.FBottomRect.top,this.FBottomText)}},{key:"GetOffsetAt",value:function(t){return this.FOutSelectInto?Su(gu(r.prototype),"GetOffsetAt",this).call(this,t):t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"SetActive",value:function(t){Su(gu(r.prototype),"SetActive",this).call(this,t),t||(this.FActiveArea=up.None)}},{key:"MouseLeave",value:function(){Su(gu(r.prototype),"MouseLeave",this).call(this),this.FMouseMoveArea=up.None}},{key:"MouseDown",value:function(t){var e=Su(gu(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=0;this.FActiveArea==up.Top?(i=this.FTopText,n=t.x-this.FTopRect.left):this.FActiveArea==up.Bottom&&(i=this.FBottomText,n=t.x-this.FBottomRect.left);var o=-1;return this.FActiveArea!=up.None&&(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)),o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){if(this.FMouseLBDowning||t.button!=ee||or.keyDownStates[Re]||(this.FOutSelectInto=!0),this.FOutSelectInto)this.FMouseMoveArea=up.None;else{var e=this.GetExpressArea(t.x,t.y);e!=this.FMouseMoveArea&&(this.FMouseMoveArea=e,this.OwnerData.Style.UpdateInfoRePaint())}return Su(gu(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FMouseLBDowning=!1,this.FOutSelectInto=!1,Su(gu(r.prototype),"MouseUp",this).call(this,t)}},{key:"WantKeyDown",value:function(t){return!0}},{key:"KeyDown",value:function(t){switch(t.keyCode){case Pe:this.FActiveArea==up.Top?this.FCaretOffset>0&&(this.FTopText=C.stringDelete(this.FTopText,this.FCaretOffset-1,1),this.FCaretOffset--):this.FActiveArea==up.Bottom&&this.FCaretOffset>0&&(this.FBottomText=C.stringDelete(this.FBottomText,this.FCaretOffset-1,1),this.FCaretOffset--),this.FormatDirty();break;case Be:this.FCaretOffset>0&&this.FCaretOffset--;break;case Me:var e="";this.FActiveArea==up.Top?e=this.FTopText:this.FActiveArea==up.Bottom&&(e=this.FBottomText),this.FCaretOffset=0?(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),this.FActiveArea==up.Top?(this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.FTopRect.bottom-this.FTopRect.top,t.X=this.FTopRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FTopText.substr(0,this.FCaretOffset)),t.Y=this.FTopRect.top):this.FActiveArea==up.Bottom&&(this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.FBottomRect.bottom-this.FBottomRect.top,t.X=this.FBottomRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FBottomText.substr(0,this.FCaretOffset)),t.Y=this.FBottomRect.top)):t.Visible=!1}},{key:"GetExpressArea",value:function(t,e){return this.FTopRect.pointInAt(t,e)?up.Top:this.FBottomRect.pointInAt(t,e)?up.Bottom:up.None}},{key:"Assign",value:function(t){this.Assign(t),this.FTopText=t.TopText,this.FBottomText=t.BottomText}},{key:"SaveToStreamRange",value:function(t,e,i){Su(gu(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FTopText),lp.HCSaveTextToStream(t,this.FBottomText)}},{key:"LoadFromStream",value:function(t,e,i){Su(gu(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FTopText=lp.HCLoadTextFromStream(t,i),this.FBottomText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Su(gu(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Su(gu(r.prototype),"ParseXml",this).call(this,t)}},{key:"TopRect",get:function(){return this.FTopRect},set:function(t){this.FTopRect=t}},{key:"BottomRect",get:function(){return this.FBottomRect},set:function(t){this.FBottomRect=t}},{key:"Padding",get:function(){return this.FPadding}},{key:"LineHide",get:function(){return this.FLineHide},set:function(t){this.FLineHide=t}},{key:"TopText",get:function(){return this.FTopText},set:function(t){this.FTopText=t}},{key:"BottomText",get:function(){return this.FBottomText},set:function(t){this.FBottomText=t}},{key:"ActiveArea",get:function(){return this.FActiveArea}}])&&pu(e.prototype,i),n&&pu(e,n),r}(Ya);function Cu(t){return(Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ku(t,e){for(var i=0;ia?o+r+s+6*this.Padding:o+a+s+6*this.Padding,this.Height=2*n+4*this.Padding,this.FLeftRect.resetBounds(this.Padding,Math.trunc((this.Height-n)/2),o,n),this.FRightRect.resetBounds(this.Width-this.Padding-s,Math.trunc((this.Height-n)/2),s,n),this.TopRect.resetBounds(this.FLeftRect.right+this.Padding+Math.trunc((this.FRightRect.left-this.Padding-(this.FLeftRect.right+this.Padding)-r)/2),this.Padding,r,n),this.BottomRect.resetBounds(this.FLeftRect.right+this.Padding+Math.trunc((this.FRightRect.left-this.Padding-(this.FLeftRect.right+this.Padding)-a)/2),this.Height-this.Padding-n,a,n)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),s.pen.color=at.Black,s.drawLineDriect(e.left+this.FLeftRect.right+this.Padding,e.top+this.TopRect.bottom+this.Padding,e.left+this.FRightRect.left-this.Padding,e.top+this.TopRect.bottom+this.Padding),!a.Print){var l=new U;if(this.FActiveArea!=up.None){switch(this.FActiveArea){case up.Left:l.resetRect(this.FLeftRect);break;case up.Top:l.resetRect(this.TopRect);break;case up.Right:l.resetRect(this.FRightRect);break;case up.Bottom:l.resetRect(this.BottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)}if(this.FMouseMoveArea!=up.None&&this.FMouseMoveArea!=this.FActiveArea){switch(this.FMouseMoveArea){case up.Left:l.resetRect(this.FLeftRect);break;case up.Top:l.resetRect(this.TopRect);break;case up.Right:l.resetRect(this.FRightRect);break;case up.Bottom:l.resetRect(this.BottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=lp.clMedGray,s.rectangleRect(l)}}t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),s.textOut(e.left+this.FLeftRect.left,e.top+this.FLeftRect.top,this.FLeftText),s.textOut(e.left+this.TopRect.left,e.top+this.TopRect.top,this.TopText),s.textOut(e.left+this.FRightRect.left,e.top+this.FRightRect.top,this.FRightText),s.textOut(e.left+this.BottomRect.left,e.top+this.BottomRect.top,this.BottomText)}},{key:"MouseDown",value:function(t){var e=Pu(_u(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=0;switch(this.FActiveArea){case up.Left:i=this.FLeftText,n=t.x-this.FLeftRect.left;break;case up.Top:i=this.TopText,n=t.x-this.TopRect.left;break;case up.Right:i=this.FRightText,n=t.x-this.FRightRect.left;break;case up.Bottom:i=this.BottomText,n=t.x-this.BottomRect.left}var o=0;return this.FActiveArea!=up.None?(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)):o=-1,o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"KeyDown",value:function(t){if(this.FActiveArea==up.Left||this.FActiveArea==up.Right)switch(t.keyCode){case Pe:this.FActiveArea==up.Left?this.FCaretOffset>0&&(this.FLeftText=C.stringDelete(this.FLeftText,this.FCaretOffset-1,1),this.FCaretOffset--):this.FCaretOffset>0&&(this.FRightText=C.stringDelete(this.FRightText,this.FCaretOffset-1,1),this.FCaretOffset--),this.FormatDirty();break;case Be:this.FCaretOffset>0&&this.FCaretOffset--;break;case Me:var e=this.FRightText;this.FActiveArea==up.Left&&(e=this.FLeftText),this.FCaretOffsetthis.FRightText.length&&(this.FCaretOffset=this.FRightText.length)}}])&&ku(e.prototype,i),n&&ku(e,n),r}(wu);function Au(t){return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tu(t,e){for(var i=0;i51){var n=t.readByte();this.FChecked=or.system.isOdd(n>>7),this.BoxRight=or.system.isOdd(n>>6)}else this.FChecked=t.readBoolean();this.FText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Ou(Mu(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Ou(Mu(r.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Ou(Mu(r.prototype),"ToJSONString",this).call(this)+',"Checked":"'+this.FChecked+'"'}},{key:"ParseJSONOjbect",value:function(t){Ou(Mu(r.prototype),"ParseJSONOjbect",this).call(this,t),this.FChecked=t.checked}},{key:"Checked",get:function(){return this.FChecked},set:function(t){this.SetChecked(t)}}])&&Tu(e.prototype,i),n&&Tu(e,n),r}(Ja);function Gu(t){return(Gu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uu(t,e){return(Uu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=zu(t);if(e){var o=zu(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wu(this,i)}}function Wu(t,e){return!e||"object"!==Gu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function zu(t){return(zu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ju=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uu(t,e)}(i,t);var e=Vu(i);function i(){return Hu(this,i),e.apply(this,arguments)}return i}(sl);function Xu(t){return(Xu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ku(t,e){for(var i=0;ithis.Width-this.FPaddingRight?this.FLeftOffset=this.FLeftOffset+i-this.Width+this.FPaddingRight:i<0&&(this.FLeftOffset=this.FLeftOffset+i)}}},{key:"GetCharDrawLeft",value:function(t){var e=0;return t>0&&(t==this.FText.length?e=this.Width:(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),e=this.FPaddingLeft+this.FAlignLeft+this.OwnerData.Style.TempCanvas.textWidth(this.FText.substr(0,t))-this.FLeftOffset)),e}},{key:"OffsetInSelect",value:function(t){return t>=this.FCaretOffset&&t<=this.FSelEnd}},{key:"DeleteSelectText",value:function(){this.FText=C.stringDelete(this.FText,this.FCaretOffset,this.FSelEnd-this.FCaretOffset),this.FSelEnd=-1,this.FSelMove=this.FCaretOffset,this.CalcTextSize()}},{key:"DisSelectText",value:function(){this.FSelMove=this.FCaretOffset,this.SelectTextExists()&&(this.FSelEnd=-1)}},{key:"GetReadOnly",value:function(){return this.FReadOnly}},{key:"SetReadOnly",value:function(t){this.FReadOnly!=t&&(this.FReadOnly=t)}},{key:"FormatToDrawItem",value:function(t,e){switch(this.CalcSize(),this.FTextAlignHorz){case Xa:this.FAlignLeft=(this.Width-this.FPaddingLeft-this.FTextSize.width-this.FPaddingRight)/2;break;case Ka:this.FAlignLeft=this.Width-this.FPaddingLeft-this.FTextSize.width-this.FPaddingRight;break;default:this.FAlignLeft=0}}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){if(Yu(Qu(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l),!l.Print&&(this.FReadOnly?(a.brush.color=lp.clBtnFace,a.fillRect(e)):this.IsSelectComplate&&(a.brush.color=t.SelColor,a.fillRect(e)),this.SelectTextExists())){a.brush.color=t.SelColor;var h=this.GetCharDrawLeft(this.FCaretOffset),c=this.GetCharDrawLeft(this.FSelEnd);h=Math.max(0,Math.min(h,this.Width)),c=Math.max(0,Math.min(c,this.Width)),a.fillRect(U.Create(e.left+h,e.top,e.left+c,e.bottom))}if(t.TextStyles[this.TextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),this.AutoSize||l.Print?a.textOut(e.left+this.FPaddingLeft+this.FAlignLeft,e.top+this.FPaddingTop,this.FText):a.textRect(e,e.left+this.FPaddingLeft+this.FAlignLeft-this.FLeftOffset,e.top+this.FPaddingTop,this.FText),(!l.Print||!this.FPrintOnlyText)&&this.FBorderSides.value>0){l.Print||!this.FMouseIn&&!this.Active?a.pen.color=at.Black:a.pen.color=at.Blue,a.pen.width=this.FBorderWidth,a.pen.style=pt.Solid,a.beginPath();try{this.FBorderSides.has(fp.Left)&&a.drawLine(e.left,e.top,e.left,e.bottom),this.FBorderSides.has(fp.Top)&&a.drawLine(e.left,e.top,e.right,e.top),this.FBorderSides.has(fp.Right)&&a.drawLine(e.right-1,e.top,e.right-1,e.bottom),this.FBorderSides.has(fp.Bottom)&&a.drawLine(e.left,e.bottom-1,e.right,e.bottom-1)}finally{a.paintPath()}}}},{key:"GetOffsetAt",value:function(t){return t<=this.FPaddingLeft?lp.OffsetBefor:t>=this.Width-this.FPaddingRight?lp.OffsetAfter:lp.OffsetInner}},{key:"SetActive",value:function(t){var e=this.Active;Yu(Qu(r.prototype),"SetActive",this).call(this,t),t||(this.DisSelectText(),this.FLeftOffset=0,this.FCaretOffset=-1),e!=this.Active&&(e&&null!=this.OnDeactivate?this.OnDeactivate(this):e||null==this.OnActivate||this.OnActivate(this,null))}},{key:"MouseDown",value:function(t){var e=Yu(Qu(r.prototype),"MouseDown",this).call(this,t);if(!this.Active)return e;this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo);var i=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,this.FText,t.x-this.FPaddingLeft-this.FAlignLeft+this.FLeftOffset);if(t.button==ee)this.DisSelectText();else{if(this.OffsetInSelect(i))return e;this.DisSelectText()}return i!=this.FCaretOffset&&(this.FCaretOffset=i,this.FSelMove=i,this.ScrollAdjust(i),this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){var e=Yu(Qu(r.prototype),"MouseMove",this).call(this,t);return t.button==ee&&(t.x<0?this.FLeftOffset=Math.max(this.FAlignLeft,this.FLeftOffset-this.OwnerData.Style.TextStyles[this.TextStyleNo].TextMetric_tmAveCharWidth):t.x>this.Width-this.FPaddingRight&&(this.FLeftOffset=Math.max(this.FAlignLeft,Math.min(this.FTextSize.width-this.Width+this.FPaddingRight+this.FAlignLeft,this.FLeftOffset+this.OwnerData.Style.TextStyles[this.TextStyleNo].TextMetric_tmAveCharWidth))),this.FSelEnd=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,this.FText,t.x-this.FPaddingLeft-this.FAlignLeft+this.FLeftOffset),this.FSelMove=this.FSelEnd,!this.SelectTextExists()&&this.FSelEnd>=0&&(this.FSelEnd=-1,this.FSelMove=this.FCaretOffset),this.ScrollAdjust(this.FSelMove)),e}},{key:"MouseUp",value:function(t){if(t.button==ee&&this.FSelEnd>=0&&this.FSelEnd0&&(this.FText=C.stringDelete(this.FText,this.FCaretOffset-1,1),this.FCaretOffset--,this.CalcTextSize()),this.ScrollAdjust(this.FCaretOffset),this.FormatDirty();break;case Be:this.DisSelectText(),this.FCaretOffset>0&&this.FCaretOffset--,this.ScrollAdjust(this.FCaretOffset),this.OwnerData.Style.UpdateInfoRePaint();break;case Me:this.DisSelectText(),this.FCaretOffsetthis.Width&&(t.Visible=!1)}}},{key:"GetText",value:function(){return this.FText}},{key:"SetText",value:function(t){this.FReadOnly||this.FText==t||(this.FText=t,this.FCaretOffset>this.FText.length&&(this.FCaretOffset=0),this.AutoSize?this.OwnerData.ItemReFormatRequest(this):this.OwnerData.Style.UpdateInfoRePaint())}},{key:"SetTextAlignHorz",value:function(t){this.FTextAlignHorz!=t&&(this.FTextAlignHorz=t,this.ReFormatRequest())}},{key:"SelectTextExists",value:function(){return this.FSelEnd>=0&&this.FSelEnd!=this.FCaretOffset}},{key:"CoordInSelect",value:function(t,e){return this.SelectExists()&&U.CreateByBounds(0,0,this.Width,this.Height).pointInAt(t,e)}},{key:"SelectExists",value:function(){return Yu(Qu(r.prototype),"SelectExists",this).call(this)||this.SelectTextExists()}},{key:"IsSelectComplateTheory",value:function(){return this.IsSelectComplate}},{key:"DeleteSelected",value:function(){var t=Yu(Qu(r.prototype),"DeleteSelected",this).call(this);return this.SelectTextExists()&&(this.DeleteSelectText(),t=!0),t}},{key:"DisSelect",value:function(){this.DisSelectText(),Yu(Qu(r.prototype),"DisSelect",this).call(this)}},{key:"SaveSelectToText",value:function(){return this.SelectTextExists()?this.FText.substr(this.FCaretOffset,this.FSelEnd-this.FCaretOffset):Yu(Qu(r.prototype),"SaveSelectToText",this).call(this)}},{key:"Assign",value:function(t){Yu(Qu(r.prototype),"Assign",this).call(this,t),this.FText=t.Text,this.FReadOnly=t.ReadOnly,this.FPrintOnlyText=t.PrintOnlyText,this.FBorderSides.Value=t.BorderSides.Value,this.FBorderWidth=t.BorderWidth}},{key:"Clear",value:function(){this.Text=""}},{key:"ReFormatRequest",value:function(){this.FormatDirty(),this.OwnerData.ItemReFormatRequest(this)}},{key:"SaveToStreamRange",value:function(t,e,i){Yu(Qu(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FText);var n=0;this.FReadOnly&&(n|=128),this.FPrintOnlyText&&(n|=64),t.writeByte(n),t.writeByte(this.FBorderSides.value),t.writeByte(this.FBorderWidth),t.writeByte(this.FTextAlignHorz)}},{key:"LoadFromStream",value:function(t,e,i){if(Yu(Qu(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FText=lp.HCLoadTextFromStream(t,i),i>33){var n=t.readByte();this.FReadOnly=or.system.isOdd(n>>7),this.FPrintOnlyText=or.system.isOdd(n>>6)}else this.FReadOnly=t.readBoolean(),this.FPrintOnlyText=!1;i>15&&(this.FBorderSides.value=t.readByte(),this.FBorderWidth=t.readByte()),i>56&&(this.FTextAlignHorz=t.readByte())}},{key:"ToXml",value:function(t){Yu(Qu(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Yu(Qu(r.prototype),"ParseXml",this).call(this,t)}},{key:"ReadOnly",get:function(){return this.GetReadOnly()},set:function(t){this.SetReadOnly(t)}},{key:"PrintOnlyText",get:function(){return this.FPrintOnlyText},set:function(t){this.FPrintOnlyText=t}},{key:"BorderSides",get:function(){return this.FBorderSides},set:function(t){this.FBorderSides=t}},{key:"BorderWidth",get:function(){return this.FBorderWidth},set:function(t){this.FBorderWidth=t}},{key:"TextAlignHorz",get:function(){return this.FTextAlignHorz},set:function(t){this.SetTextAlignHorz(t)}}])&&Ku(e.prototype,i),n&&Ku(e,n),r}(Ja);function tf(t){return(tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ef(t,e){for(var i=0;ii?i:n,this._popupControl=new oi,this._popupControl.width=this._listBox.width,this._popupControl.height=this._listBox.height,this._popupControl.dropDownStyle=!0,this._popupControl.onClose=function(){t._popupControl=null},this._popupControl.onPaint=function(e){t._listBox.paintTo(e,0,0)},this._popupControl.onMouseEnter=function(){t._listBox.mouseEnter()},this._popupControl.onMouseLeave=function(){t._listBox.mouseLeave()},this._popupControl.onMouseWheel=function(e){t._listBox.mouseWheel(e)},this._popupControl.onMouseDown=function(e){t._popupDownInTextArea=t._listBox.textArea().pointInAt(e.x,e.y),t._listBox.mouseDown(e)},this._popupControl.onMouseMove=function(e){t._listBox.mouseMove(e)},this._popupControl.onMouseUp=function(e){t._listBox.mouseUp(e),t._popupDownInTextArea&&t._listBox.textArea().pointInAt(e.x,e.y)&&(t._popupControl.donePopup(),t.OwnerData.Style.InvalidateRect(U.Create(t.FButtonDrawRect.right-t.Width,t.FButtonDrawRect.top,t.FButtonDrawRect.right,t.FButtonDrawRect.bottom)))}}var o=this.OwnerData.GetScreenCoord(this.FButtonDrawRect.left-(this.Width-this.FButtonDrawRect.width),this.FButtonDrawRect.bottom+1);this._popupAlign==Wt||(o.x+=this.Width-this._popupControl.width),this._popupControl.popup(o.x,o.y,!0)}},{key:"KeyDown",value:function(t){!this.FStatic&&this.Enabled&&nf(lf(r.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){!this.FStatic&&this.Enabled&&nf(lf(r.prototype),"KeyPress",this).call(this,t)}},{key:"MouseDown",value:function(t){return this.Enabled&&!this.ReadOnly&&this.OwnerData.CanEdit()&&t.button==ee&&this.FButtonRect.pointInAt(t.x,t.y)?(this.DoPopup(),!0):nf(lf(r.prototype),"MouseDown",this).call(this,t)}},{key:"MouseMove",value:function(t){return this.FButtonRect.pointInAt(t.x,t.y)?(this.FMouseInButton||(this.FMouseInButton=!0,this.OwnerData.Style.UpdateInfoRePaint()),lp.GCursor=oe,!0):(this.FMouseInButton&&(this.FMouseInButton=!1,this.OwnerData.Style.UpdateInfoRePaint()),nf(lf(r.prototype),"MouseMove",this).call(this,t))}},{key:"MouseLeave",value:function(){nf(lf(r.prototype),"MouseLeave",this).call(this),this.FMouseInButton=!1}},{key:"GetCaretInfo",value:function(t){nf(lf(r.prototype),"GetCaretInfo",this).call(this,t),!this.AutoSize&&t.X>this.Width-this.BTNWIDTH&&(t.Visible=!1)}},{key:"SetItemIndex",value:function(t){this.ReadOnly||(t>=0&&t<=this._listBox.items.count-1?this._listBox.itemIndex=t:(this.FItemIndex=-1,this.Text=""),this.DoChange(),null!=this.OnItemIndexChanged&&this.OnItemIndexChanged(this))}},{key:"Assign",value:function(t){nf(lf(r.prototype),"Assign",this).call(this,t),this.FStatic=t.Static,this.FSaveItem=t.SaveItem,this._listBox.items.clear();for(var e=0;e0){o=this._listBox.items[0].text;for(var s=1;s0){o=this.FItemValues[0];for(var a=1;a36){if(i>40){var n=t.readByte();this.FStatic=or.system.isOdd(n>>7),this.FSaveItem=or.system.isOdd(n>>6)}else this.FSaveItem=t.readBoolean();if(this.FSaveItem){for(var o=lp.HCLoadTextFromStream(t,i).split(lp.sLineBreak),s=0,a=o.length;s0&&i>35)for(var d=0,m=(c=lp.HCLoadTextFromStream(t,i).split(lp.sLineBreak)).length;d0}}},{key:"AddItem",value:function(t,e){this._listBox.items.add(t),this.FItemValues.add(e)}},{key:"Clear",value:function(){this._listBox.items.clear(),this.FItemValues.clear()}},{key:"ToXml",value:function(t){nf(lf(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){nf(lf(r.prototype),"ParseXml",this).call(this,t)}},{key:"Items",get:function(){return this._listBox.items}},{key:"ItemValues",get:function(){return this.FItemValues}},{key:"ItemIndex",get:function(){return this.FItemIndex},set:function(t){this.SetItemIndex(t)}},{key:"SaveItem",get:function(){return this.FSaveItem},set:function(t){this.FSaveItem=t}},{key:"Static",get:function(){return this.FStatic},set:function(t){this.FStatic=t}}])&&ef(e.prototype,i),n&&ef(e,n),r}($u);function cf(t){return(cf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uf(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0;return Ff(this,i),(t=e.call(this)).Size=n,t.Bits=new P(n>0?n+31>>5:1),t}return gf(i,[{key:"EnsureCapacity",value:function(t){if(t>this.Bits.length<<5){var e=this.Bits.length;this.Bits.length=t;for(var i=e;i>3}},{key:"GetSize",value:function(){return this.Size}},{key:"Get",value:function(t){return 0!=(this.Bits[t>>5]&1<<(31&t))}},{key:"SetBit",value:function(t){this.Bits[t>>5]|=1<<(31&t)}},{key:"AppendBit",value:function(t){this.EnsureCapacity(this.Size+1),t&&(this.Bits[this.Size>>5]|=1<<(31&this.Size)),this.Size++}},{key:"AppendBits",value:function(t,e){this.EnsureCapacity(this.Size+e);for(var i=e;i>0;i--)this.AppendBit(1==(t>>i-1&1))}},{key:"AppendBitArray",value:function(t){var e=t.GetSize();this.EnsureCapacity(this.Size+e);for(var i=0;i=Math.trunc((t+7)/8))return n;return null}}]),i}(L),Yf=function(t){wf(i,t);var e=kf(i);function i(){return Ff(this,i),e.call(this)}return gf(i,[{key:"GetDataMaskBit",value:function(t,e,i){var n,o=0;if(t>=0&&t<8)switch(t){case 0:o=i+e&1;break;case 1:o=1&i;break;case 2:o=e%3;break;case 3:o=(i+e)%3;break;case 4:o=(i>>1)+Math.trunc(e/3)&1;break;case 5:o=(1&(n=i*e))+n%3;break;case 6:o=(1&(n=i*e))+(3&n)&1;break;case 7:o=(n=i*e)%3+(i+e&1)&1}return 0==o}}]),i}(L),Jf=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).MatrixUtilError=!1,t}return gf(i,[{key:"ClearMatrix",value:function(t){t.Clear(255)}},{key:"EmbedBasicPatterns",value:function(t,e){this.EmbedPositionDetectionPatternsAndSeparators(e),this.EmbedDarkDotAtLeftBottomCorner(e),this.MaybeEmbedPositionAdjustmentPatterns(t,e),this.EmbedTimingPatterns(e)}},{key:"EmbedTypeInfo",value:function(t,e,i){var n,o,r,s,a,l=new Bf;this.MakeTypeInfoBits(t,e,l);for(var h=0;h0;){for(6==l&&l--;h>=0&&h>=1,e++;return e}},{key:"CalculateBCHCode",value:function(t,e){var i=this.FindMSBSet(e);for(t<<=i-1;this.FindMSBSet(t)>=i;)t^=e<=0&&e<8){var n=t.Bits<<3|e;i.AppendBits(n,5);var o=this.CalculateBCHCode(n,1335);i.AppendBits(o,10);var r=new Bf;if(r.AppendBits(21522,15),i.XorOperation(r),15!=i.GetSize())return void(this.MatrixUtilError=!0)}}},{key:"MakeVersionInfoBits",value:function(t,e){e.AppendBits(t,6);var i=this.CalculateBCHCode(t,7973);e.AppendBits(i,12),18!=e.GetSize()&&(this.MatrixUtilError=!0)}},{key:"IsEmpty",value:function(t){return-1==t}},{key:"EmbedTimingPatterns",value:function(t){for(var e,i=8;i<=t.Width-9;i++)e=(i+1)%2,this.IsEmpty(t.Get(i,6))&&t.SetInteger(i,6,e),this.IsEmpty(t.Get(6,i))&&t.SetInteger(6,i,e)}},{key:"EmbedDarkDotAtLeftBottomCorner",value:function(t){0!=t.Get(8,t.Height-8)?t.SetInteger(8,t.Height-8,1):this.MatrixUtilError=!0}},{key:"EmbedHorizontalSeparationPattern",value:function(t,e,i){for(var n=0;n<8;n++){if(!this.IsEmpty(i.Get(t+n,e)))return void(this.MatrixUtilError=!0);i.SetInteger(t+n,e,Hf[0][n])}}},{key:"EmbedVerticalSeparationPattern",value:function(t,e,i){for(var n=0;n<7;n++){if(!this.IsEmpty(i.Get(t,e+n)))return void(this.MatrixUtilError=!0);i.SetInteger(t,e+n,Uf[n][0])}}},{key:"EmbedPositionAdjustmentPattern",value:function(t,e,i){for(var n=0;n<5;n++)for(var o=0;o<5;o++){if(!this.IsEmpty(i.Get(t+o,e+n)))return void(this.MatrixUtilError=!0);i.SetInteger(t+o,e+n,Wf[n][o])}}},{key:"EmbedPositionDetectionPattern",value:function(t,e,i){for(var n=0;n<7;n++)for(var o=0;o<7;o++){if(!this.IsEmpty(i.Get(t+o,e+n)))return void(this.MatrixUtilError=!0);i.SetInteger(t+o,e+n,Vf[n][o])}}},{key:"EmbedPositionDetectionPatternsAndSeparators",value:function(t){var e=Vf[0].length;this.EmbedPositionDetectionPattern(0,0,t),this.EmbedPositionDetectionPattern(t.Width-e,0,t),this.EmbedPositionDetectionPattern(0,t.Width-e,t);var i=Hf[0].length;this.EmbedHorizontalSeparationPattern(0,i-1,t),this.EmbedHorizontalSeparationPattern(t.Width-i,i-1,t),this.EmbedHorizontalSeparationPattern(0,t.Width-i,t);var n=Uf.length;this.EmbedVerticalSeparationPattern(n,0,t),this.EmbedVerticalSeparationPattern(t.Height-n-1,0,t),this.EmbedVerticalSeparationPattern(n,t.Height-n,t)}},{key:"MaybeEmbedPositionAdjustmentPatterns",value:function(t,e){if(t>=2){for(var i,n,o=t-1,r=zf[o].length,s=new P(r),a=0;a=this.FSize&&(t^=this.FPrimitive,t&=this.FSize-1);for(var i=0;i=0){if(0==e)return this.FZero;var i=new P(t+1);return i[0]=e,new qf(this,i)}return null}}],[{key:"CreateQRCodeField256",value:function(){return new i(285,256,0)}},{key:"AddOrSubtract",value:function(t,e){return t^e}}]),i}(L),qf=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;Ff(this,i),(o=e.call(this)).Coefficients=n,o.FField=t,o.FField.FPolyList.length=o.FField.FPolyList.length+1,o.FField.FPolyList[o.FField.FPolyList.length-1]=Df(o);var r=n.length;if(r>1&&0==n[0]){for(var s=1;s=0){if(0==e)return this.FField.GetZero();for(var n=this.Coefficients.length,o=new P(n+t),r=0;r=t.GetDegree()&&!a.IsZero();)i=a.GetDegree()-t.GetDegree(),n=this.FField.Multiply(a.GetCoefficient(a.GetDegree()),h),o=t.MultiplyByMonomial(i,n),r=this.FField.BuildMonomial(i,n),s=s.AddOrSubtract(r),a=a.AddOrSubtract(o);(e=new k(2))[0]=s,e[1]=a}return e}},{key:"GetCoefficients",value:function(){return this.Coefficients}},{key:"IsZero",value:function(){return 0==this.Coefficients[0]}},{key:"GetCoefficient",value:function(t){return this.Coefficients[this.Coefficients.length-1-t]}},{key:"GetDegree",value:function(){return this.Coefficients.length-1}},{key:"AddOrSubtract",value:function(t){if(null!=t&&this.FField===t.FField){if(this.IsZero())return t;if(t.IsZero())return this;var e=this.Coefficients.concat(),n=t.Coefficients.concat();if(e.length>n.length){var o=e.concat();e=n,n=o}var r=new P(n.length),s=n.length-e.length;s>0&&(r=n.concat());for(var a=s,l=n.length;a0){var i=t.length-e;if(i>0){for(var n=this.BuildGenerator(e),o=new P(i),r=0;r=this.FCachedGenerators.count)for(var e,i,n=this.FCachedGenerators[this.FCachedGenerators.count-1],o=new P(2),r=this.FCachedGenerators.count;r<=t;r++)o[0]=1,o[1]=this.FField.Exp(r-1+this.FField.GetGeneratorBase()),e=new qf(this.FField,o),i=n.Multiply(e),this.FCachedGenerators.add(i),n=i;return this.FCachedGenerators[t]}}]),i}(L),$f=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;return Ff(this,i),(o=e.call(this)).FDataBytes=t,o.FErrorCorrectionBytes=n,o}return gf(i,[{key:"GetDataBytes",value:function(){return this.FDataBytes}},{key:"GetErrorCorrectionBytes",value:function(){return this.FErrorCorrectionBytes}}]),i}(L),td=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).EncoderError=!1,t}return gf(i,[{key:"ApplyMaskPenaltyRule1Internal",value:function(t,e){var i,n,o=0,r=0,s=-1;e?(i=t.Height,n=t.Width):(i=t.Width,n=t.Height);for(var a,l=t.GetArray(),h=0;h5&&o++:(r=1,s=a);r=0}return o}},{key:"ChooseMode",value:function(t,e){var i,n=!0,o=!0,r=!0;if(0==e){for(var s=0;s"9"){n=!1;break}if(n)o=!1;else for(var a=0;a255){r=!1;break}return n?{mode:xf,encoding:e}:o?{mode:Af,encoding:e}:r?{mode:Tf,encoding:3}:{mode:Tf,encoding:4}}return 1==e?{mode:xf,encoding:e}:2==e?{mode:Af,encoding:e}:{mode:Tf,encoding:e}}},{key:"FilterContent",value:function(t,e,i){for(var n="",o=!1,r=0;r="0"&&t[r]<="9":e==Af?o=this.GetAlphanumericCode(t[r].charCodeAt(0))>0:e==Tf&&(3==i?o=t[r].charCodeAt(0)<=255:4!=i&&5!=i||(o=!0)),o&&(n+=t[r]);return n}},{key:"Append8BitBytes",value:function(t,e,i){var n=null;if(3==i){n=new Uint8Array(t.length);for(var o=0;o(1<=i)this.EncoderError=!0;else{var s=t%i,a=i-s,l=Math.trunc(t/i),h=l+1,c=Math.trunc(e/i),u=c+1,f=l-c,d=h-u;f==d&&i==a+s&&t==(c+f)*a+(u+d)*s?ni)this.FEncoderError=!0;else{for(var n=0;n<4&&e.GetSize()0)for(var r=o;r<8;r++)e.AppendBit(!1);for(var s=t-e.GetSizeInBytes(),a=0;a=0&&0==i[r][s-1]&&0==i[r][s-2]&&0==i[r][s-3]&&0==i[r][s-4])&&(e+=40),r+6=0&&0==i[r-1][s]&&0==i[r-2][s]&&0==i[r-3][s]&&0==i[r-4][s])&&(e+=40);return e}},{key:"ApplyMaskPenaltyRule4",value:function(t){for(var e=0,i=t.GetArray(),n=t.Width,o=t.Height,r=0;r=0&&t<8}},{key:"SetMatrix",value:function(t){this.Matrix=t}},{key:"SetECLevel",value:function(t){this.ECLevel=new Nf,this.ECLevel.Assign(t)}},{key:"SetAll",value:function(t,e,i,n,o,r){this.Version=t,this.NumTotalBytes=e,this.NumDataBytes=i,this.NumRSBlocks=n,this.NumECBytes=o,this.MatrixWidth=r}}]),i}(L),id=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;Ff(this,i),(o=e.call(this)).Width=t,o.Height=n,o.Bytes=new k(n);for(var r=0;rt&&(i=this.Width/t,this.Width=t,this.Height=Math.round(this.Height/i)),this.Height>e&&(i=this.Height/e,this.Height=e,this.Width=Math.round(this.Width/i))}}]),i}(rl);function rd(t,e){for(var i=0;i",">","30","212123"],["?","?","31","212321"],["@","@","32","232121"],["A","A","33","111323"],["B","B","34","131123"],["C","C","35","131321"],["D","D","36","112313"],["E","E","37","132113"],["F","F","38","132311"],["G","G","39","211313"],["H","H","40","231113"],["I","I","41","231311"],["J","J","42","112133"],["K","K","43","112331"],["L","L","44","132131"],["M","M","45","113123"],["N","N","46","113321"],["O","O","47","133121"],["P","P","48","313121"],["Q","Q","49","211331"],["R","R","50","231131"],["S","S","51","213113"],["T","T","52","213311"],["U","U","53","213131"],["V","V","54","311123"],["W","W","55","311321"],["X","X","56","331121"],["Y","Y","57","312113"],["Z","Z","58","312311"],["[","[","59","332111"],["\\","\\","60","314111"],["]","]","61","221411"],["^","^","62","431111"],["_","_","63","111224"],[String.fromCharCode(0),"`","64","111422"],[String.fromCharCode(1),"a","65","121124"],[String.fromCharCode(2),"b","66","121421"],[String.fromCharCode(3),"c","67","141122"],[String.fromCharCode(4),"d","68","141221"],[String.fromCharCode(5),"e","69","112214"],[String.fromCharCode(6),"f","70","112412"],[String.fromCharCode(7),"g","71","122114"],[String.fromCharCode(8),"h","72","122411"],[String.fromCharCode(9),"i","73","142112"],[String.fromCharCode(10),"j","74","142211"],[String.fromCharCode(11),"k","75","241211"],[String.fromCharCode(12),"l","76","221114"],[String.fromCharCode(13),"m","77","413111"],[String.fromCharCode(14),"n","78","241112"],[String.fromCharCode(15),"o","79","134111"],[String.fromCharCode(16),"p","80","111242"],[String.fromCharCode(17),"q","81","121142"],[String.fromCharCode(18),"r","82","121241"],[String.fromCharCode(19),"s","83","114212"],[String.fromCharCode(20),"t","84","124112"],[String.fromCharCode(21),"u","85","124211"],[String.fromCharCode(22),"v","86","411212"],[String.fromCharCode(23),"w","87","421112"],[String.fromCharCode(24),"x","88","421211"],[String.fromCharCode(25),"y","89","212141"],[String.fromCharCode(26),"z","90","214121"],[String.fromCharCode(27),"{","91","412121"],[String.fromCharCode(28),"|","92","111143"],[String.fromCharCode(29),"}","93","111341"],[String.fromCharCode(30),"~","94","131141"],[String.fromCharCode(31)," ","95","114113"],[" "," ","96","114311"],[" "," ","97","411113"],[" "," ","98","411311"],[" "," ","99","113141"],[" "," "," ","114131"],[" "," "," ","311141"],[" "," "," ","411131"],[" "," "," ","211412"],[" "," "," ","211214"],[" "," "," ","211232"]],vd=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.FModul=1,this.FZoom=1,this.FWidth=1,this.FHeight=100,this.FModules=new Array(4),this.FText="",this.FCode="",this.FTextVisible=!0,this.onWidthChanged=null,this.SetText(e)}var e,i,n;return e=t,(i=[{key:"IsDigit",value:function(t){return t>=0&&t<=9}},{key:"IsFourOrMoreDigits",value:function(t,e,i){i=0;var n=t.length;if(this.IsDigit(t[e])&&e+4=4}}},{key:"FindCodeA",value:function(t){for(var e=0,i=Sd.length;en)return{index:e,encoding:i,result:""};var o="",r="";return"&"==t[e]&&e+2<=n&&";"==t[e+2]&&("A"==(r=t[e+1].toUpperCase())||"B"==r||"C"==r||"S"==r||"1"==r||"2"==r||"3"==r||"4"==r)?{index:e+=3,encoding:i,result:o="&"+r+";"}:i==hd&&e+1<=n?(o=t.substr(e,2),{index:e+=2,encoding:i,result:o}):(o=t.substr(e,1),{index:++e,encoding:i,result:o})}},{key:"StripControlCodes",value:function(t,e){for(var i,n,o="",r=0,s=t.length,a=sd;rh-1)return{index:e,encoding:i,result:""};var c,u="",f="";"&"==t[e]&&e+2e&&(this.Height=e)}}])&&Id(e.prototype,i),n&&Id(e,n),r}(rl);function bd(t){return(bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rd(t,e){for(var i=0;i0){var s="";o>0&&(s=this.FFormat.substr(0,o)),i.left=this.FPaddingLeft,""!=s&&(i.left+=t.textWidth(s));var a=t.textMetric(this.FFormat.substr(o,r));i.top=Math.trunc((this.Height-a.height)/2),i.right=i.left+a.width,i.bottom=i.top+a.height}}},{key:"GetAreaRect",value:function(t){var e=new U;if(t==Nd.None)return e;var i=Dt.getCanvasTemp();return this.OwnerData.Style.TextStyles[this.TextStyleNo].ApplyStyle(i),""!=this.FFormat&&this.AppendFormat(i,t,e),e}},{key:"GetAreaAt",value:function(t,e){return this.GetAreaRect(Nd.Year).pointInAt(t,e)?Nd.Year:this.GetAreaRect(Nd.Month).pointInAt(t,e)?Nd.Month:this.GetAreaRect(Nd.Day).pointInAt(t,e)?Nd.Day:this.GetAreaRect(Nd.Hour).pointInAt(t,e)?Nd.Hour:this.GetAreaRect(Nd.Minute).pointInAt(t,e)?Nd.Minute:this.GetAreaRect(Nd.Second).pointInAt(t,e)?Nd.Second:this.GetAreaRect(Nd.Millisecond).pointInAt(t,e)?Nd.dtaMillisecond:Nd.None}},{key:"SetDateTime",value:function(t){this.FDateTime!=t&&(this.FDateTime=t,_d(Od(r.prototype),"SetText",this).call(this,this.FDateTime.format(this.FFormat)),this.FAreaRect=this.GetAreaRect(this.FActiveArea))}},{key:"Power10",value:function(t){for(var e=10,i=2;i<=t;i++)e*=10;return e}},{key:"GetYear",value:function(t){var e=this.FDateTime.year,i=1999,n=or.system.tryParseInt(t);if(n.ok)if((i=n.value)Nd.None&&(this.FActiveArea==Nd.Year&&this.SetInputYear(),this.FActiveArea=this.FActiveArea>>1,this.FAreaRect=this.GetAreaRect(this.FActiveArea),this.OwnerData.Style.UpdateInfoRePaint());break;case Me:this.FActiveArea=0)switch(this.FActiveArea){case Nd.Year:this.FNewYear.length>3&&(this.FNewYear=C.stringDelete(this.FNewYear,0,1)),this.FNewYear=this.FNewYear+e;break;case Nd.Month:if((i=n.month)>9){if("0"==e)return;n=X.Create(n.year,parseInt(e),n.day,n.hour,n.minute,n.second)}else if(1==i&&this.FJoinKey)"012".indexOf(e)>=0?(i=10*i+parseInt(e),n=X.Create(n.year,i,n.day,n.hour,n.minute,n.second)):n=X.Create(n.year,parseInt(e),n.day,n.hour,n.minute,n.second);else{if("0"==e)return;n=X.Create(n.year,parseInt(e),n.day,n.hour,n.minute,n.second)}break;case Nd.Day:if((i=n.day)>9){if("0"==t)return;n=X.Create(n.year,n.month,parseInt(e),n.hour,n.minute,n.second)}else this.FJoinKey&&((i=10*i+parseInt(e))>X.DaysInMonth(n.year,n.month)&&(i=parseInt(e)),n=X.Create(n.year,n.month,i,n.hour,n.minute,n.second));break;case Nd.Hour:if((i=n.hour)>9){if("0"==e)return;n=X.Create(n.year,n.month,n.day,parseInt(e),n.minute,n.second)}else if(this.FJoinKey)(i=10*i+parseInt(e))>23&&(i=parseInt(e)),n=X.Create(n.year,n.month,n.day,i,n.minute,n.second);else{if("0"==e)return;n=X.Create(n.year,n.month,n.day,parseInt(e),n.minute,n.second)}break;case Nd.Minute:if((i=n.minute)>9){if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.hour,parseInt(e),n.second)}else if(this.FJoinKey)(i=10*i+parseInt(e))>59&&(i=parseInt(e)),n=X.Create(n.year,n.month,n.day,n.hour,i,n.second);else{if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.minute,parseInt(e),n.second)}break;case Nd.Second:if((i=n.second)>9){if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.hour,n.minute,parseInt(e))}else if(this.FJoinKey)(i=10*i+parseInt(e))>59&&(i=parseInt(e)),n=X.Create(n.year,n.month,n.day,n.hour,n.minute,i);else{if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.hour,n.minute,parseInt(e))}}this.FActiveArea!=Nd.Year&&(this.FActiveArea=this.GetAreaAt(this.FAreaRect.left,this.FAreaRect.top),this.FActiveArea!=Nd.None&&(this.FAreaRect=this.GetAreaRect(this.FActiveArea)),this.FJoinKey=!0,this.SetDateTime(n)),this.OwnerData.Style.UpdateInfoRePaint()}}}},{key:"InsertText",value:function(t){return 1==t.length&&"0123456789".indexOf(t)>=0&&this.KeyPress(t.charCodeAt(0)),!1}},{key:"SetText",value:function(t){}},{key:"Assign",value:function(t){_d(Od(r.prototype),"Assign",this).call(this,t),this.FFormat=t.Format,this.FDateTime=X.CreateByDateTime(t.DateTime)}},{key:"SaveToStreamRange",value:function(t,e,i){_d(Od(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FFormat),t.writeDateTime(this.FDateTime)}},{key:"LoadFromStream",value:function(t,e,i){_d(Od(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FFormat=lp.HCLoadTextFromStream(t,i),this.FDateTime=t.readDateTime()}},{key:"ToXml",value:function(t){_d(Od(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){_d(Od(r.prototype),"ParseXml",this).call(this,t)}},{key:"Format",get:function(){return this.FFormat},set:function(t){this.SetFormat(t)}},{key:"DateTime",get:function(){return this.FDateTime},set:function(t){this.SetDateTime(t)}}])&&Rd(e.prototype,i),n&&Rd(e,n),r}($u);function Ed(t){return(Ed="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Md(t,e,i){return(Md="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ud(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Ld(t,e){return(Ld=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Gd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ud(t);if(e){var o=Ud(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Hd(this,i)}}function Hd(t,e){return!e||"object"!==Ed(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ud(t){return(Ud=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wd(t,e){for(var i=0;i0)){this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo);var t=this.FPaddingLeft,e=this.FPaddingTop,i=new H;if(0==this.FColumns){for(var n=0;nthis.Width&&(t=this.FPaddingLeft,e+=i.height+this.FPaddingBottom),this.FItems[n].Rect.resetBounds(t,e,this.RadioButtonWidth+i.width,i.height),t=t+this.RadioButtonWidth+i.width+this.FPaddingRight;this.AutoSize&&(this.Width=t),this.Height=e+i.height+this.FPaddingBottom}else{var o=0,r=1,s=this.FColumns;i.height=0,this.FColumns>this.FItems.count&&(s=this.FItems.count);for(var a=0;ao&&(o=t),a0){for(var l=0;l=0&&this.DoSetItemChecked(n,!this.FItems[n].Checked)}return e}},{key:"MouseMove",value:function(t){return lp.GCursor=oe,Md(Ud(i.prototype),"MouseMove",this).call(this,t)}},{key:"GetOffsetAt",value:function(t){return t<=this.FPaddingLeft?lp.OffsetBefor:t>=this.Width-this.FPaddingRight?lp.OffsetAfter:lp.OffsetInner}},{key:"GetText",value:function(){for(var t=Md(Ud(i.prototype),"GetText",this).call(this),e=0;e0&&this.FBatchCount--,0==this.FBatchCount&&this.ReLayout()}},{key:"AddItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Kd;n.Checked=i,n.Text=t,n.TextValue=e,this.FItems.add(n)}},{key:"SetAllChecked",value:function(t){for(var e=0;e0){r=this.FItems[0].Text,s=this.FItems[0].TextValue;for(var a=1;a39){this.FColumns=t.readByte();var o=t.readByte();this.FMultSelect=or.system.isOdd(o>>7),this.FItemHit=or.system.isOdd(o>>6),this.FColumnAlign=or.system.isOdd(o>>5),this.BoxRight=or.system.isOdd(o>>4)}this.FItems.clear();var r=lp.HCLoadTextFromStream(t,n);if(""!=r){for(var s=r.split(lp.sLineBreak),a=0;a35&&""!=(r=lp.HCLoadTextFromStream(t,n))){s=r.split(lp.sLineBreak);for(var l=0;l33&&(this.FRadioStyle=t.readByte())}finally{this.EndAdd()}}},{key:"ToXml",value:function(t){Md(Ud(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Md(Ud(i.prototype),"ParseXml",this).call(this,t)}},{key:"MultSelect",get:function(){return this.FMultSelect},set:function(t){this.FMultSelect=t}},{key:"RadioStyle",get:function(){return this.FRadioStyle},set:function(t){this.FRadioStyle=t}},{key:"ItemHit",get:function(){return this.FItemHit},set:function(t){this.FItemHit=t}},{key:"Columns",get:function(){return this.FColumns},set:function(t){this.SetColumns(t)}},{key:"ColumnAlign",get:function(){return this.FColumnAlign},set:function(t){this.SetColumnAlign(t)}},{key:"Items",get:function(){return this.FItems}}]),i}(Ja);function Jd(t){return(Jd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zd(t,e){for(var i=0;ir?o+4*this.FPadding:r+4*this.FPadding,this.Height=2*n+4*this.FPadding,this.FSupRect.resetBounds(this.FPadding,this.FPadding,o,n),this.FSubRect.resetBounds(this.FPadding,this.Height-this.FPadding-n,r,n)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),!a.Print){var l=new U;this.FActiveArea!=up.None&&(this.FActiveArea==up.Top?l.resetRect(this.FSupRect):this.FActiveArea==up.Bottom&&l.resetRect(this.FSubRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)),this.FMouseMoveArea!=up.None&&this.FMouseMoveArea!=this.FActiveArea&&(this.FMouseMoveArea==up.Top?l.resetRect(this.FSupRect):this.FMouseMoveArea==up.Bottom&&l.resetRect(this.FSubRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=lp.clMedGray,s.rectangleRect(l))}this.ApplySupSubStyle(t.TextStyles[this.TextStyleNo],s,a.ScaleY/a.Zoom),s.textOut(e.left+this.FSupRect.left,e.top+this.FSupRect.top,this.FSupText),s.textOut(e.left+this.FSubRect.left,e.top+this.FSubRect.top,this.FSubText)}},{key:"GetOffsetAt",value:function(t){return this.FOutSelectInto?qd(em(r.prototype),"GetOffsetAt",this).call(this,t):t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"SetActive",value:function(t){qd(em(r.prototype),"SetActive",this).call(this,t),t||(this.FActiveArea=up.None)}},{key:"MouseLeave",value:function(){qd(em(r.prototype),"MouseLeave",this).call(this),this.FMouseMoveArea=up.None}},{key:"MouseDown",value:function(t){var e=qd(em(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=0;this.FActiveArea==up.Top?(i=this.FSupText,n=t.x-this.FSupRect.left):this.FActiveArea==up.Bottom&&(i=this.FSubText,n=t.x-this.FSubRect.left);var o=0;return this.FActiveArea!=up.None?(this.ApplySupSubStyle(this.OwnerData.Style.TextStyles[this.TextStyleNo],this.OwnerData.Style.TempCanvas),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)):o=-1,o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){if(this.FMouseLBDowning||t.button!=ee||or.keyDownStates[Re]||(this.FOutSelectInto=!0),this.FOutSelectInto)this.FMouseMoveArea=up.None;else{var e=this.GetExpressArea(t.x,t.y);e!=this.FMouseMoveArea&&(this.FMouseMoveArea=e,this.OwnerData.Style.UpdateInfoRePaint())}return qd(em(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FMouseLBDowning=!1,this.FOutSelectInto=!1,qd(em(r.prototype),"MouseUp",this).call(this,t)}},{key:"KeyDown",value:function(t){switch(t.keyCode){case Pe:this.FActiveArea==up.Top?this.FCaretOffset>0&&(this.FSupText=C.stringDelete(this.FSupText,this.FCaretOffset-1,1),this.FCaretOffset--):this.FActiveArea==up.Bottom&&this.FCaretOffset>0&&(this.FSubText=C.stringDelete(this.FSubText,this.FCaretOffset-1,1),this.FCaretOffset--),this.FormatDirty();break;case Be:this.FCaretOffset>0&&this.FCaretOffset--;break;case Me:var e="";this.FActiveArea==up.Top?e=this.FSupText:this.FActiveArea==up.Bottom&&(e=this.FSubText),this.FCaretOffset28&&(this.FPageIndex=t.readInt32()),this.FLock=i>37&&t.readBoolean()}},{key:"ToXml",value:function(t){t.SetAttribute("sno",this.StyleNo.toString()),t.SetAttribute("left",this.FLeft.toString()),t.SetAttribute("top",this.FTop.toString()),t.SetAttribute("width",this.Width.toString()),t.SetAttribute("height",this.Height.toString()),t.SetAttribute("pageindex",this.FPageIndex.toString()),this.FLock&&t.SetAttribute("lock",this.FLock.toString())}},{key:"ParseXml",value:function(t){}},{key:"DrawRect",get:function(){return this.FDrawRect},set:function(t){this.FDrawRect=t}},{key:"Left",get:function(){return this.FLeft},set:function(t){this.FLeft=t}},{key:"Top",get:function(){return this.FTop},set:function(t){this.FTop=t}},{key:"PageIndex",get:function(){return this.FPageIndex},set:function(t){this.FPageIndex=t}},{key:"Lock",get:function(){return this.FLock},set:function(t){this.FLock=t}}]),i}(rl),xm=function(t){km(i,t);var e=Dm(i);function i(){var t;return Im(this,i),(t=e.call(this)).OnInsertItem=null,t.OnRemoveItem=null,t}return wm(i,[{key:"doAdded_",value:function(t){Cm(Rm(i.prototype),"doAdded_",this).call(this,t),null!=this.OnInsertItem&&this.OnInsertItem(t)}},{key:"doRemoved_",value:function(t){Cm(Rm(i.prototype),"doRemoved_",this).call(this,t),null!=this.OnRemoveItem&&this.OnRemoveItem(t)}}]),i}(V);function Am(t){return(Am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tm(t,e){for(var i=0;i26)this.FShapeLine.LoadFromStream(t);else{this.FShapeLine.Width=1,this.FShapeLine.Color=at.Black;var n=t.readInt32(),o=t.readInt32();this.FShapeLine.StartPt.reset(n,o),n=t.readInt32(),o=t.readInt32(),this.FShapeLine.EndPt.reset(n,o)}}},{key:"ToXml",value:function(t){Om(Mm(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Om(Mm(r.prototype),"ParseXml",this).call(this,t)}}])&&Tm(e.prototype,i),n&&Tm(e,n),r}(_m);function Gm(t){return(Gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hm(t,e){for(var i=0;i34&&(this.FAutoSize=t.readBoolean(),this.FCode128.TextVisible=t.readBoolean(),this.FCode128.Zoom=t.readByte())}},{key:"ToXml",value:function(t){Um(jm(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Um(jm(r.prototype),"ParseXml",this).call(this,t)}},{key:"PenWidth",get:function(){return this.GetPenWidth()},set:function(t){this.SetPenWidth(t)}},{key:"AutoSize",get:function(){return this.FAutoSize},set:function(t){this.FAutoSize=t}},{key:"ShowText",get:function(){return this.GetShowText()},set:function(t){this.SetShowText(t)}}])&&Hm(e.prototype,i),n&&Hm(e,n),r}(_m);function Km(t){return(Km="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ym(t,e){for(var i=0;i=0&&t<=this.Width?this.MarkType===Pp.Beg?lp.OffsetAfter:lp.OffsetBefor:iy(sy(i.prototype),"GetOffsetAt",this).call(this,t)}},{key:"JustifySplit",value:function(){return!1}},{key:"FormatToDrawItem",value:function(t,e){if(this.Width=0,this.Height=t.Style.TextStyles[0].FontHeight-t.Style.LineSpaceMin,this.MarkType===Pp.Beg)if(e0)for(var r=null,s=0;sthis.FSelectSeekNo&&tthis.FSelectSeekOffset||t==this.SelectInfo.EndItemNo&&ethis.SelectInfo.EndItemNo||t==this.SelectInfo.EndItemNo&&e>this.SelectInfo.EndItemOffset?(o=this.SelectInfo.EndItemNo,r=this.SelectInfo.EndItemOffset,o=(i=this.AdjustSelectRange(o,r,t,e)).startItemNo,r=i.startItemOffset,t=i.endItemNo,e=i.endItemOffset):n=!1:t>this.FSelectSeekNo||t==this.FSelectSeekNo&&e>this.FSelectSeekOffset||t>this.SelectInfo.StartItemNo&&tthis.SelectInfo.StartItemOffset?(o=this.SelectInfo.StartItemNo,r=this.SelectInfo.StartItemOffset,o=(i=this.AdjustSelectRange(o,r,t,e)).startItemNo,r=i.startItemOffset,t=i.endItemNo,e=i.endItemOffset):t=0&&(tthis.SelectInfo.StartItemNo||t==this.SelectInfo.StartItemNo&&e>this.SelectInfo.StartItemOffset?(o=this.SelectInfo.StartItemNo,r=this.SelectInfo.StartItemOffset,o=(i=this.AdjustSelectRange(o,r,t,e)).startItemNo,r=i.startItemOffset,t=i.endItemNo,e=i.endItemOffset):n=!1),{itemNo:t,offset:e,result:n}}},{key:"SetEmptyData",value:function(){if(0==this.Items.count){var t=this.CreateDefaultTextItem();t.ParaFirst=!0,this.Items.add(t),this.ReFormat()}}},{key:"EmptyDataInsertItem",value:function(t){return!(t.StyleNo>cs.Null&&""==t.Text||(t.ParaNo=this.Items[0].ParaNo,this.UndoAction_DeleteItem(0,0),this.Items.clear(),this.DrawItems.clear(),t.ParaFirst=!0,this.Items.add(t),this.UndoAction_InsertItem(0,0),this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(0),this.ReFormat(),0))}},{key:"SelectPerfect",value:function(){if(this.SelectInfo.EndItemNo>=0)for(var t=this.SelectInfo.StartItemNo;t<=this.SelectInfo.EndItemNo;t++)if(this.Items[t].StyleNo0&&e==this.GetItemOffsetAfter(t)&&t=0&&this.Items[i].Length>0&&0==n&&!this.Items[i].ParaFirst&&(this.Items[i].DisSelect(),i-=1,n=this.GetItemOffsetAfter(i))):i0&&0==e&&!this.Items[t].ParaFirst&&(t-=1,e=this.GetItemOffsetAfter(t)),t!=i&&n==this.GetItemOffsetAfter(i)&&(this.Items[i].DisSelect(),ie?this.Items[t].StyleNo=0&&this.Items[this.SelectInfo.EndItemNo].DisSelect(),this.SelectInfo.StartItemNo>=0&&(0!=e&&e!=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)||this.Items[this.SelectInfo.StartItemNo].DisSelect()),this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1):o?(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.EndItemNo=i,this.SelectInfo.EndItemOffset=n):(this.SelectInfo.StartItemNo=i,this.SelectInfo.StartItemOffset=n,this.SelectInfo.EndItemNo=t,this.SelectInfo.EndItemOffset=e),r>=0)if(r>this.SelectInfo.StartItemNo)for(var a=r;a>=this.SelectInfo.StartItemNo+1;a--)this.Items[a].DisSelect();else for(var l=r;l<=this.SelectInfo.StartItemNo-1;l++)this.Items[l].DisSelect();if(this.SelectInfo.EndItemNo<0)for(var h=s;h>=this.SelectInfo.StartItemNo+1;h--)this.Items[h].DisSelect();else for(var c=s;c>=this.SelectInfo.EndItemNo+1;c--)this.Items[c].DisSelect();return{startItemNo:t,startItemOffset:e,endItemNo:i,endItemOffset:n}}},{key:"DoLoadFromStream",value:function(t,e,i){if(this.FReadOnly=!1,this.CanEdit()){my(vy(r.prototype),"DoLoadFromStream",this).call(this,t,e,i),this.BeginFormat();try{this.FCheckEmptyItem=!1,this.InsertStream(t,e,i),i>48||i>47&&(t.readBoolean(),this.FReadOnly=!1),this.FCheckEmptyItem&&this.DeleteEmptyItem(),this.ReSetSelectAndCaretByOffset(0,0)}finally{this.EndFormat()}}}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];my(vy(r.prototype),"ReSetSelectAndCaretByOffset",this).call(this,t,e,i),this.FSelectSeekNo=this.SelectInfo.StartItemNo,this.FSelectSeekOffset=this.SelectInfo.StartItemOffset}},{key:"DoAcceptAction",value:function(t,e,i){var n=this.Items[t].AcceptAction(e,this.SelectInfo.StartRestrain,i);return n&&null!=this.OnAcceptAction&&(n=this.OnAcceptAction(this,t,e,i)),n}},{key:"DoDrawItemMouseMove",value:function(t,e,i,n,o){null!=this.OnDrawItemMouseMove&&this.OnDrawItemMouseMove(t,e,i,n,o)}},{key:"CheckInsertItemCount",value:function(t,e){return e-t+1}},{key:"DoItemMouseLeave",value:function(t){this.Items[t].MouseLeave()}},{key:"DoItemMouseEnter",value:function(t){this.Items[t].MouseEnter()}},{key:"DoItemResized",value:function(t){this.Change(),null!=this.OnItemResized&&this.OnItemResized(this,t)}},{key:"GetHeight",value:function(){return this.CalcContentHeight()}},{key:"SetReadOnly",value:function(t){this.FReadOnly=t}},{key:"CreateItemByStyle",value:function(t){var e=null;if(tcs.Null&&t0){var r=this.Items[t-1].Length;this.MergeItemToPrio(t)&&(this.UndoAction_InsertText(t-1,this.Items[t-1].Length-this.Items[t].Length+1,this.Items[t].Text),this.UndoAction_DeleteItem(t,0),this.Items.delete(t),e--,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=r,this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=r+this.SelectInfo.EndItemOffset)}}else{var s=n.Text,a=s.substr(this.SelectInfo.StartItemOffset+1-1,this.SelectInfo.EndItemOffset-this.SelectInfo.StartItemOffset),l=s.substr(0,this.SelectInfo.StartItemOffset),h=this.Items[t].BreakByOffset(this.SelectInfo.EndItemOffset);if(null!=h){this.UndoAction_DeleteText(t,this.SelectInfo.EndItemOffset+1,h.Text),this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(t+1,h)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(t+1,0),e++}if(""!=l){this.UndoAction_DeleteText(t,this.SelectInfo.StartItemOffset+1,a),n.Text=l;var c=this.CreateDefaultTextItem();if(c.ParaNo=n.ParaNo,c.StyleNo=o,c.Text=a,null!=h)this.Items.insert(t+1,c),this.UndoAction_InsertItem(t+1,0),e++;else{if(tcs.Null&&(t.Append=!t.StyleHasMatch(this.Style,this.CurStyleNo),this.CurStyleNo=t.GetMatchStyleNo(this.Style,this.CurStyleNo),this.Style.UpdateInfoRePaint(),0==this.Items[this.SelectInfo.StartItemNo].Length?(n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o),this.UndoAction_ItemStyle(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.CurStyleNo),this.Items[this.SelectInfo.StartItemNo].StyleNo=this.CurStyleNo,this.ReFormatData(n,o),this.Style.UpdateInfoReCaret()):(this.Items[this.SelectInfo.StartItemNo].isClass(Ya)&&(n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o),this.Items[this.SelectInfo.StartItemNo].TextStyleNo=this.CurStyleNo,this.ReFormatData(n,o)),this.Style.UpdateInfoReCaret(!1))),void this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);if(this.SelectInfo.EndItemNo<0)this.Items[this.SelectInfo.StartItemNo].StyleNocs.Null){t.Append=!t.StyleHasMatch(this.Style,this.Items[r].StyleNo);break}if(this.Items[r].MatchTextStyle(this.Style,t))break}if(this.SelectInfo.StartItemNo===this.SelectInfo.EndItemNo)i=this.ApplySameItem(this.SelectInfo.StartItemNo,i,t);else{i=this.ApplyRangeEndItem(this.SelectInfo.EndItemNo,i,t);for(var s=this.SelectInfo.EndItemNo-1;s>=this.SelectInfo.StartItemNo+1;s--)this.ApplyRangeNorItem(s,t);i=this.ApplyRangeStartItem(this.SelectInfo.StartItemNo,i,t),this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo+1;l--)a=this.Items[l-1].Length,this.MergeItemToPrio(l)&&(this.UndoAction_InsertText(l-1,this.Items[l-1].Length-this.Items[l].Length+1,this.Items[l].Text),this.UndoAction_DeleteItem(l,0),this.Items.delete(l),i--,l==this.SelectInfo.EndItemNo&&(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset+a),this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo-1);this.SelectInfo.StartItemNo>0&&!this.Items[this.SelectInfo.StartItemNo].ParaFirst&&(a=this.Items[this.SelectInfo.StartItemNo-1].Length,this.MergeItemToPrio(this.SelectInfo.StartItemNo)&&(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,this.Items[this.SelectInfo.StartItemNo-1].Length-this.Items[this.SelectInfo.StartItemNo].Length+1,this.Items[this.SelectInfo.StartItemNo].Text),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),i--,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=a,this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo-1,this.SelectInfo.StartItemNo==this.SelectInfo.EndItemNo&&(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset+a)))}this.ReFormatData(n,o+i,i)}this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}},{key:"DoApplyParagraphStyle",value:function(t,e,i){var n,o,r;e.isClass(xl)?(n=e.Indent,r=this.Style.ParaStyles[this.GetItemParaStyle(t)],o=sr.pixXToMillimeter(this.Width)-r.LeftIndent-r.RightIndent-sr.pixXToMillimeter(lp.TabCharWidth),r.FirstIndent+i>o?e.Indent=o:e.Indent=r.FirstIndent+i):e.isClass(Al)?(n=e.Indent,r=this.Style.ParaStyles[this.GetItemParaStyle(t)],o=sr.pixXToMillimeter(this.Width)-r.FirstIndent-r.RightIndent-sr.pixXToMillimeter(lp.TabCharWidth),r.LeftIndent>0&&r.LeftIndent+i<0||r.LeftIndent<0&&r.LeftIndent+i>0?e.Indent=0:r.LeftIndent+i>o?e.Indent=o:e.Indent=r.LeftIndent+i):e.isClass(Tl)&&(n=e.Indent,r=this.Style.ParaStyles[this.GetItemParaStyle(t)],o=sr.pixXToMillimeter(this.Width)-r.FirstIndent-r.LeftIndent-sr.pixXToMillimeter(lp.TabCharWidth),r.RightIndent+i>o?e.Indent=o:e.Indent=r.RightIndent+i);var s=e.GetMatchParaNo(this.Style,this.GetItemParaStyle(t));if(this.Items[t].ParaNo!=s){var a=-1,l=-1,h=this.GetParaItemRang(t,a,l);a=h.a,l=h.b,this.UndoAction_ItemParaNo(a,0,s);for(var c=a;c<=l;c++)this.Items[c].ParaNo=s}(e.isClass(xl)||e.isClass(Al)||e.isClass(Tl))&&(e.Indent=n)}},{key:"ApplyParagraphSelecteStyle",value:function(t,e){var i=-1,n=-1,o=this.GetParaItemRang(this.SelectInfo.StartItemNo,i,n);i=o.a,n=o.b,this.DoApplyParagraphStyle(this.SelectInfo.StartItemNo,t,e);for(var r=n+1;r<=this.SelectInfo.EndItemNo;)this.Items[r].ParaFirst&&this.DoApplyParagraphStyle(r,t,e),r++}},{key:"ApplySelectParaStyle",value:function(t){if(!(this.SelectInfo.StartItemNo<0)){var e=0;t.isClass(xl)?e=t.Indent-this.Style.ParaStyles[this.GetItemParaStyle(this.SelectInfo.StartItemNo)].FirstIndent:t.isClass(Al)?e=t.Indent-this.Style.ParaStyles[this.GetItemParaStyle(this.SelectInfo.StartItemNo)].LeftIndent:t.isClass(Tl)&&(e=t.Indent-this.Style.ParaStyles[this.GetItemParaStyle(this.SelectInfo.StartItemNo)].RightIndent);var i=-1,n=-1;this.Undo_New(),this.SelectInfo.EndItemNo>=0?(i=this.Items[this.GetParaFirstItemNo(this.SelectInfo.StartItemNo)].FirstDItemNo,n=this.GetParaLastItemNo(this.SelectInfo.EndItemNo),this.FormatPrepare(i,n),this.ApplyParagraphSelecteStyle(t,e),this.ReFormatData(i,n)):this.GetItemStyle(this.SelectInfo.StartItemNo)=0?this.FCurParaNo=this.Items[this.FSelectSeekNo].ParaNo:this.FCurParaNo=this.Items[this.SelectInfo.StartItemNo].ParaNo,this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}}},{key:"ApplyTableCellAlign",value:function(t){this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.ApplyContentAlign(t),!0}))}},{key:"ParaFirstItemAddBullet_",value:function(t,e,i,n,o,r,s){if(this.Items[t].StyleNo>cs.Null&&""==this.Items[t].Text){this.UndoAction_DeleteItem(t,0),this.Items.removeAt(t);var a=new vm(this);a.BulletStyle=e,a.Prefix=n,a.Suffix=o,e==Cp.Symbol?a.Text=n+i+o:a.SetOrderNumber(s),a.ParaFirst=!0,this.Items.insert(t,a),this.UndoAction_InsertItem(t,0)}else if(za.IsBeginMark(this.Items[t])){var l=new vm(this);l.BulletStyle=e,l.Prefix=n,l.Suffix=o,e==Cp.Symbol?l.Text=n+i+o:l.SetOrderNumber(s),this.Items.insert(t+1,l),this.UndoAction_InsertItem(t+1,0),r++}else{this.UndoAction_ItemParaFirst(t,0,!1),this.Items[t].ParaFirst=!1;var h=new vm(this);h.BulletStyle=e,h.Prefix=n,h.Suffix=o,e==Cp.Symbol?h.Text=n+i+o:h.SetOrderNumber(s),h.ParaFirst=!0,this.Items.insert(t,h),this.UndoAction_InsertItem(t,0),r++}return e!=Cp.Symbol&&s--,{incCount:r,order:s}}},{key:"ApplyBullet",value:function(t,e,i,n){if(!(this.SelectInfo.StartItemNo<0)){var o=this.SelectInfo.StartItemNo,r=this.SelectInfo.EndItemNo,s=0;this.InitializeField(),t!=Cp.Symbol&&(s=parseInt(e));var a=0,l=-1,h=-1,c=-1;if(this.Undo_New(),r>=0){l=this.GetParaFirstItemNo(o),h=this.Items[l].FirstDItemNo,c=this.GetParaLastItemNo(r),this.FormatPrepare(h,c);for(var u=l+1;u<=r;u++)this.Items[u].ParaFirst&&s++;for(var f,d=r;d>=l;d--)this.Items[d].ParaFirst&&(a=(f=this.ParaFirstItemAddBullet_(d,t,e,i,n,a,s)).incCount,s=f.order);l<=o&&(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1),this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo+a}else o>=0&&(l=this.GetParaFirstItemNo(o),h=this.Items[l].FirstDItemNo,c=this.GetParaLastItemNo(o),this.FormatPrepare(h,c),this.ParaFirstItemAddBullet_(l,t,e,i,n,a,s));this.ReFormatData(h,c+a,a),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}}},{key:"DisSelect",value:function(){var t=my(vy(r.prototype),"DisSelect",this).call(this);return t&&(this.FDraging=!1,this.FSelecting=!1,this.Style.UpdateInfoRePaint()),this.Style.UpdateInfoReCaret(),t}},{key:"DeleteItemSelectComplate",value:function(t,e,i,n,o){if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.DeleteItem))return{delCount:t,result:!1};if(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),t++,this.SelectInfo.StartItemNo>n&&this.SelectInfo.StartItemNo0){var a=this.Items[this.SelectInfo.StartItemNo-1].Length;this.MergeItemText(this.Items[this.SelectInfo.StartItemNo-1],this.Items[this.SelectInfo.StartItemNo])&&(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,a+1,this.Items[this.SelectInfo.StartItemNo].Text),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),t++,this.SelectInfo.StartItemOffset=a),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)}return{delCount:t,result:!1}}},{key:"DeleteSelected",value:function(){if(!this.CanEdit())return!1;if(!this.SelectPerfect())return this.DisSelect(),!1;if(!this.SelectExists())return!0;if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.DeleteSelected))return!1;var t=this.IsSelectSeekStart(),e=0;this.InitializeField();var i,n=-1,o=-1,s=-1,a=-1,l=-1,h=-1;if(this.SelectInfo.EndItemNo<0&&this.Items[this.SelectInfo.StartItemNo].StyleNo0?this.SelectInfo.StartItemNo:this.DrawItems[n].ItemNo,this.Undo_New(),this.Items[this.SelectInfo.StartItemNo].IsSelectComplateTheory()){var c=this.GetParaItemRang(this.SelectInfo.StartItemNo,a,l);a=c.a,l=c.b;var u=this.DeleteItemSelectComplate(e,a,l,o,s);e=u.delCount,u.result}else this.Items[this.SelectInfo.StartItemNo].MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),this.Items[this.SelectInfo.StartItemNo].DeleteSelected();this.ReFormatData(n,s-e,-e)}else{var f=this.Items[this.SelectInfo.EndItemNo];if(this.SelectInfo.EndItemNo==this.SelectInfo.StartItemNo){if(this.Undo_New(),n=(i=this.GetFormatRange(n,s)).firstDrawItemNo,s=i.lastItemNo,this.FormatPrepare(n,s),o=this.FormatCount>0?this.SelectInfo.StartItemNo:this.DrawItems[n].ItemNo,f.IsSelectComplate){var d=this.GetParaItemRang(this.SelectInfo.StartItemNo,a,l);a=d.a,l=d.b;var m=this.DeleteItemSelectComplate(e,a,l,o,s);e=m.delCount,m.result}else if(f.StyleNo=this.SelectInfo.StartItemNo+1;w--)this.DoAcceptAction(w,0,wp.DeleteItem)?(this.UndoAction_DeleteItem(w,0),this.Items.delete(w),e++,h--):h=w;var k=this.Items[this.SelectInfo.StartItemNo];if(k.StyleNo0?this.FormatPrepare(h,c):(h=0,c=-1);var d=0,m=0;this.Undo_New();for(var y=cs.Null,p=null,S=0;S<=f-1;S++)if(y=t.readInt32(),(p=this.CreateItemByStyle(y)).LoadFromStream(t,e,i),null!=e?(p.StyleNo>cs.Null&&(p.StyleNo=this.Style.GetStyleNo(e.TextStyles[p.StyleNo],!0)),this.Style.States.Contain(Ip.Pasting)?p.ParaNo=u:p.ParaNo=this.Style.GetParaNo(e.ParaStyles[p.ParaNo],!0)):(p.StyleNo>cs.Null&&(this.CurStyleNocs.Null&&""==p.Text&&!p.ParaFirst)m++,p.dispose(),p=null;else{if(0==S)s?(p.ParaFirst=this.Items[l].ParaFirst,this.Items[l].ParaFirst&&(this.UndoAction_ItemParaFirst(l,0,!1),this.Items[l].ParaFirst=!1)):p.ParaFirst=!1;else if(!this.Loading&&!p.ParaFirst&&this.MergeItemText(this.Items[l+S-1-m],p)){m++,p.dispose(),p=null;continue}!this.FCheckEmptyItem&&S>0&&!p.ParaFirst&&(p.StyleNo>cs.Null&&0==p.Length&&(this.FCheckEmptyItem=!0),this.Items[l+S-m-1].StyleNo>cs.Null&&0==this.Items[l+S-m-1].Length&&(this.FCheckEmptyItem=!0)),this.Items.insert(l+S-m,p),this.UndoAction_InsertItem(l+S-m,0),d++}var v=l+(f=this.CheckInsertItemCount(l,l+d-1))-1,F=this.GetItemOffsetAfter(v);if(null!=r)if(this.MergeItemText(this.Items[v],r))this.UndoAction_InsertText(v,this.Items[v].Length-r.Length+1,r.Text),r.dispose(),r=null;else{this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(v+1,r)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(v+1,0),f++}if(l>0){if(a)this.UndoAction_ItemParaFirst(l,0,this.Items[l-1].ParaFirst),this.Items[l].ParaFirst=this.Items[l-1].ParaFirst,this.Items[l-1].PageBreak&&(this.UndoAction_ItemPageBreak(l,0,!0),this.Items[l].PageBreak=!0),this.UndoAction_DeleteItem(l-1,0),this.Items.delete(l-1),f--,v--;else{var I=this.Items[l-1].Length;!this.Items[l].ParaFirst&&this.MergeItemText(this.Items[l-1],this.Items[l])?(this.UndoAction_InsertText(l-1,this.Items[l-1].Length-this.Items[l].Length+1,this.Items[l].Text),this.UndoAction_DeleteItem(l,0),this.Items.delete(l),1==f&&(F=I+F),f--,v--):this.Items[l].StyleNo>cs.Null&&0==this.Items[l].Length&&(this.UndoAction_DeleteItem(l,0),this.Items.delete(l),f--,v--)}vthis.Style.ParaStyles.count-1&&(t.ParaNo=this.CurParaNo),!t.ParaFirst){if(this.IsEmptyData())return this.Undo_New(),i=this.EmptyDataInsertItem(t),this.CurParaNo=t.ParaNo,i;t.ParaNo=this.CurParaNo}var n=-1,o=-1,r=this.GetActiveItemNo();if(this.Items[r].StyleNo2&&void 0!==arguments[2])||arguments[2];if(!this.CanEdit())return!1;if(!this.DeleteSelected())return!1;if(e.ParaNo>this.Style.ParaStyles.count-1&&(e.ParaNo=this.CurParaNo),!e.ParaFirst){if(this.IsEmptyData()){this.Undo_New();var o=this.EmptyDataInsertItem(e);return this.CurParaNo=e.ParaNo,o}e.ParaNo=this.CurParaNo}var r=0,s=-1,a=-1;if(this.Undo_New(),e.StyleNo0&&this.Items[t-1].StyleNo>cs.Null&&""==this.Items[t-1].Text?(s=(i=this.GetFormatRangeByOffset(t-1,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst=!0,e.PageBreak=this.Items[t-1].PageBreak,this.UndoAction_DeleteItem(t-1,0),this.Items.delete(t-1),r--,l--):(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemLastDrawItemNo(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a)):(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemLastDrawItemNo(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),!e.ParaFirst&&this.Items[t-1].StyleNo>cs.Null&&""==this.Items[t-1].Text&&(e.ParaFirst=!0,e.PageBreak=this.Items[t-1].PageBreak,this.UndoAction_DeleteItem(t-1,0),this.Items.delete(t-1),r--,l--)),this.Items.insert(l,e),this.UndoAction_InsertItem(l,lp.OffsetAfter),r++,this.ReFormatData(s,a+r,r),this.ReSetSelectAndCaret(l)}else{var h=!1;e.ParaFirst||(n?t0&&this.Items[t-1].CanConcatItems(e)&&(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemOffsetAfter(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_InsertText(t-1,this.Items[t-1].Length+1,e.Text),this.Items[t-1].Text=this.Items[t-1].Text+e.Text,this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t-1),h=!0):this.IsEmptyLine(t-1)?(s=(i=this.GetFormatRangeByOffset(t-1,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst=!0,this.Items.insert(t,e),this.UndoAction_InsertItem(t,0),this.UndoAction_DeleteItem(t-1,0),this.Items.delete(t-1),this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t-1),h=!0):this.Items[t-1].CanConcatItems(e)?(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemOffsetAfter(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_InsertText(t-1,this.Items[t-1].Length+1,e.Text),this.Items[t-1].Text=this.Items[t-1].Text+e.Text,this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t-1),h=!0):t=0){this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{this.DeleteItems(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemNo,!0),this.InsertText(t)}finally{this.Undo_GroupEnd(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}return}if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.SetItemText))return;this.Undo_New(),this.UndoAction_SetItemText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,t),this.Items[this.SelectInfo.StartItemNo].Text=t,n=(i=this.GetFormatRange(n,o)).firstDrawItemNo,o=i.lastItemNo,this.FormatPrepare(n,o),this.ReFormatData(n,o),this.SelectInfo.StartItemOffset=t.length,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1,this.Items[this.SelectInfo.StartItemNo].DisSelect(),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}}}},{key:"KillFocus",value:function(){var t=this.GetActiveItemNo();t>0&&this.Items[t].KillFocus()}},{key:"DoItemMouseDown",value:function(t,e,i){if(!(t<0)){var n=this.CoordToItemOffset(i.x,i.y,t,e,-1,-1),o=new ei;o.assign(i),o.x=n.x,o.y=n.y,this.Items[t].MouseDown(o),null!=this.OnItemMouseDown&&this.OnItemMouseDown(this,t,e,o)}}},{key:"MouseDown",value:function(t){this.FSelecting=!1,this.FDraging=!1,this.FMouseLBDouble=!1,this.FMouseDownReCaret=!1,this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FMouseDownX=t.x,this.FMouseDownY=t.y;var e=-1,i=-1,n=-1,o=!1,r=this.GetItemAt(t.x,t.y,e,i,n,o);if(e=r.itemNo,i=r.offset,n=r.drawItemNo,o=r.restrain,this.FSelectSeekNo=e,this.FSelectSeekOffset=i,t.button==ee&&or.keyDownStates[Re])if(this.FMouseDownItemNo=e,this.FMouseDownItemOffset=i,!o&&this.Items[this.FMouseDownItemNo].StyleNo3&&void 0!==arguments[3]&&arguments[3];if(!(t<0)){var o=this.CoordToDrawItem(i.x,i.y,this.FMouseMoveDrawItemNo,-1,-1),r=new ei;r.assign(i),r.x=o.x,r.y=o.y,n&&this.DoDrawItemMouseMove(this,t,e,this.FMouseMoveDrawItemNo,r),this.Items[t].MouseMove(r)}}},{key:"MouseMove",value:function(t){if(this.SelectedResizing())return this.FMouseMoveItemNo=this.FMouseDownItemNo,this.FMouseMoveItemOffset=this.FMouseDownItemOffset,this.FMouseMoveDrawItemNo=this.GetDrawItemNoByOffset(this.FMouseMoveItemNo,this.FMouseMoveItemOffset),this.FMouseMoveRestrain=!1,this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t),void this.Style.UpdateInfoRePaint();var e=-1,i=-1,n=!1,o=this.GetItemAt(t.x,t.y,e,i,this.FMouseMoveDrawItemNo,n);if(e=o.itemNo,i=o.offset,this.FMouseMoveDrawItemNo=o.drawItemNo,n=o.restrain,this.FDraging||this.Style.UpdateInfo.DragingSelected)lp.GCursor=ae,this.FMouseMoveItemNo=e,this.FMouseMoveItemOffset=i,this.SelectInfo.StartItemNo=e,this.SelectInfo.StartItemOffset=i,this.FMouseMoveRestrain=n,this.CaretDrawItemNo=this.FMouseMoveDrawItemNo,this.Style.UpdateInfoReCaret(),!n&&this.Items[this.FMouseMoveItemNo].StyleNo=0&&this.DoItemMouseLeave(this.FMouseMoveItemNo),e>=0&&!n&&this.DoItemMouseEnter(e),this.Style.UpdateInfoRePaint()):n!=this.FMouseMoveRestrain&&(!this.FMouseMoveRestrain&&n?this.FMouseMoveItemNo>=0&&this.DoItemMouseLeave(this.FMouseMoveItemNo):this.FMouseMoveRestrain&&!n&&e>=0&&this.DoItemMouseEnter(e),this.Style.UpdateInfoRePaint()),this.FMouseMoveItemNo=e,this.FMouseMoveItemOffset=i,this.FMouseMoveRestrain=n,n||(this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t,!0),or.keyDownStates[_e]&&""!=this.Items[this.FMouseMoveItemNo].HyperLink&&(lp.GCursor=le))):(this.FSelecting=!0,this.Style.UpdateInfo.Selecting=!0)}},{key:"DoItemMouseUp",value:function(t,e,i,n){if(!(t<0)){var o=this.CoordToItemOffset(n.x,n.y,t,e,-1,-1),r=new ei;r.assign(n),r.x=o.x,r.y=o.y,this.Items[t].MouseUp(r),i||null==this.OnItemMouseUp||this.OnItemMouseUp(this,t,e,r)}}},{key:"DoNormalMouseUp",value:function(t,e,i,n,o){this.FMouseMoveItemNo<0?(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.StartRestrain=n,this.CaretDrawItemNo=i):(this.SelectInfo.StartItemNo=this.FMouseMoveItemNo,this.SelectInfo.StartItemOffset=this.FMouseMoveItemOffset,this.SelectInfo.StartRestrain=n,this.CaretDrawItemNo=this.FMouseMoveDrawItemNo),this.Style.UpdateInfoRePaint(),this.FMouseDownReCaret||this.Style.UpdateInfoReCaret(),this.DoItemMouseUp(t,e,n,o)}},{key:"MouseUp",value:function(t){if(this.FMouseLBDowning=!1,!(this.FMouseLBDouble||t.button==ee&&or.keyDownStates[Re])){var e=!1;if(this.SelectedResizing()){this.Undo_New(),this.UndoAction_ItemSelf(this.FMouseDownItemNo,this.FMouseDownItemOffset),this.DoItemMouseUp(this.FMouseDownItemNo,this.FMouseDownItemOffset,e,t),this.DoItemResized(this.FMouseDownItemNo);var i=-1,n=-1,o=this.GetFormatRangeByOffset(this.FMouseDownItemNo,this.FMouseDownItemOffset,i,n);return i=o.firstDrawItemNo,n=o.lastItemNo,this.FormatPrepare(i,n),this.ReFormatData(i,n),void this.Style.UpdateInfoRePaint()}var r=-1,s=-1,a=-1,l=this.GetItemAt(t.x,t.y,r,s,a,e);if(r=l.itemNo,s=l.offset,a=l.drawItemNo,e=l.restrain,this.FSelecting||this.Style.UpdateInfo.Selecting){if(this.FSelecting=!1,this.SelectInfo.StartItemNo>=0)for(var h=this.SelectInfo.StartItemNo;h<=this.SelectInfo.EndItemNo;h++)h!=r&&this.Items[h].StyleNo=0&&this.Items[this.FMouseDownItemNo].StyleNo=0)for(var c=this.SelectInfo.StartItemNo;c<=this.SelectInfo.EndItemNo;c++)this.Items[c].DisSelect();this.FMouseMoveItemNo=r,this.FMouseMoveItemOffset=s,this.FMouseMoveDrawItemNo=a,this.FMouseDownItemNo=r,this.FMouseDownItemOffset=s,this.DoNormalMouseUp(r,s,a,e,t),this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else this.SelectExists(!1)&&this.DisSelect(),this.DoNormalMouseUp(r,s,a,e,t)}}},{key:"MouseLeave",value:function(){this.FMouseMoveItemNo>=0&&(this.DoItemMouseLeave(this.FMouseMoveItemNo),this.FMouseMoveItemNo=-1,this.FMouseMoveItemOffset=-1,this.FMouseMoveDrawItemNo=-1,this.Style.UpdateInfoRePaint())}},{key:"KeyPress",value:function(t){if(!this.CanEdit())return t;var e=this.GetActiveItem();if(null==e)return t;if(e.StyleNocs.Null&&(this.Style.ApplyTempStyle(n),o=2*this.Style.TempCanvas.textWidth("荆")),this.ApplyParaFirstIndent(i.FirstIndent+sr.pixXToMillimeter(o))}else if(t.StyleNo0?this.Items[t].StyleNo0&&(t-=1,e=this.Items[t].StyleNo0?this.Items[t].Length-1:0),lp.UNPLACEHOLDERCHAR&&this.Items[t].StyleNo>cs.Null&&this.Items[t].Length>0&&lp.IsUnPlaceHolderChar(this.Items[t].Text[e+1-1])&&(e=this.GetItemActualOffset(t,e)-1),{itemNo:t,offset:e}}},{key:"SelectStartItemPrio",value:function(){var t=this.SelectPrio(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);this.SelectInfo.StartItemNo=t.itemNo,this.SelectInfo.StartItemOffset=t.offset}},{key:"SelectEndItemPrio",value:function(){var t=this.SelectPrio(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset);this.SelectInfo.EndItemNo=t.itemNo,this.SelectInfo.EndItemOffset=t.offset}},{key:"LeftKeyDown",value:function(t,e){if(e.shiftState.has(Qt))this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(this.SelectStartItemPrio(),this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectEndItemPrio(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.StartItemNo>0&&0==this.SelectInfo.StartItemOffset&&(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)),this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectStartItemPrio(),this.CheckSelectEndEff(),this.SetSelectSeekStart()),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset));else{if(t){for(var i=this.SelectInfo.StartItemNo;i<=this.SelectInfo.EndItemNo;i++)this.Items[i].DisSelect();this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else if(0!=this.SelectInfo.StartItemOffset){if(this.SelectInfo.StartItemOffset=this.SelectInfo.StartItemOffset-1,lp.UNPLACEHOLDERCHAR){var n=this.Items[this.SelectInfo.StartItemNo].Text[this.SelectInfo.StartItemOffset+1-1];lp.TibetanVowel.indexOf(n)>=0||lp.IsUnPlaceHolderChar(n)&&(this.SelectInfo.StartItemOffset=this.GetItemActualOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)-1)}}else if(this.SelectInfo.StartItemNo>0){if(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),!this.DrawItems[this.Items[this.SelectInfo.StartItemNo+1].FirstDItemNo].LineFirst)return this.Style.UpdateInfoRePaint(),void this.KeyDown(e)}else e.Handled=!0;if(!e.Handled){var o=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);o!=this.CaretDrawItemNo?o==this.CaretDrawItemNo-1&&this.DrawItems[o].ItemNo==this.DrawItems[this.CaretDrawItemNo].ItemNo&&this.DrawItems[this.CaretDrawItemNo].LineFirst&&this.SelectInfo.StartItemOffset==this.DrawItems[this.CaretDrawItemNo].CharOffs-1||(this.CaretDrawItemNo=o):this.SelectInfo.StartRestrain&&(this.SelectInfo.StartRestrain=!1,this.Items[this.DrawItems[o].ItemNo].Active=!0),this.Style.UpdateInfoRePaint()}}}},{key:"SelectNext",value:function(t,e){return e==this.GetItemOffsetAfter(t)?t0?1:0):this.Items[t].StyleNo=0?this.IsSelectSeekStart()?(this.SelectStartItemNext(),this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectEndItemNext(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.StartItemNo0&&!this.DrawItems[i].LineFirst;)i--;this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekStart()):this.DrawItems[i].ItemNo>this.SelectInfo.StartItemNo?(this.SelectInfo.EndItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):this.DrawItems[i].ItemNo==this.SelectInfo.StartItemNo?this.DrawItems[i].CharOffs-1>this.SelectInfo.StartItemOffset&&(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekStart()),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}else{if(t){for(var n=this.SelectInfo.StartItemNo;n<=this.SelectInfo.EndItemNo;n++)this.Items[n].DisSelect();this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else{var o=this.GetSelectStartDrawItemNo(),r=-1,s=this.GetLineDrawItemRang(o,r);o=s.a,r=s.b,this.SelectInfo.StartItemNo=this.DrawItems[o].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[o].CharOffs-1}e.Handled||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)),this.Style.UpdateInfoRePaint()}}},{key:"EndKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){var i=this.GetDrawItemNoByOffset(this.FSelectSeekNo,this.FSelectSeekOffset);for(i+=1;i=0?this.IsSelectSeekStart()?this.DrawItems[i].ItemNo>this.SelectInfo.EndItemNo?(this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].StyleNo0){i=!0;var s=this.DrawItems[t].rect.left+this.GetDrawItemOffsetWidth(t,e);n-=1,n=(r=this.GetLineDrawItemRang(n,o)).a,o=r.b;for(var a=n;a<=o;a++)if(this.DrawItems[a].rect.right>s)return{drawItemNo:t=a,drawItemOffset:e=this.Items[this.DrawItems[a].ItemNo].isClass(za)?this.Items[this.DrawItems[a].ItemNo].GetOffsetAt(0):this.DrawItems[a].CharOffs+this.GetDrawItemOffsetAt(a,s)-1,result:i};t=o,e=this.Items[this.DrawItems[o].ItemNo].isClass(za)?this.Items[this.DrawItems[o].ItemNo].GetOffsetAt(0):this.DrawItems[o].CharOffsetEnd()}return{drawItemNo:t,drawItemOffset:e,result:i}}},{key:"UpKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){var i,n=-1,o=-1;this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(n=this.GetSelectStartDrawItemNo(),o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetUpDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.SelectInfo.StartItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart())):(n=this.GetSelectEndDrawItemNo(),o=this.SelectInfo.EndItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetUpDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.DrawItems[n].ItemNo>this.SelectInfo.StartItemNo?(this.SelectInfo.EndItemNo=n,this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):this.DrawItems[n].ItemNo==this.SelectInfo.StartItemNo?(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,o>this.SelectInfo.StartItemOffset?(this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart())):(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart()))):(n=this.CaretDrawItemNo,o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetUpDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart())),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}else if(t)this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1;else{var r=this.CaretDrawItemNo,s=this.SelectInfo.StartItemOffset-this.DrawItems[r].CharOffs+1,a=this.GetUpDrawItemNo(r,s);r=a.drawItemNo,s=a.drawItemOffset,a.result?(this.SelectInfo.StartItemNo=this.DrawItems[r].ItemNo,this.SelectInfo.StartItemOffset=s,this.CaretDrawItemNo=r,this.Style.UpdateInfoRePaint()):e.Handled=!0}}},{key:"GetDownDrawItemNo",value:function(t,e){var i=!1,n=t,o=-1,r=this.GetLineDrawItemRang(n,o);if(n=r.a,(o=r.b)s)return{drawItemNo:t=a,drawItemOffset:e=this.Items[this.DrawItems[a].ItemNo].isClass(za)?this.Items[this.DrawItems[a].ItemNo].GetOffsetAt(0):this.DrawItems[a].CharOffs+this.GetDrawItemOffsetAt(a,s)-1,result:i};t=o,e=this.Items[this.DrawItems[o].ItemNo].isClass(za)?this.Items[this.DrawItems[o].ItemNo].GetOffsetAt(0):this.DrawItems[o].CharOffsetEnd()}return{drawItemNo:t,drawItemOffset:e,result:i}}},{key:"DownKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){var i,n=-1,o=-1;this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(n=this.GetSelectStartDrawItemNo(),o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetDownDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.DrawItems[n].ItemNo0?this.ApplyParaFirstIndent(Math.max(0,this.Style.ParaStyles[e.ParaNo].FirstIndent-sr.pixXToMillimeter(lp.TabCharWidth))):this.SelectInfo.StartItemNo>0&&(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,this.GetItemOffsetAfter(this.SelectInfo.StartItemNo-1)),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.IsEmptyLine(this.SelectInfo.StartItemNo-1)?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo-1,0),this.Items.delete(this.SelectInfo.StartItemNo-1),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,0)):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!1),e.ParaFirst=!1,e.PageBreak&&(this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!1),e.PageBreak=!1),this.ReFormatData(s,a))):(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),this.KeyDown(i));break;case Ge:if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.startItemOffset,wp.DeleteItem))return void(this.SelectInfo.StartItemOffset=lp.OffsetAfter);if(s=(o=this.GetFormatRange(s,a)).firstDrawItemNo,a=o.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst)this.SelectInfo.StartItemNo!=a?(this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!0),this.Items[this.SelectInfo.StartItemNo+1].ParaFirst=!0,this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),this.ReFormatData(s,a-1,-1)):(this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),(e=this.CreateDefaultTextItem()).ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,e),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.ReFormatData(s,a));else if(this.SelectInfo.StartItemNo=0&&this.SelectInfo.StartItemNo0){var c=this.Style.ParaStyles[t.ParaNo];this.ApplyParaFirstIndent(Math.max(0,c.FirstIndent-sr.pixXToMillimeter(lp.TabCharWidth)))}else if(t.PageBreak)s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,0,!1),t.PageBreak=!1,this.ReFormatData(s,a,0,!0);else if(0!=this.SelectInfo.StartItemNo){if(!t.ParaFirst)return this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),this.CaretDrawItemNo=this.Items[this.SelectInfo.StartItemNo].FirstDItemNo,void this.KeyDown(i);if(r=this.Items[this.SelectInfo.StartItemNo-1].Length,t.CanConcatItems(this.Items[this.SelectInfo.StartItemNo-1])){if(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,r),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,this.Items[this.SelectInfo.StartItemNo-1].Length+1,this.Items[this.SelectInfo.StartItemNo].Text),this.Items[this.SelectInfo.StartItemNo-1].Text=this.Items[this.SelectInfo.StartItemNo-1].Text+this.Items[this.SelectInfo.StartItemNo].Text,this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.Items.delete(this.SelectInfo.StartItemNo),(l=this.Items[this.SelectInfo.StartItemNo-1].ParaNo)!=t.ParaNo)for(var u=this.SelectInfo.StartItemNo;u<=a-1;u++)this.Items[u].ParaNo=l;this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,r)}else if(this.IsEmptyLine(this.SelectInfo.StartItemNo-1))s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,r),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo-1,0),this.Items.delete(this.SelectInfo.StartItemNo-1),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,0);else if(0==t.Length)s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,r),this.FormatPrepare(s,this.SelectInfo.StartItemNo),this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.Items.delete(this.SelectInfo.StartItemNo),this.ReFormatData(s,this.SelectInfo.StartItemNo-1,-1),this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo-1);else{if(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,this.GetItemOffsetAfter(this.SelectInfo.StartItemNo-1)),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!1),t.ParaFirst=!1,(l=this.Items[this.SelectInfo.StartItemNo-1].ParaNo)!=t.ParaNo)for(var f=this.SelectInfo.StartItemNo;f<=a;f++)this.Items[f].ParaNo=l;this.ReFormatData(s,a),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,0)}}}else if(1==t.Length)if(o=this.SelectInfo.StartItemNo,this.DrawItems[this.Items[o].FirstDItemNo].LineFirst)if(this.Items[o].ParaFirst)if(s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),o0&&o1&&void 0!==arguments[1]&&arguments[1];if(!lp.IsKeyDownEdit(t.keyCode)||this.CanEdit()){var i=t.keyCode;i!=Pe&&i!=Ge&&i!=be&&i!=De||this.InitializeMouseField();var n=this.GetActiveItem();if(null!=n){var o=this.SelectExists();if(o&&(i==Pe||i==Ge||i==be||i==De)){if(!this.DeleteSelected())return;if(i==Pe||i==Ge)return}var r=-1,s=-1,a=this.GetParaItemRang(this.SelectInfo.StartItemNo,r,s);if(r=a.a,s=a.b,n.StyleNo0){var l,h=this.GetDrawItemText(o);l=(n=n-this.DrawItems[o].CharOffs+1)>0?lp.GetUnicodeCharType(h[n-1]):lp.GetUnicodeCharType(h[0]);for(var c=0,u=n-1;u>=1;u--)if(lp.GetUnicodeCharType(h[u-1])!=l){c=u;break}for(var f=h.length,d=n+1;d<=h.length;d++)if(lp.GetUnicodeCharType(h[d-1])!=l){f=d-1;break}this.SelectInfo.StartItemNo=i,this.SelectInfo.StartItemOffset=c+this.DrawItems[o].CharOffs-1,c!=f&&(this.SelectInfo.EndItemNo=i,this.SelectInfo.EndItemOffset=f+this.DrawItems[o].CharOffs-1,this.MatchItemSelectState())}this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(!1)}}},{key:"DeleteItems",value:function(t,e,i){if(this.CanEdit()&&!(e0&&(n--,n=this.GetFormatFirstDrawItem(n)),this.FormatPrepare(n,o);var s=this.Items[t].ParaFirst,a=e-t+1;this.Undo_New();for(var l=e;l>=t;l--)this.UndoAction_DeleteItem(l,0),this.Items.delete(l);if(0==this.Items.count){var h=this.CreateDefaultTextItem();this.CurStyleNo=h.StyleNo,h.ParaFirst=!0,this.Items.add(h),a--,this.UndoAction_InsertItem(0,0)}else if(s)if(t0?this.ReSetSelectAndCaret(t-1):this.ReSetSelectAndCaretByOffset(0,0)}}},{key:"DeleteActiveDataItems",value:function(t,e,i){if(!(t<0||t>this.Items.count-1)){var n=this.GetActiveItem();if(n.StyleNo0&&this.Items[this.Items.count-1].CanConcatItems(t.Items[0])?(this.Items[this.Items.count-1].Text=this.Items[this.Items.count-1].Text+t.Items[0].Text,e=1):e=0;for(var i=e;i0)if(r=t.length,e||""==t)if(e||this.Items[this.SelectInfo.StartItemNo].ParaFirst){var s=this.CreateDefaultTextItem();s.Text=t,s.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,s),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),o.ParaFirst=!0;else if(o.AcceptAction(0,this.SelectInfo.StartRestrain,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo,1,t),o.Text=t+o.Text;else if(o.ParaFirst){var a=this.CreateDefaultTextItem();a.Text=t,a.ParaFirst=!0,this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!1),o.ParaFirst=!1,this.Items.insert(this.SelectInfo.StartItemNo,a),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else if(this.Items[this.SelectInfo.StartItemNo-1].StyleNo>cs.Null)if((o=this.Items[this.SelectInfo.StartItemNo-1]).AcceptAction(o.Length,!0,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,o.Length+1,t),o.Text=o.Text+t,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,r=o.Length;else{var l=this.CreateDefaultTextItem();l.Text=t,this.Items.insert(this.SelectInfo.StartItemNo,l),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else{var h=this.CreateDefaultTextItem();h.Text=t,this.Items.insert(this.SelectInfo.StartItemNo,h),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else if(this.SelectInfo.StartItemOffset==o.Length)if(e||""==t)if(!e&&this.SelectInfo.StartItemNocs.Null)if((o=this.Items[this.SelectInfo.StartItemNo+1]).AcceptAction(0,!0,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo+1,1,t),o.Text=t+o.Text,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length;else{var f=this.CreateDefaultTextItem();f.Text=t,this.Items.insert(this.SelectInfo.StartItemNo+1,f),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else{var d=this.CreateDefaultTextItem();d.Text=t,this.Items.insert(this.SelectInfo.StartItemNo+1,d),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else if(e||""==t){var m=o.SubString(this.SelectInfo.StartItemOffset+1-1,o.Length-this.SelectInfo.StartItemOffset);this.UndoAction_DeleteText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,m);var y=o.BreakByOffset(this.SelectInfo.StartItemOffset);y.Text=t+y.Text,y.ParaFirst=!0,this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(this.SelectInfo.StartItemNo+1,y)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else{r=this.SelectInfo.StartItemOffset+t.length;var p=o.Text;p=C.stringInsert(p,this.SelectInfo.StartItemOffset,t),this.UndoAction_InsertText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,t),o.Text=p}this.SelectInfo.StartItemOffset=r,n=!0}else{var S=this.CreateDefaultTextItem();if(S.Text=t,S.ParaFirst=e||""==t,0==this.SelectInfo.StartItemOffset)!S.ParaFirst&&o.ParaFirst&&(S.ParaFirst=!0,0==o.Length?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),i--):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!1),o.ParaFirst=!1)),this.Items.insert(this.SelectInfo.StartItemNo,S),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++,this.SelectInfo.StartItemOffset=S.Length;else if(this.SelectInfo.StartItemOffset==o.Length)this.Items.insert(this.SelectInfo.StartItemNo+1,S),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=S.Length;else{var v=o.SubString(this.SelectInfo.StartItemOffset+1,o.Length-this.SelectInfo.StartItemOffset);this.UndoAction_DeleteText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,v);var F=o.BreakByOffset(this.SelectInfo.StartItemOffset);F.ParaFirst=!1,this.Items.insert(this.SelectInfo.StartItemNo+1,S),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=S.Length,this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(this.SelectInfo.StartItemNo+1,F)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++}}return this.CurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,{addCount:i,result:n}}},{key:"DoInsertTextEx",value:function(t,e,i){var n=this.Items[this.SelectInfo.StartItemNo];return n.StyleNocs.Null&&!this.Items[this.SelectInfo.StartItemNo+1].ParaFirst?(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0,this.CurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,i=this.DoInsertTextEx(t,e,i)):""==t&&this.SelectInfo.StartItemNo0&&this.Items[this.SelectInfo.StartItemNo-1].StyleNo>cs.Null&&!n.ParaFirst?(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].Length,this.CurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,i=this.DoInsertTextEx(t,e,i)):""!=t||n.ParaFirst?((n=this.CreateDefaultTextItem()).Text=t,(e||""==t)&&(n.ParaFirst=!0),this.Items[this.SelectInfo.StartItemNo].ParaFirst&&(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!1),this.Items[this.SelectInfo.StartItemNo].ParaFirst=!1,n.ParaFirst=!0),this.Items.insert(this.SelectInfo.StartItemNo,n),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++,this.SelectInfo.StartItemOffset=n.Length,this.CurStyleNo=n.StyleNo):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),n.ParaFirst=!0):i=this.DoTextItemInsert(t,e,i).addCount,i}},{key:"InsertText",value:function(t){if(!this.CanEdit())return!1;if(!this.DeleteSelected())return!1;if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.InsertText))return!1;if(!this.DoInsertTextBefor(t))return!1;var e=!1;this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{var i;this.Undo_New();var n=-1,o=-1;if(this.Items[this.SelectInfo.StartItemNo].StyleNo0){var a=this.Items[s-1].Length;this.MergeItemToPrio(s)&&(this.UndoAction_InsertText(s-1,this.Items[s-1].Length-this.Items[s].Length+1,this.Items[s].Text),this.UndoAction_DeleteItem(s,0),this.Items.delete(s),r--,this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,a+this.SelectInfo.StartItemOffset))}0!=r&&(this.ReFormatData(i,n+r,r),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret())}}}}},{key:"DisActive",value:function(){if(this.InitializeField(),this.Items.count>0){var t=this.GetActiveItem();null!=t&&(t.Active=!1)}}},{key:"GetHint",value:function(){return!this.FMouseMoveRestrain&&this.FMouseMoveItemNo>=0?this.Items[this.FMouseMoveItemNo].GetHint():""}},{key:"MouseMoveDrawItemNo",get:function(){return this.FMouseMoveDrawItemNo}},{key:"MouseDownItemNo",get:function(){return this.FMouseDownItemNo}},{key:"MouseDownItemOffset",get:function(){return this.FMouseDownItemOffset}},{key:"MouseMoveItemNo",get:function(){return this.FMouseMoveItemNo}},{key:"MouseMoveItemOffset",get:function(){return this.FMouseMoveItemOffset}},{key:"MouseMoveRestrain",get:function(){return this.FMouseMoveRestrain}},{key:"HotDrawItemNo",get:function(){return this.FMouseMoveDrawItemNo}},{key:"height",get:function(){return this.GetHeight()}},{key:"ReadOnly",get:function(){return this.FReadOnly},set:function(t){this.SetReadOnly(t)}},{key:"Selecting",get:function(){return this.FSelecting}}])&&dy(e.prototype,i),n&&dy(e,n),r}(Sc);function Iy(t){return(Iy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gy(t,e,i){return(gy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xy(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function wy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cy(t,e){for(var i=0;i=this.SelectInfo.StartItemNo&&o<=this.SelectInfo.EndItemNo)&&this.FDomainStartDeletes.add(o)}else n=this.FDomainStartDeletes.indexOf(t)>=0;return n&&(n=Hy(zy(r.prototype),"DoAcceptAction",this).call(this,t,e,i)),n}},{key:"DoSaveItem",value:function(t){var e=Hy(zy(r.prototype),"DoSaveItem",this).call(this,t);if(e&&this.Style.States.Contain(Ip.Copying)&&this.Items[t].StyleNo==cs.Domain){var i=this.GetDomainAnother(t);e=i>=this.SelectInfo.StartItemNo&&i<=this.SelectInfo.EndItemNo}return e}},{key:"CheckInsertItemCount",value:function(t,e){var i=Hy(zy(r.prototype),"CheckInsertItemCount",this).call(this,t,e);if(this.Loading)return i;var n=-1,o=new ql;this.GetDomainFrom(t,0,o),o.BeginNo>=0&&(n=this.Items[o.BeginNo].Level);for(var s=t;s<=e;s++)this.Items[s].isClass(za)&&(this.Items[s].MarkType==Pp.Beg&&n++,this.Items[s].Level=n,this.Items[s].MarkType==Pp.End&&n--);return this.Style.States.Contain(Ip.DomainWholeReplace)&&(!this.Items[t].ParaFirst&&t>0&&this.Items[t-1].isClass(za)&&this.Items[t-1].ParaFirst&&(this.Items[t-1].ParaNo=this.Items[t].ParaNo),this.IsParaLastItem(e+1)&&this.Items[e+1].isClass(za)&&(this.Items[e+1].ParaNo=this.Items[e].ParaNo)),i}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Hy(zy(r.prototype),"ReSetSelectAndCaretByOffset",this).call(this,t,e,i),this.Style.States.Contain(Ip.BatchInsert)||(this.FDomainCount>0?this.GetDomainFrom(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.FActiveDomain):this.FActiveDomain.Clear())}},{key:"DoCaretItemChanged",value:function(){this.FCaretItemChanged=!0}},{key:"DoInsertItem",value:function(t){za.IsBeginMark(t)&&this.FDomainCount++,this.FHotDomain.Clear(),Hy(zy(r.prototype),"DoInsertItem",this).call(this,t)}},{key:"DoRemoveItem",value:function(t){za.IsBeginMark(t)&&this.FDomainCount--,this.FHotDomain.Clear(),Hy(zy(r.prototype),"DoRemoveItem",this).call(this,t)}},{key:"DoDrawItemPaintBefor",value:function(t,e,i,n,o,s,a,l,h,c,u,f){if(Hy(zy(r.prototype),"DoDrawItemPaintBefor",this).call(this,t,e,i,n,o,s,a,l,h,c,u,f),!f.Print){var d=!1,m=!1;this.Style.DrawHotDomainRegion&&this.FHotDomain.BeginNo>=0&&(d=this.FHotDomain.Contain(e)),this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(m=this.FActiveDomain.Contain(e)),(d||m)&&(d&&this.FHotDomainRGN.combineRect(n),m&&this.FActiveDomainRGN.combineRect(n))}}},{key:"SelectOffsetAfter_",value:function(t,e){var i=this.Items[t].IsSelectComplate;return!i&&this.Items[t].StyleNo>cs.Null&&this.SelectInfo.EndItemNo>=0&&(t==this.SelectInfo.EndItemNo?this.SelectInfo.EndItemOffset==this.DrawItems[e].CharOffsetEnd()&&(i=!0):t==this.SelectInfo.StartItemNo&&(i=!0)),i}},{key:"DrawLineLastMrak",value:function(t,e,i,n,o,r){this.SelectOffsetAfter_(n,o)&&(t.brush.color=this.Style.SelColor,t.fillRect(U.Create(e.right,e.top,e.right+10,e.bottom))),t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=lp.clActiveBorder,t.beginPath();try{t.moveTo(i.right+4,i.bottom-8),t.lineTo(i.right+6,i.bottom-8),t.moveTo(i.right+6,i.bottom-8),t.lineTo(i.right+6,i.bottom-3),t.moveTo(i.right,i.bottom-3),t.lineTo(i.right+6,i.bottom-3),t.moveTo(i.right+1,i.bottom-4),t.lineTo(i.right+1,i.bottom-1),t.moveTo(i.right+2,i.bottom-5),t.lineTo(i.right+2,i.bottom)}finally{t.paintPath()}}},{key:"DoDrawItemPaintAfter",value:function(t,e,i,n,o,s,a,l,h,c,u,f){Hy(zy(r.prototype),"DoDrawItemPaintAfter",this).call(this,t,e,i,n,o,s,a,l,h,c,u,f),f.Print||t.Style.ShowParaLastMark&&(i=0?this.GetTopLevelData()==this&&(this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(n=!0),this.FDomainCount>0?this.GetDomainFrom(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.FActiveDomain):this.FActiveDomain.Clear(),this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(n=!0)):this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(this.FActiveDomain.Clear(),n=!0),n&&this.Style.UpdateInfoRePaint(),this.FCaretItemChanged&&(this.FCaretItemChanged=!1,null!=this.OnCaretItemChanged&&this.OnCaretItemChanged(this,this.Items[this.SelectInfo.StartItemNo])),o!=this.ActiveDomainBeginItem()&&this.FActiveDomain.BeginNo>=0&&null!=this.OnDomainSwitch&&this.OnDomainSwitch(this,this.FActiveDomain.BeginNo)}},{key:"DeleteSelected",value:function(){return this.FDomainStartDeletes.clear(),Hy(zy(r.prototype),"DeleteSelected",this).call(this)}},{key:"DeleteActiveDomain",value:function(){if(this.SelectExists())return!1;var t=!1;if(this.FActiveDomain.BeginNo>=0)t=this.DeleteDomain(this.FActiveDomain);else if(this.Items[this.SelectInfo.StartItemNo].StyleNo0&&(i=this.GetFormatFirstDrawItem(this.Items[t].FirstDItemNo-1)):(this.UndoAction_ItemParaFirst(e+1,0,!0),this.Items[e+1].ParaFirst=!0)),this.FormatPrepare(i,n);for(var o=0,r=this.Items[t].PageBreak,s=e;s>=t;s--)this.UndoAction_DeleteItem(s,0),this.Items.delete(s),o++;if(this.FActiveDomain.Clear(),0==t){var a=this.CreateDefaultTextItem();a.ParaFirst=!0,a.PageBreak=r,this.Items.insert(t,a),this.UndoAction_InsertItem(t,0),o--}return this.ReFormatData(i,n-o,-o),this.InitializeField(),t>this.Items.count-1?this.ReSetSelectAndCaret(t-1):this.ReSetSelectAndCaretByOffset(t,0),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),!0}},{key:"MouseMove",value:function(t){var e=this.Style.DrawHotDomainRegion&&this.FHotDomain.BeginNo>=0;Hy(zy(r.prototype),"MouseMove",this).call(this,t),this.FDomainCount>0?this.GetDomainFrom(this.MouseMoveItemNo,this.MouseMoveItemOffset,this.FHotDomain):this.FHotDomain.Clear();var i=this.GetTopLevelDataAt(t.x,t.y);(i==this||i.HotDomain.BeginNo<0)&&this.Style.DrawHotDomainRegion&&this.FHotDomain.BeginNo>=0&&(e=!0),e&&this.Style.UpdateInfoRePaint()}},{key:"InsertItem",value:function(t){var e=Hy(zy(r.prototype),"InsertItem",this).call(this,t);return e&&(this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll()),e}},{key:"InsertItemEx",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Hy(zy(r.prototype),"InsertItemEx",this).call(this,t,e,i);return n&&(this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll()),n}},{key:"CanEdit",value:function(){var t=Hy(zy(r.prototype),"CanEdit",this).call(this);return t&&null!=this.OnCanEdit&&(t=this.OnCanEdit(this)),t}},{key:"DoInsertTextBefor",value:function(t,e,i){var n=Hy(zy(r.prototype),"DoInsertTextBefor",this).call(this,t,e,i);return n&&null!=this.OnInsertTextBefor&&(n=this.OnInsertTextBefor(this,t,e,i)),n}},{key:"DoLoadFromStream",value:function(t,e,i){Hy(zy(r.prototype),"DoLoadFromStream",this).call(this,t,e,i),i>42&&(this.Script=lp.HCLoadTextFromStream(t,i))}},{key:"SaveToStream",value:function(t){Hy(zy(r.prototype),"SaveToStream",this).call(this,t),lp.HCSaveTextToStream(t,this.Script)}},{key:"InsertDomain",value:function(t){if(!this.CanEdit())return!1;var e=!1,i=null;this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{this.Style.States.Include(Ip.BatchInsert);try{i=this.CreateDefaultDomainItem(),null!=t&&i.Assign(t),i.MarkType=Pp.Beg,this.FActiveDomain.BeginNo>=0&&(i.Level=this.Items[this.FActiveDomain.BeginNo].Level+1),(e=this.InsertItem(i))&&(i=this.CreateDefaultDomainItem(),null!=t&&i.Assign(t),i.MarkType=Pp.End,this.FActiveDomain.BeginNo>=0&&(i.Level=this.Items[this.FActiveDomain.BeginNo].Level+1),e=this.InsertItem(i))}finally{this.Style.States.Exclude(Ip.BatchInsert)}}finally{this.Undo_GroupEnd(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}return this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo),e}},{key:"GetItemDomain",value:function(t){var e=new ql;return this.GetDomainFrom(t,0,e,null),{beginNo:e.BeginNo,endNo:e.EndNo}}},{key:"GetDomainFrom",value:function(t,e,i,n){if(i.Clear(),!(t<0||e<0)){var o=0,r=0,s=t,a=t;if(this.Items[t].isClass(za)&&this.doAskIsWantDomain(n,t))if(this.Items[t].MarkType==Pp.Beg)if(e==lp.OffsetAfter)i.Data=this,i.BeginNo=t,r=this.Items[t].Level,a=t+1;else{if(!(t>0))return;s=t-1}else if(e==lp.OffsetAfter){if(!(t=0;l--)if(this.Items[l].isClass(za)&&this.doAskIsWantDomain(n,l))if(this.Items[l].MarkType==Pp.Beg){if(0==o){i.Data=this,i.BeginNo=l,r=this.Items[l].Level;break}o--}else o++;if(i.BeginNo>=0&&i.EndNo<0){for(var h=a;h<=this.Items.count-1;h++)if(this.Items[h].isClass(za)&&this.doAskIsWantDomain(n,h)&&this.Items[h].MarkType==Pp.End&&this.Items[h].Level==r){i.EndNo=h;break}if(i.EndNo<0)throw"异常:获取数据组结束出错!"}}else{for(var c=a;c<=this.Items.count-1;c++)if(this.Items[c].isClass(za)&&this.doAskIsWantDomain(n,c))if(this.Items[c].MarkType==Pp.End){if(!(o>0)){i.EndNo=c,r=this.Items[c].Level;break}o--}else o++;if(i.EndNo>=0&&i.BeginNo<0){for(var u=s;u>=0;u--)if(this.Items[u].isClass(za)&&this.doAskIsWantDomain(n,u)&&this.Items[u].MarkType==Pp.Beg&&this.Items[u].Level==r){i.Data=this,i.BeginNo=u;break}if(i.BeginNo<0)throw"异常:获取域起始位置出错!"}}else if(i.EndNo<0){for(var f=a;f<=this.Items.count-1;f++)if(this.Items[f].isClass(za)&&this.doAskIsWantDomain(n,f)&&this.Items[f].MarkType==Pp.End&&this.Items[f].Level==r){i.EndNo=f;break}if(i.EndNo<0)throw"异常:获取域起始位置出错!"}}}},{key:"SetSelectBound",value:function(t,e,i,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=-1,s=-1,a=-1,l=-1;i<0?(r=t,a=e,s=-1,l=-1):i>=t?(r=t,s=i,i==t?n>=e?(a=e,l=n):(a=n,l=e):(a=e,l=n)):(r=i,s=t,l=a=n);var h=this.AdjustSelectRange(r,a,s,l);r=h.startItemNo,a=h.startItemOffset,s=h.endItemNo,l=h.endItemOffset,this.MatchItemSelectState(),o?(this.FCurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,this.FCurParaNo=this.Items[this.SelectInfo.StartItemNo].ParaNo):(this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!0),this.Style.UpdateInfoRePaint())}},{key:"SelectItemAfterWithCaret",value:function(t){this.ReSetSelectAndCaret(t)}},{key:"SelectLastItemAfterWithCaret",value:function(){this.SelectItemAfterWithCaret(this.Items.count-1)}},{key:"SelectFirstItemBeforWithCaret",value:function(){this.ReSetSelectAndCaretByOffset(0,0)}},{key:"GetDomainAnother",value:function(t){var e=-1,i=this.Items[t];if(i.MarkType==Pp.End){for(var n=t-1;n>=0;n--)if(this.Items[n].StyleNo==cs.Domain&&this.Items[n].MarkType==Pp.Beg&&this.Items[n].Level==i.Level){e=n;break}}else for(var o=t+1;o<=this.Items.count-1;o++)if(this.Items[o].StyleNo==cs.Domain&&this.Items[o].MarkType==Pp.End&&this.Items[o].Level==i.Level){e=o;break}return e}},{key:"ReversePos",value:function(t,e){var i=e.lastIndexOf(t);return i<0?0:i+1}},{key:"DoSearchByOffset",value:function(t,e,i,n,o,r){if(!this.Items[o].Visible)return!1;var s,a,l,h=-1,c=-1,u=!1;if(this.Items[o].StyleNo0)this.SelectInfo.StartItemNo=o,this.SelectInfo.StartItemOffset=i?h-1:r+h-1,this.SelectInfo.EndItemNo=o,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset+e.length,u=!0;else if(""!=s&&e.length>1)if(i)for(c=o,a=s,l="";c>0&&!this.Items[c].ParaFirst&&this.Items[c-1].StyleNo>cs.Null;)if(this.Items[c-1].Visible){if(s.length>e.length-1&&(s=this.Items[c-1].TextEffective().substr(e.length-1,this.Items[c-1].Text.length-e.length+1)),l+=s,a=s+a,n||(a=a.toUpperCase()),(h=a.indexOf(e)+1)>0){for(this.SelectInfo.StartItemNo=c-1,this.SelectInfo.StartItemOffset=this.Items[c-1].Length-(s.length-h)-1,this.SelectInfo.EndItemNo=o,this.SelectInfo.EndItemOffset=h+e.length-1-s.length;c=e.length-1)break;c--}else c--;else for(c=o,a=s,l="";ccs.Null;)if(this.Items[c+1].Visible){if(s.length>e.length-1&&(s=this.Items[c+1].TextEffective().substr(0,e.length-1)),l+=s,a+=s,n||(a=a.toUpperCase()),(h=a.indexOf(e)+1)>0){for(this.SelectInfo.StartItemNo=o,this.SelectInfo.StartItemOffset=r+h-1,this.SelectInfo.EndItemNo=c+1,this.SelectInfo.EndItemOffset=h+e.length-1-(this.Items[o].Length-r);c>=o+1;)this.Items[c].Visible||(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset-this.Items[c].TextEffective().length),c--;u=!0;break}if(l.length>=e.length-1)break;c++}else c++;return u}},{key:"Search",value:function(t,e,i){var n=!1,o="";o=i?t:t.toUpperCase();var r=-1,s=-1;if(this.SelectInfo.StartItemNo<0?(r=0,s=0):this.SelectInfo.EndItemNo>=0?(e?(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset):(r=this.SelectInfo.EndItemNo,s=this.SelectInfo.EndItemOffset),this.DisSelect()):(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset),!(n=this.DoSearchByOffset(t,o,e,i,r,s)))if(e){for(var a=r-1;a>=0;a--)if(this.DoSearchByOffset(t,o,e,i,a,this.GetItemOffsetAfter(a))){n=!0;break}}else for(var l=r+1;l<=this.Items.count-1;l++)if(this.DoSearchByOffset(t,o,e,i,l,0)){n=!0;break}return n?(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset,this.SelectInfo.EndItemNo>=0?this.ReSetSelectAndCaretByOffset(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset,!e):this.ReSetSelectAndCaretByOffset(r,s,!e),this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=s,this.MatchItemSelectState()):this.SelectInfo.EndItemNo>=0?(e?(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset):(r=this.SelectInfo.EndItemNo,s=this.SelectInfo.EndItemOffset),this.DisSelect(),this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=s):this.SelectInfo.StartItemNo<0&&(this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=s),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),n}},{key:"Replace",value:function(t){return this.InsertText(t)}},{key:"ActiveDomainBeginItem",value:function(){return this.FActiveDomain.BeginNo>=0?this.Items[this.FActiveDomain.BeginNo]:null}},{key:"GetCaretInfoCur",value:function(t){this.Style.UpdateInfo.DragingSelected?this.GetCaretInfo(this.MouseMoveItemNo,this.MouseMoveItemOffset,t):this.GetCaretInfo(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,t)}},{key:"TraverseItemExecute",value:function(t,e){var i;this.Items[t].StyleNo==cs.Domain&&(za.IsBeginMark(this.Items[t])?((i=(i=e.DomainStack.peek()).AppendChild()).Data=this,i.BeginNo=t,e.DomainStack.push(i)):(i=e.DomainStack.pop()).EndNo=t),e.ReverseOrder&&this.Items[t].StyleNo=0&&!t.Stop;e--)this.TraverseItemExecute(e,t);else for(var i=0;i0?this.Items[this.FActiveAnnotate.EndNo]:null}},{key:"DoLoadFromStream",value:function(t,e,n){if(gy(xy(i.prototype),"DoLoadFromStream",this).call(this,t,e,n),n>22&&n<55){var o=t.readUInt16();if(o>0)for(var r=0;r54?t.readUInt32():0}},{key:"DoInsertItem",value:function(t){t.StyleNo===cs.Annotate&&t.MarkType===Pp.Beg&&(this.FAnnotateCount++,null!=this.OnInsertAnnotate&&this.OnInsertAnnotate(this,t)),gy(xy(i.prototype),"DoInsertItem",this).call(this,t)}},{key:"DoRemoveItem",value:function(t){t.StyleNo===cs.Annotate&&t.MarkType===Pp.Beg&&(this.FAnnotateCount--,null!=this.OnRemoveAnnotate&&this.OnRemoveAnnotate(this,t)),gy(xy(i.prototype),"DoRemoveItem",this).call(this,t)}},{key:"DoAcceptAction",value:function(t,e,n){if(this.Style.States.Contain(Ip.Loading)||this.Style.States.Contain(Ip.Undoing)||this.Style.States.Contain(Ip.Redoing))return!0;var o=!0;return n===wp.DeleteItem&&this.Items[t].StyleNo===cs.Annotate&&(o=!1),o&&(o=gy(xy(i.prototype),"DoAcceptAction",this).call(this,t,e,n)),o}},{key:"DoDrawItemPaintContent",value:function(t,e,n,o,r,s,a,l,h,c,u,f,d){d.Print||null==this.OnDrawItemAnnotate||t.Items[e].StyleNo===cs.Annotate&&t.Items[e].MarkType===Pp.End&&this.OnDrawItemAnnotate(t,n,o,t.Items[e]),gy(xy(i.prototype),"DoDrawItemPaintContent",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f,d)}},{key:"GetCaretInfo",value:function(t,e,n){this.FAnnotateCount>0&&this.SelectInfo.StartItemNo>=0&&(this.GetTopLevelData()==this&&this.GetAnnotateFrom(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.FActiveAnnotate));gy(xy(i.prototype),"GetCaretInfo",this).call(this,t,e,n)}},{key:"MouseMove",value:function(t){gy(xy(i.prototype),"MouseMove",this).call(this,t),this.FAnnotateCount>0?this.GetAnnotateFrom(this.MouseMoveItemNo,this.MouseMoveItemOffset,this.FHotAnnotate):this.FHotAnnotate.Clear();var e=this.GetTopLevelDataAt(t.x,t.y);(e==this||e.HotAnnotate.BeginNo<0)&&this.FHotAnnotate.BeginNo>=0&&this.Style.UpdateInfoRePaint()}},{key:"InitializeField",value:function(){gy(xy(i.prototype),"InitializeField",this).call(this),null!=this.FHotAnnotate&&this.FHotAnnotate.Clear(),null!=this.FActiveAnnotate&&this.FActiveAnnotate.Clear()}},{key:"SaveToStream",value:function(t){gy(xy(i.prototype),"SaveToStream",this).call(this,t),t.writeInt32(this.FNextID)}},{key:"GetAnnotateBeginBefor",value:function(t,e){for(var i=t;i>=0;i--)if(this.Items[i].StyleNo===cs.Annotate&&this.Items[i].MarkType===Pp.Beg&&this.Items[i].ID===e)return i;return-1}},{key:"GetAnnotateEndAfter",value:function(t,e){for(var i=t;i=0;r--)if(this.Items[r].StyleNo===cs.Annotate)if((n=this.Items[r]).MarkType===Pp.End)this.FIDStrack.push(n.ID);else{if(!(this.FIDStrack.count>0)){i.Data=this,i.BeginNo=r,o=n.ID;break}if(o=this.FIDStrack.peek(),n.ID!==o){i.Data=this,i.BeginNo=r,o=n.ID;break}this.FIDStrack.pop()}i.BeginNo>=0&&(i.EndNo=this.GetAnnotateEndAfter(t+1,o))}}},{key:"InsertAnnotateByOffset",value:function(t,e,i){var n=0;if(i===lp.OffsetBefor)t.ParaFirst=this.Items[e].ParaFirst,t.PageBreak=this.Items[e].PageBreak,this.Items[e].StyleNo>cs.Null&&""===this.Items[e].Text?(this.UndoAction_DeleteItem(e,0),this.Items.delete(e),n--):(this.Items[e].ParaFirst&&(this.UndoAction_ItemParaFirst(e,0,!1),this.Items[e].ParaFirst=!1),this.Items[e].PageBreak&&(this.UndoAction_ItemPageBreak(e,0,!1),this.Items[e].PageBreak=!1)),this.Items.insert(e,t),this.UndoAction_InsertItem(e,lp.OffsetBefor),n++;else if(i===this.GetItemOffsetAfter(e))this.Items.insert(e+1,t),this.UndoAction_InsertItem(e+1,lp.OffsetBefor),n++;else if(this.IsRectItem(e))this.Items.insert(e+1,t),this.UndoAction_InsertItem(e+1,lp.OffsetBefor),n++;else{var o=this.Items[e].SubString(i+1,this.Items[e].Length-i);this.UndoAction_DeleteText(e,i+1,o);var r=this.Items[e].BreakByOffset(i);this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(e+1,r)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(e+1,0),n++,this.Items.insert(e+1,t),this.UndoAction_InsertItem(e+1,lp.OffsetBefor),n++}return n}},{key:"InsertAnnotate",value:function(t,e){var i=!1;if(this.Items[this.SelectInfo.StartItemNo].StyleNo=0?this.InsertAnnotateByOffset(l,this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset):this.InsertAnnotateByOffset(l,this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),(l=new uy(this)).MarkType=Pp.Beg,l.ID=this.FNextID,o+=this.InsertAnnotateByOffset(l,this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.ReFormatData(r,s+o,o)}finally{this.Style.States.Exclude(Ip.BatchInsert)}return this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo),!0}},{key:"DeleteAnnotate",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.CanEdit())return!1;if(e0&&(n--,n=this.GetFormatFirstDrawItem(n)),this.FormatPrepare(n,r);var a=this.Items[t].ParaFirst,l=2;if(this.Undo_New(),this.UndoAction_DeleteItem(e,0),this.Items.delete(e),this.UndoAction_DeleteItem(t,0),this.Items.delete(t),0===this.Items.count){var h=this.CreateDefaultTextItem();this.CurStyleNo=h.StyleNo,h.ParaFirst=!0,this.Items.add(h),l--,this.UndoAction_InsertItem(0,0)}else if(a)if(t0?this.ReSetSelectAndCaret(t-1):this.ReSetSelectAndCaretByOffset(0,0),!0}},{key:"DeleteActiveAnnotate",value:function(){if(this.SelectExists())return!1;var t=!1;if(this.FActiveAnnotate.BeginNo>=0)t=this.DeleteAnnotate(this.FActiveAnnotate.BeginNo,this.FActiveAnnotate.EndNo);else if(this.Items[this.SelectInfo.StartItemNo].StyleNo0&&(t+=this.DrawItems[0].rect.top),t}},{key:"DoLoadFromStream",value:function(t,e,i){this.BeginFormat();try{Yy(Qy(r.prototype),"DoLoadFromStream",this).call(this,t,e,i)}finally{this.EndFormat(!1)}}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.FActive?Yy(Qy(r.prototype),"ReSetSelectAndCaretByOffset",this).call(this,t,e,i):(this.SelectInfo.Initialize(),this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e)}},{key:"ReFormatData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Yy(Qy(r.prototype),"ReFormatData",this).call(this,t,e,i,n),this.FormatChange=!1,this.FormatHeightChange&&(this.SetFormatHeightChange(),this.DoFormatDirty())}},{key:"DoFormatDirty",value:function(){null!=this.FOnFormatDirty&&this.FOnFormatDirty()}},{key:"DoSetFormatHeightChange",value:function(){null!=this.OnSetFormatHeightChange&&this.OnSetFormatHeightChange()}},{key:"ReFormat",value:function(){this.Style.SkipFormat||Yy(Qy(r.prototype),"ReFormat",this).call(this)}},{key:"DisSelect",value:function(){var t=Yy(Qy(r.prototype),"DisSelect",this).call(this);return this.FCellSelectedAll=!1,t}},{key:"DeleteSelected",value:function(){var t=Yy(Qy(r.prototype),"DeleteSelected",this).call(this);return this.FCellSelectedAll=!1,t}},{key:"DeleteItemDirect",value:function(t){Yy(Qy(r.prototype),"DeleteItemDirect",this).call(this,t),this.DoFormatDirty()}},{key:"SetFormatHeightChange",value:function(){this.FormatChange=!1,this.DoSetFormatHeightChange()}},{key:"SetActive",value:function(t){this.FActive!=t&&(this.FActive=t),this.FActive||(this.DisSelect(),this.InitializeField(),this.Style.UpdateInfoRePaint())}},{key:"GetFormatTop",value:function(){return null!=this.FOnGetFormatTop?this.FOnGetFormatTop(this):0}},{key:"ApplySelectTextStyle",value:function(t){this.FCellSelectedAll&&(this.CurStyleNo=this.Items[0].StyleNo),Yy(Qy(r.prototype),"ApplySelectTextStyle",this).call(this,t)}},{key:"ApplySelectParaStyle",value:function(t){this.FCellSelectedAll&&(this.CurParaNo=this.Items[0].ParaNo),Yy(Qy(r.prototype),"ApplySelectParaStyle",this).call(this,t)}},{key:"GetDrawItemFormatTop",value:function(t){return Yy(Qy(r.prototype),"GetDrawItemFormatTop",this).call(this,t)+this.GetFormatTop()}},{key:"SelectAll",value:function(){Yy(Qy(r.prototype),"SelectAll",this).call(this),this.FCellSelectedAll=!0}},{key:"CoordInSelect",value:function(t,e,i,n,o){return this.FCellSelectedAll?this.PointInCellRect(G.Create(t,e)):Yy(Qy(r.prototype),"CoordInSelect",this).call(this,t,e,i,n,o)}},{key:"GetItemAt",value:function(t,e,i,n,o,s){var a=Yy(Qy(r.prototype),"GetItemAt",this).call(this,t,e,i,n,o,s);return this.FCellSelectedAll&&(a.restrain=!this.PointInCellRect(G.Create(t,e))),a}},{key:"GetRootData",value:function(){return null!=this.FOnGetRootData?this.FOnGetRootData():Yy(Qy(r.prototype),"GetRootData",this).call(this)}},{key:"SelectFirstItemOffsetBefor",value:function(){return!this.SelectExists()&&0==this.SelectInfo.StartItemNo&&0==this.SelectInfo.StartItemOffset}},{key:"SelectLastItemOffsetAfter",value:function(){return!this.SelectExists()&&this.SelectInfo.StartItemNo==this.Items.count-1&&this.SelectInfo.StartItemOffset==this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)}},{key:"SelectFirstLine",value:function(){return 0==this.GetParaFirstItemNo(this.SelectInfo.StartItemNo)}},{key:"SelectLastLine",value:function(){return this.GetParaLastItemNo(this.SelectInfo.StartItemNo)==this.Items.count-1}},{key:"ClearFormatExtraHeight",value:function(){for(var t=0,e=0,i=1,n=this.DrawItems.count;it&&(t=e),this.DrawItems[i].rect.offset(0,-e),this.Items[this.DrawItems[i].ItemNo].StyleNo=32&&e.keyCode<=126||e.keyCode>=3840&&e.keyCode<=4095||e.keyCode>=6144&&e.keyCode<=6319:e.keyCode>=32&&e.keyCode<=126}},{key:"IsKeyDownWant",value:function(t){return t==Pe||t==Ge||t==Be||t==Me||t==Ee||t==Le||t==be||t==Ne||t==Oe||t==De}},{key:"IsKeyDownEdit",value:function(t){return t==Pe||t==Ge||t==be||t==De}},{key:"IsDirectionKey",value:function(t){return t==Be||t==Ee||t==Me||t==Le}},{key:"PosCharHC",value:function(t,e){for(var i=0,n=1;n<=e.length;n++)if(t==e[n-1])return i=n;return i}},{key:"IsUnPlaceHolderChar",value:function(e){return t.UnPlaceholderChar.indexOf(e)>=0}},{key:"GetTextActualOffset",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=i,r=e.length;if(n)for(;o=0;)o++;else for(;o>1&&t.UnPlaceholderChar.indexOf(e[o-1])>=0;)o--;return o}},{key:"GetCharHalfFarfromUN",value:function(e,i,n){var o=t.GetTextActualOffset(e,i,!0),r=t.GetTextActualOffset(e,i)-1;return r>0?o==r?r>1?n[r-2]+Math.trunc((n[o-1]-n[r-2])/2):Math.trunc(n[r-1]/2):n[r-1]+Math.trunc((n[o-1]-n[r-1])/2):Math.trunc(n[o-1]/2)}},{key:"GetCharHalfFarfrom",value:function(t,e){var i=0;return t>1?i=e[t-2]+Math.trunc((e[t-1]-e[t-2])/2):1==t&&(i=Math.trunc(e[t-1]/2)),i}},{key:"GetNorAlignCharOffsetAt",value:function(e,i,n){var o;if(n<0)o=0;else{var r=i.length,s=e.getTextExtentExPoint(i,r);if(0==s.length||n>s[s.length-1])o=r;else for(var a=1;a<=r;){if(t.UNPLACEHOLDERCHAR&&(a=t.GetTextActualOffset(i,a,!0)),n==s[a-1]){o=a;break}if(!(n>s[a-1])){o=t.UNPLACEHOLDERCHAR&&n>t.GetCharHalfFarfromUN(i,a,s)||!t.UNPLACEHOLDERCHAR&&t.GetCharHalfFarfrom(a,s)?a:t.UNPLACEHOLDERCHAR?t.GetTextActualOffset(i,a)-1:a-1;break}a++}}return o}},{key:"GetPaperSizeInfo",value:function(e){var i;switch(e){case kp.A3:i='{"Name":"A3", "Width":297, "Height":420}';break;case kp.A4:i='{"Name":"A4", "Width":210, "Height":297}';break;case kp.A5:i='{"Name":"A5", "Width":148, "Height":210}';break;case kp.B5:i='{"Name":"B5", "Width":182, "Height":257}';break;case t.DMPAPER_HC_16K:i='{"Name":"16K", "Width":195, "Height":271}';break;default:i='{"Name":"自定义", "Width":210, "Height":297}'}return JSON.parse(i)}},{key:"GetPaperSizeName",value:function(e){return t.GetPaperSizeInfo(e).Name}},{key:"GetPaperSizeByName",value:function(e){switch(e){case"A3":return kp.A3;case"A4":return kp.A4;case"A5":return kp.A5;case"B5":return kp.B5;case"16K":return t.DMPAPER_HC_16K;default:return kp.Custom}}},{key:"GetVersionAsInteger",value:function(t){return t.replace(/[^0-9]/gi,"")}},{key:"HCSaveTextToStream",value:function(e,i){var n=A.getBytes(i),o=n.length;o>O.max&&or.exception(t.HCS_EXCEPTION_TEXTOVER),e.writeUInt16(o),o>0&&e.writeBuffer(n)}},{key:"HCLoadTextFromStream",value:function(t,e){var i=t.readUInt16();if(i>0){var n=t.readBuffer(i);return A.getString(n)}return""}},{key:"GetPropertyString",value:function(e){for(var i,n="",o=0;o=0?or.exception("HCSetProperty属性值中不允许有=号"):""!=i?t.setValue(e,i):t.remove(e))}},{key:"HCRemoveProperty",value:function(t,e){t.remove(e)}},{key:"_SaveFileFormatAndVersion",value:function(e){var i=A.getBytes(t.HC_EXT);e.writeBuffer(i),i=A.getBytes(t.HC_FileVersion),e.writeBuffer(i),e.writeByte(t.HC_PROGRAMLANGUAGE)}},{key:"_LoadFileFormatAndVersion",value:function(e){var i=e.readBuffer(A.getByteCount(this.HC_EXT)),n=A.getString(i,0,i.length);i=e.readBuffer(A.getByteCount(this.HC_FileVersion));var o=A.getString(i,0,i.length),r=t.GetVersionAsInteger(o),s=0;return r>19&&(s=e.readByte()),{fileExt:n,fileVersion:r,lang:s}}},{key:"HCSaveColorToStream",value:function(t,e){var i=at.colorToRGBA(e);t.writeByte(i.a),t.writeByte(i.r),t.writeByte(i.g),t.writeByte(i.b)}},{key:"HCLoadColorFromStream",value:function(t){var e=t.readByte();return"rgba("+t.readByte()+", "+t.readByte()+", "+t.readByte()+", "+e+")"}},{key:"HCRGBStringToColor",value:function(e){var i=e.split(",");return i.length>3?"0"==i[0]?t.HCTransparentColor:at.rgbaToColor(i[1],i[2],i[3]):at.rgbaToColor(i[0],i[1],i[2])}},{key:"HCColorToRGBString",value:function(e){if(e==t.HCTransparentColor)return"0,255,255,255";var i=at.colorToRGBA(e);return C.stringFormat("255,{0},{1},{2}",i.r,i.g,i.b)}},{key:"HCSaveImageToStream",value:function(t,e){if(e&&""!=e.src){var i=e.src.split(","),n=b.fromBase64(i[1]);t.writeUInt32(n.length),n.length>0&&t.writeBuffer(n)}else t.writeUInt32(0)}},{key:"HCLoadImageFromStream",value:function(t){var e=null,i=t.readUInt32();if(i>0){var n=t.readBuffer(i);(e=new $i).src="data:image/png;base64,"+b.fromBuffer(n).toBase64()}return e}},{key:"GetXmlRN",value:function(t){return t.replace("\n","\r\n")}},{key:"SetBorderSideByPro",value:function(t,e){}},{key:"GetBorderSidePro",value:function(t){}},{key:"GraphicToBase64",value:function(t,e){}},{key:"Base64ToGraphic",value:function(t){}},{key:"HCDeleteBreak",value:function(t){return t.replace(new RegExp(this.sLineBreak,"g"),"")}},{key:"GetUnicodeCharType",value:function(t){var e=t.charCodeAt(0);return e>=11904&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||12295==e||e>=12549&&e<=12591||e>=12704&&e<=12730||e>=12736&&e<=12771||e>=13312&&e<=19893||e>=19968&&e<=40869||e>=40870&&e<=40943||e>=58368&&e<=58856||e>=58880&&e<=59087||e>=59413&&e<=59503||e>=63744&&e<=64217||e>=131072&&e<=173782||e>=173824&&e<=177972||e>=177984&&e<=178205||e>=178208&&e<=183969||e>=183984&&e<=191456||e>=194560&&e<=195101?gp.HZ:e>=3840&&e<=3850||e>=3854&&e<=4095?gp.ZW:e>=3851&&e<=3853?gp.Break:e>=6144&&e<=6319?gp.HZ:e>=33&&e<=47||e>=58&&e<=64||e>=91&&e<=96||e>=123&&e<=126||65504==e?gp.FH:e>=48&&e<=57?gp.SZ:e>=65&&e<=90||e>=97&&e<=122?gp.ZM:gp.Break}},{key:"ReplaceUnPreChar",value:function(t){return t.replace(/\u2002/g," ").replace(/\u0009/g,"")}},{key:"HCDrawArrow",value:function(t,e,i,n,o){switch(o){case 0:t.pen.color=e,t.beginPath();try{t.moveTo(i,n),t.lineTo(i+1,n),t.moveTo(i-1,n+1),t.lineTo(i+2,n+1),t.moveTo(i-2,n+2),t.lineTo(i+3,n+2),t.moveTo(i-3,n+3),t.lineTo(i+4,n+3),t.moveTo(i-4,n+4),t.lineTo(i+5,n+4)}finally{t.paintPath()}break;case 1:t.pen.color=e,t.beginPath();try{t.moveTo(i,n),t.lineTo(i+1,n),t.moveTo(i-1,n-1),t.lineTo(i+2,n-1),t.moveTo(i-2,n-2),t.lineTo(i+3,n-2),t.moveTo(i-3,n-3),t.lineTo(i+4,n-3),t.moveTo(i-4,n-4),t.lineTo(i+5,n-4)}finally{t.paintPath()}}}},{key:"HCDrawWave",value:function(t,e){var i=!1,n=e.left;for(t.beginPath(),t.moveTo(n,e.bottom);ne.right&&(n=e.right),i?t.lineTo(n,e.bottom):t.lineTo(n,e.bottom+2),i=!i;t.paintPath()}}]),t}();lp.TableCellData=$y,lp.AnnotationWidth=200,lp.HCExtFormat=0,lp.OffsetBefor=0,lp.OffsetInner=1,lp.OffsetAfter=2,lp.MinRowHeight=20,lp.MinColWidth=20,lp.clActiveBorder="rgb(180, 180, 180)",lp.clBtnFace="rgb(240, 240, 240)",lp.clMedGray="rgb(160, 160, 164)",lp.clMenu="rgb(240, 240, 240)",lp.clWindow="rgb(255, 255, 255)",lp.clHighlight="rgb(51, 153, 255)",lp.clInfoBk="rgb(255, 255, 225)",lp.AnnotateBKColor="rgb(255, 213, 213)",lp.AnnotateBKActiveColor="rgb(255, 168, 168)",lp.HyperTextColor="rgb(5, 99, 193)",lp.HCTransparentColor="rgba(255, 255, 255, 0)",lp.HC_TEXTMAXSIZE=4294967295,lp.GCursor=oe,lp.HC_PROGRAMLANGUAGE=4,lp.TabCharWidth=28,lp.DefaultColWidth=50,lp.PMSLineHeight=24,lp.AnnotationWidth=200,lp.DMPAPER_HC_16K=-1e3,lp.ROMANUMBER=["Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ"],lp.CIRCLENUMBER=["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳"],lp.HC_EXCEPTION="HC异常:",lp.HCS_EXCEPTION_NULLTEXT=lp.HC_EXCEPTION+"文本Item的内容出现为空的情况!",lp.HCS_EXCEPTION_TEXTOVER=lp.HC_EXCEPTION+"TextItem的内容超出允许的最大字节数4294967295!",lp.HCS_EXCEPTION_MEMORYLESS=lp.HC_EXCEPTION+"复制时没有申请到足够的内存",lp.HCS_EXCEPTION_VOIDSOURCECELL=lp.HC_EXCEPTION+"源单元格无法再获取源单元格!",lp.HCS_EXCEPTION_TIMERRESOURCEOUTOF=lp.HC_EXCEPTION+"安装计时器的资源不足!",lp.CHECKNULLITEM=!0,lp.PROCSERIES=!0,lp.USESCRIPT=!1,lp.UNPLACEHOLDERCHAR=!0,lp.USESAVEITEMEVENT=!1,lp.RESETTABLEUSEFIRSTROWHEIGHT=!0,lp.TibetanVowel="ེོིུ",lp.TibetanOther="ྸཾ༷༵ྃཿྷྺྕྖཻླྲྟྱྭྀཽྥྩྪྫྰྶྡྦྔྨ྄ྒྒྮྯྴྐྑྤྣྠྗྙྼྻཱ༙༾༿྇྆ྲྀཷླྀཹཱིྚཱཱིུྜ࿆ྵྐྵྂྞྛ",lp.UnPlaceholderChar=lp.TibetanVowel+lp.TibetanOther,lp.DontLineFirstChar='`-=[]\\;,./~!@#$%^&*()_+{}|:""<>?·-=【】\;’,。、~!@#¥%……&×()——+{}|:”《》?°་༌།'+lp.UnPlaceholderChar,lp.DontLineLastChar="/\\\“‘",lp.LineSqueezeChar=",。;、?“”",lp.sLineBreak="\r\n",lp.HC_EXT=".hcf",lp.HC_EXT_DOCX=".docx",lp.HC_FileVersion="5.7",lp.HC_FileVersionInt=57,lp.HCExtFormat=0;var hp=0,cp=1,up={None:0,Left:1,Top:2,Right:3,Bottom:4},fp={Left:1,Top:2,Right:4,Bottom:8,LTRB:16,RTLB:32},dp={Header:1,Page:2,Footer:4},mp={None:0,Prev:1},yp={TopLeft:0,TopCenter:1,TopRight:2,CenterLeft:3,CenterCenter:4,CenterRight:5,BottomLeft:6,BottomCenter:7,BottomRight:8},pp=0,Sp=1,vp=2,Fp=3,Ip={Loading:0,Saving:1,Cutting:2,Copying:3,Pasting:4,DomainWholeReplace:5,Undoing:6,Redoing:7,InsertBreakItem:8,BatchInsert:9,Destroying:10,FormatBrushing:11},gp={Break:0,HZ:1,ZM:2,SZ:3,FH:4,ZW:5},wp={BackDeleteText:0,DeleteText:1,InsertText:2,ReturnItem:3,SetItemText:4,DeleteItem:5,InsertItem:6,ItemProperty:7,ItemSelf:8,ItemMirror:9,ConcatText:10,DeleteSelected:11},Cp={Symbol:0,OrderCustom:1,OrderRoman:2,OrderCustomCircle:3},kp={Custom:0,Letter:1,LetterSmall:2,Tabloid:3,Ledger:4,Legal:5,Statement:6,Executive:7,A3:8,A4:9,A4Small:10,A5:11,B4:12,B5:13,Folio:14,Quarto:15,Standard10x14:16,Standard11x17:17,Note:18,Number9Envelope:19,Number10Envelope:20,Number11Envelope:21,Number12Envelope:22,Number14Envelope:23,CSheet:24,DSheet:25,ESheet:26,DLEnvelope:27,C5Envelope:28,C3Envelope:29,C4Envelope:30,C6Envelope:31,C65Envelope:32,B4Envelope:33,B5Envelope:34,B6Envelope:35,ItalyEnvelope:36,MonarchEnvelope:37,PersonalEnvelope:38,USStandardFanfold:39,GermanStandardFanfold:40,GermanLegalFanfold:41,JapanesePostcard:43,Standard9x11:44,Standard10x11:45,Standard15x11:46,InviteEnvelope:47,LetterExtra:50,LegalExtra:51,TabloidExtra:52,A4Extra:53,LetterTransverse:54,A4Transverse:55,LetterExtraTransverse:56,APlus:57,BPlus:58,LetterPlus:59,A4Plus:60,A5Transverse:61,B5Transverse:62,A3Extra:63,A5Extra:64,B5Extra:65,A2:66,A3Transverse:67,A3ExtraTransverse:68,JapaneseDoublePostcard:69,A6:70,JapaneseEnvelopeKakuNumber2:71,JapaneseEnvelopeKakuNumber3:72,JapaneseEnvelopeChouNumber3:73,JapaneseEnvelopeChouNumber4:74,LetterRotated:75,A3Rotated:76,A4Rotated:77,A5Rotated:78,B4JisRotated:79,B5JisRotated:80,JapanesePostcardRotated:81,JapaneseDoublePostcardRotated:82,A6Rotated:83,JapaneseEnvelopeKakuNumber2Rotated:84,JapaneseEnvelopeKakuNumber3Rotated:85,JapaneseEnvelopeChouNumber3Rotated:86,JapaneseEnvelopeChouNumber4Rotated:87,B6Jis:88,B6JisRotated:89,Standard12x11:90,JapaneseEnvelopeYouNumber4:91,JapaneseEnvelopeYouNumber4Rotated:92,Prc16K:93,Prc32K:94,Prc32KBig:95,PrcEnvelopeNumber1:96,PrcEnvelopeNumber2:97,PrcEnvelopeNumber3:98,PrcEnvelopeNumber4:99,PrcEnvelopeNumber5:100,PrcEnvelopeNumber6:101,PrcEnvelopeNumber7:102,PrcEnvelopeNumber8:103,PrcEnvelopeNumber9:104,PrcEnvelopeNumber10:105,Prc16KRotated:106,Prc32KRotated:107,Prc32KBigRotated:108,PrcEnvelopeNumber1Rotated:109,PrcEnvelopeNumber2Rotated:110,PrcEnvelopeNumber3Rotated:111,PrcEnvelopeNumber4Rotated:112,PrcEnvelopeNumber5Rotated:113,PrcEnvelopeNumber6Rotated:114,PrcEnvelopeNumber7Rotated:115,PrcEnvelopeNumber8Rotated:116,PrcEnvelopeNumber9Rotated:117,PrcEnvelopeNumber10Rotated:118},Pp={Beg:0,End:1},Dp=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ep(t,e)}(i,t);var e=ip(i);function i(){return rp(this,i),e.call(this)}return i}(M),bp=function t(){rp(this,t),this.X=0,this.Y=0,this.Height=20,this.PageIndex=0,this.Visible=!1},Rp=function(){function t(e){rp(this,t),this.FReCreate=!1,this.FDisFocus=!1,this.VScroll=!1,this.HScroll=!1,this.control=e,this.FWidth=0,this.FHeight=0,this.FX=0,this.FY=0,this.Visible=!1}return ap(t,[{key:"setX_",value:function(t){this.FX!=t&&(this.FX=t,this.Show())}},{key:"setY_",value:function(t){this.FY!=t&&(this.FY=t,this.Show())}},{key:"setHeight_",value:function(t){this.FHeight!=t&&(this.FHeight=t,this.FReCreate=!0)}},{key:"setWidth_",value:function(t){this.FWidth!=t&&(this.FWidth=t,this.FReCreate=!0)}},{key:"ReCreate",value:function(){or.application.destroyCaret(this.control),or.application.createCaret(this.control,null,this.FWidth,this.FHeight)}},{key:"ShowAt",value:function(t,e){this.FDisFocus=!1,this.FReCreate&&this.ReCreate(),this.Visible=!0,or.ime.updatePosition(t,e),or.application.setCaretPos(t,e),or.application.showCaret(this.control)}},{key:"Show",value:function(){this.ShowAt(this.FX,this.FY)}},{key:"Hide",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.FDisFocus=t,this.Visible=!1,or.application.hideCaret(this.control)}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.setHeight_(t)}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.setWidth_(t)}},{key:"X",get:function(){return this.FX},set:function(t){this.setX_(t)}},{key:"Y",get:function(){return this.FY},set:function(t){this.setY_(t)}},{key:"DisFocus",get:function(){return this.FDisFocus}}]),t}();function _p(t){return(_p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xp(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"";return rS(this,i),(t=e.call(this,n)).FEditProtect=!1,t.FDeleteAllow=!0,t.FAllocOnly=!1,t.FCopyProtect=!1,t.FAllocValue=!1,t.FOutOfRang=!1,t.FMouseIn=!1,t.FTraceStyles=new M,t.FPropertys=new z,t}return $p(i,[{key:"HasProp",value:function(t){return this.FPropertys.hasKey(t)}},{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){e=e.toString(),"Text"==t||("EditProtect"==t?this.FEditProtect=or.system.parseBooleanDef(e,this.FEditProtect):"DeleteAllow"==t?this.FDeleteAllow=or.system.parseBooleanDef(e,this.FDeleteAllow):"CopyProtect"==t?this.FCopyProtect=or.system.parseBooleanDef(e,this.FCopyProtect):"AllocValue"==t?this.FAllocValue=or.system.parseBooleanDef(e,this.FAllocValue):lp.HCSetProperty(this.FPropertys,t,e))}},{key:"GetIsElement",value:function(){return null!=this.FPropertys.valueByKey(aS)}},{key:"SetText",value:function(t){""!=t?Zp(oS(i.prototype),"SetText",this).call(this,t):this.IsElement?this.Text=this.FPropertys.valueByKey(hS):Zp(oS(i.prototype),"SetText",this).call(this,"")}},{key:"MouseEnter",value:function(){Zp(oS(i.prototype),"MouseEnter",this).call(this),this.FMouseIn=!0}},{key:"MouseLeave",value:function(){Zp(oS(i.prototype),"MouseLeave",this).call(this),this.FMouseIn=!1}},{key:"SetActive",value:function(t){t||(this.FMouseIn=!1),Zp(oS(i.prototype),"SetActive",this).call(this,t)}},{key:"TextEffective",value:function(){return this.FTraceStyles.has(sS.Del)?"":Zp(oS(i.prototype),"TextEffective",this).call(this)}},{key:"SubStringEffective",value:function(t,e){return this.FTraceStyles.has(sS.Del)?"":Zp(oS(i.prototype),"SubStringEffective",this).call(this,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FTraceStyles.value=t.TraceStyles.value,this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow,this.FCopyProtect=t.CopyProtect,this.FAllocValue=t.AllocValue,this.FOutOfRang=t.OutOfRang;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"CanConcatItems",value:function(t){var e=Zp(oS(i.prototype),"CanConcatItems",this).call(this,t);return e&&(e=this.GetValue(aS)==t.GetValue(aS)&&this.FTraceStyles.value==t.TraceStyles.value&&this.FEditProtect==t.FEditProtect&&this.FDeleteAllow==t.DeleteAllow&&this.FCopyProtect==t.CopyProtect&&this.GetValue(SS)==t.GetValue(SS)&&this.GetValue(vS)==t.GetValue(vS)&&this.GetValue(FS)==t.GetValue(FS)&&this.GetValue(IS)==t.GetValue(IS)),e}},{key:"GetHint",value:function(){if(0==this.FTraceStyles.value)return this.GetValue(hS);var t=this.GetValue(vS),e=this.GetValue(SS);return""!=t?""!=e?t+"\r\n"+e:t:e}},{key:"DeleteProperty",value:function(t){lp.HCRemoveProperty(this.FPropertys,t)}},{key:"AcceptAction",value:function(t,e,n){var o=Zp(oS(i.prototype),"AcceptAction",this).call(this,t,e,n);if(o)switch(n){case wp.InsertText:(this.FEditProtect||this.FAllocOnly)&&(o=0==t||t==this.Length);break;case wp.ConcatText:(this.FEditProtect||this.IsElement)&&(o=!1);break;case wp.BackDeleteText:(this.FEditProtect||this.FAllocOnly)&&(o=0==t);break;case wp.DeleteText:(this.FEditProtect||this.FAllocOnly)&&(o=t==this.Length)}return o}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FOutOfRang&&(o|=64),this.FCopyProtect&&(o|=32),this.FAllocValue&&(o|=16),this.FDeleteAllow&&(o|=8),this.FAllocOnly&&(o|=4),t.writeByte(o),or.emrCommon.G_SaveTrace?t.writeByte(this.FTraceStyles.value):t.writeByte(0),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FOutOfRang=or.system.isOdd(o>>6),this.FCopyProtect=or.system.isOdd(o>>5),this.FAllocValue=or.system.isOdd(o>>4),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>3),this.FAllocOnly=or.system.isOdd(o>>2),o=t.readByte(),this.FTraceStyles.value=n>46?o:0==o?0:1==o?sS.Del:sS.Add;var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys),n<=46&&""!=this.GetValue(pS)&&(0==o||(1==o?this.SetValue(SS,this.GetValue(pS)):this.SetValue(vS,this.GetValue(pS))),this.SetValue(pS,""))}},{key:"ToHtml",value:function(){if(or.emrCommon.ToHtmlUseTrace){var t="",e='"+this.Text+""}return this.FTraceStyles.has(sS.Del)?"":Zp(oS(i.prototype),"ToHtml",this).call(this)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t),this.FEditProtect&&t.SetAttribute("editprotect","1"),this.FOutOfRang&&t.SetAttribute("outofrang","1"),this.FCopyProtect&&t.SetAttribute("copyprotect","1"),this.FAllocValue&&t.SetAttribute("allocvalue","1"),this.FDeleteAllow&&t.SetAttribute("deleteallow","1"),this.FAllocOnly&&t.SetAttribute("alloconly","1"),t.SetAttribute("tracestyles",this.FTraceStyles.value.toString());var e=lp.GetPropertyString(this.FPropertys);""!=e&&t.SetAttribute("property",e)}},{key:"ParseXml",value:function(t){if(Zp(oS(i.prototype),"ParseXml",this).call(this,t),this.FEditProtect="1"==t.GetAttribute("editprotect"),t.HasAttribute("deleteallow")?this.FDeleteAllow="1"==t.GetAttribute("deleteallow"):this.FDeleteAllow=!0,t.HasAttribute("alloconly")?this.FAllocOnly="1"==t.GetAttribute("alloconly"):this.FAllocOnly=!1,t.HasAttribute("property")){var e=lp.GetXmlRN(t.GetAttribute("property"));lp.SetPropertyString(e,this.FPropertys)}}},{key:"ToJSONString",value:function(){for(var t,e="",n=0;n1&&null!=(o=t.substr(n+1,t.length-n-1))&&""!=o&&(i=parseInt(o))),{low:e,hi:i}}}]),i}(function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FSyntaxs=null,n}return $p(i,[{key:"SyntaxAdd",value:function(t,e,i){var n=new BS;n.Offset=t,n.Length=e,n.Problem=i,null==this.FSyntaxs&&(this.FSyntaxs=new V),this.FSyntaxs.add(n)}},{key:"SyntaxClear",value:function(){null!=this.FSyntaxs&&this.FSyntaxs.clear()}},{key:"SyntaxCount",value:function(){return null!=this.FSyntaxs?this.FSyntaxs.count:0}},{key:"Syntaxs",get:function(){return this.FSyntaxs}}]),i}(Hl)),MS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoCreateCell",value:function(t){return new LS(t)}},{key:"SaveToStream",value:function(t){Zp(oS(i.prototype),"SaveToStream",this).call(this,t),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e){if(Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e),e>53){var n=lp.HCLoadTextFromStream(t,e);lp.SetPropertyString(n,this.FPropertys)}}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"Propertys",get:function(){return this.FPropertys}}]),i}(Uh),LS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"SetEditProtect",value:function(t){this.FEditProtect=t,null!=this.CellData&&(this.CellData.ReadOnly=this.FEditProtect)}},{key:"SaveToStream",value:function(t){Zp(oS(i.prototype),"SaveToStream",this).call(this,t);var e=0;this.FEditProtect&&(e|=128),t.writeByte(e),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){if(Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n),n>53){if(n>56){var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7)}var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.SetEditProtect(t)}}]),i}(Nh),GS=function(t){tS(i,t);var e=iS(i);function i(t,n,o,r){var s;return rS(this,i),(s=e.call(this,t,n,o,r)).FDrawRect=new U,s.FEditProtect=!1,s.FDeleteAllow=!0,s.FPropertys=new z,s.FAutoLineCol=-1,s.FPaintCellCol=-1,s.FAutoFillPage=!1,s.FLightEditRow=!1,s.FLightEditCol=!1,s}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"CellChangeByAction",value:function(t,e,n){Zp(oS(i.prototype),"CellChangeByAction",this).call(this,t,e,n)}},{key:"DoCreateRow",value:function(t,e){return new MS(t,e)}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){this.FDrawRect.resetRect(e),Zp(oS(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l)}},{key:"DoCellPaintDataBefor",value:function(t,e,i,n,o){this.FPaintCellCol=e}},{key:"DoCellDataDrawItemPaintAfter",value:function(t,e,n,o,r,s,a,l,h,c,u,f){Zp(oS(i.prototype),"DoCellDataDrawItemPaintAfter",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f),this.FPaintCellCol==this.FAutoLineCol&&n=0&&(e=this.FixRow+this.FixRowCount);for(var n=this.RowCount-1;n>=e&&!i;n--)for(var o=this.Rows[n].ColCount,r=0;r=0&&tt;a--)this.Rows.delete(a)}}}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys),this.PropertyChange()}},{key:"CheckPageSurplus",value:function(t){if(this.FAutoFillPage){var e=Math.floor(t/(this.DefaultRowHeight+this.BorderWidthPix));return e>0?(this.AppendRowDynamic(e),e*(this.DefaultRowHeight+this.BorderWidthPix)):0}return Zp(oS(i.prototype),"CheckPageSurplus",this).call(this,t)}},{key:"Change",value:function(){this.DoChange()}},{key:"PropertyChange",value:function(){var t=this.GetValue(i.AutoLineColProp);this.FAutoLineCol=""!=t?parseInt(t):-1,t=this.GetValue(i.AutoFillPageProp),this.FAutoFillPage="1"==t,t=this.GetValue(i.LightEditRowProp),this.FLightEditRow="1"==t,t=this.GetValue(i.LightEditColProp),this.FLightEditCol="1"==t}},{key:"SetRowReadOnly",value:function(t,e){for(var i=this.Rows[t].ColCount,n=0;n>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys),this.PropertyChange()}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"AutoLineCol",get:function(){return this.FAutoLineCol}},{key:"AutoFillPage",get:function(){return this.FAutoFillPage}},{key:"LightEditRow",get:function(){return this.FLightEditRow}},{key:"LightEditCol",get:function(){return this.FLightEditCol}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(ic);GS.AutoLineColProp="AutoLineCol",GS.AutoFillPageProp="AutoFillPage",GS.LightEditRowProp="LightEditRow",GS.LightEditColProp="LightEditCol";var HS=function(t){tS(i,t);var e=iS(i);function i(t,n,o){var r;return rS(this,i),(r=e.call(this,t,n,o)).FDeleteAllow=!0,r.FEditProtect=!1,r.FPropertys=new z,r}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoSetChecked",value:function(t){this.EditProtect||Zp(oS(i.prototype),"DoSetChecked",this).call(this,t)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Lu),US=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(cm),VS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"KeyDown",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyPress",this).call(this,t)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"InsertText",value:function(t){return!this.FEditProtect&&Zp(oS(i.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}($u),WS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o.SaveItem=!1,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"KeyDown",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyPress",this).call(this,t)}},{key:"DoPopup",value:function(){this.FEditProtect||Zp(oS(i.prototype),"DoPopup",this).call(this)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"InsertText",value:function(t){return!this.FEditProtect&&Zp(oS(i.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(hf),zS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoPopup",value:function(){this.FEditProtect||Zp(oS(i.prototype),"DoPopup",this).call(this)}},{key:"KeyDown",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyPress",this).call(this,t)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"InsertText",value:function(t){return!this.FEditProtect&&Zp(oS(i.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Bd),jS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoSetItemChecked",value:function(t,e){this.FEditProtect||Zp(oS(i.prototype),"DoSetItemChecked",this).call(this,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Yd),XS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Xm),KS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(ty),YS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){Zp(oS(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),this.Empty&&this.Active&&!l.Print&&(a.font.size=12,a.font.styles.add(ht.Italic),a.textOut(e.left+2,e.top+2,"DeIndex:"+this.GetValue(aS)))}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){if(Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n),!(n<33)){var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}($c);function JS(t){return(JS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ZS(t,e){for(var i=0;i0&&t.FGridDomain.col>0&&t.btnDomainOKClick()},this.FGridDomain.onKeyDown=function(e){t.doGridDomainKeyDown(e)},this.FGridDomain.onCellPaint=function(e,i,n,o){return t.DomainCellPaint(e,i,n,o)},this.FGridDomain.borderVisible=!1,this.FGridDomain.setColWidth(0,0),null!=or.emrCommon.domainPopupGridItemColWidth?this.FGridDomain.setColWidth(1,or.emrCommon.domainPopupGridItemColWidth):this.FGridDomain.setColWidth(1,110),this.FGridDomain.setColWidth(2,35),this.FGridDomain.setColWidth(3,25),this.FGridDomain.setColWidth(4,30),this.FGridDomain.setColWidth(5,30),this.FGridDomain.transparent=!0,this.FGridDomain.align=Kt,this.FPageDomain.addControl(this.FGridDomain),this.FGridDomain.rows[0][0].value="",this.FGridDomain.rows[0][1].value="值",this.FGridDomain.rows[0][2].value="编码",this.FGridDomain.rows[0][3].value="ID",this.FGridDomain.rows[0][4].value="拼音",this.FGridDomain.rows[0][5].value="扩展",this.FGridDomain.fixRowCount=1,this.FPageDomain.addControl(this.FGridDomain),this.lblWait=new en("正在加载..."),this.lblWait.left=this.FGridDomain.left,this.lblWait.top=this.FGridDomain.top,this.lblWait.width=100,this.FPageDomain.addControl(this.lblWait)}},{key:"_initNumberPage",value:function(){var t=this,e=new en("数值");e.left=5,e.top=10,this.FPageNumber.addControl(e);var i=new en("单位");i.left=5,i.top=35,this.FPageNumber.addControl(i),this.edtValue=new pn,this.edtValue.valueMask=yn,this.edtValue.top=5,this.edtValue.left=e.right+5,this.edtValue.width=60,this.edtValue.onKeyDown=function(e){t.doNumberValueKeyDonw(e)},this.FPageNumber.addControl(this.edtValue),this.cbbUnit=new Cn,this.cbbUnit.left=i.right+5,this.cbbUnit.top=30,this.cbbUnit.width=60,this.FPageNumber.addControl(this.cbbUnit),this.chkHideUnit=new un("隐藏单位"),this.chkHideUnit.top=this.cbbUnit.bottom+5,this.chkHideUnit.left=5,this.FPageNumber.addControl(this.chkHideUnit);var n=new nn("确定");n.left=this.edtValue.right+5,n.top=5,n.onClick=function(){t.doNumberOk()},this.FPageNumber.addControl(n)}},{key:"_initMemoPage",value:function(){var t=this;this.memo=new dn,this.memo.top=5,this.memo.left=5,this.memo.width=190,this.memo.onKeyDown=function(e){t.doMemoValueKeyDown(e)};var e=new nn("确定");e.left=this.memo.left,e.top=this.memo.bottom+5,e.onClick=function(){t.doMemoOK()},this.FPageMemo.addControl(this.memo),this.FPageMemo.addControl(e)}},{key:"_initDateTimePage",value:function(){var t=this;this.dtpDateTime=new Pn(X.Now()),this.dtpDateTime.top=5,this.dtpDateTime.left=5,this.dtpDateTime.width=190,this.FPageDateTime.addControl(this.dtpDateTime);var e=new en("格式:");e.left=this.dtpDateTime.left,e.top=this.dtpDateTime.bottom+8,this.FPageDateTime.addControl(e),this.cbbDTFmt=new Cn("yyyy-MM-dd hh:mm"),this.cbbDTFmt.left=e.right,this.cbbDTFmt.top=this.dtpDateTime.bottom+5,this.cbbDTFmt.width=this.dtpDateTime.width-e.width,this.cbbDTFmt.dropDownWidth=this.dtpDateTime.width,this.cbbDTFmt.addItem("yyyy-MM-dd hh:mm"),this.cbbDTFmt.addItem("yyyy-MM-dd hh:mm:ss"),this.cbbDTFmt.addItem("yyyy年MM月dd日 hh时mm"),this.cbbDTFmt.addItem("yyyy-MM-dd"),this.cbbDTFmt.addItem("yyyy年MM月dd日"),this.cbbDTFmt.static=!0,this.cbbDTFmt.onSelectedIndexChange=function(){t.dtpDateTime.format=t.cbbDTFmt.text,t.dtpDateTime.dateTime=X.CreateByDateTime(t.dtCalc.dateTime)},this.FPageDateTime.addControl(this.cbbDTFmt),this.dtCalc=new kn(X.Now()),this.dtCalc.left=5,this.dtCalc.top=this.cbbDTFmt.bottom+5,this.dtCalc.width=190,this.dtCalc.btnDone.visible_=!1,this.dtCalc.onChange=function(){t.dtpDateTime.dateTime=X.CreateByDateTime(t.dtCalc.dateTime)},this.FPageDateTime.addControl(this.dtCalc);var i=new nn("当前日期时间");i.autoWidth=!0,i.left=35,i.top=this.dtCalc.bottom+5,i.onClick=function(){t.dtpDateTime.dateTime=X.Now(),t.dtCalc.dateTime=X.CreateByDateTime(t.dtpDateTime.dateTime)},this.FPageDateTime.addControl(i);var n=new nn("确定");n.width=56,n.left=i.right+10,n.top=i.top,n.onClick=function(){t.btnDateTimeOkClick()},this.FPageDateTime.addControl(n)}},{key:"_filterDomainItem",value:function(t){var e=this.FDomainItems.cv;if(""==t)for(var i in this.FDomainItems.count=this.FDomainItems.cv.length,e)e[i].visible=!0;else{for(var n=!1,o=0;o255){n=!0;break}var r=0,s=t.toUpperCase();for(var a in e)(n?e[a].value.indexOf(t)>=0:e[a].py.toUpperCase().indexOf(s)>=0)?(e[a].visible=!0,r++):e[a].visible=!1;this.FDomainItems.count=r}this._iniDomainItems()}},{key:"_iniDomainItems",value:function(){var t=this.FDomainItems.cv,e="",i=!0;this.FDeItem.AllocValue&&(e=","+this.FDeItem.GetValue(mS)+","),this.FGridDomain.beginUpdate();try{this.FGridDomain.rowCount=this.FDomainItems.count+1,this.FGridDomain.fixRowCount=1;var n=1;for(var o in t)t[o].visible&&(e.indexOf(","+t[o].code+",")>=0?this.FGridDomain.rows[n][0].value="1":(this.FGridDomain.rows[n][0].value="0",i=!1),this.FGridDomain.rows[n][1].value=t[o].value,this.FGridDomain.rows[n][2].value=t[o].code,this.FGridDomain.rows[n][3].value=t[o].id,this.FGridDomain.rows[n][4].value=t[o].py,this.FGridDomain.rows[n][5].value=t[o].content,n++);if(this.FGridDomain.rows[0][0].value=i?"1":"0",this.FGridDomain.rowCount>13)this.height=300,this._popupShow(this.left,this.top);else{var r=this.pnlDomain.height+this.FGridDomain.contentHeight;this.FGridDomain.HScroll_.visible&&(r+=this.FGridDomain.HScroll_.height),this.height=r1&&(this.FGridDomain.row=1),this.FGridDomain.setFocus()}},{key:"DomainCellPaint",value:function(t,e,i,n){return!(!this.FMultSelect||0!=n||("1"==this.FGridDomain.rows[i][n].value?or.theme.drawFrameControl(t,e,new Set([yi]),Ii):"2"==this.FGridDomain.rows[i][n].value?or.theme.drawFrameControl(t,e,new Set([pi]),Ii):or.theme.drawFrameControl(t,e,new Set([]),Ii),0))}},{key:"doGridDomainClick",value:function(){if(this.FMultSelect&&this.FGridDomain.col<2){this.FGridDomain.beginUpdate();try{var t="0";if(0==this.FGridDomain.row){this.chkItemMutex.state==pi?"0"==this.FGridDomain.rows[0][0].value?t="1":"1"==this.FGridDomain.rows[0][0].value?t="2":"2"==this.FGridDomain.rows[0][0].value&&(t="0"):t="0"==this.FGridDomain.rows[0][0].value?"1":"0",this.FGridDomain.rows[0][0].value=t;for(var e=0,i=this.FGridDomain.rowCount;e=0){var s=this.FGridDomain.row;(t=this.SetDeItemValue(this.FGridDomain.rows[s][1].value))||(this.FDeItem.SetValue(cS,CS),this.FDeItem.SetValue(mS,this.FGridDomain.rows[s][2].value),""!=this.FGridDomain.rows[s][5].value&&this.SetDeItemExtraValue(this.FGridDomain.rows[s][3].value))}else{if(this.DomainNoItemSelectStop)return;t=this._initDEText()}t||(this.visible=!1,this.doItemPopupSetClose())}},{key:"btnDateTimeOkClick",value:function(){""!=this.dtpDateTime.text&&(this.SetDeItemValue(this.dtpDateTime.text)||(this.visible=!1,this.doItemPopupSetClose()))}},{key:"doNumberValueKeyDonw",value:function(t){t.keyCode==be&&this.doNumberOk()}},{key:"doMemoValueKeyDown",value:function(t){t.keyCode==be&&this.doMemoOK()}},{key:"doGridDomainKeyDown",value:function(t){t.keyCode==be?this.btnDomainOKClick():t.keyCode==Te&&(this.FGridDomain.col=0,this.doGridDomainClick())}},{key:"_trunStringPage",value:function(t){this.pageIndex=2,this.width=200,this.height=60,this.memo.text=t,""!=this.memo.text&&this.memo.select(0,this.memo.text.length),this.memo.setFocus()}},{key:"_popupShow",value:function(t,e){t+this.width>this.parent.width&&(t=this.parent.width-this.width),t<0&&(t=0),e+this.height>this.parent.height&&(e=this.parent.height-this.height),e<0&&(e=0),this.left=t,this.top=e,this.visible=!0}},{key:"_showPopupDeItem",value:function(t,e){this.FFrmtp=DS;var i="",n="";if(""!=t){var o=JSON.parse(t);this.FFrmtp=o.Frmtp,i=o.Unit,n=o.CMV}if(this.FFrmtp==PS){if(this.FTemplate=!1,this.FTemp=!1,this.FConCalcValue=!1,""!=this.FDeItem.GetValue(uS)?this.edtValue.text=this.FDeItem.Text.replace(new RegExp(this.FDeItem.GetValue(uS),"g"),""):this.edtValue.text=this.FDeItem.Text,""!=this.edtValue.text&&this.edtValue.selectAll(),this.cbbUnit.items.clear(),i)for(var r=i.split(","),s=0;s0?(this.cbbUnit.itemIndex=this.cbbUnit.items.indexOf(this.FDeItem.GetValue(uS)),this.cbbUnit.itemIndex<0&&(this.cbbUnit.itemIndex=0)):this.cbbUnit.text=this.FDeItem.GetValue(uS),this.chkHideUnit.checked="1"==this.FDeItem.GetValue(fS),this.pageIndex=1,this.width=185,this.height=100}else if(this.FFrmtp==bS||this.FFrmtp==RS||this.FFrmtp==_S){this.pageIndex=3,this.dtpDateTime.dateTime=X.CreateByString(this.FDeItem.Text),this.dtCalc.dateTime=X.CreateByString(this.FDeItem.Text),this.width=200,this.height=275,or.emrCommon.disPopupDateTimeFormat?this.cbbDTFmt.enabled=!1:this.cbbDTFmt.enabled=!0;var a=this.FDeItem.GetValue(yS);""!=a?this.cbbDTFmt.text=a:this.FFrmtp==bS?this.cbbDTFmt.text=or.emrCommon.dateFormatDef:this.FFrmtp==RS?this.cbbDTFmt.text=or.emrCommon.timeFormatDef:this.cbbDTFmt.text=or.emrCommon.dateFormatDef+" "+or.emrCommon.timeFormatDef,this.dtpDateTime.format=this.cbbDTFmt.text}else if(this.FFrmtp==CS||this.FFrmtp==kS){this.beginUpdate();try{this.pageIndex=0,this.width=250,this.height=this.FDomainMinH,this.lblWait.visible_=!0,this.FGridDomain.visible_=!1,this._popupShow(e.x,e.y)}finally{this.endUpdate()}this.beginUpdate();try{if(this.MultSelect=this.FFrmtp==kS,this.edtFilter.clear(),this.FGridDomain.rowCount>1&&(this.FGridDomain.rowCount=1),""!=n){if(null!=this.OnPopupGetDeItemDomainLib){var l=this.OnPopupGetDeItemDomainLib(n);return null!==l&&this.IniDomainUIByJSON(l),!0}this.lblWait.visible_=!1}}finally{this.endUpdate()}}else{if(this.FFrmtp!=DS)return!1;this._trunStringPage(this.FDeItem.Text)}return this._popupShow(e.x,e.y),this.FFrmtp==PS?this.edtValue.setFocus():this.FFrmtp==DS&&this.memo.setFocus(),!0}},{key:"PopupDeItem",value:function(t,e){return this.MultSelect=!1,this.FDeItem=t,this.FFrmtp="",null!=this.OnPopupGetDeItemInfoLib&&this.OnPopupGetDeItemInfoLib(t),this._showPopupDeItem("{"+t.ToJSONString()+"}",e)}},{key:"SetDeItemValue",value:function(t){return null!=this.OnSetPopupItemText&&this.OnSetPopupItemText(this.FDeItem,t)}},{key:"SetDeItemExtraValue",value:function(t){if(null!=this.OnPopupGetDomainItemExtraLib)this.OnPopupGetDomainItemExtraLib(this.FDeItem,t);else if(null!=this.OnSetActiveItemExtra&&(this.FDBDomain.select("id="+t),this.FDBDomain.count>0)){var e=new K;this.FDBDomain[0].fieldByName("content").saveToStream(e),e.position=0,this.OnSetActiveItemExtra(this.FDeItem,e)}}},{key:"_initDEText",value:function(){var t=this.FDeItem.GetValue(hS);this.FDeItem.Propertys.remove(mS);var e=this.SetDeItemValue(t);return this.FDeItem.AllocValue=!1,e}},{key:"SetMultSelect",value:function(t){if(this.FMultSelect!=t){this.beginUpdate();try{this.FMultSelect=t,this.FMultSelect?(this.cbbItemSplit.text=r.MultItemSpliter,this.FGridDomain.setColWidth(0,20),this.pnlDomain.height=54,this.height+=24,this.btnRM.text="单选"):(this.FGridDomain.setColWidth(0,0),this.pnlDomain.height=30,this.height-=24,this.btnRM.text="多选"),this.FGridDomain.setFocus()}finally{this.endUpdate()}}}},{key:"MultSelect",get:function(){return this.FMultSelect},set:function(t){this.SetMultSelect(t)}}])&&ZS(e.prototype,i),n&&ZS(e,n),r}(On);function iv(t){return(iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nv(t,e){for(var i=0;i=0?or.exception("属性值中不允许有=号"):this.FPropertys.setValue(t,e)}},{key:"GetIsProcBegin",value:function(){return this.MarkType==Pp.Beg&&this.FIsProc}},{key:"GetIsProcEnd",value:function(){return this.MarkType==Pp.End&&this.FIsProc}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){if(dv(vv(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),this.MarkType==Pp.Beg){var h=0;""!=this.FTitle&&(this.Selected()||(a.brush.style=Ft),t.TextStyles[this.FTextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),a.textOut(e.left,e.top,this.FTitle),h=a.textMetric(this.FTitle).width),this.Empty&&""!=this.FPrompt&&(this.Selected()||(this.Active?(a.brush.color=t.SelColor,a.fillRect(U.Create(e.left+h,e.top,e.right,e.bottom))):a.brush.style=Ft),t.TextStyles[this.FTextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),a.font.styles.add(ht.Italic),a.font.color=at.Gray,a.textOut(e.left+h,e.top,this.FPrompt))}}},{key:"SaveToStreamRange",value:function(t,e,n){dv(vv(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeInt32(this.FTextStyleNo),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){dv(vv(i.prototype),"LoadFromStream",this).call(this,t,e,n),n>51&&(this.FTextStyleNo=t.readInt32(),this.OwnerData.Style.States.Contain(Ip.Loading)||(this.FTextStyleNo=null!=e?this.OwnerData.Style.GetStyleNo(e.TextStyles[this.FTextStyleNo],!0):0));var o=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(o,this.FPropertys),this.CheckPropertys()}},{key:"Assign",value:function(t){dv(vv(i.prototype),"Assign",this).call(this,t);var e=lp.GetPropertyString(t.Propertys);this.FReadOnly=t.ReadOnly,lp.SetPropertyString(e,this.FPropertys),this.CheckPropertys()}},{key:"MatchTextStyle",value:function(t,e){return e.Append=!e.StyleHasMatch(t,this.FTextStyleNo),!0}},{key:"ApplySelectTextStyle",value:function(t,e){this.FTextStyleNo=e.GetMatchStyleNo(t,this.FTextStyleNo)}},{key:"MarkStyleUsed",value:function(t){t?this.OwnerData.Style.TextStyles[this.FTextStyleNo].CheckSaveUsed=!0:this.FTextStyleNo=this.OwnerData.Style.TextStyles[this.FTextStyleNo].TempNo}},{key:"FormatToDrawItem",value:function(t,e){if(this.Width=0,this.FTextStyleNor?o:r,l+=s>a?s:a,this.Width=l,this.Height=2*n+4*this.FPadding,o>r?(this.FLeftTopRect.resetBounds(this.FPadding,this.FPadding,o,n),this.FLeftBottomRect.resetBounds(this.FPadding,this.Height-this.FPadding-n,o,n)):(this.FLeftTopRect.resetBounds(this.FPadding,this.FPadding,r,n),this.FLeftBottomRect.resetBounds(this.FPadding,this.Height-this.FPadding-n,r,n)),s>a?(this.FRightTopRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.FPadding,s,n),this.FRightBottomRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.Height-this.FPadding-n,s,n)):(this.FRightTopRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.FPadding,a,n),this.FRightBottomRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.Height-this.FPadding-n,a,n)),this.FEmptyLower&&(n=0,""==this.FLeftTopText&&""==this.FRightTopText&&(n=this.FLeftTopRect.height-this.AreaMinSize,this.FLeftTopRect.height=this.AreaMinSize,this.FRightTopRect.height=this.AreaMinSize,this.FLeftBottomRect.offset(0,-n),this.FRightBottomRect.offset(0,-n)),""==this.FLeftBottomText&&""==this.FRightBottomText&&(n=n+this.FLeftBottomRect.height-this.AreaMinSize,this.FLeftBottomRect.height=this.AreaMinSize,this.FRightBottomRect.height=this.AreaMinSize),this.Height=this.Height-n)}},{key:"GetOffsetAt",value:function(t){return this.FOutSelectInto?Dv(xv(r.prototype),"GetOffsetAt",this).call(this,t):t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"MouseLeave",value:function(){Dv(xv(r.prototype),"MouseLeave",this).call(this),this.FMouseMoveArea=Av}},{key:"MouseDown",value:function(t){var e=Dv(xv(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee,this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=-1;switch(this.FActiveArea){case Tv:i=this.FLeftTopText,n=t.x-this.FLeftTopRect.left;break;case Nv:i=this.FLeftBottomText,n=t.x-this.FLeftBottomRect.left;break;case Ov:i=this.FRightTopText,n=t.x-this.FRightTopRect.left;break;case Bv:i=this.FRightBottomText,n=t.x-this.FRightBottomRect.left}var o=0;return this.FActiveArea!=Av?(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)):o=-1,o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){if(this.FMouseLBDowning||t.button!=ee||(this.FOutSelectInto=!0),this.FOutSelectInto)this.FMouseMoveArea=Av;else{var e=this.GetToothArea(t.x,t.y);e!=this.FMouseMoveArea&&(this.FMouseMoveArea=e,this.OwnerData.Style.UpdateInfoRePaint())}return Dv(xv(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FMouseLBDowning=!1,this.FOutSelectInto=!1,Dv(xv(r.prototype),"MouseUp",this).call(this,t)}},{key:"WantKeyDown",value:function(t){var e=!1;return t.keyCode==Be?this.FActiveArea==Tv&&0==this.FCaretOffset?e=!1:this.FActiveArea==Av?(this.FActiveArea=Bv,this.FCaretOffset=this.FRightBottomText.length,e=!0):e=!0:t.keyCode==Me?this.FActiveArea==Bv&&this.FCaretOffset==this.FRightBottomText.length?e=!1:this.FActiveArea==Av?(this.FActiveArea=Tv,this.FCaretOffset=0,e=!0):e=!0:e=!0,e}},{key:"BackDeleteChar",value:function(t){return this.FCaretOffset>0&&(t=C.stringDelete(t,this.FCaretOffset-1,1),this.FCaretOffset--),t}},{key:"BackspaceKeyDown",value:function(){switch(this.FActiveArea){case Tv:this.FLeftTopText=this.BackDeleteChar(this.FLeftTopText);break;case Nv:this.FLeftBottomText=this.BackDeleteChar(this.FLeftBottomText);break;case Ov:this.FRightTopText=this.BackDeleteChar(this.FRightTopText);break;case Bv:this.FRightBottomText=this.BackDeleteChar(this.FRightBottomText)}this.FormatDirty()}},{key:"LeftKeyDown",value:function(){if(this.FCaretOffset>0)this.FCaretOffset--;else if(this.FActiveArea>Tv){var t=this.FActiveArea-1;if(this.FActiveArea!=t){switch(this.FActiveArea=t,this.FActiveArea){case Tv:this.FCaretOffset=this.FLeftTopText.length;break;case Nv:this.FCaretOffset=this.FLeftBottomText.length;break;case Ov:this.FCaretOffset=this.FRightTopText.length;break;case Bv:this.FCaretOffset=this.FRightBottomText.length}this.OwnerData.Style.UpdateInfoRePaint()}}}},{key:"RightKeyDown",value:function(){var t="";switch(this.FActiveArea){case Tv:t=this.FLeftTopText;break;case Nv:t=this.FLeftBottomText;break;case Ov:t=this.FRightTopText;break;case Bv:t=this.FRightBottomText}if(this.FCaretOffset0){var i;t.brush.color="rgb(82, 89, 107)";for(var n=0;nthis.leftBlank_+this.buttonSize&&i.top0)for(var e,i=0;i0){t.brush.color="#52596b",t.fillRect(U.Create(2,this.height-this.rightBlank_+2,this.width-2,this.height-2)),t.pen.color="#aaabb3";var e=Math.trunc((this.width-5)/2),i=this.height-this.rightBlank_+2+this.buttonSize-9;t.beginPath(),t.drawLine(e,i,e+5,i),t.drawLine(e+1,i-1,e+4,i-1),t.drawLine(e+2,i-2,e+3,i-2),i-=3,t.drawLine(e,i,e+5,i),t.drawLine(e+1,i-1,e+4,i-1),t.drawLine(e+2,i-2,e+3,i-2),i=this.height-this.rightBlank_+2+this.buttonSize+2+3,t.drawLine(e,i,e+5,i),t.drawLine(e+1,i+1,e+4,i+1),t.drawLine(e+2,i+2,e+3,i+2),i+=3,t.drawLine(e,i,e+5,i),t.drawLine(e+1,i+1,e+4,i+1),t.drawLine(e+2,i+2,e+3,i+2),t.paintPath()}}},{key:"SetAreaPos",value:function(t,e,i){null==this.FAreaMarks&&(this.FAreaMarks=new V);var n=this._getAreaMarkByTag(t);if(n<0){var o=new jv;o.tag=t,o.position=e,o.height=i,this.FAreaMarks.add(o);var r=this._getAreaMarkRect(this.FAreaMarks.count-1);this.updateRect(r)}else if(this.FAreaMarks[n].position!=e||this.FAreaMarks[n].height!=i){var s=this._getAreaMarkRect(n);this.FAreaMarks[n].position=e,this.FAreaMarks[n].height=i,this.updateRect(s),s=this._getAreaMarkRect(n),this.updateRect(s)}}}])&&Lv(e.prototype,i),n&&Lv(e,n),r}(mi);function Kv(t){return(Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yv(t,e){return(Yv=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Jv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=qv(t);if(e){var o=qv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Zv(this,i)}}function Zv(t,e){return!e||"object"!==Kv(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function qv(t){return(qv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $v(t,e){for(var i=0;i42&&t.readInt64(),lF(dF(i.prototype),"DoLoadFromStream",this).call(this,t,e,n),n>12)for(var o=t.readInt32();o>0;){var r=null,s=cs.Null;s=t.readInt32(),(r=n<28&&s==_c?new Lm(this):this.CreateItemByStyle(s)).LoadFromStream(t,e,n),this.FFloatItems.add(r),o--}}},{key:"UndoAction_FloatItemMirror",value:function(t){}},{key:"DoFloatItemPaintAfter",value:function(t,e,i){if(null!==this.OnFloatItemPaintAfter){e.save();try{this.OnFloatItemPaintAfter(this,t,e,i)}finally{e.restore()}}}},{key:"MouseDownFloatItem",value:function(t){var e=!1;this.FMouseDownIndex=this.GetFloatItemAt(t.x,t.y);var i=this.FFloatItemIndex;if(this.FFloatItemIndex!=this.FMouseDownIndex&&(this.FFloatItemIndex>=0&&(this.FFloatItems[this.FFloatItemIndex].Active=!1),this.FFloatItemIndex=this.FMouseDownIndex,this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()),this.FFloatItemIndex>=0){if(this.ReadOnly)return!0;if(2==t.clicks)return this.FFloatItems[this.FFloatItemIndex].DblClick(t.x-this.FFloatItems[this.FFloatItemIndex].Left,t.y-this.FFloatItems[this.FFloatItemIndex].Top),!0;var n=new ei;n.assign(t),n.x=t.x-this.FFloatItems[this.FFloatItemIndex].Left,n.y=t.y-this.FFloatItems[this.FFloatItemIndex].Top,e=this.FFloatItems[this.FFloatItemIndex].MouseDown(n)}return this.FMouseDownIndex<0&&i<0&&(e=!1),e}},{key:"MouseMoveFloatItem",value:function(t){var e=!1;if(t.button!=ee||or.keyDownStates[Re]){var i=this.GetFloatItemAt(t.x,t.y);if(this.FMouseMoveIndex!=i&&(this.FMouseMoveIndex>=0&&this.FFloatItems[this.FMouseMoveIndex].MouseLeave(),this.FMouseMoveIndex=i,this.FMouseMoveIndex>=0&&this.FFloatItems[this.FMouseMoveIndex].MouseEnter()),i>=0){var n=this.FFloatItems[i],o=new ei;o.assign(t),o.x=t.x-n.Left,o.y=t.y-n.Top,e=n.MouseMove(o)}}else{if(this.ReadOnly)return e;if(this.FMouseDownIndex>=0){var r=this.FFloatItems[this.FMouseDownIndex],s=new ei;s.assign(t),s.x=t.x-r.Left,s.y=t.y-r.Top,(e=r.MouseMove(s))&&this.Style.UpdateInfoRePaint()}}return e}},{key:"MouseUpFloatItem",value:function(t){var e=!1;if(this.FMouseDownIndex>=0){if(this.ReadOnly)return!0;this.Undo_New(),this.UndoAction_FloatItemMirror(this.FMouseDownIndex);var i=this.FFloatItems[this.FMouseDownIndex],n=new ei;n.assign(t),n.x=t.x-i.Left,n.y=t.y-i.Top,(e=i.MouseUp(n))&&this.Style.UpdateInfoRePaint()}return e}},{key:"KeyDownFloatItem",value:function(t){if(this.ReadOnly)return!0;var e=!0;if(this.FFloatItemIndex>=0&&!this.FFloatItems[this.FFloatItemIndex].Lock)switch(t.keyCode){case Pe:case Ge:this.FFloatItems.delete(this.FFloatItemIndex),this.FFloatItemIndex=-1,this.FMouseMoveIndex=-1;break;case Be:this.FFloatItems[this.FFloatItemIndex].Left-=1;break;case Me:this.FFloatItems[this.FFloatItemIndex].Left+=1;break;case Ee:this.FFloatItems[this.FFloatItemIndex].Left-=1;break;case Le:this.FFloatItems[this.FFloatItemIndex].Left+=1;break;default:e=!1}else e=!1;return e&&this.Style.UpdateInfoRePaint(),e}},{key:"Clear",value:function(){this.FFloatItemIndex=-1,this.FMouseDownIndex=-1,this.FMouseMoveIndex=-1,this.FFloatItems.clear(),lF(dF(i.prototype),"Clear",this).call(this)}},{key:"GetCaretInfo",value:function(t,e,n){this.FFloatItemIndex>=0?n.Visible=!1:lF(dF(i.prototype),"GetCaretInfo",this).call(this,t,e,n)}},{key:"GetScreenCoord",value:function(t,e){return null!=this.OnGetScreenCoord?this.OnGetScreenCoord(t,e):new G}},{key:"TraverseFloatItem",value:function(t){if(null!=t)for(var e=0;e=0){var e=new FontSizeStyleMatch;e.FontSize=t,this.FFloatItems[this.FFloatItemIndex].ApplySelectTextStyle(this.Style,e)}else lF(dF(i.prototype),"ApplyTextFontSize",this).call(this,t)}},{key:"PaintFloatItems",value:function(t,e,i,n,o,r){for(var s=null,a=0;a<=this.FFloatItems.count-1;a++)(s=this.FFloatItems[a]).DrawRect.resetBounds(s.Left,s.Top,s.Width,s.Height),s.DrawRect.offset(e,i-n),s.PaintTo(this.Style,s.DrawRect,i,0,0,0,o,r),this.DoFloatItemPaintAfter(s,o,r)}},{key:"FloatItemIndex",get:function(){return this.FFloatItemIndex}},{key:"ActiveFloatItem",get:function(){return this.GetActiveFloatItem()}},{key:"FloatItems",get:function(){return this.FFloatItems}}]),i}(jy),yF=function(t){hF(i,t);var e=uF(i);function i(t){return rF(this,i),e.call(this,t)}return i}(mF),pF=function(t){hF(i,t);var e=uF(i);function i(t){return rF(this,i),e.call(this,t)}return i}(mF),SF=function(t){hF(i,t);var e=uF(i);function i(t){var n;return rF(this,i),(n=e.call(this,t)).FShowLineActiveMark=!1,n.FShowUnderLine=!1,n.FShowLineNo=!1,n}return aF(i,[{key:"DoDrawItemPaintAfter",value:function(t,e,n,o,r,s,a,l,h,c,u,f){lF(dF(i.prototype),"DoDrawItemPaintAfter",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f),this.FShowUnderLine&&t.IsLineLastDrawItem(n)&&(u.pen.color="black",u.drawLineDriect(s,o.top,s+this.Width,o.top),u.drawLineDriect(s,o.bottom,s+this.Width,o.bottom))}},{key:"DoDrawItemPaintBefor",value:function(t,e,n,o,r,s,a,l,h,c,u,f){if(lF(dF(i.prototype),"DoDrawItemPaintBefor",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f),!f.Print){if(this.FShowLineActiveMark&&n==this.GetSelectStartDrawItemNo()){u.pen.color="blue";var d=o.top+Math.trunc(this.DrawItems[n].height/2);u.beginPath();try{u.moveTo(s-10,d),u.lineTo(s-11,d),u.moveTo(s-11,d-1),u.lineTo(s-11,d+2),u.moveTo(s-12,d-2),u.lineTo(s-12,d+3),u.moveTo(s-13,d-3),u.lineTo(s-13,d+4),u.moveTo(s-14,d-4),u.lineTo(s-14,d+5),u.moveTo(s-15,d-2),u.lineTo(s-15,d+3),u.moveTo(s-16,d-2),u.lineTo(s-16,d+3)}finally{u.paintPath()}}if(this.FShowLineNo&&this.DrawItems[n].LineFirst){for(var m=0,y=0;y<=n;y++)this.DrawItems[y].LineFirst&&m++;u.font.size=10,u.font.name="Courier New",u.font.color="rgb(180, 180, 180)",u.textOut(s-50,o.top+Math.trunc((o.height-16)/2),m.toString())}}}},{key:"DoLoadFromStream",value:function(t,e,n){this.FShowUnderLine=t.readBoolean(),lF(dF(i.prototype),"DoLoadFromStream",this).call(this,t,e,n)}},{key:"MouseDown",value:function(t){if(this.FShowLineActiveMark){var e=this.MouseDownItemNo,n=this.MouseDownItemOffset;lF(dF(i.prototype),"MouseDown",this).call(this,t),e==this.MouseDownItemNo&&n==this.MouseDownItemOffset||this.Style.UpdateInfoRePaint()}else lF(dF(i.prototype),"MouseDown",this).call(this,t)}},{key:"SaveToStream",value:function(t){t.writeBoolean(this.FShowUnderLine),lF(dF(i.prototype),"SaveToStream",this).call(this,t)}},{key:"InsertStream",value:function(t,e,n){return lF(dF(i.prototype),"InsertStream",this).call(this,t,e,n)}},{key:"PaintFloatItems",value:function(t,e,i,n,o,r){for(var s=null,a=0;a41&&lp.HCLoadTextFromStream(t,i),t.readBoolean(),i>11&&(t.readByte(),t.readBoolean()),i>45&&(t.readInt32(),lp.HCLoadTextFromStream(t,i)),o)?this.FPaper.LoadFromStream(t,i):(new eF).LoadFromStream(t,i);var s=new Set([]);if(t.readBoolean()&&s.add(dp.Header),t.readBoolean()&&s.add(dp.Footer),t.readBoolean()&&s.add(dp.Page),s.has(dp.Header)){if(t.readInt32(),n==dp.Header)return;r=t.readInt64(),t.position+=r}n!=dp.Header&&n!=dp.Footer&&(s.has(dp.Footer)&&(r=t.readInt64(),t.position+=r),t.readBoolean(),t.readInt64())}},{key:"ToHtml",value:function(){return this.Header.ToHtml()+lp.sLineBreak+this.Page.ToHtml()+lp.sLineBreak+this.Footer.ToHtml()}},{key:"ToXml",value:function(t){t.SetAttribute("symmargin",this.FSymmetryMargin.toString()),t.SetAttribute("ori",this.FPaperOrientation.toString()),t.SetAttribute("pagenovisible",this.FPageNoVisible.toString()),t.SetAttribute("pagenofrom",this.FPageNoFrom.toString()),t.SetAttribute("pagenoformat",this.FPageNoFormat),t.SetAttribute("pagesize",this.PaperSize.toString()+","+C.stringFormatFloat(1,this.PaperWidth)+","+C.stringFormatFloat(1,this.PaperHeight)),t.SetAttribute("margin",C.stringFormatFloat(1,this.PaperMarginLeft)+","+C.stringFormatFloat(1,this.PaperMarginTop)+","+C.stringFormatFloat(1,this.PaperMarginRight)+","+C.stringFormatFloat(1,this.PaperMarginBottom)),t.SetAttribute("property",lp.GetPropertyString(this.FPropertys));var e=Kr.Create("header");e.SetAttribute("offset",this.HeaderOffset.toString()),this.Header.ToXml(e),t.AppendChild(e),e=Kr.Create("footer"),this.Footer.ToXml(e),t.AppendChild(e),e=Kr.Create("page"),this.Page.ToXml(e),t.AppendChild(e)}},{key:"ParseXml",value:function(t){this.SymmetryMargin=t.GetAttribute("symmargin"),this.PaperOrientation=t.GetAttribute("ori"),this.PageNoVisible=t.GetAttribute("pagenovisible"),t.HasAttribute("pagenofrom")&&(this.FPageNoFrom=t.GetAttribute("pagenofrom")),t.HasAttribute("pagenoformat")&&(this.FPageNoFormat=t.GetAttribute("pagenoformat"));var e=t.GetAttribute("pagesize").split(",");if(this.PaperSize=e[0],this.PaperWidth=e[1],this.PaperHeight=e[2],e=t.GetAttribute("margin").split(","),this.PaperMarginLeft=e[0],this.PaperMarginTop=e[1],this.PaperMarginRight=e[2],this.PaperMarginBottom=e[3],t.HasAttribute("property")){var i=lp.GetXmlRN(t.GetAttribute("property"));lp.SetPropertyString(i,this.FPropertys)}this.Page.Width=this.GetPageWidth();for(var n=0;n=t){e=n;break}return e<0&&t>i&&(e=this.FPages.count-1),e}},{key:"DoActiveDataCheckUpdateInfo",value:function(){null!=this.OnCheckUpdateInfo&&this.OnCheckUpdateInfo(this)}},{key:"DoDataReadOnlySwitch",value:function(t){null!=this.OnReadOnlySwitch&&this.OnReadOnlySwitch(this)}},{key:"DoGetScreenCoordEvent",value:function(t,e){return null!=this.OnGetScreenCoord?this.OnGetScreenCoord(t,e):G.Create(0,0)}},{key:"DoDataDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintBefor&&this.OnDrawItemPaintBefor(this,t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoDataDrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){null!=this.OnDrawItemPaintContent&&this.OnDrawItemPaintContent(t,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoDataDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintAfter&&this.OnDrawItemPaintAfter(this,t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoDataInsertAnnotate",value:function(t,e){null!=this.OnInsertAnnotate&&this.OnInsertAnnotate(this,t,e)}},{key:"DoDataRemoveAnnotate",value:function(t,e){null!=this.OnRemoveAnnotate&&this.OnRemoveAnnotate(this,t,e)}},{key:"DoDataDrawItemAnnotate",value:function(t,e,i,n){null!=this.OnDrawItemAnnotate&&this.OnDrawItemAnnotate(this,t,e,i,n)}},{key:"DoDataInsertItem",value:function(t,e){null!=this.OnInsertItem&&this.OnInsertItem(this,t,e)}},{key:"DoDataRemoveItem",value:function(t,e){null!=this.OnRemoveItem&&this.OnRemoveItem(this,t,e)}},{key:"DoDataSaveItem",value:function(t,e){return null==this.OnSaveItem||this.OnSaveItem(this,t,e)}},{key:"DoDataPaintDomainRegion",value:function(t,e){return null==this.OnPaintDomainRegion||this.OnPaintDomainRegion(this,t,e)}},{key:"DoMatchTextStyleNoAt",value:function(t,e,i){return null!==this.OnMatchTextStyleNoAt?this.OnMatchTextStyleNoAt(t,e,i):cs.Null}},{key:"DoDataAcceptAction",value:function(t,e,i,n){return null==this.OnDataAcceptAction||this.OnDataAcceptAction(this,t,e,i,n)}},{key:"DoDataItemMouseDown",value:function(t,e,i,n){null!=this.OnItemMouseDown&&this.OnItemMouseDown(this,t,e,i,n)}},{key:"DoDataItemMouseUp",value:function(t,e,i,n){null!=this.OnItemMouseUp&&this.OnItemMouseUp(this,t,e,i,n)}},{key:"DoDataDrawItemMouseMove",value:function(t,e,i,n,o){null!=this.OnDrawItemMouseMove&&this.OnDrawItemMouseMove(this,t,e,i,n,o)}},{key:"DoDataChanged",value:function(t){null!=this.OnDataChange&&this.OnDataChange(t,null)}},{key:"DoDataSetChange",value:function(){null!=this.OnDataSetChange&&this.OnDataSetChange()}},{key:"DoDataFloatItemPaintAfter",value:function(t,e,i,n){null!==this.OnFloatItemPaintAfter&&this.OnFloatItemPaintAfter(this,t,e,i,n)}},{key:"DoDataItemReFormatRequest",value:function(t,e){this.DoSectionDataAction(t,(function(){return t.ItemReFormatResponse(e),!0}))}},{key:"DoDataItemSetCaretRequest",value:function(t,e,i){this.DoActiveDataCheckUpdateInfo()}},{key:"DoDataItemResized",value:function(t,e){var i=t.Items[e],n=this.GetPageWidth(),o=0,r=t.GetRootData();o=r==this.FHeader?this.GetHeaderAreaHeight():r==this.FFooter?this.FPaper.MarginBottomPix:this.GetPageHeight(),i.RestrainSize(n,o),null!=this.OnItemResize&&this.OnItemResize(t,e)}},{key:"DoDataCreateStyleItem",value:function(t,e){return null!=this.OnCreateItemByStyle?this.OnCreateItemByStyle(t,e):null}},{key:"DoDataCanEdit",value:function(t){return null==this.OnCanEdit||this.OnCanEdit(t)}},{key:"DoDataInsertTextBefor",value:function(t,e,i,n){return null==this.OnInsertTextBefor||this.OnInsertTextBefor(t,e,i,n)}},{key:"DoDataCreateItem",value:function(t){null!=this.OnCreateItem&&this.OnCreateItem(t,null)}},{key:"DoDataCurParaNoChange",value:function(t){null!=this.OnCurParaNoChange&&this.OnCurParaNoChange(t)}},{key:"DoDataCaretItemChanged",value:function(t,e){null!=this.OnCaretItemChanged&&this.OnCaretItemChanged(this,t,e)}},{key:"DoDataDomainSwitch",value:function(t,e){null!=this.OnDataDomainSwitch&&this.OnDataDomainSwitch(this,t,e)}},{key:"DoDataGetUndoList",value:function(){return null!=this.OnGetUndoList?this.OnGetUndoList():null}},{key:"GetPageIndexByPageDataDrawItem",value:function(t){if(t<0)return 0;for(var e=this.FPages.count-1,i=0;i<=this.FPages.count-1;i++)if(this.FPages[i].EndDrawItemNo>=t){e=i;break}return e}},{key:"PaperCoordToData",value:function(t,e,i,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.FViewModel!=Bs)return{x:i,y:n};var r=-1,s=this.GetPageMarginLeft(t);return i-=s,e==this.FHeader?(n-=this.GetHeaderPageDrawTop(),o&&(n<0?n=1:n>(r=this.FHeader.height)&&(n=r-1))):e==this.FFooter?(n=n-this.FPaper.HeightPix+this.FPaper.MarginBottomPix,o&&(n<0?n=1:n>this.FPaper.MarginBottomPix&&(n=this.FPaper.MarginBottomPix-1))):e==this.FPage&&(n-=this.GetHeaderAreaHeight(),o&&(n<0?n=1:n>=(r=this.GetPageHeight())&&(n=r-1))),{x:i,y:n}}},{key:"GetReadOnly",value:function(){return this.FHeader.ReadOnly&&this.FFooter.ReadOnly&&this.FPage.ReadOnly}},{key:"SetReadOnly",value:function(t){this.FHeader.ReadOnly=t,this.FFooter.ReadOnly=t,this.FPage.ReadOnly=t}},{key:"SetActivePageIndex",value:function(t){this.FActivePageIndex!=t&&(this.FActivePageIndex=t,null!=this.OnActivePageChange&&this.OnActivePageChange(this,null))}},{key:"GetCurStyleNo",value:function(){return this.FActiveData.GetTopLevelData().CurStyleNo}},{key:"GetCurParaNo",value:function(){return this.FActiveData.GetTopLevelData().CurParaNo}},{key:"KillFocus",value:function(){this.FActiveData.KillFocus()}},{key:"GetPaperSize",value:function(){return this.FPaper.Size}},{key:"SetPaperSize",value:function(t){this.FPaper.Size=t}},{key:"GetPaperWidth",value:function(){return this.FPaper.Width}},{key:"GetPaperHeight",value:function(){return this.FPaper.Height}},{key:"GetPaperMarginTop",value:function(){return this.FPaper.MarginTop}},{key:"GetPaperMarginLeft",value:function(){return this.FPaper.MarginLeft}},{key:"GetPaperMarginRight",value:function(){return this.FPaper.MarginRight}},{key:"GetPaperMarginBottom",value:function(){return this.FPaper.MarginBottom}},{key:"SetPaperWidth",value:function(t){this.FPaper.Width=t}},{key:"SetPaperHeight",value:function(t){this.FPaper.Height=t}},{key:"SetPaperMarginTop",value:function(t){this.FPaper.MarginTop=t}},{key:"SetPaperMarginLeft",value:function(t){this.FPaper.MarginLeft=t}},{key:"SetPaperMarginRight",value:function(t){this.FPaper.MarginRight=t}},{key:"SetPaperMarginBottom",value:function(t){this.FPaper.MarginBottom=t}},{key:"GetPaperWidthPix",value:function(){return this.FPaper.WidthPix}},{key:"GetPaperHeightPix",value:function(){return this.FPaper.HeightPix}},{key:"GetPaperMarginTopPix",value:function(){return this.FPaper.MarginTopPix}},{key:"GetPaperMarginLeftPix",value:function(){return this.FPaper.MarginLeftPix}},{key:"GetPaperMarginRightPix",value:function(){return this.FPaper.MarginRightPix}},{key:"GetPaperMarginBottomPix",value:function(){return this.FPaper.MarginBottomPix}},{key:"SetHeaderOffset",value:function(t){this.FHeaderOffset!=t&&(this.FHeaderOffset=t,this.BuildSectionPages(0),this.DoDataChanged(this))}},{key:"NewEmptyPage",value:function(){var t=new iF;return this.FPages.add(t),t}},{key:"GetPageCount",value:function(){return this.FPages.count}},{key:"GetSectionDataAt",value:function(t,e){return t<0||t>this.FPaper.WidthPix||e<0||e>this.FPaper.HeightPix?this.FActiveData:e>=this.FPaper.HeightPix-this.FPaper.MarginBottomPix?this.FFooter:e=t){i=t-(i-n);break}e=e+this.FPagePadding+this.FPaper.HeightPix}return e=e+this.FPagePadding+this.GetHeaderAreaHeight()+i}},{key:"GetPageIndexByCurrent",value:function(){var t=-1,e=-1;if(this.FActiveData!=this.FPage)t=this.FActivePageIndex;else{e=this.FPage.CaretDrawItemNo<0?this.FPage.GetDrawItemNoByOffset(this.FPage.SelectInfo.StartItemNo,this.FPage.SelectInfo.StartItemOffset):this.FPage.CaretDrawItemNo;for(var i=new bp,n=0;n<=this.FPages.count-1;n++)if(this.FPages[n].EndDrawItemNo>=e){n=0?(i.Y=0,this.FPage.GetCaretInfo(this.FPage.SelectInfo.StartItemNo,this.FPage.SelectInfo.StartItemOffset,i),t=this.GetPageIndexByFormat(i.Y)):t=this.GetPageIndexByPageDataDrawItem(e):t=n;break}}return t}},{key:"GetPageIndexByFormat",value:function(t){return Math.trunc(t/this.GetPageHeight())}},{key:"SetActiveItemText",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.SetActiveItemText(t),!0}))}},{key:"PaintDisplayPage",value:function(t,e,i,n){for(var o=this.FDisplayFirstPageIndex;o<=this.FDisplayLastPageIndex;o++){n.PageIndex=o;var r=0;r=n.ViewModel==Bs?this.GetPageTopFilm(o):this.GetPageTop(o),this.paintPaper(o,t,r-e,i,n)}}},{key:"KeyPress",value:function(t){var e=this;if(this.FActiveData.CanEdit())if(lp.IsKeyPressWant(t)){var i=t.keyCode;this.DoSectionDataAction(this.FActiveData,(function(){return i=e.FActiveData.KeyPress(i),!0})),t.keyCode=i}else t.keyCode=0}},{key:"KeyDown",value:function(t){var e=this;if(this.FActiveData.CanEdit())if(this.FActiveData.KeyDownFloatItem(t))this.DoActiveDataCheckUpdateInfo();else{var i=t.keyCode;if(lp.IsKeyDownWant(i))switch(i){case Pe:case Ge:case be:case De:this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.KeyDown(t),!0}));break;case Be:case Me:case Ee:case Le:case Ne:case Oe:this.FActiveData.KeyDown(t),this.SetActivePageIndex(this.GetPageIndexByCurrent()),this.DoActiveDataCheckUpdateInfo()}else this.FActiveData.KeyDown(t)}}},{key:"KeyUp",value:function(t){this.FActiveData.CanEdit()&&this.FActiveData.KeyUp(t)}},{key:"ApplyTextStyle",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextStyle(t),!0}))}},{key:"ApplyTextStyleNo",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextStyleNo(t),!0}))}},{key:"ApplyTextFontName",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextFontName(t),!0}))}},{key:"ApplyTextFontSize",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextFontSize(t),!0}))}},{key:"ApplyTextColor",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextColor(t),!0}))}},{key:"ApplyTextBackColor",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextBackColor(t),!0}))}},{key:"ApplyTableCellAlign",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTableCellAlign(t),!0}))}},{key:"InsertText",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertText(t)}))}},{key:"InsertTable",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.InsertTable(t,e)}))}},{key:"InsertImage",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertImage(t)}))}},{key:"InsertGifImage",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertGifImage(t)}))}},{key:"InsertLine",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertLine(t)}))}},{key:"InsertItem",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertItem(t)}))}},{key:"InsertItemEx",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.InsertItemEx(t,e)}))}},{key:"InsertBreak",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.InsertBreak()}))}},{key:"InsertPageBreak",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FPage.InsertPageBreak()}))}},{key:"InsertDomain",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertDomain(t)}))}},{key:"InsertAnnotate",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.InsertAnnotate(t,e)}))}},{key:"SetActiveImage",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.SetActiveImage(t)}))}},{key:"ActiveTableResetRowCol",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.ActiveTableResetRowCol(t,e)}))}},{key:"ActiveTableInsertRowAfter",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertRowAfter(t)}))}},{key:"ActiveTableInsertRowBefor",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertRowBefor(t)}))}},{key:"ActiveTableDeleteCurRow",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableDeleteCurRow()}))}},{key:"ActiveTableDeleteRowFrom",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.ActiveTableDeleteRowFrom(t,e)}))}},{key:"ActiveTableSplitCurRow",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableSplitCurRow()}))}},{key:"ActiveTableSplitCurCol",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableSplitCurCol()}))}},{key:"ActiveTableInsertColAfter",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertColAfter(t)}))}},{key:"ActiveTableInsertColBefor",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertColBefor(t)}))}},{key:"ActiveTableDeleteCurCol",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableDeleteCurCol()}))}},{key:"SectionCoordToPaper",value:function(t,e,i,n,o){return{x:e,y:i-(this.FViewModel==Bs?this.GetPageTopFilm(t):this.GetPageTop(t))}}},{key:"ApplyParaAlignHorz",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaAlignHorz(t),!0}))}},{key:"ApplyParaAlignVert",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaAlignVert(t),!0}))}},{key:"ApplyParaBackColor",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaBackColor(t),!0}))}},{key:"ApplyParaBreakRough",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaBreakRough(t),!0}))}},{key:"ApplyParaLineSpace",value:function(t,e){var i=this;this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.ApplyParaLineSpace(t,e),!0}))}},{key:"ApplyParaLeftIndent",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaLeftIndent(t),!0}))}},{key:"ApplyParaRightIndent",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaRightIndent(t),!0}))}},{key:"ApplyParaFirstIndent",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaFirstIndent(t),!0}))}},{key:"ApplyBullet",value:function(t,e,i,n){var o=this;this.DoSectionDataAction(this.FActiveData,(function(){return o.FActiveData.ApplyBullet(t,e,i,n),!0}))}},{key:"DataAction",value:function(t,e){return this.DoSectionDataAction(t,e)}},{key:"GetPageCaretInfo",value:function(t){var e=-1,i=-1;i=this.FStyle.UpdateInfo.DragingSelected?this.FMousePageIndex:this.FActivePageIndex,this.FActiveData.SelectInfo.StartItemNo<0||i<0?t.Visible=!1:(t.PageIndex=i,this.FActiveData.GetCaretInfoCur(t),t.Visible&&(this.FActiveData==this.FPage&&i!=(e=this.GetPageIndexByFormat(t.Y))&&(i=e,this.SetActivePageIndex(i)),this.FViewModel==Bs?(e=this.GetPageMarginLeft(i),t.X=t.X+e,t.Y=t.Y+this.GetPageTopFilm(i),this.FActiveData==this.FHeader?t.Y=t.Y+this.GetHeaderPageDrawTop():this.FActiveData==this.FPage?t.Y=t.Y+this.GetHeaderAreaHeight()-this.GetPageDataFmtTop(i):this.FActiveData==this.FFooter&&(t.Y=t.Y+this.FPaper.HeightPix-this.FPaper.MarginBottomPix)):(t.Y=t.Y+this.GetPageTop(i),this.FActiveData==this.FPage&&(t.Y=t.Y-this.GetPageDataFmtTop(i)))))}},{key:"PaintHeader",value:function(t,e,i,n,o,r,s,a,l,h){var c=s+t;t>0&&(c=t+s);var u=t+this.GetHeaderPageDrawTop();if(null!=this.OnPaintHeaderBefor){l.save();try{this.OnPaintHeaderBefor(this,a,new U(i,u,n,e),l,h)}finally{l.restore()}}if(this.FHeader.PaintData(i,u,n,e,Math.max(u,0),c,0,l,h),null!=this.OnPaintHeaderAfter){l.save();try{this.OnPaintHeaderAfter(this,a,U.Create(i,u,n,e),l,h)}finally{l.restore()}}}},{key:"PaintFooter",value:function(t,e,i,n,o,r,s,a,l){var h=l.WindowHeight-n;if(h=h>this.FPaper.MarginBottomPix?t:l.WindowHeight,null!=this.OnPaintFooterBefor){a.save();try{this.OnPaintFooterBefor(this,s,U.Create(e,n,i,t),a,l)}finally{a.restore()}}if(this.FFooter.PaintData(e,n,i,t,Math.max(n,0),t+h,0,a,l),null!=this.OnPaintFooterAfter){a.save();try{this.OnPaintFooterAfter(this,s,U.Create(e,n,i,t),a,l)}finally{a.restore()}}}},{key:"PaintPage",value:function(t,e,i,n,o,r,s,a,l,h,c,u){if(!(this.FPages[h].StartDrawItemNo<0||this.FPages[h].EndDrawItemNo<0)){if(null!=this.OnPaintPageBefor){c.save();try{this.OnPaintPageBefor(this,h,U.Create(t,e,i,n),c,u)}finally{c.restore()}}if(this.FPage.PaintData(t,e,i,n,a,l,u.PageDataFmtTop,c,u),null!=this.OnPaintPageAfter){c.save();try{this.OnPaintPageAfter(this,h,U.Create(t,e,i,n),c,u)}finally{c.restore()}}}}},{key:"paintPaper",value:function(t,e,i,n,o){var r,s,a,l,h=Math.round(o.WindowWidth/o.ScaleX),c=Math.round(o.WindowHeight/o.ScaleY),u=e,f=i,d=0,m=0,y=0,p=0,S=0;if(o.ViewModel==Bs){r=e+this.FPaper.WidthPix,s=f+this.FPaper.HeightPix;var v=this.GetPageMarginLeftAndRight(t);a=u+(y=v.left),d=r-(p=v.right),l=f+(S=this.GetHeaderAreaHeight()),m=s-this.FPaper.MarginBottomPix}else a=u,d=r=e+this.GetPageWidth(),S=0,y=0,p=0,l=f,m=(s=i+this.GetPageHeight())-1;var F=Math.max(l,0),I=Math.min(m,c);o.PageDataFmtTop=this.GetPageDataFmtTop(t),n.save();try{if(o.Print||(n.brush.color=this.FStyle.BackgroundColor,n.fillRect(U.Create(u,f,Math.min(r,h),Math.min(s,c)))),null!=this.OnPaintPaperBefor){n.save();try{this.OnPaintPaperBefor(this,t,U.Create(u,f,r,s),n,o)}finally{n.restore()}}o.Print||(o.ViewModel==Bs?(l>0&&(S>this.FPaper.MarginTopPix&&(n.pen.style=pt.Dot,n.pen.color="rgb(211, 211, 211)",o.drawNoScaleLine(n,[G.Create(a,l-1),G.Create(d,l-1)])),this.FActiveData==this.FHeader?(n.pen.width=1,n.pen.color="blue",n.pen.style=pt.Solid,n.drawLine(a,l,d,l),n.drawLineByPointsDriect([G.Create(a,l),G.Create(a,f+this.FHeaderOffset),G.Create(d,f+this.FHeaderOffset),G.Create(d,l)]),n.brush.color="rgb(216, 232, 245)",n.fillRect(U.Create(a-40,l,a,l+20)),n.font.size=10,n.font.name="宋体",n.font.styles.clear(),n.font.color="rgb(21, 66, 139)",n.textOut(a-32,l+4,"页眉")):(n.pen.width=1,n.pen.color="gray",n.pen.style=pt.Solid),o.drawNoScaleLine(n,[G.Create(a-lp.PMSLineHeight,i+this.FPaper.MarginTopPix),G.Create(a,i+this.FPaper.MarginTopPix),G.Create(a,i+this.FPaper.MarginTopPix-lp.PMSLineHeight)]),o.drawNoScaleLine(n,[G.Create(d+lp.PMSLineHeight,i+this.FPaper.MarginTopPix),G.Create(d,i+this.FPaper.MarginTopPix),G.Create(d,i+this.FPaper.MarginTopPix-lp.PMSLineHeight)])),m0&&(n.pen.width=1,n.pen.color="gray",n.pen.style=pt.DashDot,n.drawLine(u,l,r,l)),m0){g.reset(u,Math.max(f+this.FHeaderOffset,0),r,Math.min(l,o.WindowHeight)),n.save();try{n.clipRect(g),this.PaintHeader(f,l,a,d,y,p,S,t,n,o)}finally{n.restore()}}if(mF){g.reset(u,Math.max(l,F),r,Math.min(m,I)+1),n.save();try{n.clipRect(g),this.PaintPage(a,l,d,m,y,p,S,F,I,t,n,o)}finally{n.restore()}}g.reset(u,f,r,s),n.save();try{n.clipRect(g),this.FHeader.PaintFloatItems(t,a,f+this.GetHeaderPageDrawTop(),0,n,o),this.FFooter.PaintFloatItems(t,a,m,0,n,o),this.FPage.PaintFloatItems(t,a,l,this.GetPageDataFmtTop(t),n,o)}finally{n.restore()}}finally{n.restore()}if(null!=this.OnPaintPaperAfter){n.save();try{this.OnPaintPaperAfter(this,t,U.Create(u,f,r,s),n,o)}finally{n.restore()}}}},{key:"Clear",value:function(){this.FHeader.Clear(),this.FFooter.Clear(),this.FPage.Clear(),this.FPages.ClearEx(),this.FActivePageIndex=0}},{key:"MouseDown",value:function(t){var e=!1,i=this.FActiveData.GetTopLevelData(),n=this.GetPageIndexByFilm(t.y);this.FActivePageIndex!=n&&(this.FActivePageIndex=n);var o=this.SectionCoordToPaper(this.FActivePageIndex,t.x,t.y,-1,-1),r=o.x,s=o.y,a=this.GetSectionDataAt(r,s);if(a!=this.FActiveData&&2==t.clicks&&this.FViewModel==Bs&&(this.SetActiveData(a),e=!0),this.FActiveData.FloatItems.count>0){var l=this.PaperCoordToData(this.FActivePageIndex,this.FActiveData,r,s,!1);this.FActiveData==this.FPage&&(l.y=l.y+this.GetPageDataFmtTop(this.FActivePageIndex));var h=new ei;if(h.assign(t),h.x=l.x,h.y=l.y,this.FActiveData.MouseDownFloatItem(h))return}if(r=(o=this.PaperCoordToData(this.FActivePageIndex,this.FActiveData,r,s)).x,s=o.y,this.FActiveData==this.FPage&&(s+=this.GetPageDataFmtTop(this.FActivePageIndex)),2!=t.clicks||e){var c=new ei;c.assign(t),c.x=r,c.y=s,this.FActiveData.MouseDown(c)}else this.FActiveData.DblClick(r,s);i!=this.FActiveData.GetTopLevelData()&&null!=this.OnChangeTopLevelData&&this.OnChangeTopLevelData(this,null)}},{key:"MouseMove",value:function(t){var e=this.GetPageMarginLeftAndRight(this.FMousePageIndex),i=e.left,n=e.right;t.xthis.FPaper.WidthPix-n?lp.GCursor=oe:lp.GCursor=ue,this.FMousePageIndex=this.GetPageIndexByFilm(t.y);var o,r=-1,s=-1;if(this.FActiveData.FloatItems.count>0){t.button==ee&&!or.keyDownStates[Re]&&this.FActiveData.FloatItemIndex>=0&&(this.FActiveData.ActiveFloatItem.Resizing||(this.FActiveData.ActiveFloatItem.PageIndex=this.FMousePageIndex)),this.FActiveData==this.FPage?this.FActiveData.FloatItemIndex>=0&&this.FActiveData.ActiveFloatItem.Resizing?(o=this.SectionCoordToPaper(this.FActiveData.ActiveFloatItem.PageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FActiveData.ActiveFloatItem.PageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y+this.GetPageDataFmtTop(this.FActiveData.ActiveFloatItem.PageIndex)):(o=this.SectionCoordToPaper(this.FMousePageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FMousePageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y+this.GetPageDataFmtTop(this.FMousePageIndex)):this.FActiveData.FloatItemIndex>=0&&this.FActiveData.ActiveFloatItem.Resizing?(o=this.SectionCoordToPaper(this.FActivePageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FActivePageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y):(o=this.SectionCoordToPaper(this.FMousePageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FMousePageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y);var a=new ei;if(a.assign(t),a.x=r,a.y=s,this.FActiveData.MouseMoveFloatItem(a))return}r=(o=this.SectionCoordToPaper(this.FMousePageIndex,t.x,t.y,r,s)).x,s=o.y;var l=this.GetSectionDataAt(r,s);l!=this.FMoveData&&(null!=this.FMoveData?this.FMoveData.SelectedResizing()||(this.FMoveData.MouseLeave(),this.FMoveData=l):this.FMoveData=l),r=(o=this.PaperCoordToData(this.FMousePageIndex,this.FActiveData,r,s,0!=t.button)).x,s=o.y,this.FActiveData==this.FPage&&(s+=this.GetPageDataFmtTop(this.FMousePageIndex));var h=new ei;h.assign(t),h.x=r,h.y=s,this.FActiveData.MouseMove(h)}},{key:"MouseUp",value:function(t){var e,i=this,n=this.GetPageIndexByFilm(t.y),o=-1,r=-1,s=null;if(!(this.FActiveData.FloatItems.count>0&&this.FActiveData.FloatItemIndex>=0&&(this.FActiveData==this.FPage?(e=this.SectionCoordToPaper(this.FActiveData.ActiveFloatItem.PageIndex,t.x,t.y,o,r),e=this.PaperCoordToData(this.FActiveData.ActiveFloatItem.PageIndex,this.FActiveData,e.x,e.y,!1),o=e.x,r=e.y+this.GetPageDataFmtTop(this.FActiveData.ActiveFloatItem.PageIndex)):(e=this.SectionCoordToPaper(n,t.x,t.y,o,r),e=this.PaperCoordToData(n,this.FActiveData,e.x,e.y,!1),o=e.x,r=e.y),(s=new ei).assign(t),s.x=o,s.y=r,this.FActiveData.MouseUpFloatItem(s))))if(e=this.SectionCoordToPaper(n,t.x,t.y,o,r),e=this.PaperCoordToData(n,this.FActiveData,e.x,e.y),o=e.x,r=e.y,this.FActiveData==this.FPage&&(r+=this.GetPageDataFmtTop(n)),this.FActiveData.SelectedResizing())this.DoSectionDataAction(this.FActiveData,(function(){var e=new ei;return e.assign(t),e.x=o,e.y=r,i.FActiveData.MouseUp(e),!0}));else{var a=new ei;a.assign(t),a.x=o,a.y=r,this.FActiveData.MouseUp(a)}}},{key:"GetPageTopFilm",value:function(t){for(var e=this.FPagePadding,i=0;i<=t-1;i++)e=e+this.FPaper.HeightPix+this.FPagePadding;return e}},{key:"GetPageTop",value:function(t){for(var e=0,i=this.GetPageHeight(),n=0;n<=t-1;n++)e+=i;return e}},{key:"GetPageDataFmtTop",value:function(t){var e=0;if(t>0)for(var i=this.GetPageHeight(),n=0;n<=t-1;n++)e+=i;return e}},{key:"GetHeaderPageDrawTop",value:function(){var t=this.FHeaderOffset,e=this.FHeader.height;return el){if(this.FPages[o].StartDrawItemNo==t&&0==e&&!n.CanPageBreak)return s+=h=l-this.FPage.DrawItems[t].rect.bottom,this.FPage.DrawItems[t].rect.bottom=this.FPage.DrawItems[t].rect.bottom+h,n.Height=n.Height+h,{pageIndex:o,breakSeat:r,suplus:s,pageFmtTop:a,pageFmtBottom:l};var u=U.CreateByRect(this.FPage.DrawItems[t].rect);(t==this.FPage.DrawItems.count-1||this.FPage.DrawItems[t+1].LineFirst)&&u.inFlate(0,-Math.trunc(this.FPage.GetLineBlankSpace(t)/2));var f=n.CheckFormatPageBreak(this.FPages.count-1,u.top,u.bottom,a,l,e,r,c,h);if(r=f.breakSeat,c=f.fmtOffset,h=f.fmtHeightInc,!(r<0))return c>0?(s=s+(c+=this.FPage.GetLineBlankSpace(t)/2)+h,this.FPage.DrawItems[t].rect.offset(0,c),l=(a=l)+i,o=this._FormatNewPage(o,t-1,t),this._RectItemCheckPage(t,e,i,n,o,r,s,a,l)):(s+=h,this.FPage.DrawItems[t].rect.bottom=this.FPage.DrawItems[t].rect.bottom+h,n.Height=n.Height+h,l=(a=l)+i,o=this._FormatNewPage(o,t,t),this._RectItemCheckPage(t,e,i,n,o,r,s,a,l));s=s+l-u.bottom}else(h=n.CheckPageSurplus(l-this.FPage.DrawItems[t].rect.bottom,h))>0&&(s+=h,this.FPage.DrawItems[t].rect.bottom=this.FPage.DrawItems[t].rect.bottom+h,n.Height=n.Height+h);return{pageIndex:o,breakSeat:r,suplus:s,pageFmtTop:a,pageFmtBottom:l}}},{key:"_FormatRectItemCheckPageBreak",value:function(t,e,i,n,o){var r=0,s=0,a=this.FPage.Items[this.FPage.DrawItems[t].ItemNo];a.CheckFormatPageBreakBefor();var l=this._RectItemCheckPage(t,0,e,a,i,s,r,n,o);if(i=l.pageIndex,s=l.breakSeat,r=l.suplus,n=l.pageFmtTop,o=l.pageFmtBottom,0!=r)for(var h=t+1;h<=this.FPage.DrawItems.count-1;h++)this.FPage.DrawItems[h].rect.offset(0,r);return{pageIndex:i,pageFmtTop:n,pageFmtBottom:o}}},{key:"_FormatTextItemCheckPageBreak",value:function(t,e,i,n,o){if(this.FPage.DrawItems[e].rect.bottom>n){for(var r=n-this.FPage.DrawItems[e].rect.top,s=e;s<=this.FPage.DrawItems.count-1;s++)this.FPage.DrawItems[s].rect.offset(0,r);n=(i=n)+t,o=this._FormatNewPage(o,e-1,e)}return{pageFmtTop:i,pageFmtBottom:n,pageIndex:o}}},{key:"BuildSectionPages",value:function(t){if(!(this.FPage.FormatCount>0)){for(var e=t,i=null;e>0&&!this.FPage.DrawItems[e].LineFirst;)e--;var n=0;if(--e>0)for(var o=this.FPages.count-1;o>=0;o--)if(e>=(i=this.FPages[o]).StartDrawItemNo&&e<=i.EndDrawItemNo){n=o;break}this.FPages.removeRange(n+1,this.FPages.count-n-1),0==this.FPages.count&&((i=new iF).StartDrawItemNo=0,this.FPages.add(i),n=0);for(var r=this.GetPageDataFmtTop(n),s=this.GetPageHeight(),a=r+s,l=0,h=null,c=e+1;c<=this.FPage.DrawItems.count-1;c++)if(this.FPage.DrawItems[c].LineFirst){if((h=this.FPage.Items[this.FPage.DrawItems[c].ItemNo]).PageBreak&&h.FirstDItemNo==c){if((l=a-this.FPage.DrawItems[c].rect.top)>0)for(var u=c;u<=this.FPage.DrawItems.count-1;u++)this.FPage.DrawItems[u].rect.offset(0,l);a=(r=a)+s,n=this._FormatNewPage(n,c-1,c)}if(this.FPage.GetDrawItemStyle(c)=0;m--)this.FPage.FloatItems[m].PageIndex>this.FPages.count-1&&this.FPage.FloatItems.delete(m)}}},{key:"DeleteSelected",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.DeleteSelected()}))}},{key:"DisSelect",value:function(){this.FActiveData.DisSelect()}},{key:"DeleteActiveAnnotate",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.DeleteActiveAnnotate()}))}},{key:"DeleteActiveDomain",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.DeleteActiveDomain()}))}},{key:"DeleteActiveDataItems",value:function(t,e,i){var n=this;return this.DoSectionDataAction(this.FActiveData,(function(){return n.FActiveData.DeleteActiveDataItems(t,e,i),!0}))}},{key:"MergeTableSelectCells",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.MergeTableSelectCells()}))}},{key:"TableApplyContentAlign",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableApplyContentAlign(t)}))}},{key:"ReFormatActiveParagraph",value:function(){var t=this;this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ReFormatActiveParagraph(),!0}))}},{key:"ReFormatActiveItem",value:function(){var t=this;this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ReFormatActiveItem(),!0}))}},{key:"GetHeaderAreaHeight",value:function(){var t=this.FHeaderOffset+this.FHeader.height;return t0){t.writeBoolean(this.FSymmetryMargin),t.writeByte(this.FPaperOrientation),t.writeBoolean(this.FPageNoVisible),t.writeInt32(this.FPageNoFrom),lp.HCSaveTextToStream(t,this.FPageNoFormat),this.FPaper.SaveToStream(t);var n=e.has(dp.Header);t.writeBoolean(n),n=e.has(dp.Footer),t.writeBoolean(n),n=e.has(dp.Page),t.writeBoolean(n),e.has(dp.Header)&&(t.writeInt32(this.FHeaderOffset),this.FHeader.SaveToStream(t)),e.has(dp.Footer)&&this.FFooter.SaveToStream(t),e.has(dp.Page)&&this.FPage.SaveToStream(t)}var o=t.position;t.position=i,i=o-i-8,t.writeUInt64(i),t.position=o}},{key:"SaveToText",value:function(){return this.FPage.SaveToText()}},{key:"LoadFromStream",value:function(t,e,i){t.readInt64(),i>41&&this.DoLoadFromStream(t,i),this.FSymmetryMargin=t.readBoolean(),i>11&&(this.FPaperOrientation=t.readByte(),this.FPageNoVisible=t.readBoolean()),i>45&&(this.FPageNoFrom=t.readInt32(),this.FPageNoFormat=lp.HCLoadTextFromStream(t,i),this.FPageNoFormat=this.FPageNoFormat.replace("%d","{0}"),this.FPageNoFormat=this.FPageNoFormat.replace("%d","{1}")),this.FPaper.LoadFromStream(t,i),this.FPage.Width=this.GetPageWidth();var n=new Set([]);t.readBoolean()&&n.add(dp.Header),t.readBoolean()&&n.add(dp.Footer),t.readBoolean()&&n.add(dp.Page),n.has(dp.Header)&&(this.FHeaderOffset=t.readInt32(),this.FHeader.Width=this.FPage.Width,this.FHeader.LoadFromStream(t,this.FStyle,i)),n.has(dp.Footer)&&(this.FFooter.Width=this.FPage.Width,this.FFooter.LoadFromStream(t,this.FStyle,i)),n.has(dp.Page)&&this.FPage.LoadFromStream(t,this.FStyle,i),this.BuildSectionPages(0)}},{key:"InsertStream",value:function(t,e,i){var n=this;return this.DoSectionDataAction(this.FActiveData,(function(){return n.FActiveData.InsertStream(t,e,i)}))}},{key:"FormatData",value:function(){this.FHeader.ReFormat(),this.Footer.ReFormat(),this.FPage.ReFormat()}},{key:"ActiveDataSetSelectBound",value:function(t,e,i,n){this.FActiveData.SetSelectBound(t,e,i,n,!1),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.FStyle.UpdateInfoReScroll(),this.DoActiveDataCheckUpdateInfo()}},{key:"Undo",value:function(t){var e=this;this.DoDataGetUndoList().GroupWorking?t.Data.Undo(t):(this.FActiveData!=t.Data&&this.SetActiveData(t.Data),this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.Undo(t),!0})))}},{key:"Redo",value:function(t){var e=this;this.DoDataGetUndoList().GroupWorking?t.Data.Redo(t):(this.FActiveData!=t.Data&&this.SetActiveData(t.Data),this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.Redo(t),!0})))}},{key:"Style",get:function(){return this.FStyle}},{key:"PaperSize",get:function(){return this.GetPaperSize()},set:function(t){this.SetPaperSize(t)}},{key:"PaperWidth",get:function(){return this.GetPaperWidth()},set:function(t){this.SetPaperWidth(t)}},{key:"PaperHeight",get:function(){return this.GetPaperHeight()},set:function(t){this.SetPaperHeight(t)}},{key:"PaperMarginTop",get:function(){return this.GetPaperMarginTop()},set:function(t){this.SetPaperMarginTop(t)}},{key:"PaperMarginLeft",get:function(){return this.GetPaperMarginLeft()},set:function(t){this.SetPaperMarginLeft(t)}},{key:"PaperMarginRight",get:function(){return this.GetPaperMarginRight()},set:function(t){this.SetPaperMarginRight(t)}},{key:"PaperMarginBottom",get:function(){return this.GetPaperMarginBottom()},set:function(t){this.SetPaperMarginBottom(t)}},{key:"PaperOrientation",get:function(){return this.FPaperOrientation},set:function(t){this.FPaperOrientation=t}},{key:"PaperWidthPix",get:function(){return this.GetPaperWidthPix()}},{key:"PaperHeightPix",get:function(){return this.GetPaperHeightPix()}},{key:"PaperMarginTopPix",get:function(){return this.GetPaperMarginTopPix()}},{key:"PaperMarginLeftPix",get:function(){return this.GetPaperMarginLeftPix()}},{key:"PaperMarginRightPix",get:function(){return this.GetPaperMarginRightPix()}},{key:"PaperMarginBottomPix",get:function(){return this.GetPaperMarginBottomPix()}},{key:"HeaderOffset",get:function(){return this.FHeaderOffset},set:function(t){this.SetHeaderOffset(t)}},{key:"Header",get:function(){return this.FHeader}},{key:"Footer",get:function(){return this.FFooter}},{key:"Page",get:function(){return this.FPage}},{key:"CurStyleNo",get:function(){return this.GetCurStyleNo()}},{key:"CurParaNo",get:function(){return this.GetCurParaNo()}},{key:"ActiveData",get:function(){return this.FActiveData},set:function(t){this.SetActiveData(t)}},{key:"ActiveArea",get:function(){return this.GetActiveArea()}},{key:"ActivePageIndex",get:function(){return this.FActivePageIndex}},{key:"ViewModel",get:function(){return this.FViewModel},set:function(t){this.FViewModel!=t&&(this.FViewModel=t,this.SetActiveData(this.FPage))}},{key:"SymmetryMargin",get:function(){return this.FSymmetryMargin},set:function(t){this.FSymmetryMargin=t}},{key:"DisplayFirstPageIndex",get:function(){return this.FDisplayFirstPageIndex},set:function(t){this.FDisplayFirstPageIndex=t}},{key:"DisplayLastPageIndex",get:function(){return this.FDisplayLastPageIndex},set:function(t){this.FDisplayLastPageIndex=t}},{key:"PageCount",get:function(){return this.GetPageCount()}},{key:"PageNoVisible",get:function(){return this.FPageNoVisible},set:function(t){this.FPageNoVisible=t}},{key:"PageNoFrom",get:function(){return this.FPageNoFrom},set:function(t){this.FPageNoFrom=t}},{key:"PageNoFormat",get:function(){return this.FPageNoFormat},set:function(t){this.FPageNoFormat!=t&&(this.FPageNoFormat=t,this.DoActiveDataCheckUpdateInfo())}},{key:"PagePadding",get:function(){return this.FPagePadding},set:function(t){this.FPagePadding=t}},{key:"ReadOnly",get:function(){return this.GetReadOnly()},set:function(t){this.SetReadOnly(t)}}]),i}(L));function xF(t){return(xF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function AF(t,e,i){return(AF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=GF(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function TF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(t,e){for(var i=0;i0){t.brush.color="#52596b",t.fillRect(U.Create(2,2,this.leftBtnRect_.left,this.height-2)),t.font.size=8,t.font.color="#d0d1d5",t.font.name="宋体",t.font.styles.clear();for(var e=2,n=Math.trunc((this.height-t.font.height)/2),o="",r=0,s=this.FStatuses.count;r0&&void 0!==arguments[0]?arguments[0]:$n;zF(YF(r.prototype),"show",this).call(this,t),this.cbbKey.setFocus()}}])&&WF(e.prototype,i),n&&WF(e,n),r}(ro);function ZF(t,e,i){return(ZF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sI(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function qF(t,e){for(var i=0;i0){for(var o=-1,r=-1,s=null,a="",l=t,h=l.GetHeaderAreaHeight(),c=e.top+h-n.PageDataFmtTop,u=n.PageDataFmtTop+c,f=u+l.PaperHeightPix-h-l.PaperMarginBottomPix,d=0;d<=this.FDrawAnnotates.count-1&&!((s=this.FDrawAnnotates[d]).DrawRect.top>f);d++)s.DrawRect.bottom>u&&(r=d,o<0&&(o=d));if(o>=0){i.font.size=8,i.font.name="宋体",i.font.color=at.Black,u=this.FDrawAnnotates[o].DrawRect.top;for(var m=o;m<=r;m++){if((s=this.FDrawAnnotates[m]).DrawRect.top>u&&(u=s.DrawRect.top),a=s.isClass(lI)?s.Title+":"+s.Text:s.AnnotateItem.Content.Title+":"+s.AnnotateItem.Content.Text,s.rect.reset(0,0,lp.AnnotationWidth-30,i.font.height),i.getTextRect(m.toString()+a,s.rect),s.rect.right0){s.rect.bottom+=20*s.AnnotateItem.Replys.count;for(var y=0;ye.bottom){c=this.FDrawAnnotates[r].rect.bottom-e.bottom+5;var p=0,S=-1;u=this.FDrawAnnotates[r].rect.top;for(var v=r;v>=o;v--){if((c-=p=u-this.FDrawAnnotates[v].rect.bottom-5)<=0){S=v+1,c<0&&(p+=c);break}u=this.FDrawAnnotates[v].rect.top}S<0&&(S=o,(p=this.FDrawAnnotates[o].rect.top-e.top-5)>c&&(p=c)),this.FDrawAnnotates[S].rect.offset(0,-p),u=this.FDrawAnnotates[S].rect.bottom+5;for(var F=S;F<=r;F++)c=u-this.FDrawAnnotates[F].rect.top,this.FDrawAnnotates[F].rect.offset(0,c),u=this.FDrawAnnotates[F].rect.bottom+5}var I,g=new U;i.pen.color=at.Red;for(var w=o;w<=r;w++){(s=this.FDrawAnnotates[w]).isClass(lI)?(a=s.Title+":"+s.Text,i.pen.style=pt.Dot,i.pen.width=1,i.brush.color=lp.AnnotateBKColor):(a=s.AnnotateItem.Content.Title+":"+s.AnnotateItem.Content.Text,(I=s.Data).HotAnnotate.EndNo>=0&&s.AnnotateItem==I.HotAnnotate.Data.Items[I.HotAnnotate.EndNo]?(i.pen.style=pt.Solid,i.pen.width=1,i.brush.color=lp.AnnotateBKActiveColor):I.ActiveAnnotate.EndNo>=0&&s.AnnotateItem==I.ActiveAnnotate.Data.Items[I.ActiveAnnotate.EndNo]?(i.pen.style=pt.Solid,i.pen.width=2,i.brush.color=lp.AnnotateBKActiveColor):(i.pen.style=pt.Dot,i.pen.width=1,i.brush.color=lp.AnnotateBKColor)),n.Print&&(i.brush.style=Ft),i.fillRoundRect(s.rect,5),g.resetRect(s.rect),g.inFlate(-5,-5),i.textOutRect(w.toString()+a,g),i.brush.style=Ft,i.beginPath();try{i.moveTo(s.DrawRect.right,s.DrawRect.bottom),i.lineTo(e.right,s.DrawRect.bottom),i.lineTo(s.rect.left,g.top)}finally{i.paintPath()}}}}}},{key:"InsertDataAnnotate",value:function(t){this.FCount++,this.FVisible=!0}},{key:"RemoveDataAnnotate",value:function(t){this.FCount--,0==this.FCount&&(this.FVisible=!1)}},{key:"AddDrawAnnotate",value:function(t){this.FDrawAnnotates.add(t)}},{key:"ClearDrawAnnotate",value:function(){this.FDrawAnnotates.clear()}},{key:"MouseDown",value:function(t,e){this.FActiveDrawAnnotateIndex=this._getDrawAnnotateAt(t,e)}},{key:"MouseMove",value:function(t,e){this.MouseIn=this.FDrawRect.pointInAt(t,e)}},{key:"DrawCount",get:function(){return this._getDrawCount()}},{key:"DrawAnnotates",get:function(){return this.FDrawAnnotates}},{key:"Visible",get:function(){return this.FVisible}},{key:"Count",get:function(){return this.FCount}},{key:"DrawRect",get:function(){return this.FDrawRect}},{key:"MouseIn",get:function(){return this.FMouseIn},set:function(t){this.FMouseIn!=t&&(this.FMouseIn=t,this._doUpdateView())}},{key:"ActiveDrawAnnotateIndex",get:function(){return this.FActiveDrawAnnotateIndex}},{key:"OnUpdateView",get:function(){return this.FOnUpdateView},set:function(t){this.FOnUpdateView=t}}]),t}(),cI=function(t){eI(i,t);var e=nI(i);function i(){var t;return tI(this,i),(t=e.call(this)).width_=500,t.height_=500,t.color=at.rgbaToColor(82,89,107),t.canFocus=!0,t.cursor=ue,t._canvas=document.createElement("canvas"),t._context=t._canvas.getContext("2d"),t.FDataBmpCanvas=new Dt(t._context),t.FDataBmpCanvas.prepareConext(or._scale),sr.Initialization(),0==lp.HCExtFormat&&(lp.HCExtFormat=or.clipboard.registerFormat()),t.FUndoList=new Ta,t.FUndoList.OnUndo=function(e){t.DoUndo(e)},t.FUndoList.OnRedo=function(e){t.DoRedo(e)},t.FUndoList.OnUndoNew=function(){return t.DoUndoNew()},t.FUndoList.OnUndoGroupStart=function(e,i){return t.DoUndoGroupBegin(e,i)},t.FUndoList.OnUndoGroupEnd=function(e,i){return t.DoUndoGroupEnd(e,i)},t.FUndoList.OnUndoDestroy=function(e){t.DoUndoDestroy(e)},t.FAnnotatePre=new hI,t.FAnnotatePre.OnUpdateView=function(e){t.DoAnnotatePreUpdateView(e)},t.BKCanvas=document.createElement("canvas"),t.BKContext=t.BKCanvas.getContext("2d"),t.BKImage=null,t.FBKImageVisible=!1,t.BKImagePrintVisible=!1,t.FBKImageLayout=vp,t.FUpdateCount=0,t.FFileName="",t.FViewWidth=0,t.FViewHeight=0,t.FIsChanged=!1,t.FCanEditChecked=!1,t.FCanEditSnapShot=!1,t.FZoom=1,t.FAutoZoom=!1,t.FPrintView=!1,t.FViewModel=Bs,t.FHScrollBarAutoVisible=!1,t.FPagePadding=20,t.ExtrnalCP=!0,t.FStyle=new cs(!0,!0),t.FStyle.OnInvalidateRect=function(e){t.DoStyleInvalidateRect(e)},t.FSections=new V,t.FSections.add(t.NewDefaultSection()),t.FActiveSectionIndex=0,t.FDisplayFirstSection=0,t.FDisplayLastSection=0,t.FVScrollBar=new Xv,t.FVScrollBar.orientation=Jt,t.FVScrollBar.align=Vt,t.FVScrollBar.onScroll=function(e,i,n){t.DoVerScroll(e,i,n)},t.FVScrollBar.OnPageUpClick=function(e){t.DoPageUp(e)},t.FVScrollBar.OnPageDownClick=function(e){t.DoPageDown(e)},t.FHScrollBar=new UF,t.FHScrollBar.orientation=Yt,t.FHScrollBar.addStatus(100),t.FHScrollBar.align=Vt,t.FHScrollBar.onScroll=function(e,i,n){t.DoHorScroll(e,i,n)},t.controls.add(t.FHScrollBar),t.controls.add(t.FVScrollBar),t.btnInfo=new on(""),t.btnInfo.textVisible=!1,t.btnInfo.image.src=or.application.icon.src,t.btnInfo.onClick=function(){null!=t.ShowCopyRight?t.ShowCopyRight():or.showMessage("欢迎使用HCView!")},t.controls.add(t.btnInfo),t.handle_=or.handleAllocate(),t.FCaret=new Rp,t.FCaret.control=rI(t),t.imeMode=Mi,t.FFrmSearch=null,t.OnCaretChange=null,t.OnVerScroll=null,t.OnHorScroll=null,t.OnSectionCreateItem=null,t.OnSectionReadOnlySwitch=null,t.OnSectionCurParaNoChange=null,t.OnSectionActivePageChange=null,t.OnSectionCreateStyleItem=null,t.OnSectionCaretItemChanged=null,t.OnSectionDataDomainSwitch=null,t.OnSectionCanEdit=null,t.OnSectionInsertTextBefor=null,t.OnSectionInsertItem=null,t.OnSectionRemoveItem=null,t.OnSectionDrawItemMouseMove=null,t.OnSectionSaveItem=null,t.OnSectionAcceptAction=null,t.OnSectionDrawItemPaintAfter=null,t.OnSectionDrawItemPaintBefor=null,t.OnSectionFloatItemPaintAfter=null,t.OnSectionPaintHeaderBefor=null,t.OnSectionPaintHeaderAfter=null,t.OnSectionPaintFooterBefor=null,t.OnSectionPaintFooterAfter=null,t.OnSectionPaintPageBefor=null,t.OnSectionPaintPageAfter=null,t.OnSectionPaintPaperBefor=null,t.OnSectionPaintPaperAfter=null,t.OnPaintViewBefor=null,t.OnPaintViewAfter=null,t.OnChange=null,t.OnChangedSwitch=null,t.OnZoomChanged=null,t.OnViewResize=null,t.OnStyleLoaded=null,t.CalcScrollRang(),t}return QF(i,[{key:"dispose",value:function(){this.FStyle.States.Include(Ip.Destroying),ZF(sI(i.prototype),"dispose",this).call(this)}},{key:"SetPrintBySectionInfo",value:function(t,e){}},{key:"GetViewWidth",value:function(){this.FVScrollBar.visible?this.FViewWidth=this.width-this.FVScrollBar.width:this.FViewWidth=this.width}},{key:"GetViewHeight",value:function(){this.FHScrollBar.visible?this.FViewHeight=this.height-this.FHScrollBar.height:this.FViewHeight=this.height}},{key:"GetSymmetryMargin",value:function(){return this.ActiveSection.SymmetryMargin}},{key:"SetSymmetryMargin",value:function(t){this.ActiveSection.SymmetryMargin!=t&&(this.ActiveSection.SymmetryMargin=t,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.DoMapChanged(),this.DoViewResize())}},{key:"SetBKImageVisible",value:function(t){this.FBKImageVisible!=t&&(this.FBKImageVisible=t,this.UpdateView())}},{key:"SetBKImageLayout",value:function(t){this.FBKImageLayout!=t&&(this.FBKImageLayout=t,this.UpdateView())}},{key:"DoVerScroll",value:function(t,e,i){this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo(),this.GetPagesAndActive(),null!=this.OnVerScroll&&this.OnVerScroll(this)}},{key:"DoHorScroll",value:function(t,e,i){this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo(),null!=this.OnHorScroll&&this.OnHorScroll(this)}},{key:"DoSectionDataChange",value:function(t){this.DoChange()}},{key:"DoSetChange",value:function(){this.FCanEditChecked=!1,this.SetIsChanged(!0),null!=this.OnChange&&this.OnChange(this)}},{key:"DoSectionChangeTopLevelData",value:function(t){this.DoViewResize()}},{key:"DoSectionDataCheckUpdateInfo",value:function(t){this.CheckUpdateInfo()}},{key:"DoLoadFromStream",value:function(t,e,i){var n=this;t.position=0;var o=lp._LoadFileFormatAndVersion(t),r=o.fileExt,s=o.fileVersion;if(r!=lp.HC_EXT&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!"),s>lp.HC_FileVersionInt&&or.exception("加载失败,当前编辑器最高支持版本为"+lp.HC_FileVersionInt.toString()+"的文件,无法打开版本为"+s.toString()+"的文件!"),this.DoLoadStreamBefor(t,s),e.LoadFromStream(t,s),null!=this.OnStyleLoaded&&this.OnStyleLoaded(e,s),s>55){var a=t.readByte();this.FBKImageVisible=or.system.isOdd(a>>7),this.BKImagePrintVisible=or.system.isOdd(a>>6),this.FBKImageLayout=t.readByte(),this.BKImage=lp.HCLoadImageFromStream(t),null!=this.BKImage&&(this.BKImage.onImageLoaded=function(){n.UpdateView()})}else this.BKImage=null;i(s,o.lang),this.DoLoadStreamAfter(t,s),this.DoMapChanged()}},{key:"DoUndoNew",value:function(){var t=new Pa;return t.SectionIndex=this.FActiveSectionIndex,t.HScrollPos=this.FHScrollBar.position,t.VScrollPos=this.FVScrollBar.position,t.Data=this.ActiveSection.ActiveData,t}},{key:"DoUndoGroupBegin",value:function(t,e){var i=new Ra;return i.SectionIndex=this.FActiveSectionIndex,i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.ActiveSection.ActiveData,i.CaretDrawItemNo=this.ActiveSection.ActiveData.CaretDrawItemNo,i}},{key:"DoUndoGroupEnd",value:function(t,e){var i=new Aa;return i.SectionIndex=this.FActiveSectionIndex,i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.ActiveSection.ActiveData,i.CaretDrawItemNo=this.ActiveSection.ActiveData.CaretDrawItemNo,i}},{key:"DoUndo",value:function(t){(t.isClass(Pa)||t.isClass(Ra))&&(this.FActiveSectionIndex!=t.SectionIndex&&this.SetActiveSectionIndex(t.SectionIndex),this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.ActiveSection.Undo(t)}},{key:"DoRedo",value:function(t){(t.isClass(Pa)||t.isClass(Aa))&&(this.FActiveSectionIndex!=t.SectionIndex&&this.SetActiveSectionIndex(t.SectionIndex),this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.ActiveSection.Redo(t)}},{key:"DoUndoDestroy",value:function(t){}},{key:"DoViewResize",value:function(){null!=this.OnViewResize&&this.OnViewResize(this)}},{key:"DoMapChanged",value:function(){0==this.FUpdateCount&&(this.CalcScrollRang(),this.CheckUpdateInfo())}},{key:"DoSectionReadOnlySwitch",value:function(t){null!=this.OnSectionReadOnlySwitch&&this.OnSectionReadOnlySwitch(this)}},{key:"DoSectionGetScreenCoord",value:function(t,e){var i=this.clientToScreen(G.Create(t,e));return G.Create(this.ZoomIn(i.x),this.ZoomIn(i.y))}},{key:"DoSectionItemResize",value:function(t,e){this.DoViewResize()}},{key:"DoSectionDrawItemAnnotate",value:function(t,e,i,n,o){var r=new aI;r.Data=e,r.DrawRect.resetRect(n),r.AnnotateItem=o,this.FAnnotatePre.AddDrawAnnotate(r)}},{key:"DoSectionGetUndoList",value:function(){return this.FUndoList}},{key:"DoSectionInsertAnnotate",value:function(t,e,i){this.FAnnotatePre.InsertDataAnnotate(i)}},{key:"DoSectionRemoveAnnotate",value:function(t,e,i){this.FAnnotatePre.RemoveDataAnnotate(i)}},{key:"DoSectionCurParaNoChange",value:function(t){null!=this.OnSectionCurParaNoChange&&this.OnSectionCurParaNoChange(t)}},{key:"DoSectionActivePageChange",value:function(t){null!=this.OnSectionActivePageChange&&this.OnSectionActivePageChange(t)}},{key:"DoStyleInvalidateRect",value:function(t){t?this.UpdateViewRect(t):this.UpdateView()}},{key:"DoAnnotatePreUpdateView",value:function(t){this.FAnnotatePre.Visible?(this.FStyle.UpdateInfoRePaint(),this.DoMapChanged()):this.UpdateView()}},{key:"NewDefaultSection",value:function(){var t=this,e=new _F(this.FStyle);return e.OnDataChange=function(e){t.DoSectionDataChange(e)},e.OnDataSetChange=function(){t.DoSetChange()},e.OnChangeTopLevelData=function(e){t.DoSectionChangeTopLevelData(e)},e.OnCheckUpdateInfo=function(e){t.DoSectionDataCheckUpdateInfo(e)},e.OnCreateItem=function(e){t.DoSectionCreateItem(e)},e.OnDataAcceptAction=function(e,i,n,o,r){return t.DoSectionAcceptAction(e,i,n,o,r)},e.OnCreateItemByStyle=function(e,i){return t.DoSectionCreateStyleItem(e,i)},e.OnPaintDomainRegion=function(e,i,n){return t.DoSectionPaintDomainRegion(e,i,n)},e.OnMatchTextStyleNoAt=function(e,i,n){return t.DoSectionMatchTextStyleNoAt(e,i,n)},e.OnCanEdit=function(e){return t.DoSectionCanEdit(e)},e.OnInsertTextBefor=function(e,i,n,o){return t.DoSectionInsertTextBefor(e,i,n,o)},e.OnInsertItem=function(e,i,n){t.DoSectionInsertItem(e,i,n)},e.OnRemoveItem=function(e,i,n){t.DoSectionRemoveItem(e,i,n)},e.OnSaveItem=function(e,i,n){return t.DoSectionSaveItem(e,i,n)},e.OnDrawItemMouseMove=function(e,i,n,o,r,s){t.DoSectionDrawItemMouseMove(e,i,n,o,r,s)},e.OnItemResize=function(e,i){t.DoSectionItemResize(e,i)},e.OnReadOnlySwitch=function(e){t.DoSectionReadOnlySwitch(e)},e.OnGetScreenCoord=function(e,i){return t.DoSectionGetScreenCoord(e,i)},e.OnDrawItemPaintAfter=function(e,i,n,o,r,s,a,l,h,c,u,f,d){t.DoSectionDrawItemPaintAfter(e,i,n,o,r,s,a,l,h,c,u,f,d)},e.OnDrawItemPaintBefor=function(e,i,n,o,r,s,a,l,h,c,u,f,d){t.DoSectionDrawItemPaintBefor(e,i,n,o,r,s,a,l,h,c,u,f,d)},e.OnPaintHeaderBefor=function(e,i,n,o,r){t.DoSectionPaintHeaderBefor(e,i,n,o,r)},e.OnPaintHeaderAfter=function(e,i,n,o,r){t.DoSectionPaintHeaderAfter(e,i,n,o,r)},e.OnPaintFooterBefor=function(e,i,n,o,r){t.DoSectionPaintFooterBefor(e,i,n,o,r)},e.OnPaintFooterAfter=function(e,i,n,o,r){t.DoSectionPaintFooterAfter(e,i,n,o,r)},e.OnPaintPageBefor=function(e,i,n,o,r){t.DoSectionPaintPageBefor(e,i,n,o,r)},e.OnPaintPageAfter=function(e,i,n,o,r){t.DoSectionPaintPageAfter(e,i,n,o,r)},e.OnPaintPaperBefor=function(e,i,n,o,r){t.DoSectionPaintPaperBefor(e,i,n,o,r)},e.OnPaintPaperAfter=function(e,i,n,o,r){t.DoSectionPaintPaperAfter(e,i,n,o,r)},e.OnInsertAnnotate=function(e,i,n){t.DoSectionInsertAnnotate(e,i,n)},e.OnRemoveAnnotate=function(e,i,n){t.DoSectionRemoveAnnotate(e,i,n)},e.OnDrawItemAnnotate=function(e,i,n,o,r){t.DoSectionDrawItemAnnotate(e,i,n,o,r)},e.OnGetUndoList=function(){return t.DoSectionGetUndoList()},e.OnCurParaNoChange=function(e){t.DoSectionCurParaNoChange(e)},e.OnCaretItemChanged=function(e,i,n){t.DoSectionCaretItemChanged(e,i,n)},e.OnDataDomainSwitch=function(e,i,n){t.DoSectionDataDomainSwitch(e,i,n)},e.OnActivePageChange=function(e){t.DoSectionActivePageChange(e)},e.OnFloatItemPaintAfter=function(e,i,n,o,r){t.DoSectionFloatItemPaintAfter(e,i,n,o,r)},e}},{key:"GetViewRect",value:function(){return U.CreateByBounds(0,0,this.FViewWidth,this.FViewHeight)}},{key:"GetPageIndexFilmTop",value:function(t){var e=this.GetSectionPageIndexByPageIndex(t,-1),i=e.pageIndex,n=e.result,o=this.GetSectionTopFilm(n);return i>0&&(this.FSections[n].ViewModel==Bs?o+=i*(this.FPagePadding+this.FSections[n].PaperHeightPix):o+=i*(this.FPagePadding+this.FSections[n].GetPageHeight())),o}},{key:"DoPageUp",value:function(t){var e=this.GetPagePreviewFirst();this.FVScrollBar.position=e>0?this.GetPageIndexFilmTop(e-1):0}},{key:"DoPageDown",value:function(t){var e=this.GetPagePreviewFirst();ethis.FViewHeight&&(this.FVScrollBar.position=this.FVScrollBar.position+this.FCaret.Y+this.FCaret.Height+this.FPagePadding-this.FViewHeight)}finally{this.FCaret.VScroll=!1}}if(!this.FCaret.HScroll){this.FCaret.HScroll=!0;try{this.FCaret.X<0?this.FHScrollBar.position=this.FHScrollBar.position+this.FCaret.X-this.FPagePadding:this.FCaret.X+this.FPagePadding>this.FViewWidth&&(this.FHScrollBar.position=this.FHScrollBar.position+this.FCaret.X+this.FPagePadding-this.FViewWidth)}finally{this.FCaret.HScroll=!1}}}}else{if(this.FCaret.X<0||this.FCaret.X>this.FViewWidth)return void this.FCaret.Hide();if(this.FCaret.Y+this.FCaret.Height<0||this.FCaret.Y>this.FViewHeight)return void this.FCaret.Hide()}this.FCaret.VScroll||this.FCaret.HScroll||(this.FCaret.Y+this.FCaret.Height>this.FViewHeight&&(this.FCaret.Height=this.FViewHeight-this.FCaret.Y),this.FCaret.Show(),this.DoCaretChange())}else this.FCaret.Hide()}else this.FCaret.Hide()}},{key:"GetSectionByCrood",value:function(t,e,i){i=-1;for(var n=0,o=0;o<=this.FSections.count-1;o++)if((n+=this.FSections[o].GetFilmHeight())>e){i=o;break}return i<0&&n+this.FPagePadding>=e&&(i=this.FSections.count-1),i<0&&(i=0),i}},{key:"SetZoom",value:function(t){var e=t;e<.25?e=.25:e>5&&(e=5),this.FZoom!=e&&(this.FZoom=e,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),null!=this.OnZoomChanged&&this.OnZoomChanged(this),this.DoMapChanged(),this.DoViewResize())}},{key:"GetHScrollValue",value:function(){return this.FHScrollBar.position}},{key:"GetCurStyleNo",value:function(){return this.ActiveSection.CurStyleNo}},{key:"GetCurParaNo",value:function(){return this.ActiveSection.CurParaNo}},{key:"GetShowLineActiveMark",value:function(){return this.FSections[0].Page.ShowLineActiveMark}},{key:"SetShowLineActiveMark",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].Page.ShowLineActiveMark=t;this.UpdateView()}},{key:"GetShowLineNo",value:function(){return this.FSections[0].Page.ShowLineNo}},{key:"SetShowLineNo",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].Page.ShowLineNo=t;this.UpdateView()}},{key:"GetShowUnderLine",value:function(){return this.FSections[0].Page.ShowUnderLine}},{key:"SetShowUnderLine",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].Page.ShowUnderLine=t;this.UpdateView()}},{key:"GetReadOnly",value:function(){for(var t=0;t<=this.FSections.count-1;t++)if(!this.FSections[t].ReadOnly)return!1;return!0}},{key:"SetReadOnly",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].ReadOnly=t;this.UpdateView()}},{key:"SetViewModel",value:function(t){if(this.FViewModel!=t){this.FViewModel=t;for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].ViewModel=t;this.PagePadding=t==Bs?20:0}}},{key:"SetPrintView",value:function(t){this.FPrintView!=t&&(this.FPrintView=t,t&&!this.ReadOnly&&(this.ReadOnly=!0),this.UpdateView())}},{key:"SetActiveSectionIndex",value:function(t){this.FActiveSectionIndex!=t&&(this.FActiveSectionIndex>=0&&this.FSections[this.FActiveSectionIndex].DisActive(),this.FActiveSectionIndex=t,this.DoViewResize())}},{key:"SetIsChanged",value:function(t){this.FIsChanged!=t&&(this.FIsChanged=t,null!=this.OnChangedSwitch&&this.OnChangedSwitch(this))}},{key:"SetPagePadding",value:function(t){if(this.FPagePadding!=t){this.FPagePadding=t;for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].PagePadding=this.FPagePadding;this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.DoMapChanged(),this.DoViewResize()}}},{key:"GetActiveSection",value:function(){return this.FSections[this.FActiveSectionIndex]}},{key:"AutoScrollTimer",value:function(t){}},{key:"GetPagesAndActive",value:function(){this.FHScrollBar.Statuses[0].text="预览"+(this.PagePreviewFirst+1).toString()+" 光标"+(this.ActivePageIndex+1).toString()+"/"+this.PageCount.toString()+"页"}},{key:"ResetCanEditShot",value:function(){this.FCanEditChecked=!1,this.FCanEditSnapShot=!1}},{key:"doContextMenu_",value:function(t,e){if(this.popupMenu){var i=this.clientToScreen(new G(0,0));this.popupMenu.popup(i.x+t,i.y+e)}}},{key:"doPaint_",value:function(t){t.bitBlt(0,0,this.FViewWidth,this.FViewHeight,this.FDataBmpCanvas,0,0,this.FViewWidth,this.FViewHeight),t.brush.color=this.color,t.fillBounds(this.FVScrollBar.left,this.FHScrollBar.top,this.FVScrollBar.width,this.FHScrollBar.height),ZF(sI(i.prototype),"doPaint_",this).call(this,t)}},{key:"doSetBounds_",value:function(){this.FHScrollBar.top=this.height-this.FHScrollBar.height,this.FHScrollBar.width=this.width-this.FVScrollBar.width,this.FHScrollBarAutoVisible&&(this.FHScrollBar.visible=this.FHScrollBar.pageSize0&&this.FViewHeight>0&&(this._canvas.width=this.FViewWidth,this._canvas.height=this.FViewHeight,this._context=this._canvas.getContext("2d"),this.FDataBmpCanvas=new Dt(this._context),this.FDataBmpCanvas.prepareConext(or._scale)),this.FAutoZoom&&(this.FAnnotatePre.Visible?this.FZoom=(this.FViewWidth-2*this.FPagePadding)/(this.ActiveSection.PaperWidthPix+lp.AnnotationWidth):this.FZoom=(this.FViewWidth-2*this.FPagePadding)/this.ActiveSection.PaperWidthPix),this.CalcScrollRang(),this.FStyle.UpdateInfoRePaint(),null!=this.FCaret&&this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo(),this.DoViewResize()}},{key:"DoChange",value:function(){this.DoMapChanged(),this.DoSetChange()}},{key:"DoCaretChange",value:function(){this.GetPagesAndActive(),null!=this.OnCaretChange&&this.OnCaretChange(this,null)}},{key:"DoKillFocus",value:function(){null!=this.FCaret&&(this.FCaret.Hide(!0),this.UpdateViewRect(U.CreateByBounds(this.FCaret.X-1,this.FCaret.Y,this.FCaret.Width+1,this.FCaret.Height)))}},{key:"DoSectionCreateItem",value:function(t){null!=this.OnSectionCreateItem&&this.OnSectionCreateItem(this)}},{key:"DoSectionAcceptAction",value:function(t,e,i,n,o){return null==this.OnSectionAcceptAction||this.OnSectionAcceptAction(t,e,i,n,o)}},{key:"DoSectionCreateStyleItem",value:function(t,e){return null!=this.OnSectionCreateStyleItem?this.OnSectionCreateStyleItem(t,e):null}},{key:"DoSectionPaintDomainRegion",value:function(t,e,i){return!0}},{key:"DoSectionMatchTextStyleNoAt",value:function(t,e,i){return cs.Null}},{key:"DoSectionCaretItemChanged",value:function(t,e,i){null!=this.OnSectionCaretItemChanged&&this.OnSectionCaretItemChanged(t,e,i)}},{key:"DoSectionDataDomainSwitch",value:function(t,e,i){null!=this.OnSectionDataDomainSwitch&&this.OnSectionDataDomainSwitch(t,e,i)}},{key:"DoSectionCreateFloatStyleItem",value:function(t,e){return null!=this.FOnSectionCreateFloatStyleItem?this.FOnSectionCreateFloatStyleItem(t,e):null}},{key:"DoSectionInsertItem",value:function(t,e,i){null!=this.OnSectionInsertItem&&this.OnSectionInsertItem(t,e,i)}},{key:"DoSectionRemoveItem",value:function(t,e,i){null!=this.OnSectionRemoveItem&&this.OnSectionRemoveItem(t,e,i)}},{key:"DoSectionSaveItem",value:function(t,e,i){return null==this.OnSectionSaveItem||this.OnSectionSaveItem(t,e,i)}},{key:"DoSectionDrawItemMouseMove",value:function(t,e,i,n,o,r){null!=this.OnSectionDrawItemMouseMove&&this.OnSectionDrawItemMouseMove(t,e,i,n,o,r)}},{key:"DoSectionCanEdit",value:function(t){var e=!0;return this.Style.States.Contain(Ip.Loading)||null==this.OnSectionCanEdit||(e=this.OnSectionCanEdit(t)),this.FCanEditChecked=!0,this.FCanEditSnapShot=e,e}},{key:"DoSectionInsertTextBefor",value:function(t,e,i,n){return null==this.OnSectionInsertTextBefor||this.OnSectionInsertTextBefor(t,e,i,n)}},{key:"DoSectionPaintHeaderBefor",value:function(t,e,i,n,o){null!=this.OnSectionPaintHeaderBefor&&this.OnSectionPaintHeaderBefor(t,e,i,n,o)}},{key:"DoSectionPaintHeaderAfter",value:function(t,e,i,n,o){null!=this.OnSectionPaintHeaderAfter&&this.OnSectionPaintHeaderAfter(t,e,i,n,o)}},{key:"DoSectionPaintFooterBefor",value:function(t,e,i,n,o){null!=this.OnSectionPaintFooterBefor&&this.OnSectionPaintFooterBefor(t,e,i,n,o)}},{key:"DoSectionPaintFooterAfter",value:function(t,e,i,n,o){var r=t;if(r.PageNoVisible){for(var s=this.FSections.indexOf(r),a=0,l=0,h=0;h<=this.FSections.count-1;h++)h==s&&(a=l),l+=this.FSections[h].PageCount;var c=C.stringFormat(r.PageNoFormat,a+r.PageNoFrom+e,l);n.font.size=10,n.font.name="宋体",n.font.color=at.Black,n.font.styles.clear(),n.textOut(i.left+Math.trunc((i.width-n.textWidth(c))/2),i.top+r.Footer.height,c)}null!=this.OnSectionPaintFooterAfter&&this.OnSectionPaintFooterAfter(r,e,i,n,o)}},{key:"DoSectionPaintPageBefor",value:function(t,e,i,n,o){null!=this.OnSectionPaintPageBefor&&this.OnSectionPaintPageBefor(t,e,i,n,o)}},{key:"DoSectionPaintPageAfter",value:function(t,e,i,n,o){null!=this.OnSectionPaintPageAfter&&this.OnSectionPaintPageAfter(t,e,i,n,o)}},{key:"DoSectionPaintPaperBefor",value:function(t,e,i,n,o){if(o.Print&&this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.ClearDrawAnnotate(),null!==this.BKImage&&this.BKImage.loaded){if(o.Print?this.BKImagePrintVisible:this.FBKImageVisible)switch(this.FBKImageLayout){case vp:n.drawImage(i.left,i.top,this.BKImage.image);break;case Fp:n.drawImage(i.left+(i.width-this.BKImage.width)/2,i.top+(i.height-this.BKImage.height)/2,this.BKImage.image);break;case pp:this.BKCanvas.width=i.width,this.BKCanvas.height=i.height,this.BKContext.fillStyle=this.BKContext.createPattern(this.BKImage.image,"repeat"),this.BKContext.fillRect(0,0,i.width,i.height),n.h5context.drawImage(this.BKCanvas,0,0,i.width,i.height,i.left,i.top,i.width,i.height);break;case Sp:n.drawImageRect(i,this.BKImage.image)}}null!=this.OnSectionPaintPaperBefor&&this.OnSectionPaintPaperBefor(t,e,i,n,o)}},{key:"DoSectionPaintPaperAfter",value:function(t,e,i,n,o){!o.Print&&this.FViewModel==Bs&&t.PagePadding>10&&(n.font.size=10,n.font.name="宋体",n.font.color="#d0d1d5",n.font.styles.clear()),this.FAnnotatePre.Visible&&this.FAnnotatePre.PaintDrawAnnotate(t,i,n,o),null!=this.OnSectionPaintPaperAfter&&this.OnSectionPaintPaperAfter(t,e,i,n,o)}},{key:"DoSectionDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){null!=this.OnSectionDrawItemPaintBefor&&this.OnSectionDrawItemPaintBefor(this,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoSectionDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){""!=e.Items[i].HyperLink&&(u.pen.style=pt.Solid,u.pen.color="rgb(0, 0, 255)",u.pen.width=1,u.drawLineDriect(o.left,o.bottom,o.right,o.bottom)),null!=this.OnSectionDrawItemPaintAfter&&this.OnSectionDrawItemPaintAfter(this,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoSectionDrawItemPaintContent",value:function(){}},{key:"DoSectionFloatItemPaintAfter",value:function(t,e,i,n,o){null!==this.OnSectionFloatItemPaintAfter&&this.OnSectionFloatItemPaintAfter(t,e,i,n,o)}},{key:"DoInsertText",value:function(t){return this.ActiveSection.InsertText(t)}},{key:"DoCopyRequest",value:function(t){var e=this.ActiveSection.GetTopLevelItem();return!e.isClass($u)||!e.SelectTextExists()||t==Ao}},{key:"DoPasteRequest",value:function(t){return!this.ActiveSection.GetTopLevelItem().isClass($u)||t==Ao}},{key:"DoPasteFormatStream",value:function(t){return!0}},{key:"DoCopyAsStream",value:function(t){}},{key:"DoPaintViewBefor",value:function(t,e){null!=this.OnPaintViewBefor&&this.OnPaintViewBefor(t,e)}},{key:"DoPaintViewAfter",value:function(t,e){null!=this.OnPaintViewAfter&&this.OnPaintViewAfter(t,e)}},{key:"DoSaveStreamBefor",value:function(t){}},{key:"DoSaveStreamAfter",value:function(t){}},{key:"DoLoadStreamBefor",value:function(t,e){this.ResetCanEditShot()}},{key:"DoLoadStreamAfter",value:function(t,e){}},{key:"DoSaveXmlDocument",value:function(t){}},{key:"DoLoadXmlDocument",value:function(t){this.ResetCanEditShot()}},{key:"doSetFocus_",value:function(t){ZF(sI(i.prototype),"doSetFocus_",this).call(this,t),this.focused&&this.imeMode==Mi&&or.ime.setControl(this)}},{key:"imeActive",value:function(){this.FCaret.Visible&&this.FCaret.Show()}},{key:"doMouseDown_",value:function(t){ZF(sI(i.prototype),"doMouseDown_",this).call(this,t);var e=this.GetSectionByCrood(this.ZoomOut(this.FHScrollBar.position+t.x),this.ZoomOut(this.FVScrollBar.position+t.y),-1);if(e!=this.FActiveSectionIndex&&this.SetActiveSectionIndex(e),!(this.FActiveSectionIndex<0)){var n=this.GetSectionDrawLeft(this.FActiveSectionIndex);this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.MouseDown(this.ZoomOut(t.x),this.ZoomOut(t.y));var o=new G;o.x=this.ZoomOut(this.FHScrollBar.position+t.x)-n,o.y=this.ZoomOut(this.FVScrollBar.position+t.y)-this.GetSectionTopFilm(this.FActiveSectionIndex);var r=new ei;r.assign(t),r.x=o.x,r.y=o.y,this.FSections[this.FActiveSectionIndex].MouseDown(r),this.CheckUpdateInfo()}}},{key:"doMouseMove_",value:function(t){if(ZF(sI(i.prototype),"doMouseMove_",this).call(this,t),this.FActiveSectionIndex>=0){var e=new ei;e.assign(t),e.x=this.ZoomOut(this.FHScrollBar.position+t.x)-this.GetSectionDrawLeft(this.FActiveSectionIndex),e.y=this.ZoomOut(this.FVScrollBar.position+t.y)-this.GetSectionTopFilm(this.FActiveSectionIndex),this.FSections[this.FActiveSectionIndex].MouseMove(e),this.FStyle.UpdateInfo.Selecting&&this.AutoScrollTimer(!0)}this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.MouseMove(this.ZoomOut(t.x),this.ZoomOut(t.y)),this.CheckUpdateInfo(),this.cursor=lp.GCursor}},{key:"doMouseUp_",value:function(t){if(this.FStyle.UpdateInfo.Selecting&&this.AutoScrollTimer(!1),t.button==ie)return ZF(sI(i.prototype),"doMouseUp_",this).call(this,t),void(this.FStyle.States.Contain(Ip.FormatBrushing)&&this.FStyle.States.Exclude(Ip.FormatBrushing));if(this.FActiveSectionIndex>=0){var e=new ei;e.assign(t),e.x=this.ZoomOut(this.FHScrollBar.position+t.x)-this.GetSectionDrawLeft(this.FActiveSectionIndex),e.y=this.ZoomOut(this.FVScrollBar.position+t.y)-this.GetSectionTopFilm(this.FActiveSectionIndex),this.FSections[this.FActiveSectionIndex].MouseUp(e)}this.FStyle.UpdateInfo.DragingSelected&&(lp.GCursor=oe),this.cursor=lp.GCursor,this.imeMode==Mi&&or.ime.setControl(this),ZF(sI(i.prototype),"doMouseUp_",this).call(this,t),this.CheckUpdateInfo(),this.FStyle.UpdateInfo.Selecting&&(this.FStyle.UpdateInfo.Selecting=!1,this.FStyle.States.Contain(Ip.FormatBrushing)&&this.ApplyTextStyleNo(this.FStyle.FormatBrushStyleNo)),this.FStyle.States.Contain(Ip.FormatBrushing)&&this.FStyle.States.Exclude(Ip.FormatBrushing),this.FStyle.UpdateInfo.DragingSelected=!1}},{key:"doMouseWheel_",value:function(t){or.keyDownStates[_e]||(or.keyDownStates[Re]?this.FHScrollBar.position-=t.delta:this.FVScrollBar.position-=t.delta)}},{key:"doKeyDown_",value:function(t){or.keyDownStates[_e]&&t.keyCode==Ve?this.ShowSearchForm():or.keyDownStates[_e]&&t.keyCode==He?this.SelectAll():or.keyDownStates[_e]&&t.keyCode==je?this.Undo():or.keyDownStates[_e]&&t.keyCode==ze?this.Redo():this.ActiveSection.KeyDown(t),ZF(sI(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"doKeyUp_",value:function(t){ZF(sI(i.prototype),"doKeyUp_",this).call(this,t),this.ActiveSection.KeyUp(t)}},{key:"doKeyPress_",value:function(t){ZF(sI(i.prototype),"doKeyPress_",this).call(this,t),or.keyDownStates[_e]||this.ActiveSection.KeyPress(t)}},{key:"imeInput",value:function(t){""!=t&&this.InsertText(t)}},{key:"DataSaveLiteStream",value:function(t,e){lp._SaveFileFormatAndVersion(t),this.FStyle.SaveToStream(t),e()}},{key:"DataLoadLiteStream",value:function(t,e){var i=lp._LoadFileFormatAndVersion(t),n=new cs;n.LoadFromStream(t,i.fileVersion),e(i.fileVersion,n)}},{key:"CalcScrollRang",value:function(){var t=0,e=0,i=0;if(this.FViewModel==Bs){e=this.FSections[0].PaperWidthPix;for(var n=0;n<=this.FSections.count-1;n++)t+=this.FSections[n].GetFilmHeight(),(i=this.FSections[n].PaperWidthPix)>e&&(e=i)}else{e=this.FSections[0].GetPageWidth();for(var o=0;o<=this.FSections.count-1;o++)t+=this.FSections[o].GetFilmHeight(),(i=this.FSections[o].GetPageWidth())>e&&(e=i)}this.FAnnotatePre.Visible&&(e+=lp.AnnotationWidth),t=this.ZoomIn(t+this.FPagePadding),e=this.ZoomIn(e+this.FPagePadding+this.FPagePadding),this.FVScrollBar.max=t,this.FHScrollBar.max=e}},{key:"CheckUpdateInfo",value:function(){this.FUpdateCount>0||(null!=this.FCaret&&this.FStyle.UpdateInfo.ReCaret&&(this.ReBuildCaret(),this.FStyle.UpdateInfo.ReCaret=!1,this.FStyle.UpdateInfo.ReStyle=!1,this.FStyle.UpdateInfo.ReScroll=!1),this.FStyle.UpdateInfo.RePaint&&(this.FStyle.UpdateInfo.RePaint=!1,this.UpdateView()))}},{key:"InitializeComponent",value:function(){this.SuspendLayout(),this.Name="HCView",this.ResumeLayout(!1)}},{key:"DeleteUnUsedStyle",value:function(t,e,i){t.TextStyles[0].CheckSaveUsed=!0,t.TextStyles[0].TempNo=0;for(var n=1;ncs.Null&&(h.CurStyleNo=t.TextStyles[h.CurStyleNo].TempNo),h.CurParaNo=t.ParaStyles[h.CurParaNo].TempNo;for(var u=t.TextStyles.count-1;u>=1;u--)t.TextStyles[u].CheckSaveUsed||t.TextStyles.delete(u);for(var f=t.ParaStyles.count-1;f>=0;f--)t.ParaStyles[f].CheckSaveUsed||t.ParaStyles.delete(f)}},{key:"ResetActiveSectionMargin",value:function(){this.ActiveSection.ResetMargin(),this.DoViewResize()}},{key:"ActiveItemReAdaptEnvironment",value:function(){this.ActiveSection.ActiveItemReAdaptEnvironment()}},{key:"Clear",value:function(){this.BeginUpdate();try{this.FStyle.Initialize(),this.FSections.removeRange(1,this.FSections.count-1),this.FActiveSectionIndex=0,this.FDisplayFirstSection=-1,this.FDisplayLastSection=-1,this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.FSections[0].Clear(),this.FUndoList.clear()}finally{this.FUndoList.RestoreState()}this.FHScrollBar.position=0,this.FVScrollBar.position=0,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoMapChanged(),this.DoViewResize()}finally{this.EndUpdate()}}},{key:"ClearUndo",value:function(){this.FUndoList.clear()}},{key:"DisSelect",value:function(){this.ActiveSection.DisSelect(),this.DoSectionDataCheckUpdateInfo(this,null)}},{key:"DeleteSelected",value:function(){this.ActiveSection.DeleteSelected()}},{key:"DeleteActiveDomain",value:function(){return this.ActiveSection.DeleteActiveDomain()}},{key:"DeleteActiveAnnotate",value:function(){return this.ActiveSection.DeleteActiveAnnotate()}},{key:"DeleteActiveDataItems",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e0&&(this.FSections.delete(this.FActiveSectionIndex),this.FActiveSectionIndex=this.FActiveSectionIndex-1,this.FDisplayFirstSection=-1,this.FDisplayLastSection=-1,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoChange())}},{key:"FormatData",value:function(){for(var t=0;t<=this.FSections.count-1;t++)this.FSections[t].FormatData(),this.FSections[t].BuildSectionPages(0);this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoMapChanged()}},{key:"InsertStream",value:function(t){var e=this,i=!1;this.BeginUpdate();try{var n=new cs;this.DoLoadFromStream(t,n,(function(o,r){if(t.readByte(),o>42)return e.ActiveSection.SeekStreamToArea(t,n,o,dp.Page),void(i=e.ActiveSection.InsertStream(t,n,o));var s=new _F(n);s.OnCreateItemByStyle=function(t,i){return e.DoSectionCreateStyleItem(t,i)};var a=new K;s.LoadFromStream(t,n,o),s.Page.SaveToStream(a),a.position=0,a.readBoolean(),a.readInt64(),i=e.ActiveSection.InsertStream(a,n,lp.HC_FileVersionInt)}))}finally{this.EndUpdate()}return i}},{key:"InsertLiteStream",value:function(t){var e=this,i=!1;return this.DataLoadLiteStream(t,(function(n,o){e.BeginUpdate();try{i=e.ActiveSection.InsertStream(t,o,n)}finally{e.EndUpdate()}})),i}},{key:"AppendStream",value:function(t){return this.ActiveSection.ActiveData.SelectLastItemAfterWithCaret(),this.InsertBreak(),this.ApplyParaAlignHorz(dr),this.InsertStream(t)}},{key:"LoadHeaderFromStream",value:function(t,e){var i=this,n=!1;this.BeginUpdate();try{var o=new cs;this.DoLoadFromStream(t,o,(function(r,s){if(t.readByte(),r>42){i.ActiveSection.Header.BeginFormat();try{i.ActiveSection.SeekStreamToArea(t,o,r,dp.Header,e),i.ActiveSection.Header.LoadFromStream(t,o,r)}finally{i.ActiveSection.Header.EndFormat(!1)}i.ResetActiveSectionMargin(),n=!0}}))}finally{this.EndUpdate()}return n}},{key:"LoadFooterFromStream",value:function(t,e){var i=this,n=!1;this.BeginUpdate();try{var o=new cs;this.DoLoadFromStream(t,o,(function(r,s){if(t.readByte(),r>42){i.ActiveSection.Footer.BeginFormat();try{i.ActiveSection.SeekStreamToArea(t,o,r,dp.Footer,e),i.ActiveSection.Footer.LoadFromStream(t,o,r)}finally{i.ActiveSection.Footer.EndFormat(!1)}i.ResetActiveSectionMargin(),n=!0}}))}finally{this.EndUpdate()}return n}},{key:"InsertText",value:function(t){this.BeginUpdate();try{return this.DoInsertText(t)}finally{this.EndUpdate()}}},{key:"InsertTable",value:function(t,e){this.BeginUpdate();try{return this.ActiveSection.InsertTable(t,e)}finally{this.EndUpdate()}}},{key:"InsertImageFile",value:function(t){}},{key:"InsertImage",value:function(t){this.BeginUpdate();try{return this.ActiveSection.InsertImage(t)}finally{this.EndUpdate()}}},{key:"InsertGifImage",value:function(t){this.BeginUpdate();try{return this.ActiveSection.InsertGifImage(t)}finally{this.EndUpdate()}}},{key:"InsertLine",value:function(t){return this.ActiveSection.InsertLine(t)}},{key:"InsertItem",value:function(t){return this.ActiveSection.InsertItem(t)}},{key:"InsertItemEx",value:function(t,e){return this.ActiveSection.InsertItemEx(t,e)}},{key:"InsertFloatItem",value:function(t){return this.ActiveSection.InsertFloatItem(t)}},{key:"InsertAnnotate",value:function(t,e){return this.ActiveSection.InsertAnnotate(t,e)}},{key:"InsertBreak",value:function(){return this.ActiveSection.InsertBreak()}},{key:"InsertPageBreak",value:function(){return this.ActiveSection.InsertPageBreak()}},{key:"InsertSectionBreak",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ReadOnly)return!1;var i=!1;this.BeginUpdate();try{var n=this.NewDefaultSection();n.PageNoFormat=this.FSections[this.FActiveSectionIndex].PageNoFormat,n.AssignPaper(this.FSections[this.FActiveSectionIndex]),t&&n.Header.Clone(this.FSections[this.FActiveSectionIndex].Header),e&&n.Footer.Clone(this.FSections[this.FActiveSectionIndex].Footer),this.FSections.insert(this.FActiveSectionIndex+1,n),this.FActiveSectionIndex=this.FActiveSectionIndex+1,i=!0,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.FStyle.UpdateInfoReScroll(),this.DoChange()}finally{this.EndUpdate()}return i}},{key:"InsertDomain",value:function(t){return this.ActiveSection.InsertDomain(t)}},{key:"SetActiveImage",value:function(t){return this.ActiveSection.SetActiveImage(t)}},{key:"ActiveTableResetRowCol",value:function(t,e){return this.ActiveSection.ActiveTableResetRowCol(t,e)}},{key:"ActiveTableInsertRowAfter",value:function(t){return this.ActiveSection.ActiveTableInsertRowAfter(t)}},{key:"ActiveTableInsertRowBefor",value:function(t){return this.ActiveSection.ActiveTableInsertRowBefor(t)}},{key:"ActiveTableDeleteCurRow",value:function(){return this.ActiveSection.ActiveTableDeleteCurRow()}},{key:"ActiveTableDeleteRowFrom",value:function(t,e){return this.ActiveSection.ActiveTableDeleteRowFrom(t,e)}},{key:"ActiveTableSplitCurRow",value:function(){return this.ActiveSection.ActiveTableSplitCurRow()}},{key:"ActiveTableSplitCurCol",value:function(){return this.ActiveSection.ActiveTableSplitCurCol()}},{key:"ActiveTableInsertColBefor",value:function(t){return this.ActiveSection.ActiveTableInsertColBefor(t)}},{key:"ActiveTableInsertColAfter",value:function(t){return this.ActiveSection.ActiveTableInsertColAfter(t)}},{key:"ActiveTableDeleteCurCol",value:function(){return this.ActiveSection.ActiveTableDeleteCurCol()}},{key:"ApplyParaAlignHorz",value:function(t){this.ActiveSection.ApplyParaAlignHorz(t)}},{key:"ApplyParaAlignVert",value:function(t){this.ActiveSection.ApplyParaAlignVert(t)}},{key:"ApplyParaBackColor",value:function(t){this.ActiveSection.ApplyParaBackColor(t)}},{key:"ApplyParaBreakRough",value:function(t){this.ActiveSection.ApplyParaBreakRough(t)}},{key:"ApplyParaLineSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.ActiveSection.ApplyParaLineSpace(t,e)}},{key:"ApplyParaLeftIndentAdd",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.ActiveSection.ApplyParaLeftIndent(this.FStyle.ParaStyles[this.CurParaNo].LeftIndent+sr.pixXToMillimeter(lp.TabCharWidth)):this.ActiveSection.ApplyParaLeftIndent(Math.max(0,this.FStyle.ParaStyles[this.CurParaNo].LeftIndent-sr.pixXToMillimeter(lp.TabCharWidth)))}},{key:"ApplyParaLeftIndent",value:function(t){this.ActiveSection.ApplyParaLeftIndent(t)}},{key:"ApplyParaRightIndent",value:function(t){this.ActiveSection.ApplyParaRightIndent(t)}},{key:"ApplyParaFirstIndent",value:function(t){this.ActiveSection.ApplyParaFirstIndent(t)}},{key:"ApplyBullet",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";this.ActiveSection.ApplyBullet(t,e,i,n)}},{key:"ApplyTextStyle",value:function(t){this.ActiveSection.ApplyTextStyle(t)}},{key:"ApplyTextStyleNo",value:function(t){t>cs.Null&&this.ActiveSection.ApplyTextStyleNo(t)}},{key:"ApplyTextFontName",value:function(t){this.ActiveSection.ApplyTextFontName(t)}},{key:"ApplyTextFontSize",value:function(t){this.ActiveSection.ApplyTextFontSize(t)}},{key:"ApplyTextColor",value:function(t){this.ActiveSection.ApplyTextColor(t)}},{key:"ApplyTextBackColor",value:function(t){this.ActiveSection.ApplyTextBackColor(t)}},{key:"ApplyTableCellAlign",value:function(t){this.ActiveSection.ApplyTableCellAlign(t)}},{key:"SelectAll",value:function(){for(var t=0;t<=this.FSections.count-1;t++)this.FSections[t].SelectAll();this.FStyle.UpdateInfoRePaint(),this.CheckUpdateInfo()}},{key:"doCut_",value:function(t){this.FStyle.States.Include(Ip.Cutting);try{this.doCopy_(t),this.ActiveSection.DeleteSelected(),this.doCutAfter_()}finally{this.FStyle.States.Exclude(Ip.Cutting)}}},{key:"doCutAfter_",value:function(){null!=this.OnCutAfter&&this.OnCutAfter()}},{key:"doCopy_",value:function(t){var e=this;if(or.localStorage.removeItem(g),or.localStorage.removeItem(lp.HC_EXT),this.ActiveSection.SelectExists()){this.FStyle.States.Include(Ip.Copying);try{if(this.DoCopyRequest(Ao)){var i=this.ActiveSectionTopLevelData().SaveSelectToText();or.localStorage.setString(g,i),this.ExtrnalCP&&t.clipboardData.setData(I.TXT,i)}if(this.DoCopyRequest(lp.HCExtFormat)){var n=new K;this.DoCopyAsStream(n),this.DataSaveLiteStream(n,(function(){e.ActiveSectionTopLevelData().SaveSelectToStream(n)})),or.localStorage.setStream(lp.HC_EXT,n),this.ExtrnalCP&&t.clipboardData.setData(lp.HC_EXT,n.toJSONString())}this.FStyle.States.Contain(Ip.Cutting)||this.doCopyAfter_()}finally{this.FStyle.States.Exclude(Ip.Copying)}}}},{key:"CopyAsText",value:function(){this.DoCopyRequest(Ao)&&(or.localStorage.setString(g,this.ActiveSectionTopLevelData().SaveSelectToText()),this.doCopyAfter_())}},{key:"doCopyAfter_",value:function(){null!=this.OnCopyAfter&&this.OnCopyAfter()}},{key:"doPaste_",value:function(t){var e=this;if(this.ExtrnalCP){if(this.doPasteBefor_()){this.FStyle.States.Include(Ip.Pasting);try{if(t.clipboardData.types.indexOf(lp.HC_EXT)>-1&&this.DoPasteRequest(lp.HCExtFormat)){var i=new K;if(i.fromJSONString(t.clipboardData.getData(lp.HC_EXT)),!this.DoPasteFormatStream(i))return;this.InsertLiteStream(i)}else if(t.clipboardData.types.indexOf(I.TXT)>-1&&this.DoPasteRequest(Ao))this.InsertText(t.clipboardData.getData(I.TXT));else{var n=t.clipboardData.types.indexOf("Files");if(n>-1){var o=t.clipboardData.items[n].type;if(o==I.PNG&&this.DoPasteRequest(No)||o==I.JPEG&&this.DoPasteRequest(Oo)||o==I.BMP&&this.DoPasteRequest(To)){var r=t.clipboardData.items[n].getAsFile();if(r){var s=this.ActiveSectionTopLevelData(),a=s.CreateItemByStyle(cs.Image);a.LoadGraphicFile(r,(function(){a.RestrainSize(s.Width,a.Height),e.InsertItem(a)}))}}}}}finally{this.FStyle.States.Exclude(Ip.Pasting)}}}else this.Paste()}},{key:"Paste",value:function(){if(this.doPasteBefor_()){this.FStyle.States.Include(Ip.Pasting);try{if(or.localStorage.hasKey(lp.HC_EXT)&&this.DoPasteRequest(lp.HCExtFormat)){var t=or.localStorage.getStream(lp.HC_EXT);if(!this.DoPasteFormatStream(t))return;this.InsertLiteStream(t)}else or.clipboard.hasFormat(Bo)&&this.DoPasteRequest(Bo)||(or.localStorage.hasKey(g)&&this.DoPasteRequest(Ao)?this.InsertText(or.localStorage.getString(g)):or.clipboard.hasFormat(To)&&this.DoPasteRequest(To))}finally{this.FStyle.States.Exclude(Ip.Pasting)}}}},{key:"PasteAsText",value:function(){this.doPasteBefor_()&&or.localStorage.hasKey(g)&&this.DoPasteRequest(Ao)&&this.InsertText(or.localStorage.getString(g))}},{key:"doPasteBefor_",value:function(){return null==this.OnPasteBefor||this.OnPasteBefor()}},{key:"ShowSearchForm",value:function(){null==this.FFrmSearch&&(this.FFrmSearch=new JF(this),this.FFrmSearch.closeFree=!1),this.FFrmSearch.cbbKey.text=this.ActiveSectionTopLevelData().SaveSelectToText(),this.FFrmSearch.visible||(this.FFrmSearch.moveCenter(),this.FFrmSearch.show())}},{key:"ZoomIn",value:function(t){return Math.round(t*this.FZoom)}},{key:"ZoomOut",value:function(t){return Math.round(t/this.FZoom)}},{key:"MapChange",value:function(){this.DoMapChanged()}},{key:"UpdateView",value:function(){this.UpdateViewRect(this.GetViewRect())}},{key:"CalcDisplaySectionAndPage",value:function(){this.FDisplayFirstSection>=0&&(this.FSections[this.FDisplayFirstSection].DisplayFirstPageIndex=-1,this.FSections[this.FDisplayFirstSection].DisplayLastPageIndex=-1,this.FDisplayFirstSection=-1),this.FDisplayLastSection>=0&&(this.FSections[this.FDisplayLastSection].DisplayFirstPageIndex=-1,this.FSections[this.FDisplayLastSection].DisplayLastPageIndex=-1,this.FDisplayLastSection=-1);for(var t=-1,e=-1,i=0,n=0;n<=this.FSections.count-1;n++){for(var o=0;o<=this.FSections[n].PageCount-1;o++)if(this.FSections[n].ViewModel==Bs?i+=this.ZoomIn(this.FPagePadding+this.FSections[n].PaperHeightPix):i+=this.ZoomIn(this.FPagePadding+this.FSections[n].GetPageHeight()),i>this.FVScrollBar.position){t=o;break}if(t>=0){this.FDisplayFirstSection=n,this.FSections[this.FDisplayFirstSection].DisplayFirstPageIndex=t;break}}if(this.FDisplayFirstSection>=0){for(var r=this.FVScrollBar.position+this.FViewHeight,s=this.FDisplayFirstSection;s<=this.FSections.count-1;s++){for(var a=t;a<=this.FSections[s].PageCount-1;a++){if(!(i=0){this.FDisplayLastSection=s,this.FSections[this.FDisplayLastSection].DisplayLastPageIndex=e;break}t=0}this.FDisplayLastSection<0&&(this.FDisplayLastSection=this.FSections.count-1,this.FSections[this.FDisplayLastSection].DisplayLastPageIndex=this.FSections[this.FDisplayLastSection].PageCount-1)}if(this.FDisplayFirstSection<0||this.FDisplayLastSection<0)throw"异常:获取当前显示起始页和结束页失败!";this.FDisplayFirstSection!=this.FDisplayLastSection&&(this.FSections[this.FDisplayFirstSection].DisplayLastPageIndex=this.FSections[this.FDisplayFirstSection].PageCount-1,this.FSections[this.FDisplayLastSection].DisplayFirstPageIndex=0)}},{key:"UpdateViewRect",value:function(t){if(!this.FStyle.States.Contain(Ip.Destroying)&&0==this.FUpdateCount){this.FDataBmpCanvas.save();try{this.FDataBmpCanvas.clipRect(t),this.FDataBmpCanvas.beginPath(),this.FViewModel==Bs?this.FDataBmpCanvas.brush.color=this.color:this.FDataBmpCanvas.brush.color=this.FStyle.BackgroundColor,this.FDataBmpCanvas.fillBounds(0,0,this.FViewWidth,this.FViewHeight),this.CalcDisplaySectionAndPage();var e=new RF;try{e.ScaleX=this.FZoom,e.ScaleY=this.FZoom,e.Zoom=this.FZoom,e.ViewModel=this.FViewModel,e.WindowWidth=this.FViewWidth,e.WindowHeight=this.FViewHeight,e.DPI=sr.PixelsPerInchX,e.Print=this.FPrintView;var i=e.scaleCanvas(this.FDataBmpCanvas);try{this.DoPaintViewBefor(this.FDataBmpCanvas,e),this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.ClearDrawAnnotate();for(var n=0,o=this.FDisplayFirstSection;o<=this.FDisplayLastSection;o++)e.SectionIndex=o,n=this.ZoomOut(this.FVScrollBar.position)-this.GetSectionTopFilm(o),this.FSections[o].PaintDisplayPage(this.GetSectionDrawLeft(o)-this.ZoomOut(this.FHScrollBar.position),n,this.FDataBmpCanvas,e);for(var r=0;r<=e.topItems.count-1;r++)e.topItems[r].PaintTop(this.FDataBmpCanvas);this.DoPaintViewAfter(this.FDataBmpCanvas,e),!e.Print&&null!=this.FCaret&&this.FCaret.DisFocus&&(this.FDataBmpCanvas.pen.color="gray",this.FDataBmpCanvas.pen.style=pt.Solid,this.FDataBmpCanvas.pen.width=this.FCaret.Width,this.FDataBmpCanvas.drawLineDriect(this.FCaret.X,this.FCaret.Y,this.FCaret.X,this.FCaret.Y+this.FCaret.Height))}finally{e.restoreCanvasScale(this.FDataBmpCanvas,i)}}finally{e=null}}finally{this.FDataBmpCanvas.paintPath(),this.FDataBmpCanvas.restore()}this.updateRect(t)}}},{key:"BeginUpdate",value:function(){this.FUpdateCount++}},{key:"EndUpdate",value:function(){this.FUpdateCount>0&&this.FUpdateCount--,this.DoMapChanged()}},{key:"UndoGroupBegin",value:function(){if(this.FUndoList.Enable){var t=this.ActiveSection.ActiveData;this.FUndoList.UndoGroupBegin(t.SelectInfo.StartItemNo,t.SelectInfo.StartItemOffset)}}},{key:"UndoGroupEnd",value:function(){if(this.FUndoList.Enable){var t=this.ActiveSection.ActiveData;this.FUndoList.UndoGroupEnd(t.SelectInfo.StartItemNo,t.SelectInfo.StartItemOffset)}}},{key:"GetActiveItem",value:function(){return this.ActiveSection.GetActiveItem()}},{key:"GetTopLevelItem",value:function(){return this.ActiveSection.GetTopLevelItem()}},{key:"GetTopLevelDrawItem",value:function(){return this.ActiveSection.GetTopLevelDrawItem()}},{key:"GetActivePageIndex",value:function(){for(var t=0,e=0;e<=this.ActiveSectionIndex-1;e++)t+=this.FSections[e].PageCount;return t+this.ActiveSection.ActivePageIndex}},{key:"GetPagePreviewFirst",value:function(){for(var t=0,e=0;e<=this.ActiveSectionIndex-1;e++)t+=this.FSections[e].PageCount;return t+this.FSections[this.FActiveSectionIndex].DisplayFirstPageIndex}},{key:"GetPageCount",value:function(){for(var t=0,e=0;e<=this.FSections.count-1;e++)t+=this.FSections[e].PageCount;return t}},{key:"PageUp",value:function(){this.DoPageUp(this)}},{key:"PageDown",value:function(){this.DoPageDown(this)}},{key:"GetSectionDrawLeft",value:function(t){var e=0;return this.FViewModel==Bs&&(e=this.FAnnotatePre.Visible?Math.max(Math.trunc((this.FViewWidth-this.ZoomIn(this.FSections[t].PaperWidthPix+lp.AnnotationWidth))/2),this.ZoomIn(this.FPagePadding)):Math.max(Math.trunc((this.FViewWidth-this.ZoomIn(this.FSections[t].PaperWidthPix))/2),this.ZoomIn(this.FPagePadding))),e=this.ZoomOut(e)}},{key:"GetFormatPointToViewCoord",value:function(t){var e=G.Create(t.x,t.y),i=this.ActiveSection,n=-1;return n=i.ActiveData==i.Page?i.GetPageIndexByFormat(e.y):i.ActivePageIndex,e.x=this.ZoomIn(this.GetSectionDrawLeft(this.ActiveSectionIndex)+(i.GetPageMarginLeft(n)+e.x))-this.FHScrollBar.position,i.ActiveData==i.Header?e.y=this.ZoomIn(this.GetSectionTopFilm(this.ActiveSectionIndex)+i.GetPageTopFilm(n)+i.GetHeaderPageDrawTop()+e.y)-this.FVScrollBar.position:i.ActiveData==i.Footer?e.y=this.ZoomIn(this.GetSectionTopFilm(this.ActiveSectionIndex)+i.GetPageTopFilm(n)+i.PaperHeightPix-i.PaperMarginBottomPix+e.y)-this.FVScrollBar.position:e.y=this.ZoomIn(this.GetSectionTopFilm(this.ActiveSectionIndex)+i.GetPageTopFilm(n)+i.GetHeaderAreaHeight()+e.y-i.GetPageDataFmtTop(n))-this.FVScrollBar.position,e}},{key:"GetTopLevelDrawItemViewCoord",value:function(){var t=this.ActiveSection.GetTopLevelDrawItemCoord();return t=this.GetFormatPointToViewCoord(t)}},{key:"GetTopLevelRectDrawItemViewCoord",value:function(){var t=this.ActiveSection.GetTopLevelRectDrawItemCoord();return t=this.GetFormatPointToViewCoord(t)}},{key:"SetActiveItemText",value:function(t){this.ActiveSection.SetActiveItemText(t)}},{key:"FormatSection",value:function(t){this.FSections[t].FormatData(),this.FSections[t].BuildSectionPages(0),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoChange()}},{key:"ActiveSectionTopLevelData",value:function(){return this.ActiveSection.ActiveData.GetTopLevelData()}},{key:"GetSectionTopFilm",value:function(t){for(var e=0,i=0;i<=t-1;i++)e+=this.FSections[i].GetFilmHeight();return e}},{key:"SaveToFile",value:function(t){}},{key:"LoadFromFile",value:function(t){var e=this,i=!1;return K.loadFromFile(t,(function(n){(i=e.LoadFromStream(n))&&(e.FFileName=t)})),i}},{key:"SaveToText",value:function(){for(var t=this.FSections[0].SaveToText(),e=1;e<=this.FSections.count-1;e++)t=t+lp.sLineBreak+this.FSections[e].SaveToText();return t}},{key:"SaveToImage",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=new RF;e.ScaleX=1,e.ScaleY=1,e.Zoom=1,e.Print=!0,e.DPI=sr.PixelsPerInchX,e.ViewModel=Bs;var i=0,n=0;if(t){for(var o=0;o1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;lp.USESCRIPT&&!e&&this.DisSelect(),this.FStyle.States.Include(Ip.Saving);try{lp._SaveFileFormatAndVersion(t),this.DoSaveStreamBefor(t);var n=i;null==n&&((n=new Set([])).add(dp.Header),n.add(dp.Footer),n.add(dp.Page)),e||(this.FUndoList.clear(),this.DeleteUnUsedStyle(this.FStyle,this.FSections,n)),this.FStyle.SaveToStream(t);var o=0;this.FBKImageVisible&&(o|=128),this.BKImagePrintVisible&&(o|=64),t.writeByte(o),t.writeByte(this.FBKImageLayout),lp.HCSaveImageToStream(t,this.BKImage),t.writeByte(this.FSections.count);for(var r=0;r<=this.FSections.count-1;r++)this.FSections[r].SaveToStream(t,n);this.DoSaveStreamAfter(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"DoLoadProceDelegate",value:function(t){var e=!1;this.BeginUpdate();try{this.FUndoList.clear(),this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.FStyle.States.Include(Ip.Loading);try{t()}finally{this.FStyle.States.Exclude(Ip.Loading)}e=!0,this.DoViewResize()}finally{this.FUndoList.RestoreState()}}finally{this.EndUpdate()}return e}},{key:"LoadFromStream",value:function(t){var e=this;return this.DoLoadProceDelegate((function(){e.Clear(),t.position=0;e.DoLoadFromStream(t,e.FStyle,(function(i){var n=t.readByte();e.FSections[0].LoadFromStream(t,e.FStyle,i);for(var o=1;o1&&void 0!==arguments[1]?arguments[1]:-1,n=function(){t.Position=0;var n=new cs;e.DoLoadFromStream(t,n,(function(o){for(var r=t.readByte(),s=0;s"),e.append(""),e.append(""),e.append(""),e.append(""),e.append(this.FStyle.ToCSS()),e.append(""),e.append("");for(var i=0;i"),e.append(""),e.text}},{key:"GetSectionPageIndexByPageIndex",value:function(t,e){for(var i=-1,n=0,o=0;o<=this.FSections.count-1;o++){if(n+this.FSections[o].PageCount>t){i=o,e=t-n;break}n+=this.FSections[o].PageCount}return{pageIndex:e,result:i}}},{key:"Print",value:function(){return this.Print("")}},{key:"PrintCopies",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.PrintRange(t,0,this.PageCount-1,e)}},{key:"PrintRange",value:function(t,e,i,n){for(var o=new Array(i-e+1),r=e;r<=i;r++)o[r-e]=r;return this.PrintPages(t,n,o)}},{key:"PrintPages",value:function(t,e,i){}},{key:"PrintOdd",value:function(t){var e=new Array(0);return this.PrintPages(t,1,e)}},{key:"PrintEven",value:function(t){var e=new Array(0);return this.PrintPages(t,1,e)}},{key:"PrintCurPageByActiveLine",value:function(t,e,i){}},{key:"PrintCurPageByItemRange",value:function(t,e,i,n,o,r,s){}},{key:"PrintCurPageSelected",value:function(t,e,i){return this.ActiveSection.ActiveData.SelectExists(!1)?this.PrintCurPageByItemRange(t,e,i,this.ActiveSection.ActiveData.SelectInfo.StartItemNo,this.ActiveSection.ActiveData.SelectInfo.StartItemOffset,this.ActiveSection.ActiveData.SelectInfo.EndItemNo,this.ActiveSection.ActiveData.SelectInfo.EndItemOffset):TPrintResult.prNoSupport}},{key:"MergeTableSelectCells",value:function(){return this.ActiveSection.MergeTableSelectCells()}},{key:"TableApplyContentAlign",value:function(t){return this.ActiveSection.TableApplyContentAlign(t)}},{key:"Undo",value:function(){this.FStyle.States.Include(Ip.Undoing);try{if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Undo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}finally{this.FStyle.States.Exclude(Ip.Undoing)}}},{key:"Redo",value:function(){this.FStyle.States.Include(Ip.Redoing);try{if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Redo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}finally{this.FStyle.States.Exclude(Ip.Redoing)}}},{key:"Search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.ActiveSection.Search(t,e,i);if(n){var o=this.GetTopLevelDrawItemViewCoord(),r=this.ActiveSectionTopLevelData(),s=r.GetDrawItemNoByOffset(r.SelectInfo.StartItemNo,r.SelectInfo.StartItemOffset),a=r.GetDrawItemNoByOffset(r.SelectInfo.EndItemNo,r.SelectInfo.EndItemOffset),l=new U;s==a?(l.left=o.x+this.ZoomIn(r.GetDrawItemOffsetWidth(s,r.SelectInfo.StartItemOffset-r.DrawItems[s].CharOffs+1)),l.top=o.y,l.right=o.x+this.ZoomIn(r.GetDrawItemOffsetWidth(a,r.SelectInfo.EndItemOffset-r.DrawItems[a].CharOffs+1)),l.bottom=o.y+this.ZoomIn(r.DrawItems[a].rect.height)):e?(l.left=o.x+this.ZoomIn(r.DrawItems[s].rect.left-r.DrawItems[a].rect.left+r.GetDrawItemOffsetWidth(s,r.SelectInfo.StartItemOffset-r.DrawItems[s].CharOffs+1)),l.top=o.y+this.ZoomIn(r.DrawItems[s].rect.top-r.DrawItems[a].rect.top),l.right=o.x+this.ZoomIn(r.DrawItems[s].rect.left-r.DrawItems[a].rect.left+r.DrawItems[s].rect.width),l.bottom=l.top+this.ZoomIn(r.DrawItems[s].rect.height)):(l.left=o.x,l.top=o.y,l.right=o.x+this.ZoomIn(r.GetDrawItemOffsetWidth(a,r.SelectInfo.EndItemOffset-r.DrawItems[a].CharOffs+1)),l.bottom=o.y+this.ZoomIn(r.DrawItems[a].rect.height)),l.top<0?this.FVScrollBar.position=this.FVScrollBar.position+l.top:l.bottom>this.FViewHeight&&(this.FVScrollBar.position=this.FVScrollBar.position+l.bottom-this.FViewHeight),l.left<0?this.FHScrollBar.position=this.FHScrollBar.position+l.left:l.right>this.FViewWidth&&(this.FHScrollBar.position=this.FHScrollBar.position+l.right-this.FViewWidth)}return n}},{key:"Replace",value:function(t){return this.ActiveSection.Replace(t)}},{key:"NumberOfWords",value:function(){return this.SaveToText().length}},{key:"CanEdit",value:function(){return this.DoSectionCanEdit(this)}},{key:"Caret",get:function(){return this.FCaret}},{key:"FileName",get:function(){return this.FFileName},set:function(t){this.FFileName=t}},{key:"Style",get:function(){return this.FStyle}},{key:"SymmetryMargin",get:function(){return this.GetSymmetryMargin()},set:function(t){this.SetSymmetryMargin(t)}},{key:"ActivePageIndex",get:function(){return this.GetActivePageIndex()}},{key:"PagePreviewFirst",get:function(){return this.GetPagePreviewFirst()}},{key:"PageCount",get:function(){return this.GetPageCount()}},{key:"ActiveSectionIndex",get:function(){return this.FActiveSectionIndex},set:function(t){this.SetActiveSectionIndex(t)}},{key:"ActiveSection",get:function(){return this.GetActiveSection()}},{key:"HScrollBar",get:function(){return this.FHScrollBar}},{key:"VScrollBar",get:function(){return this.FVScrollBar}},{key:"HScrollBarAutoVisible",get:function(){return this.FHScrollBarAutoVisible},set:function(t){this.FHScrollBarAutoVisible!=t&&(this.FHScrollBarAutoVisible=t,this.FHScrollBar.visible=!t||this.FHScrollBar.pageSize43&&(i=t.readByte()),i>0){var n=lp.HCLoadTextFromStream(t,e);this.Style.States.Contain(Ip.Loading)&&lp.SetPropertyString(n,this.FPropertys)}else this.Style.States.Contain(Ip.Loading)&&this.FPropertys.clear();DI(xI(r.prototype),"DoLoadStreamBefor",this).call(this,t,e)}},{key:"DoSaveStreamBefor",value:function(t){t.writeByte(r.EmrViewVersion);var e=lp.GetPropertyString(this.FPropertys);lp.HCSaveTextToStream(t,e),DI(xI(r.prototype),"DoSaveStreamBefor",this).call(this,t)}},{key:"TraverseItem",value:function(t){if(0!=t.Areas.values)for(var e=0;elp.HC_FileVersionInt&&or.exception("加载失败,当前编辑器最高支持版本为"+lp.HC_FileVersionInt.toString()+"的文件,无法打开版本为"+r.toString()+"的文件!"),this.DoLoadStreamBefor(t,r),e.LoadFromStream(t,r),r>55){var s=t.readByte();this.FBKImageVisible=or.system.isOdd(s>>7),this.BKImagePrintVisible=or.system.isOdd(s>>6),this.FBKImageLayout=t.readByte(),this.BKImage=lp.HCLoadImageFromStream(t)}else this.BKImage=null;i(r),this.DoLoadStreamAfter(t,r)}},{key:"GetActiveSection",value:function(){return this.FSections[this.FActiveSectionIndex]}},{key:"DoSectionPaintFooterAfter",value:function(t,e,i,n,o){var r=t;if(r.PageNoVisible){for(var s=this.FSections.indexOf(r),a=0,l=0,h=0;h<=this.FSections.count-1;h++)h==s&&(a=l),l+=this.FSections[h].PageCount;var c=C.stringFormat(r.PageNoFormat,a+r.PageNoFrom+e,l);n.font.size=10,n.font.name="宋体",n.textOut(i.left+Math.trunc((i.width-n.textWidth(c))/2),i.top+r.Footer.height,c)}}},{key:"DoSectionCreateStyleItem",value:function(t,e){return null}},{key:"DoSaveStreamBefor",value:function(t){}},{key:"DoSaveStreamAfter",value:function(t){}},{key:"DoLoadStreamBefor",value:function(t,e){}},{key:"DoLoadStreamAfter",value:function(t,e){}},{key:"DataLoadLiteStream",value:function(t,e){var i=lp._LoadFileFormatAndVersion(t),n=new cs;n.LoadFromStream(t,i.fileVersion),e(i.fileVersion,n)}},{key:"DeleteUnUsedStyle",value:function(t,e,i){t.TextStyles[0].CheckSaveUsed=!0,t.TextStyles[0].TempNo=0;for(var n=1;ncs.Null&&(h.CurStyleNo=t.TextStyles[h.CurStyleNo].TempNo),h.CurParaNo=t.ParaStyles[h.CurParaNo].TempNo;for(var u=t.TextStyles.count-1;u>=1;u--)t.TextStyles[u].CheckSaveUsed||t.TextStyles.delete(u);for(var f=t.ParaStyles.count-1;f>=0;f--)t.ParaStyles[f].CheckSaveUsed||t.ParaStyles.delete(f)}},{key:"Clear",value:function(){this.FStyle.Initialize(),this.FSections.removeRange(1,this.FSections.count-1),this.FActiveSectionIndex=0,this.FSections[0].clear()}},{key:"GetPageCount",value:function(){for(var t=0,e=0;e<=this.FSections.count-1;e++)t+=this.FSections[e].PageCount;return t}},{key:"GetSectionPageIndexByPageIndex",value:function(t,e){for(var i=-1,n=0,o=0;o<=this.FSections.count-1;o++){if(n+this.FSections[o].PageCount>t){i=o,e=t-n;break}n+=this.FSections[o].PageCount}return{pageIndex:e,result:i}}},{key:"SaveToFile",value:function(t){}},{key:"LoadFromFile",value:function(t){var e=this,i=!1;return K.loadFromFile(t,(function(t){i=e.LoadFromStream(t)})),i}},{key:"SaveToText",value:function(){this.FStyle.States.Include(Ip.Saving);try{for(var t=this.FSections[0].SaveToText(),e=1;e<=this.FSections.count-1;e++)t=t+lp.sLineBreak+this.FSections[e].SaveToText();return t}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"LoadFromText",value:function(t){if(this.clear(),this.FStyle.Initialize(),""==t)return!1;this.FStyle.States.Include(Ip.Saving);try{return this.ActiveSection.InsertText(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"SaveToStream",value:function(t,e){this.FStyle.States.Include(Ip.Saving);try{lp._SaveFileFormatAndVersion(t),this.DoSaveStreamBefor(t);var i=new Set([]);i.add(dp.Header),i.add(dp.Footer),i.add(dp.Page),e||this.DeleteUnUsedStyle(this.FStyle,this.FSections,i),this.FStyle.SaveToStream(t);var n=0;this.FBKImageVisible&&(n|=128),this.BKImagePrintVisible&&(n|=64),t.writeByte(n),t.writeByte(this.FBKImageLayout),lp.HCSaveImageToStream(t,this.BKImage),t.writeByte(this.FSections.count);for(var o=0;o<=this.FSections.count-1;o++)this.FSections[o].SaveToStream(t,i);this.DoSaveStreamAfter(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"LoadFromBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.LoadFromStream(e),e=null}},{key:"LoadFromStream",value:function(t){var e=this;this.FStyle.States.Include(Ip.Loading);try{t.position=0,this.DoLoadFromStream(t,this.FStyle,(function(i){var n=t.readByte();e.FSections[0].LoadFromStream(t,e.FStyle,i);for(var o=1;o<=n-1;o++){var r=e.NewDefaultSection();r.LoadFromStream(t,e.FStyle,i),e.FSections.add(r)}}))}finally{this.FStyle.States.Exclude(Ip.Loading)}return!0}},{key:"InsertLiteStream",value:function(t){var e=this,i=!1;return this.DataLoadLiteStream(t,(function(n,o){i=e.ActiveSection.InsertStream(t,o,n)})),i}},{key:"PageCount",get:function(){return this.GetPageCount()}},{key:"ActiveSection",get:function(){return this.GetActiveSection()}},{key:"Sections",get:function(){return this.FSections}},{key:"Style",get:function(){return this.FStyle}}])&&FI(e.prototype,i),n&&FI(e,n),r}(L));function TI(t,e,i){return(TI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=UI(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function OI(t){return(OI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function NI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function BI(t,e){for(var i=0;ithis.Data.Items.count-1)return"";var t=this.Data.Items[this.ItemNo].Name;return null!=t?this.Data.HotDomain.BeginNo>=0&&!this.Data.Items[this.Data.HotDomain.BeginNo].IsProc&&this.Data.HotDomain.BeginNo!=this.ItemNo&&this.Data.HotDomain.EndNo!=this.ItemNo&&(t=""!=t?this.Data.Items[this.Data.HotDomain.BeginNo].Name+">"+t:this.Data.Items[this.Data.HotDomain.BeginNo].Name):t="",t}}]),i}(L),WI=function(t){MI(i,t);var e=GI(i);function i(){var t;return NI(this,i),(t=e.call(this))._width=100,t._height=100,t.FHideTrace=!1,t.Secret=!1,t.TraceInfoAnnotate=!1,t.FTrace=!1,t.FTraceCount=0,t.FInsertTraceStream=!1,t.FPrintUnAlloc=!1,t.FDesignMode=!1,t.FIgnoreAcceptAction=!1,t.FDeDoneColor=lp.clBtnFace,t.FDeUnDoneColor="#FFDD80",t.FDeHotColor="rgb(204, 224, 244)",t.FPageBlankTip="",t.FPropertys=new z,t.FHintInfo=new VI,t.OnCanNotEdit=null,t.OnSyncDeItem=null,t.OnCopyRequest=null,t.OnPasteRequest=null,t.OnCopyAsStream=null,t.OnPasteFromStream=null,t.OnSyntaxCheck=null,t.OnSyntaxPaint=null,t.OnDrawTrace=null,t.OnSaveItem=null,t.Style.DefaultTextStyle.Size=mt.fontSizeToPt("小四"),t.Style.DefaultTextStyle.Family="宋体",t.HScrollBar.addStatus(200),lp.PROCSERIES&&(t.FUnEditProcBKColor=lp.clBtnFace,t.FShowProcSplit=!0,t.CanEditCheckInEditProc=!0,t.FProcCount=0,t.FCaretProcInfo=new Cv,t.FEditProcInfo=new Cv,t.FEditProcIndex=""),t.PrintHideUnAllocValue=!1,t.UnAllocWarning=!0,t.PrintSave=!1,t}return EI(i,[{key:"createBefor",value:function(){Hl.HCDefaultTextItemClass=ES,za.HCDefaultDomainItemClass=wv}},{key:"getHint_",value:function(){return this.FHintInfo.getHint()}},{key:"getHintRect",value:function(){return null}},{key:"DoSectionDrawItemMouseMove",value:function(t,e,n,o,r,s){TI(UI(i.prototype),"DoSectionDrawItemMouseMove",this).call(this,t,e,n,o,r,s),this.FHintInfo.Section=t,this.FHintInfo.Data=e,this.FHintInfo.ItemNo=n,this.FHintInfo.DrawItemNo=r}},{key:"SetHideTrace",value:function(t){var e=this;if(this.FHideTrace!=t){var i;this.FHideTrace=t,this.DisSelect();var n=new $l;n.Areas.add(dp.Page),n.Process=function(t,n,o,r,s){t.Items[n].isClass(ES)?((i=t.Items[n]).TraceStyles.has(sS.Del)&&(i.Visible=!e.FHideTrace),e.TraceInfoAnnotate&&0!=i.TraceStyles.value&&(e.FHideTrace?e.AnnotatePre.RemoveDataAnnotate(null):e.AnnotatePre.InsertDataAnnotate(null))):t.Items[n].isClass(al)&&t.Items[n].FormatDirty()},this.TraverseItem(n),this.FormatData()}}},{key:"SetPageBlankTip",value:function(t){this.FPageBlankTip!=t&&(this.FPageBlankTip=t,this.UpdateView())}},{key:"DoSyntaxCheck",value:function(t,e,i,n){t.Items[e].StyleNo>cs.Null&&this.OnSyntaxCheck(t,n,e)}},{key:"DoSyncDeItem",value:function(t,e,i){null!=this.OnSyncDeItem&&this.OnSyncDeItem(t,e,i)}},{key:"InsertEmrTraceText",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.replace(/\r\n/g,""),n=new ES(i);this.CurStyleNocs.Null||t.StyleNo==cs.Image||t.StyleNo==cs.Table||t.StyleNo==cs.CheckBox||t.StyleNo==cs.Edit||t.StyleNo==cs.Combobox||t.StyleNo==cs.DateTimePicker||t.StyleNo==cs.RadioGroup?t.GetValue(aS)==e:void 0}},{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){e=e.toString(),lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoSectionCreateStyleItem",value:function(t,e){return AI.CreateEmrStyleItem(t,e)}},{key:"DoSectionCaretItemChanged",value:function(t,e,n){var o,r="",s=this.GetTopLevelItem();if(null!=s){lp.PROCSERIES&&this.FProcCount>0&&e==this.ActiveSection.Page&&(this.CheckCaretProcInfo(),this.FCaretProcInfo.EndNo>0&&(r=(o=this.ActiveSection.ActiveData.Items[this.FCaretProcInfo.BeginNo]).GetValue(hS)));var a=this.ActiveSectionTopLevelData();a.ActiveDomain.EndNo>0&&(o=a.Items[a.ActiveDomain.BeginNo],(lp.PROCSERIES&&!o.IsProc||!lp.PROCSERIES)&&(r=""!=r?r+">"+o.GetValue(hS)+"("+o.GetValue(aS)+")":o.GetValue(hS)+"("+o.GetValue(aS)+")")),s.isClass(ES)?0!=s.TraceStyles.value?r=r+"-"+s.GetHint():s.IsElement&&(r=""!=r?r+" > "+s.GetValue(hS)+"("+s.GetValue(aS)+")":s.GetValue(hS)+"("+s.GetValue(aS)+")"):s.isClass(VS)||s.isClass(WS)||s.isClass(zS)?r=""!=r?r+" > "+s.GetValue(hS)+"("+s.GetValue(aS)+")":s.GetValue(hS)+"("+s.GetValue(aS)+")":s.isClass(YS)&&(r=""!=r?r+" > "+s[hS]+"("+s[aS]+")":s[hS]+"("+s[aS]+")")}this.HScrollBar.Statuses[1].text=r,TI(UI(i.prototype),"DoSectionCaretItemChanged",this).call(this,t,e,n)}},{key:"DoSectionInsertItem",value:function(t,e,n){if(n.StyleNo>cs.Null){if(this.Style.States.UndoRedo())return;this.Style.States.Contain(Ip.InsertBreakItem)||this.Style.States.Contain(Ip.Loading)||(this.FInsertTraceStream?(n.TraceStyles.add(sS.Del),n.ParaFirst=!1):this.FTrace&&!n.TraceStyles.has(sS.Del)&&(n.TraceStyles.value=sS.Add)),0!=n.TraceStyles.value&&(this.FTraceCount++,n.TraceStyles.has(sS.Del)?n.Visible=!this.FHideTrace:n.Visible=!0,this.TraceInfoAnnotate&&!this.FHideTrace&&this.AnnotatePre.InsertDataAnnotate(null)),n.TraceStyles.has(sS.Del)||this.Style.States.Contain(Ip.InsertBreakItem)||this.DoSyncDeItem(t,e,n)}else if(lp.PROCSERIES&&n.StyleNo==cs.Domain)n.IsProcBegin&&this.FProcCount++;else if(n.StyleNo!=cs.Line){if(this.Style.States.UndoRedo())return;this.DoSyncDeItem(t,e,n)}TI(UI(i.prototype),"DoSectionInsertItem",this).call(this,t,e,n)}},{key:"DoSectionRemoveItem",value:function(t,e,n){n.isClass(ES)&&0!=n.TraceStyles.value&&this.FTraceCount>0&&(this.FTraceCount--,this.TraceInfoAnnotate&&this.AnnotatePre.RemoveDataAnnotate(null)),TI(UI(i.prototype),"DoSectionRemoveItem",this).call(this,t,e,n)}},{key:"DoSectionSaveItem",value:function(t,e,n){var o=TI(UI(i.prototype),"DoSectionSaveItem",this).call(this,t,e,n);return o&&!or.emrCommon.G_SaveTrace&&e.Items[n].StyleNo>cs.Null&&e.Items[n].TraceStyles.has(sS.Del)&&(o=!1),o&&this.Style.States.Contain(Ip.Copying)&&e.Items[n].StyleNo>cs.Null&&(o=!e.Items[n].TraceStyles.has(sS.Del)&&!e.Items[n].CopyProtect),lp.USESAVEITEMEVENT&&!this.PrintSave&&this.Style.States.Contain(Ip.Saving)&&o&&null!=this.OnSaveItem&&this.OnSaveItem(t,e,e.Items[n]),o}},{key:"DoSectionPaintDomainRegion",value:function(t,e,i){return e.Items[i].GetValue(Iv.SubType)!=gv.Proc}},{key:"DoSectionMatchTextStyleNoAt",value:function(t,e,n){return t.Items[e].StyleNo===cs.Domain&&t.Items[e].Empty?t.Items[e].TextStyleNo:TI(UI(i.prototype),"DoSectionMatchTextStyleNoAt",this).call(this,t,e,n)}},{key:"DoSectionItemMouseDown",value:function(t,e,n,o,r){if(TI(UI(i.prototype),"DoSectionItemMouseDown",this).call(this,t,e,n,o,r),!t.SelectExists()){var s=e.Items[n];s.isClass(ES)&&e.SelectInfo.StartRestrain&&s.Length>0&&(s.Active=!1)}}},{key:"DoSectionCanEdit",value:function(t){return!!this.FIgnoreAcceptAction||(!lp.PROCSERIES||!this.CanEditCheckInEditProc||this.FEditProcIndex==this.FCaretProcInfo.Index)&&(!!TI(UI(i.prototype),"DoSectionCanEdit",this).call(this,t)&&(!(null!=t.ActiveDomain&&t.ActiveDomain.BeginNo>=0)||!t.Items[t.ActiveDomain.BeginNo].ReadOnly))}},{key:"DoSectionAcceptAction",value:function(t,e,n,o,r){if(this.FIgnoreAcceptAction)return!0;if(lp.PROCSERIES){if(r==wp.DeleteSelected&&e==this.ActiveSection.Page&&this.FEditProcInfo.EndNo>0&&!(e.SelectInfo.StartItemNo>this.FEditProcInfo.BeginNo&&e.SelectInfo.EndItemNo0&&(this.Sections[this.FCaretProcInfo.SectionIndex].Page.Items[this.FCaretProcInfo.BeginNo].Changed=!0)}var s=TI(UI(i.prototype),"DoSectionAcceptAction",this).call(this,t,e,n,o,r);if(s)switch(r){case wp.BackDeleteText:case wp.DeleteText:if(e.Items[n].isClass(ES)){var a=e.Items[n];this.FTrace||!a.IsElement||1!=a.Length||a.DeleteAllow||(""!=a.GetValue(hS)?this.SetActiveItemText(a.GetValue(hS)):this.SetActiveItemText("未填写"),a.AllocValue=!1,s=!1)}break;case wp.SetItemText:if(e.Items[n].isClass(ES))e.Items[n].AllocValue=!0;break;case wp.ReturnItem:if(e.Items[n].isClass(ES)){var l=e.Items[n];o>0&&o0&&t.SetAttribute("property",lp.GetPropertyString(this.FPropertys))}},{key:"DoLoadXmlDocument",value:function(t){TI(UI(i.prototype),"DoLoadXmlDocument",this).call(this,t),t.HasAttribute("property")&&lp.SetPropertyString(t.GetAttribute("property"),this.FPropertys)}},{key:"DoLoadStreamBefor",value:function(t,e){var n=0;if(e>43&&(n=t.readByte()),n>0){var o=lp.HCLoadTextFromStream(t,e);this.Style.States.Contain(Ip.Loading)&&lp.SetPropertyString(o,this.FPropertys)}else this.Style.States.Contain(Ip.Loading)&&this.FPropertys.clear();TI(UI(i.prototype),"DoLoadStreamBefor",this).call(this,t,e)}},{key:"DoSectionPaintPageBefor",value:function(t,e,n,o,r){if(TI(UI(i.prototype),"DoSectionPaintPageBefor",this).call(this,t,e,n,o,r),lp.PROCSERIES&&!r.Print&&this.FEditProcInfo.EndNo>0){var s=this.FEditProcInfo.Data,a=s.DrawItems[s.Items[this.FEditProcInfo.BeginNo].FirstDItemNo].rect.leftTop;(a=this.GetFormatPointToViewCoord(a)).y>n.top&&(o.brush.color=this.FUnEditProcBKColor,o.fillRect(U.Create(n.left,n.top,n.right,a.y))),this.FEditProcInfo.EndNo0)if(e.isClass(SF)&&e.Items[i].isClass(wv))e.Items[i].IsProcBegin&&(u.pen.style=pt.DashDotDot,u.pen.color=at.Blue,u.moveTo(s,o.top-1),u.lineTo(a,o.top-1));if(this.UnAllocWarning&&e.Items[i].StyleNo==cs.Domain&&e.Items[i].Empty&&(u.pen.color=at.Red,u.pen.width=1,u.pen.style=pt.Solid,lp.HCDrawWave(u,r)),e.Items[i].isClass(ES)){var d=e.Items[i];if(!d.Selected())if(d.IsElement){if(d.MouseIn||d.Active?(d.OutOfRang?u.brush.color=at.Red:u.brush.color=this.FDeHotColor,u.fillRect(o)):this.FDesignMode?(d.AllocValue?u.brush.color=this.FDeDoneColor:u.brush.color=this.FDeUnDoneColor,u.fillRect(o)):d.OutOfRang?(u.brush.color=at.Red,u.fillRect(o)):(d.AllocValue?u.brush.color=this.FDeDoneColor:u.brush.color=this.FDeUnDoneColor,u.fillRect(o)),ics.Null&&e.Items[i+1].IsElement){u.pen.width=1,u.pen.color=this.Style.BackgroundColor,u.beginPath();try{u.moveTo(o.right-1,o.bottom-5),u.lineTo(o.right-1,o.bottom),u.moveTo(o.right-2,o.bottom-4),u.lineTo(o.right-2,o.bottom),u.moveTo(o.right-3,o.bottom-3),u.lineTo(o.right-3,o.bottom),u.moveTo(o.right-4,o.bottom-2),u.lineTo(o.right-4,o.bottom),u.moveTo(o.right-5,o.bottom-1),u.lineTo(o.right-5,o.bottom)}finally{u.paintPath()}}if(i>0&&!e.Items[i].ParaFirst&&e.Items[i-1].StyleNo>cs.Null&&e.Items[i-1].IsElement){u.pen.width=1,u.pen.color=this.Style.BackgroundColor,u.beginPath();try{u.moveTo(o.left,o.bottom-5),u.lineTo(o.left,o.bottom),u.moveTo(o.left+1,o.bottom-4),u.lineTo(o.left+1,o.bottom),u.moveTo(o.left+2,o.bottom-3),u.lineTo(o.left+2,o.bottom),u.moveTo(o.left+3,o.bottom-2),u.lineTo(o.left+3,o.bottom),u.moveTo(o.left+4,o.bottom-1),u.lineTo(o.left+4,o.bottom)}finally{u.paintPath()}}}else(this.FDesignMode||d.MouseIn||d.Active)&&(d.EditProtect||d.CopyProtect)&&(u.brush.color=lp.clBtnFace,u.fillRect(o));if(!this.FHideTrace&&0!=d.TraceStyles.value)if(null!=this.OnDrawTrace)this.OnDrawTrace(d,r,u);else{if(d.TraceStyles.has(sS.Del)){var m,y=this.Style.TextStyles[d.StyleNo].FontHeight;switch(this.Style.ParaStyles[d.ParaNo].AlignVert){case vr:m=o.top+Math.trunc(y/2);break;case Fr:m=o.top+Math.trunc((o.bottom-o.top)/2);break;default:m=o.bottom-Math.trunc(y/2)}u.pen.style=pt.Solid,u.pen.color=at.Red,u.pen.width=1,u.drawLineDriect(o.left,m-1,o.right,m-1),u.drawLineDriect(o.left,m+2,o.right,m+2)}if(d.TraceStyles.has(sS.Add)){var p=this.Style.TextStyles[d.StyleNo].FontHeight,S=o.bottom;switch(this.Style.ParaStyles[d.ParaNo].AlignVert){case vr:S=o.top+p;break;case Fr:S=o.top+Math.trunc((o.height+p)/2)}u.pen.style=pt.Solid,u.pen.color=at.Blue,u.pen.width=1,u.drawLineDriect(o.left,S,o.right,S)}}}}}},{key:"DoSectionDrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){if(!(f.Print||t.Items[e].StyleNo0&&!d.IsSelectComplate)for(var m,y=t.DrawItems[i].CharOffs,p=t.DrawItems[i].CharOffsetEnd(),S=0,v=0,F=0,I=new U,g=!1,w=0;wp)&&!((v=S+d.Syntaxs[w].Length-1)=p?(g=!0,I.left=o.left,I.right=o.right):S>=y?(g=!0,v<=p?(F=S-y,m=d.Syntaxs[w].Length,I.left=o.left+t.GetDrawItemOffsetWidth(i,F,u),I.right=o.left+t.GetDrawItemOffsetWidth(i,F+m,u)):(I.left=o.left+t.GetDrawItemOffsetWidth(i,S-y,u),I.right=o.right)):v<=p&&(g=!0,I.left=o.left,I.right=o.left+t.GetDrawItemOffsetWidth(i,v-y+1,u)),g))if(I.top=o.top,I.bottom=o.bottom,null!=this.OnSyntaxPaint)this.OnSyntaxPaint(t,e,r,d.Syntaxs[w],I,u);else{switch(d.Syntaxs[w].Problem){case OS:u.pen.color=at.Red;break;case NS:u.pen.color=at.Orange}lp.HCDrawWave(u,I)}}}},{key:"DrawBlankTip_",value:function(t,e,i,n,o){e+14<=n&&(o.font.size=12,o.font.styles.clear(),o.font.color=at.Black,o.textOut(t+(i-t-o.textWidth(this.FPageBlankTip))/2,e,this.FPageBlankTip))}},{key:"DrawTraceHint_",value:function(t,e,i,n,o){o.font.size=12,o.font.color=at.Black;var r=t.GetValue(vS)+" "+t.GetValue(SS),s=o.textMetric(r),a=U.CreateByBounds(e.left,e.top-s.height-5,s.width,s.height);a.right>i&&a.offset(i-a.right,0),a.topcs.Null&&m.IsElement&&!m.AllocValue)return f.brush.color=at.White,void f.fillRect(s)}if(!this.FHideTrace&&this.FTraceCount>0){var y=e.Items[n];if(y.StyleNo>cs.Null&&0!=y.TraceStyles.value&&(""!=y.GetValue(vS)||""!=y.GetValue(SS)))if(this.TraceInfoAnnotate){var p=new lI;p.DrawRect.resetRect(s),p.Title=y.GetHint(),p.Text=e.GetDrawItemText(o),this.AnnotatePre.AddDrawAnnotate(p)}else o!=e.HotDrawItemNo||e.MouseMoveRestrain||this.DrawTraceHint_(y,s,l,c,f)}if(this.Secret){var S=e.Items[n];if(S.StyleNo>cs.Null&&""!=S.GetValue(gS)){var v=ES.GetSecretRange(S.GetValue(gS));if(v.low>0){v.hi<0&&(v.hi=S.Length);var F=e.DrawItems[o];if(v.low<=F.CharOffsetEnd()&&(v.lowF.CharOffsetEnd()&&(v.hi=F.CharOffsetEnd()),v.low=v.low-F.CharOffs+1,v.low>0&&v.low--,v.hi=v.hi-F.CharOffs+1,v.hi>=0)){f.brush.style=vt;var I=f.brush.color;f.brush.color=at.DarkGray,f.fillRect(U.Create(s.left+e.GetDrawItemOffsetWidth(o,v.low),s.top,s.left+e.GetDrawItemOffsetWidth(o,v.hi),s.bottom)),f.brush.style=vt,f.brush.color=I}}}}if(lp.PROCSERIES&&!d.Print&&e.Items[n].isClass(wv)){var g=e.Items[n];g.MarkType==Pp.Beg?g.GetValue(Iv.SubType)==gv.Proc&&(n>0&&e.Items[n-1].isClass(wv)&&e.Items[n-1].GetValue(Iv.SubType)==gv.Proc&&lp.HCDrawArrow(f,lp.clMedGray,s.left-10,s.top,0),this.FEditProcInfo.BeginNo==n?lp.HCDrawArrow(f,at.Blue,s.left-10,s.top+12,1):lp.HCDrawArrow(f,lp.clMedGray,s.left-10,s.top+12,1)):g.GetValue(Iv.SubType)==gv.Proc&&(n1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=TI(UI(i.prototype),"Search",this).call(this,t,e,n);return lp.PROCSERIES&&this.CheckCaretProcInfo(),o}},{key:"Replace",value:function(t){var e=TI(UI(i.prototype),"Replace",this).call(this,t);return lp.PROCSERIES&&this.CheckCaretProcInfo(),e}},{key:"TraverseItem",value:function(t){if(0!=t.Areas.size)for(var e=0;e<=this.Sections.count-1;e++)t.Stop||(t.SectionIndex=e,t.Areas.has(dp.Header)&&this.Sections[e].Header.TraverseItem(t),!t.Stop&&t.Areas.has(dp.Page)&&this.Sections[e].Page.TraverseItem(t),!t.Stop&&t.Areas.has(dp.Footer)&&this.Sections[e].Footer.TraverseItem(t))}},{key:"InsertDeGroup",value:function(t){var e=this.InsertDomain(t);return lp.PROCSERIES&&this.CheckCaretProcInfo(),e}},{key:"DeleteDeGroup",value:function(t){var e=this;if(""==t)return!1;var i=this.GetDataDeGroupItemNo(this.ActiveSection.Page,t,!1,0,-1);if(i.endNo>0){var n=this.ActiveSection.DataAction(this.ActiveSection.Page,(function(){e.FIgnoreAcceptAction=!0;try{e.ActiveSection.Page.DeleteDomainByItemNo(i.startNo,i.endNo)}finally{e.FIgnoreAcceptAction=!1}return!0}));return lp.PROCSERIES&&this.CheckCaretProcInfo(),n}return!1}},{key:"GetDeGroupItemNo",value:function(t){for(var e,i=new Ql,n=0;n0)return{result:!0,sectionIndex:n,data:i.Childs[0].Data,startNo:i.Childs[0].BeginNo,endNo:i.Childs[0].EndNo};return{result:!1,sectionIndex:-1,data:null,startNo:-1,endNo:-1}}},{key:"GetCaretDeGroupProperty",value:function(t,e){var i=this.ActiveSectionTopLevelData(),n=i.ActiveDomain;return n.BeginNo<0?"":t==Iv.Propertys?"json"==e?lp.GetPropertyJSON(i.Items[n.BeginNo].Propertys):lp.GetPropertyString(i.Items[n.BeginNo].Propertys):i.Items[n.BeginNo].GetValue(t)}},{key:"SetCaretDeGroupProperty",value:function(t,e){var i=this.ActiveSectionTopLevelData(),n=i.ActiveDomain;return n.EndNo>0&&(t==Iv.Propertys?"object"==OI(e)?(lp.SetPropertyJSON(i.Items[n.BeginNo].Propertys,e),lp.SetPropertyJSON(i.Items[n.EndNo].Propertys,e)):(lp.SetPropertyString(i.Items[n.BeginNo].Propertys,e),lp.SetPropertyString(i.Items[n.EndNo].Propertys,e)):(i.Items[n.BeginNo].SetValue(t,e),i.Items[n.EndNo].SetValue(t,e)),!0)}},{key:"GetCaretDeGroupText",value:function(){var t=this.ActiveSectionTopLevelData(),e=t.ActiveDomain;return e.BeginNo<0?"":this.GetDataDeGroupText(t,e.BeginNo,e.EndNo)}},{key:"SetCaretDeGroupByText",value:function(t){var e=this.ActiveSectionTopLevelData().ActiveDomain;e.EndNo>0&&(this.SetDataDeGroupText(e.Data,e.BeginNo,e.EndNo,t),this.FormatSection(this.ActiveSectionIndex))}},{key:"GetCaretDeGroupStream",value:function(){var t=this.ActiveSectionTopLevelData(),e=t.ActiveDomain;if(e.BeginNo<0)return null;this.GetDataDeGroupToStream(t,e.BeginNo,e.EndNo)}},{key:"SetCaretDeGroupByStream",value:function(t){var e=this.ActiveSectionTopLevelData().ActiveDomain;e.EndNo>0&&this.SetDataDeGroupFromStream(e.Data,e.BeginNo,e.EndNo,t)}},{key:"SetDeGroupProperty",value:function(t,e,i){var n=this.GetDeGroupItemNo(t);if(!n.result)return!1;n.data.Items[n.startNo].SetValue(e,i),n.data.Items[n.endNo].SetValue(e,i)}},{key:"GetDeGroupProperty",value:function(t,e){var i=this.GetDeGroupItemNo(t);return i.result?i.data.Items[i.startNo].GetValue(e):""}},{key:"InsertDeItem",value:function(t){return this.InsertItem(t)}},{key:"NewDeItem",value:function(t){var e=new ES(t);return e.StyleNo=this.Style.GetStyleNo(this.Style.DefaultTextStyle,!0),e.ParaNo=this.CurParaNo,e}},{key:"GetDeItemText",value:function(t){return this.GetDeItemProperty(t,"Text")}},{key:"GetDeItemProperty",value:function(t,e,i){var n=!1,o=new $l;o.Areas.add(dp.Header),o.Areas.add(dp.Page),o.Areas.add(dp.Footer);var r,s="";return o.Process=function(o,a,l,h,c){if((r=o.Items[a]).StyleNo>cs.Null&&r.GetValue(aS)==t){if("Text"==e)s=r.Text;else if("AllocValue"==e)s=r.AllocValue?"1":"0";else{if(e==Iv.Propertys)return"json"==i?lp.GetPropertyJSON(r.Propertys):lp.GetPropertyString(r.Propertys);s=r.GetValue(e)}return n=!0,!0}if(r.StyleNo==cs.Image&&r.GetValue(aS)==t){if("Base64"==e||"Graphic"==e)r.Text;else{if(e==Iv.Propertys)return"json"==i?lp.GetPropertyJSON(r.Propertys):lp.GetPropertyString(r.Propertys);s=r.GetValue(e)}return n=!0,!0}if(r.StyleNo==cs.Combobox&&r.GetValue(aS)==t){if("Text"==e)s=r.Text;else if("ItemValue"==e)s=r.ItemValues[r.ItemIndex];else{if(e==Iv.Propertys)return"json"==i?lp.GetPropertyJSON(r.Propertys):lp.GetPropertyString(r.Propertys);s=r.GetValue(e)}return n=!0,!0}},this.TraverseItem(o),n?{result:n,text:s}:{result:!1,text:""}}},{key:"GetDeGroupDeItemText",value:function(t,e){return this.GetDeGroupItemNo(t).result?this.GetDeItemProperty(e,"Text"):{result:!1,text:""}}},{key:"GetDeGroupDeItemProperty",value:function(t,e,i){return this.GetDeGroupItemNo(t).result?this.GetDeItemProperty(e,i):{result:!1,text:""}}},{key:"GetDeObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=new $l;o.Tag=0;var r=function(e,i,n,o,r){if(e.Items[i].StyleNo>cs.Null){if(t(e,i))return!0}else switch(e.Items[i].StyleNo){case cs.Table:case cs.Image:case cs.Edit:case cs.Combobox:case cs.Button:case cs.CheckBox:case cs.RadioGroup:case cs.DateTimePicker:if(t(e,i))return!0}};if(o.Process=r,null==e)o.Areas.add(dp.Page),this.TraverseItem(o);else if(i>=0)for(var s=i;s<=n;s++)o.Stop=o.Process(e,s,o.Tag,o.DomainStack,o.Stop),o.Stop||e.Items[s].StyleNo1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=null,r=null;return this.GetDeObject((function(e,i){return((r=e.Items[i]).StyleNo>cs.Null&&r.GetValue(aS)==t||r.StyleNo==cs.Table&&r.GetValue(aS)==t||r.StyleNo==cs.Image&&r.GetValue(aS)==t||r.StyleNo==cs.Edit&&r.GetValue(aS)==t||r.StyleNo==cs.Combobox&&r.GetValue(aS)==t||r.StyleNo==cs.Button&&r.GetValue(aS)==t||r.StyleNo==cs.CheckBox&&r.GetValue(aS)==t||r.StyleNo==cs.RadioGroup&&r.GetValue(aS)==t||r.StyleNo==cs.DateTimePicker&&r.GetValue(aS)==t)&&(o=r,!0)}),e,i,n),o}},{key:"SetDeImage",value:function(t,e){return this.SetDeObjectProperty(t,"Propertys",e)}},{key:"SyncDeItemAfterRef",value:function(t,e){var i,n=!1,o=!1,r=new $l;r.Tag=0,r.Areas.add(dp.Page),r.Process=function(t,r,s,a,l){i=t.Items[r],n?i.StyleNo>cs.Null&&i.GetValue(aS)==e.GetValue(aS)&&(i.Text=e.Text,i.AllocValue=!0,i.SetValue(mS,e.GetValue(mS)),o=!0):i==e&&(n=!0)},this.TraverseItem(r),o&&this.FormatData()}},{key:"FindSameDeItem",value:function(t){var e=null,i=new $l;return i.Tag=0,i.Areas.add(dp.Page),i.Process=function(i,n,o,r,s){if(i.Items[n].StyleNo>cs.Null){var a=i.Items[n];if(a.GetValue(aS)==t.GetValue(aS)&&a.AllocValue)return e=a,!0}return!1},this.TraverseItem(i),e}},{key:"SetDeItemText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.SetDeObjectProperty(t,"Text",e,i)}},{key:"SetDataDeObjectProperty",value:function(t,e,i,n){var o=this,r=!1;if(e.StyleNo>cs.Null)if("Text"==i)""!=n&&(e.Text=n,e.AllocValue=!0,t.Change(),t.isClass($y)&&t.OnFormatDirty()),r=!0;else if("Propertys"==i)if("object"==OI(n))for(var s in n)"Text"==s?(""!=n[s]&&(e.Text=n[s],e.AllocValue=!0,t.Change(),t.isClass($y)&&t.OnFormatDirty()),r=!0):e.SetValue(s,n[s]);else{var a=new z;lp.SetPropertyString(n,a);for(var l=0;l3&&void 0!==arguments[3]?arguments[3]:0,r=!1,s=!1,a=null,l=null,h=new $l;h.Areas.add(dp.Page);var c=function(h,c,u,f,d){return a!==h&&(a=h,!h.CanEdit())||(l=h.Items[c],!(!(r=n.DeItemIndexMatch(l,t))||(s=n.SetDataDeObjectProperty(h,l,e,i),0!=o))||void 0)};if(h.Process=c,lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return!1;h.SectionIndex=this.FEditProcInfo.SectionIndex;for(var u,f=this.Sections[this.FEditProcInfo.SectionIndex].Page,d=this.FEditProcInfo.BeginNo;d<=this.FEditProcInfo.EndNo&&!h.Stop;d++)f.Items[d].isClass(za)&&(za.IsBeginMark(f.Items[d])?(u=new Ql,f.GetDomainFrom(d,lp.OffsetAfter,u),h.DomainStack.push(u)):h.DomainStack.pop()),h.Stop=h.Process(f,d,h.Tag,h.domainStack,h.Stop),h.Stop||f.Items[d].StyleNo4&&void 0!==arguments[4]?arguments[4]:0;if(this.Sections[t].Header.ReadOnly)return!1;var s=!1,a=!1,l=null,h=new $l;h.Areas.add(dp.Header);var c=function(t,h,c,u,f){if(l=t.Items[h],(s=o.DeItemIndexMatch(l,e))&&(a=o.SetDataDeObjectProperty(t,l,i,n),0==r))return!0};return h.Process=c,this.Sections[t].Header.TraverseItem(h),s&&a&&this.FormatData(),s}},{key:"SetSectionFooterDeObjectProperty",value:function(t,e,i,n){var o=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(this.Sections[t].Footer.ReadOnly)return!1;var s=!1,a=!1,l=null,h=new $l;h.Areas.add(dp.Footer);var c=function(t,h,c,u,f){if(l=t.Items[h],(s=o.DeItemIndexMatch(l,e))&&(a=o.SetDataDeObjectProperty(t,l,i,n),0==r))return!0};return h.Process=c,this.Sections[t].Footer.TraverseItem(h),s&&a&&this.FormatData(),s}},{key:"DeleteDeObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=!1,n=null,o=null,r=new $l;r.Areas.add(dp.Page),0!=e&&(r.ReverseOrder=!0);var s=function(r,s,a,l,h){if(n!==r&&(n=r,r.DisSelect(),!r.CanEdit()))return!0;if((o=r.Items[s]).StyleNo>cs.Null&&o.Index==t){if(r.DeleteItemDirect(s),i=!0,0==e||1==e)return!0}else if((o.StyleNo==cs.Image||o.StyleNo==cs.Table||o.StyleNo==cs.CheckBox||o.StyleNo==cs.Edit||o.StyleNo==cs.Combobox||o.StyleNo==cs.DateTimePicker||o.StyleNo==cs.RadioGroup)&&o.GetValue(aS)==t&&(r.DeleteItemDirect(s),i=!0,0==e||1==e))return!0};if(r.Process=s,lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;r.SectionIndex=this.FEditProcInfo.SectionIndex;for(var a,l=this.Sections[this.FEditProcInfo.SectionIndex].Page,h=this.FEditProcInfo.BeginNo;h<=this.FEditProcInfo.EndNo&&!r.Stop;h++)l.Items[h].isClass(za)&&(za.IsBeginMark(l.Items[h])?(a=new Ql,l.GetDomainFrom(h,lp.OffsetAfter,a),r.DomainStack.push(a)):r.DomainStack.pop()),r.Stop=r.Process(l,h,r.Tag,r.domainStack,r.Stop),r.Stop||l.Items[h].StyleNo3&&void 0!==arguments[3]&&arguments[3];if(""==t)return or.returnFalseLog("InsertProc方法的procIndex参数为空");if(""!=i){var r=this.GetProcItemNo(i);if(!r.result)return or.returnFalseLog("InsertProc方法的未找到Index为"+i+"的病程!");r.sectionIndex!=this.ActiveSectionIndex&&(this.ActiveSectionIndex=r.sectionIndex),(n=this.ActiveSection.Page).SetSelectBound(r.startNo,0,r.startNo,0)}else(n=this.ActiveSectionTopLevelData()).SelectLastItemAfterWithCaret();var s=!1;if(n==this.ActiveSection.Page){var a=new wv(n);if(a.SetValue(aS,t),a.SetValue(Iv.SubType,gv.Proc),""!=e)for(var l,h=e.split(lp.sLineBreak),c=0;c0&&(n.Index=t.Items[n.BeginNo].GetValue(Iv.Index))}},{key:"SetProcDeGroupByStream",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.GetProcItemNo(t);if(r.result){var s=new Ql;if(this.GetDataDeGroupTree(e,this.Sections[r.sectionIndex].Page,r.startNo,r.endNo,s),0==s.Childs.count)return!1;var a=!1;return this.DataLoadLiteStream(i,(function(t,e){a=n.SetDeGroupTreeByStream(s,i,e,t,o)})),this.ClearUndo(),this.FormatSection(r.sectionIndex),lp.PROCSERIES&&this.CheckCaretProcInfo(),a}return r.result}},{key:"SetProcDeGroupByText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=this.GetProcItemNo(t);if(o.result){var r=new Ql;if(this.GetDataDeGroupTree(e,this.Sections[o.sectionIndex].Page,o.startNo,o.endNo,r),0==r.Childs.count)return!1;this.SetDeGroupTreeByText(r,i,n),this.ClearUndo(),this.FormatSection(o.sectionIndex),lp.PROCSERIES&&this.CheckCaretProcInfo()}return o.result}},{key:"GetCaretProcProperty",value:function(t,e){if(this.FCaretProcInfo.EndNo>0){if(t==Iv.Index)return this.FCaretProcInfo.Index;var i=this.ActiveSection.Page.Items[this.FCaretProcInfo.BeginNo];return t==Iv.Propertys?"json"==e?lp.GetPropertyJSON(i.Propertys):lp.GetPropertyString(i.Propertys):i.GetValue(t)}return""}},{key:"GetProcProperty",value:function(t,e,i){var n=this.GetProcItemNo(t);if(n.result){var o=this.Sections[n.sectionIndex].Page.Items[n.startNo];if(e==Iv.Propertys){if("json"==i){if(o.Changed){var r=lp.GetPropertyJSON(o.Propertys);return r.Changed="1",r}return lp.GetPropertyJSON(o.Propertys)}return o.Changed?lp.GetPropertyString(o.Propertys)+"Changed=1":lp.GetPropertyString(o.Propertys)}return"Changed"==e?o.Changed?"1":"0":o.GetValue(e)}return""}},{key:"SetProcProperty",value:function(t,e,i){var n=this.GetProcItemNo(t);if(n.result){var o=this.Sections[n.sectionIndex].Page.Items[n.startNo],r=this.Sections[n.sectionIndex].Page.Items[n.endNo];if(""!=e&&""!=i)o.SetValue(e,i),r.SetValue(e,i);else if(e==Iv.Propertys){var s,a=new z;lp.SetPropertyString(i,a);for(var l=0;l=0){var o=this.Sections[i].Page,r=o.DrawItems[o.Items[e].FirstDItemNo].rect.top;return r=this.Sections[i].PageDataFormtToFilmCoord(r),r+=this.GetSectionTopFilm(i),this.VScrollBar.position=r,o.ItemSetCaretRequest(e,lp.OffsetAfter),!0}return!1}},{key:"ScrollToItem",value:function(t){var e=-1,i=-1,n=new $l;return n.Areas.add(dp.Page),n.Process=function(o,r,s,a,l){if(o.Items[r]===t)return e=o.GetDrawItemFormatTop(o.Items[r].FirstDItemNo),i=n.SectionIndex,!0},this.TraverseItem(n),e>=0&&(e=this.Sections[i].PageDataFormtToFilmCoord(e),e+=this.GetSectionTopFilm(i),this.VScrollBar.position=e,!0)}},{key:"DeleteAllProcMark",value:function(){var t=this.ActiveSection.Page;this.BeginUpdate();try{t.BeginFormat();try{for(var e,i=t.Items.count-1;i>=0;i--)t.Items[i].StyleNo==cs.Domain&&(e=t.Items[i]).IsProc&&(e.IsProcEnd||i=0);s++){e=this.Sections[s].Page;for(var a=0;a=0&&(i=(r=e.GetDomainAnother(o))>=0),{sectionIndex:n,startNo:o,endNo:r,result:i}}},{key:"CheckCaretProcInfo",value:function(){this.GetSectionCaretProcInfo(this.ActiveSectionIndex,this.FCaretProcInfo),this.FCaretProcInfo.Index==this.FEditProcIndex&&this.FEditProcInfo.Assign(this.FCaretProcInfo)}},{key:"CheckEditProcInfo",value:function(){this.FEditProcInfo.Clear();var t=this.GetProcItemNo(this.FEditProcIndex);t.endNo>0&&(this.ActiveSectionIndex!=t.sectionIndex&&(this.ActiveSectionIndex=t.sectionIndex),this.FEditProcInfo.SectionIndex=t.sectionIndex,this.FEditProcInfo.Data=this.Sections[t.sectionIndex].Page,this.FEditProcInfo.BeginNo=t.startNo,this.FEditProcInfo.EndNo=t.endNo,this.FEditProcInfo.Index=this.FEditProcIndex)}},{key:"GetSectionCaretProcInfo",value:function(t,e){var i=this.Sections[t].Page;this.GetProcInfoAt(i,i.SelectInfo.StartItemNo,i.SelectInfo.StartItemOffset,e),e.SectionIndex=t}},{key:"SetActiveItemExtra",value:function(t){var e=this;this.DataLoadLiteStream(t,(function(i,n){e.BeginUpdate();try{e.UndoGroupBegin();try{var o=e.ActiveSectionTopLevelData();e.DeleteActiveDataItems(o.SelectInfo.StartItemNo),e.ActiveSection.InsertStream(t,n,i)}finally{e.UndoGroupEnd()}}finally{e.EndUpdate()}}))}},{key:"SetActiveTableRowReadOnly",value:function(t){var e=this.ActiveSection.ActiveData.GetActiveRectItem();if(null!=e&&e.StyleNo==cs.Table){var i=e.GetEditCellWith();i.row>=0&&e.SetRowReadOnly(i.row,t)}}},{key:"SetActiveTableCellReadOnly",value:function(t){var e=this.ActiveSection.ActiveData.GetActiveRectItem();if(null!=e&&e.StyleNo==cs.Table){var i=e.GetEditCellWith();i.row>=0&&e.SetCellReadOnly(i.row,i.col,t)}}},{key:"CheckDeGroupStart",value:function(t,e,i){var n=!1;if(t.Items[e].isClass(wv)){var o=t.Items[e];n=o.MarkType==Pp.Beg&&o.GetValue(aS)==i}return n}},{key:"CheckDeGroupEnd",value:function(t,e,i){var n=!1;if(t.Items[e].isClass(wv)){var o=t.Items[e];n=o.MarkType==Pp.End&&o.GetValue(aS)==i}return n}},{key:"GetDataDeGroupItemNo",value:function(t,e,i,n,o){o=-1;var r=-1,s=-1;if(n<0&&(n=0),i){for(var a=n;a>=0;a--)if(this.CheckDeGroupEnd(t,a,e)){s=a;break}if(s>=0)for(var l=s-1;l>=0;l--)if(this.CheckDeGroupStart(t,l,e)){r=l;break}}else{for(var h=n;h=0)for(var c=r+1;c=0&&s>=0?(n=r,o=s):n=-1,{startNo:n,endNo:o}}},{key:"GetDataDeGroupText",value:function(t,e,i){for(var n="",o=e+1;ocs.Null&&t.Items[o].TraceStyles.has(sS.Del)||(t.Items[o].ParaFirst?n=n+lp.sLineBreak+t.Items[o].Text:n+=t.Items[o].Text));return n}},{key:"GetDeGroupAsText",value:function(t){var e=this.GetDeGroupItemNo(t);return e.endNo>0?this.GetDataDeGroupText(e.data,e.startNo,e.endNo):""}},{key:"GetDeGroupAsStream",value:function(t){var e=this.GetDeGroupItemNo(t);return e.result?this.GetDataDeGroupToStream(e.data,e.startNo,e.endNo):null}},{key:"GetDataForwardDeGroupText",value:function(t,e){var i="",n=e,o=-1,r=t.Items[e].GetValue(aS),s=this.GetDataDeGroupItemNo(t,r,!0,n,o);return n=s.startNo,(o=s.endNo)>0&&(i=this.GetDataDeGroupText(t,n,o)),i}},{key:"SetDeGroupTreeByText",value:function(t,e,i){if(0==t.Childs.count)return!1;this.FIgnoreAcceptAction=!0;try{this.Style.States.Include(Ip.DomainWholeReplace);try{var n;if(0==i)(n=t.Childs[0]).Data.DisSelect(),n.Data.SetSelectBound(n.BeginNo,lp.OffsetAfter,n.EndNo,lp.OffsetBefor),n.Data.InsertText(e);else if(1==i)(n=t.Childs.last).Data.DisSelect(),n.Data.SetSelectBound(n.BeginNo,lp.OffsetAfter,n.EndNo,lp.OffsetBefor),n.Data.InsertText(e);else for(var o=t.Childs.count-1;o>=0;o--)(n=t.Childs[o]).Data.DisSelect(),n.Data.SetSelectBound(n.BeginNo,lp.OffsetAfter,n.EndNo,lp.OffsetBefor),n.Data.InsertText(e)}finally{this.Style.States.Exclude(Ip.DomainWholeReplace)}}finally{this.FIgnoreAcceptAction=!1}return!0}},{key:"SetDeGroupTreeByStream",value:function(t,e,i,n,o){if(0==t.Childs.count)return!1;this.FIgnoreAcceptAction=!0;try{this.Style.States.Include(Ip.DomainWholeReplace);try{var r;if(0==o)(r=t.Childs[0]).Data.DisSelect(),r.Data.SetSelectBound(r.BeginNo,lp.OffsetAfter,r.EndNo,lp.OffsetBefor),r.Data.InsertStream(e,i,n);else if(1==o)(r=t.Childs.last).Data.DisSelect(),r.Data.SetSelectBound(r.BeginNo,lp.OffsetAfter,r.EndNo,lp.OffsetBefor),r.Data.InsertStream(e,i,n);else for(var s=e.position,a=t.Childs.count-1;a>=0;a--)e.position=s,(r=t.Childs[a]).Data.DisSelect(),r.Data.SetSelectBound(r.BeginNo,lp.OffsetAfter,r.EndNo,lp.OffsetBefor),r.Data.InsertStream(e,i,n)}finally{this.Style.States.Exclude(Ip.DomainWholeReplace)}}finally{this.FIgnoreAcceptAction=!1}return!0}},{key:"SetDataDeGroupText",value:function(t,e,i,n){var o=-1,r=i;i<0&&(r=t.GetDomainAnother(e)),r>e?o=e:(o=r,r=e),t.DisSelect(),t.SetSelectBound(o,lp.OffsetAfter,r,lp.OffsetBefor),this.FIgnoreAcceptAction=!0;try{""!=n?t.InsertText(n):t.DeleteSelected()}finally{this.FIgnoreAcceptAction=!1}lp.PROCSERIES&&this.CheckCaretProcInfo()}},{key:"SetDeGroupByText",value:function(t,e,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=null;switch(e){case dp.Header:r=this.Sections[t].Header;break;case dp.Page:r=this.Sections[t].Page;break;case dp.Footer:r=this.Sections[t].Footer}var s=0,a=r.Items.count-1;if(lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;s=this.FEditProcInfo.BeginNo,a=this.FEditProcInfo.EndNo}var l=new Ql;this.GetDataDeGroupTree(i,r,s,a,l),0!=l.Childs.count&&(this.SetDeGroupTreeByText(l,n,o),this.ClearUndo(),this.FormatSection(t),lp.PROCSERIES&&this.CheckCaretProcInfo())}},{key:"SetActiveSectionDeGroupByStream",value:function(t,e,i){this.SetDeGroupByStream(this.ActiveSectionIndex,dp.Page,t,e,i)}},{key:"SetDeGroupByStream",value:function(t,e,i,n){var o=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=null;switch(e){case dp.Header:s=this.Sections[t].Header;break;case dp.Page:s=this.Sections[t].Page;break;case dp.Footer:s=this.Sections[t].Footer}var a=0,l=s.Items.count-1;if(lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;a=this.FEditProcInfo.BeginNo,l=this.FEditProcInfo.EndNo}var h=new Ql;this.GetDataDeGroupTree(i,s,a,l,h),0!=h.Childs.count&&(this.DataLoadLiteStream(n,(function(t,e){o.SetDeGroupTreeByStream(h,n,e,t,r)})),this.ClearUndo(),this.FormatSection(t),lp.PROCSERIES&&this.CheckCaretProcInfo())}},{key:"SetCaretToPageDeGroupStart",value:function(t){return this.SetCaretToDeGroupStart(t)}},{key:"SetCaretToDeGroupStart",value:function(t){var e=this.GetDeGroupItemNo(t);return e.result&&(e.data.ItemSetCaretRequest(e.startNo,lp.OffsetAfter),lp.PROCSERIES&&this.CheckCaretProcInfo()),e.result}},{key:"SetDeGroupByFileStream",value:function(t,e,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=new AI;r.LoadFromStream(n);var s=new K;lp._SaveFileFormatAndVersion(s),r.Style.SaveToStream(s),r.ActiveSection.Page.SaveItemToStream(s,0,0,r.ActiveSection.Page.Items.count-1,r.ActiveSection.Page.GetItemOffsetAfter(r.ActiveSection.Page.Items.count-1)),s.position=0,this.SetDeGroupByStream(t,e,i,s,o)}},{key:"GetDataDeGroupToStream",value:function(t,e,i){var n=new K;return this.DataSaveLiteStream(n,(function(){t.SaveItemToStream(n,e+1,0,i-1,t.Items[i-1].Length)})),n}},{key:"SetDataDeGroupFromStream",value:function(t,e,i,n){var o=this;this.DataLoadLiteStream(n,(function(r,s){o.FIgnoreAcceptAction=!0;try{o.BeginUpdate();try{t.BeginFormat();try{i-e>1?(t.DisSelect(),t.DeleteItems(e+1,i-1,!1)):t.SetSelectBound(e,lp.OffsetAfter,e,lp.OffsetAfter),t.InsertStream(n,s,r),t.isClass($y)&&t.OnFormatDirty()}finally{t.EndFormat(!1)}o.ClearUndo(),o.FormatData()}finally{o.EndUpdate()}}finally{o.FIgnoreAcceptAction=!1}})),lp.PROCSERIES&&this.CheckCaretProcInfo()}},{key:"SaveSelectToText",value:function(){return this.ActiveSectionTopLevelData().SaveSelectToText()}},{key:"SaveSelectToStream",value:function(t){var e=this;this.DataSaveLiteStream(t,(function(){e.Style.States.Include(Ip.Copying);try{e.ActiveSectionTopLevelData().SaveSelectToStream(t)}finally{e.Style.States.Exclude(Ip.Copying)}}))}},{key:"SaveToLiteStream",value:function(t){var e=this;this.DataSaveLiteStream(t,(function(){e.Style.States.Include(Ip.Copying);try{var i=e.ActiveSection.Page;i.SaveItemToStream(t,0,0,i.Items.count-1,i.GetItemOffsetAfter(i.Items.count-1))}finally{e.Style.States.Exclude(Ip.Copying)}}))}},{key:"SaveToStreamNoTrace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;or.emrCommon.G_SaveTrace=!1;try{this.SaveToStream(t,e,i)}finally{or.emrCommon.G_SaveTrace=!0}}},{key:"RemoveTrace",value:function(){var t=this,e=new $l;e.ReverseOrder=!0,e.Areas.add(dp.Page),e.Areas.add(dp.Header),e.Areas.add(dp.Footer),e.Process=function(e,i,n,o,r){if(e.Items[i].StyleNo>cs.Null){var s=e.Items[i];0!=s.TraceStyles.value&&(t.TraceInfoAnnotate&&t.AnnotatePre.RemoveDataAnnotate(null),s.TraceStyles.has(sS.Add)?(s.Reset(),s.DeleteProperty(vS),s.DeleteProperty(IS),s.DeleteProperty(pS),s.TraceStyles.value=0):s.TraceStyles.has(sS.Del)&&(1==e.Items.count&&0==i?(s.Reset(),s.DeleteProperty(SS),s.DeleteProperty(FS),s.DeleteProperty(pS),s.TraceStyles.value=0):e.Items.delete(i)))}else e.Items[i].isClass(al)&&e.Items[i].FormatDirty()},this.TraverseItem(e),this.ClearUndo(),this.FormatData()}},{key:"AcceptTrace",value:function(t,e){var i=this,n=null,o=new $l;if(o.ReverseOrder=!0,o.Areas.add(dp.Page),o.Areas.add(dp.Header),o.Areas.add(dp.Footer),o.Process=function(t,e,o,r,s){t.Items[e].StyleNo>cs.Null?0!=(n=t.Items[e]).TraceStyles.value&&(!0,i.TraceInfoAnnotate&&i.AnnotatePre.RemoveDataAnnotate(null),n.TraceStyles.has(sS.Add)?(n.DeleteProperty(vS),n.DeleteProperty(IS),n.DeleteProperty(pS),n.TraceStyles.value=0):n.TraceStyles.has(sS.Del)&&(1==t.Items.count&&0==e?(n.DeleteProperty(SS),n.DeleteProperty(FS),n.DeleteProperty(pS),n.TraceStyles.value=0):t.Items.delete(e))):t.Items[e].isClass(al)&&t.Items[e].FormatDirty()},lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;o.SectionIndex=this.FEditProcInfo.SectionIndex;for(var r=this.Sections[this.FEditProcInfo.SectionIndex].Page,s=this.FEditProcInfo.BeginNo;s<=this.FEditProcInfo.EndNo;s++)o.Stop=o.Process(r,s,o.Tag,o.domainStack,o.Stop),o.Stop||r.Items[s].StyleNo4&&(i=or.system.parseFloatDef(e.edtLineSpace.text,0)),t.ApplyParaLineSpace(e.cbbSpaceMode.itemIndex,i),t.ApplyParaAlignHorz(e.cbbAlignHorz.itemIndex),t.ApplyParaAlignVert(e.cbbAlignVert.itemIndex),t.ApplyParaFirstIndent(or.system.parseFloatDef(e.edtFirstIndent.text,0)),t.ApplyParaLeftIndent(or.system.parseFloatDef(e.edtLeftIndent.text,0)),t.ApplyParaRightIndent(or.system.parseFloatDef(e.edtRightIndent.text,0)),t.ApplyParaBreakRough(e.chkBreakRough.checked),e.FLineSapceMinChanged&&(t.Style.LineSpaceMin=e.edtLineSpaceMin.number,t.FormatData())}finally{t.EndUpdate()}}))}}])&&QI(e.prototype,i),n&&QI(e,n),r}(ro);function og(t){return(og="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sg(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:320,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:246;rg(this,r),(t=o.call(this,e,i)).caption="属性",t.gridProperty=new Mn(1,2),t.gridProperty.marginLeft=5,t.gridProperty.marginRight=5,t.gridProperty.height=180,t.gridProperty.align=Xt,t.gridProperty.fixRowCount=1,t.gridProperty.rows[0][0].value="键",t.gridProperty.rows[0][1].value="值",t.gridProperty.setColWidth(0,100),t.gridProperty.setColWidth(1,180),t.pnlButton=new hn,t.pnlButton.height=40,t.pnlButton.borderVisible=!1,t.pnlButton.align=Xt;var n=new en("第一列为空时无效");n.left=2,n.top=10,n.font.color=at.OrangeRed,t.pnlButton.addControl(n);var s=new nn("新增行");s.left=n.right+5,s.top=5,s.width=55,s.onClick=function(){t.gridProperty.rowCount++,t.gridProperty.rows.last[0].value="",t.gridProperty.rows.last[1].value=""},t.pnlButton.addControl(s);var a=new nn("删除行");a.left=s.right+10,a.top=s.top,a.width=55,a.onClick=function(){t.gridProperty.deleteRow(t.gridProperty.row)},t.pnlButton.addControl(a);var l=new nn("保存");l.left=a.right+20,l.top=a.top,l.width=55,l.onClick=function(){t.modalResult=no,t.close()},t.pnlButton.addControl(l),t.beginUpdate();try{t.addControl(t.pnlButton),t.addControl(t.gridProperty),t.moveCenter()}finally{t.endUpdate()}return t}return e=r,(i=[{key:"getPropertys",value:function(t){this.gridProperty.rowCount=t.count+1;for(var e=1;e<=t.count;e++)this.gridProperty.rows[e][0].value=t[e-1].key,this.gridProperty.rows[e][1].value=t[e-1].val}},{key:"setPropertys",value:function(t){var e;t.clear();for(var i=1;i=0&&""!=this.ProcIndex?(this.FEmrView.PrintProcIndex=this.ProcIndex,this.FFromView.ActiveSection.Header.SaveToStream(t),t.position=0,this.FEmrView.ActiveSection.Header.LoadFromStream(t,this.FFromView.Style,lp.HC_FileVersionInt),t.clear(),this.FFromView.ActiveSection.Footer.SaveToStream(t),t.position=0,this.FEmrView.ActiveSection.Footer.LoadFromStream(t,this.FFromView.Style,lp.HC_FileVersionInt),this.FEmrView.ActiveSection.AssignPaper(this.FFromView.Sections[this.SectionIndex]),t.clear(),this.FFromView.GetProcAsStream(this.ProcIndex,t),t.position=0,this.FEmrView.InsertLiteStream(t)):(this.FEmrView.PrintProcIndex="",this.FFromView.SaveToStream(t),t.position=0,this.FEmrView.LoadFromStream(t)),t=null,this.FEmrView.PrintView=!0,this.FEmrView.HideTrace=!0,this.FEmrView.ReadOnly=!0}finally{this.FEmrView.EndUpdate()}}},{key:"SetView",value:function(t,e,i){this.SectionIndex=e,this.ProcIndex=i,this.FFromView=t,this.DoLoadFromView(),this.showModal((function(){}))}}])&&Ig(e.prototype,i),n&&Ig(e,n),r}(ro);function Dg(t){return(Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bg(t,e){for(var i=0;it.edtHeight.number?or.showMessage("线高度必需小于等于高度!"):(t.modalResult=no,t.close())},a.left=Math.trunc((t.width-a.width)/2),a.top=t.clientArea.height-30,t.beginUpdate();try{t.addControl(e),t.addControl(t.edtWidth),t.addControl(i),t.addControl(t.edtHeight),t.addControl(n),t.addControl(t.edtLineHeight),t.addControl(s),t.addControl(t.cbbLineStyle),t.addControl(a)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t){var e=this,i=t.ActiveSectionTopLevelData().GetActiveItem();this.beginUpdate();try{switch(this.edtWidth.text=i.Width,this.edtHeight.text=i.Height,this.edtLineHeight.text=i.LineHeight,i.LineStyle){case pt.Solid:this.cbbLineStyle.itemIndex=0;break;case pt.Dash:this.cbbLineStyle.itemIndex=1;break;case pt.Dot:this.cbbLineStyle.itemIndex=2;break;case pt.DashDot:this.cbbLineStyle.itemIndex=3;break;case pt.DashDotDot:this.cbbLineStyle.itemIndex=4;break;default:this.cbbLineStyle.itemIndex=0}this.cbbLineStyle.itemIndex=i.LineStyle,this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{switch(i.Width=or.system.parseIntDef(e.edtWidth.text,i.Width),i.Height=or.system.parseIntDef(e.edtHeight.text,i.Height),i.LineHeight=or.system.parseIntDef(e.edtLineHeight.text,i.LineHeight),e.cbbLineStyle.itemIndex){case 0:i.LineStyle=pt.Solid;break;case 1:i.LineStyle=pt.Dash;break;case 2:i.LineStyle=pt.Dot;break;case 3:i.LineStyle=pt.DashDot;break;case 4:i.LineStyle=pt.DashDotDot;break;default:i.LineStyle=pt.Solid}t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Ng(e.prototype,i),n&&Ng(e,n),r}(ro);function Hg(t){return(Hg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ug(t,e){for(var i=0;i=0?this.FTableItem.Rows[this.FTableItem.SelectCellRang.StartRow][this.FTableItem.SelectCellRang.StartCol]:this.FTableItem.Rows[0][0],this.beginUpdate();try{this.cbbBackColor.color=e.BackgroundColor,this.chkLeft.checked=e.BorderSides.has(fp.Left),this.chkTop.checked=e.BorderSides.has(fp.Top),this.chkRight.checked=e.BorderSides.has(fp.Right),this.chkBottom.checked=e.BorderSides.has(fp.Bottom),this.chkLTRB.checked=e.BorderSides.has(fp.LTRB),this.chkRTLB.checked=e.BorderSides.has(fp.RTLB)}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{if(0==i.cbbRang.itemIndex)if(i.FTableItem.SelectCellRang.EditCell())i.SetCellBorderBack(i.FTableItem.SelectCellRang.StartRow,i.FTableItem.SelectCellRang.StartCol);else if(i.FTableItem.SelectCellRang.StartRow>=0)for(var e=i.FTableItem.SelectCellRang.StartRow;e<=i.FTableItem.SelectCellRang.EndRow;e++)for(var n=i.FTableItem.SelectCellRang.StartCol;n<=i.FTableItem.SelectCellRang.EndCol;n++)i.SetCellBorderBack(e,n);else i.ApplyAllTable();else i.ApplyAllTable();t.Style.UpdateInfoRePaint()}finally{t.EndUpdate()}}))}}])&&Yg(e.prototype,i),n&&Yg(e,n),r}(ro);function tw(t){return(tw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ew(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iw(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:320,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:246;return ew(this,r),(t=o.call(this,e,i)).caption="数据组",t}return e=r,(i=[{key:"SetView",value:function(t){var e=this,i=t.ActiveSectionTopLevelData(),n=i.ActiveDomain;if(!(n.BeginNo<0)){var o=i.Items[n.BeginNo];this.beginUpdate();try{""!=o.GetValue(Iv.Name)&&(this.caption+="-"+o.GetValue(Iv.Name)),this.getPropertys(o.Propertys),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){e.setPropertys(o.Propertys),o.CheckPropertys(),o=i.Items[n.EndNo],e.setPropertys(o.Propertys),o.CheckPropertys(),t.ActiveSection.ReFormatActiveItem()}))}}}])&&iw(e.prototype,i),n&&iw(e,n),r}(ug);function lw(t){return(lw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cw(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:225,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:160;hw(this,r),t=o.call(this,e,i);var n=new en("标题:");n.left=10,n.top=10,t.edtTitle=new dn(""),t.edtTitle.left=n.left,t.edtTitle.top=n.bottom+5,t.edtTitle.width=200;var s=new en("批注:");s.left=n.left,s.top=t.edtTitle.bottom+10,t.edtText=new dn(""),t.edtText.left=s.left,t.edtText.top=s.bottom+5,t.edtText.width=200,t.btnOK=new nn("确定"),t.btnOK.left=Math.trunc((t.width-t.btnOK.width)/2),t.btnOK.top=t.edtText.bottom+10,t.btnOK.onClick=function(){t.modalResult=no,t.close()},t.beginUpdate();try{t.addControl(n),t.addControl(t.edtTitle),t.addControl(s),t.addControl(t.edtText),t.addControl(t.btnOK),t.moveCenter()}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetAnnotate",value:function(t){null!=t?(this.btnOK.text="修改",this.edtTitle.text=t.Content.Title,this.edtText.text=t.Content.Text,this.caption="批注序号-"+t.ID.toString()):(this.btnOK.text="确定",this.caption="新建批注",this.edtTitle.clear(),this.edtText.clear())}}])&&cw(e.prototype,i),n&&cw(e,n),r}(ro);function pw(t){return(pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sw(t,e){for(var i=0;ithis.FViewWidth)return void this.FCaret.Hide();if(this.FCaret.Y+this.FCaret.Height<0||this.FCaret.Y>this.FViewHeight)return void this.FCaret.Height}else if(this.FCaret.Heightthis.FViewHeight&&(this.FVScrollBar.position+=this.FCaret.Y+this.FCaret.Height+this.paddingTop-this.FViewHeight)}finally{this.FCaret.VScroll=!1}}if(!this.FCaret.HScroll){this.FCaret.HScroll=!0;try{this.FCaret.X?this.FHScrollBar.position+=this.FCaret.X-this.paddingLeft:this.FCaret.X+this.paddingLeft>this.FViewWidth&&(this.FHScrollBar.position+=this.FCaret.X+this.paddingLeft-this.FViewWidth)}finally{this.FCaret.HScroll=!1}}}this.FCaret.VScroll||this.FCaret.HScroll||(this.FCaret.Y+this.FCaret.Height>this.FViewHeight&&(this.FCaret.Height=this.FViewHeight-this.FCaret.Y),this.FCaret.Show(),this.DoCaretChange())}else this.FCaret.Hide()}}},{key:"CheckUpdateInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null!=this.FCaret&&this.FStyle.UpdateInfo.ReCaret&&(this.FStyle.UpdateInfo.ReCaret=!1,this.FStyle.UpdateInfo.ReStyle=!1,this.FStyle.UpdateInfo.ReScroll=!1,this.ReBuildCaret(t)),this.FStyle.UpdateInfo.RePaint&&(this.FStyle.UpdateInfo.RePaint=!1,this.UpdateView())}},{key:"DoMapChanged",value:function(){0==this.FUpdateCount&&(this.CalcScrollRang(),this.CheckUpdateInfo())}},{key:"DoCaretChange",value:function(){null!=this.OnCaretChange&&this.OnCaretChange(this,null)}},{key:"DoDataCheckUpdateInfo",value:function(){0==this.FUpdateCount&&this.CheckUpdateInfo()}},{key:"DoChange",value:function(){this.FChanged=!0,this.DoMapChanged(),null!=this.OnChange&&this.OnChange(this,null)}},{key:"CalcScrollRang",value:function(){this.FHScrollBar.max=this.paddingLeft+this.paddingRight,this.FVScrollBar.max=this.FData.height+this.paddingTop+this.paddingBottom}},{key:"_DeleteUnUsedStyle",value:function(){this.FStyle.TextStyles[0].CheckSaveUsed=!0,this.FStyle.TextStyles[0].TempNo=0;for(var t=1;t=1;r--)this.FStyle.TextStyles[r].CheckSaveUsed||this.FStyle.TextStyles.removeAt(r);for(var s=this.FStyle.ParaStyles.count-1;s>=0;s--)this.FStyle.ParaStyles[s].CheckSaveUsed||this.FStyle.ParaStyles.removeAt(s)}},{key:"doPaint_",value:function(t){t.bitBlt(0,0,this.FViewWidth,this.FViewHeight,this.FDataBmpCanvas,0,0,this.FViewWidth,this.FViewHeight),t.brush.color=this.color,t.fillBounds(this.FVScrollBar.left,this.FHScrollBar.top,this.FVScrollBar.width,this.FHScrollBar.height),Tw(Mw(r.prototype),"doPaint_",this).call(this,t)}},{key:"doResize_",value:function(){Tw(Mw(r.prototype),"doResize_",this).call(this),this.GetViewWidth(),this.GetViewHeight(),this.FViewWidth>0&&this.FViewHeight>0&&(this._canvas.width=this.FViewWidth,this._canvas.height=this.FViewHeight,this._context=this._canvas.getContext("2d"),this.FDataBmpCanvas=new Dt(this._context),this.FDataBmpCanvas.prepareConext(or._scale)),this.FData.Width=this.FViewWidth-this.paddingLeft-this.paddingRight,this.FData.ReFormat(),this.FStyle.UpdateInfoRePaint(),null!=this.FCaret&&this.FStyle.UpdateInfoReCaret(!1),this.DoMapChanged()}},{key:"doSetBounds_",value:function(){this.FVScrollBar.left=this.width-this.FVScrollBar.width,this.FVScrollBar.height=this.height-this.FHScrollBar.height,this.FVScrollBar.pageSize=this.FVScrollBar.height,this.FHScrollBar.top=this.height-this.FHScrollBar.height,this.FHScrollBar.width=this.width-this.FVScrollBar.width,this.FHScrollBar.pageSize=this.FHScrollBar.width,Tw(Mw(r.prototype),"doSetBounds_",this).call(this)}},{key:"doSetFocus_",value:function(t){Tw(Mw(r.prototype),"doSetFocus_",this).call(this,t),this.focused&&this.imeMode==Mi&&or.ime.setControl(this)}},{key:"imeActive",value:function(){this.FCaret.Show()}},{key:"doMouseDown_",value:function(t){var e=new ei;e.assign(t),e.x=t.x-this.paddingLeft-this.FHScrollBar.position,e.y=t.y-this.paddingTop+this.FVScrollBar.position,this.FData.MouseDown(e),this.CheckUpdateInfo(),Tw(Mw(r.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseMove_",value:function(t){Tw(Mw(r.prototype),"doMouseMove_",this).call(this,t),lp.GCursor=ue;var e=new ei;e.assign(t),e.x=t.x-this.paddingLeft-this.FHScrollBar.position,e.y=t.y-this.paddingTop+this.FVScrollBar.position,this.FData.MouseMove(e),this.cursor=lp.GCursor,this.CheckUpdateInfo()}},{key:"doMouseUp_",value:function(t){if(Tw(Mw(r.prototype),"doMouseUp_",this).call(this,t),this.imeMode==Mi&&or.ime.setControl(this),t.button!=ie){var e=new ei;e.assign(t),e.x=t.x-this.paddingLeft-this.FHScrollBar.position,e.y=t.y-this.paddingTop+this.FVScrollBar.position,this.FData.MouseUp(e),this.FStyle.UpdateInfo.DragingSelected&&(lp.GCursor=oe),this.cursor=lp.GCursor,this.CheckUpdateInfo(),this.FStyle.UpdateInfo.Selecting=!1,this.FStyle.UpdateInfo.DragingSelected=!1}}},{key:"doMouseWheel_",value:function(t){or.keyDownStates[_e]?this.FHScrollBar.position-=t.delta:this.FVScrollBar.position-=t.delta}},{key:"doKeyDown_",value:function(t){Tw(Mw(r.prototype),"doKeyDown_",this).call(this,t),or.keyDownStates[_e]&&t.keyCode==He?this.SelectAll():or.keyDownStates[_e]&&t.keyCode==je?this.Undo():or.keyDownStates[_e]&&t.keyCode==ze?this.Redo():(this.FData.KeyDown(t),lp.IsKeyDownEdit(t.keyCode)?this.DoChange():lp.IsDirectionKey(t.keyCode)&&this.DoDataCheckUpdateInfo()),this.CheckUpdateInfo()}},{key:"doKeyUp_",value:function(t){Tw(Mw(r.prototype),"doKeyUp_",this).call(this,t),this.FData.KeyUp(t)}},{key:"doKeyPress_",value:function(t){Tw(Mw(r.prototype),"onKeyPress",this).call(this,t),lp.IsKeyPressWant(t)&&(this.FData.KeyPress(t.keyCode),this.DoChange(),this.CheckUpdateInfo())}},{key:"imeInput",value:function(t){""!=t&&(this.FData.InsertText(t),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.CheckUpdateInfo())}},{key:"DoDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){}},{key:"DoDataCreateStyleItem",value:function(t,e){return null!=this.FOnCreateStyleItem?this.FOnCreateStyleItem(t,e):null}},{key:"DoDataInsertItem",value:function(t,e){null!=this.OnInsertItem&&this.OnInsertItem(t,e)}},{key:"DoDataRemoveItem",value:function(t,e){null!=this.OnRemoveItem&&this.OnRemoveItem(t,e)}},{key:"DataSaveLiteStream",value:function(t,e){lp._SaveFileFormatAndVersion(t),this.FStyle.SaveToStream(t),e()}},{key:"DataLoadLiteStream",value:function(t,e){var i=lp._LoadFileFormatAndVersion(t),n=new cs;n.LoadFromStream(t,i.fileVersion),e(i.fileVersion,n)}},{key:"InsertLiteStream",value:function(t){var e=this,i=!1;return this.DataLoadLiteStream(t,(function(n,o){e.BeginUpdate();try{i=e.FData.GetTopLevelData().InsertStream(t,o,n)}finally{e.EndUpdate()}})),i}},{key:"DoCopyRequest",value:function(t){var e=this.FData.GetTopLevelItem();return e.StyleNo!=cs.Edit||!e.SelectTextExists()||t==Ao}},{key:"DoPasteRequest",value:function(t){return this.FData.GetTopLevelItem().StyleNo!=cs.Edit||t==Ao}},{key:"DoPasteFormatStream",value:function(t){return!0}},{key:"DoCopyAsStream",value:function(t){}},{key:"doCut_",value:function(t){this.doCopy_(t),this.FData.DeleteSelected(),this.CheckUpdateInfo()}},{key:"doCopy_",value:function(t){var e=this;if(this.FData.SelectExists()){this.FStyle.States.Include(Ip.Copying);try{if(this.DoCopyRequest(Ao)){var i=this.FData.SaveSelectToText();t.clipboardData.setData(I.TXT,i)}if(this.DoCopyRequest(lp.HCExtFormat)){var n=new K;this.DoCopyAsStream(n),this.DataSaveLiteStream(n,(function(){e.FData.GetTopLevelData().SaveSelectToStream(n)})),t.clipboardData.setData(lp.HC_EXT,n.toJSONString())}}finally{this.FStyle.States.Exclude(Ip.Copying)}}}},{key:"doPaste_",value:function(t){this.FStyle.States.Include(Ip.Pasting);try{if(t.clipboardData.types.indexOf(lp.HC_EXT)>-1&&this.DoPasteRequest(lp.HCExtFormat)){var e=new K;if(e.fromJSONString(t.clipboardData.getData(lp.HC_EXT)),!this.DoPasteFormatStream(e))return;this.InsertLiteStream(e)}else t.clipboardData.types.indexOf(I.TXT)>-1&&this.DoPasteRequest(Ao)&&(this.FData.InsertText(t.clipboardData.getData(I.TXT)),this.DoMapChanged())}finally{this.FStyle.States.Exclude(Ip.Pasting)}}},{key:"DataChangeByAction",value:function(t){var e=t();return this.DoChange(),e}},{key:"DoGetUndoList",value:function(){return this.FUndoList}},{key:"DoUndoNew",value:function(){var t=new ka;return t.HScrollPos=this.FHScrollBar.position,t.VScrollPos=this.FVScrollBar.position,t.Data=this.FData,t}},{key:"DoUndoGroupBegin",value:function(t,e){var i=new ba;return i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.FData,i.CaretDrawItemNo=this.FData.CaretDrawItemNo,i}},{key:"DoUndoGroupEnd",value:function(t,e){var i=new xa;return i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.FData,i.CaretDrawItemNo=this.FData.CaretDrawItemNo,i}},{key:"DoUndo",value:function(t){var e=this;(t.isClass(ka)||t.isClass(ba))&&(this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.DoGetUndoList().GroupWorking?this.FData.Undo(t):this.DataChangeByAction((function(){return e.FData.Undo(t),!0}))}},{key:"DoRedo",value:function(t){var e=this;(t.isClass(ka)||t.isClass(ba))&&(this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.DoGetUndoList().GroupWorking?this.FData.Redo(t):this.DataChangeByAction((function(){return e.FData.Redo(t),!0}))}},{key:"ApplyParaAlignHorz",value:function(t){this.FData.ApplyParaAlignHorz(t),this.CheckUpdateInfo()}},{key:"ApplyParaAlignVert",value:function(t){this.FData.ApplyParaAlignVert(t),this.CheckUpdateInfo()}},{key:"ApplyParaBackColor",value:function(t){this.FData.ApplyParaBackColor(t),this.CheckUpdateInfo()}},{key:"ApplyParaLineSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.FData.ApplyParaLineSpace(t,e),this.CheckUpdateInfo()}},{key:"ApplyTextStyle",value:function(t){this.FData.ApplyTextStyle(t),this.CheckUpdateInfo()}},{key:"ApplyTextFontName",value:function(t){this.FData.ApplyTextFontName(t),this.CheckUpdateInfo()}},{key:"ApplyTextFontSize",value:function(t){this.FData.ApplyTextFontSize(t),this.CheckUpdateInfo()}},{key:"ApplyTextColor",value:function(t){this.FData.ApplyTextColor(t),this.CheckUpdateInfo()}},{key:"ApplyTextBackColor",value:function(t){this.FData.ApplyTextBackColor(t),this.CheckUpdateInfo()}},{key:"InsertText",value:function(t){var e=this;return this.DataChangeByAction((function(){return e.FData.InsertText(t)}))}},{key:"InsertItem",value:function(t){var e=this;return this.DataChangeByAction((function(){return e.FData.InsertItem(t)}))}},{key:"InsertItemEx",value:function(t,e){var i=this;return this.DataChangeByAction((function(){return i.FData.InsertItemEx(t,e)}))}},{key:"InsertDomain",value:function(t){var e=this;return this.DataChangeByAction((function(){return e.FData.InsertDomain(t)}))}},{key:"InsertTable",value:function(t,e){var i=this;return this.DataChangeByAction((function(){return i.FData.GetTopLevelData().InsertTable(t,e)}))}},{key:"TopLevelData",value:function(){return this.FData.GetTopLevelData()}},{key:"SetActiveItemText",value:function(t){this.FData.SetActiveItemText(t),this.CheckUpdateInfo()}},{key:"SelectAll",value:function(){this.FData.SelectAll(),this.FStyle.UpdateInfoRePaint(),this.CheckUpdateInfo()}},{key:"SaveToFile",value:function(t){}},{key:"LoadFromFile",value:function(t){}},{key:"SaveToStream",value:function(t){lp._SaveFileFormatAndVersion(t),this._DeleteUnUsedStyle(),this.FStyle.SaveToStream(t),this.FData.SaveToStream(t)}},{key:"LoadFromStream",value:function(t){this.BeginUpdate();try{this.FUndoList.clear(),this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.FData.Clear(),this.FStyle.Initialize(),t.position=0;var e=lp._LoadFileFormatAndVersion(t);e.fileExt!=lp.HC_EXT&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!"),this.FStyle.LoadFromStream(t,e.fileVersion),this.FData.LoadFromStream(t,this.FStyle,e.fileVersion),this.DoMapChanged()}finally{this.FUndoList.RestoreState()}}finally{this.EndUpdate()}}},{key:"Clear",value:function(){this.FData.Clear()}},{key:"Undo",value:function(){if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Undo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}},{key:"Redo",value:function(){if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Redo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}},{key:"UndoGroupBegin",value:function(){this.FUndoList.Enable&&this.FUndoList.UndoGroupBegin(this.FData.SelectInfo.StartItemNo,this.FData.SelectInfo.StartItemOffset)}},{key:"UndoGroupEnd",value:function(){this.FUndoList.Enable&&this.FUndoList.UndoGroupEnd(this.FData.SelectInfo.StartItemNo,this.FData.SelectInfo.StartItemOffset)}},{key:"GetViewRect",value:function(){return U.CreateByBounds(this.paddingLeft,this.paddingTop,this.FViewWidth,this.FViewHeight)}},{key:"UpdateView",value:function(){this.UpdateViewRect(this.GetViewRect())}},{key:"UpdateViewRect",value:function(t){if(!this.FStyle.States.Contain(Ip.Destroying)&&0==this.FUpdateCount){this.FDataBmpCanvas.save();try{this.FDataBmpCanvas.clipRect(t),this.FDataBmpCanvas.brush.color=at.White,this.FDataBmpCanvas.fillRect(U.CreateByBounds(0,0,this.FViewWidth,this.FViewHeight));var e=new Us;this.FData.PaintData(this.paddingLeft-this.FHScrollBar.position,this.paddingTop,this.width-this.FHScrollBar.position-this.paddingRight,this.paddingTop+this.FData.height,this.paddingTop,this.height-this.FHScrollBar.height,this.FVScrollBar.position,this.FDataBmpCanvas,e);for(var i=0;i0?this.edtFixRowLast.text=(i.FixRow+i.FixRowCount-1).toString():this.edtFixRowLast.text=this.edtFixRowFirst.text,this.edtFixColFirst.text=i.FixCol.toString(),i.FixColCount>0?this.edtFixColLast.text=(i.FixCol+i.FixColCount-1).toString():this.edtFixColLast.text=this.edtFixColFirst.text,this.chkDeleteAllow.checked=i.DeleteAllow,this.chkCanResize.checked=i.CanResize,this.pageRow.text="行("+i.SelectCellRang.StartRow.toString()+")",i.SelectCellRang.StartRow>=0&&i.SelectCellRang.StartCol>=0?i.SelectCellRang.EndRow>=0?(i.Rows[i.SelectCellRang.StartRow][i.SelectCellRang.StartCol].AlignVert,this.pageCell.text="单元格("+i.SelectCellRang.StartRow.toString()+","+i.SelectCellRang.StartCol.toString()+") - ("+i.SelectCellRang.EndRow.toString()+","+i.SelectCellRang.EndCol.toString()+")"):(i.GetEditCell().AlignVert,this.pageCell.text="单元格("+i.SelectCellRang.StartRow.toString()+","+i.SelectCellRang.StartCol.toString()+")",this.mmoScript.InsertText(i.GetEditCell().CellData.Script)):this.pageCell.visible=!1,this.getPropertys(i),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{i.CellHPaddingMM=or.system.parseFloatDef(e.edtCellHPadding.text,.2),i.CellVPaddingMM=or.system.parseFloatDef(e.edtCellVPadding.text,0),i.BorderWidthPt=or.system.parseFloatDef(e.edtBorderWidth.text,.5),i.borderVisible=e.chkBorderVisible.checked,i.SetFixRowAndCount(or.system.parseIntDef(e.edtFixRowFirst.text,-1),or.system.parseIntDef(e.edtFixRowLast.text,-1)-or.system.parseIntDef(e.edtFixRowFirst.text,-1)+1),i.SetFixColAndCount(or.system.parseIntDef(e.edtFixColFirst.text,-1),or.system.parseIntDef(e.edtFixColLast.text,-1)-or.system.parseIntDef(e.edtFixColFirst.text,-1)+1),i.DeleteAllow=e.chkDeleteAllow.checked,i.CanResize=e.chkCanResize.checked,i.SelectCellRang.StartRow>=0&&i.SelectCellRang.StartCol>=0&&(i.SelectCellRang.EndCol>0||(i.GetEditCell().CellData.Script=e.mmoScript.Data.SaveToText())),e.setPropertys(i),i.PropertyChange(),i.Change(),t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Hw(e.prototype,i),n&&Hw(e,n),r}(ro);function Xw(t){return(Xw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kw(t,e){for(var i=0;ics.Null)i.Index&&r.peek().addNode(i.Name+"("+i.Text+")",i);else if(i.StyleNo==cs.Domain)if(za.IsBeginMark(i)){var u=null;u=i.IsProcBegin?r.peek().addNode("[病程]"+i.Name,i):r.peek().addNode("[数据组]"+i.Name,i),r.push(u)}else r.pop();else i.StyleNo!=cs.Image&&i.StyleNo!=cs.Table&&i.StyleNo!=cs.CheckBox&&i.StyleNo!=cs.Edit&&i.StyleNo!=cs.Combobox&&i.StyleNo!=cs.DateTimePicker&&i.StyleNo!=cs.RadioGroup||i.Index&&(i.Name?r.peek().addNode(i.Name+"("+i.Text+")",i):r.peek().addNode("非文本("+i.Text+")",i))},this.FEmrView.TraverseItem(e),o.expand=!0}}])&&aC(e.prototype,i),n&&aC(e,n),r}(ro);function dC(t){return(dC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mC(t,e){return(mC=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=SC(t);if(e){var o=SC(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pC(this,i)}}function pC(t,e){return!e||"object"!==dC(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function SC(t){return(SC=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FC(t,e){for(var i=0;i1};var a=s.addItem("打开");a.hint="打开本地文件",a.onClick=function(){t.PopupFormClose(),t._openFileDialog()},s.addItem("新建").onClick=function(){t.FEmrView.Clear()},s.addItem("另存为").onClick=function(){var e=new K;t.FEmrView.SaveToStream(e,!1);var i=new Uint8Array(e.buffer),n=new Blob([i],{type:"application/octet-stream"}),o=window.URL.createObjectURL(n),r=document.createElement("a");document.body.appendChild(r),r.href=o,r.download="HCView H5.hcf",r.click(),window.URL.revokeObjectURL(n),document.body.removeChild(r)},this.menuExportFile=s.addItem("导出"),this.menuExportFile.addItem("XML").onClick=function(){t.DoExportXML()},this.menuExportFile.addItem("文本").onClick=function(){t.DoExportTXT()},this.menuExportFile.addItem("HTML").onClick=function(){t.DoExportHTML()},this.menuExportFile.addItem("PDF").onClick=function(){t.DoExportPDF()},this.menuExportFile.visible=!1,this.menuImplortFile=s.addItem("导入"),this.menuImplortFile.addItem("XML").onClick=function(){t.DoImportXML()},this.menuImplortFile.addItem("文本").onClick=function(){t.DoImportTXT()},this.menuImplortFile.visible=!1,s.addItem("页面设置").onClick=function(){(new ZI).SetView(t.FEmrView)},this.menuDeleteSection=s.addItem("删除当前节"),this.menuDeleteSection.onClick=function(){t.FEmrView.DeleteActiveSection()},this.btnFile=new an("文件"),this.btnFile.image.src=or.emrCommon.homePath+"image/file.png",this.btnFile.textVisible=!0,this.btnFile.hint="文档处理",this.btnFile.dropDownMenu=s,this.captionBar.addControl(this.btnFile),this.btnSave=this.captionBar.addButton("保存",!0,or.emrCommon.homePath+"image/save.png"),this.btnSave.onClick=function(){t.DoSave()};var l=new _n;l.dropDownStyle=!0,l.addItem("全部").onClick=function(){t.Print()},l.addItem("当前页").onClick=function(){t.PrintCurPage()},l.addItem("指定页码或范围").onClick=function(){t.DoPrintPageRange(t.FEmrView)},l.addSpliter(),l.addItem("奇数页(顺序)").onClick=function(){t.DoPrintOdd(t.FEmrView,!1)},l.addItem("奇数页(倒序)").onClick=function(){t.DoPrintOdd(t.FEmrView,!0)},l.addSpliter(),l.addItem("偶数页(顺序)").onClick=function(){t.DoPrintEven(t.FEmrView,!1)},l.addItem("偶数页(倒序)").onClick=function(){t.DoPrintEven(t.FEmrView,!0)},l.addSpliter(),l.addItem("当前行-当前页").onClick=function(){t.DoPrintCurLine(t.FEmrView)},l.addItem("当前行-最后页").onClick=function(){t.DoPrintCurLine(t.FEmrView,t.FEmrView.PageCount)},l.addItem("当前页选中内容").onClick=function(){t.DoPrintSelect(t.FEmrView)};var h=l.addItem("预览");h.addItem("全部").onClick=function(){t.PrintView()};var c=h.addItem("当前病程");c.onClick=function(){t.PrintView(t.FEmrView.FCaretProcInfo.SectionIndex,t.FEmrView.FCaretProcInfo.Index)},l.onPopup=function(){c.enabled=""!=t.FEmrView.FCaretProcInfo.Index},this.btnPrint=new an("打印"),this.btnPrint.image.src=or.emrCommon.homePath+"image/print.png",this.btnPrint.textVisible=!0,this.btnPrint.hint="文档打印",this.btnPrint.dropDownMenu=l,this.captionBar.addControl(this.btnPrint),this.btnInsert=new an("插入"),this.btnInsert.textVisible=!0,this.btnInsert.hint="插入功能",this.btnInsert.dropDownMenu=e,this.captionBar.addControl(this.btnInsert),this.captionBar.addSpliter(),this.captionBar.addButton("撤销",!1,or.emrCommon.homePath+"image/undo.png").onClick=function(){t.FEmrView.Undo()},this.captionBar.addButton("恢复",!1,or.emrCommon.homePath+"image/redo.png").onClick=function(){t.FEmrView.Redo()},this.captionBar.addSpliter(),this.cbbZoom=new Cn("100%"),this.cbbZoom.align=Wt,this.cbbZoom.static=!0,this.cbbZoom.width=48,this.cbbZoom.dropDownWidth=this.cbbZoom.width+5,this.cbbZoom.addItem("25%"),this.cbbZoom.addItem("50%"),this.cbbZoom.addItem("75%"),this.cbbZoom.addItem("100%"),this.cbbZoom.addItem("125%"),this.cbbZoom.addItem("150%"),this.cbbZoom.addItem("200%"),this.cbbZoom.addItem("300%"),this.cbbZoom.addItem("500%"),this.cbbZoom.onSelectedIndexChange=function(){var e=t.cbbZoom.text.replace("%","");t.FEmrView.Zoom=e/100},this.captionBar.addControl(this.cbbZoom),this.cbbFont=new Dn(""),this.cbbFont.static=!0,this.cbbFont.width=56,this.cbbFont.align=Wt,(new ct).detect("Microsoft Himalaya")&&this.cbbFont.addItem("Microsoft Himalaya"),this.cbbFont.onSelectedIndexChange=function(){t.FEmrView.ApplyTextFontName(t.cbbFont.text)},this.captionBar.addControl(this.cbbFont),this.cbbFontSize=new Cn(""),this.cbbFontSize.static=!0,this.cbbFontSize.width=48,this.cbbFontSize.dropDownWidth=64,this.cbbFontSize.state=!0,this.cbbFontSize.align=Wt,this.cbbFontSize.addItem("初号"),this.cbbFontSize.addItem("小初"),this.cbbFontSize.addItem("一号"),this.cbbFontSize.addItem("小一"),this.cbbFontSize.addItem("二号"),this.cbbFontSize.addItem("小二"),this.cbbFontSize.addItem("三号"),this.cbbFontSize.addItem("小三"),this.cbbFontSize.addItem("四号"),this.cbbFontSize.addItem("小四"),this.cbbFontSize.addItem("五号"),this.cbbFontSize.addItem("小五"),this.cbbFontSize.addItem("10"),this.cbbFontSize.addItem("10.5"),this.cbbFontSize.addItem("11"),this.cbbFontSize.addItem("12"),this.cbbFontSize.addItem("14"),this.cbbFontSize.addItem("16"),this.cbbFontSize.addItem("18"),this.cbbFontSize.addItem("20"),this.cbbFontSize.addItem("22"),this.cbbFontSize.addItem("24"),this.cbbFontSize.addItem("26"),this.cbbFontSize.addItem("28"),this.cbbFontSize.addItem("36"),this.cbbFontSize.addItem("48"),this.cbbFontSize.addItem("72"),this.cbbFontSize.itemIndex=10,this.cbbFontSize.onSelectedIndexChange=function(){t.FEmrView.ApplyTextFontSize(mt.fontSizeToPt(t.cbbFontSize.text))},this.captionBar.addControl(this.cbbFontSize),this.cbbFontColor=new Rn,this.cbbFontColor.align=Wt,this.cbbFontColor.onSelectedIndexChange=function(){t.FEmrView.ApplyTextColor(t.cbbFontColor.color)},this.captionBar.addControl(this.cbbFontColor),this.captionBar.addSpliter(),this.btnBold=this.captionBar.addButton("加粗",!1,or.emrCommon.homePath+"image/bold.png"),this.btnBold.hint="加粗",this.btnBold.onClick=function(){t.FEmrView.ApplyTextStyle(_r)},this.btnItalic=this.captionBar.addButton("倾斜",!1,or.emrCommon.homePath+"image/italic.png"),this.btnItalic.hint="倾斜",this.btnItalic.onClick=function(){t.FEmrView.ApplyTextStyle(xr)},this.btnUnderline=this.captionBar.addButton("下划线",!1,or.emrCommon.homePath+"image/underline.png"),this.btnUnderline.hint="下划线",this.btnUnderline.onClick=function(){t.FEmrView.ApplyTextStyle(Ar)},this.btnStrikeOut=this.captionBar.addButton("中划线",!1,or.emrCommon.homePath+"image/strikeout.png"),this.btnStrikeOut.hint="中划线",this.btnStrikeOut.onClick=function(){t.FEmrView.ApplyTextStyle(Tr)},this.btnSuperscript=this.captionBar.addButton("上标",!1,or.emrCommon.homePath+"image/superscript.png"),this.btnSuperscript.hint="上标",this.btnSuperscript.onClick=function(){t.FEmrView.ApplyTextStyle(Or)},this.btnSubscript=this.captionBar.addButton("下标",!1,or.emrCommon.homePath+"image/subscript.png"),this.btnSubscript.hint="下标",this.btnSubscript.onClick=function(){t.FEmrView.ApplyTextStyle(Nr)},this.btnFormatBrush=this.captionBar.addButton("格式刷",!1,or.emrCommon.homePath+"image/formatbrush.png"),this.btnFormatBrush.visible=!1,this.btnFormatBrush.hint="格式刷",this.btnFormatBrush.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData().CurStyleNo;e>cs.Null&&(t.FEmrView.Style.FormatBrushStyleNo=e,t.FEmrView.Style.States.Include(Ip.FormatBrushing))},this.captionBar.addSpliter();var u=this.captionBar.addButton("左缩进",!1,or.emrCommon.homePath+"image/rightindent.png");u.hint="增加左缩进",u.onClick=function(){t.FEmrView.ApplyParaLeftIndentAdd()};var f=this.captionBar.addButton("右缩进",!1,or.emrCommon.homePath+"image/leftindent.png");f.hint="减少左缩进",f.onClick=function(){t.FEmrView.ApplyParaLeftIndentAdd(!1)},this.btnAlignLeft=this.captionBar.addButton("居左",!1,or.emrCommon.homePath+"image/left.png"),this.btnAlignLeft.hint="左对齐",this.btnAlignLeft.onClick=function(){t.FEmrView.ApplyParaAlignHorz(dr)},this.btnAlignCenter=this.captionBar.addButton("居中",!1,or.emrCommon.homePath+"image/center.png"),this.btnAlignCenter.hint="居中对齐",this.btnAlignCenter.onClick=function(){t.FEmrView.ApplyParaAlignHorz(mr)},this.btnAlignRight=this.captionBar.addButton("居右",!1,or.emrCommon.homePath+"image/right.png"),this.btnAlignRight.hint="右对齐",this.btnAlignRight.onClick=function(){t.FEmrView.ApplyParaAlignHorz(yr)},this.btnAlignJustify=this.captionBar.addButton("两端",!1,or.emrCommon.homePath+"image/justify.png"),this.btnAlignJustify.hint="两端对齐",this.btnAlignJustify.onClick=function(){t.FEmrView.ApplyParaAlignHorz(pr)},this.btnAlignScatter=this.captionBar.addButton("分散",!1,or.emrCommon.homePath+"image/scatter.png"),this.btnAlignScatter.hint="分散对齐",this.btnAlignScatter.onClick=function(){t.FEmrView.ApplyParaAlignHorz(Sr)};var d=new _n;d.addItem("单倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS100)},d.addItem("1.15倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS115)},d.addItem("1.5倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS150)},d.addItem("2倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS200)};var m=new an("行间距");m.hint="行间距选项",m.image.src=or.emrCommon.homePath+"image/linespace.png",m.dropDownMenu=d,this.captionBar.addControl(m),this.FContextMenu=new _n,this.FContextMenu.onPopup=function(){null!=t.FEmrView.ActiveSectionTopLevelData().ActiveAnnotate?(Q.enabled=!0,$.enabled=!0):(Q.enabled=!1,$.enabled=!1);var e=t.FEmrView.ActiveSection.ActiveData,i=e.GetActiveFloatItem(),n=e.ReadOnly;if(null==i){j.visible=!1;for(var o=e.GetActiveItem(),r=null,s=o;null!=s&&s.isClass(Wa)&&null!=s.GetActiveData();)null!=r&&(e=r,o=s),r=s.GetActiveData(),s=r.GetActiveItem(),r.ReadOnly&&(n=!0);if(null==r&&(r=e),n){for(var a=0;a0){A.enabled=!0;for(var h=l.SelectCellRang.StartRow;h<=l.SelectCellRang.EndRow;h++)if(!l.RowCanDelete(h)){A.enabled=!1;break}}else A.enabled=l.CurRowCanDelete();T.enabled=l.CurColCanDelete(),b.enabled=l.SelectedCellCanMerge(),l.BorderVisible?O.text="隐藏边框":O.text="显示边框"}if(N.enabled=!n,N.visible=N.enabled,p.enabled=r.SelectExists(),p.visible=p.enabled,y.enabled=p.enabled&&!t.FEmrView.ActiveSection.ReadOnly,y.visible=y.enabled,S.enabled=!n&&(or.localStorage.hasKey(lp.HC_EXT)||or.localStorage.hasKey(g)),S.visible=S.enabled,v.enabled=!n&&or.localStorage.hasKey(g),v.visible=v.enabled,W.visible=!1,E.visible=!1,M.visible=!1,L.visible=!1,Y.visible=!1,J.visible=!1,G.visible=!1,U.visible=!1,V.visible=!1,B.visible=!1,z.visible=!1,!n){if(s.isClass(YS))W.visible=!r.ReadOnly&&s.Active,W.text="图片属性";else if(W.visible=!r.ReadOnly&&!r.SelectExists()&&s.isClass(Ja)&&s.Active,W.visible)switch(s.StyleNo){case cs.RadioGroup:W.text="DeRadioGroup属性";break;case cs.Edit:W.text="DeEdit属性";break;case cs.DateTimePicker:W.text="DeDateTiem属性";break;case cs.Combobox:W.text="DeCombobox属性";break;default:W.text="属性("+s.className+")"}s.isClass(ES)&&(s.IsElement&&(E.visible=!0,E.text=s.GetValue(hS)),t.FEmrView.DesignModeEx&&(M.visible=!0,L.visible=!0,r.SelectExists()?(Y.text="运行时禁止编辑",Y.visible=!0,J.text="运行时禁止复制",J.visible=!0):(s.EditProtect?Y.text="运行时允许编辑":Y.text="运行时禁止编辑",Y.visible=!0,s.CopyProtect?J.text="运行时允许复制":J.text="运行时禁止复制",J.visible=!0))),r.ActiveDomain.BeginNo>=0&&!r.Items[r.ActiveDomain.BeginNo].IsProc&&(G.visible=!0,G.text="["+r.Items[r.ActiveDomain.BeginNo].GetValue(hS)+"]",t.FEmrView.DesignModeEx&&(U.visible=!0,V.visible=!0)),s.StyleNo0?t.FEmrView.ActiveTableDeleteRowFrom(e.SelectCellRang.StartRow,e.SelectCellRang.EndRow):t.FEmrView.ActiveTableDeleteCurRow()};var T=F.addItem("删除当前列");T.onClick=function(){t.FEmrView.ActiveTableDeleteCurCol()},F.addSpliter(),F.addItem("边框及背景").onClick=function(){(new $g).SetView(t.FEmrView)};var O=F.addItem("显示/隐藏边框");O.onClick=function(){var e=t.FEmrView.ActiveSection.ActiveData.GetActiveItem();e.isClass(ic)&&(e.BorderVisible=!e.BorderVisible,t.FEmrView.UpdateView())},F.addItem("适应宽度").onClick=function(){var e=t.FEmrView.ActiveSection.ActiveData.GetActiveRectItem();null!=e&&e.AdjustWidth(!0)},F.addItem("属性").onClick=function(){t.DoTablePropertyClick()};var N=this.FContextMenu.addItem("段落");N.onClick=function(){(new ng).SetView(t.FEmrView)},this.FContextMenu.addItem("文档结构").onClick=function(){t.ShowDocTree()};var B=this.FContextMenu.addSpliter(),E=this.FContextMenu.addItem("数据元");E.addItem("重新选择").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();t.DoDeItemAutoComplate(e,e.GetActiveItemNo())},E.addItem("引用上文").onClick=function(){var e=t.EmrView.ActiveSectionTopLevelData().GetActiveItem();t.ActiveDeItemSync(e)},E.addItem("更新引用").onClick=function(){if(null!=t.OnDeItemGetSyncValue){var e=t.EmrView.ActiveSectionTopLevelData().GetActiveItem(),i=t.OnDeItemGetSyncValue(e);if(i&&""!=i){t.DoSetActiveDeItemText(e,i,!1)}}},E.addSpliter(),E.addItem("重置").onClick=function(){t.FEmrView.ActiveSectionTopLevelData().GetActiveItem().Reset(),t.FEmrView.ActiveSection.ReFormatActiveItem()};var M=E.addItem("删除");M.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();t.FEmrView.DeleteActiveDataItems(e.SelectInfo.StartItemNo)};var L=E.addItem("属性");L.onClick=function(){(new Tg).SetView(t.FEmrView)};var G=this.FContextMenu.addItem("数据组");G.addItem("重新选择").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveDomain;t.DoDeGroupAutoComplate(e,i.BeginNo,i.EndNo)};var H=G.addItem("引用上文");H.addItem("引用为文本").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveDomain,n=t.FEmrView.GetDeGroupAsText(e.Items[i.BeginNo].Index);n&&(t.FEmrView.SetDataDeGroupText(e,i.BeginNo,i.EndNo,n),t.FEmrView.FormatSection(t.FEmrView.ActiveSectionIndex))},H.addItem("带结构引用").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveDomain,n=t.FEmrView.GetDeGroupAsStream(e.Items[i.BeginNo].Index);n&&(n.position=0,t.FEmrView.SetDataDeGroupFromStream(e,i.BeginNo,i.EndNo,n))},G.addSpliter();var U=G.addItem("删除");U.onClick=function(){t.FEmrView.DeleteActiveDomain()};var V=G.addItem("属性");V.onClick=function(){(new aw).SetView(t.FEmrView)};var W=this.FContextMenu.addItem("属性");W.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData().GetActiveItem();if(e.StyleNo==cs.RadioGroup)(new vg).SetView(t.FEmrView,e);else if(e.StyleNo==cs.Edit){(new Xg).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.DateTimePicker){(new rC).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.Combobox){(new Qw).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.CheckBox){(new _w).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.Image){(new ww).SetView(t.FEmrView,e)}};var z=this.FContextMenu.addItem("RectItem属性");z.onClick=function(){(new Gg).SetView(t.FEmrView)};var j=this.FContextMenu.addItem("浮动对象属性");j.onClick=function(){};var Y=this.FContextMenu.addItem("运行时禁止编辑");Y.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();if(e.SelectExists()){for(var i=e.SelectInfo.StartItemNo;i<=e.SelectInfo.EndItemNo;i++)if(e.Items[i].StyleNo=0){var e=this.FEmrView.Style.TextStyles[t];this.cbbFont.itemIndex=this.cbbFont.items.indexOf(e.Family),this.cbbFontSize.itemIndex=this.cbbFontSize.items.indexOf(mt.fontPtToSize(e.Size)),this.cbbFontColor.color=e.Color,this.btnBold.checked=e.FontStyles.has(ht.Bold),this.btnItalic.checked=e.FontStyles.has(ht.Italic),this.btnUnderline.checked=e.FontStyles.has(ht.Underline),this.btnStrikeOut.checked=e.FontStyles.has(ht.StrikeOut),this.btnSuperscript.checked=e.FontStyles.has(ht.SuperScript),this.btnSubscript.checked=e.FontStyles.has(ht.SubScript)}else this.btnBold.checked=!1,this.btnItalic.checked=!1,this.btnUnderline.checked=!1,this.btnStrikeOut.checked=!1,this.btnSuperscript.checked=!1,this.btnSubscript.checked=!1}},{key:"CurParaStyleChange",value:function(t){if(t>=0){var e=this.FEmrView.Style.ParaStyles[t].AlignHorz;this.btnAlignLeft.checked=e==dr,this.btnAlignRight.checked=e==yr,this.btnAlignCenter.checked=e==mr,this.btnAlignJustify.checked=e==pr,this.btnAlignScatter.checked=e==Sr}}},{key:"DoTablePropertyClick",value:function(){(new jw).SetView(this.FEmrView)}},{key:"PopupFormClose",value:function(){null!=this.frmRecordPop&&this.frmRecordPop.visible?this.frmRecordPop.visible=!1:null!=this.OnPopupFormClose&&this.OnPopupFormClose()}},{key:"DoDeItemPopup",value:function(t){return null==this.OnDeItemPopup||this.OnDeItemPopup(t)}},{key:"PopupDeCombobox",value:function(){}},{key:"DoSectionDrawItemMouseMove",value:function(t,e,i,n){if(this.FMouseInElementFire=!1,!(t.Items[e].StyleNoa/3&&n.x1){var l=U.CreateByRect(t.DrawItems[i].rect);l.offset(-l.left,-l.top),this.FEmrView.Style.TextStyles[t.Items[e].StyleNo].ApplyStyle(this.FEmrView.Style.TempCanvas);var h=this.FEmrView.Style.TempCanvas.textWidth(o[0]),c=this.FEmrView.Style.TempCanvas.textWidth(o.charAt(r-1));n.x>h/2&&n.xcs.Null&&t.Items[e].IsElement&&this.DoDeItemAutoComplate(t,e)}}},{key:"NextDeItemAutoComplate",value:function(){var t=this.FEmrView.ActiveSectionTopLevelData();if(t.CanEdit()){for(var e=t.GetActiveItemNo()+1;ecs.Null&&t.Items[e].IsElement)return void this.DoDeItemAutoComplate(t,e);this.PopupFormClose()}}},{key:"PrevDeItemAutoComplate",value:function(){var t=this.FEmrView.ActiveSectionTopLevelData();if(t.CanEdit()){for(var e=t.GetActiveItemNo()-1;e>=0;e--)if(t.Items[e].StyleNo>cs.Null&&t.Items[e].IsElement)return void this.DoDeItemAutoComplate(t,e);this.PopupFormClose()}}},{key:"DoInsertItem",value:function(t,e,i){var n=this;i.isClass(WS)&&(i.OnPopupItem=function(t){return n.DoDeComboboxPopupItem(t)}),null!=this.OnInsertDeItem&&this.OnInsertDeItem(t,e,i)}},{key:"DoSave",value:function(){null!=this.OnSave&&this.OnSave(this)}},{key:"DoImportXML",value:function(){null!=this.OnImportXML&&this.OnImportXML(this.FEmrView)}},{key:"DoImportTXT",value:function(){null!=this.OnImportTXT&&this.OnImportTXT(this.FEmrView)}},{key:"DoExportXML",value:function(){null!=this.OnExportXML&&this.OnExportXML(this.FEmrView)}},{key:"DoExportTXT",value:function(){null!=this.OnExportTXT&&this.OnExportTXT(this.FEmrView)}},{key:"DoExportHTML",value:function(){null!=this.OnExportHTML&&this.OnExportHTML(this.FEmrView)}},{key:"DoExportPDF",value:function(){null!=this.OnExportPDF&&this.OnExportPDF(this.FEmrView)}},{key:"DoPrint",value:function(t){null!=this.OnPrint&&this.OnPrint(t)}},{key:"DoPrintCurPage",value:function(t){null!=this.OnPrintCurPage&&this.OnPrintCurPage(t)}},{key:"DoPrintPageRange",value:function(t){null!=this.OnPrintPageRange&&this.OnPrintPageRange(t)}},{key:"DoPrintOdd",value:function(t,e){null!=this.OnPrintOdd&&this.OnPrintOdd(t,e)}},{key:"DoPrintEven",value:function(t,e){null!=this.OnPrintEven&&this.OnPrintEven(t,e)}},{key:"DoPrintCurLine",value:function(t,e){null!=this.OnPrintCurLine&&this.OnPrintCurLine(t,e)}},{key:"DoPrintSelect",value:function(t){null!=this.OnPrintSelect&&this.OnPrintSelect(t)}},{key:"DoSaveStructure",value:function(){null!=this.OnSaveStructure&&this.OnSaveStructure(this)}},{key:"PrintView",value:function(t,e){var i=this,n=new Pg;n.OnPrint=function(t){i.DoPrint(t)},n.OnPrintCurPage=function(t){i.DoPrintCurPage(t)},n.OnPrintOdd=function(t){i.DoPrintOdd(t,!1)},n.OnPrintEven=function(t){i.DoPrintEven(t,!1)},n.OnPrintCurLine=function(t,e){i.DoPrintCurLine(t,e)},n.OnPrintSelect=function(t){i.DoPrintSelect(t)},n.SetView(this.FEmrView,t,e)}},{key:"InsertDeItem",value:function(t,e,i){if(""==t||""==e)return or.showMessage("要插入的数据元索引和名称不能为空!"),null;var n=this.FEmrView.NewDeItem(e);return n.SetValue(aS,t),n.SetValue(hS,e),i.Text&&""!=i.Text.toString()&&(n.Text=i.Text.toString(),n.AllocValue=!0),i.Code&&n.SetValue(lS,i.Code),null!=i.AllocValue&&(!0===i.AllocValue||"1"===i.AllocValue?n.AllocValue=!0:n.AllocValue=!1),null!=i.AllocOnly&&(n.AllocOnly=i.AllocOnly),i.Frmtp&&n.SetValue(cS,i.Frmtp),i.Unit&&n.SetValue(uS,i.Unit),i.ItemMutex&&n.SetValue(xS,i.ItemMutex),i.MutexYes&&n.SetValue(AS,i.MutexYes),i.MutexNo&&n.SetValue(TS,i.MutexNo),i.CMV&&n.SetValue(dS,i.CMV),i.CMVVCode&&n.SetValue(mS,i.CMVVCode),null!=i.DeleteAllow&&(n.DeleteAllow=i.DeleteAllow),i.EditProtect&&(n.EditProtect=i.EditProtect),i.CopyProtect&&(n.CopyProtect=i.CopyProtect),i.OutOfRang&&(n.OutOfRang=i.OutOfRang),i.ItemEditValue&&n.SetValue(wS,i.ItemEditValue),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertDeItem(n),n}},{key:"InsertHyperLink",value:function(t){if(!t.Text||""==t.Text)return null;if(!t.HyperLink||""==t.HyperLink)return null;var e=this.FEmrView.ActiveSectionTopLevelData().CreateDefaultTextItem();return e.Text=t.Text,e.HyperLink=t.HyperLink,this.FEmrView.InsertItem(e),e}},{key:"InsertDeGroup",value:function(t,e,i){if(""!=t&&""!=e){var n=new wv(this.FEmrView.ActiveSectionTopLevelData());n.SetValue(aS,t),n.SetValue(hS,e),i.ReadOnly&&(n.ReadOnly=i.ReadOnly),i.Code&&n.SetValue(lS,i.Code),i.Frmtp&&n.SetValue(cS,i.Frmtp),i.CMV&&(i.Frmtp||n.SetValue(cS,CS),n.SetValue(dS,i.CMV)),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertDeGroup(n)}else or.showMessage("要插入的数据组索引和名称不能为空!")}},{key:"InsertDeEdit",value:function(t,e,i){if(""==t)return or.showMessage("要插入的Edit索引不能为空!"),null;var n="";i.Text?n=i.Text:e&&(n=e);var o=new VS(this.FEmrView.ActiveSectionTopLevelData(),n);return o.SetValue(aS,t),""!=e&&o.SetValue(hS,e),i.Code&&o.SetValue(lS,i.Code),i.DeleteAllow&&(o.DeleteAllow=i.DeleteAllow),i.EditProtect&&(o.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,o):lp.SetItemPropertyString(i.Propertys,o)),this.FEmrView.InsertItem(o),o}},{key:"InsertDeCombobox",value:function(t,e,i){var n=e;if(i.Text&&(n=i.Text),""==t)return or.showMessage("要插入的Combobox索引和名称不能为空!"),null;var o=new WS(this.FEmrView.ActiveSectionTopLevelData(),n);if(o.SetValue(aS,t),""!=e&&o.SetValue(hS,e),i.SaveItem?o.SaveItem=i.SaveItem:o.SaveItem=!1,i.Items)for(var r=0;r=0?(o=o.replace(/%/,""),(s=or.system.parseIntDef(o,-1))>0&&(s=Math.trunc(i.Width*s/100))):or.system.isNumber(e.ColWidths[l])&&(s=or.system.parseIntDef(e.ColWidths[l],-1)),s>0&&(n.FColWidths[r]=s,a=a-s-n.FBorderWidthPix),r++;for(a=Math.trunc(a/(e.ColCount-r))-n.FBorderWidthPix;r1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!=t){var n=e;if(null==n){var o=new Set([]);o.add(dp.Header),o.add(dp.Footer),o.add(dp.Page)}else if(0==n.size)return;var r=new $l;r.Tag=i,r.Areas=n,r.Process=t,this.FEmrView.TraverseItem(r)}}},{key:"SaveToImage",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"PNG";this.FEmrView.SaveToImage(t,e,i)}},{key:"ShowDocTree",value:function(){(new fC).SetView(this.FEmrView)}},{key:"Print",value:function(){this.DoPrint(this.FEmrView)}},{key:"PrintCurPage",value:function(){this.DoPrintCurPage(this.FEmrView)}},{key:"EmrView",get:function(){return this.FEmrView}},{key:"OnCopyRequest",get:function(){return this.FEmrView.OnCopyRequest},set:function(t){this.FEmrView.OnCopyRequest=t}},{key:"OnPasteRequest",get:function(){return this.FEmrView.OnPasteRequest},set:function(t){this.FEmrView.OnPasteRequest=t}},{key:"OnCopyAsStream",get:function(){return this.FEmrView.OnCopyAsStream},set:function(t){this.FEmrView.OnCopyAsStream=t}},{key:"OnPasteFromStream",get:function(){return this.FEmrView.OnPasteFromStream},set:function(t){this.FEmrView.OnPasteFromStream=t}},{key:"PrintToolVisible",get:function(){return this.tlbPrint.visible},set:function(t){this.SetPrintToolVisible(t)}},{key:"OnSyntaxCheck",get:function(){return this.FEmrView.OnSyntaxCheck},set:function(t){this.FEmrView.OnSyntaxCheck=t}},{key:"OnSyntaxPaint",get:function(){return this.FEmrView.OnSyntaxPaint},set:function(t){this.FEmrView.OnSyntaxPaint=t}},{key:"ToolbarVisible",get:function(){return this.captionBar.visible},set:function(t){this.captionBar.visible=t}},{key:"HideTrace",get:function(){return this.FEmrView.HideTrace},set:function(t){this.SetHideTrace(t)}},{key:"ShowExportMenu",get:function(){return this.menuExportFile.visible},set:function(t){this.menuExportFile.visible=t}},{key:"ShowImportMenu",get:function(){return this.menuImplortFile.visible},set:function(t){this.menuImplortFile.visible=t}},{key:"MultItemSpliter",get:function(){return ev.MultItemSpliter},set:function(t){ev.MultItemSpliter=t}},{key:"DeMutexCheckState",get:function(){return this.RecordPop().chkItemMutex.useCheckState},set:function(t){this.RecordPop().chkItemMutex.useCheckState=t}},{key:"OnPopupGetDeItemInfoLib",get:function(){return this.RecordPop().OnPopupGetDeItemInfoLib},set:function(t){this.RecordPop().OnPopupGetDeItemInfoLib=t}},{key:"OnPopupGetDeItemDomainLib",get:function(){return this.RecordPop().OnPopupGetDeItemDomainLib},set:function(t){this.RecordPop().OnPopupGetDeItemDomainLib=t}},{key:"OnPopupGetDomainItemExtraLib",get:function(){return this.RecordPop().OnPopupGetDomainItemExtraLib},set:function(t){this.RecordPop().OnPopupGetDomainItemExtraLib=t}},{key:"OnItemPopupSetCloseLib",get:function(){return this.RecordPop().OnItemPopupSetCloseLib},set:function(t){this.RecordPop().OnItemPopupSetCloseLib=t}}]),i}(ro);function CC(t){return(CC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PC(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:250,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;kC(this,i),(t=e.call(this,n,o)).caption="指定页码";var r=new en("单页以英文逗号“,”分隔如:1,4,6,8");r.left=10,r.top=10;var s=new en("连续页以英文“-”分隔如:2-5");s.left=r.left,s.top=r.bottom+5;var a=new en("以上可同时使用如:1,3,5-7,9");a.left=r.left,a.top=s.bottom+5,t.edtPages=new TC(""),t.edtPages.imeMode=Ei,t.edtPages.left=a.left,t.edtPages.top=a.bottom+3,t.edtPages.width=225;var l=new nn("打印");l.left=Math.trunc((t.width-l.width)/2),l.top=t.edtPages.bottom+10,l.onClick=function(){t.modalResult=no,t.close()},t.beginUpdate();try{t.addControl(r),t.addControl(s),t.addControl(a),t.addControl(t.edtPages),t.addControl(l)}finally{t.endUpdate()}return t}return i}(ro);function NC(t){return(NC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function BC(t,e){for(var i=0;i56?i.getTextMetrics(n.Family,n.Size,n.FontStyles.value):console.log("无效的字体:"+n.Family))},this.FFrmRecord.EmrView.Style.FTextStyles.onAdded=function(t){or.meaChr&&null==or.localStorage.hcf[mt.getMeasureName(t.Family,t.Size,t.FontStyles.value)]&&i.getMeasure(t.Family,t.Size,t.FontStyles.value)},e.designMode&&(this.FFrmRecord.EmrView.DesignModeEx=e.designMode),e.deUnDoneColor&&(this.FFrmRecord.EmrView.DeUnDoneColor=e.deUnDoneColor),e.deDoneColor&&(this.FFrmRecord.EmrView.DeDoneColor=e.deDoneColor),e.deHotColor&&(this.FFrmRecord.EmrView.DeHotColor=e.deHotColor),e.defaultFontSize){this.FFrmRecord.EmrView.Style.DefaultTextStyle.Size=mt.fontSizeToPt(e.defaultFontSize);var r=this.FFrmRecord.cbbFontSize.itemIndexOf(e.defaultFontSize);r>=0&&(this.FFrmRecord.cbbFontSize.itemIndex=r)}if(e.defaultFontFamily){this.FFrmRecord.EmrView.Style.DefaultTextStyle.Family=e.defaultFontFamily;var s=this.FFrmRecord.cbbFont.itemIndexOf(e.defaultFontFamily);s>=0&&(this.FFrmRecord.cbbFont.itemIndex=s)}if(null!=e.paraLastMark&&(this.FFrmRecord.EmrView.Style.ShowParaLastMark=e.paraLastMark),e.multItemSpliter&&(this.FFrmRecord.MultItemSpliter=e.multItemSpliter),e.paperInfo)this.SetActiveSectionPaperInfo(e.paperInfo,!1);else{if(e.paperSize){var a=lp.GetPaperSizeByName(e.paperSize),l=lp.GetPaperSizeInfo(a);this.FFrmRecord.EmrView.ActiveSection.PaperSize=a,this.FFrmRecord.EmrView.ActiveSection.PaperOrientation==hp?(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=l.Width,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=l.Height):(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=l.Height,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=l.Width)}if(e.paperOrientation&&this.FFrmRecord.EmrView.ActiveSection.PaperOrientation!=e.paperOrientation){this.FFrmRecord.EmrView.ActiveSection.PaperOrientation=e.paperOrientation;var h=this.FFrmRecord.EmrView.ActiveSection.PaperWidth;this.FFrmRecord.EmrView.ActiveSection.PaperWidth=this.FFrmRecord.EmrView.ActiveSection.PaperHeight,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=h}}(null!=e.useAnnotate&&(this.FFrmRecord.UseAnnotate=e.useAnnotate),null!=e.unAllocWarning&&(this.FFrmRecord.EmrView.UnAllocWarning=e.unAllocWarning),null!=e.showExportMenu&&(this.FFrmRecord.ShowExportMenu=e.showExportMenu),null!=e.showImportMenu&&(this.FFrmRecord.ShowImportMenu=e.showImportMenu),this.FFrmRecord.EmrView.ResetActiveSectionMargin(),null!=e.traceInfoAnnotate&&(this.FFrmRecord.EmrView.TraceInfoAnnotate=e.traceInfoAnnotate),null!=e.deMutexCheckState&&(this.FFrmRecord.DeMutexCheckState=e.deMutexCheckState),null!=e.domainPopupGridItemColWidth&&(or.emrCommon.domainPopupGridItemColWidth=e.domainPopupGridItemColWidth),e.toolBar)&&(or.debugLog("初始化传递的工具栏控制!"+JSON.stringify(e.toolBar)),e.toolBar.height&&(this.FFrmRecord.captionBar.height=e.toolBar.height),null==e.toolBar.visible||e.toolBar.visible||(this.FFrmRecord.captionBar.visible=!1),e.toolBar.btnFile&&(null==(n=e.toolBar.btnFile).visible||n.visible||(this.FFrmRecord.btnFile.visible=!1),e.toolBar.btnFile.menu&&(n=e.toolBar.btnFile.menu,this.doSetToolMenu(this.FFrmRecord.btnFile.dropDownMenu,n))),e.toolBar.btnSave&&(null==(n=e.toolBar.btnSave).visible||n.visible||(this.FFrmRecord.btnSave.visible=!1)),e.toolBar.btnPrint&&(null==(n=e.toolBar.btnPrint).visible||n.visible||(this.FFrmRecord.btnPrint.visible=!1)),e.toolBar.btnInsert&&(null==(n=e.toolBar.btnInsert).visible||n.visible||(this.FFrmRecord.btnInsert.visible=!1),e.toolBar.btnInsert.menu&&(n=e.toolBar.btnInsert.menu,this.doSetToolMenu(this.FFrmRecord.btnInsert.dropDownMenu,n))),null!=e.toolBar.btnFormatBrush&&(this.FFrmRecord.btnFormatBrush.visible=e.toolBar.btnFormatBrush),e.toolBar.btnCustoms&&this.AddToolButton(e.toolBar.btnCustoms));e.event&&(or.debugLog("初始化传递的事件控制!"+JSON.stringify(e.event)),e.event.onCaretItemChanged&&(this.OnCaretItemChanged=e.event.onCaretItemChanged),e.event.onDomainSwitch&&(this.OnDomainSwitch=e.event.onDomainSwitch),e.event.onChangedSwitch&&(this.OnChangedSwitch=e.event.onChangedSwitch),e.event.onSave&&(this.OnSave=e.event.onSave),e.event.onExternalDeItemPopup&&(this.OnExternalDeItemPopup=e.event.onExternalDeItemPopup),e.event.onPopupGetDeItemInfo&&(this.OnPopupGetDeItemInfo=e.event.onPopupGetDeItemInfo),e.event.onPopupGetDeItemDomain&&(this.OnPopupGetDeItemDomain=e.event.onPopupGetDeItemDomain),e.event.onPopupGetDomainItemExtraLib&&(this.OnPopupGetDomainItemExtraLib=e.event.onPopupGetDomainItemExtraLib),e.event.onItemPopupSetClose&&(this.OnItemPopupSetClose=e.event.onItemPopupSetClose),e.event.onSectionInsertItem&&(this.OnSectionInsertItem=e.event.onSectionInsertItem),e.event.onInserItemSync&&(this.OnInserItemSync=e.event.onInserItemSync),e.event.onDeComboboxPopup&&(this.OnDeComboboxPopup=e.event.onDeComboboxPopup),e.event.onCanEdit&&(this.OnCanEdit=e.event.onCanEdit),e.event.onDeItemPopup&&(this.OnDeItemPopup=e.event.onDeItemPopup),e.event.onDeItemGetSyncValue&&(this.OnDeItemGetSyncValue=e.event.onDeItemGetSyncValue),e.event.onDrawTrace&&(this.OnDrawTrace=e.event.onDrawTrace),e.event.onEmrViewKeyDown&&(this.OnEmrViewKeyDown=e.event.onEmrViewKeyDown),e.event.onKeyDown&&(this.OnKeyDonw=e.event.onKeyDown),e.event.onPrintProcess&&(this.OnPrintProcess=e.event.onPrintProcess),e.event.onPrinted&&(this.OnPrinted=e.event.onPrinted),e.event.onMouseUp&&(this.OnMouseUp=e.event.onMouseUp),e.event.onPopupFormClose&&(this.OnPopupFormClose=e.event.onPopupFormClose),e.event.onChange&&(this.OnChange=e.event.onChange),e.event.onDblClick&&(this.OnDblClick=e.event.onDblClick),e.event.onViewMenuPopup&&(this.OnViewMenuPopup=e.event.onViewMenuPopup),e.event.onSetDeItemText&&(this.OnSetDeItemText=e.event.onSetDeItemText),e.event.onSaveItem&&(this.OnSaveItem=e.event.onSaveItem),e.event.onCopyAfter&&(this.OnCopyAfter=e.event.onCopyAfter),e.event.onCutAfter&&(this.OnCutAfter=e.event.onCutAfter),e.event.onPasteBefor&&(this.OnPasteBefor=e.event.onPasteBefor),e.event.onSyntaxCheck&&(this.OnSyntaxCheck=e.event.onSyntaxCheck),e.event.onSyntaxPaint&&(this.onSyntaxPaint=e.event.onSyntaxPaint)),e.contextMenu&&(or.debugLog("初始化传递的自定义右键菜单!"+JSON.stringify(e.contextMenu)),this.FFrmRecord.FContextMenu.addSpliter(),this.AddContextMenu(e.contextMenu)),or.application.addForm(this.FFrmRecord),or.application.run(),or.autoWidth=!0,at.colorToRGBA("black"),e.event&&e.event.onInitialization&&e.event.onInitialization()}var e,i,n;return e=t,(i=[{key:"useMeaChar",value:function(){var t=navigator.userAgent;if("Win32"==navigator.platform||"Windows"==navigator.platform){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return!1;if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return!1;if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return!1;if((t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)&&(this.osVer="WinVista"),t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return!1}return!0}},{key:"getMeasure",value:function(t,e,i){var n=mt.getMeasureName(t,e,i);null==or.localStorage.hcf[n]&&Ni.get(this.FHCServer,{CMD:"1070",name:t,size:e,style:i},(function(t){var e=JSON.parse(t);or.localStorage.hcf[n]=e.arr,or.localStorage.setString("hcf",JSON.stringify(or.localStorage.hcf))}),!1)}},{key:"getTextMetrics",value:function(t,e,i){or.textMetricsIndexOf(t,e,i)>=0||Ni.get(this.FHCServer,{CMD:"1071",name:t,size:e,styles:i},(function(n){var o=JSON.parse(n),r={name:t,size:e,styles:i,trueType:o.trueType,CJK:o.CJK,advCharWidth:o.advCharWidth,height:o.height,ascent:o.ascent};or.textMetrics.add(r)}),!1)}},{key:"doSetToolMenu",value:function(t,e){for(var i=null,n=0;n0){var n=new Uint8Array(e.data),o=new Blob([n],{type:I.PDF}),r=URL.createObjectURL(o),s=document.createElement("a");document.body.appendChild(s),s.href=r,s.download="HCView H5.pdf",s.click(),window.URL.revokeObjectURL(o),document.body.removeChild(s)}else console.log("警告,服务端生成的PDF文件大小为0!")}))}));else console.log("打印失败,未设置HC服务端地址!")}},{key:"doPrintExecute",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){var d=this,m=arguments.length>13&&void 0!==arguments[13]?arguments[13]:"";if(this.FHCServer)var y=or.waitMessage("正在打印...",(function(){var p=new K;t.PrintSave=!0;try{t.SaveToStream(p,!1)}finally{t.PrintSave=!1}var S=new Uint8Array(p.buffer);Ni.post(d.FHCServer,{CMD:"1068",data:S,first:e,last:i,isodd:n,header:o,footer:r,leftb:s,topb:a,hb:l,lefte:h,tope:c,he:u,pages:m,phuav:t.PrintHideUnAllocValue,revord:f,rbwm:d.RBWatermarking},(function(t){var e=JSON.parse(t);if(e.err)or.endWaitMessage(y),alert(e.err);else if(e.data.length>0){e.fontlose&&alert("生成打印PDF文件时服务器系统中缺少以下字体:"+e.fontlose);var i=document.getElementById("hclPrintFrame");null!=i&&(or.parentElement.removeChild(i),i=null),(i=document.createElement("iframe")).id="hclPrintFrame",i.style.display="none",or.parentElement.appendChild(i),i.onload=function(){i.contentWindow.print(),URL.revokeObjectURL(i.src),or.endWaitMessage(y),null!=d.OnPrinted&&(u&&u>0?d.OnPrinted(2):a&&a>0?d.OnPrinted(1):d.OnPrinted(0))};var n=new Uint8Array(e.data),o=new Blob([n],{type:I.PDF});i.src=URL.createObjectURL(o)}else or.endWaitMessage(y),console.log("警告,服务端生成的打印文件大小为0!")}))}));else console.log("打印失败,未设置HC服务端地址!")}},{key:"doPrint",value:function(t){this.doPrintExecute(t,-1,-1,0,1,1,-1,-1,-1,-1,-1,-1,0)}},{key:"doPrintCurPage",value:function(t){var e=t.GetActivePageIndex();this.doPrintExecute(t,e+1,e+1,0,1,1,-1,-1,-1,-1,-1,-1,0)}},{key:"doPrintPageRange",value:function(t){var e=this,i=new OC;i.moveCenter(),i.showModal((function(){e.doPrintExecute(t,-1,-1,3,1,1,-1,-1,-1,-1,-1,-1,0,i.edtPages.text)}))}},{key:"doPrintOdd",value:function(t,e){this.doPrintExecute(t,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,e?1:0)}},{key:"doPrintEvent",value:function(t,e){this.doPrintExecute(t,-1,-1,2,1,1,-1,-1,-1,-1,-1,-1,e?1:0)}},{key:"doPrintCurLine",value:function(t,e){var i=t.GetActivePageIndex(),n=t.ActiveSection.GetTopLevelDrawItemCoord();n.y=n.y-t.ActiveSection.GetPageDataFmtTop(i);var o=i+1,r=0,s=0;e&&(o=e,r=1,s=1),this.doPrintExecute(t,i+1,o,0,r,s,0,n.y,-1,-1,-1,-1,0)}},{key:"doPrintSelect",value:function(t){if(t.ActiveSection.ActiveData.SelectExists(!1)){var e=t.GetActivePageIndex(),i=t.ActiveSection.GetPageMarginLeftAndRight(e),n=t.ActiveSection.ActiveData,o=n.GetDrawItemNoByOffset(n.SelectInfo.StartItemNo,n.SelectInfo.StartItemOffset),r=n.DrawItems[o].rect.leftTop;r.x=i.left+r.x+n.GetDrawItemOffsetWidth(o,n.SelectInfo.StartItemOffset-n.DrawItems[o].CharOffs+1),r.y=r.y-t.ActiveSection.GetPageDataFmtTop(e);var s=n.GetDrawItemNoByOffset(n.SelectInfo.EndItemNo,n.SelectInfo.EndItemOffset),a=n.DrawItems[s].rect.leftTop;a.x=i.left+a.x+n.GetDrawItemOffsetWidth(s,n.SelectInfo.EndItemOffset-n.DrawItems[s].CharOffs+1),a.y=a.y-t.ActiveSection.GetPageDataFmtTop(e),this.doPrintExecute(t,e+1,e+1,0,0,0,r.x,r.y,n.DrawItems[o].rect.height,a.x,a.y,n.DrawItems[s].rect.height,0)}else console.log("打印选中内容时,未发现正文有选中内容!")}},{key:"Dispose",value:function(){nr.disposeInstance()}},{key:"AddToolButton",value:function(t){for(var e,i=this,n=function(n){if(t[n].menu){e=new an(t[n].text),null!=t[n].textVisible&&(e.textVisible=t[n].textVisible);var o=new _n;o.dropDownStyle=!0,i.AddContextMenu(t[n].menu,o),e.dropDownMenu=o,i.FFrmRecord.captionBar.addControl(e)}else e=i.FFrmRecord.captionBar.addButton(t[n].text),null!=t[n].textVisible&&(e.textVisible=t[n].textVisible),e.onClick=function(){t[n].exec()};t[n].image&&(e.image.src=t[n].image)},o=0;o5&&void 0!==arguments[5]?arguments[5]:0;this.Print(t,e,i,n,o,r)}},{key:"Print",value:function(t,e,i,n,o,r){this.doPrintExecute(this.FFrmRecord.EmrView,t,e,i,n,o,-1,-1,-1,-1,-1,-1,r)}},{key:"PrintView",value:function(){this.FFrmRecord.PrintView()}},{key:"applyParaAlignHorz",value:function(t){this.ApplyParaAlignHorz(t)}},{key:"ApplyParaAlignHorz",value:function(t){this.FFrmRecord.EmrView.ApplyParaAlignHorz(t)}},{key:"applyTextStyle",value:function(t){this.ApplyTextStyle(t)}},{key:"ApplyTextStyle",value:function(t){this.FFrmRecord.EmrView.ApplyTextStyle(t)}},{key:"applyTextFontName",value:function(t){this.ApplyTextFontName(t)}},{key:"ApplyTextFontName",value:function(t){this.FFrmRecord.EmrView.ApplyTextFontName(t)}},{key:"applyTextFontSize",value:function(t){this.ApplyTextFontSize(t)}},{key:"ApplyTextFontSize",value:function(t){"string"==typeof t?this.FFrmRecord.EmrView.ApplyTextFontSize(mt.fontSizeToPt(t)):this.FFrmRecord.EmrView.ApplyTextFontSize(t)}},{key:"applyTextColor",value:function(t){this.ApplyTextColor(t)}},{key:"ApplyTextColor",value:function(t){this.FFrmRecord.EmrView.ApplyTextColor(t)}},{key:"applyTextBackColor",value:function(t){this.ApplyTextBackColor(t)}},{key:"ApplyTextBackColor",value:function(t){this.FFrmRecord.EmrView.ApplyTextBackColor(t)}},{key:"beginUpdate",value:function(){this.BeginUpdate()}},{key:"BeginUpdate",value:function(){this.FFrmRecord.EmrView.BeginUpdate()}},{key:"endUpdate",value:function(){this.EndUpdate()}},{key:"EndUpdate",value:function(){this.FFrmRecord.EmrView.EndUpdate()}},{key:"NextDeItemAutoComplate",value:function(){this.FFrmRecord.NextDeItemAutoComplate()}},{key:"PrevDeItemAutoComplate",value:function(){this.FFrmRecord.PrevDeItemAutoComplate()}},{key:"loadHeaderFromBytes",value:function(t,e){this.LoadHeaderFromBytes(t,e)}},{key:"LoadHeaderFromBytes",value:function(t,e){var i=new K;i.writeBuffer(t),i.position=0,this.LoadHeaderFromStream(i,e),i=null}},{key:"LoadHeaderFromStream",value:function(t,e){if(!this.FrmRecord.EmrView.LoadHeaderFromStream(t,e)){var i=new AI;i.LoadFromStream(t),t.clear(),i.Sections[0].Header.SaveToStream(t),t.position=0,this.FFrmRecord.EmrView.IgnoreAcceptAction=!0;try{this.FFrmRecord.EmrView.ActiveSection.Header.BeginFormat();try{this.FFrmRecord.EmrView.ActiveSection.Header.LoadFromStream(t,i.Style,lp.HC_FileVersionInt)}finally{this.FFrmRecord.EmrView.ActiveSection.Header.EndFormat(!1)}e?this.FFrmRecord.EmrView.ActiveSection.AssignPaper(i.Sections[0]):this.FFrmRecord.EmrView.ResetActiveSectionMargin()}finally{this.FFrmRecord.EmrView.IgnoreAcceptAction=!1}this.FFrmRecord.EmrView.IsChanged=!0,this.FFrmRecord.EmrView.UpdateView()}}},{key:"loadFooterFromBytes",value:function(t,e){this.LoadFooterFromBytes(t,e)}},{key:"LoadFooterFromBytes",value:function(t,e){var i=new K;i.writeBuffer(t),i.position=0,this.LoadFooterFromStream(i,e),i=null}},{key:"LoadFooterFromStream",value:function(t,e){if(!this.FrmRecord.EmrView.LoadFooterFromStream(t,e)){var i=new AI;i.LoadFromStream(t),t.clear(),i.Sections[0].Footer.SaveToStream(t),t.position=0,this.FFrmRecord.EmrView.IgnoreAcceptAction=!0;try{this.FFrmRecord.EmrView.ActiveSection.Footer.BeginFormat();try{this.FFrmRecord.EmrView.ActiveSection.Footer.LoadFromStream(t,i.Style,lp.HC_FileVersionInt)}finally{this.FFrmRecord.EmrView.ActiveSection.Footer.EndFormat(!1)}e?this.FFrmRecord.EmrView.ActiveSection.AssignPaper(i.Sections[0]):this.FFrmRecord.EmrView.ResetActiveSectionMargin()}finally{this.FFrmRecord.EmrView.IgnoreAcceptAction=!1}this.FFrmRecord.EmrView.IsChanged=!0,this.FFrmRecord.EmrView.UpdateView()}}},{key:"loadFromFile",value:function(t){this.LoadFromFile(t)}},{key:"LoadFromFile",value:function(t){this.FFrmRecord.PopupFormClose(),this.FFrmRecord.EmrView.LoadFromFile(t)}},{key:"LoadFromBytes",value:function(t){this.loadFromStream(t)}},{key:"loadFromStream",value:function(t){this.LoadFromStream(t)}},{key:"LoadFromStream",value:function(t){this.FFrmRecord.PopupFormClose();var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.LoadFromStream(e),e=null}},{key:"SaveToBytes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.SaveToStream(t,e)}},{key:"saveToStream",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.SaveToStream(t,e)}},{key:"SaveToStream",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=new K;return this.FFrmRecord.EmrView.SaveToStream(i,t,e),i.buffer}},{key:"InsertBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.InsertStream(e),e=null}},{key:"AppendBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.AppendStream(e),e=null}},{key:"SaveToLiteBytes",value:function(){var t=new K;return this.FFrmRecord.EmrView.SaveToLiteStream(t),t.buffer}},{key:"InsertLiteBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.InsertLiteStream(e),e=null}},{key:"saveToXml",value:function(){return this.SaveToXml()}},{key:"SaveToXml",value:function(){return this.FFrmRecord.EmrView.SaveToXml()}},{key:"saveToHtml",value:function(){return this.SaveToHtml()}},{key:"SaveToHtml",value:function(){return this.FFrmRecord.EmrView.SaveToHtml()}},{key:"SaveToText",value:function(){return this.FFrmRecord.EmrView.SaveToText()}},{key:"SaveSelectToText",value:function(){return this.FFrmRecord.EmrView.SaveSelectToText()}},{key:"SaveSelectToBytes",value:function(){var t=new K;return this.FFrmRecord.EmrView.SaveSelectToStream(t),t.buffer}},{key:"Resize",value:function(){or.resize()}},{key:"clear",value:function(){this.Clear()}},{key:"Clear",value:function(){this.FFrmRecord.EmrView.Clear()}},{key:"clearUndo",value:function(){this.ClearUndo()}},{key:"ClearUndo",value:function(){this.FFrmRecord.EmrView.ClearUndo()}},{key:"CanEdit",value:function(){return this.FFrmRecord.EmrView.CanEdit()}},{key:"UndoDisenable",value:function(){this.FFrmRecord.EmrView.FUndoList.Enable=!1}},{key:"UndoEnable",value:function(){this.FFrmRecord.EmrView.FUndoList.Enable=!0}},{key:"Search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.FFrmRecord.EmrView.Search(t,e,i)}},{key:"SyntaxCheck",value:function(){this.FFrmRecord.EmrView.SyntaxCheck()}},{key:"insertDeItem",value:function(t){return this.InsertDeItem(t)}},{key:"InsertDeItem",value:function(t){return this.FFrmRecord.InsertDeItem(t.Index,t.Name,t)}},{key:"InsertToothItem",value:function(t){var e=new Ev(this.FFrmRecord.EmrView.ActiveSectionTopLevelData(),t.LeftTop,t.RightTop,t.LeftBottom,t.RightBottom);this.FFrmRecord.EmrView.InsertItem(e)}},{key:"InsertHyperLink",value:function(t){return this.FFrmRecord.InsertHyperLink(t)}},{key:"getDeItemText",value:function(t){return this.GetDeItemText(t)}},{key:"GetDeItemText",value:function(t){return this.FFrmRecord.EmrView.GetDeItemText(t)}},{key:"getDeItemProperty",value:function(t,e,i){return this.GetDeItemProperty(t,e,i)}},{key:"GetDeItemProperty",value:function(t,e,i){return this.FFrmRecord.EmrView.GetDeItemProperty(t,e,i)}},{key:"SetDeItemText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.FFrmRecord.EmrView.SetDeItemText(t,e,i)}},{key:"SetDeItemProperty",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.FFrmRecord.EmrView.SetDeObjectProperty(t,e,i,n)}},{key:"insertProc",value:function(t,e,i){return this.InsertProc(t,e,i)}},{key:"InsertProc",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.FFrmRecord.EmrView.InsertProc(t,e,i,n)}},{key:"DeleteProc",value:function(t){this.FFrmRecord.EmrView.DeleteProc(t)}},{key:"ScrollToProc",value:function(t){return this.FFrmRecord.EmrView.ScrollToProc(t)}},{key:"GetCaretProcProperty",value:function(t,e){return this.FFrmRecord.EmrView.GetCaretProcProperty(t,e)}},{key:"GetCaretDeGroupProperty",value:function(t,e){return this.FFrmRecord.EmrView.GetCaretDeGroupProperty(t,e)}},{key:"getProcProperty",value:function(t,e,i){return this.GetProcProperty(t,e,i)}},{key:"GetProcProperty",value:function(t,e,i){return this.FFrmRecord.EmrView.GetProcProperty(t,e,i)}},{key:"SetProcProperty",value:function(t,e,i){this.FFrmRecord.EmrView.SetProcProperty(t,e,i)}},{key:"setProcBytes",value:function(t,e){this.SetProcByFileSteam(t,e)}},{key:"SetProcBytes",value:function(t,e){this.SetProcByFileSteam(t,e)}},{key:"SetProcByFileSteam",value:function(t,e){var i=new K;i.writeBuffer(e),i.position=0,this.FFrmRecord.EmrView.SetProcByFileSteam(t,i),i=null}},{key:"getProcAsText",value:function(t){return this.GetProcAsText(t)}},{key:"GetProcAsText",value:function(t){var e=this.FFrmRecord.EmrView.GetProcAsText(t);return e.result?e.text:null}},{key:"getProcAsBytes",value:function(t){return this.GetProcAsBytes(t)}},{key:"GetProcAsBytes",value:function(t){var e=new K;return this.FFrmRecord.EmrView.GetProcAsStream(t,e)?e.buffer:[]}},{key:"SaveProcToBytes",value:function(t,e){var i=new AI,n=new K;return e&&(this.FFrmRecord.EmrView.ActiveSection.Header.SaveToStream(n),n.position=0,i.ActiveSection.Header.LoadFromStream(n,this.FFrmRecord.EmrView.Style,lp.HC_FileVersionInt),n.clear(),this.FFrmRecord.EmrView.ActiveSection.Footer.SaveToStream(n),n.position=0,i.ActiveSection.Footer.LoadFromStream(n,this.FFrmRecord.EmrView.Style,lp.HC_FileVersionInt)),i.ActiveSection.AssignPaper(this.FFrmRecord.EmrView.ActiveSection),n.clear(),this.FFrmRecord.EmrView.GetProcAsStream(t,n),n.position=0,i.InsertLiteStream(n),n.clear(),i.SaveToStream(n,!1),n.buffer}},{key:"SetProcByBytes",value:function(t,e){var i=new K;i.writeBuffer(e),i.position=0,this.FFrmRecord.EmrView.SetProcByStream(t,i),i=null}},{key:"SetProcByText",value:function(t,e){this.FFrmRecord.EmrView.SetProcByText(t,e)}},{key:"SetActiveItemExtraByBytes",value:function(t){this.SetPopupItemExtraByBytes(null,t)}},{key:"SetPopupItemExtraByBytes",value:function(t,e){var i=new K;i.writeBuffer(e),i.position=0,null==t||t.StyleNo>cs.Null?this.FFrmRecord.EmrView.SetActiveItemExtra(i):this.FFrmRecord.EmrView.InsertLiteStream(i),i=null}},{key:"SetActiveDeObjectProperty",value:function(t,e){this.FFrmRecord.EmrView.SetActiveDeObjectProperty(t,e)}},{key:"getProcAsHtml",value:function(t){return this.GetProcAsHtml(t)}},{key:"GetProcAsHtml",value:function(t){var e=this.FFrmRecord.EmrView.GetProcItemNo(t);if(e.result){var i=new j;return i.append(""),i.append(""),i.append(""),i.append(""),i.append(""),i.append(this.FFrmRecord.EmrView.Style.ToCSS()),i.append(""),i.append(""),i.append(this.FFrmRecord.EmrView.Sections[e.sectionIndex].Page.ToHtml(e.startNo,e.endNo)),i.append(""),i.append(""),i.text}return""}},{key:"insertDeGroup",value:function(t){this.InsertDeGroup(t)}},{key:"InsertDeGroup",value:function(t){this.FFrmRecord.InsertDeGroup(t.Index,t.Name,t)}},{key:"DeleteDeGroup",value:function(t){this.FFrmRecord.EmrView.DeleteDeGroup(t)}},{key:"setDeGroupText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.SetDeGroupByText(t,e,i)}},{key:"SetDeGroupText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.SetDeGroupByText(t,e,i)}},{key:"SetDeGroupByText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.FFrmRecord.EmrView.SetDeGroupByText(this.FFrmRecord.EmrView.ActiveSectionIndex,dp.Page,t,e,i)}},{key:"SetDeGroupProperty",value:function(t,e,i){this.SetDeGroupProperty(t,e,i)}},{key:"SetDeGroupProperty",value:function(t,e,i){this.FFrmRecord.EmrView.SetDeGroupProperty(t,e,i)}},{key:"getDeGroupText",value:function(t){return this.GetDeGroupAsText(t)}},{key:"GetDeGroupText",value:function(t){return this.GetDeGroupAsText(t)}},{key:"GetDeGroupAsText",value:function(t){return this.FFrmRecord.EmrView.GetDeGroupAsText(t)}},{key:"GetDeGroupAsBytes",value:function(t){var e=this.FFrmRecord.EmrView.GetDeGroupAsStream(t);return e?e.buffer:[]}},{key:"SetDeGroupByBytes",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=new K;n.writeBuffer(e),n.position=0,this.FFrmRecord.EmrView.SetActiveSectionDeGroupByStream(t,n,i),n=null}},{key:"SetProcDeGroupByText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.FFrmRecord.EmrView.SetProcDeGroupByText(t,e,i,n)}},{key:"SetProcDeGroupByBytes",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=new K;o.writeBuffer(i),o.position=0,this.FFrmRecord.EmrView.SetProcDeGroupByStream(t,e,o,n),o=null}},{key:"SetCaretDeGroupByText",value:function(t){this.FFrmRecord.EmrView.SetCaretDeGroupByText(t)}},{key:"SetCaretDeGroupByBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.SetCaretDeGroupByStream(e),e=null}},{key:"SetActiveDeItemDomain",value:function(t){this.FFrmRecord.SetActiveDeItemDomain(t)}},{key:"insertText",value:function(t,e){this.InsertText(t,e)}},{key:"InsertText",value:function(t,e){this.FFrmRecord.EmrView.InsertText(t)}},{key:"insertDeTable",value:function(t){return this.InsertDeTable(t)}},{key:"InsertDeTable",value:function(t){return this.FFrmRecord.InsertDeTable(t.Index,t)}},{key:"insertDeImage",value:function(t){return this.InsertDeImage(t)}},{key:"InsertDeImage",value:function(t){return this.FFrmRecord.InsertDeImage(t.Index,t.Name,t)}},{key:"setDeImage",value:function(t){this.SetDeImage(t)}},{key:"SetDeImage",value:function(t){this.FFrmRecord.EmrView.SetDeImage(t.Index,t)}},{key:"insertDeEdit",value:function(t){return this.InsertDeEdit(t)}},{key:"InsertDeEdit",value:function(t){return this.FFrmRecord.InsertDeEdit(t.Index,t.Name,t)}},{key:"insertDeCombobox",value:function(t){return this.InsertDeCombobox(t)}},{key:"InsertDeCombobox",value:function(t){return this.FFrmRecord.InsertDeCombobox(t.Index,t.Name,t)}},{key:"insertDeDateTime",value:function(t){return this.InsertDeDateTime(t)}},{key:"InsertDeDateTime",value:function(t){return this.FFrmRecord.InsertDeDateTime(t.Index,t.Name,t)}},{key:"insertDeRadioGroup",value:function(t){return this.InsertDeRadioGroup(t)}},{key:"InsertDeRadioGroup",value:function(t){return this.FFrmRecord.InsertDeRadioGroup(t.Index,t.Name,t)}},{key:"insertDeCheckBox",value:function(t){return this.InsertDeCheckBox(t)}},{key:"InsertDeCheckBox",value:function(t){return this.FFrmRecord.InsertDeCheckBox(t.Index,t.Name,t)}},{key:"insertDeFloatBarCode",value:function(t){return this.InsertDeFloatBarCode(t)}},{key:"InsertDeFloatBarCode",value:function(t){return this.FFrmRecord.InsertDeFloatBarCode(t.Index,t.Name,t)}},{key:"InsertDeFloatQRCode",value:function(t){return this.FFrmRecord.InsertDeFloatQRCode(t.Index,t.Name,t)}},{key:"InsertDeYueJingItem",value:function(t,e,i,n){this.FFrmRecord.InsertDeYueJingItem(t,e,i,n)}},{key:"InsertDeToothItem",value:function(t,e,i,n){this.FFrmRecord.InsertDeToothItem(t,e,i,n)}},{key:"InsertDeFangJiaoItem",value:function(t,e,i,n){this.FFrmRecord.InsertDeFangJiaoItem(t,e,i,n)}},{key:"InsertDeCnDrugItem",value:function(t,e){this.FFrmRecord.InsertDeCnDrugItem(t,e)}},{key:"GetActiveItem",value:function(){return this.FFrmRecord.EmrView.ActiveSectionTopLevelData().GetActiveItem()}},{key:"DeleteActiveItem",value:function(){var t=this.FFrmRecord.EmrView.ActiveSectionTopLevelData();this.FFrmRecord.EmrView.DeleteActiveDataItems(t.SelectInfo.StartItemNo)}},{key:"DeleteItem",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=this.FFrmRecord.EmrView.ActiveSection.Page,n=i.Items.count-1;n>=0&&(!(i.Items[n].StyleNo>cs.Null||i.Items[n].StyleNo==cs.Image)||i.Items[n].GetValue(aS)!=t||(i.Items.delete(n),2!=e));n--);this.FFrmRecord.EmrView.FormatData()}},{key:"ShowSearch",value:function(){this.FFrmRecord.EmrView.ShowSearchForm()}},{key:"traverseElement",value:function(t,e,i){this.TraverseElement(t,e,i)}},{key:"TraverseElement",value:function(t,e,i){this.FFrmRecord.TraverseElement(t,e,i)}},{key:"WaitMessage",value:function(t,e){return or.waitMessage(t,e)}},{key:"EndWaitMessage",value:function(t){or.endWaitMessage(t)}},{key:"CreateEmrViewLite",value:function(){return new AI}},{key:"SetActiveSectionPaperInfo",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.size)if("object"==NC(t.size))this.FFrmRecord.EmrView.ActiveSection.PaperWidth=t.size.width,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=t.size.height;else{var i=lp.GetPaperSizeByName(t.size),n=lp.GetPaperSizeInfo(i);this.FFrmRecord.EmrView.ActiveSection.PaperSize=i,this.FFrmRecord.EmrView.ActiveSection.PaperOrientation==hp?(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=n.Width,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=n.Height):(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=n.Height,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=n.Width)}if(t.margin&&(t.margin.left&&t.margin.left>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginLeft=t.margin.left),t.margin.top&&t.margin.top>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginTop=t.margin.top),t.margin.right&&t.margin.right>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginRight=t.margin.right),t.margin.bottom&&t.margin.bottom>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginBottom=t.margin.bottom)),t.orientation&&this.FFrmRecord.EmrView.ActiveSection.PaperOrientation!=t.orientation){this.FFrmRecord.EmrView.ActiveSection.PaperOrientation=t.orientation;var o=this.FFrmRecord.EmrView.ActiveSection.PaperWidth;this.FFrmRecord.EmrView.ActiveSection.PaperWidth=this.FFrmRecord.EmrView.ActiveSection.PaperHeight,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=o}e&&this.FrmRecord.EmrView.ResetActiveSectionMargin()}},{key:"ExportPDF",value:function(){this.doExportPDF(this.FFrmRecord.EmrView)}},{key:"ExportTXT",value:function(){this.doExportTXT(this.FFrmRecord.EmrView)}},{key:"ImportTXT",value:function(){this.doImportTXT(this.FFrmRecord.EmrView)}},{key:"ImportXML",value:function(){this.doImportXML(this.FFrmRecord.EmrView)}},{key:"ExportXML",value:function(){this.doExportXML(this.FFrmRecord.EmrView)}},{key:"ExportHTML",value:function(){this.doExportHTML(this.FFrmRecord.EmrView)}},{key:"toolBar",get:function(){return this.ToolBar}},{key:"ToolBar",get:function(){return this.FFrmRecord.captionBar}},{key:"isChanged",get:function(){return this.IsChanged},set:function(t){this.IsChanged=t}},{key:"IsChanged",get:function(){return this.FFrmRecord.EmrView.IsChanged},set:function(t){this.FFrmRecord.EmrView.IsChanged=t}},{key:"designMode",get:function(){return this.DesignMode},set:function(t){this.DesignMode=t}},{key:"DesignMode",get:function(){return this.FFrmRecord.EmrView.DesignModeEx},set:function(t){this.FFrmRecord.EmrView.DesignModeEx=t}},{key:"procCount",get:function(){return this.ProcCount}},{key:"ProcCount",get:function(){return this.FFrmRecord.EmrView.ProcCount}},{key:"editProcIndex",get:function(){return this.EditProcIndex},set:function(t){this.EditProcIndex=t}},{key:"EditProcIndex",get:function(){return this.FFrmRecord.EmrView.EditProcIndex},set:function(t){this.FFrmRecord.EmrView.EditProcIndex=t}},{key:"CaretProcInfo",get:function(){return this.FFrmRecord.EmrView.FCaretProcInfo}},{key:"showProcSplit",get:function(){return this.ShowProcSplit},set:function(t){this.ShowProcSplit=t}},{key:"ShowProcSplit",get:function(){return this.FFrmRecord.EmrView.ShowProcSplit},set:function(t){this.FFrmRecord.EmrView.ShowProcSplit=t}},{key:"readOnly",get:function(){return this.ReadOnly},set:function(t){this.ReadOnly=t}},{key:"ReadOnly",get:function(){return this.FFrmRecord.EmrView.ReadOnly},set:function(t){this.FFrmRecord.EmrView.ReadOnly=t}},{key:"trace",get:function(){return this.Trace},set:function(t){this.Trace=t}},{key:"Trace",get:function(){return this.FFrmRecord.EmrView.Trace},set:function(t){this.FFrmRecord.EmrView.Trace=t}},{key:"secret",get:function(){return this.Secret},set:function(t){this.Secret=t}},{key:"Secret",get:function(){return this.FFrmRecord.EmrView.Secret},set:function(t){this.FFrmRecord.EmrView.Secret=t}},{key:"hideTrace",get:function(){return this.HideTrace},set:function(t){this.HideTrace=t}},{key:"HideTrace",get:function(){return this.FFrmRecord.EmrView.HideTrace},set:function(t){this.FFrmRecord.EmrView.HideTrace=t}},{key:"TraceInfoAnnotate",get:function(){return this.FFrmRecord.EmrView.TraceInfoAnnotate},set:function(t){this.FFrmRecord.EmrView.TraceInfoAnnotate=t}},{key:"UnAllocWarning",get:function(){return this.FFrmRecord.EmrView.UnAllocWarning},set:function(t){this.FFrmRecord.EmrView.UnAllocWarning=t}},{key:"FrmRecord",get:function(){return this.FFrmRecord}},{key:"InnerView",get:function(){return this.FFrmRecord.EmrView}},{key:"HCL",get:function(){return or}},{key:"HC",get:function(){return lp}},{key:"HCServer",get:function(){return this.FHCServer},set:function(t){var e=this;this.FHCServer=t,Ni.post(this.FHCServer,{CMD:"1000"},(function(t){var i=JSON.parse(t);e.CopyRight=i.comp+" "+i.hosp}))}},{key:"CheckNullItem",get:function(){return lp.CHECKNULLITEM},set:function(t){lp.CHECKNULLITEM=t}},{key:"OnCaretItemChanged",get:function(){return this.FFrmRecord.EmrView.OnSectionCaretItemChanged},set:function(t){this.FFrmRecord.EmrView.OnSectionCaretItemChanged=null!=t?function(){t()}:null}},{key:"OnDomainSwitch",get:function(){return this.FrmRecord.EmrView.OnSectionDataDomainSwitch},set:function(t){this.FFrmRecord.EmrView.OnSectionDataDomainSwitch=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnChangedSwitch",get:function(){return this.FFrmRecord.OnChangedSwitch},set:function(t){this.FFrmRecord.OnChangedSwitch=null!=t?function(){t()}:null}},{key:"OnSave",get:function(){return this.FFrmRecord.OnSave},set:function(t){this.FFrmRecord.OnSave=null!=t?function(){t()}:null}},{key:"OnExternalDeItemPopup",get:function(){return this.FFrmRecord.OnExternalDeItemPopupLib},set:function(t){this.FFrmRecord.OnExternalDeItemPopupLib=null!=t?function(e,i,n){return t(e,i,n)}:null}},{key:"OnPopupGetDeItemInfo",get:function(){return this.FFrmRecord.OnPopupGetDeItemInfoLib},set:function(t){this.FFrmRecord.OnPopupGetDeItemInfoLib=null!=t?function(e){return t(e)}:null}},{key:"OnItemPopupSetClose",get:function(){return this.FFrmRecord.OnItemPopupSetCloseLib},set:function(t){this.FFrmRecord.OnItemPopupSetCloseLib=null!=t?function(e){return t(e)}:null}},{key:"OnPopupGetDeItemDomain",get:function(){return this.FFrmRecord.OnPopupGetDeItemDomainLib},set:function(t){this.FFrmRecord.OnPopupGetDeItemDomainLib=null!=t?function(e){return t(e)}:null}},{key:"OnPopupGetDomainItemExtraLib",get:function(){return this.FFrmRecord.OnPopupGetDomainItemExtraLib},set:function(t){this.FFrmRecord.OnPopupGetDomainItemExtraLib=t}},{key:"OnSetDeItemText",get:function(){return this.FFrmRecord.OnSetDeItemText},set:function(t){this.FFrmRecord.OnSetDeItemText=null!=t?function(e,i){return t(e,i)}:null}},{key:"OnSaveItem",get:function(){return this.FFrmRecord.EmrView.OnSaveItem},set:function(t){this.FFrmRecord.EmrView.OnSaveItem=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnCutAfter",get:function(){return this.FrmRecord.EmrView.OnCutAfter},set:function(t){this.FFrmRecord.EmrView.OnCutAfter=null!=t?function(){t()}:null}},{key:"OnCopyAfter",get:function(){return this.FrmRecord.EmrView.OnCopyAfter},set:function(t){this.FFrmRecord.EmrView.OnCopyAfter=null!=t?function(){t()}:null}},{key:"OnPasteBefor",get:function(){return this.FrmRecord.EmrView.OnPasteBefor},set:function(t){this.FFrmRecord.EmrView.OnPasteBefor=null!=t?function(){return t()}:null}},{key:"OnSectionInsertItem",get:function(){return this.FFrmRecord.OnInsertDeItem},set:function(t){this.FFrmRecord.OnInsertDeItem=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnInserItemSync",get:function(){return this.FFrmRecord.EmrView.OnSyncDeItem},set:function(t){null!=t?this.FFrmRecord.EmrView.OnSyncDeItem=function(e,i,n){t(e,i,n)}:this.FrmRecord.EmrView.OnSyncDeItem=null}},{key:"OnDeComboboxPopup",get:function(){return this.FFrmRecord.OnDeComboboxPopup},set:function(t){this.FFrmRecord.OnDeComboboxPopup=null!=t?function(e){return t(e)}:null}},{key:"OnCanEdit",get:function(){return this.FFrmRecord.EmrView.OnSectionCanEdit},set:function(t){this.FFrmRecord.EmrView.OnSectionCanEdit=null!=t?function(e){return t(e)}:null}},{key:"OnDeItemPopup",get:function(){return this.FFrmRecord.OnDeItemPopup},set:function(t){this.FrmRecord.OnDeItemPopup=null!=t?function(e){return t(e)}:null}},{key:"OnMouseUp",get:function(){return this.FFrmRecord.OnMouseUpLib},set:function(t){this.FFrmRecord.OnMouseUpLib=null!=t?function(e,i){t(e,i)}:null}},{key:"OnPopupFormClose",get:function(){return this.FFrmRecord.OnPopupFormClose},set:function(t){this.FFrmRecord.OnPopupFormClose=null!=t?function(){t()}:null}},{key:"OnChange",get:function(){return this.FFrmRecord.EmrView.OnChange},set:function(t){this.FFrmRecord.EmrView.OnChange=null!=t?function(){t()}:null}},{key:"OnDblClick",get:function(){return this.FFrmRecord.EmrView.onDblClick},set:function(t){this.FrmRecord.EmrView.onDblClick=null!=t?function(e){t()}:null}},{key:"OnDeItemGetSyncValue",get:function(){return this.FFrmRecord.OnDeItemGetSyncValue},set:function(t){this.FFrmRecord.OnDeItemGetSyncValue=null!=t?function(e){return t(e)}:null}},{key:"OnDrawTrace",get:function(){return this.FFrmRecord.EmrView.OnDrawTrace},set:function(t){this.FFrmRecord.EmrView.OnDrawTrace=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnSyntaxCheck",get:function(){return this.FFrmRecord.OnSyntaxCheck},set:function(t){this.FFrmRecord.EmrView.OnSyntaxCheck=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnSyntaxPaint",get:function(){return this.FFrmRecord.OnSyntaxPaint},set:function(t){this.FFrmRecord.OnSyntaxPaint=null!=t?function(e,i,n,o,r,s){t(e,i,n,o,r,s)}:null}}])&&BC(e.prototype,i),n&&BC(e,n),t}();e.default=EC}]).default;