@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
2 lines • 391 kB
JavaScript
/*! For license information please see bridge.min.js.LICENSE.txt */
!function(e){"use strict";var t,n,r,i,s,o,a,u,l,c,h={global:e,emptyFn:function(){},identity:function(e){return e},geti:function(e,t,n){return Bridge.hasValue(e[t])?t:n},literal:function(e,t){return t.$getType=function(){return e},t},isPlainObject:function(e){if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},toPlain:function(e){var t,n,r,i,s;if(!e||Bridge.isPlainObject(e)||"object"!=typeof e)return e;if("function"==typeof e.toJSON)return e.toJSON();if(Bridge.isArray(e)){for(t=[],n=0;n<e.length;n++)t.push(Bridge.toPlain(e[n]));return t}for(s in r={},e)i=e[s],Bridge.isFunction(i)||(r[s]=i);return r},ref:function(e,t){Bridge.isArray(t)&&(t=System.Array.toIndex(e,t));var n={};return Object.defineProperty(n,"v",{get:function(){return e[t]},set:function(n){e[t]=n}}),n},property:function(e,t,n,r){e[t]=n;var i="$"===t.charAt(0)?t.slice(1):t,s="get"+i,o="set"+i,a=t.lastIndexOf("$");a>0&&t.length-a-1>0&&!isNaN(parseInt(t.substr(a+1)))&&(a=t.substring(0,a-1).lastIndexOf("$")),a>0&&a!==t.length-1&&(s=t.substring(0,a)+"get"+t.substr(a+1),o=t.substring(0,a)+"set"+t.substr(a+1)),e[s]=function(e,t,n){return n?function(){return t[e]}:function(){return this[e]}}(t,e,r),e[o]=function(e,t,n){return n?function(n){t[e]=n}:function(t){this[e]=t}}(t,e,r)},event:function(e,t,n,r){e[t]=n;var i="$"===t.charAt(0)?t.slice(1):t,s="add"+i,o="remove"+i,a=t.lastIndexOf("$");a>0&&t.length-a-1>0&&!isNaN(parseInt(t.substr(a+1)))&&(a=t.substring(0,a-1).lastIndexOf("$")),a>0&&a!==t.length-1&&(s=t.substring(0,a)+"add"+t.substr(a+1),o=t.substring(0,a)+"remove"+t.substr(a+1)),e[s]=function(e,t,n){return n?function(n){t[e]=Bridge.fn.combine(t[e],n)}:function(t){this[e]=Bridge.fn.combine(this[e],t)}}(t,e,r),e[o]=function(e,t,n){return n?function(n){t[e]=Bridge.fn.remove(t[e],n)}:function(t){this[e]=Bridge.fn.remove(this[e],t)}}(t,e,r)},createInstance:function(e,t){return e===System.Decimal?System.Decimal.Zero:e===System.Int64?System.Int64.Zero:e===System.UInt64?System.UInt64.Zero:e===System.Double||e===System.Single||e===System.Byte||e===System.SByte||e===System.Int16||e===System.UInt16||e===System.Int32||e===System.UInt32||e===Bridge.Int?0:"function"==typeof e.getDefaultValue?e.getDefaultValue():e!==Boolean&&(e===Date?new Date(0):e===Number?0:e===String?"":e&&e.$literal?e.ctor():t&&t.length>0?Bridge.Reflection.applyConstructor(e,t):new e)},clone:function(e){return Bridge.isArray(e)?System.Array.clone(e):Bridge.isString(e)?e:Bridge.isFunction(e.System$ICloneable$clone)?e.System$ICloneable$clone():Bridge.is(e,System.ICloneable)?e.clone():null},copy:function(e,t,n,r){"string"==typeof n&&(n=n.split(/[,;\s]+/));for(var i,s=0,o=n?n.length:0;s<o;s++)i=n[s],(!0!==r||null==e[i])&&(e[i]=Bridge.is(t[i],System.ICloneable)?Bridge.clone(t[i]):t[i]);return e},get:function(e){return e&&null!==e.$staticInit&&e.$staticInit(),e},ns:function(e,t){var n=e.split("."),r=0;for(t||(t=Bridge.global),r=0;r<n.length;r++)void 0===t[n[r]]&&(t[n[r]]={}),t=t[n[r]];return t},ready:function(e,t){var n=function(){t?e.apply(t):e()};void 0!==Bridge.global.jQuery?Bridge.global.jQuery(n):void 0===Bridge.global.document||"complete"===Bridge.global.document.readyState||"loaded"===Bridge.global.document.readyState?n():Bridge.on("DOMContentLoaded",Bridge.global.document,n)},on:function(e,t,n,r){t.addEventListener?t.addEventListener(e,(function(e){var t=n.apply(r||this,arguments);return!1===t&&(e.stopPropagation(),e.preventDefault()),t}),!1):t.attachEvent("on"+e,(function(){var e=n.call(r||t,Bridge.global.event);return!1===e&&(Bridge.global.event.returnValue=!1,Bridge.global.event.cancelBubble=!0),e}))},addHash:function(e,t,n){if(isNaN(t)&&(t=17),isNaN(n)&&(n=23),Bridge.isArray(e)){for(var r=0;r<e.length;r++)t=t+((t*n|0)+(null==e[r]?0:Bridge.getHashCode(e[r])))|0;return t}return t+((t*n|0)+(null==e?0:Bridge.getHashCode(e)))|0},getHashCode:function(e,t,n){var r,i,s,o,a;if(Bridge.isEmpty(e,!0)){if(t)return 0;throw new System.InvalidOperationException("HashCode cannot be calculated for empty value")}if(!1!==n&&e.hasOwnProperty("item1")&&Bridge.isPlainObject(e)&&(n=!0),e.getHashCode&&Bridge.isFunction(e.getHashCode)&&!e.__insideHashCode&&0===e.getHashCode.length)return e.__insideHashCode=!0,r=e.getHashCode(),delete e.__insideHashCode,r;if(Bridge.isBoolean(e))return e?1:0;if(Bridge.isDate(e))return 4294967295&e.valueOf();if(e===Number.POSITIVE_INFINITY)return 2146435072;if(e===Number.NEGATIVE_INFINITY)return 4293918720;if(Bridge.isNumber(e)){if(Math.floor(e)===e)return e;e=e.toExponential()}if(Bridge.isString(e)){for(i=0,s=0;s<e.length;s++)i=(i<<5)-i+e.charCodeAt(s)&4294967295;return i}if(e.$$hashCode)return e.$$hashCode;if(n&&"object"==typeof e){for(a in o=0,e)e.hasOwnProperty(a)&&(o=29*o+(Bridge.isEmpty(e[a],!0)?0:Bridge.getHashCode(e[a])));if(0!==o)return e.$$hashCode=o,o}return e.$$hashCode=4294967296*Math.random()|0,e.$$hashCode},getDefaultValue:function(e){return e.getDefaultValue&&0===e.getDefaultValue.length?e.getDefaultValue():e!==Boolean&&(e===Date?new Date(-864e13):e===Number?0:null)},getTypeAlias:function(e){return(e.$$name||Bridge.getTypeName(e)).replace(/[\.\(\)\,]/g,"$")},getTypeName:function(e){return Bridge.Reflection.getTypeFullName(e)},hasValue:function(e){return null!=e},hasValue$1:function(){if(0===arguments.length)return!1;for(var e=0;e<arguments.length;e++)if(null==arguments[e])return!1;return!0},is:function(e,t,n,r){var i,s,o,a;if(null==e)return!!r;if(i=e.constructor,t.constructor===Function&&e instanceof t||i===t)return!0;if(s=i.$kind||i.$$inherits,o=t.$kind,s||o){if(t.$isInterface){if(s)return i.$isArrayEnumerator?System.Array.is(e,t):t.isAssignableFrom?t.isAssignableFrom(i):Bridge.Reflection.getInterfaces(i).indexOf(t)>=0;if(Bridge.isArray(e,i))return System.Array.is(e,t);if(i===String)return System.String.is(e,t)}return!0!==n&&t.$is?t.$is(e):!(!t.$literal||!Bridge.isPlainObject(e))&&(!e.$getType||Bridge.Reflection.isAssignableFrom(t,e.$getType()))}if("boolean"==(a=typeof t))return t;if("string"===a&&(t=Bridge.unroll(t)),"function"===a&&Bridge.getType(e).prototype instanceof t)return!0;if(!0!==n){if("function"==typeof t.$is)return t.$is(e);if("function"==typeof t.isAssignableFrom)return t.isAssignableFrom(Bridge.getType(e))}return Bridge.isArray(e)?System.Array.is(e,t):"object"===a&&(i===t||e instanceof t)},as:function(e,t,n){return Bridge.is(e,t,!1,n)?e:null},cast:function(e,t,n){if(null==e)return e;var r=Bridge.is(e,t,!1,n)?e:null;if(null===r)throw new System.InvalidCastException("Unable to cast type "+(e?Bridge.getTypeName(e):"'null'")+" to type "+Bridge.getTypeName(t));return r},apply:function(e,t){for(var n,r=Bridge.getPropertyNames(t,!0),i=0;i<r.length;i++)"function"==typeof e[n=r[i]]&&"function"!=typeof t[n]?e[n](t[n]):e[n]=t[n];return e},merge:function(e,t,n,r){var i,s,o,a,u,l,c;if(e instanceof System.Decimal&&Bridge.isNumber(t))return new System.Decimal(t);if(e instanceof System.Int64&&Bridge.isNumber(t))return new System.Int64(t);if(e instanceof System.UInt64&&Bridge.isNumber(t))return new System.UInt64(t);if(e instanceof Boolean||Bridge.isBoolean(e)||e instanceof Number||Bridge.isNumber(e)||e instanceof String||Bridge.isString(e)||e instanceof Function||Bridge.isFunction(e)||e instanceof Date||Bridge.isDate(e)||Bridge.isNumber(e)||e instanceof System.Double||e instanceof System.Single||e instanceof System.Byte||e instanceof System.SByte||e instanceof System.Int16||e instanceof System.UInt16||e instanceof System.Int32||e instanceof System.UInt32||e instanceof Bridge.Int||e instanceof System.Decimal)return t;if(Bridge.isArray(t)&&Bridge.isFunction(e.add||e.push))for(u=Bridge.isArray(e)?e.push:e.add,s=0;s<t.length;s++)l=t[s],Bridge.isArray(l)||(l=[void 0===r?l:Bridge.merge(r(),l)]),u.apply(e,l);else for(i in t)o=t[i],"function"==typeof e[i]?i.match(/^\s*get[A-Z]/)?Bridge.merge(e[i](),o):e[i](o):"function"==typeof e[c="set"+i.charAt(0).toUpperCase()+i.slice(1)]&&"function"!=typeof o?e[c](o):o&&o.constructor===Object&&e[i]?(a=e[i],Bridge.merge(a,o)):e[i]=o;return n&&n.call(e,e),e},getEnumerator:function(e,t,n){if("string"==typeof e&&(e=System.String.toCharArray(e)),2===arguments.length&&Bridge.isFunction(t)&&(n=t,t=null),t&&e&&e[t])return e[t].call(e);if(!n&&e&&e.getEnumerator)return e.getEnumerator();var r;if(n&&Bridge.isFunction(e[r="System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(n)+"$getEnumerator"])||Bridge.isFunction(e[r="System$Collections$IEnumerable$getEnumerator"]))return e[r]();if(n&&e&&e.getEnumerator)return e.getEnumerator();if("[object Array]"===Object.prototype.toString.call(e)||e&&Bridge.isDefined(e.length))return new Bridge.ArrayEnumerator(e,n);throw new System.InvalidOperationException("Cannot create enumerator")},getPropertyNames:function(e,t){var n=[];for(var r in e)(t||"function"!=typeof e[r])&&n.push(r);return n},isDefined:function(e,t){return void 0!==e&&(!t||null!==e)},isEmpty:function(e,t){return null==e||!t&&""===e||!(t||!Bridge.isArray(e))&&0===e.length},toArray:function(e){var t,n,r,i=[];if(Bridge.isArray(e))for(t=0,r=e.length;t<r;++t)i.push(e[t]);else for(t=Bridge.getEnumerator(e);t.moveNext();)n=t.getCurrent(),i.push(n);return i},toList:function(e,t){return new(System.Collections.Generic.List$1(t||Object))(e)},arrayTypes:[e.Array,e.Uint8Array,e.Int8Array,e.Int16Array,e.Uint16Array,e.Int32Array,e.Uint32Array,e.Float32Array,e.Float64Array,e.Uint8ClampedArray],isArray:function(e,t){var n=t||(null!=e?e.constructor:null);return!!n&&Bridge.arrayTypes.indexOf(n)>=0},isFunction:function(e){return"function"==typeof e},isDate:function(e){return"[object Date]"===Object.prototype.toString.call(e)},isNull:function(e){return null==e},isBoolean:function(e){return"boolean"==typeof e},isNumber:function(e){return"number"==typeof e&&isFinite(e)},isString:function(e){return"string"==typeof e},unroll:function(e){for(var t=e.split("."),n=Bridge.global[t[0]],r=1;r<t.length;r++){if(!n)return null;n=n[t[r]]}return n},referenceEquals:function(e,t){return Bridge.hasValue(e)?e===t:!Bridge.hasValue(t)},staticEquals:function(e,t){return Bridge.hasValue(e)?!!Bridge.hasValue(t)&&Bridge.equals(e,t):!Bridge.hasValue(t)},equals:function(e,t){if(null==e&&null==t)return!0;if(e&&Bridge.isFunction(e.equals)&&1===e.equals.length)return e.equals(t);if(t&&Bridge.isFunction(t.equals)&&1===t.equals.length)return t.equals(e);if(Bridge.isDate(e)&&Bridge.isDate(t))return e.valueOf()===t.valueOf();if(Bridge.isNull(e)&&Bridge.isNull(t))return!0;if(Bridge.isNull(e)!==Bridge.isNull(t))return!1;var n=e===t;return n||"object"!=typeof e||"object"!=typeof t||null===e||null===t||"struct"!==e.$kind||"struct"!==t.$kind||e.$$name!==t.$$name?!n&&e&&t&&e.hasOwnProperty("item1")&&Bridge.isPlainObject(e)&&t.hasOwnProperty("item1")&&Bridge.isPlainObject(t)?Bridge.objectEquals(e,t):n:Bridge.getHashCode(e)===Bridge.getHashCode(t)&&Bridge.objectEquals(e,t)},objectEquals:function(e,t){Bridge.$$leftChain=[],Bridge.$$rightChain=[];var n=Bridge.deepEquals(e,t);return delete Bridge.$$leftChain,delete Bridge.$$rightChain,n},deepEquals:function(e,t){if("object"==typeof e&&"object"==typeof t){if(e===t)return!0;if(Bridge.$$leftChain.indexOf(e)>-1||Bridge.$$rightChain.indexOf(t)>-1)return!1;for(var n in t)if(t.hasOwnProperty(n)!==e.hasOwnProperty(n)||typeof t[n]!=typeof e[n])return!1;for(n in e){if(t.hasOwnProperty(n)!==e.hasOwnProperty(n)||typeof e[n]!=typeof t[n])return!1;if(e[n]!==t[n])if("object"==typeof e[n]){if(Bridge.$$leftChain.push(e),Bridge.$$rightChain.push(t),!Bridge.deepEquals(e[n],t[n]))return!1;Bridge.$$leftChain.pop(),Bridge.$$rightChain.pop()}else if(!Bridge.equals(e[n],t[n]))return!1}return!0}return Bridge.equals(e,t)},compare:function(e,t,n,r){if(!Bridge.isDefined(e,!0)){if(n)return 0;throw new System.NullReferenceException}if(Bridge.isNumber(e)||Bridge.isString(e)||Bridge.isBoolean(e))return Bridge.isString(e)&&!Bridge.hasValue(t)?1:e<t?-1:e>t?1:0;if(Bridge.isDate(e))return Bridge.compare(e.valueOf(),t.valueOf());var i;if(r&&Bridge.isFunction(e[i="System$IComparable$1$"+Bridge.getTypeAlias(r)+"$compareTo"])||Bridge.isFunction(e[i="System$IComparable$compareTo"]))return e[i](t);if(Bridge.isFunction(e.compareTo))return e.compareTo(t);if(r&&Bridge.isFunction(t[i="System$IComparable$1$"+Bridge.getTypeAlias(r)+"$compareTo"])||Bridge.isFunction(t[i="System$IComparable$compareTo"]))return-t[i](e);if(Bridge.isFunction(t.compareTo))return-t.compareTo(e);if(n)return 0;throw new System.Exception("Cannot compare items")},equalsT:function(e,t,n){if(!Bridge.isDefined(e,!0))throw new System.NullReferenceException;return Bridge.isNumber(e)||Bridge.isString(e)||Bridge.isBoolean(e)?e===t:Bridge.isDate(e)?e.valueOf()===t.valueOf():n&&null!=e&&Bridge.isFunction(e[r="System$IEquatable$1$"+Bridge.getTypeAlias(n)+"$equalsT"])?e[r](t):n&&null!=t&&Bridge.isFunction(t[r="System$IEquatable$1$"+Bridge.getTypeAlias(n)+"$equalsT"])?t[r](e):e.equalsT?e.equalsT(t):t.equalsT(e);var r},format:function(e,t,n){return Bridge.isNumber(e)?Bridge.Int.format(e,t,n):Bridge.isDate(e)?Bridge.Date.format(e,t,n):Bridge.isFunction(e.System$IFormattable$format)?e.System$IFormattable$format(t,n):e.format(t,n)},getType:function(e){if(null==e)throw new System.NullReferenceException("instance is null");if("number"==typeof e)return!isNaN(e)&&isFinite(e)&&Math.floor(e,0)===e?System.Int32:System.Double;if(e.$getType)return e.$getType();try{return e.constructor}catch(e){return Object}},isLower:function(e){var t=String.fromCharCode(e);return t===t.toLowerCase()&&t!==t.toUpperCase()},isUpper:function(e){var t=String.fromCharCode(e);return t!==t.toLowerCase()&&t===t.toUpperCase()},coalesce:function(e,t){return Bridge.hasValue(e)?e:t},fn:{equals:function(e){return this===e||null!=e&&this.constructor===e.constructor&&this.equals===e.equals&&this.$method===e.$method&&this.$scope===e.$scope},call:function(e,t){var n=Array.prototype.slice.call(arguments,2);return(e=e||Bridge.global)[t].apply(e,n)},makeFn:function(e,t){return function(){return e.apply(this,arguments)}},bind:function(e,t,n,r){var i,s;if(t&&t.$method===t&&t.$scope===e)return t;if(e&&e.$$bind)for(i=0;i<e.$$bind.length;i++)if(e.$$bind[i].$method===t)return e.$$bind[i];return s=2===arguments.length?Bridge.fn.makeFn((function(){Bridge.caller.unshift(this);var n=t.apply(e,arguments);return Bridge.caller.shift(this),n}),t.length):Bridge.fn.makeFn((function(){var i,s=n||arguments;return!0===r?s=(s=Array.prototype.slice.call(arguments,0)).concat(n):"number"==typeof r&&(s=Array.prototype.slice.call(arguments,0),0===r?s.unshift.apply(s,n):r<s.length?s.splice.apply(s,[r,0].concat(n)):s.push.apply(s,n)),Bridge.caller.unshift(this),i=t.apply(e,s),Bridge.caller.shift(this),i}),t.length),e&&(e.$$bind=e.$$bind||[],e.$$bind.push(s)),s.$method=t,s.$scope=e,s.equals=Bridge.fn.equals,s},bindScope:function(e,t){var n=Bridge.fn.makeFn((function(){var n,r=Array.prototype.slice.call(arguments,0);return r.unshift.apply(r,[e]),Bridge.caller.unshift(this),n=t.apply(e,r),Bridge.caller.shift(this),n}),t.length);return n.$method=t,n.$scope=e,n.equals=Bridge.fn.equals,n},$build:function(e){var t=function(){for(var e=t.$invocationList,n=null,r=0;r<e.length;r++)n=e[r].apply(null,arguments);return n};return t.$invocationList=e?Array.prototype.slice.call(e,0):[],0===t.$invocationList.length?null:t},combine:function(e,t){if(!e||!t)return e||t;var n=e.$invocationList?e.$invocationList:[e],r=t.$invocationList?t.$invocationList:[t];return Bridge.fn.$build(n.concat(r))},getInvocationList:function(){},remove:function(e,t){if(!e||!t)return e||null;for(var n,r,i=e.$invocationList?e.$invocationList:[e],s=t.$invocationList?t.$invocationList:[t],o=[],a=i.length-1;a>=0;a--){for(n=!1,r=0;r<s.length;r++)if(i[a]===s[r]||i[a].$method&&i[a].$method===s[r].$method&&i[a].$scope&&i[a].$scope===s[r].$scope){n=!0;break}n||o.push(i[a])}return o.reverse(),Bridge.fn.$build(o)}},sleep:function(e,t){if(Bridge.hasValue(t)&&(e=t.getTotalMilliseconds()),isNaN(e)||e<-1||e>2147483647)throw new System.ArgumentOutOfRangeException("timeout","Number must be either non-negative and less than or equal to Int32.MaxValue or -1");-1==e&&(e=2147483647);for(var n=(new Date).getTime();(new Date).getTime()-n<e&&!((new Date).getTime()-n>2147483647););},getMetadata:function(e){return e.$getMetadata?e.$getMetadata():e.$metadata}};e.Bridge=h,e.Bridge.caller=[],e.System={},e.System.Diagnostics={},e.System.Diagnostics.Contracts={},e.System.Threading={},t={is:function(e,t){return!!Bridge.isString(e)&&(e.constructor===t||e instanceof t||t===System.ICloneable||t===System.Collections.IEnumerable||t===System.Collections.Generic.IEnumerable$1(System.Char)||t===System.IComparable$1(String)||t===System.IEquatable$1(String))},lastIndexOf:function(e,t,n,r){var i=e.lastIndexOf(t,n);return i<n-r+1?-1:i},lastIndexOfAny:function(e,t,n,r){var i,s,o=e.length;if(!o)return-1;for(t=String.fromCharCode.apply(null,t),(i=(n=n||o-1)-(r=r||o)+1)<0&&(i=0),s=n;s>=i;s--)if(t.indexOf(e.charAt(s))>=0)return s;return-1},isNullOrWhiteSpace:function(e){return!e||System.Char.isWhiteSpace(e)},isNullOrEmpty:function(e){return!e},fromCharCount:function(e,t){if(t>=0)return String(Array(t+1).join(String.fromCharCode(e)));throw new System.ArgumentOutOfRangeException("count","cannot be less than zero")},format:function(e){return System.String._format(System.Globalization.CultureInfo.getCurrentCulture(),e,Array.prototype.slice.call(arguments,1))},formatProvider:function(e,t){return System.String._format(e,t,Array.prototype.slice.call(arguments,2))},_format:function(e,t,n){var r=this,i=n,s=this.decodeBraceSequence;return t.replace(/(\{+)((\d+|[a-zA-Z_$]\w+(?:\.[a-zA-Z_$]\w+|\[\d+\])*)(?:\,(-?\d*))?(?:\:([^\}]*))?)(\}+)|(\{+)|(\}+)/g,(function(t,n,o,a,u,l,c,h,m){return h?s(h):m?s(m):n.length%2==0||c.length%2==0?s(n)+o+s(c):s(n,!0)+r.handleElement(e,a,u,l,i)+s(c,!0)}))},handleElement:function(e,t,n,r,i){var s;if((t=parseInt(t,10))>i.length-1)throw new System.FormatException("Input string was not in a correct format.");return null==(s=i[t])&&(s=""),s=r&&Bridge.is(s,System.IFormattable)?Bridge.format(s,r,e):""+s,n&&(n=parseInt(n,10),Bridge.isNumber(n)||(n=null)),System.String.alignString(s.toString(),n)},decodeBraceSequence:function(e,t){return e.substr(0,(e.length+(t?0:1))/2)},alignString:function(e,t,n,r,i){if(!e||!t)return e;if(n||(n=" "),Bridge.isNumber(n)&&(n=String.fromCharCode(n)),r||(r=t<0?1:2),t=Math.abs(t),i&&e.length>t&&(e=e.substring(0,t)),t+1>=e.length)switch(r){case 2:e=Array(t+1-e.length).join(n)+e;break;case 3:var s=t-e.length,o=Math.ceil(s/2);e=Array(s-o+1).join(n)+e+Array(o+1).join(n);break;default:e+=Array(t+1-e.length).join(n)}return e},startsWith:function(e,t){return!t.length||!(t.length>e.length)&&(t=System.String.escape(t),null!==e.match("^"+t))},endsWith:function(e,t){return!t.length||!(t.length>e.length)&&(t=System.String.escape(t),null!==e.match(t+"$"))},contains:function(e,t){if(null==t)throw new System.ArgumentNullException;return null!=e&&e.indexOf(t)>-1},indexOfAny:function(e,t){var n,r,i,s,o,a;if(null==t)throw new System.ArgumentNullException;if(null==e||""===e)return-1;if((n=arguments.length>2?arguments[2]:0)<0)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero");if((r=arguments.length>3?arguments[3]:e.length-n)<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(r>e.length-n)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string");for(i=e.substr(n,r),s=0;s<t.length;s++)if(o=String.fromCharCode(t[s]),(a=i.indexOf(o))>-1)return a+n;return-1},indexOf:function(e,t){var n,r,i,s;if(null==t)throw new System.ArgumentNullException;if(null==e||""===e)return-1;if((n=arguments.length>2?arguments[2]:0)<0||n>e.length)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(""===t)return arguments.length>2?n:0;if((r=arguments.length>3?arguments[3]:e.length-n)<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(r>e.length-n)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string");return i=e.substr(n,r),(s=5===arguments.length&&arguments[4]%2!=0?i.toLocaleUpperCase().indexOf(t.toLocaleUpperCase()):i.indexOf(t))>-1?5===arguments.length?0===System.String.compare(t,i.substr(s,t.length),arguments[4])?s+n:-1:s+n:-1},equals:function(){return 0===System.String.compare.apply(this,arguments)},compare:function(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;if(arguments.length>=3)if(Bridge.isBoolean(arguments[2])){if(arguments[2]&&(e=e.toLocaleUpperCase(),t=t.toLocaleUpperCase()),4===arguments.length)return e.localeCompare(t,arguments[3].name)}else switch(arguments[2]){case 1:return e.localeCompare(t,System.Globalization.CultureInfo.getCurrentCulture().name,{sensitivity:"accent"});case 2:return e.localeCompare(t,System.Globalization.CultureInfo.invariantCulture.name);case 3:return e.localeCompare(t,System.Globalization.CultureInfo.invariantCulture.name,{sensitivity:"accent"});case 4:return e===t?0:e>t?1:-1;case 5:return e.toUpperCase()===t.toUpperCase()?0:e.toUpperCase()>t.toUpperCase()?1:-1}return e.localeCompare(t)},toCharArray:function(e,t,n){var r,i;if(t<0||t>e.length||t>e.length-n)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(n<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");for(Bridge.hasValue(t)||(t=0),Bridge.hasValue(n)||(n=e.length),r=[],i=t;i<t+n;i++)r.push(e.charCodeAt(i));return r},escape:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},replaceAll:function(e,t,n){var r=new RegExp(System.String.escape(t),"g");return e.replace(r,n)},insert:function(e,t,n){return e>0?t.substring(0,e)+n+t.substring(e,t.length):n+t},remove:function(e,t,n){if(null==e)throw new System.NullReferenceException;if(t<0)throw new System.ArgumentOutOfRangeException("startIndex","StartIndex cannot be less than zero");if(null!=n){if(n<0)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than zero");if(n>e.length-t)throw new System.ArgumentOutOfRangeException("count","Index and count must refer to a location within the string")}else if(t>=e.length)throw new System.ArgumentOutOfRangeException("startIndex","startIndex must be less than length of string");return null==n||t+n>e.length?e.substr(0,t):e.substr(0,t)+e.substr(t+n)},split:function(e,t,n,r){for(var i,s=Bridge.hasValue(t)&&0!==t.length?new RegExp(t.map(System.String.escape).join("|"),"g"):new RegExp("\\s","g"),o=[],a=0;;a=s.lastIndex){if(!(i=s.exec(e)))return(1!==r||a!==e.length)&&o.push(e.substr(a)),o;if(1!==r||i.index>a){if(o.length===n-1)return o.push(e.substr(a)),o;o.push(e.substring(a,i.index))}}},trimEnd:function(e,t){return e.replace(t?new RegExp("["+System.String.escape(String.fromCharCode.apply(null,t))+"]+$"):/\s*$/,"")},trimStart:function(e,t){return e.replace(t?new RegExp("^["+System.String.escape(String.fromCharCode.apply(null,t))+"]+"):/^\s*/,"")},trim:function(e,t){return System.String.trimStart(System.String.trimEnd(e,t),t)},concat:function(){for(var e,t="",n=0;n<arguments.length;n++)t+=null==(e=arguments[n])?"":e;return t}},System.String=t,n={nameEquals:function(e,t,n){return n?e.toLowerCase()===t.toLowerCase():e.charAt(0).toLowerCase()+e.slice(1)===t.charAt(0).toLowerCase()+t.slice(1)},checkEnumType:function(e){if(!e)throw new System.ArgumentNullException("enumType");if(e.prototype&&"enum"!==e.$kind)throw new System.ArgumentException("","enumType")},toName:function(e){return e},parse:function(e,t,r,i){var s,o,a,u,l,c;if(System.Enum.checkEnumType(e),s={},System.Int32.tryParse(t,s))return s.v;if(o=e,e.prototype&&e.prototype.$flags){var h=t.split(","),m=0,g=!0;for(a=h.length-1;a>=0;a--){for(c in u=h[a].trim(),l=!1,o)if(n.nameEquals(c,u,r)){m|=o[c],l=!0;break}if(!l){g=!1;break}}if(g)return m}else for(c in o)if(n.nameEquals(c,t,r))return o[c];if(!0!==i)throw new System.ArgumentException("Invalid Enumeration Value");return null},toString:function(e,t,r){var i,s,o,a;if(e===Number)return t.toString();if(System.Enum.checkEnumType(e),i=e,s=System.Int64.is64Bit(t),(e.prototype&&e.prototype.$flags||!0===r)&&0!==t){for(a in o=[],i)(s&&System.Int64.is64Bit(i[a])?!i[a].and(t).isZero():i[a]&t)&&o.push(n.toName(a));return o.length?o.join(", "):t.toString()}for(a in i)if(s&&System.Int64.is64Bit(i[a])?i[a].eq(t):i[a]===t)return n.toName(a);return t.toString()},getValues:function(e){var t,n,r;for(r in System.Enum.checkEnumType(e),t=[],n=e)n.hasOwnProperty(r)&&r.indexOf("$")<0&&"function"!=typeof n[r]&&t.push(n[r]);return t},format:function(e,t,n){var r;if(System.Enum.checkEnumType(e),!Bridge.hasValue(t)&&(r="value")||!Bridge.hasValue(n)&&(r="format"))throw new System.ArgumentNullException(r);switch(n){case"G":case"g":return System.Enum.toString(e,t);case"x":case"X":return t.toString(16);case"d":case"D":return t.toString();case"f":case"F":return System.Enum.toString(e,t,!0);default:throw new System.FormatException}},getNames:function(e){var t,r,i;for(i in System.Enum.checkEnumType(e),t=[],r=e)r.hasOwnProperty(i)&&i.indexOf("$")<0&&"function"!=typeof r[i]&&t.push(n.toName(i));return t},getName:function(e,t){var n,r;for(r in System.Enum.checkEnumType(e),n=e)if(n[r]===t)return r.charAt(0).toUpperCase()+r.slice(1);return null},hasFlag:function(e,t){return!!(e&t)},isDefined:function(e,t){var r,i,s;for(s in System.Enum.checkEnumType(e),r=e,i=Bridge.isString(t),r)if(i?n.nameEquals(s,t,!1):r[s]===t)return!0;return!1},tryParse:function(e,t,r,i){return r.v=0,r.v=n.parse(e,t,i,!0),null!=r.v}},System.Enum=n;var m=function(e){return e.test(navigator.userAgent.toLowerCase())},g=Bridge.global.document&&"CSS1Compat"===Bridge.global.document.compatMode,f=function(e,t){var n;return e&&(n=t.exec(navigator.userAgent.toLowerCase()))?parseFloat(n[1]):0},p=Bridge.global.document?Bridge.global.document.documentMode:null,d=m(/opera/),y=d&&m(/version\/10\.5/),S=m(/\bchrome\b/),x=m(/webkit/),w=!S&&m(/safari/),v=w&&m(/applewebkit\/4/),b=w&&m(/version\/3/),I=w&&m(/version\/4/),C=w&&m(/version\/5\.0/),E=w&&m(/version\/5/),$=!d&&(m(/msie/)||m(/trident/)),B=$&&(m(/msie 7/)&&8!==p&&9!==p&&10!==p||7===p),_=$&&(m(/msie 8/)&&7!==p&&9!==p&&10!==p||8===p),T=$&&(m(/msie 9/)&&7!==p&&8!==p&&10!==p||9===p),R=$&&(m(/msie 10/)&&7!==p&&8!==p&&9!==p||10===p),N=$&&(m(/trident\/7\.0/)&&7!==p&&8!==p&&9!==p&&10!==p||11===p),k=$&&m(/msie 6/),A=!x&&!$&&m(/gecko/),D=A&&m(/rv:1\.9/),O=A&&m(/rv:2\.0/),M=A&&m(/rv:5\./),P=A&&m(/rv:10\./),V=D&&m(/rv:1\.9\.0/),L=D&&m(/rv:1\.9\.1/),F=D&&m(/rv:1\.9\.2/),G=m(/windows|win32/),q=m(/macintosh|mac os x/),U=m(/linux/),z=f(!0,/\bchrome\/(\d+\.\d+)/),j=f(!0,/\bfirefox\/(\d+\.\d+)/),H=f($,/msie (\d+\.\d+)/),W=f(d,/version\/(\d+\.\d+)/),Z=f(w,/version\/(\d+\.\d+)/),K=f(x,/webkit\/(\d+\.\d+)/),J=!!Bridge.global.location&&/^https/i.test(Bridge.global.location.protocol),X=/iPhone/i.test(navigator.platform),Y=/iPod/i.test(navigator.platform),Q=/iPad/i.test(navigator.userAgent),ee=/Blackberry/i.test(navigator.userAgent),te=/Android/i.test(navigator.userAgent),ne=q||G||U&&!te,re={isStrict:g,isIEQuirks:$&&!g&&(k||B||_||T),isOpera:d,isOpera10_5:y,isWebKit:x,isChrome:S,isSafari:w,isSafari3:b,isSafari4:I,isSafari5:E,isSafari5_0:C,isSafari2:v,isIE:$,isIE6:k,isIE7:B,isIE7m:k||B,isIE7p:$&&!k,isIE8:_,isIE8m:k||B||_,isIE8p:$&&!(k||B),isIE9:T,isIE9m:k||B||_||T,isIE9p:$&&!(k||B||_),isIE10:R,isIE10m:k||B||_||T||R,isIE10p:$&&!(k||B||_||T),isIE11:N,isIE11m:k||B||_||T||R||N,isIE11p:$&&!(k||B||_||T||R),isGecko:A,isGecko3:D,isGecko4:O,isGecko5:M,isGecko10:P,isFF3_0:V,isFF3_5:L,isFF3_6:F,isFF4:4<=j&&j<5,isFF5:5<=j&&j<6,isFF10:10<=j&&j<11,isLinux:U,isWindows:G,isMac:q,chromeVersion:z,firefoxVersion:j,ieVersion:H,operaVersion:W,safariVersion:Z,webKitVersion:K,isSecure:J,isiPhone:X,isiPod:Y,isiPad:Q,isBlackberry:ee,isAndroid:te,isDesktop:ne,isTablet:Q,isPhone:!ne&&!Q,iOS:X||Q||Y,standalone:!!Bridge.global.navigator&&!!Bridge.global.navigator.standalone};Bridge.Browser=re,r={_initialize:function(){this.$initialized||(this.$initialized=Bridge.emptyFn,this.$staticInit&&this.$staticInit(),this.$initMembers&&this.$initMembers())},initConfig:function(e,t,n,r,i,s){var o,a,u,l;if(n.fields)for(a in n.fields)i[a]=n.fields[a];if(n.properties)for(a in n.properties)Bridge.property(i,a,n.properties[a],r);if(n.events)for(a in n.events)Bridge.event(i,a,n.events[a],r);if(n.alias)for(u=0;u<n.alias.length;u++)void 0===(l=i[n.alias[u]])&&s&&(l=s[n.alias[u]]),i[n.alias[u+1]]=l,u++;n.init&&(o=n.init),(o||e&&!r&&t.$initMembers)&&(i.$initMembers=function(){e&&!r&&t.$initMembers&&t.$initMembers.call(this),o&&o.call(this)})},definei:function(e,t,n){!0!==n&&n||!t?n?n.$kind="interface":t={$kind:"interface"}:t.$kind="interface";var r=Bridge.define(e,t,n);return r.$kind="interface",r.$isInterface=!0,r},define:function(e,t,n,r){var i,s,o,a,u,l,c,h,m,g,f,p,d,y=!1;if(!0===n?(y=!0,n=t,t=Bridge.global):n||(n=t,t=Bridge.global),Bridge.isFunction(n))return i=function(){var t,r,s,o;return(r=Bridge.Class.getCachedType(i,arguments))?r.type:(t=Array.prototype.slice.call(arguments),s=n.apply(null,t),o=Bridge.define(Bridge.Class.genericName(e,t),s,!0,{fn:i,args:t}),Bridge.Class.staticInitAllow||Bridge.Class.$queue.push(o),Bridge.get(o))},i.$cache=[],Bridge.Class.generic(e,t,i,n.length);y||(Bridge.Class.staticInitAllow=!1);var S,x,w,v,b,I,C,E=(n=n||{}).$inherits||n.inherits,$=n.$statics||n.statics,B=n.$entryPoint,_=n.$scope||t||Bridge.global;if(n.$kind=n.$kind||"class",n.$inherits?delete n.$inherits:delete n.inherits,B&&delete n.$entryPoint,Bridge.isFunction($)?$=null:n.$statics?delete n.$statics:delete n.statics,(o=n.hasOwnProperty("ctor")&&n.ctor)?s=o:(s=n.$literal?function(e){return(e=e||{}).$getType=function(){return s},e}:function(){this.$initialize(),s.$base&&(s.$$inherits&&s.$$inherits.length>0&&s.$$inherits[0].$staticInit&&s.$$inherits[0].$staticInit(),s.$base.ctor.call(this))},n.ctor=s),n.$literal&&($&&$.getDefaultValue||(s.getDefaultValue=function(){return{$getType:function(){return s}}}),s.$literal=!0,delete n.$literal),y||(_=Bridge.Class.set(_,e,s)),r&&r.fn.$cache.push({type:s,args:r.args}),s.$$name=e,s.$kind=n.$kind,r&&y){for(s.$genericTypeDefinition=r.fn,s.$typeArguments=r.args,s.$assembly=r.fn.$assembly||Bridge.$currentAssembly,a=Bridge.Reflection.getTypeFullName(r.fn),w=0;w<r.args.length;w++)a+=(0===w?"[":",")+"["+Bridge.Reflection.getTypeQName(r.args[w])+"]";a+="]",s.$$fullname=a}else s.$$fullname=s.$$name;if(E&&Bridge.isFunction(E)&&(E=E()),u=[],l=[],E)for(c=0;c<E.length;c++){if((m=((h=E[c]).$interfaces||[]).concat(h.$baseInterfaces||[])).length>0)for(g=0;g<m.length;g++)l.indexOf(m[g])<0&&l.push(m[g]);"interface"===h.$kind&&u.push(h)}for(C in s.$baseInterfaces=l,s.$interfaces=u,s.$allInterfaces=u.concat(l),(!E||"interface"===E[0].$kind)&&(E=null),S=E?E[0].prototype:this.prototype,s.$base=S,x=E?E[0].$$initCtor?new E[0].$$initCtor:new E[0]:{},s.$$initCtor=function(){},s.$$initCtor.prototype=x,s.$$initCtor.prototype.constructor=s,s.$$initCtor.prototype.$$fullname=r&&y?s.$$fullname:s.$$name,$&&(f=$.$config||$.config)&&!Bridge.isFunction(f)&&(Bridge.Class.initConfig(E,S,f,!0,s),$.$config?delete $.$config:delete $.config),(p=n.$config||n.config)&&!Bridge.isFunction(p)?(Bridge.Class.initConfig(E,S,p,!1,n,x),n.$config?delete n.$config:delete n.config):E&&S.$initMembers&&(n.$initMembers=function(){S.$initMembers.call(this)}),n.$initialize=Bridge.Class._initialize,d=[],n)d.push(C);for(w=0;w<d.length;w++)C=d[w],v=n[C],b="ctor"===C,I=C,Bridge.isFunction(v)&&(b||null!==C.match("^\\$ctor"))&&(b=!0),b?(s[I]=n[C],s[I].prototype=x,s[I].prototype.constructor=s,x[I]=n[C]):x[I]=n[C];if(x.$$name=e,$)for(C in $)"ctor"===C?s.$ctor=$[C]:s[C]=$[C];for(E||(E=[Object].concat(u)),s.$$inherits=E,w=0;w<E.length;w++)(_=E[w]).$$inheritors||(_.$$inheritors=[]),_.$$inheritors.push(s);return i=function(){Bridge.Class.staticInitAllow&&(s.$staticInit=null,s.$initMembers&&s.$initMembers(),s.$ctor&&s.$ctor())},(B||Bridge.isFunction(x.$main))&&Bridge.Class.$queueEntry.push(s),s.$staticInit=i,y||Bridge.Class.registerType(e,s),Bridge.Reflection&&(s.$getMetadata=Bridge.Reflection.getMetadata),"enum"===s.$kind&&(s.$is=function(e){var t=s.prototype.$utype;return t===System.String?"string"==typeof e:t&&t.$is?t.$is(e):"number"==typeof e},s.getDefaultValue=function(){return s.prototype.$utype===System.String?null:0}),"interface"===s.$kind&&(s.prototype.$variance&&(s.isAssignableFrom=Bridge.Class.varianceAssignable),s.$isInterface=!0),s},varianceAssignable:function(e){var t,n,r=function(e,t){var n;if(t.$genericTypeDefinition===e.$genericTypeDefinition&&t.$typeArguments.length===e.$typeArguments.length){for(n=0;n<e.$typeArguments.length;n++){var r=e.prototype.$variance[n],i=e.$typeArguments[n],s=t.$typeArguments[n];switch(r){case 1:if(!Bridge.Reflection.isAssignableFrom(i,s))return!1;break;case 2:if(!Bridge.Reflection.isAssignableFrom(s,i))return!1;break;default:if(s!==i)return!1}}return!0}return!1};if("interface"===e.$kind&&r(this,e))return!0;for(t=Bridge.Reflection.getInterfaces(e),n=0;n<t.length;n++)if(t[n]===this||r(this,t[n]))return!0;return!1},registerType:function(e,t){Bridge.$currentAssembly&&(Bridge.$currentAssembly.$types[e]=t,t.$assembly=Bridge.$currentAssembly)},addExtend:function(e,t){var n,r,i,s;for(Array.prototype.push.apply(e.$$inherits,t),e.$interfaces=e.$interfaces||[],e.$baseInterfaces=e.$baseInterfaces||[],n=0;n<t.length;n++){if((r=t[n]).$$inheritors||(r.$$inheritors=[]),r.$$inheritors.push(e),(i=(r.$interfaces||[]).concat(r.$baseInterfaces||[])).length>0)for(s=0;s<i.length;s++)e.$baseInterfaces.indexOf(i[s])<0&&e.$baseInterfaces.push(i[s]);"interface"===r.$kind&&e.$interfaces.push(r)}e.$allInterfaces=e.$interfaces.concat(e.$baseInterfaces)},set:function(e,t,n,r){for(var i,s,o,a,u=t.split("."),l=0;l<u.length-1;l++)void 0===e[u[l]]&&(e[u[l]]={}),e=e[u[l]];if(o=e[i=u[u.length-1]]){if(o.$$name===t)throw"Class '"+t+"' is already defined";for(s in o)"function"==typeof(a=o[s])&&a.$$name&&function(e,t,n){Object.defineProperty(e,t,{get:function(){return Bridge.Class.staticInitAllow&&(n.$staticInit&&n.$staticInit(),Bridge.Class.defineProperty(e,t,n)),n},set:function(e){n=e},enumerable:!0,configurable:!0})}(n,s,a)}return!0!==r?function(e,t,n){Object.defineProperty(e,t,{get:function(){return Bridge.Class.staticInitAllow&&(n.$staticInit&&n.$staticInit(),Bridge.Class.defineProperty(e,t,n)),n},set:function(e){n=e},enumerable:!0,configurable:!0})}(e,i,n):e[i]=n,e},defineProperty:function(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0})},genericName:function(e,t){for(var n,r=e,i=0;i<t.length;i++)r+="$"+((n=t[i]).$$name||Bridge.getTypeName(n));return r},getCachedType:function(e,t){for(var n,r,i,s=e.$cache,o=s.length,a=0;a<o;a++)if((n=s[a]).args.length===t.length){for(r=!0,i=0;i<n.args.length;i++)if(n.args[i]!==t[i]){r=!1;break}if(r)return n}return null},generic:function(e,t,n,r){return n.$$name=e,n.$kind="class",Bridge.Class.set(t,e,n,!0),Bridge.Class.registerType(e,n),n.$typeArgumentCount=r,n.$isGenericTypeDefinition=!0,n.$getMetadata=Bridge.Reflection.getMetadata,n},init:function(e){var t,n,r;for(Bridge.Class.staticInitAllow=!0,t=Bridge.Class.$queue.concat(Bridge.Class.$queueEntry),n=0;n<t.length;n++)(r=t[n]).$staticInit&&r.$staticInit(),r.prototype.$main&&Bridge.ready(r.prototype.$main);Bridge.Class.$queue.length=0,Bridge.Class.$queueEntry.length=0,e&&e()}},Bridge.Class=r,Bridge.Class.$queue=[],Bridge.Class.$queueEntry=[],Bridge.define=Bridge.Class.define,Bridge.definei=Bridge.Class.definei,Bridge.init=Bridge.Class.init,Bridge.assembly=function(e,t,n){n||(n=t,t={}),e=e||"Bridge.$Unknown";var r=System.Reflection.Assembly.assemblies[e];r?Bridge.apply(r.res,t||{}):r=new System.Reflection.Assembly(e,t),Bridge.$currentAssembly=r,n&&n.call(Bridge.global,r,Bridge.global),Bridge.init()},Bridge.define("System.Reflection.Assembly",{statics:{assemblies:{}},ctor:function(e,t){this.$initialize(),this.name=e,this.res=t||{},this.$types={},this.$={},System.Reflection.Assembly.assemblies[e]=this},toString:function(){return this.name},getManifestResourceNames:function(){return Object.keys(this.res)},getManifestResourceDataAsBase64:function(e,t){return 1===arguments.length&&(t=e,e=null),e&&(t=Bridge.Reflection.getTypeNamespace(e)+"."+t),this.res[t]||null},getManifestResourceData:function(e,t){1===arguments.length&&(t=e,e=null),e&&(t=Bridge.Reflection.getTypeNamespace(e)+"."+t);var n=this.res[t];return n?System.Convert.fromBase64String(n):null},getCustomAttributes:function(e){return e&&!Bridge.isBoolean(e)?this.attr.filter((function(t){return Bridge.is(t,e)})):this.attr}}),Bridge.$currentAssembly=new System.Reflection.Assembly("mscorlib"),Bridge.SystemAssembly=Bridge.$currentAssembly,Bridge.SystemAssembly.$types["System.Reflection.Assembly"]=System.Reflection.Assembly,System.Reflection.Assembly.$assembly=Bridge.SystemAssembly,i=Bridge.$currentAssembly,Bridge.SystemAssembly.version="15.6.0",Bridge.SystemAssembly.compiler="15.6.0",Bridge.define("Bridge.Utils.SystemAssemblyVersion"),Bridge.Reflection={setMetadata:function(e,t){e.$getMetadata=Bridge.Reflection.getMetadata,e.$metadata=t},initMetaData:function(e,t){var n,r;if(t.m)for(n=0;n<t.m.length;n++)(r=t.m[n]).td=e,r.ad&&(r.ad.td=e),r.r&&(r.r.td=e),r.g&&(r.g.td=e),r.s&&(r.s.td=e);e.$metadata=t,e.$initMetaData=!0},getMetadata:function(){var e,t,n,r;if(!this.$metadata&&this.$genericTypeDefinition&&(this.$metadata=this.$genericTypeDefinition.$factoryMetadata||this.$genericTypeDefinition.$metadata),"function"==typeof(e=this.$metadata))if(this.$isGenericTypeDefinition){for(n=this.$typeArgumentCount,r=new Array(n),t=0;t<n;t++)r[t]=Object;this.$factoryMetadata=this.$metadata,e=this.$metadata.apply(null,r)}else e=this.$typeArguments?this.$metadata.apply(null,this.$typeArguments):this.$metadata();return!this.$initMetaData&&e&&Bridge.Reflection.initMetaData(this,e),e},load:function(e){return System.Reflection.Assembly.assemblies[e]||require(e)},getGenericTypeDefinition:function(e){if(e.$isGenericTypeDefinition)return e;if(!e.$genericTypeDefinition)throw new System.InvalidOperationException("This operation is only valid on generic types.");return e.$genericTypeDefinition},getGenericParameterCount:function(e){return e.$typeArgumentCount||0},getGenericArguments:function(e){return e.$typeArguments||null},isGenericTypeDefinition:function(e){return e.$isGenericTypeDefinition||!1},getBaseType:function(e){var t,n;if(e===Object||"interface"===e.$kind||null==e.prototype)return null;if(Object.getPrototypeOf)return Object.getPrototypeOf(e.prototype).constructor;if(t=e.prototype,Object.prototype.hasOwnProperty.call(t,"constructor"))try{return n=t.constructor,delete t.constructor,t.constructor}finally{t.constructor=n}return t.constructor},getTypeFullName:function(e){var t,n;return e.$$fullname?e.$$fullname:e.$$name?e.$$name:(t=e.constructor===Function?e.toString():e.constructor.toString(),(n=/function (.{1,})\(/.exec(t))&&n.length>1?n[1]:"Object")},_makeQName:function(e,t){return e+(t?", "+t.name:"")},getTypeQName:function(e){return Bridge.Reflection._makeQName(Bridge.Reflection.getTypeFullName(e),e.$assembly)},getTypeName:function(e){var t=Bridge.Reflection.getTypeFullName(e),n=t.indexOf("["),r=t.lastIndexOf(".",n>=0?n:t.length);return r>0?t.substr(r+1):t},getTypeNamespace:function(e){var t,n=Bridge.Reflection.getTypeFullName(e),r=n.indexOf("["),i=n.lastIndexOf(".",r>=0?r:n.length),s=i>0?n.substr(0,i):"";return e.$assembly&&(t=Bridge.Reflection._getAssemblyType(e.$assembly,s))&&(s=Bridge.Reflection.getTypeNamespace(t)),s},getTypeAssembly:function(e){return System.Array.contains([Date,Number,Boolean,String,Function,Array],e)?Bridge.SystemAssembly:e.$assembly||Bridge.SystemAssembly},_getAssemblyType:function(e,t){var n,r,i,s,o=!1;if(e||(e=Bridge.SystemAssembly,o=!0),e.$types){if(n=e.$types[t]||null)return n;if("mscorlib"!==e.name)return null;e=Bridge.global}for(r=t.split("."),i=e,s=0;s<r.length;s++)if(!(i=i[r[s]]))return null;return"function"!=typeof i||!o&&i.$assembly&&e.name!==i.$assembly.name?null:i},getAssemblyTypes:function(e){var t,n,r=[];if(e.$types)for(t in e.$types)e.$types.hasOwnProperty(t)&&r.push(e.$types[t]);else n=function(e,t){for(var i in e)e.hasOwnProperty(i)&&n(e[i],i);"function"==typeof e&&Bridge.isUpper(t.charCodeAt(0))&&r.push(e)},n(e,"");return r},createAssemblyInstance:function(e,t){var n=Bridge.Reflection.getType(t,e);return n?Bridge.createInstance(n):null},getInterfaces:function(e){return e.$allInterfaces?e.$allInterfaces:e===Date?[System.IComparable$1(Date),System.IEquatable$1(Date),System.IComparable,System.IFormattable]:e===Number?[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int),System.IComparable,System.IFormattable]:e===Boolean?[System.IComparable$1(Boolean),System.IEquatable$1(Boolean),System.IComparable]:e===String?[System.IComparable$1(String),System.IEquatable$1(String),System.IComparable,System.ICloneable,System.Collections.IEnumerable,System.Collections.Generic.IEnumerable$1(System.Char)]:e===Array||System.Array._typedArrays[Bridge.getTypeName(e)]?[System.Collections.IEnumerable,System.Collections.ICollection,System.ICloneable,System.Collections.Generic.IEnumerable$1(Object),System.Collections.Generic.ICollection$1(Object),System.Collections.Generic.IList$1(Object)]:[]},isInstanceOfType:function(e,t){return Bridge.is(e,t)},isAssignableFrom:function(e,t){if(null==e)throw new System.NullReferenceException;if(null==t)return!1;if(e===t||e===Object)return!0;if(Bridge.isFunction(e.isAssignableFrom))return e.isAssignableFrom(t);if(t===Array)return System.Array.is([],e);if(Bridge.Reflection.isInterface(e)&&System.Array.contains(Bridge.Reflection.getInterfaces(t),e))return!0;var n,r=t.$$inherits;if(r)for(n=0;n<r.length;n++)if(Bridge.Reflection.isAssignableFrom(e,r[n]))return!0;return!1},isClass:function(e){return"class"===e.$kind||e===Array||e===Function||e===RegExp||e===String||e===Error||e===Object},isEnum:function(e){return"enum"===e.$kind},isFlags:function(e){return!(!e.prototype||!e.prototype.$flags)},isInterface:function(e){return"interface"===e.$kind},_getType:function(e,t,n){var r,i,s=!n,o=(n=n||/[[,\]]/g).lastIndex,a=n.exec(e),u=[];if(a)switch(r=e.substring(o,a.index),a[0]){case"[":if("["!==e[a.index+1])return null;for(;;){if(n.exec(e),!(i=Bridge.Reflection._getType(e,Bridge.SystemAssembly,n)))return null;if(u.push(i),"]"===(a=n.exec(e))[0])break;if(","!==a[0])return null}if((a=n.exec(e))&&","===a[0]&&(n.exec(e),!(t=System.Reflection.Assembly.assemblies[(n.lastIndex>0?e.substring(a.index+1,n.lastIndex-1):e.substring(a.index+1)).trim()])))return null;break;case",":if(n.exec(e),!(t=System.Reflection.Assembly.assemblies[(n.lastIndex>0?e.substring(a.index+1,n.lastIndex-1):e.substring(a.index+1)).trim()]))return null}else r=e.substring(o);return s&&n.lastIndex?null:(i=Bridge.Reflection._getAssemblyType(t,r.trim()),(i=u.length?i.apply(null,u):i)&&i.$staticInit&&i.$staticInit(),i)},getType:function(e,t){return e?Bridge.Reflection._getType(e,t):null},canAcceptNull:function(e){return"struct"!==e.$kind&&e!==System.Decimal&&e!==System.Int64&&e!==System.UInt64&&e!==System.Double&&e!==System.Single&&e!==System.Byte&&e!==System.SByte&&e!==System.Int16&&e!==System.UInt16&&e!==System.Int32&&e!==System.UInt32&&e!==Bridge.Int&&e!==Boolean&&e!==Date&&e!==Number},applyConstructor:function(e,t){var n,r,i,s,o,a,u,l,c,h;if(!t||0===t.length)return new e;if(e.$$initCtor&&"anonymous"!==e.$kind){if(n=0,Bridge.getMetadata(e)){for(r=Bridge.Reflection.getMembers(e,1,28),s=0;s<r.length;s++)if((o=r[s]).p&&o.p.length===t.length){for(i=!0,a=0;a<o.p.length;a++)if(u=o.p[a],!Bridge.is(t[a],u)||null==t[a]&&!Bridge.Reflection.canAcceptNull(u)){i=!1;break}i&&(e=e[o.sn],n++)}}else if(Bridge.isFunction(e.ctor)&&e.ctor.length===t.length)e=e.ctor;else for(l="$ctor",c=1;Bridge.isFunction(e[l+c]);)e[l+c].length===t.length&&(e=e[l+c],n++),c++;if(n>1)throw new System.Exception("The ambiguous constructor call")}return(h=function(){e.apply(this,t)}).prototype=e.prototype,new h},getAttributes:function(e,t,n){var r,i,s,o,a,u,l,c=[];if(n&&(u=Bridge.Reflection.getBaseType(e)))for(s=Bridge.Reflection.getAttributes(u,t,!0),r=0;r<s.length;r++)i=Bridge.getType(s[r]),(o=Bridge.getMetadata(i))&&o.ni||c.push(s[r]);if((a=Bridge.getMetadata(e))&&a.at)for(r=0;r<a.at.length;r++)if(s=a.at[r],null==t||Bridge.Reflection.isInstanceOfType(s,t)){if(i=Bridge.getType(s),!(o=Bridge.getMetadata(i))||!o.am)for(l=c.length-1;l>=0;l--)Bridge.Reflection.isInstanceOfType(c[l],i)&&c.splice(l,1);c.push(s)}return c},getMembers:function(e,t,n,r,i){var s,o,a,u,l,c,h,m,g,f=[];if((72==(72&n)||4==(6&n))&&(s=Bridge.Reflection.getBaseType(e))&&(f=Bridge.Reflection.getMembers(s,-2&t,n&(64&n?255:247)&(2&n?251:255),r,i)),o=function(e){if(t&e.t&&(4&n&&!e.is||8&n&&e.is)&&(!r||e.n===r)){if(i){if((e.p||[]).length!==i.length)return;for(var s=0;s<i.length;s++)if(i[s]!==e.p[s])return}f.push(e)}},(a=Bridge.getMetadata(e))&&a.m)for(u=["g","s","ad","r"],g=0;g<a.m.length;g++)for(o(l=a.m[g]),c=0;c<4;c++)l[h=u[c]]&&o(l[h]);if(256&n){for(;e;){for(m=[],g=0;g<f.length;g++)f[g].td===e&&m.push(f[g]);if(m.length>1)throw new System.Reflection.AmbiguousMatchException("Ambiguous match");if(1===m.length)return m[0];e=Bridge.Reflection.getBaseType(e)}return null}return f},midel:function(e,t,n){var r,i,s,o;if(e.is&&t)throw new System.ArgumentException("Cannot specify target for static method");if(!e.is&&!t)throw new System.ArgumentException("Must specify target for instance method");if(e.fg)r=function(){return(e.is?e.td:this)[e.fg]};else if(e.fs)r=function(t){(e.is?e.td:this)[e.fs]=t};else{if(r=e.def||(e.is||e.sm?e.td[e.sn]:t[e.sn]),e.tpc){if(!n||n.length!==e.tpc)throw new System.ArgumentException("Wrong number of type arguments");i=r,r=function(){return i.apply(this,n.concat(Array.prototype.slice.call(arguments)))}}else if(n&&n.length)throw new System.ArgumentException("Cannot specify type arguments for non-generic method");e.exp&&(s=r,r=function(){return s.apply(this,Array.prototype.slice.call(arguments,0,arguments.length-1).concat(arguments[arguments.length-1]))}),e.sm&&(o=r,r=function(){return o.apply(null,[this].concat(Array.prototype.slice.call(arguments)))})}return Bridge.fn.bind(t,r)},invokeCI:function(e,t){return e.exp&&(t=t.slice(0,t.length-1).concat(t[t.length-1])),e.def?e.def.apply(null,t):e.sm?e.td[e.sn].apply(null,t):Bridge.Reflection.applyConstructor(e.sn?e.td[e.sn]:e.td,t)},fieldAccess:function(e,t){if(e.is&&t)throw new System.ArgumentException("Cannot specify target for static field");if(!e.is&&!t)throw new System.ArgumentException("Must specify target for instance field");if(t=e.is?e.td:t,3!==arguments.length)return t[e.sn];t[e.sn]=arguments[2]}},Bridge.setMetadata=Bridge.Reflection.setMetadata,System.Reflection.ConstructorInfo={$is:function(e){return null!=e&&1===e.t}},System.Reflection.EventInfo={$is:function(e){return null!=e&&2===e.t}},System.Reflection.FieldInfo={$is:function(e){return null!=e&&4===e.t}},System.Reflection.MethodBase={$is:function(e){return null!=e&&(1===e.t||8===e.t)}},System.Reflection.MethodInfo={$is:function(e){return null!=e&&8===e.t}},System.Reflection.PropertyInfo={$is:function(e){return null!=e&&16===e.t}},System.AppDomain={getAssemblies:function(){return Object.keys(System.Reflection.Assembly.assemblies).map((function(e){return System.Reflection.Assembly.assemblies[e]}))}},Bridge.define("System.IFormattable",{$kind:"interface",statics:{$is:function(e){return!(!Bridge.isNumber(e)&&!Bridge.isDate(e))||Bridge.is(e,System.IFormattable,!0)}}}),Bridge.define("System.IComparable",{$kind:"interface",statics:{$is:function(e){return!!(Bridge.isNumber(e)||Bridge.isDate(e)||Bridge.isBoolean(e)||Bridge.isString(e))||Bridge.is(e,System.IComparable,!0)}}}),Bridge.define("System.IFormatProvider",{$kind:"interface"}),Bridge.define("System.ICloneable",{$kind:"interface"}),Bridge.define("System.IComparable$1",(function(e){return{$kind:"interface",statics:{$is:function(t){return!!(Bridge.isNumber(t)&&e.$number&&e.$is(t)||Bridge.isDate(t)&&e===Date||Bridge.isBoolean(t)&&e===Boolean||Bridge.isString(t)&&e===String)||Bridge.is(t,System.IComparable$1(e),!0)}}}})),Bridge.define("System.IEquatable$1",(function(e){return{$kind:"interface",statics:{$is:function(t){return!!(Bridge.isNumber(t)&&e.$number&&e.$is(t)||Bridge.isDate(t)&&e===Date||Bridge.isBoolean(t)&&e===Boolean||Bridge.isString(t)&&e===String)||Bridge.is(t,System.IEquatable$1(e),!0)}}}})),Bridge.define("Bridge.IPromise",{$kind:"interface"}),Bridge.define("System.IDisposable",{$kind:"interface"}),s={hasValue:Bridge.hasValue,getValue:function(e){if(!Bridge.hasValue(e))throw new System.InvalidOperationException("Nullable instance doesn't have a value.");return e},getValueOrDefault:function(e,t){return Bridge.hasValue(e)?e:t},add:function(e,t){return Bridge.hasValue$1(e,t)?e+t:null},band:function(e,t){return Bridge.hasValue$1(e,t)?e&t:null},bor:function(e,t){return Bridge.hasValue$1(e,t)?e|t:null},and:function(e,t){return!0===e&&!0===t||!1!==e&&!1!==t&&null},or:function(e,t){return!0===e||!0===t||(!1!==e||!1!==t)&&null},div:function(e,t){return Bridge.hasValue$1(e,t)?e/t:null},eq:function(e,t){return Bridge.hasValue(e)?e===t:!Bridge.hasValue(t)},equals:function(e,t,n){return Bridge.hasValue(e)?n?n(e,t):Bridge.equals(e,t):!Bridge.hasValue(t)},toString:function(e,t){return Bridge.hasValue(e)?t?t(e):e.toString():""},getHashCode:function(e,t){return Bridge.hasValue(e)?t?t(e):Bridge.getHashCode(e):0},xor:function(e,t){return Bridge.hasValue$1(e,t)?e^t:null},gt:function(e,t){return Bridge.hasValue$1(e,t)&&e>t},gte:function(e,t){return Bridge.hasValue$1(e,t)&&e>=t},neq:function(e,t){return Bridge.hasValue(e)?e!==t:Bridge.hasValue(t)},lt:function(e,t){return Bridge.hasValue$1(e,t)&&e<t},lte:function(e,t){return Bridge.hasValue$1(e,t)&&e<=t},mod:function(e,t){return Bridge.hasValue$1(e,t)?e%t:null},mul:function(e,t){return Bridge.hasValue$1(e,t)?e*t:null},sl:function(e,t){return Bridge.hasValue$1(e,t)?e<<t:null},sr:function(e,t){return Bridge.hasValue$1(e,t)?e>>t:null},srr:function(e,t){return Bridge.hasValue$1(e,t)?e>>>t:null},sub:function(e,t){return Bridge.hasValue$1(e,t)?e-t:null},bnot:function(e){return Bridge.hasValue(e)?~e:null},neg:function(e){return Bridge.hasValue(e)?-e:null},not:function(e){return Bridge.hasValue(e)?!e:null},pos:function(e){return Bridge.hasValue(e)?+e:null},lift:function(){for(var e=1;e<arguments.length;e++)if(!Bridge.hasValue(arguments[e]))return null;return null==arguments[0]?null:null==arguments[0].apply?arguments[0]:arguments[0].apply(null,Array.prototype.slice.call(arguments,1))},lift1:function(e,t){return Bridge.hasValue(t)?"function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)):null},lift2:function(e,t,n){return Bridge.hasValue$1(t,n)?"function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)):null},liftcmp:function(e,t,n){return!!Bridge.hasValue$1(t,n)&&("function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)))},lifteq:function(e,t,n){var r=Bridge.hasValue(t),i=Bridge.hasValue(n);return!r&&!i||r&&i&&("function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)))},liftne:function(e,t,n){var r=Bridge.hasValue(t),i=Bridge.hasValue(n);return r!==i||r&&("function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)))}},System.Nullable=s,Bridge.define("System.Nullable$1",(function(e){return{$kind:"struct",statics:{getDefaultValue:function(){return null},$is:function(t){return Bridge.is(t,e)}}}})),Bridge.define("System.Char",{inherits:[System.IComparable,System.IFormattable],$kind:"struct",statics:{min:0,max:65535,$is:function(e){return"number"==typeof e&&Math.round(e,0)==e&&e>=System.Char.min&&e<=System.Char.max},getDefaultValue:function(){return 0},parse:function(e){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("s");if(1!==e.length)throw new System.FormatException;return e.charCodeAt(0)},tryParse:function(e,t){var n=e&&1===e.length;return t.v=n?e.charCodeAt(0):0,n},format:function(e,t,n){return Bridge.Int.format(e,t,n)},charCodeAt:function(e,t){if(null==e)throw new System.ArgumentNullException;if(1!=e.length)throw new System.FormatException("String must be exactly one character long");return e.charCodeAt(t)},isWhiteSpace:function(e){return!/[^\s\x09-\x0D\x85\xA0]/.test(e)},isDigit:function(e){return e<256?e>=48&&e<=57:new RegExp("[0-90-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9]").test(String.fromCharCode(e))},isLetter:function(e){return e<256?e>=65&&e<=90||e>=97&&e<=122:new RegExp("[A-Za-za-zµß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᴫᵫ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆῇῐ-ΐῖῗῠ-ῧῲ-ῴῶῷℊℎℏℓℯℴℹℼℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥⱦⱨⱪⱬⱱⱳⱴⱶ-ⱻⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟺff-stﬓ-ﬗa-zA-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉ-ƋƎ-ƑƓƔƖ-ƘƜƝƟƠƢƤƦƧƩƬƮƯƱ-ƳƵƷƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-ZDžLjNjDzᾈ-ᾏᾘ-ᾟᾨ-ᾯᾼῌῼʰ-ˁˆ-ˑˠ-ˤˬˮʹͺՙـۥۦߴߵߺࠚࠤࠨॱๆໆჼៗᡃᪧᱸ-ᱽᴬ-ᵪᵸᶛ-ᶿⁱⁿₐ-ₜⱼⱽⵯⸯ々〱-〵〻ゝゞー-ヾꀕꓸ-ꓽꘌꙿꜗ-ꜟꝰꞈꟸꟹꧏꩰꫝꫳꫴー゙゚ªºƻǀ-ǃʔא-תװ-ײؠ-ؿف-يٮٯٱ-ۓەۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪࠀ-ࠕࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॲ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๅກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎა-ჺჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៜᠠ-ᡂᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱷᳩ-ᳬᳮ-ᳱᳵᳶℵ-ℸⴰ-ⵧⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ〆〼ぁ-ゖゟァ-ヺヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꀔꀖ-ꒌꓐ-ꓷꔀ-ꘋꘐ-ꘟꘪꘫꙮꚠ-ꛥꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩯꩱ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛꫜꫠ-ꫪꫲꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎יִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼヲ-ッア-ンᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]").test(String.fromCharCode(e))},isHighSurrogate:function(e){return new RegExp("[\ud800-\udbff]").test(String.fromCharCode(e))},isLowSurrogate:function(e){return new RegExp("[\udc00-\udfff]").test(String.fromCharCode(e))},isSurrogate:function(e){return new RegExp("[\ud800-\udfff]").test(String.fromCharCode(e))},isNull:function(e){return new RegExp("\0").test(String.fromCharCode(e))},isSymbol:function(e){return e<256?-1!=[36,43,60,61,62,94,96,124,126,162,163,164,165,166,167,168,169,172,174,175,176,177,180,182,184,215,247].indexOf(e):new RegExp("[₠-⃐-℀-⅏⅐-←-⇿∀-⋿⌀-⏿■-◿☀-⛿✀-➿⟀-⟯⟰-⟿⠀-⣿⤀-⥿⦀-⧿⨀-⫿⬀-⯿]").test(String.fromCharCode(e))},isSeparator:function(e){return e<256?32==e||160==e:new RegExp("[\u2028\u2029 - ]").test(String.fromCharCode(e))},isPunctuation:function(e){return e<256?-1!=[33,34,35,37,38,39,40,41,42,44,45,46,47,58,59,63,64,91,92,93,95,123,125,161,171,173,183,187,191].indexOf(e):new RegExp("[!-#%-*,-/:;?@[-]_{}¡§«¶·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔༺-༽྅࿐-࿔࿙࿚၊-၏჻፠-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰-⸻、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・-֊־᐀᠆‐-―⸗⸚⸺⸻〜〰゠︱︲﹘﹣-([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝﴾︗︵︷︹︻︽︿﹁﹃﹇﹙﹛﹝([{⦅「)]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶︸︺︼︾﹀﹂﹄﹈﹚﹜﹞)]}⦆」«‘‛“‟‹⸂⸄⸉⸌⸜⸠»’”›⸃⸅⸊⸍⸝⸡_‿⁀⁔︳︴﹍-﹏_!-#%-'*,./:;?@\\¡§¶·¿;·՚-՟։׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔྅࿐-࿔࿙࿚၊-၏჻፠-፨᙭᙮᛫-᛭᜵᜶។-៖៘-៚᠀-᠅᠇-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‖‗†-‧‰-‸※-‾⁁-⁃⁇-⁑⁓⁕-⁞⳹-⳼⳾⳿⵰⸀⸁⸆-⸈⸋⸎-⸖⸘⸙⸛⸞⸟⸪-⸮⸰-⸹、-〃〽・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫︐-︖︙︰﹅﹆﹉-﹌﹐-﹒﹔-﹗﹟-﹡﹨﹪﹫!-#%-'*,./:;?@\。、・]").test(String.fromCharCode(e))},isNumber:function(e){return e<256?-1!=[48,49,50,51,52,53,54,55,56,57,178,179,185,188,189,190].indexOf(e):new RegExp("[0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-90-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9ᛮ-ᛰⅠ-ↂↅ-ↈ〇〡-〩〸-〺ꛦ-ꛯ²³¹¼-¾৴-৹୲-୷௰-௲౸-౾൰-൵༪-༳፩-፼៰-៹᧚⁰⁴-⁹₀-₉⅐-⅟↉①-⒛⓪-⓿❶-➓⳽㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꠰-꠵]").test(String.fromCharCode(e))},isControl:function(e){return e<256?e>=0&&e<=31||e>=127&&e<=159:new RegExp("[\0--]").test(String.fromCharCode(e))}}}),Bridge.Class.addExtend(System.Char,[System.IComparable$1(System.Char),System.IEquatable$1(System.Char)]),Bridge.define("System.FormattableString",{inherits:[System.IFormattable],statics:{invariant:function(e){return e.toString$1(System.Globalization.CultureInfo.invariantCulture)}},toString:function(){return this.toString$1(System.Globalization.CultureInfo.getCurrentCulture())},System$IFormattable$format:function(e,t){return this.toString$1(t)}}),Bridge.define("System.FormattableStringImpl",{inherits:[System.FormattableString],args:null,format:null,ctor:function(e,t){void 0===t&&(t=[]),this.$initialize(),System.FormattableString.ctor.call(this),this.format=e,this.args=t},getArgumentCount:function(){return this.args.length},getFormat:function(){return this.format},getArgument:function(e){return this.args[e]},getArguments:function(){return this.args},toString$1:function(e){return System.String.formatProvider.apply(System.String,[e,this.format].concat(this.args))}}),Bridge.define("System.Runtime.CompilerServices.FormattableStringFactory",{statics:{create:function(e,t){return void 0===t&&(t=[]),new System.FormattableStringImpl(e,t)}}}),Bridge.define("System.Exception",{ctor:function(e,t){this.$initialize(),this.message=e||"Exception of type '"+Bridge.getTypeName(this)+"' was thrown.",this.innerException=t||null,this.errorStack=new Error,this.data=new(System.Collections.Generic.Dictionary$2(Object,Object))},getMessage:function(){return this.message},getInnerException:function(){return this.innerException},getStackTrace:function(){return this.errorStack.stack},getData:function(){return this.data},toString:function(){return this.getMessage()},statics:{create:function(e){return Bridge.is(e,System.Exception)?e:e instanceof TypeError?new System.NullReferenceException(e.message,new Bridge.ErrorException(e)):e instanceof RangeError?new System.ArgumentOutOfRangeException(null,e.message,new Bridge.ErrorException(e)):e instanceof Error?new Bridge.ErrorException(e):new System.Exception(e?e.toString():null)}}}),Bridge.define("System.SystemException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"System error.",t)}}),Bridge.define("System.OutOfMemoryException",{inherits:[System.SystemException],ctor:function(e,t){this.$initialize(),e||(e="Insufficient memory to continue the execution of the program."),System.SystemException.ctor.call(this,e,t)}}),Bridge.define("System.IndexOutOfRangeException",{inherits:[System.SystemException],ctor:function(e,t){this.$initialize(),e||(e="Index was outside the bounds of the array."),System.SystemException.ctor.call(this,e,t)}}),Bridge.define("System.TimeoutException",{inherits:[System.SystemException],ctor:function(e,t){this.$initialize(),e||(e="The operation has timed out."),System.SystemException.ctor.call(this,e,t)}}),Bridge.define("System.RegexMatchTimeoutException",{inherits:[System.TimeoutException],_regexInput:"",_regexPattern:"",_matchTimeout:null,config:{init:function(){this._matchTimeout=System.TimeSpan.fromTicks(-1)}},ctor:function(){this.$initialize(),System.TimeoutException.ctor.call(this)},$ctor1:function(e){this.$initialize(),System.TimeoutException.ctor.call(this,e)},$ctor2:function(e,t){this.$initialize(),System.TimeoutException.ctor.call(this,e,t)},$ctor3:function(e,t,n){this.$initialize(),this._regexInput=e,this._regexPattern=t,this._matchTimeout=n,this.$ctor1("The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors.")},getPattern:function(){return this._regexPattern},getInput:function(){return this._regexInput},getMatchTimeout:function(){return this._matchTimeout}}),Bridge.define("Bridge.ErrorException",{inherits:[System.Exception],ctor:function(e){this.$initialize(),System.Exception.ctor.call(this,e.message),this.errorStack=e,this.error=e},getError:function(){return this.error}}),Bridge.define("System.ArgumentException",{inherits:[System.Exception],ctor:function(e,t,n){this.$initialize(),System.Exception.ctor.call(this,e||"Value does not fall within the expected range.",n),this.paramName=t||null},getParamName:function(){return this.paramName}}),Bridge.define("System.ArgumentNullException",{inherits:[System.ArgumentException],ctor:function(e,t,n){this.$initialize(),t||(t="Value cannot be null.",e&&(t+="\nParameter name: "+e)),System.ArgumentException.ctor.call(this,t,e,n)}}),Bridge.define("System.ArgumentOutOfRangeException",{inherits:[System.ArgumentException],ctor:function(e,t,n,r){this.$initialize(),t||(t="Value is out of range.",e&&(t+="\nParameter name: "+e)),System.ArgumentException.ctor.call(this,t,e,n),this.actualValue=r||null},getActualValue:function(){return this.actualValue}}),Bridge.define("System.Globalization.CultureNotFoundException",{inherits:[System.ArgumentException],ctor:function(e,t,n,r,i){this.$initialize(),n||(n="Culture is not supported.",e&&(n+="\nParameter name: "+e),t&&(n+="\n"+t+" is an invalid culture identifier.")),System.ArgumentException.ctor.call(this,n,e,r),this.invalidCultureName=t||null,this.invalidCultureId=i||null},getInvalidCultureName:function(){return this.invalidCultureName},getInvalidCultureId:function(){return this.invalidCultureId}}),Bridge.define("System.Collections.Generic.KeyNotFoundException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Key not found.",t)}}),Bridge.define("System.ArithmeticException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Overflow or underflow in the arithmetic operation.",t)}}),Bridge.define("System.DivideByZeroException",{inherits:[System.ArithmeticException],ctor:function(e,t){this.$initialize(),System.ArithmeticException.ctor.call(this,e||"Division by 0.",t)}}),Bridge.define("System.OverflowException",{inherits:[System.ArithmeticException],ctor:function(e,t){this.$initialize(),System.ArithmeticException.ctor.call(this,e||"Arithmetic operation resulted in an overflow.",t)}}),Bridge.define("System.FormatException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Invalid format.",t)}}),Bridge.define("System.InvalidCastException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"The cast is not valid.",t)}}),Bridge.define("System.InvalidOperationException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Operation is not valid due to the current state of the object.",t)}}),Bridge.define("System.NotImplementedException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"The method or operation is not implemented.",t)}}),Bridge.define("System.NotSupportedException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Specified method is not supported.",t)}}),Bridge.define("System.NullReferenceException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Object is null.",t)}}),Bridge.define("System.RankException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Attempted to operate on an array with the incorrect number of dimensions.",t)}}),Bridge.define("Bridge.PromiseException",{inherits:[System.Exception],ctor:function(e,t,n){this.$initialize(),this.arguments=System.Array.clone(e),null==t&&(t="Promise exception: [",t+=this.arguments.map((function(e){return null==e?"null":e.toString()})).join(", "),t+="]"),System.Exception.ctor.call(this,t,n)},getArguments:function(){return this.arguments}}),Bridge.define("System.OperationCanceledException",{inherits:[System.Exception],ctor:function(e,t,n){this.$initialize(),System.Exception.ctor.call(this,e||"Operation was canceled.",n),this.cancellationToken=t||System.Threading.CancellationToken.none}}),Bridge.define("System.Threading.Tasks.TaskCanceledException",{inherits:[System.OperationCanceledException],ctor:function(e,t,n){this.$initialize(),System.OperationCanceledException.ctor.call(this,e||"A task was canceled.",null,n),this.task=t||null}}),Bridge.define("System.AggregateException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),this.innerExceptions=new(System.Collections.ObjectModel.ReadOnlyCollection$1(System.Exception))(Bridge.hasValue(t)?Bridge.toArray(t):[]),System.Exception.ctor.call(this,e||"One or more errors occurred.",this.innerExceptions.items.length?this.innerExceptions.items[0]:null)},handle:function(e){var t,n,r;if(!Bridge.hasValue(e))throw new System.ArgumentNullException("predicate");for(t=this.innerExceptions.getCount(),n=[],r=0;r<t;r++)e(this.innerExceptions.get(r))||n.push(this.innerExceptions.get(r));if(n.length>0)throw new System.AggregateException(this.getMessage(),n)},flatten:function(){var e,t,n,r,i,s=new(System.Collections.Generic.List$1(System.Exception)),o=new(System.Collections.Generic.List$1(System.AggregateException));for(o.add(this),e=0;o.getCount()>e;)for(t=o.getItem(e++).innerExceptions,n=0;n<t.getCount();n++)r=t.get(n),Bridge.hasValue(r)&&(i=Bridge.as(r,System.AggregateException),Bridge.hasValue(i)?o.add(i):s.add(r));return new System.AggregateException(this.getMessage(),s)}}),Bridge.define("System.Reflection.AmbiguousMatchException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e||"Ambiguous match.",t)}}),Bridge.define("System.Globalization.DateTimeFormatInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:{getFormat:"System$IFormatProvider$getFormat"}},statics:{$allStandardFormats:{d:"shortDatePattern",D:"longDatePattern",f:"longDatePattern shortTimePattern",F:"longDatePattern longTimePattern",g:"shortDatePattern shortTimePattern",G:"shortDatePattern longTimePattern",m:"monthDayPattern",M:"monthDayPattern",o:"roundtripFormat",O:"roundtripFormat",r:"rfc1123",R:"rfc1123",s:"sortableDateTimePattern",S:"sortableDateTimePattern1",t:"shortTimePattern",T:"longTimePattern",u:"universalSortableDateTimePattern",U:"longDatePattern longTimePattern",y:"yearMonthPattern",Y:"yearMonthPattern"},ctor:function(){this.invariantInfo=Bridge.merge(new System.Globalization.DateTimeFormatInfo,{abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbreviatedMonthGenitiveNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],amDesignator:"AM",dateSeparator:"/",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],firstDayOfWeek:0,fullDateTimePattern:"dddd, dd MMMM yyyy HH:mm:ss",longDatePattern:"dddd, dd MMMM yyyy",longTimePattern:"HH:mm:ss",monthDayPattern:"MMMM dd",monthGenitiveNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],pmDesignator:"PM",rfc1123:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",shortDatePattern:"MM/dd/yyyy",shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],shortTimePattern:"HH:mm",sortableDateTimePattern:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",sortableDateTimePattern1:"yyyy'-'MM'-'dd",timeSeparator:":",universalSortableDateTimePattern:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",yearMonthPattern:"yyyy MMMM",roundtripFormat:"yyyy'-'MM'-'dd'T'HH':'mm':'ss.uzzz"})}},getFormat:function(e){return e===System.Globalization.DateTimeFormatInfo?this:null},getAbbreviatedDayName:function(e){if(e<0||e>6)throw new System.ArgumentOutOfRangeException("dayofweek");return this.abbreviatedDayNames[e]},getAbbreviatedMonthName:function(e){if(e<1||e>13)throw new System.ArgumentOutOfRangeException("month");return this.abbreviatedMonthNames[e-1]},getAllDateTimePatterns:function(e,t){var n,r,i,s,o=System.Globalization.DateTimeFormatInfo.$allStandardFormats,a=[];if(e){if(!o[e]){if(t)return null;throw new System.ArgumentException(null,"format")}(n={})[e]=o[e]}else n=o;for(o in n){for(r=n[o].split(" "),i="",s=0;s<r.length;s++)i=(0===s?"":i+" ")+this[r[s]];a.push(i)}return a},getDayName:function(e){if(e<0||e>6)throw new System.ArgumentOutOfRangeException("dayofweek");return this.dayNames[e]},getMonthName:function(e){if(e<1||e>13)throw new System.ArgumentOutOfRangeException("month");return this.monthNames[e-1]},getShortestDayName:function(e){if(e<0||e>6)throw new System.ArgumentOutOfRangeException("dayOfWeek");return this.shortestDayNames[e]},clone:function(){return Bridge.copy(new System.Globalization.DateTimeFormatInfo,this,["abbreviatedDayNames","abbreviatedMonthGenitiveNames","abbreviatedMonthNames","amDesignator","dateSeparator","dayNames","firstDayOfWeek","fullDateTimePattern","longDatePattern","longTimePattern","monthDayPattern","monthGenitiveNames","monthNames","pmDesignator","rfc1123","shortDatePattern","shortestDayNames","shortTimePattern","sortableDateTimePattern","timeSeparator","universalSortableDateTimePattern","yearMonthPattern","roundtripFormat"])}}),Bridge.define("System.Globalization.NumberFormatInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:{getFormat:"System$IFormatProvider$getFormat"}},statics:{ctor:function(){this.numberNegativePatterns=["(n)","-n","- n","n-","n -"],this.currencyNegativePatterns=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],this.currencyPositivePatterns=["$n","n$","$ n","n $"],this.percentNegativePatterns=["-n %","-n%","-%n","%-n","%n-","n-%","n%-","-% n","n %-","% n-","% -n","n- %"],this.percentPositivePatterns=["n %","n%","%n","% n"],this.invariantInfo=Bridge.merge(new System.Globalization.NumberFormatInfo,{nanSymbol:"NaN",negativeSign:"-",positiveSign:"+",negativeInfinitySymbol:"-Infinity",positiveInfinitySymbol:"Infinity",percentSymbol:"%",percentGroupSizes:[3],percentDecimalDigits:2,percentDecimalSeparator:".",percentGroupSeparator:",",percentPositivePattern:0,percentNegativePattern:0,currencySymbol:"¤",currencyGroupSizes:[3],currencyDecimalDigits:2,currencyDecimalSeparator:".",currencyGroupSeparator:",",currencyNegativePattern:0,currencyPositivePattern:0,numberGroupSizes:[3],numberDecimalDigits:2,numberDecimalSeparator:".",numberGroupSeparator:",",numberNegativePattern:1})}},getFormat:function(e){return e===System.Globalization.NumberFormatInfo?this:null},clone:function(){return Bridge.copy(new System.Globalization.NumberFormatInfo,this,["nanSymbol","negativeSign","positiveSign","negativeInfinitySymbol","positiveInfinitySymbol","percentSymbol","percentGroupSizes","percentDecimalDigits","percentDecimalSeparator","percentGroupSeparator","percentPositivePattern","percentNegativePattern","currencySymbol","currencyGroupSizes","currencyDecimalDigits","currencyDecimalSeparator","currencyGroupSeparator","currencyNegativePattern","currencyPositivePattern","numberGroupSizes","numberDecimalDigits","numberDecimalSeparator","numberGroupSeparator","numberNegativePattern"])}}),Bridge.define("System.Globalization.CultureInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:{getFormat:"System$IFormatProvider$getFormat"}},$entryPoint:!0,statics:{ctor:function(){this.cultures=this.cultures||{},this.invariantCulture=Bridge.merge(new System.Globalization.CultureInfo("iv",!0),{englishName:"Invariant Language (Invariant Country)",nativeName:"Invariant Language (Invariant Country)",numberFormat:System.Globalization.NumberFormatInfo.invariantInfo,dateTimeFormat:System.Globalization.DateTimeFormatInfo.invariantInfo}),this.setCurrentCulture(System.Globalization.CultureInfo.invariantCulture)},getCurrentCulture:function(){return this.currentCulture},setCurrentCulture:function(e){this.currentCulture=e,System.Globalization.DateTimeFormatInfo.currentInfo=e.dateTimeFormat,System.Globalization.NumberFormatInfo.currentInfo=e.numberFormat},getCultureInfo:function(e){if(!e)throw new System.ArgumentNullException("name");return this.cultures[e]},getCultures:function(){for(var e=Bridge.getPropertyNames(this.cultures),t=[],n=0;n<e.length;n++)t.push(this.cultures[e[n]]);return t}},ctor:function(e,t){if(this.$initialize(),this.name=e,System.Globalization.CultureInfo.cultures||(System.Globalization.CultureInfo.cultures={}),System.Globalization.CultureInfo.cultures[e])Bridge.copy(this,System.Globalization.CultureInfo.cultures[e],["englishName","nativeName","numberFormat","dateTimeFormat"]);else{if(!t)throw new System.Globalization.CultureNotFoundException("name",e);System.Globalization.CultureInfo.cultures[e]=this}},getFormat:function(e){switch(e){case System.Globalization.NumberFormatInfo:return this.numberFormat;case System.Globalization.DateTimeFormatInfo:return this.dateTimeFormat;default:return null}},clone:function(){return new System.Globalization.CultureInfo(this.name)}}),Bridge.Math={divRem:function(e,t,n){var r=e%t;return n.v=r,(e-r)/t},round:function(e,t,n){var r,i,s=Math.pow(10,t||0);return(e*=s)%1==.5*(r=e>0|-(e<0))?((i=Math.floor(e))+(4===n?r>0:i%2*r))/s:Math.round(e)/s},log10:Math.log10||function(e){return Math.log(e)/Math.LN10},logWithBase:function(e,t){return isNaN(e)?e:isNaN(t)?t:1===t?NaN:1===e||0!==t&&t!==Number.POSITIVE_INFINITY?Bridge.Math.log10(e)/Bridge.Math.log10(t):NaN},log:function(e){return 0===e?Number.NEGATIVE_INFINITY:e<0||isNaN(e)?NaN:e===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:e===Number.NEGATIVE_INFINITY?NaN:Math.log(e)},sinh:Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},cosh:Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},tanh:Math.tanh||function(e){if(e===1/0)return 1;if(e===-1/0)return-1;var t=Math.exp(2*e);return(t-1)/(t+1)}},o={trueString:"True",falseString:"False",is:function(e,t){return t===System.IComparable||t===System.IEquatable$1(Boolean)||t===System.IComparable$1(Boolean)},$is:function(e){return"boolean"==typeof e},getDefaultValue:function(){return!1},toString:function(e){return e?System.Boolean.trueString:System.Boolean.falseString},parse:function(e){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("value");var t={v:!1};if(!System.Boolean.tryParse(e,t))throw new System.FormatException("Bad format for Boolean value");return t.v},tryParse:function(e,t){if(t.v=!1,!Bridge.hasValue(e))return!1;if(System.String.equals(System.Boolean.trueString,e,5))return t.v=!0,!0;if(System.String.equals(System.Boolean.falseString,e,5))return t.v=!1,!0;for(var n=0,r=e.length-1;n<e.length&&(System.Char.isWhiteSpace(e[n])||System.Char.isNull(e.charCodeAt(n)));)n++;for(;r>=n&&(System.Char.isWhiteSpace(e[r])||System.Char.isNull(e.charCodeAt(r)));)r--;return e=e.substr(n,r-n+1),System.String.equals(System.Boolean.trueString,e,5)?(t.v=!0,!0):!!System.String.equals(System.Boolean.falseString,e,5)&&(t.v=!1,!0)}},System.Boolean=o,function(){var e=function(e,t,n,r){var i=Bridge.define(e,{inherits:[System.IComparable,System.IFormattable],statics:{$number:!0,min:t,max:n,precision:r,$is:function(e){return"number"==typeof e&&Math.floor(e,0)===e&&e>=t&&e<=n},getDefaultValue:function(){return 0},parse:function(e,r){return Bridge.Int.parseInt(e,t,n,r)},tryParse:function(e,r,i){return Bridge.Int.tryParseInt(e,r,t,n,i)},format:function(e,t,n){return Bridge.Int.format(e,t,n,i)}}});i.$kind="",Bridge.Class.addExtend(i,[System.IComparable$1(i),System.IEquatable$1(i)])};e("System.Byte",0,255,3),e("System.SByte",-128,127,3),e("System.Int16",-32768,32767,5),e("System.UInt16",0,65535,5),e("System.Int32",-2147483648,2147483647,10),e("System.UInt32",0,4294967295,10)}(),Bridge.define("Bridge.Int",{inherits:[System.IComparable,System.IFormattable],statics:{$number:!0,$is:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e,0)===e},getDefaultValue:function(){return 0},format:function(e,t,n,r){var i,s,o,a,u,l,c,h,m,g=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),f=g.numberDecimalSeparator,p=(g.numberGroupSeparator,e instanceof System.Decimal),d=e instanceof System.Int64||e instanceof System.UInt64,y=p||d?!e.isZero()&&e.isNegative():e<0;if(!d&&(p?!e.isFinite():!isFinite(e)))return Number.NEGATIVE_INFINITY===e||p&&y?g.negativeInfinitySymbol:isNaN(e)?g.nanSymbol:g.positiveInfinitySymbol;if(t||(t="G"),i=t.match(/^([a-zA-Z])(\d*)$/))switch(a=i[1].toUpperCase(),s=(s=parseInt(i[2],10))>15?15:s,a){case"D":return this.defaultFormat(e,isNaN(s)?1:s,0,0,g,!0);case"F":case"N":return isNaN(s)&&(s=g.numberDecimalDigits),this.defaultFormat(e,1,s,s,g,"F"===a);case"G":case"E":for(var S,x,w=0,v=p||d?d&&e.eq(System.Int64.MinValue)?System.Int64(e.value.toUnsigned()):e.abs():Math.abs(e),b=i[1],I=3;p||d?v.gte(10):v>=10;)p||d?v=v.div(10):v/=10,w++;for(;p||d?v.ne(0)&&v.lt(1):0!==v&&v<1;)p||d?v=v.mul(10):v*=10,w--;if("G"===a){if((u=isNaN(s))&&(s=p?29:d?e instanceof System.Int64?19:20:r&&r.precision?r.precision:15),w>-5&&w<s||p&&u)return S=0,x=s-(w>0?w+1:1),this.defaultFormat(e,1,S,x,g,!0);b="G"===b?"E":"e",I=2,S=0,x=(s||15)-1}else S=x=isNaN(s)?6:s;return w>=0?b+=g.positiveSign:(b+=g.negativeSign,w=-w),y&&(p||d?v=v.mul(-1):v*=-1),this.defaultFormat(v,1,S,x,g)+b+this.defaultFormat(w,I,0,0,g,!0);case"P":return isNaN(s)&&(s=g.percentDecimalDigits),this.defaultFormat(100*e,1,s,s,g,!1,"percent");case"X":for(l=p?e.round().value.toHex().substr(2):d?e.toString(16):Math.round(e).toString(16),"X"===i[1]&&(l=l.toUpperCase()),s-=l.length;s-- >0;)l="0"+l;return l;case"C":return isNaN(s)&&(s=g.currencyDecimalDigits),this.defaultFormat(e,1,s,s,g,!1,"currency");case"R":return c=p||d?e.toString():""+e,"."!==f&&(c=c.replace(".",f)),c.replace("e","E")}if(-1!==t.indexOf(",.")||System.String.endsWith(t,",")){for(h=0,-1===(m=t.indexOf(",."))&&(m=t.length-1);m>-1&&","===t.charAt(m);)h++,m--;p||d?e=e.div(Math.pow(1e3,h)):e/=Math.pow(1e3,h)}return-1!==t.indexOf("%")&&(p||d?e=e.mul(100):e*=100),-1!==t.indexOf("‰")&&(p||d?e=e.mul(1e3):e*=1e3),o=t.split(";"),(p||d?e.lt(0):e<0)&&o.length>1?(p||d?e=e.mul(-1):e*=-1,t=o[1]):t=o[(p||d?e.ne(0):!e)&&o.length>2?2:0],this.customFormat(e,t,g,!t.match(/^[^\.]*[0#],[0#]/))},defaultFormat:function(e,t,n,r,i,s,o){o=o||"number";var a,u,l,c,h,m,g,f,p,d,y,S,x=(i||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),w=x[o+"GroupSizes"],v="",b=e instanceof System.Decimal,I=e instanceof System.Int64||e instanceof System.UInt64,C=b||I?!e.isZero()&&e.isNegative():e<0;if(Math.pow(10,r),S=(a=b?e.abs().toDecimalPlaces(r).toFixed():I?e.eq(System.Int64.MinValue)?e.value.toUnsigned().toString():e.abs().toString():""+ +Math.abs(e).toFixed(r)).split("").every((function(e){return"0"===e||"."===e})),(u=a.indexOf("."))>0&&(h=x[o+"DecimalSeparator"]+a.substr(u+1),a=a.substr(0,u)),a.length<t&&(a=Array(t-a.length+1).join("0")+a),h?(h.length-1<n&&(h+=Array(n-h.length+2).join("0")),0===r?h=null:h.length-1>r&&(h=h.substr(0,r+1))):n>0&&(h=x[o+"DecimalSeparator"]+Array(n+1).join("0")),c=w[l=0],a.length<c)v=a,h&&(v+=h);else{for(m=a.length,g=!1,y=s?"":x[o+"GroupSeparator"];!g&&((f=m-(p=c))<0&&(c+=f,p+=f,f=0,g=!0),p);)d=a.substr(f,p),v=v.length?d+y+v:d,m-=p,l<w.length-1&&(c=w[++l]);h&&(v+=h)}return C&&!S?System.Globalization.NumberFormatInfo[o+"NegativePatterns"][x[o+"NegativePattern"]].replace("-",x.negativeSign).replace("%",x.percentSymbol).replace("$",x.currencySymbol).replace("n",v):System.Globalization.NumberFormatInfo[o+"PositivePatterns"]?System.Globalization.NumberFormatInfo[o+"PositivePatterns"][x[o+"PositivePattern"]].replace("%",x.percentSymbol).replace("$",x.currencySymbol).replace("n",v):v},customFormat:function(e,t,n,r){var i,s,o,a,u,l,c,h,m,g,f=0,p=-1,d=0,y=-1,S=0,x=1,w=!1,v="",b=!1,I=!1,C=!1,E=e instanceof System.Decimal,$=e instanceof System.Int64||e instanceof System.UInt64,B=E||$?!e.isZero()&&e.isNegative():e<0;for(m="number",-1!==t.indexOf("%")?m="percent":-1!==t.indexOf("$")&&(m="currency"),o=0;o<t.length;o++)if("'"===(s=t.charAt(o))||'"'===s){if((o=t.indexOf(s,o+1))<0)break}else"\\"===s?o++:(("0"===s||"#"===s)&&(d+=S,"0"===s&&(S?y=d:p<0&&(p=f)),f+=!S),S=S||"."===s);for(p=p<0?1:f-p,B&&(w=!0),l=Math.pow(10,d),h=(e=E?System.Decimal.round(e.abs().mul(l),4).div(l).toString():$?(e.eq(System.Int64.MinValue)?System.Int64(e.value.toUnsigned()):e.abs()).mul(l).div(l).toString():""+Math.round(Math.abs(e)*l)/l).split("").every((function(e){return"0"===e||"."===e})),o=(i=(c=e.indexOf("."))<0?e.length:c)-f,g={groupIndex:Math.max(i,p),sep:r?"":n[m+"GroupSeparator"]},1===i&&"0"===e.charAt(0)&&(b=!0),a=0;a<t.length;a++)if("'"===(s=t.charAt(a))||'"'===s){if(u=t.indexOf(s,a+1),v+=t.substring(a+1,u<0?t.length:u),u<0)break;a=u}else"\\"===s?(v+=t.charAt(a+1),a++):"#"===s||"0"===s?(C=!0,!I&&b&&"#"===s||(g.buffer=v,o<i?(o>=0?(x&&this.addGroup(e.substr(0,o),g),this.addGroup(e.charAt(o),g)):o>=i-p&&this.addGroup("0",g),x=0):(y-- >0||o<e.length)&&this.addGroup(o>=e.length?"0":e.charAt(o),g),v=g.buffer),o++):"."===s?(C||b||(v+=e.substr(0,i),C=!0),(e.length>++o||y>0)&&(I=!0,v+=n[m+"DecimalSeparator"])):","!==s&&(v+=s);return w&&!h&&(v="-"+v),v},addGroup:function(e,t){for(var n=t.buffer,r=t.sep,i=t.groupIndex,s=0,o=e.length;s<o;s++)n+=e.charAt(s),r&&i>1&&i--%3==1&&(n+=r);t.buffer=n,t.groupIndex=i},parseFloat:function(e,t){var n={};return Bridge.Int.tryParseFloat(e,t,n,!1),n.v},tryParseFloat:function(e,t,n,r){var i,s,o,a;if(n.v=0,null==r&&(r=!0),null==e){if(r)return!1;throw new System.ArgumentNullException("s")}e=e.trim();var u=(t||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),l=u.numberDecimalSeparator,c=u.numberGroupSeparator,h="Input string was not in a correct format.",m=e.indexOf(l),g=c?e.indexOf(c):-1;if(m>-1&&(m<g||g>-1&&m<e.indexOf(c,m)||e.indexOf(l,m+1)>-1)){if(r)return!1;throw new System.FormatException(h)}if("."!==l&&"."!==c&&e.indexOf(".")>-1){if(r)return!1;throw new System.FormatException(h)}if(g>-1){for(i="",o=0;o<e.length;o++)e[o]!==c&&(i+=e[o]);e=i}if(e===u.negativeInfinitySymbol)return n.v=Number.NEGATIVE_INFINITY,!0;if(e===u.positiveInfinitySymbol)return n.v=Number.POSITIVE_INFINITY,!0;if(e===u.nanSymbol)return n.v=Number.NaN,!0;for(s=0,o=0;o<e.length;o++)if(System.Char.isLetter(e[o].charCodeAt(0))){if("e"!==e[o].toLowerCase()){if(r)return!1;throw new System.FormatException(h)}if(++s>1){if(r)return!1;throw new System.FormatException(h)}}if(a=parseFloat(e.replace(l,".")),isNaN(a)){if(r)return!1;throw new System.FormatException(h)}return n.v=a,!0},parseInt:function(e,t,n,r){if(r=r||10,null==e)throw new System.ArgumentNullException("str");if(r<=10&&!/^[+-]?[0-9]+$/.test(e)||16==r&&!/^[+-]?[0-9A-F]+$/gi.test(e))throw new System.FormatException("Input string was not in a correct format.");var i=parseInt(e,r);if(isNaN(i))throw new System.FormatException("Input string was not in a correct format.");if(i<t||i>n)throw new System.OverflowException;return i},tryParseInt:function(e,t,n,r,i){return t.v=0,!((i=i||10)<=10&&!/^[+-]?[0-9]+$/.test(e)||16==i&&!/^[+-]?[0-9A-F]+$/gi.test(e)||(t.v=parseInt(e,i),t.v<n||t.v>r))},isInfinite:function(e){return e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY},trunc:function(e){return Bridge.isNumber(e)?e>0?Math.floor(e):Math.ceil(e):Bridge.Int.isInfinite(e)?e:null},div:function(e,t){if(!Bridge.isNumber(e)||!Bridge.isNumber(t))return null;if(0===t)throw new System.DivideByZeroException;return this.trunc(e/t)},mod:function(e,t){if(!Bridge.isNumber(e)||!Bridge.isNumber(t))return null;if(0===t)throw new System.DivideByZeroException;return e%t},check:function(e,t){if(System.Int64.is64Bit(e))return System.Int64.check(e,t);if(e instanceof System.Decimal)return System.Decimal.toInt(e,t);if(Bridge.isNumber(e)&&!t.$is(e))throw new System.OverflowException;return Bridge.Int.isInfinite(e)?t===System.Int64||t===System.UInt64?t.MinValue:t.min:e},sxb:function(e){return Bridge.isNumber(e)?e|(128&e?4294967040:0):Bridge.Int.isInfinite(e)?System.SByte.min:null},sxs:function(e){return Bridge.isNumber(e)?e|(32768&e?4294901760:0):Bridge.Int.isInfinite(e)?System.Int16.min:null},clip8:function(e){return Bridge.isNumber(e)?Bridge.Int.sxb(255&e):Bridge.Int.isInfinite(e)?System.SByte.min:null},clipu8:function(e){return Bridge.isNumber(e)?255&e:Bridge.Int.isInfinite(e)?System.Byte.min:null},clip16:function(e){return Bridge.isNumber(e)?Bridge.Int.sxs(65535&e):Bridge.Int.isInfinite(e)?System.Int16.min:null},clipu16:function(e){return Bridge.isNumber(e)?65535&e:Bridge.Int.isInfinite(e)?System.UInt16.min:null},clip32:function(e){return Bridge.isNumber(e)?0|e:Bridge.Int.isInfinite(e)?System.Int32.min:null},clipu32:function(e){return Bridge.isNumber(e)?e>>>0:Bridge.Int.isInfinite(e)?System.UInt32.min:null},clip64:function(e){return Bridge.isNumber(e)?System.Int64(Bridge.Int.trunc(e)):Bridge.Int.isInfinite(e)?System.Int64.MinValue:null},clipu64:function(e){return Bridge.isNumber(e)?System.UInt64(Bridge.Int.trunc(e)):Bridge.Int.isInfinite(e)?System.UInt64.MinValue:null},sign:function(e){return Bridge.isNumber(e)?0===e?0:e<0?-1:1:null}}}),Bridge.Int.$kind="",Bridge.Class.addExtend(Bridge.Int,[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int)]),Bridge.define("System.Double",{inherits:[System.IComparable,System.IFormattable],statics:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE,precision:15,$number:!0,$is:function(e){return"number"==typeof e},getDefaultValue:function(){return 0},parse:function(e,t){return Bridge.Int.parseFloat(e,t)},tryParse:function(e,t,n){return Bridge.Int.tryParseFloat(e,t,n)},format:function(e,t,n){return Bridge.Int.format(e,t,n,System.Double)}}}),System.Double.$kind="",Bridge.Class.addExtend(System.Double,[System.IComparable$1(System.Double),System.IEquatable$1(System.Double)]),Bridge.define("System.Single",{inherits:[System.IComparable,System.IFormattable],statics:{min:-34028234663852886e22,max:34028234663852886e22,precision:7,$number:!0,$is:System.Double.$is,getDefaultValue:System.Double.getDefaultValue,parse:System.Double.parse,tryParse:System.Double.tryParse,format:function(e,t,n){return Bridge.Int.format(e,t,n,System.Single)}}}),System.Single.$kind="",Bridge.Class.addExtend(System.Single,[System.IComparable$1(System.Single),System.IEquatable$1(System.Single)]),function(e){function t(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function n(e){return!0===(e&&e.__isLong__)}function r(e,t){var n,r;if(t){if((r=0<=(e>>>=0)&&256>e)&&(n=l[e]))return n;n=s(e,0>(0|e)?-1:0,!0),r&&(l[e]=n)}else{if((r=-128<=(e|=0)&&128>e)&&(n=u[e]))return n;n=s(e,0>e?-1:0,!1),r&&(u[e]=n)}return n}function i(e,t){if(isNaN(e)||!isFinite(e))return t?h:v;if(t){if(0>e)return h;if(e>=S)return d}else{if(e<=-x)return y;if(e+1>=x)return p}return 0>e?i(-e,t).neg():s(e%4294967296|0,e/4294967296|0,t)}function s(e,n,r){return new t(e,n,r)}function o(e,t,n){var r,s,a,u,l;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,2>(n=n||10)||36<n)throw RangeError("radix");if(0<(r=e.indexOf("-")))throw Error("interior hyphen");if(0===r)return o(e.substring(1),t,n).neg();for(r=i(c(n,8)),s=v,a=0;a<e.length;a+=8)u=Math.min(8,e.length-a),l=parseInt(e.substring(a,a+u),n),8>u?(u=i(c(n,u)),s=s.mul(u).add(i(l))):s=(s=s.mul(r)).add(i(l));return s.unsigned=t,s}function a(e){return e instanceof t?e:"number"==typeof e?i(e):"string"==typeof e?o(e):s(e.low,e.high,e.unsigned)}var u,l,c,h,m,g,f,p,d,y;e.Bridge.$Long=t,t.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=n,u={},l={},t.fromInt=r,t.fromNumber=i,t.fromBits=s,c=Math.pow,t.fromString=o,t.fromValue=a;var S=0x10000000000000000,x=S/2,w=r(16777216),v=r(0);t.ZERO=v,h=r(0,!0),t.UZERO=h,m=r(1),t.ONE=m,g=r(1,!0),t.UONE=g,f=r(-1),t.NEG_ONE=f,p=s(-1,2147483647,!1),t.MAX_VALUE=p,d=s(-1,-1,!0),t.MAX_UNSIGNED_VALUE=d,y=s(0,-2147483648,!1),t.MIN_VALUE=y,(e=t.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},e.toNumber=function(){return this.unsigned?4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)},e.toString=function(e){if(2>(e=e||10)||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(y)){var t=i(e);return t=(n=this.div(t)).mul(t).sub(this),n.toString(e)+t.toInt().toString(e)}return(void 0===e||10===e?"-":"")+this.neg().toString(e)}for(var n=i(c(e,6),this.unsigned),r=(t=this,"");;){var s=t.div(n),o=(t.sub(s.mul(n)).toInt()>>>0).toString(e);if((t=s).isZero())return o+r;for(;6>o.length;)o="0"+o;r=""+o+r}},e.getHighBits=function(){return this.high},e.getHighBitsUnsigned=function(){return this.high>>>0},e.getLowBits=function(){return this.low},e.getLowBitsUnsigned=function(){return this.low>>>0},e.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;0<t&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},e.isZero=function(){return 0===this.high&&0===this.low},e.isNegative=function(){return!this.unsigned&&0>this.high},e.isPositive=function(){return this.unsigned||0<=this.high},e.isOdd=function(){return 1==(1&this.low)},e.isEven=function(){return 0==(1&this.low)},e.equals=function(e){return n(e)||(e=a(e)),(this.unsigned===e.unsigned||1!=this.high>>>31||1!=e.high>>>31)&&this.high===e.high&&this.low===e.low},e.eq=e.equals,e.notEquals=function(e){return!this.eq(e)},e.neq=e.notEquals,e.lessThan=function(e){return 0>this.comp(e)},e.lt=e.lessThan,e.lessThanOrEqual=function(e){return 0>=this.comp(e)},e.lte=e.lessThanOrEqual,e.greaterThan=function(e){return 0<this.comp(e)},e.gt=e.greaterThan,e.greaterThanOrEqual=function(e){return 0<=this.comp(e)},e.gte=e.greaterThanOrEqual,e.compare=function(e){if(n(e)||(e=a(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},e.comp=e.compare,e.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(m)},e.neg=e.negate,e.add=function(e){n(e)||(e=a(e));var t,r=this.high>>>16,i=65535&this.high,o=this.low>>>16,u=e.high>>>16,l=65535&e.high,c=e.low>>>16;return e=0+((t=(65535&this.low)+(65535&e.low)+0)>>>16),o=0+((e+=o+c)>>>16),s((65535&e)<<16|65535&t,(i=(i=0+((o+=i+l)>>>16))+(r+u)&65535)<<16|65535&o,this.unsigned)},e.subtract=function(e){return n(e)||(e=a(e)),this.add(e.neg())},e.sub=e.subtract,e.multiply=function(e){var t,r,o,u;if(this.isZero()||(n(e)||(e=a(e)),e.isZero()))return v;if(this.eq(y))return e.isOdd()?y:v;if(e.eq(y))return this.isOdd()?y:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(w)&&e.lt(w))return i(this.toNumber()*e.toNumber(),this.unsigned);var l=this.high>>>16,c=65535&this.high,h=this.low>>>16,m=65535&this.low,g=e.high>>>16,f=65535&e.high,p=e.low>>>16;return o=0+((u=0+m*(e=65535&e.low))>>>16),r=0+((o+=h*e)>>>16),r+=(o=(65535&o)+m*p)>>>16,t=0+((r+=c*e)>>>16),t+=(r=(65535&r)+h*p)>>>16,r&=65535,s((o&=65535)<<16|65535&u,(t=(t+=(r+=m*f)>>>16)+(l*e+c*p+h*f+m*g)&65535)<<16|(r&=65535),this.unsigned)},e.mul=e.multiply,e.divide=function(e){var t,r,s;if(n(e)||(e=a(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?h:v;if(this.unsigned)e.unsigned||(e=e.toUnsigned());else{if(this.eq(y))return e.eq(m)||e.eq(f)?y:e.eq(y)?m:(t=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:f:(r=this.sub(e.mul(t)),t.add(r.div(e)));if(e.eq(y))return this.unsigned?h:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg()}if(this.unsigned){if(e.gt(this))return h;if(e.gt(this.shru(1)))return g;s=h}else s=v;for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=48>=(o=Math.ceil(Math.log(t)/Math.LN2))?1:c(2,o-48),u=i(t),l=u.mul(e);l.isNegative()||l.gt(r);)l=(u=i(t-=o,this.unsigned)).mul(e);u.isZero()&&(u=m),s=s.add(u),r=r.sub(l)}return s},e.div=e.divide,e.modulo=function(e){return n(e)||(e=a(e)),this.sub(this.div(e).mul(e))},e.mod=e.modulo,e.not=function(){return s(~this.low,~this.high,this.unsigned)},e.and=function(e){return n(e)||(e=a(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},e.or=function(e){return n(e)||(e=a(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},e.xor=function(e){return n(e)||(e=a(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},e.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:32>e?s(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):s(0,this.low<<e-32,this.unsigned)},e.shl=e.shiftLeft,e.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:32>e?s(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},e.shr=e.shiftRight,e.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return 32>e?s(this.low>>>e|t<<32-e,t>>>e,this.unsigned):s(32===e?t:t>>>e-32,0,this.unsigned)},e.shru=e.shiftRightUnsigned,e.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},e.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)}}(Bridge.global),System.Int64=function(e){if(this.constructor!==System.Int64)return new System.Int64(e);Bridge.hasValue(e)||(e=0),this.T=System.Int64,this.unsigned=!1,this.value=System.Int64.getValue(e)},System.Int64.$$name="System.Int64",System.Int64.prototype.$$name="System.Int64",System.Int64.$kind="struct",System.Int64.prototype.$kind="struct",System.Int64.$$inherits=[],Bridge.Class.addExtend(System.Int64,[System.IComparable,System.IFormattable,System.IComparable$1(System.Int64),System.IEquatable$1(System.Int64)]),System.Int64.$is=function(e){return e instanceof System.Int64},System.Int64.is64Bit=function(e){return e instanceof System.Int64||e instanceof System.UInt64},System.Int64.getDefaultValue=function(){return System.Int64.Zero},System.Int64.getValue=function(e){return Bridge.hasValue(e)?e instanceof Bridge.$Long?e:e instanceof System.Int64?e.value:e instanceof System.UInt64?e.value.toSigned():Bridge.isArray(e)?new Bridge.$Long(e[0],e[1]):Bridge.isString(e)?Bridge.$Long.fromString(e):Bridge.isNumber(e)?Bridge.$Long.fromNumber(e):e instanceof System.Decimal?Bridge.$Long.fromString(e.toString()):Bridge.$Long.fromValue(e):null},System.Int64.create=function(e){return Bridge.hasValue(e)?e instanceof System.Int64?e:new System.Int64(e):null},System.Int64.lift=function(e){return Bridge.hasValue(e)?System.Int64.create(e):null},System.Int64.toNumber=function(e){return e?e.toNumber():null},System.Int64.prototype.toNumberDivided=function(e){var t=this.div(e),n=this.mod(e).toNumber()/e;return t.toNumber()+n},System.Int64.prototype.toJSON=function(){return this.toNumber()},System.Int64.prototype.toString=function(e,t){return e||t?Bridge.isNumber(e)&&!t?this.value.toString(e):Bridge.Int.format(this,e,t):this.value.toString()},System.Int64.prototype.format=function(e,t){return Bridge.Int.format(this,e,t)},System.Int64.prototype.isNegative=function(){return this.value.isNegative()},System.Int64.prototype.abs=function(){if(this.T===System.Int64&&this.eq(System.Int64.MinValue))throw new System.OverflowException;return new this.T(this.value.isNegative()?this.value.neg():this.value)},System.Int64.prototype.compareTo=function(e){return this.value.compare(this.T.getValue(e))},System.Int64.prototype.add=function(e,t){var n=this.T.getValue(e),r=new this.T(this.value.add(n));if(t){var i=this.value.isNegative(),s=n.isNegative(),o=r.value.isNegative();if(i&&s&&!o||!i&&!s&&o||this.T===System.UInt64&&r.lt(System.UInt64.max(this,n)))throw new System.OverflowException}return r},System.Int64.prototype.sub=function(e,t){var n=this.T.getValue(e),r=new this.T(this.value.sub(n));if(t){var i=this.value.isNegative(),s=n.isNegative(),o=r.value.isNegative();if(i&&!s&&!o||!i&&s&&o||this.T===System.UInt64&&this.value.lt(n))throw new System.OverflowException}return r},System.Int64.prototype.isZero=function(){return this.value.isZero()},System.Int64.prototype.mul=function(e,t){var n,r=this.T.getValue(e),i=new this.T(this.value.mul(r));if(t){var s=this.sign(),o=r.isZero()?0:r.isNegative()?-1:1,a=i.sign();if(this.T===System.Int64){if(this.eq(System.Int64.MinValue)||this.eq(System.Int64.MaxValue)){if(r.neq(1)&&r.neq(0))throw new System.OverflowException;return i}if(r.eq(Bridge.$Long.MIN_VALUE)||r.eq(Bridge.$Long.MAX_VALUE)){if(this.neq(1)&&this.neq(0))throw new System.OverflowException;return i}if(-1===s&&-1===o&&1!==a||1===s&&1===o&&1!==a||-1===s&&1===o&&-1!==a||1===s&&-1===o&&-1!==a)throw new System.OverflowException;if((n=i.abs()).lt(this.abs())||n.lt(System.Int64(r).abs()))throw new System.OverflowException}else{if(this.eq(System.UInt64.MaxValue)){if(r.neq(1)&&r.neq(0))throw new System.OverflowException;return i}if(r.eq(Bridge.$Long.MAX_UNSIGNED_VALUE)){if(this.neq(1)&&this.neq(0))throw new System.OverflowException;return i}if((n=i.abs()).lt(this.abs())||n.lt(System.Int64(r).abs()))throw new System.OverflowException}}return i},System.Int64.prototype.div=function(e){return new this.T(this.value.div(this.T.getValue(e)))},System.Int64.prototype.mod=function(e){return new this.T(this.value.mod(this.T.getValue(e)))},System.Int64.prototype.neg=function(e){if(e&&this.T===System.Int64&&this.eq(System.Int64.MinValue))throw new System.OverflowException;return new this.T(this.value.neg())},System.Int64.prototype.inc=function(e){return this.add(1,e)},System.Int64.prototype.dec=function(e){return this.sub(1,e)},System.Int64.prototype.sign=function(){return this.value.isZero()?0:this.value.isNegative()?-1:1},System.Int64.prototype.clone=function(){return new this.T(this)},System.Int64.prototype.ne=function(e){return this.value.neq(this.T.getValue(e))},System.Int64.prototype.neq=function(e){return this.value.neq(this.T.getValue(e))},System.Int64.prototype.eq=function(e){return this.value.eq(this.T.getValue(e))},System.Int64.prototype.lt=function(e){return this.value.lt(this.T.getValue(e))},System.Int64.prototype.lte=function(e){return this.value.lte(this.T.getValue(e))},System.Int64.prototype.gt=function(e){return this.value.gt(this.T.getValue(e))},System.Int64.prototype.gte=function(e){return this.value.gte(this.T.getValue(e))},System.Int64.prototype.equals=function(e){return this.value.eq(this.T.getValue(e))},System.Int64.prototype.equalsT=function(e){return this.equals(e)},System.Int64.prototype.getHashCode=function(){return 397*(397*this.sign()+this.value.high|0)+this.value.low|0},System.Int64.prototype.toNumber=function(){return this.value.toNumber()},System.Int64.parse=function(e){if(null==e)throw new System.ArgumentNullException("str");if(!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException("Input string was not in a correct format.");var t=new System.Int64(e);if(e!==t.toString())throw new System.OverflowException;return t},System.Int64.tryParse=function(e,t){try{return null!=e&&/^[+-]?[0-9]+$/.test(e)?(t.v=new System.Int64(e),e===t.v.toString()||(t.v=System.Int64(Bridge.$Long.ZERO),!1)):(t.v=System.Int64(Bridge.$Long.ZERO),!1)}catch(e){return t.v=System.Int64(Bridge.$Long.ZERO),!1}},System.Int64.divRem=function(e,t,n){e=System.Int64(e),t=System.Int64(t);var r=e.mod(t);return n.v=r,e.sub(r).div(t)},System.Int64.min=function(){for(var e,t=[],n=0,r=arguments.length;n<r;n++)t.push(System.Int64.getValue(arguments[n]));for(n=0,e=t[0];++n<t.length;)t[n].lt(e)&&(e=t[n]);return new System.Int64(e)},System.Int64.max=function(){for(var e,t=[],n=0,r=arguments.length;n<r;n++)t.push(System.Int64.getValue(arguments[n]));for(n=0,e=t[0];++n<t.length;)t[n].gt(e)&&(e=t[n]);return new System.Int64(e)},System.Int64.prototype.and=function(e){return new this.T(this.value.and(this.T.getValue(e)))},System.Int64.prototype.not=function(){return new this.T(this.value.not())},System.Int64.prototype.or=function(e){return new this.T(this.value.or(this.T.getValue(e)))},System.Int64.prototype.shl=function(e){return new this.T(this.value.shl(e))},System.Int64.prototype.shr=function(e){return new this.T(this.value.shr(e))},System.Int64.prototype.shru=function(e){return new this.T(this.value.shru(e))},System.Int64.prototype.xor=function(e){return new this.T(this.value.xor(this.T.getValue(e)))},System.Int64.check=function(e,t){if(Bridge.Int.isInfinite(e))return t===System.Int64||t===System.UInt64?t.MinValue:t.min;if(!e)return null;var n,r;if(t===System.Int64){if(e instanceof System.Int64)return e;if((n=e.value.toString())!==(r=new System.Int64(n)).value.toString())throw new System.OverflowException;return r}if(t===System.UInt64){if(e instanceof System.UInt64)return e;if(e.value.isNegative())throw new System.OverflowException;if((n=e.value.toString())!==(r=new System.UInt64(n)).value.toString())throw new System.OverflowException;return r}return Bridge.Int.check(e.toNumber(),t)},System.Int64.clip8=function(e){return e?Bridge.Int.sxb(255&e.value.low):Bridge.Int.isInfinite(e)?System.SByte.min:null},System.Int64.clipu8=function(e){return e?255&e.value.low:Bridge.Int.isInfinite(e)?System.Byte.min:null},System.Int64.clip16=function(e){return e?Bridge.Int.sxs(65535&e.value.low):Bridge.Int.isInfinite(e)?System.Int16.min:null},System.Int64.clipu16=function(e){return e?65535&e.value.low:Bridge.Int.isInfinite(e)?System.UInt16.min:null},System.Int64.clip32=function(e){return e?0|e.value.low:Bridge.Int.isInfinite(e)?System.Int32.min:null},System.Int64.clipu32=function(e){return e?e.value.low>>>0:Bridge.Int.isInfinite(e)?System.UInt32.min:null},System.Int64.clip64=function(e){return e?new System.Int64(e.value.toSigned()):Bridge.Int.isInfinite(e)?System.Int64.MinValue:null},System.Int64.clipu64=function(e){return e?new System.UInt64(e.value.toUnsigned()):Bridge.Int.isInfinite(e)?System.UInt64.MinValue:null},System.Int64.Zero=System.Int64(Bridge.$Long.ZERO),System.Int64.MinValue=System.Int64(Bridge.$Long.MIN_VALUE),System.Int64.MaxValue=System.Int64(Bridge.$Long.MAX_VALUE),System.Int64.precision=19,System.UInt64=function(e){if(this.constructor!==System.UInt64)return new System.UInt64(e);Bridge.hasValue(e)||(e=0),this.T=System.UInt64,this.unsigned=!0,this.value=System.UInt64.getValue(e,!0)},System.UInt64.$$name="System.UInt64",System.UInt64.prototype.$$name="System.UInt64",System.UInt64.$kind="struct",System.UInt64.prototype.$kind="struct",System.UInt64.$$inherits=[],Bridge.Class.addExtend(System.UInt64,[System.IComparable,System.IFormattable,System.IComparable$1(System.UInt64),System.IEquatable$1(System.UInt64)]),System.UInt64.$is=function(e){return e instanceof System.UInt64},System.UInt64.getDefaultValue=function(){return System.UInt64.Zero},System.UInt64.getValue=function(e){return Bridge.hasValue(e)?e instanceof Bridge.$Long?e:e instanceof System.UInt64?e.value:e instanceof System.Int64?e.value.toUnsigned():Bridge.isArray(e)?new Bridge.$Long(e[0],e[1],!0):Bridge.isString(e)?Bridge.$Long.fromString(e,!0):Bridge.isNumber(e)?Bridge.$Long.fromNumber(e,!0):e instanceof System.Decimal?Bridge.$Long.fromString(e.toString(),!0):Bridge.$Long.fromValue(e):null},System.UInt64.create=function(e){return Bridge.hasValue(e)?e instanceof System.UInt64?e:new System.UInt64(e):null},System.UInt64.lift=function(e){return Bridge.hasValue(e)?System.UInt64.create(e):null},System.UInt64.prototype.toJSON=System.Int64.prototype.toJSON,System.UInt64.prototype.toString=System.Int64.prototype.toString,System.UInt64.prototype.format=System.Int64.prototype.format,System.UInt64.prototype.isNegative=System.Int64.prototype.isNegative,System.UInt64.prototype.abs=System.Int64.prototype.abs,System.UInt64.prototype.compareTo=System.Int64.prototype.compareTo,System.UInt64.prototype.add=System.Int64.prototype.add,System.UInt64.prototype.sub=System.Int64.prototype.sub,System.UInt64.prototype.isZero=System.Int64.prototype.isZero,System.UInt64.prototype.mul=System.Int64.prototype.mul,System.UInt64.prototype.div=System.Int64.prototype.div,System.UInt64.prototype.toNumberDivided=System.Int64.prototype.toNumberDivided,System.UInt64.prototype.mod=System.Int64.prototype.mod,System.UInt64.prototype.neg=System.Int64.prototype.neg,System.UInt64.prototype.inc=System.Int64.prototype.inc,System.UInt64.prototype.dec=System.Int64.prototype.dec,System.UInt64.prototype.sign=System.Int64.prototype.sign,System.UInt64.prototype.clone=System.Int64.prototype.clone,System.UInt64.prototype.ne=System.Int64.prototype.ne,System.UInt64.prototype.neq=System.Int64.prototype.neq,System.UInt64.prototype.eq=System.Int64.prototype.eq,System.UInt64.prototype.lt=System.Int64.prototype.lt,System.UInt64.prototype.lte=System.Int64.prototype.lte,System.UInt64.prototype.gt=System.Int64.prototype.gt,System.UInt64.prototype.gte=System.Int64.prototype.gte,System.UInt64.prototype.equals=System.Int64.prototype.equals,System.UInt64.prototype.equalsT=System.Int64.prototype.equalsT,System.UInt64.prototype.getHashCode=System.Int64.prototype.getHashCode,System.UInt64.prototype.toNumber=System.Int64.prototype.toNumber,System.UInt64.parse=function(e){if(null==e)throw new System.ArgumentNullException("str");if(!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException("Input string was not in a correct format.");var t=new System.UInt64(e);if(t.value.isNegative())throw new System.OverflowException;if(e!==t.toString())throw new System.OverflowException;return t},System.UInt64.tryParse=function(e,t){try{return null!=e&&/^[+-]?[0-9]+$/.test(e)?(t.v=new System.UInt64(e),t.v.isNegative()?(t.v=System.UInt64(Bridge.$Long.UZERO),!1):e===t.v.toString()||(t.v=System.UInt64(Bridge.$Long.UZERO),!1)):(t.v=System.UInt64(Bridge.$Long.UZERO),!1)}catch(e){return t.v=System.UInt64(Bridge.$Long.UZERO),!1}},System.UInt64.min=function(){for(var e,t=[],n=0,r=arguments.length;n<r;n++)t.push(System.UInt64.getValue(arguments[n]));for(n=0,e=t[0];++n<t.length;)t[n].lt(e)&&(e=t[n]);return new System.UInt64(e)},System.UInt64.max=function(){for(var e,t=[],n=0,r=arguments.length;n<r;n++)t.push(System.UInt64.getValue(arguments[n]));for(n=0,e=t[0];++n<t.length;)t[n].gt(e)&&(e=t[n]);return new System.UInt64(e)},System.UInt64.divRem=function(e,t,n){e=System.UInt64(e),t=System.UInt64(t);var r=e.mod(t);return n.v=r,e.sub(r).div(t)},System.UInt64.prototype.and=System.Int64.prototype.and,System.UInt64.prototype.not=System.Int64.prototype.not,System.UInt64.prototype.or=System.Int64.prototype.or,System.UInt64.prototype.shl=System.Int64.prototype.shl,System.UInt64.prototype.shr=System.Int64.prototype.shr,System.UInt64.prototype.shru=System.Int64.prototype.shru,System.UInt64.prototype.xor=System.Int64.prototype.xor,System.UInt64.Zero=System.UInt64(Bridge.$Long.UZERO),System.UInt64.MinValue=System.UInt64.Zero,System.UInt64.MaxValue=System.UInt64(Bridge.$Long.MAX_UNSIGNED_VALUE),System.UInt64.precision=20,function(e){function t(e){var t,n,r,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;i>t;t++)r=e[t]+"",(n=Re-r.length)&&(s+=h(n)),s+=r;o=e[t],(n=Re-(r=o+"").length)&&(s+=h(n))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function n(e,t,n){if(e!==~~e||t>e||e>n)throw Error(ve+e)}function r(e,t,n,r){for(var i,s,o,a=e[0];a>=10;a/=10)--t;return--t<0?(t+=Re,i=0):(i=Math.ceil((t+1)/Re),t%=Re),a=Ce(10,Re-t),o=e[i]%a|0,null==r?3>t?(0==t?o=o/100|0:1==t&&(o=o/10|0),s=4>n&&99999==o||n>3&&49999==o||5e4==o||0==o):s=(4>n&&o+1==a||n>3&&o+1==a/2)&&(e[i+1]/a/100|0)==Ce(10,t-2)-1||(o==a/2||0==o)&&0==(e[i+1]/a/100|0):4>t?(0==t?o=o/1e3|0:1==t?o=o/100|0:2==t&&(o=o/10|0),s=(r||4>n)&&9999==o||!r&&n>3&&4999==o):s=((r||4>n)&&o+1==a||!r&&n>3&&o+1==a/2)&&(e[i+1]/a/1e3|0)==Ce(10,t-3)-1,s}function i(e,t,n){for(var r,i,s=[0],o=0,a=e.length;a>o;){for(i=s.length;i--;)s[i]*=t;for(s[0]+=fe.indexOf(e.charAt(o++)),r=0;r<s.length;r++)s[r]>n-1&&(void 0===s[r+1]&&(s[r+1]=0),s[r+1]+=s[r]/n|0,s[r]%=n)}return s.reverse()}function s(e,t,n,r){var i,s,o,a,u,l,c,h,m,g=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(0>(s=t-i))s+=Re,o=t,u=(c=h[m=0])/Ce(10,i-o-1)%10|0;else if((m=Math.ceil((s+1)/Re))>=(a=h.length)){if(!r)break e;for(;a++<=m;)h.push(0);c=u=0,i=1,o=(s%=Re)-Re+1}else{for(c=a=h[m],i=1;a>=10;a/=10)i++;u=0>(o=(s%=Re)-Re+i)?0:c/Ce(10,i-o-1)%10|0}if(r=r||0>t||void 0!==h[m+1]||(0>o?c:c%Ce(10,i-o-1)),l=4>n?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(s>0?o>0?c/Ce(10,i-o):0:h[m-1])%10&1||n==(e.s<0?8:7)),1>t||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=Ce(10,(Re-t%Re)%Re),e.e=-t||0):h[0]=e.e=0,e;if(0==s?(h.length=m,a=1,m--):(h.length=m+1,a=Ce(10,Re-s),h[m]=o>0?(c/Ce(10,i-o)%Ce(10,o)|0)*a:0),l)for(;;){if(0==m){for(s=1,o=h[0];o>=10;o/=10)s++;for(o=h[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,h[0]==Te&&(h[0]=1));break}if(h[m]+=a,h[m]!=Te)break;h[m--]=0,a=1}for(s=h.length;0===h[--s];)h.pop()}return xe&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e<g.minE&&(e.e=0,e.d=[0])),e}function o(e,n,r){if(!e.isFinite())return y(e);var i,s=e.e,o=t(e.d),a=o.length;return n?(r&&(i=r-a)>0?o=o.charAt(0)+"."+o.slice(1)+h(i):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):0>s?(o="0."+h(-s-1)+o,r&&(i=r-a)>0&&(o+=h(i))):s>=a?(o+=h(s+1-a),r&&(i=r-s-1)>0&&(o=o+"."+h(i))):((i=s+1)<a&&(o=o.slice(0,i)+"."+o.slice(i)),r&&(i=r-a)>0&&(s+1===a&&(o+="."),o+=h(i))),o}function a(e,t){for(var n=1,r=e[0];r>=10;r/=10)n++;return n+t*Re-1}function u(e,t,n){if(t>Ne)throw xe=!0,n&&(e.precision=n),Error(be);return s(new e(pe),t,1,!0)}function l(e,t,n){if(t>ke)throw Error(be);return s(new e(de),t,n,!0)}function c(e){var t=e.length-1,n=t*Re+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function h(e){for(var t="";e--;)t+="0";return t}function m(e,t,n,r){var i,s=new e(1),o=Math.ceil(r/Re+4);for(xe=!1;;){if(n%2&&I((s=s.times(t)).d,o)&&(i=!0),0===(n=Ie(n/2))){n=s.d.length-1,i&&0===s.d[n]&&++s.d[n];break}I((t=t.times(t)).d,o)}return xe=!0,s}function g(e){return 1&e.d[e.d.length-1]}function f(e,t,n){for(var r,i=new e(t[0]),s=0;++s<t.length;){if(!(r=new e(t[s])).s){i=r;break}i[n](r)&&(i=r)}return i}function p(e,n){var i,o,a,u,l,c,h,m=0,g=0,f=0,p=e.constructor,d=p.rounding,y=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==n?(xe=!1,h=y):h=n,c=new p(.03125);e.e>-2;)e=e.times(c),f+=5;for(h+=o=Math.log(Ce(2,f))/Math.LN10*2+5|0,i=u=l=new p(1),p.precision=h;;){if(u=s(u.times(e),h,1),i=i.times(++g),t((c=l.plus(he(u,i,h,1))).d).slice(0,h)===t(l.d).slice(0,h)){for(a=f;a--;)l=s(l.times(l),h,1);if(null!=n)return p.precision=y,l;if(!(3>m&&r(l.d,h-o,d,m)))return s(l,p.precision=y,d,xe=!0);p.precision=h+=10,i=u=c=new p(1),g=0,m++}l=c}}function d(e,n){var i,o,a,l,c,h,m,g,f,p,y,S=1,x=e,w=x.d,v=x.constructor,b=v.rounding,I=v.precision;if(x.s<0||!w||!w[0]||!x.e&&1==w[0]&&1==w.length)return new v(w&&!w[0]?-1/0:1!=x.s?NaN:w?0:x);if(null==n?(xe=!1,f=I):f=n,v.precision=f+=10,o=(i=t(w)).charAt(0),!(Math.abs(l=x.e)<15e14))return g=u(v,f+2,I).times(l+""),x=d(new v(o+"."+i.slice(1)),f-10).plus(g),v.precision=I,null==n?s(x,I,b,xe=!0):x;for(;7>o&&1!=o||1==o&&i.charAt(1)>3;)o=(i=t((x=x.times(e)).d)).charAt(0),S++;for(l=x.e,o>1?(x=new v("0."+i),l++):x=new v(o+"."+i.slice(1)),p=x,m=c=x=he(x.minus(1),x.plus(1),f,1),y=s(x.times(x),f,1),a=3;;){if(c=s(c.times(y),f,1),t((g=m.plus(he(c,new v(a),f,1))).d).slice(0,f)===t(m.d).slice(0,f)){if(m=m.times(2),0!==l&&(m=m.plus(u(v,f+2,I).times(l+""))),m=he(m,new v(S),f,1),null!=n)return v.precision=I,m;if(!r(m.d,f-10,b,h))return s(m,v.precision=I,b,xe=!0);v.precision=f+=10,g=c=x=he(p.minus(1),p.plus(1),f,1),y=s(x.times(x),f,1),a=h=1}m=g,a+=2}}function y(e){return String(e.s*e.s/0)}function S(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(0>n&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):0>n&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%Re,0>n&&(r+=Re),i>r){for(r&&e.d.push(+t.slice(0,r)),i-=Re;i>r;)e.d.push(+t.slice(r,r+=Re));t=t.slice(r),r=Re-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),xe&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function x(e,t){var n,r,s,o,u,l,c,h,g;if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if($e.test(t))n=16,t=t.toLowerCase();else if(Ee.test(t))n=2;else{if(!Be.test(t))throw Error(ve+t);n=8}for((o=t.search(/p/i))>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),u=(o=t.indexOf("."))>=0,r=e.constructor,u&&(o=(l=(t=t.replace(".","")).length)-o,s=m(r,new r(n),o,2*o)),o=g=(h=i(t,n,Te)).length-1;0===h[o];--o)h.pop();return 0>o?new r(0*e.s):(e.e=a(h,g),e.d=h,xe=!1,u&&(e=he(e,s,4*l)),c&&(e=e.times(Math.abs(c)<54?Math.pow(2,c):ye.pow(2,c))),xe=!0,e)}function w(e,t,n,r,i){var s,o,a,u,l=e.precision,c=Math.ceil(l/Re);for(xe=!1,u=n.times(n),a=new e(r);;){if(o=he(a.times(u),new e(t++*t++),l,1),a=i?r.plus(o):r.minus(o),r=he(o.times(u),new e(t++*t++),l,1),void 0!==(o=a.plus(r)).d[c]){for(s=c;o.d[s]===a.d[s]&&s--;);if(-1==s)break}s=a,a=r,r=o,o=s}return xe=!0,o.d.length=c+1,o}function v(e,t){var n,r=t.s<0,i=l(e,e.precision,1),s=i.times(.5);if((t=t.abs()).lte(s))return ce=r?4:1,t;if((n=t.divToInt(i)).isZero())ce=r?3:2;else{if((t=t.minus(n.times(i))).lte(s))return ce=g(n)?r?2:3:r?4:1,t;ce=g(n)?r?1:4:r?3:2}return t.minus(i).abs()}function b(e,t,r,s){var a,u,l,c,h,m,g,f,p,d=e.constructor,S=void 0!==r;if(S?(n(r,1,ge),void 0===s?s=d.rounding:n(s,0,8)):(r=d.precision,s=d.rounding),e.isFinite()){for(S?(a=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):a=t,(l=(g=o(e)).indexOf("."))>=0&&(g=g.replace(".",""),(p=new d(1)).e=g.length-l,p.d=i(o(p),10,a),p.e=p.d.length),u=h=(f=i(g,10,a)).length;0==f[--h];)f.pop();if(f[0]){if(0>l?u--:((e=new d(e)).d=f,e.e=u,f=(e=he(e,p,r,s,0,a)).d,u=e.e,m=ue),l=f[r],c=a/2,m=m||void 0!==f[r+1],m=4>s?(void 0!==l||m)&&(0===s||s===(e.s<0?3:2)):l>c||l===c&&(4===s||m||6===s&&1&f[r-1]||s===(e.s<0?8:7)),f.length=r,m)for(;++f[--r]>a-1;)f[r]=0,r||(++u,f.unshift(1));for(h=f.length;!f[h-1];--h);for(l=0,g="";h>l;l++)g+=fe.charAt(f[l]);if(S){if(h>1)if(16==t||8==t){for(l=16==t?4:3,--h;h%l;h++)g+="0";for(h=(f=i(g,a,t)).length;!f[h-1];--h);for(l=1,g="1.";h>l;l++)g+=fe.charAt(f[l])}else g=g.charAt(0)+"."+g.slice(1);g=g+(0>u?"p":"p+")+u}else if(0>u){for(;++u;)g="0"+g;g="0."+g}else if(++u>h)for(u-=h;u--;)g+="0";else h>u&&(g=g.slice(0,u)+"."+g.slice(u))}else g=S?"0p+0":"0";g=(16==t?"0x":2==t?"0b":8==t?"0o":"")+g}else g=y(e);return e.s<0?"-"+g:g}function I(e,t){if(e.length>t)return e.length=t,!0}function C(e){return new this(e).abs()}function E(e){return new this(e).acos()}function $(e){return new this(e).acosh()}function B(e,t){return new this(e).plus(t)}function _(e){return new this(e).asin()}function T(e){return new this(e).asinh()}function R(e){return new this(e).atan()}function N(e){return new this(e).atanh()}function k(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,s=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?l(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=l(this,s,1).times(.5)).s=e.s:t.s<0?(this.precision=s,this.rounding=1,n=this.atan(he(e,t,s,1)),t=l(this,s,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(he(e,t,s,1)):(n=l(this,s,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function A(e){return new this(e).cbrt()}function D(e){return s(e=new this(e),e.e+1,2)}function O(e){if(!e||"object"!=typeof e)throw Error(we+"Object expected");for(var t,n,r=["precision",1,ge,"rounding",0,8,"toExpNeg",-me,0,"toExpPos",0,me,"maxE",0,me,"minE",-me,0,"modulo",0,9],i=0;i<r.length;i+=3)if(void 0!==(n=e[t=r[i]])){if(!(Ie(n)===n&&n>=r[i+1]&&n<=r[i+2]))throw Error(ve+t+": "+n);this[t]=n}if(e.hasOwnProperty(t="crypto"))if(void 0===(n=e[t]))this[t]=n;else{if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(ve+t+": "+n);this[t]=!(!n||!Se||!Se.getRandomValues&&!Se.randomBytes)}return this}function M(e){return new this(e).cos()}function P(e){return new this(e).cosh()}function V(e,t){return new this(e).div(t)}function L(e){return new this(e).exp()}function F(e){return s(e=new this(e),e.e+1,3)}function G(e){var t,n,r,s;if("string"!=typeof e||!e)throw Error(ve+e);if(r=e.length,s=fe.indexOf(e.charAt(0)),1===r)return new this(s>81?[-1/0,1/0,NaN][s-82]:s>40?-(s-41):s);if(64&s)t=(n=16&s)?(7&s)-3:(15&s)-7,r=1;else{if(2===r)return new this((s=88*s+fe.indexOf(e.charAt(1)))>=2816?-(s-2816)-41:s+41);if(n=32&s,!(31&s))return e=i(e.slice(1),88,10).join(""),new this(n?"-"+e:e);r=1+(t=15&s),t=1===t?fe.indexOf(e.charAt(1)):2===t?88*fe.indexOf(e.charAt(1))+fe.indexOf(e.charAt(2)):+i(e.slice(1,r),88,10).join(""),16&s&&(t=-t)}return e=(e=i(e.slice(r),88,10).join(""))+"e"+(t=t-e.length+1),new this(n?"-"+e:e)}function q(){var e,t,n=new this(0);for(xe=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return xe=!0,new this(1/0);n=t}return xe=!0,n.sqrt()}function U(e){return new this(e).ln()}function z(e,t){return new this(e).log(t)}function j(e){return new this(e).log(2)}function H(e){return new this(e).log(10)}function W(){return f(this,arguments,"lt")}function Z(){return f(this,arguments,"gt")}function K(e,t){return new this(e).mod(t)}function J(e,t){return new this(e).mul(t)}function X(e,t){return new this(e).pow(t)}function Y(e){var t,r,i,s,o=0,a=new this(1),u=[];if(void 0===e?e=this.precision:n(e,1,ge),i=Math.ceil(e/Re),!1===this.crypto)for(;i>o;)u[o++]=1e7*Math.random()|0;else if(Se&&Se.getRandomValues)for(t=Se.getRandomValues(new Uint32Array(i));i>o;)(s=t[o])>=429e7?t[o]=Se.getRandomValues(new Uint32Array(1))[0]:u[o++]=s%1e7;else if(Se&&Se.randomBytes){for(t=Se.randomBytes(i*=4);i>o;)(s=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?Se.randomBytes(4).copy(t,o):(u.push(s%1e7),o+=4);o=i/4}else{if(this.crypto)throw Error(we+"crypto unavailable");for(;i>o;)u[o++]=1e7*Math.random()|0}for(i=u[--o],e%=Re,i&&e&&(s=Ce(10,Re-e),u[o]=(i/s|0)*s);0===u[o];o--)u.pop();if(0>o)r=0,u=[0];else{for(r=-1;0===u[0];r-=Re)u.shift();for(i=1,s=u[0];s>=10;s/=10)i++;Re>i&&(r-=Re-i)}return a.e=r,a.d=u,a}function Q(e){return s(e=new this(e),e.e+1,this.rounding)}function ee(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function te(e){return new this(e).sin()}function ne(e){return new this(e).sinh()}function re(e){return new this(e).sqrt()}function ie(e,t){return new this(e).sub(t)}function se(e){return new this(e).tan()}function oe(e){return new this(e).tanh()}function ae(e){return s(e=new this(e),e.e+1,1)}var ue,le,ce,he,me=9e15,ge=1e9,fe="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%()*+,-./:;=?@[]^_`{|}~",pe="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",de="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ye={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-me,maxE:me,crypto:void 0},Se="undefined"!=typeof crypto?crypto:null,xe=!0,we="[DecimalError] ",ve=we+"Invalid argument: ",be=we+"Precision limit exceeded",Ie=Math.floor,Ce=Math.pow,Ee=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$e=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Be=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Te=1e7,Re=7,Ne=pe.length-1,ke=de.length-1,Ae={};if(Ae.absoluteValue=Ae.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),s(e)},Ae.ceil=function(){return s(new this.constructor(this),this.e+1,2)},Ae.comparedTo=Ae.cmp=function(e){var t,n,r,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,u=s.s,l=e.s;if(!o||!a)return u&&l?u!==l?u:o===a?0:!o^0>u?1:-1:NaN;if(!o[0]||!a[0])return o[0]?u:a[0]?-l:0;if(u!==l)return u;if(s.e!==e.e)return s.e>e.e^0>u?1:-1;for(r=o.length,t=0,n=(i=a.length)>r?r:i;n>t;++t)if(o[t]!==a[t])return o[t]>a[t]^0>u?1:-1;return r===i?0:r>i^0>u?1:-1},Ae.cosine=Ae.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+Re,r.rounding=1,n=function(e,t){var n,r,i,s,o=t.d.length;for(32>o?(n=Math.ceil(o/3),r=Math.pow(4,-n).toString()):(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=w(e,1,t.times(r),new e(1)),i=n;i--;)s=t.times(t),t=s.times(s).minus(s).times(8).plus(1);return e.precision-=n,t}(r,v(r,n)),r.precision=e,r.rounding=t,s(2==ce||3==ce?n.neg():n,e,t,!0)):new r(1):new r(NaN)},Ae.cubeRoot=Ae.cbrt=function(){var e,n,r,i,o,a,u,l,c,h,m=this,g=m.constructor;if(!m.isFinite()||m.isZero())return new g(m);for(xe=!1,(a=m.s*Math.pow(m.s*m,1/3))&&Math.abs(a)!=1/0?i=new g(a.toString()):(r=t(m.d),(a=((e=m.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=Math.pow(r,1/3),e=Ie((e+1)/3)-(e%3==(0>e?-1:2)),(i=new g(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=m.s),u=(e=g.precision)+3;;)if(h=(c=(l=i).times(l).times(l)).plus(m),i=he(h.plus(m).times(l),h.plus(c),u+2,1),t(l.d).slice(0,u)===(r=t(i.d)).slice(0,u)){if("9999"!=(r=r.slice(u-3,u+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(s(i,e+1,1),n=!i.times(i).times(i).eq(m));break}if(!o&&(s(l,e+1,0),l.times(l).times(l).eq(m))){i=l;break}u+=4,o=1}return xe=!0,s(i,e,g.rounding,n)},Ae.decimalPlaces=Ae.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-Ie(this.e/Re))*Re,e=t[e])for(;e%10==0;e/=10)n--;0>n&&(n=0)}return n},Ae.dividedBy=Ae.div=function(e){return he(this,new this.constructor(e))},Ae.dividedToIntegerBy=Ae.divToInt=function(e){var t=this.constructor;return s(he(this,new t(e),0,1,1),t.precision,t.rounding)},Ae.equals=Ae.eq=function(e){return 0===this.cmp(e)},Ae.floor=function(){return s(new this.constructor(this),this.e+1,3)},Ae.greaterThan=Ae.gt=function(e){return this.cmp(e)>0},Ae.greaterThanOrEqualTo=Ae.gte=function(e){var t=this.cmp(e);return 1==t||0===t},Ae.hyperbolicCosine=Ae.cosh=function(){var e,t,n,r,i,o,a,u,l=this,c=l.constructor,h=new c(1);if(!l.isFinite())return new c(l.s?1/0:NaN);if(l.isZero())return h;for(n=c.precision,r=c.rounding,c.precision=n+Math.max(l.e,l.sd())+4,c.rounding=1,32>(i=l.d.length)?(e=Math.ceil(i/3),t=Math.pow(4,-e).toString()):(e=16,t="2.3283064365386962890625e-10"),l=w(c,1,l.times(t),new c(1),!0),a=e,u=new c(8);a--;)o=l.times(l),l=h.minus(o.times(u.minus(o.times(u))));return s(l,c.precision=n,c.rounding=r,!0)},Ae.hyperbolicSine=Ae.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,3>(r=i.d.length))i=w(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=w(o,2,i=i.times(Math.pow(5,-e)),i,!0);for(var a,u=new o(5),l=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(u.plus(a.times(l.times(a).plus(c))))}return o.precision=t,o.rounding=n,s(i,t,n,!0)},Ae.hyperbolicTangent=Ae.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,he(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},Ae.inverseCosine=Ae.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,s=n.rounding;return-1!==r?0===r?t.isNeg()?l(n,i,s):new n(0):new n(NaN):t.isZero()?l(n,i+4,s).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=l(n,i+4,s).times(.5),n.precision=i,n.rounding=s,e.minus(t))},Ae.inverseHyperbolicCosine=Ae.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,xe=!1,n=n.times(n).minus(1).sqrt().plus(n),xe=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},Ae.inverseHyperbolicSine=Ae.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,xe=!1,n=n.times(n).plus(1).sqrt().plus(n),xe=!0,r.precision=e,r.rounding=t,n.ln())},Ae.inverseHyperbolicTangent=Ae.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?s(new o(i),e,t,!0):(o.precision=n=r-i.e,i=he(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},Ae.inverseSine=Ae.asin=function(){var e,t,n,r,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),n=s.precision,r=s.rounding,-1!==t?0===t?((e=l(s,n+4,r).times(.5)).s=i.s,e):new s(NaN):(s.precision=n+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=r,i.times(2)))},Ae.inverseTangent=Ae.atan=function(){var e,t,n,r,i,o,a,u,c,h=this,m=h.constructor,g=m.precision,f=m.rounding;if(h.isFinite()){if(h.isZero())return new m(h);if(h.abs().eq(1)&&ke>=g+4)return(a=l(m,g+4,f).times(.25)).s=h.s,a}else{if(!h.s)return new m(NaN);if(ke>=g+4)return(a=l(m,g+4,f).times(.5)).s=h.s,a}for(m.precision=u=g+10,m.rounding=1,e=n=Math.min(28,u/Re+2|0);e;--e)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(xe=!1,t=Math.ceil(u/Re),r=1,c=h.times(h),a=new m(h),i=h;-1!==e;)if(i=i.times(c),o=a.minus(i.div(r+=2)),i=i.times(c),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),xe=!0,s(a,m.precision=g,m.rounding=f,!0)},Ae.isFinite=function(){return!!this.d},Ae.isInteger=Ae.isInt=function(){return!!this.d&&Ie(this.e/Re)>this.d.length-2},Ae.isNaN=function(){return!this.s},Ae.isNegative=Ae.isNeg=function(){return this.s<0},Ae.isPositive=Ae.isPos=function(){return this.s>0},Ae.isZero=function(){return!!this.d&&0===this.d[0]},Ae.lessThan=Ae.lt=function(e){return this.cmp(e)<0},Ae.lessThanOrEqualTo=Ae.lte=function(e){return this.cmp(e)<1},Ae.logarithm=Ae.log=function(e){var n,i,o,a,l,c,h,m,g=this,f=g.constructor,p=f.precision,y=f.rounding;if(null==e)e=new f(10),n=!0;else{if(i=(e=new f(e)).d,e.s<0||!i||!i[0]||e.eq(1))return new f(NaN);n=e.eq(10)}if(i=g.d,g.s<0||!i||!i[0]||g.eq(1))return new f(i&&!i[0]?-1/0:1!=g.s?NaN:i?0:1/0);if(n)if(i.length>1)l=!0;else{for(a=i[0];a%10==0;)a/=10;l=1!==a}if(xe=!1,c=d(g,h=p+5),o=n?u(f,h+10):d(e,h),r((m=he(c,o,h,1)).d,a=p,y))do{if(c=d(g,h+=10),o=n?u(f,h+10):d(e,h),m=he(c,o,h,1),!l){+t(m.d).slice(a+1,a+15)+1==1e14&&(m=s(m,p+1,0));break}}while(r(m.d,a+=10,y));return xe=!0,s(m,p,y)},Ae.minus=Ae.sub=function(e){var t,n,r,i,o,u,l,c,h,m,g,f,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new d(e.d||p.s!==e.s?p:NaN):e=new d(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(h=p.d,f=e.d,l=d.precision,c=d.rounding,!h[0]||!f[0]){if(f[0])e.s=-e.s;else{if(!h[0])return new d(3===c?-0:0);e=new d(p)}return xe?s(e,l,c):e}if(n=Ie(e.e/Re),m=Ie(p.e/Re),h=h.slice(),o=m-n){for((g=0>o)?(t=h,o=-o,u=f.length):(t=f,n=m,u=h.length),o>(r=Math.max(Math.ceil(l/Re),u)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for(r=h.length,(g=(u=f.length)>r)&&(u=r),r=0;u>r;r++)if(h[r]!=f[r]){g=h[r]<f[r];break}o=0}for(g&&(t=h,h=f,f=t,e.s=-e.s),u=h.length,r=f.length-u;r>0;--r)h[u++]=0;for(r=f.length;r>o;){if(h[--r]<f[r]){for(i=r;i&&0===h[--i];)h[i]=Te-1;--h[i],h[r]+=Te}h[r]-=f[r]}for(;0===h[--u];)h.pop();for(;0===h[0];h.shift())--n;return h[0]?(e.d=h,e.e=a(h,n),xe?s(e,l,c):e):new d(3===c?-0:0)},Ae.modulo=Ae.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?s(new r(n),r.precision,r.rounding):(xe=!1,9==r.modulo?(t=he(n,e.abs(),0,3,1)).s*=e.s:t=he(n,e,0,r.modulo,1),t=t.times(e),xe=!0,n.minus(t))},Ae.naturalExponential=Ae.exp=function(){return p(this)},Ae.naturalLogarithm=Ae.ln=function(){return d(this)},Ae.negated=Ae.neg=function(){var e=new this.constructor(this);return e.s=-e.s,s(e)},Ae.plus=Ae.add=function(e){var t,n,r,i,o,u,l,c,h,m,g=this,f=g.constructor;if(e=new f(e),!g.d||!e.d)return g.s&&e.s?g.d||(e=new f(e.d||g.s===e.s?g:NaN)):e=new f(NaN),e;if(g.s!=e.s)return e.s=-e.s,g.minus(e);if(h=g.d,m=e.d,l=f.precision,c=f.rounding,!h[0]||!m[0])return m[0]||(e=new f(g)),xe?s(e,l,c):e;if(o=Ie(g.e/Re),r=Ie(e.e/Re),h=h.slice(),i=o-r){for(0>i?(n=h,i=-i,u=m.length):(n=m,r=o,u=h.length),i>(u=(o=Math.ceil(l/Re))>u?o+1:u+1)&&(i=u,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(0>(u=h.length)-(i=m.length)&&(i=u,n=m,m=h,h=n),t=0;i;)t=(h[--i]=h[i]+m[i]+t)/Te|0,h[i]%=Te;for(t&&(h.unshift(t),++r),u=h.length;0==h[--u];)h.pop();return e.d=h,e.e=a(h,r),xe?s(e,l,c):e},Ae.precision=Ae.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ve+e);return n.d?(t=c(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},Ae.round=function(){var e=this,t=e.constructor;return s(new t(e),e.e+1,t.rounding)},Ae.sine=Ae.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+Re,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(3>r)return w(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=w(e,2,t=t.times(Math.pow(5,-n)),t);for(var i,s=new e(5),o=new e(16),a=new e(20);n--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}(r,v(r,n)),r.precision=e,r.rounding=t,s(ce>2?n.neg():n,e,t,!0)):new r(NaN)},Ae.squareRoot=Ae.sqrt=function(){var e,n,r,i,o,a,u=this,l=u.d,c=u.e,h=u.s,m=u.constructor;if(1!==h||!l||!l[0])return new m(!h||0>h&&(!l||l[0])?NaN:l?u:1/0);for(xe=!1,0==(h=Math.sqrt(+u))||h==1/0?(((n=t(l)).length+c)%2==0&&(n+="0"),h=Math.sqrt(n),c=Ie((c+1)/2)-(0>c||c%2),i=new m(n=h==1/0?"1e"+c:(n=h.toExponential()).slice(0,n.indexOf("e")+1)+c)):i=new m(h.toString()),r=(c=m.precision)+3;;)if(i=(a=i).plus(he(u,a,r+2,1)).times(.5),t(a.d).slice(0,r)===(n=t(i.d)).slice(0,r)){if("9999"!=(n=n.slice(r-3,r+1))&&(o||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(s(i,c+1,1),e=!i.times(i).eq(u));break}if(!o&&(s(a,c+1,0),a.times(a).eq(u))){i=a;break}r+=4,o=1}return xe=!0,s(i,c,m.rounding,e)},Ae.tangent=Ae.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=he(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,s(2==ce||4==ce?n.neg():n,e,t,!0)):new r(NaN)},Ae.times=Ae.mul=function(e){var t,n,r,i,o,u,l,c,h,m=this,g=m.constructor,f=m.d,p=(e=new g(e)).d;if(e.s*=m.s,!(f&&f[0]&&p&&p[0]))return new g(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:f&&p?0*e.s:e.s/0);for(n=Ie(m.e/Re)+Ie(e.e/Re),c=f.length,(h=p.length)>c&&(o=f,f=p,p=o,u=c,c=h,h=u),o=[],r=u=c+h;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=c+r;i>r;)l=o[i]+p[r]*f[i-r-1]+t,o[i--]=l%Te|0,t=l/Te|0;o[i]=(o[i]+t)%Te|0}for(;!o[--u];)o.pop();for(t?++n:o.shift(),r=o.length;!o[--r];)o.pop();return e.d=o,e.e=a(o,n),xe?s(e,g.precision,g.rounding):e},Ae.toBinary=function(e,t){return b(this,2,e,t)},Ae.toDecimalPlaces=Ae.toDP=function(e,t){var r=this,i=r.constructor;return r=new i(r),void 0===e?r:(n(e,0,ge),void 0===t?t=i.rounding:n(t,0,8),s(r,e+r.e+1,t))},Ae.toExponential=function(e,t){var r,i=this,a=i.constructor;return void 0===e?r=o(i,!0):(n(e,0,ge),void 0===t?t=a.rounding:n(t,0,8),r=o(i=s(new a(i),e+1,t),!0,e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Ae.toFixed=function(e,t){var r,i,a=this,u=a.constructor;return void 0===e?r=o(a):(n(e,0,ge),void 0===t?t=u.rounding:n(t,0,8),r=o(i=s(new u(a),e+a.e+1,t),!1,e+i.e+1)),a.isNeg()&&!a.isZero()?"-"+r:r},Ae.toFraction=function(e){var n,r,i,s,o,a,u,l,h,m,g,f,p=this,d=p.d,y=p.constructor;if(!d)return new y(p);if(h=r=new y(1),i=l=new y(0),a=(o=(n=new y(i)).e=c(d)-p.e-1)%Re,n.d[0]=Ce(10,0>a?Re+a:a),null==e)e=o>0?n:h;else{if(!(u=new y(e)).isInt()||u.lt(h))throw Error(ve+u);e=u.gt(n)?o>0?n:h:u}for(xe=!1,u=new y(t(d)),m=y.precision,y.precision=o=d.length*Re*2;g=he(u,n,0,1,1),1!=(s=r.plus(g.times(i))).cmp(e);)r=i,i=s,s=h,h=l.plus(g.times(s)),l=s,s=n,n=u.minus(g.times(s)),u=s;return s=he(e.minus(r),i,0,1,1),l=l.plus(s.times(h)),r=r.plus(s.times(i)),l.s=h.s=p.s,f=he(h,i,o,1).minus(p).abs().cmp(he(l,r,o,1).minus(p).abs())<1?[h,i]:[l,r],y.precision=m,xe=!0,f},Ae.toHexadecimal=Ae.toHex=function(e,t){return b(this,16,e,t)},Ae.toJSON=function(){var e,n,r,s,o,a,u,l,c=this,h=c.s<0;if(!c.d)return fe.charAt(c.s?h?82:83:84);if(n=c.e,1===c.d.length&&4>n&&n>=0&&2857>(a=c.d[0]))return 41>a?fe.charAt(h?a+41:a):(a-=41,h&&(a+=2816),s=a/88|0,fe.charAt(s)+fe.charAt(a-88*s));if(l=t(c.d),u="",!h&&8>=n&&n>=-7)s=64+n+7;else if(h&&4>=n&&n>=-3)s=80+n+3;else if(l.length===n+1)s=32*h;else if(s=32*h+16*(0>n),88>(n=Math.abs(n)))s+=1,u=fe.charAt(n);else if(7744>n)s+=2,a=n/88|0,u=fe.charAt(a)+fe.charAt(n-88*a);else for(s+=o=(e=i(String(n),10,88)).length,r=0;o>r;r++)u+=fe.charAt(e[r]);for(u=fe.charAt(s)+u,o=(e=i(l,10,88)).length,r=0;o>r;r++)u+=fe.charAt(e[r]);return u},Ae.toNearest=function(e,t){var r=this,i=r.constructor;if(r=new i(r),null==e){if(!r.d)return r;e=new i(1),t=i.rounding}else{if(e=new i(e),void 0!==t&&n(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(xe=!1,4>t&&(t=[4,5,7,8][t]),r=he(r,e,0,t,1).times(e),xe=!0,s(r)):(e.s=r.s,r=e),r},Ae.toNumber=function(){return+this},Ae.toOctal=function(e,t){return b(this,8,e,t)},Ae.toPower=Ae.pow=function(e){var n,i,o,a,u,l,c,h=this,g=h.constructor,f=+(e=new g(e));if(!(h.d&&e.d&&h.d[0]&&e.d[0]))return new g(Ce(+h,f));if((h=new g(h)).eq(1))return h;if(o=g.precision,u=g.rounding,e.eq(1))return s(h,o,u);if(c=(n=Ie(e.e/Re))>=(i=e.d.length-1),l=h.s,c){if((i=0>f?-f:f)<=9007199254740991)return a=m(g,h,i,o),e.s<0?new g(1).div(a):s(a,o,u)}else if(0>l)return new g(NaN);return l=0>l&&1&e.d[Math.max(n,i)]?-1:1,(n=0!=(i=Ce(+h,f))&&isFinite(i)?new g(i+"").e:Ie(f*(Math.log("0."+t(h.d))/Math.LN10+h.e+1)))>g.maxE+1||n<g.minE-1?new g(n>0?l/0:0):(xe=!1,g.rounding=h.s=1,i=Math.min(12,(n+"").length),r((a=s(a=p(e.times(d(h,o+i)),o),o+5,1)).d,o,u)&&(n=o+10,+t((a=s(p(e.times(d(h,n+i)),n),n+5,1)).d).slice(o+1,o+15)+1==1e14&&(a=s(a,o+1,0))),a.s=l,xe=!0,g.rounding=u,s(a,o,u))},Ae.toPrecision=function(e,t){var r,i=this,a=i.constructor;return void 0===e?r=o(i,i.e<=a.toExpNeg||i.e>=a.toExpPos):(n(e,1,ge),void 0===t?t=a.rounding:n(t,0,8),r=o(i=s(new a(i),e,t),e<=i.e||i.e<=a.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+r:r},Ae.toSignificantDigits=Ae.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(n(e,1,ge),void 0===t?t=r.rounding:n(t,0,8)),s(new r(this),e,t)},Ae.toString=function(){var e=this,t=e.constructor,n=o(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},Ae.truncated=Ae.trunc=function(){return s(new this.constructor(this),this.e+1,1)},Ae.valueOf=function(){var e=this,t=e.constructor,n=o(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n},he=function(){function e(e,t,n){var r,i=0,s=e.length;for(e=e.slice();s--;)r=e[s]*t+i,e[s]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,s;if(n!=r)s=n>r?1:-1;else for(i=s=0;n>i;i++)if(e[i]!=t[i]){s=e[i]>t[i]?1:-1;break}return s}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,a,u,l){var c,h,m,g,f,p,d,y,S,x,w,v,b,I,C,E,$,B,_,T,R=r.constructor,N=r.s==i.s?1:-1,k=r.d,A=i.d;if(!(k&&k[0]&&A&&A[0]))return new R(r.s&&i.s&&(k?!A||k[0]!=A[0]:A)?k&&0==k[0]||!A?0*N:N/0:NaN);for(l?(f=1,h=r.e-i.e):(l=Te,f=Re,h=Ie(r.e/f)-Ie(i.e/f)),_=A.length,$=k.length,x=(S=new R(N)).d=[],m=0;A[m]==(k[m]||0);m++);if(A[m]>(k[m]||0)&&h--,null==o?(I=o=R.precision,a=R.rounding):I=u?o+(r.e-i.e)+1:o,0>I)x.push(1),p=!0;else{if(I=I/f+2|0,m=0,1==_){for(g=0,A=A[0],I++;($>m||g)&&I--;m++)C=g*l+(k[m]||0),x[m]=C/A|0,g=C%A|0;p=g||$>m}else{for((g=l/(A[0]+1)|0)>1&&(A=e(A,g,l),k=e(k,g,l),_=A.length,$=k.length),E=_,v=(w=k.slice(0,_)).length;_>v;)w[v++]=0;(T=A.slice()).unshift(0),B=A[0],A[1]>=l/2&&++B;do{g=0,0>(c=t(A,w,_,v))?(b=w[0],_!=v&&(b=b*l+(w[1]||0)),(g=b/B|0)>1?(g>=l&&(g=l-1),1==(c=t(d=e(A,g,l),w,y=d.length,v=w.length))&&(g--,n(d,y>_?T:A,y,l))):(0==g&&(c=g=1),d=A.slice()),v>(y=d.length)&&d.unshift(0),n(w,d,v,l),-1==c&&1>(c=t(A,w,_,v=w.length))&&(g++,n(w,v>_?T:A,v,l)),v=w.length):0===c&&(g++,w=[0]),x[m++]=g,c&&w[0]?w[v++]=k[E]||0:(w=[k[E]],v=1)}while((E++<$||void 0!==w[0])&&I--);p=void 0!==w[0]}x[0]||x.shift()}if(1==f)S.e=h,ue=p;else{for(m=1,g=x[0];g>=10;g/=10)m++;S.e=m+h*f-1,s(S,u?o+S.e+1:o,a,p)}return S}}(),ye=function e(t){function n(e){var t,r,i,s=this;if(!(s instanceof n))return new n(e);if(s.constructor=n,e instanceof n)return s.s=e.s,s.e=e.e,void(s.d=(e=e.d)?e.slice():e);if("number"==(i=typeof e)){if(0===e)return s.s=0>1/e?-1:1,s.e=0,void(s.d=[0]);if(0>e?(e=-e,s.s=-1):s.s=1,e===~~e&&1e7>e){for(t=0,r=e;r>=10;r/=10)t++;return s.e=t,void(s.d=[e])}return 0*e!=0?(e||(s.s=NaN),s.e=NaN,void(s.d=null)):S(s,e.toString())}if("string"!==i)throw Error(ve+e);return 45===e.charCodeAt(0)?(e=e.slice(1),s.s=-1):s.s=1,_e.test(e)?S(s,e):x(s,e)}var r,i,s;if(n.prototype=Ae,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=O,n.clone=e,n.abs=C,n.acos=E,n.acosh=$,n.add=B,n.asin=_,n.asinh=T,n.atan=R,n.atanh=N,n.atan2=k,n.cbrt=A,n.ceil=D,n.cos=M,n.cosh=P,n.div=V,n.exp=L,n.floor=F,n.fromJSON=G,n.hypot=q,n.ln=U,n.log=z,n.log10=H,n.log2=j,n.max=W,n.min=Z,n.mod=K,n.mul=J,n.pow=X,n.random=Y,n.round=Q,n.sign=ee,n.sin=te,n.sinh=ne,n.sqrt=re,n.sub=ie,n.tan=se,n.tanh=oe,n.trunc=ae,void 0===t&&(t={}),t)for(s=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<s.length;)t.hasOwnProperty(i=s[r++])||(t[i]=this[i]);return n.config(t),n}(ye),pe=new ye(pe),de=new ye(de),Bridge.$Decimal=ye,"function"==typeof define&&define.amd)define((function(){return ye}));else if("undefined"!=typeof module&&module.exports){if(module.exports=ye,!Se)try{Se=require("crypto")}catch(e){}}else e||(e="undefined"!=typeof self&&self&&self.self==self?self:Function("return this")()),le=e.Decimal,ye.noConflict=function(){return e.Decimal=le,ye},e.Decimal=ye}(Bridge.global),System.Decimal=function(e,t,n){var r;if(this.constructor!==System.Decimal)return new System.Decimal(e,t,n);if(null==e&&(e=0),"string"==typeof e){if((r=(t=t||System.Globalization.CultureInfo.getCurrentCulture())&&t.getFormat(System.Globalization.NumberFormatInfo))&&"."!==r.numberDecimalSeparator&&(e=e.replace(r.numberDecimalSeparator,".")),!/^\s*[+-]?(\d+|\d+.|\d*\.\d+)((e|E)[+-]?\d+)?\s*$/.test(e))throw new System.FormatException;e=e.replace(/\s/g,"")}if(n&&n.precision&&"number"==typeof e){var i=(Bridge.Int.trunc(e)+"").length,s=n.precision-i;s<0&&(s=0),e=e.toFixed(s)}this.value=System.Decimal.getValue(e)},System.Decimal.$$name="System.Decimal",System.Decimal.prototype.$$name="System.Decimal",System.Decimal.$kind="struct",System.Decimal.prototype.$kind="struct",System.Decimal.$$inherits=[],Bridge.Class.addExtend(System.Decimal,[System.IComparable,System.IFormattable,System.IComparable$1(System.Decimal),System.IEquatable$1(System.Decimal)]),System.Decimal.$is=function(e){return e instanceof System.Decimal},System.Decimal.getDefaultValue=function(){return new System.Decimal(0)},System.Decimal.getValue=function(e){return Bridge.hasValue(e)?e instanceof System.Decimal?e.value:e instanceof System.Int64||e instanceof System.UInt64?new Bridge.$Decimal(e.toString()):new Bridge.$Decimal(e):this.getDefaultValue()},System.Decimal.create=function(e){return Bridge.hasValue(e)?e instanceof System.Decimal?e:new System.Decimal(e):null},System.Decimal.lift=function(e){return null==e?null:System.Decimal.create(e)},System.Decimal.prototype.toString=function(e,t){return e||t?Bridge.Int.format(this,e,t):this.value.toString()},System.Decimal.prototype.toFloat=function(){return this.value.toNumber()},System.Decimal.prototype.toJSON=function(){return this.value.toNumber()},System.Decimal.prototype.format=function(e,t){return Bridge.Int.format(this.toFloat(),e,t)},System.Decimal.prototype.decimalPlaces=function(){return this.value.decimalPlaces()},System.Decimal.prototype.dividedToIntegerBy=function(e){return new System.Decimal(this.value.dividedToIntegerBy(System.Decimal.getValue(e)))},System.Decimal.prototype.exponential=function(){return new System.Decimal(this.value.exponential())},System.Decimal.prototype.abs=function(){return new System.Decimal(this.value.abs())},System.Decimal.prototype.floor=function(){return new System.Decimal(this.value.floor())},System.Decimal.prototype.ceil=function(){return new System.Decimal(this.value.ceil())},System.Decimal.prototype.trunc=function(){return new System.Decimal(this.value.trunc())},System.Decimal.round=function(e,t){var n,r;return e=System.Decimal.create(e),n=Bridge.$Decimal.rounding,Bridge.$Decimal.rounding=t,r=new System.Decimal(e.value.round()),Bridge.$Decimal.rounding=n,r},System.Decimal.toDecimalPlaces=function(e,t,n){return e=System.Decimal.create(e),new System.Decimal(e.value.toDecimalPlaces(t,n))},System.Decimal.prototype.compareTo=function(e){return this.value.comparedTo(System.Decimal.getValue(e))},System.Decimal.prototype.add=function(e){return new System.Decimal(this.value.plus(System.Decimal.getValue(e)))},System.Decimal.prototype.sub=function(e){return new System.Decimal(this.value.minus(System.Decimal.getValue(e)))},System.Decimal.prototype.isZero=function(){return this.value.isZero},System.Decimal.prototype.mul=function(e){return new System.Decimal(this.value.times(System.Decimal.getValue(e)))},System.Decimal.prototype.div=function(e){return new System.Decimal(this.value.dividedBy(System.Decimal.getValue(e)))},System.Decimal.prototype.mod=function(e){return new System.Decimal(this.value.modulo(System.Decimal.getValue(e)))},System.Decimal.prototype.neg=function(){return new System.Decimal(this.value.negated())},System.Decimal.prototype.inc=function(){return new System.Decimal(this.value.plus(System.Decimal.getValue(1)))},System.Decimal.prototype.dec=function(){return new System.Decimal(this.value.minus(System.Decimal.getValue(1)))},System.Decimal.prototype.sign=function(){return this.value.isZero()?0:this.value.isNegative()?-1:1},System.Decimal.prototype.clone=function(){return new System.Decimal(this)},System.Decimal.prototype.ne=function(e){return!!this.compareTo(e)},System.Decimal.prototype.lt=function(e){return this.compareTo(e)<0},System.Decimal.prototype.lte=function(e){return this.compareTo(e)<=0},System.Decimal.prototype.gt=function(e){return this.compareTo(e)>0},System.Decimal.prototype.gte=function(e){return this.compareTo(e)>=0},System.Decimal.prototype.equals=function(e){return!this.compareTo(e)},System.Decimal.prototype.equalsT=function(e){return!this.compareTo(e)},System.Decimal.prototype.getHashCode=function(){for(var e=397*this.sign()+this.value.e|0,t=0;t<this.value.d.length;t++)e=397*e+this.value.d[t]|0;return e},System.Decimal.toInt=function(e,t){var n,r,i;if(!e)return null;if(t){if(t===System.Int64){if((n=e.value.trunc().toString())!==(r=new System.Int64(n)).value.toString())throw new System.OverflowException;return r}if(t===System.UInt64){if(e.value.isNegative())throw new System.OverflowException;if((n=e.value.trunc().toString())!==(r=new System.UInt64(n)).value.toString())throw new System.OverflowException;return r}return Bridge.Int.check(Bridge.Int.trunc(e.value.toNumber()),t)}if(i=Bridge.Int.trunc(System.Decimal.getValue(e).toNumber()),!Bridge.Int.$is(i))throw new System.OverflowException;return i},System.Decimal.tryParse=function(e,t,n){try{return n.v=new System.Decimal(e,t),!0}catch(e){return n.v=new System.Decimal(0),!1}},System.Decimal.toFloat=function(e){return e?System.Decimal.getValue(e).toNumber():null},System.Decimal.setConfig=function(e){Bridge.$Decimal.config(e)},System.Decimal.min=function(){for(var e=[],t=0,n=arguments.length;t<n;t++)e.push(System.Decimal.getValue(arguments[t]));return new System.Decimal(Bridge.$Decimal.min.apply(Bridge.$Decimal,e))},System.Decimal.max=function(){for(var e=[],t=0,n=arguments.length;t<n;t++)e.push(System.Decimal.getValue(arguments[t]));return new System.Decimal(Bridge.$Decimal.max.apply(Bridge.$Decimal,e))},System.Decimal.random=function(e){return new System.Decimal(Bridge.$Decimal.random(e))},System.Decimal.exp=function(e){return new System.Decimal(System.Decimal.getValue(e).exp())},System.Decimal.exp=function(e){return new System.Decimal(System.Decimal.getValue(e).exp())},System.Decimal.ln=function(e){return new System.Decimal(System.Decimal.getValue(e).ln())},System.Decimal.log=function(e,t){return new System.Decimal(System.Decimal.getValue(e).log(t))},System.Decimal.pow=function(e,t){return new System.Decimal(System.Decimal.getValue(e).pow(t))},System.Decimal.sqrt=function(e){return new System.Decimal(System.Decimal.getValue(e).sqrt())},System.Decimal.prototype.isFinite=function(){return this.value.isFinite()},System.Decimal.prototype.isInteger=function(){return this.value.isInteger()},System.Decimal.prototype.isNaN=function(){return this.value.isNaN()},System.Decimal.prototype.isNegative=function(){return this.value.isNegative()},System.Decimal.prototype.isZero=function(){return this.value.isZero()},System.Decimal.prototype.log=function(e){return new System.Decimal(this.value.log(e))},System.Decimal.prototype.ln=function(){return new System.Decimal(this.value.ln())},System.Decimal.prototype.precision=function(){return this.value.precision()},System.Decimal.prototype.round=function(){var e,t=Bridge.$Decimal.rounding;return Bridge.$Decimal.rounding=6,e=new System.Decimal(this.value.round()),Bridge.$Decimal.rounding=t,e},System.Decimal.prototype.sqrt=function(){return new System.Decimal(this.value.sqrt())},System.Decimal.prototype.toDecimalPlaces=function(e,t){return new System.Decimal(this.value.toDecimalPlaces(e,t))},System.Decimal.prototype.toExponential=function(e,t){return this.value.toExponential(e,t)},System.Decimal.prototype.toFixed=function(e,t){return this.value.toFixed(e,t)},System.Decimal.prototype.pow=function(e){return new System.Decimal(this.value.pow(e))},System.Decimal.prototype.toPrecision=function(e,t){return this.value.toPrecision(e,t)},System.Decimal.prototype.toSignificantDigits=function(e,t){return new System.Decimal(this.value.toSignificantDigits(e,t))},System.Decimal.prototype.valueOf=function(){return this.value.valueOf()},System.Decimal.prototype.toFormat=function(e,t,n){var r,i,s,o=Bridge.$Decimal.format;return n&&!n.getFormat?(i=Bridge.merge({},o||{}),Bridge.$Decimal.format=Bridge.merge(i,n),r=this.value.toFormat(e,t)):((s=(n=n||System.Globalization.CultureInfo.getCurrentCulture())&&n.getFormat(System.Globalization.NumberFormatInfo))&&(Bridge.$Decimal.format.decimalSeparator=s.numberDecimalSeparator,Bridge.$Decimal.format.groupSeparator=s.numberGroupSeparator,Bridge.$Decimal.format.groupSize=s.numberGroupSizes[0]),r=this.value.toFormat(e,t)),Bridge.$Decimal.format=o,r},Bridge.$Decimal.config({precision:29}),System.Decimal.Zero=System.Decimal(0),System.Decimal.One=System.Decimal(1),System.Decimal.MinusOne=System.Decimal(-1),System.Decimal.MinValue=System.Decimal("-79228162514264337593543950335"),System.Decimal.MaxValue=System.Decimal("79228162514264337593543950335"),System.Decimal.precision=29,Bridge.define("System.DayOfWeek",{$kind:"enum",$statics:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6}}),a={getDefaultValue:function(){return new Date(-864e13)},utcNow:function(){var e=new Date;return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())},today:function(){var e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())},timeOfDay:function(e){return new System.TimeSpan(1e4*(e-new Date(e.getFullYear(),e.getMonth(),e.getDate())))},isUseGenitiveForm:function(e,t,n,r){for(var i=0,s=t-1;s>=0&&e[s]!==r;s--);if(s>=0){for(;--s>=0&&e[s]===r;)i++;if(i<=1)return!0}for(s=t+n;s<e.length&&e[s]!==r;s++);if(s<e.length){for(i=0;++s<e.length&&e[s]===r;)i++;if(i<=1)return!0}return!1},format:function(e,t,n){var r,i=this,s=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),o=e.getFullYear(),a=e.getMonth(),u=e.getDate(),l=e.getDay(),c=e.getHours(),h=e.getMinutes(),m=e.getSeconds(),g=e.getMilliseconds(),f=e.getTimezoneOffset();return 1===(t=t||"G").length?(r=s.getAllDateTimePatterns(t,!0),t=r?r[0]:t):2===t.length&&"%"===t.charAt(0)&&(t=t.charAt(1)),t.replace(/(\\.|'[^']*'|"[^"]*"|d{1,4}|M{1,4}|yyyy|yy|y|HH?|hh?|mm?|ss?|tt?|f{1,3}|z{1,3}|\:|\/)/g,(function(e,n,r){var p=e;switch(e){case"dddd":p=s.dayNames[l];break;case"ddd":p=s.abbreviatedDayNames[l];break;case"dd":p=u<10?"0"+u:u;break;case"d":p=u;break;case"MMMM":p=i.isUseGenitiveForm(t,r,4,"d")?s.monthGenitiveNames[a]:s.monthNames[a];break;case"MMM":p=i.isUseGenitiveForm(t,r,3,"d")?s.abbreviatedMonthGenitiveNames[a]:s.abbreviatedMonthNames[a];break;case"MM":p=a+1<10?"0"+(a+1):a+1;break;case"M":p=a+1;break;case"yyyy":p=o;break;case"yy":1===(p=(o%100).toString()).length&&(p="0"+p);break;case"y":p=o%100;break;case"h":case"hh":(p=c%12)?"hh"===e&&1===p.length&&(p="0"+p):p="12";break;case"HH":1===(p=c.toString()).length&&(p="0"+p);break;case"H":p=c;break;case"mm":1===(p=h.toString()).length&&(p="0"+p);break;case"m":p=h;break;case"ss":1===(p=m.toString()).length&&(p="0"+p);break;case"s":p=m;break;case"t":case"tt":p=c<12?s.amDesignator:s.pmDesignator,"t"===e&&(p=p.charAt(0));break;case"f":case"ff":case"fff":(p=g.toString()).length<3&&(p=Array(3-p.length).join("0")+p),"ff"===e?p=p.substr(0,2):"f"===e&&(p=p.charAt(0));break;case"z":p=((p=f/60)>=0?"-":"+")+Math.floor(Math.abs(p));break;case"zz":case"zzz":p=((p=f/60)>=0?"-":"+")+System.String.alignString(Math.floor(Math.abs(p)).toString(),2,"0",2),"zzz"===e&&(p+=s.timeSeparator+System.String.alignString(Math.floor(Math.abs(f%60)).toString(),2,"0",2));break;case":":p=s.timeSeparator;break;case"/":p=s.dateSeparator;break;default:p=e.substr(1,e.length-1-("\\"!==e.charAt(0)))}return p}))},parse:function(e,t,n,r){var i=this.parseExact(e,null,t,n,!0);if(null!==i)return i;if(i=Date.parse(e),!isNaN(i))return new Date(i);if(!r)throw new System.FormatException("String does not contain a valid string representation of a date and time.")},parseExact:function(e,t,n,r,i){var s,o;if(t||(t=["G","g","F","f","D","d","R","r","s","S","U","u","O","o","Y","y","M","m","T","t"]),Bridge.isArray(t)){for(s=0;s<t.length;s++)if(null!=(o=Bridge.Date.parseExact(e,t[s],n,r,!0)))return o;if(i)return null;throw new System.FormatException("String does not contain a valid string representation of a date and time.")}var a,u,l,c,h,m,g,f,p,d=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),y=d.amDesignator,S=d.pmDesignator,x=0,w=0,v=0,b=0,I=1,C=1,E=0,$=0,B=0,_=0,T="",R=0,N=0,k=!1,A=!1;if(null==e)throw new System.ArgumentNullException("str");for(1===(t=t||"G").length?t=(p=d.getAllDateTimePatterns(t,!0))?p[0]:t:2===t.length&&"%"===t.charAt(0)&&(t=t.charAt(1));w<t.length;){if(a=t.charAt(w),u="","\\"===A)u+=a,w++;else for(;t.charAt(w)===a&&w<t.length;)u+=a,w++;if(f=!0,!A)if("yyyy"===u||"yy"===u||"y"===u){if("yyyy"===u?b=this.subparseInt(e,x,4,4):"yy"===u?b=this.subparseInt(e,x,2,2):"y"===u&&(b=this.subparseInt(e,x,2,4)),null==b){k=!0;break}x+=b.length,2===b.length&&(b=((b=~~b)>30?1900:2e3)+b)}else if("MMM"===u||"MMMM"===u){for(I=0,m="MMM"===u?this.isUseGenitiveForm(t,w,3,"d")?d.abbreviatedMonthGenitiveNames:d.abbreviatedMonthNames:this.isUseGenitiveForm(t,w,4,"d")?d.monthGenitiveNames:d.monthNames,v=0;v<m.length;v++)if(g=m[v],e.substring(x,x+g.length).toLowerCase()===g.toLowerCase()){I=v%12+1,x+=g.length;break}if(I<1||I>12){k=!0;break}}else if("MM"===u||"M"===u){if(null==(I=this.subparseInt(e,x,u.length,2))||I<1||I>12){k=!0;break}x+=I.length}else if("dddd"===u||"ddd"===u){for(m="ddd"===u?d.abbreviatedDayNames:d.dayNames,v=0;v<m.length;v++)if(g=m[v],e.substring(x,x+g.length).toLowerCase()===g.toLowerCase()){x+=g.length;break}}else if("dd"===u||"d"===u){if(null==(C=this.subparseInt(e,x,u.length,2))||C<1||C>31){k=!0;break}x+=C.length}else if("hh"===u||"h"===u){if(null==(E=this.subparseInt(e,x,u.length,2))||E<1||E>12){k=!0;break}x+=E.length}else if("HH"===u||"H"===u){if(null==(E=this.subparseInt(e,x,u.length,2))||E<0||E>23){k=!0;break}x+=E.length}else if("mm"===u||"m"===u){if(null==($=this.subparseInt(e,x,u.length,2))||$<0||$>59)return null;x+=$.length}else if("ss"===u||"s"===u){if(null==(B=this.subparseInt(e,x,u.length,2))||B<0||B>59){k=!0;break}x+=B.length}else if("u"===u){if(null==(_=this.subparseInt(e,x,1,7))){k=!0;break}x+=_.length,_.length>3&&(_=_.substring(0,3))}else if("fffffff"===u||"ffffff"===u||"fffff"===u||"ffff"===u||"fff"===u||"ff"===u||"f"===u){if(null==(_=this.subparseInt(e,x,u.length,7))){k=!0;break}x+=_.length,_.length>3&&(_=_.substring(0,3))}else if("t"===u){if(e.substring(x,x+1).toLowerCase()===y.charAt(0).toLowerCase())T=y;else{if(e.substring(x,x+1).toLowerCase()!==S.charAt(0).toLowerCase()){k=!0;break}T=S}x+=1}else if("tt"===u){if(e.substring(x,x+2).toLowerCase()===y.toLowerCase())T=y;else{if(e.substring(x,x+2).toLowerCase()!==S.toLowerCase()){k=!0;break}T=S}x+=2}else if("z"===u||"zz"===u){if("-"===(c=e.charAt(x)))h=!0;else{if("+"!==c){k=!0;break}h=!1}if(x++,null==(R=this.subparseInt(e,x,1,2))||R>14){k=!0;break}x+=R.length,h&&(R=-R)}else if("zzz"===u){if(g=e.substring(x,x+6),x+=6,6!==g.length){k=!0;break}if("-"===(c=g.charAt(0)))h=!0;else{if("+"!==c){k=!0;break}h=!1}if(l=1,null==(R=this.subparseInt(g,l,1,2))||R>14){k=!0;break}if(l+=R.length,h&&(R=-R),g.charAt(l)!==d.timeSeparator){k=!0;break}if(l++,null==(N=this.subparseInt(g,l,1,2))||R>59){k=!0;break}}else f=!1;if(A||!f){if(g=e.substring(x,x+u.length),!A&&(":"===u&&g!==d.timeSeparator||"/"===u&&g!==d.dateSeparator)||g!==u&&"'"!==u&&'"'!==u&&"\\"!==u){k=!0;break}if("\\"===A&&(A=!1),"'"!==u&&'"'!==u&&"\\"!==u)x+=u.length;else if(!1===A)A=u;else{if(A!==u){k=!0;break}A=!1}}}if(A&&(k=!0),k||(x!==e.length?k=!0:2===I?b%4==0&&b%100!=0||b%400==0?C>29&&(k=!0):C>28&&(k=!0):(4===I||6===I||9===I||11===I)&&C>30&&(k=!0)),k){if(i)return null;throw new System.FormatException("String does not contain a valid string representation of a date and time.")}return E<12&&T===S?E=+E+12:E>11&&T===y&&(E-=12),0!==R||0!==N||r?new Date(Date.UTC(b,I-1,C,E-R,$-N,B,_)):new Date(b,I-1,C,E,$,B,_)},subparseInt:function(e,t,n,r){for(var i,s=r;s>=n;s--){if((i=e.substring(t,t+s)).length<n)return null;if(/^\d+$/.test(i))return i}return null},tryParse:function(e,t,n,r){return n.v=this.parse(e,t,r,!0),null!=n.v||(n.v=new Date(-864e13),!1)},tryParseExact:function(e,t,n,r,i){return r.v=this.parseExact(e,t,n,i,!0),null!=r.v||(r.v=new Date(-864e13),!1)},isDaylightSavingTime:function(e){var t=Bridge.Date.today();return t.setMonth(0),t.setDate(1),t.getTimezoneOffset()!==e.getTimezoneOffset()},toUTC:function(e){return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())},toLocal:function(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},dateAddSubTimespan:function(e,t,n){var r=new Date(e.getTime());return r.setDate(r.getDate()+n*t.getDays()),r.setHours(r.getHours()+n*t.getHours()),r.setMinutes(r.getMinutes()+n*t.getMinutes()),r.setSeconds(r.getSeconds()+n*t.getSeconds()),r.setMilliseconds(r.getMilliseconds()+n*t.getMilliseconds()),r},subdt:function(e,t){return Bridge.hasValue$1(e,t)?this.dateAddSubTimespan(e,t,-1):null},adddt:function(e,t){return Bridge.hasValue$1(e,t)?this.dateAddSubTimespan(e,t,1):null},subdd:function(e,t){return Bridge.hasValue$1(e,t)?new System.TimeSpan(1e4*(e-t)):null},gt:function(e,t){return!!Bridge.hasValue$1(e,t)&&e>t},gte:function(e,t){return!!Bridge.hasValue$1(e,t)&&e>=t},lt:function(e,t){return!!Bridge.hasValue$1(e,t)&&e<t},lte:function(e,t){return!!Bridge.hasValue$1(e,t)&&e<=t}},Bridge.Date=a,Bridge.define("System.TimeSpan",{inherits:[System.IComparable],config:{alias:["compareTo","System$IComparable$compareTo"]},$kind:"struct",statics:{fromDays:function(e){return new System.TimeSpan(864e9*e)},fromHours:function(e){return new System.TimeSpan(36e9*e)},fromMilliseconds:function(e){return new System.TimeSpan(1e4*e)},fromMinutes:function(e){return new System.TimeSpan(6e8*e)},fromSeconds:function(e){return new System.TimeSpan(1e7*e)},fromTicks:function(e){return new System.TimeSpan(e)},ctor:function(){this.zero=new System.TimeSpan(System.Int64.Zero),this.maxValue=new System.TimeSpan(System.Int64.MaxValue),this.minValue=new System.TimeSpan(System.Int64.MinValue)},getDefaultValue:function(){return new System.TimeSpan(System.Int64.Zero)},neg:function(e){return Bridge.hasValue(e)?new System.TimeSpan(e.ticks.neg()):null},sub:function(e,t){return Bridge.hasValue$1(e,t)?new System.TimeSpan(e.ticks.sub(t.ticks)):null},eq:function(e,t){return Bridge.hasValue$1(e,t)?e.ticks.eq(t.ticks):null},neq:function(e,t){return Bridge.hasValue$1(e,t)?e.ticks.ne(t.ticks):null},plus:function(e){return Bridge.hasValue(e)?new System.TimeSpan(e.ticks):null},add:function(e,t){return Bridge.hasValue$1(e,t)?new System.TimeSpan(e.ticks.add(t.ticks)):null},gt:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.gt(t.ticks)},gte:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.gte(t.ticks)},lt:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.lt(t.ticks)},lte:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.lte(t.ticks)}},ctor:function(){this.$initialize(),this.ticks=System.Int64.Zero,1===arguments.length?this.ticks=arguments[0]instanceof System.Int64?arguments[0]:new System.Int64(arguments[0]):3===arguments.length?this.ticks=new System.Int64(arguments[0]).mul(60).add(arguments[1]).mul(60).add(arguments[2]).mul(1e7):4===arguments.length?this.ticks=new System.Int64(arguments[0]).mul(24).add(arguments[1]).mul(60).add(arguments[2]).mul(60).add(arguments[3]).mul(1e7):5===arguments.length&&(this.ticks=new System.Int64(arguments[0]).mul(24).add(arguments[1]).mul(60).add(arguments[2]).mul(60).add(arguments[3]).mul(1e3).add(arguments[4]).mul(1e4))},getTicks:function(){return this.ticks},getDays:function(){return this.ticks.div(864e9).toNumber()},getHours:function(){return this.ticks.div(36e9).mod(24).toNumber()},getMilliseconds:function(){return this.ticks.div(1e4).mod(1e3).toNumber()},getMinutes:function(){return this.ticks.div(6e8).mod(60).toNumber()},getSeconds:function(){return this.ticks.div(1e7).mod(60).toNumber()},getTotalDays:function(){return this.ticks.toNumberDivided(864e9)},getTotalHours:function(){return this.ticks.toNumberDivided(36e9)},getTotalMilliseconds:function(){return this.ticks.toNumberDivided(1e4)},getTotalMinutes:function(){return this.ticks.toNumberDivided(6e8)},getTotalSeconds:function(){return this.ticks.toNumberDivided(1e7)},get12HourHour:function(){return this.getHours()>12?this.getHours()-12:0===this.getHours()?12:this.getHours()},add:function(e){return new System.TimeSpan(this.ticks.add(e.ticks))},subtract:function(e){return new System.TimeSpan(this.ticks.sub(e.ticks))},duration:function(){return new System.TimeSpan(this.ticks.abs())},negate:function(){return new System.TimeSpan(this.ticks.neg())},compareTo:function(e){return this.ticks.compareTo(e.ticks)},equals:function(e){return e.ticks.eq(this.ticks)},equalsT:function(e){return e.ticks.eq(this.ticks)},format:function(e,t){return this.toString(e,t)},getHashCode:function(){return this.ticks.getHashCode()},toString:function(e,t){var n=this.ticks,r="",i=this,s=(t||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),o=function(e,t,n,r){return System.String.alignString((0|e).toString(),t||2,"0",n||2,r||!1)};return e?e.replace(/(\\.|'[^']*'|"[^"]*"|dd?|HH?|hh?|mm?|ss?|tt?|f{1,7}|\:|\/)/g,(function(e){switch(e){case"d":return i.getDays();case"dd":return o(i.getDays());case"H":return i.getHours();case"HH":return o(i.getHours());case"h":return i.get12HourHour();case"hh":return o(i.get12HourHour());case"m":return i.getMinutes();case"mm":return o(i.getMinutes());case"s":return i.getSeconds();case"ss":return o(i.getSeconds());case"t":return(i.getHours()<12?s.amDesignator:s.pmDesignator).substring(0,1);case"tt":return i.getHours()<12?s.amDesignator:s.pmDesignator;case"f":case"ff":case"fff":case"ffff":case"fffff":case"ffffff":case"fffffff":return o(i.getMilliseconds(),e.length,1,!0);default:return e.substr(1,e.length-1-("\\"!==e.charAt(0)))}})):(n.abs().gte(864e9)&&(r+=o(n.toNumberDivided(864e9))+".",n=n.mod(864e9)),r+=o(n.toNumberDivided(36e9))+":",n=n.mod(36e9),r+=o(0|n.toNumberDivided(6e8))+":",n=n.mod(6e8),r+=o(n.toNumberDivided(1e7)),(n=n.mod(1e7)).gt(0)&&(r+="."+o(n.toNumber(),7)),r)}}),Bridge.Class.addExtend(System.TimeSpan,[System.IComparable$1(System.TimeSpan),System.IEquatable$1(System.TimeSpan)]),Bridge.define("System.Text.StringBuilder",{ctor:function(){this.$initialize(),this.buffer=[],this.capacity=16,1===arguments.length?this.append(arguments[0]):2===arguments.length?(this.append(arguments[0]),this.setCapacity(arguments[1])):3===arguments.length&&this.append(arguments[0],arguments[1],arguments[2])},getLength:function(){if(this.buffer.length<2)return this.buffer[0]?this.buffer[0].length:0;var e=this.buffer.join("");return this.buffer=[],this.buffer[0]=e,e.length},getCapacity:function(){var e=this.getLength();return this.capacity>e?this.capacity:e},setCapacity:function(e){e>this.getLength()&&(this.capacity=e)},toString:function(){var e,t,n=this.buffer.join("");return this.buffer=[],this.buffer[0]=n,2===arguments.length?(e=arguments[0],t=arguments[1],this.checkLimits(n,e,t),n.substr(e,t)):n},append:function(e){var t,n;if(null==e)return this;if(2===arguments.length){if(0===(n=arguments[1]))return this;if(n<0)throw new System.ArgumentOutOfRangeException("count","cannot be less than zero");e=Array(n+1).join(e).toString()}else if(3===arguments.length){if(t=arguments[1],0===(n=arguments[2]))return this;this.checkLimits(e,t,n),e=e.substr(t,n)}return this.buffer[this.buffer.length]=e,this},appendFormat:function(){return this.append(System.String.format.apply(System.String,arguments))},clear:function(){return this.buffer=[],this},appendLine:function(){return 1===arguments.length&&this.append(arguments[0]),this.append("\r\n")},equals:function(e){return null!=e&&(e===this||this.toString()===e.toString())},remove:function(e,t){var n=this.buffer.join("");return this.checkLimits(n,e,t),n.length===t&&0===e?this.clear():(t>0&&(this.buffer=[],this.buffer[0]=n.substring(0,e),this.buffer[1]=n.substring(e+t,n.length)),this)},insert:function(e,t){var n,r;if(null==t)return this;if(3===arguments.length){if(0===(n=arguments[2]))return this;if(n<0)throw new System.ArgumentOutOfRangeException("count","cannot be less than zero");t=Array(n+1).join(t).toString()}return r=this.buffer.join(""),this.buffer=[],e<1?(this.buffer[0]=t,this.buffer[1]=r):e>=r.length?(this.buffer[0]=r,this.buffer[1]=t):(this.buffer[0]=r.substring(0,e),this.buffer[1]=t,this.buffer[2]=r.substring(e,r.length)),this},replace:function(e,t){var n=new RegExp(e,"g"),r=this.buffer.join("");if(this.buffer=[],4===arguments.length){var i=arguments[2],s=arguments[3],o=r.substr(i,s);this.checkLimits(r,i,s),this.buffer[0]=r.substring(0,i),this.buffer[1]=o.replace(n,t),this.buffer[2]=r.substring(i+s,r.length)}else this.buffer[0]=r.replace(n,t);return this},checkLimits:function(e,t,n){if(n<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(t<0)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero");if(n>e.length-t)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string")}}),function(){var e=RegExp("[-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]","g");Bridge.regexpEscape=function(t){return t.replace(e,"\\$&")}}(),System.Diagnostics.Debug={writeln:function(e){Bridge.Console.debug(e)},_fail:function(e){System.Diagnostics.Debug.writeln(e)},assert:function(e,t){e||(t="Assert failed: "+t,confirm(t+"\r\n\r\nBreak into debugger?")&&System.Diagnostics.Debug._fail(t))},fail:function(e){System.Diagnostics.Debug._fail(e)}},Bridge.define("System.Diagnostics.Stopwatch",{ctor:function(){this.$initialize(),this._stopTime=System.Int64.Zero,this._startTime=System.Int64.Zero,this.isRunning=!1},reset:function(){this._stopTime=this._startTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!1},ticks:function(){return(this.isRunning?System.Diagnostics.Stopwatch.getTimestamp():this._stopTime).sub(this._startTime)},milliseconds:function(){return this.ticks().mul(1e3).div(System.Diagnostics.Stopwatch.frequency)},timeSpan:function(){return new System.TimeSpan(this.milliseconds().mul(1e4))},start:function(){this.isRunning||(this._startTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!0)},stop:function(){this.isRunning&&(this._stopTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!1)},restart:function(){this.isRunning=!1,this.start()},statics:{startNew:function(){var e=new System.Diagnostics.Stopwatch;return e.start(),e}}}),"undefined"!=typeof window&&window.performance&&window.performance.now?(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e6),System.Diagnostics.Stopwatch.isHighResolution=!0,System.Diagnostics.Stopwatch.getTimestamp=function(){return new System.Int64(Math.round(1e3*window.performance.now()))}):"undefined"!=typeof process&&process.hrtime?(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e9),System.Diagnostics.Stopwatch.isHighResolution=!0,System.Diagnostics.Stopwatch.getTimestamp=function(){var e=process.hrtime();return new System.Int64(e[0]).mul(1e9).add(e[1])}):(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e3),System.Diagnostics.Stopwatch.isHighResolution=!1,System.Diagnostics.Stopwatch.getTimestamp=function(){return new System.Int64((new Date).valueOf())}),System.Diagnostics.Contracts.Contract={reportFailure:function(e,t,n,r,i){var s,o,a=n.toString();throw s=(a=(a=a.substring(a.indexOf("return")+7)).substr(0,a.lastIndexOf(";")))?"Contract '"+a+"' failed":"Contract failed",o=t?s+": "+t:s,i?new i(a,t):new System.Diagnostics.Contracts.ContractException(e,o,t,a,r)},assert:function(e,t,n){t()||System.Diagnostics.Contracts.Contract.reportFailure(e,n,t,null)},requires:function(e,t,n){t()||System.Diagnostics.Contracts.Contract.reportFailure(0,n,t,null,e)},forAll:function(e,t,n){if(!n)throw new System.ArgumentNullException("predicate");for(;e<t;e++)if(!n(e))return!1;return!0},forAll$1:function(e,t){if(!e)throw new System.ArgumentNullException("collection");if(!t)throw new System.ArgumentNullException("predicate");var n=Bridge.getEnumerator(e);try{for(;n.moveNext();)if(!t(n.getCurrent()))return!1;return!0}finally{n.dispose()}},exists:function(e,t,n){if(!n)throw new System.ArgumentNullException("predicate");for(;e<t;e++)if(n(e))return!0;return!1},exists$1:function(e,t){if(!e)throw new System.ArgumentNullException("collection");if(!t)throw new System.ArgumentNullException("predicate");var n=Bridge.getEnumerator(e);try{for(;n.moveNext();)if(t(n.getCurrent()))return!0;return!1}finally{n.dispose()}}},Bridge.define("System.Diagnostics.Contracts.ContractFailureKind",{$kind:"enum",$statics:{precondition:0,postcondition:1,postconditionOnException:2,invarian:3,assert:4,assume:5}}),Bridge.define("System.Diagnostics.Contracts.ContractException",{inherits:[System.Exception],ctor:function(e,t,n,r,i){this.$initialize(),System.Exception.ctor.call(this,t,i),this._kind=e,this._failureMessage=t||null,this._userMessage=n||null,this._condition=r||null},getKind:function(){return this._kind},getFailure:function(){return this._failureMessage},getUserMessage:function(){return this._userMessage},getCondition:function(){return this._condition}}),u={toIndex:function(e,t){if(t.length!==(e.$s?e.$s.length:1))throw new System.ArgumentException("Invalid number of indices");if(t[0]<0||t[0]>=(e.$s?e.$s[0]:e.length))throw new System.ArgumentException("Index 0 out of range");var n,r=t[0];if(e.$s)for(n=1;n<e.$s.length;n++){if(t[n]<0||t[n]>=e.$s[n])throw new System.ArgumentException("Index "+n+" out of range");r=r*e.$s[n]+t[n]}return r},$get:function(e){var t=this[System.Array.toIndex(this,e)];return void 0!==t?t:this.$v},get:function(e){var t,n,r;if(arguments.length<2)throw new System.ArgumentNullException("indices");for(t=Array.prototype.slice.call(arguments,1),n=0;n<t.length;n++)if(!Bridge.hasValue(t[n]))throw new System.ArgumentNullException("indices");return void 0!==(r=e[System.Array.toIndex(e,t)])?r:e.$v},$set:function(e,t){this[System.Array.toIndex(this,Array.prototype.slice.call(e,0))]=t},set:function(e,t){var n=Array.prototype.slice.call(arguments,2);e[System.Array.toIndex(e,n)]=t},getLength:function(e,t){if(t<0||t>=(e.$s?e.$s.length:1))throw new System.IndexOutOfRangeException;return e.$s?e.$s[t]:e.length},getRank:function(e){return e.$s?e.$s.length:1},getLower:function(e,t){return System.Array.getLength(e,t),0},create:function(e,t){var n,r,i,s,o,a,u=[],l=arguments.length>2?1:0;for(u.$v=e,u.$s=[],u.get=System.Array.$get,u.set=System.Array.$set,n=2;n<arguments.length;n++)l*=arguments[n],u.$s[n-2]=arguments[n];if(u.length=l,t)for(n=0;n<u.length;n++){for(o=[],a=n,r=u.$s.length-1;r>=0;r--)s=a%u.$s[r],o.unshift(s),a=Bridge.Int.div(a-s,u.$s[r]);for(i=t,s=0;s<o.length;s++)i=i[o[s]];u[n]=i}return u},init:function(e,t,n){for(var r=new Array(e),i=!0!==n&&Bridge.isFunction(t),s=0;s<e;s++)r[s]=i?t():t;return r},toEnumerable:function(e){return new Bridge.ArrayEnumerable(e)},toEnumerator:function(e,t){return new Bridge.ArrayEnumerator(e,t)},_typedArrays:{Float32Array:!0,Float64Array:!0,Int8Array:!0,Int16Array:!0,Int32Array:!0,Uint8Array:!0,Uint8ClampedArray:!0,Uint16Array:!0,Uint32Array:!0},is:function(e,t){return e instanceof Bridge.ArrayEnumerator?!!(e.constructor===t||e instanceof t||t===Bridge.ArrayEnumerator||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.IEnumerator")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IEnumerator")):!!Bridge.isArray(e)&&(e.constructor===t||e instanceof t||!!(t===System.Collections.IEnumerable||t===System.Collections.ICollection||t===System.ICloneable||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IEnumerable$1")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.ICollection$1")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IList$1"))||!!System.Array._typedArrays[String.prototype.slice.call(Object.prototype.toString.call(e),8,-1)])},clone:function(e){return 1===e.length?[e[0]]:e.slice(0)},getCount:function(e,t){var n;return Bridge.isArray(e)?e.length:Bridge.isFunction(e[n="System$Collections$ICollection$getCount"])||t&&Bridge.isFunction(e[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getCount"])?e[n]():Bridge.isFunction(e.getCount)?e.getCount():0},getIsReadOnly:function(e,t){var n;return Bridge.isArray(e)?!!t:Bridge.isFunction(e[n="System$Collections$ICollection$getIsReadOnly"])||t&&Bridge.isFunction(e[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getIsReadOnly"])?e[n]():Bridge.isFunction(e.getIsReadOnly)?e.getIsReadOnly():0},add:function(e,t,n){var r;Bridge.isArray(e)?e.push(t):n&&Bridge.isFunction(e[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$add"])?e[r](t):Bridge.isFunction(e.add)&&e.add(t)},clear:function(e,t){var n;Bridge.isArray(e)?System.Array.fill(e,t?t.getDefaultValue||Bridge.getDefaultValue(t):null,0,e.length):t&&Bridge.isFunction(e[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$clear"])?e[n]():Bridge.isFunction(e.clear)&&e.clear()},fill:function(e,t,n,r){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("dst");if(n<0||r<0||n+r>e.length)throw new System.IndexOutOfRangeException;for(var i=Bridge.isFunction(t);--r>=0;)e[n+r]=i?t():t},copy:function(e,t,n,r,i){if(!n)throw new System.ArgumentNullException("dest","Value cannot be null");if(!e)throw new System.ArgumentNullException("src","Value cannot be null");if(t<0||r<0||i<0)throw new System.ArgumentOutOfRangeException("Number was less than the array's lower bound in the first dimension");if(i>e.length-t||i>n.length-r)throw new System.ArgumentException("Destination array was not long enough. Check destIndex and length, and the array's lower bounds");if(t<r&&e===n)for(;--i>=0;)n[r+i]=e[t+i];else for(var s=0;s<i;s++)n[r+s]=e[t+s]},copyTo:function(e,t,n,r){var i;if(Bridge.isArray(e))System.Array.copy(e,0,t,n,e?e.length:0);else if(Bridge.isFunction(e.copyTo))e.copyTo(t,n);else{if(!r||!Bridge.isFunction(e[i="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(r)+"$copyTo"]))throw new System.NotImplementedException("copyTo");e[i](t,n)}},indexOf:function(e,t,n,r,i){var s,o,a,u;if(Bridge.isArray(e)){for(u=(n=n||0)+(r=r||e.length),o=n;o<u;o++)if((a=e[o])===t||System.Collections.Generic.EqualityComparer$1.$default.equals2(a,t))return o}else{if(i&&Bridge.isFunction(e[s="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(i)+"$indexOf"]))return e[s](t);if(Bridge.isFunction(e.indexOf))return e.indexOf(t)}return-1},contains:function(e,t,n){var r;return Bridge.isArray(e)?System.Array.indexOf(e,t)>-1:n&&Bridge.isFunction(e[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$contains"])?e[r](t):!!Bridge.isFunction(e.contains)&&e.contains(t)},remove:function(e,t,n){var r,i;if(Bridge.isArray(e)){if((i=System.Array.indexOf(e,t))>-1)return e.splice(i,1),!0}else{if(n&&Bridge.isFunction(e[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$remove"]))return e[r](t);if(Bridge.isFunction(e.remove))return e.remove(t)}return!1},insert:function(e,t,n,r){var i;Bridge.isArray(e)?e.splice(t,0,n):r&&Bridge.isFunction(e[i="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(r)+"$insert"])?e[i](t,n):Bridge.isFunction(e.insert)&&e.insert(t,n)},removeAt:function(e,t,n){var r;Bridge.isArray(e)?e.splice(t,1):n&&Bridge.isFunction(e[r="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(n)+"$removeAt"])?e[r](t):Bridge.isFunction(e.removeAt)&&e.removeAt(t)},getItem:function(e,t,n){var r;return Bridge.isArray(e)?e[t]:Bridge.isFunction(e.get)?e.get(t):Bridge.isFunction(e.getItem)?e.getItem(t):n&&Bridge.isFunction(e[r="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(n)+"$getItem"])?e[r](t):Bridge.isFunction(e.get_Item)?e.get_Item(t):void 0},setItem:function(e,t,n,r){var i;if(Bridge.isArray(e))e[t]=n;else if(Bridge.isFunction(e.set))e.set(t,n);else if(Bridge.isFunction(e.setItem))e.setItem(t,n);else{if(r&&Bridge.isFunction(e[i="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(r)+"$setItem"]))return e[i](t,n);Bridge.isFunction(e.set_Item)&&e.set_Item(t,n)}},resize:function(e,t,n){var r;if(t<0)throw new System.ArgumentOutOfRangeException("newSize",null,null,t);var i=0,s=Bridge.isFunction(n),o=e.v;for(o?(i=o.length,o.length=t):o=new Array(t),r=i;r<t;r++)o[r]=s?n():n;e.v=o},reverse:function(e,t,n){var r,i,s;if(!u)throw new System.ArgumentNullException("arr");if(t||0===t||(t=0,n=e.length),t<0||n<0)throw new System.ArgumentOutOfRangeException(t<0?"index":"length","Non-negative number required.");if(u.length-t<n)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(1!==System.Array.getRank(e))throw new System.Exception("Only single dimension arrays are supported here.");for(r=t,i=t+n-1;r<i;)s=e[r],e[r]=e[i],e[i]=s,r++,i--},binarySearch:function(e,t,n,r,i){var s,o,a,u;if(!e)throw new System.ArgumentNullException("array");if(t<0||n<0)throw new System.ArgumentOutOfRangeException(t<0?"index":"length","Non-negative number required.");if(e.length-(t-0)<n)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(1!==System.Array.getRank(e))throw new System.RankException("Only single dimensional arrays are supported for the requested action.");for(i||(i=System.Collections.Generic.Comparer$1.$default),s=t,o=t+n-1;s<=o;){a=s+(o-s>>1);try{u=i.compare(e[a],r)}catch(e){throw new System.InvalidOperationException("Failed to compare two elements in the array.",e)}if(0===u)return a;u<0?s=a+1:o=a-1}return~s},sort:function(e,t,n,r){var i,s;if(!e)throw new System.ArgumentNullException("array");if(2===arguments.length&&"object"==typeof t&&(r=t,t=null),Bridge.isNumber(t)||(t=0),Bridge.isNumber(n)||(n=e.length),r||(r=System.Collections.Generic.Comparer$1.$default),0===t&&n===e.length)e.sort(Bridge.fn.bind(r,r.compare));else for((i=e.slice(t,t+n)).sort(Bridge.fn.bind(r,r.compare)),s=t;s<t+n;s++)e[s]=i[s-t]},min:function(e,t){for(var n=e[0],r=e.length,i=0;i<r;i++)!(e[i]<n||n<t)||e[i]<t||(n=e[i]);return n},max:function(e,t){for(var n=e[0],r=e.length,i=0;i<r;i++)!(e[i]>n||n>t)||e[i]>t||(n=e[i]);return n},addRange:function(e,t){if(Bridge.isArray(t))e.push.apply(e,t);else{var n=Bridge.getEnumerator(t);try{for(;n.moveNext();)e.push(n.getCurrent())}finally{Bridge.is(n,System.IDisposable)&&n.dispose()}}},convertAll:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException("converter");return e.map(t)},find:function(e,t,n){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(n))throw new System.ArgumentNullException("match");for(var r=0;r<t.length;r++)if(n(t[r]))return t[r];return Bridge.getDefaultValue(e)},findAll:function(e,t){var n,r;if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException("match");for(n=[],r=0;r<e.length;r++)t(e[r])&&n.push(e[r]);return n},findIndex:function(e,t,n,r){var i,s;if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(2===arguments.length?(r=t,t=0,n=e.length):3===arguments.length&&(r=n,n=e.length-t),t<0||t>e.length)throw new System.ArgumentOutOfRangeException("startIndex");if(n<0||t>e.length-n)throw new System.ArgumentOutOfRangeException("count");if(!Bridge.hasValue(r))throw new System.ArgumentNullException("match");for(i=t+n,s=t;s<i;s++)if(r(e[s]))return s;return-1},findLast:function(e,t,n){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(n))throw new System.ArgumentNullException("match");for(var r=t.length-1;r>=0;r--)if(n(t[r]))return t[r];return Bridge.getDefaultValue(e)},findLastIndex:function(e,t,n,r){var i,s;if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(2===arguments.length?(r=t,t=e.length-1,n=e.length):3===arguments.length&&(r=n,n=t+1),!Bridge.hasValue(r))throw new System.ArgumentNullException("match");if(0===e.length){if(-1!==t)throw new System.ArgumentOutOfRangeException("startIndex")}else if(t<0||t>=e.length)throw new System.ArgumentOutOfRangeException("startIndex");if(n<0||t-n+1<0)throw new System.ArgumentOutOfRangeException("count");for(i=t-n,s=t;s>i;s--)if(r(e[s]))return s;return-1},forEach:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException("action");for(var n=0;n<e.length;n++)t(e[n],n,e)},indexOfT:function(e,t,n,r){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(2===arguments.length?(n=0,r=e.length):3===arguments.length&&(r=e.length-n),n<0||n>=e.length&&e.length>0)throw new System.ArgumentOutOfRangeException("startIndex","out of range");if(r<0||r>e.length-n)throw new System.ArgumentOutOfRangeException("count","out of range");return System.Array.indexOf(e,t,n,r)},lastIndexOfT:function(e,t,n,r){var i,s,o;if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(2===arguments.length?(n=e.length-1,r=e.length):3===arguments.length&&(r=0===e.length?0:n+1),n<0||n>=e.length&&e.length>0)throw new System.ArgumentOutOfRangeException("startIndex","out of range");if(r<0||n-r+1<0)throw new System.ArgumentOutOfRangeException("count","out of range");for(i=n-r+1,s=n;s>=i;s--)if((o=e[s])===t||System.Collections.Generic.EqualityComparer$1.$default.equals2(o,t))return s;return-1},trueForAll:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException("match");for(var n=0;n<e.length;n++)if(!t(e[n]))return!1;return!0}},System.Array=u,Bridge.define("System.ArraySegment",{ctor:function(e,t,n){this.$initialize(),this.array=e,this.offset=t||0,this.count=n||e.length},getArray:function(){return this.array},getCount:function(){return this.count},getOffset:function(){return this.offset}}),Bridge.define("System.Collections.IEnumerable",{$kind:"interface"}),Bridge.define("System.Collections.IEnumerator",{$kind:"interface"}),Bridge.define("System.Collections.IEqualityComparer",{$kind:"interface"}),Bridge.define("System.Collections.ICollection",{inherits:[System.Collections.IEnumerable],$kind:"interface"}),Bridge.define("System.Collections.Generic.IEnumerator$1",(function(){return{inherits:[System.Collections.IEnumerator],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IEnumerable$1",(function(){return{inherits:[System.Collections.IEnumerable],$kind:"interface"}})),Bridge.define("System.Collections.Generic.ICollection$1",(function(e){return{inherits:[System.Collections.Generic.IEnumerable$1(e)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IEqualityComparer$1",(function(){return{$kind:"interface"}})),Bridge.define("System.Collections.Generic.IDictionary$2",(function(e,t){return{inherits:[System.Collections.Generic.IEnumerable$1(System.Collections.Generic.KeyValuePair$2(e,t))],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IList$1",(function(e){return{inherits:[System.Collections.Generic.ICollection$1(e)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IComparer$1",(function(){return{$kind:"interface"}})),Bridge.define("System.Collections.Generic.ISet$1",(function(e){return{inherits:[System.Collections.Generic.ICollection$1(e)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IReadOnlyCollection$1",(function(e){return{inherits:[System.Collections.Generic.IEnumerable$1(e)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IReadOnlyList$1",(function(e){return{inherits:[System.Collections.Generic.IReadOnlyCollection$1(e)],$kind:"interface"}})),Bridge.define("Bridge.CustomEnumerator",{inherits:[System.Collections.IEnumerator],config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},ctor:function(e,t,n,r,i){this.$initialize(),this.$moveNext=e,this.$getCurrent=t,this.$dispose=r,this.$reset=n,this.scope=i},moveNext:function(){try{return this.$moveNext.call(this.scope)}catch(e){throw this.dispose.call(this.scope),e}},getCurrent:function(){return this.$getCurrent.call(this.scope)},getCurrent$1:function(){return this.$getCurrent.call(this.scope)},reset:function(){this.$reset&&this.$reset.call(this.scope)},dispose:function(){this.$dispose&&this.$dispose.call(this.scope)}}),Bridge.define("Bridge.ArrayEnumerator",{inherits:[System.Collections.IEnumerator,System.IDisposable],statics:{$isArrayEnumerator:!0},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","dispose","System$IDisposable$dispose"]},ctor:function(e,t){this.$initialize(),this.array=e,this.reset(),t&&(this["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1"]=this.getCurrent)},moveNext:function(){return this.index++,this.index<this.array.length},getCurrent:function(){return this.array[this.index]},getCurrent$1:function(){return this.array[this.index]},reset:function(){this.index=-1},dispose:Bridge.emptyFn}),Bridge.define("Bridge.ArrayEnumerable",{inherits:[System.Collections.IEnumerable],config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator"]},ctor:function(e){this.$initialize(),this.array=e},getEnumerator:function(){return new Bridge.ArrayEnumerator(this.array)}}),Bridge.define("System.Collections.Generic.EqualityComparer$1",(function(e){return{inherits:[System.Collections.Generic.IEqualityComparer$1(e)],statics:{config:{init:function(){this.def=new(System.Collections.Generic.EqualityComparer$1(e))}}},config:{alias:["equals2","System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(e)+"$equals2","getHashCode2","System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(e)+"$getHashCode2"]},equals2:function(e,t){return Bridge.isDefined(e,!0)?!!Bridge.isDefined(t,!0)&&(e&&e.$$name?Bridge.isFunction(e.equalsT)?Bridge.equalsT(e,t):Bridge.isFunction(e.equals)?Bridge.equals(e,t):e===t:Bridge.equals(e,t)):!Bridge.isDefined(t,!0)},getHashCode2:function(e){return Bridge.isDefined(e,!0)?Bridge.getHashCode(e):0}}})),System.Collections.Generic.EqualityComparer$1.$default=new(System.Collections.Generic.EqualityComparer$1(Object)),Bridge.define("System.Collections.Generic.Comparer$1",(function(e){return{inherits:[System.Collections.Generic.IComparer$1(e)],config:{alias:["compare","System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(e)+"$compare"]},ctor:function(e){this.$initialize(),this.fn=e,this.compare=e}}})),System.Collections.Generic.Comparer$1.$default=new(System.Collections.Generic.Comparer$1(Object))((function(e,t){return Bridge.hasValue(e)?Bridge.hasValue(t)?Bridge.compare(e,t):1:Bridge.hasValue(t)?-1:0})),Bridge.define("System.Collections.Generic.KeyValuePair$2",(function(e,t){return{$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.KeyValuePair$2(e,t))(Bridge.getDefaultValue(e),Bridge.getDefaultValue(t))}},ctor:function(n,r){void 0===n&&(n=Bridge.getDefaultValue(e)),void 0===r&&(r=Bridge.getDefaultValue(t)),this.$initialize(),this.key=n,this.value=r},toString:function(){var e="[";return null!=this.key&&(e+=this.key.toString()),e+=", ",null!=this.value&&(e+=this.value.toString()),e+"]"}}})),Bridge.define("System.Collections.Generic.Dictionary$2",(function(e,t){return{inherits:[System.Collections.Generic.IDictionary$2(e,t)],config:{alias:["getCount","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$getCount","getKeys","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$getKeys","getValues","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$getValues","get","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$getItem","set","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$setItem","add","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$add","containsKey","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$containsKey","getEnumerator","System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$getEnumerator","remove","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$remove","tryGetValue","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$tryGetValue"]},ctor:function(n,r){var i,s,o,a,u;if(this.$initialize(),this.comparer=r||System.Collections.Generic.EqualityComparer$1(e).def,this.clear(),Bridge.is(n,System.Collections.Generic.Dictionary$2(e,t)))for(i=Bridge.getEnumerator(n);i.moveNext();)s=i.getCurrent(),this.add(s.key,s.value);else if("[object Object]"===Object.prototype.toString.call(n))for(o=Object.keys(n),u=0;u<o.length;u++)a=o[u],this.add(a,n[a])},getKeys:function(){return new(System.Collections.Generic.DictionaryCollection$1(e))(this,!0)},getValues:function(){return new(System.Collections.Generic.DictionaryCollection$1(t))(this,!1)},clear:function(){this.entries={},this.count=0},findEntry:function(e){var t,n,r=this.comparer.getHashCode2(e);if(Bridge.isDefined(this.entries[r]))for(t=this.entries[r],n=0;n<t.length;n++)if(this.comparer.equals2(t[n].key,e))return t[n]},containsKey:function(e){return!!this.findEntry(e)},containsValue:function(e){var t,n,r;for(t in this.entries)if(this.entries.hasOwnProperty(t))for(r=this.entries[t],n=0;n<r.length;n++)if(this.comparer.equals2(r[n].value,e))return!0;return!1},get:function(e){var t=this.findEntry(e);if(!t)throw new System.Collections.Generic.KeyNotFoundException("Key "+e+" does not exist.");return t.value},getItem:function(e){return this.get(e)},set:function(n,r,i){var s,o=this.findEntry(n);if(o){if(i)throw new System.ArgumentException("Key "+n+" already exists.");o.value=r}else s=this.comparer.getHashCode2(n),o=new(System.Collections.Generic.KeyValuePair$2(e,t))(n,r),this.entries[s]?this.entries[s].push(o):this.entries[s]=[o],this.count++},setItem:function(e,t,n){this.set(e,t,n)},add:function(e,t){this.set(e,t,!0)},remove:function(e){var t,n,r=this.comparer.getHashCode2(e);if(!this.entries[r])return!1;for(t=this.entries[r],n=0;n<t.length;n++)if(this.comparer.equals2(t[n].key,e))return t.splice(n,1),0==t.length&&delete this.entries[r],this.count--,!0;return!1},getCount:function(){return this.count},getComparer:function(){return this.comparer},tryGetValue:function(e,n){var r=this.findEntry(e);return n.v=r?r.value:Bridge.getDefaultValue(t),!!r},getCustomEnumerator:function(e){var t,n=Bridge.getPropertyNames(this.entries),r=-1;return new Bridge.CustomEnumerator((function(){return(r<0||t>=this.entries[n[r]].length-1)&&(t=-1,r++),!(r>=n.length||(t++,0))}),(function(){return e(this.entries[n[r]][t])}),(function(){r=-1}),null,this)},getEnumerator:function(){return this.getCustomEnumerator((function(e){return e}))}}})),Bridge.define("System.Collections.Generic.DictionaryCollection$1",(function(e){return{inherits:[System.Collections.Generic.ICollection$1(e)],config:{alias:["getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(e)+"$getEnumerator","getCount","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$getCount","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$contains","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$remove"]},ctor:function(e,t){this.$initialize(),this.dictionary=e,this.keys=t},getCount:function(){return this.dictionary.getCount()},getEnumerator:function(){return this.dictionary.getCustomEnumerator(this.keys?function(e){return e.key}:function(e){return e.value})},contains:function(e){return this.keys?this.dictionary.containsKey(e):this.dictionary.containsValue(e)},add:function(){throw new System.NotSupportedException},clear:function(){throw new System.NotSupportedException},remove:function(){throw new System.NotSupportedException}}})),Bridge.define("System.Collections.Generic.List$1",(function(e){return{inherits:[System.Collections.Generic.ICollection$1(e),System.Collections.ICollection,System.Collections.Generic.IList$1(e)],config:{alias:["getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$getItem","setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$setItem","getCount","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$getCount","getIsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$getIsReadOnly","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$copyTo","getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(e)+"$getEnumerator","indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$indexOf","insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$insert","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$remove","removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$removeAt"]},ctor:function(e){this.$initialize(),this.items="[object Array]"===Object.prototype.toString.call(e)?System.Array.clone(e):Bridge.is(e,System.Collections.IEnumerable)?Bridge.toArray(e):[],this.clear.$clearCallbacks=[]},checkIndex:function(e){if(e<0||e>this.items.length-1)throw new System.ArgumentOutOfRangeException("Index out of range")},getCount:function(){return this.items.length},getIsReadOnly:function(){return!!this.readOnly},get:function(e){return this.checkIndex(e),this.items[e]},getItem:function(e){return this.get(e)},set:function(e,t){this.checkReadOnly(),this.checkIndex(e),this.items[e]=t},setItem:function(e,t){this.set(e,t)},add:function(e){this.checkReadOnly(),this.items.push(e)},addRange:function(e){this.checkReadOnly();for(var t=Bridge.toArray(e),n=0,r=t.length;n<r;++n)this.items.push(t[n])},clear:function(){this.checkReadOnly(),this.items=[];for(var e=0;e<this.clear.$clearCallbacks.length;e++)this.clear.$clearCallbacks[e](this)},onClear:function(e){this.clear.$clearCallbacks.push(e)},indexOf:function(e,t){var n,r;for(Bridge.isDefined(t)||(t=0),0!==t&&this.checkIndex(t),n=t;n<this.items.length;n++)if(r=this.items[n],System.Collections.Generic.EqualityComparer$1.$default.equals2(r,e))return n;return-1},insertRange:function(e,t){var n,r;for(this.checkReadOnly(),e!==this.items.length&&this.checkIndex(e),n=Bridge.toArray(t),r=0;r<n.length;r++)this.insert(e++,n[r])},contains:function(e){return this.indexOf(e)>-1},copyTo:function(e,t){System.Array.copy(this.items,0,e,t,this.items.length)},getEnumerator:function(){return new Bridge.ArrayEnumerator(this.items,e)},getRange:function(t,n){Bridge.isDefined(t)||(t=0),Bridge.isDefined(n)||(n=this.items.length),0!==t&&this.checkIndex(t),this.checkIndex(t+n-1);for(var r=[],i=t+n,s=t;s<i;s++)r.push(this.items[s]);return new(System.Collections.Generic.List$1(e))(r)},insert:function(e,t){if(this.checkReadOnly(),e!==this.items.length&&this.checkIndex(e),Bridge.isArray(t))for(var n=0;n<t.length;n++)this.insert(e++,t[n]);else this.items.splice(e,0,t)},join:function(e){return this.items.join(e)},lastIndexOf:function(e,t){Bridge.isDefined(t)||(t=this.items.length-1),0!==t&&this.checkIndex(t);for(var n=t;n>=0;n--)if(e===this.items[n])return n;return-1},remove:function(e){this.checkReadOnly();var t=this.indexOf(e);return!(t<0||(this.checkIndex(t),this.items.splice(t,1),0))},removeAt:function(e){this.checkReadOnly(),this.checkIndex(e),this.items.splice(e,1)},removeRange:function(e,t){this.checkReadOnly(),this.checkIndex(e),this.items.splice(e,t)},reverse:function(){this.checkReadOnly(),this.items.reverse()},slice:function(e,t){this.checkReadOnly();var n=this.$$name.substr(this.$$name.lastIndexOf("$")+1);return new(System.Collections.Generic.List$1(Bridge.unroll(n)))(this.items.slice(e,t))},sort:function(e){this.checkReadOnly(),this.items.sort(e||System.Collections.Generic.Comparer$1.$default.compare)},splice:function(e,t,n){this.checkReadOnly(),this.items.splice(e,t,n)},unshift:function(){this.checkReadOnly(),this.items.unshift()},toArray:function(){return Bridge.toArray(this)},checkReadOnly:function(){if(this.readOnly)throw new System.NotSupportedException},binarySearch:function(e,t,n,r){return 1===arguments.length&&(n=e,e=null),2===arguments.length&&(n=e,r=t,e=null,t=null),Bridge.isNumber(e)||(e=0),Bridge.isNumber(t)||(t=this.items.length),r||(r=System.Collections.Generic.Comparer$1.$default),System.Array.binarySearch(this.items,e,t,n,r)},convertAll:function(e,t){var n,r;if(!Bridge.hasValue(t))throw new System.ArgumentNullException("converter is null.");for(n=new(System.Collections.Generic.List$1(e))(this.items.length),r=0;r<this.items.length;r++)n.items[r]=t(this.items[r]);return n}}})),Bridge.define("System.Collections.ObjectModel.ReadOnlyCollection$1",(function(e){return{inherits:[System.Collections.Generic.List$1(e),System.Collections.Generic.IReadOnlyList$1(e)],ctor:function(t){if(this.$initialize(),null==t)throw new System.ArgumentNullException("list");if(System.Collections.Generic.List$1(e).ctor.call(this,[]),this.readOnly=!0,"[object Array]"===Object.prototype.toString.call(t))this.items=t;else if(Bridge.is(t,System.Collections.Generic.List$1(e))){var n=this;this.items=t.items,t.onClear((function(e){n.items=e.items}))}else Bridge.is(t,System.Collections.IEnumerable)&&(this.items=Bridge.toArray(t))}}})),Bridge.define("System.Threading.Tasks.Task",{inherits:[System.IDisposable],config:{alias:["dispose","System$IDisposable$dispose"]},ctor:function(e,t){this.$initialize(),this.action=e,this.state=t,this.exception=null,this.status=System.Threading.Tasks.TaskStatus.created,this.callbacks=[],this.result=null},statics:{delay:function(e,t){var n=new System.Threading.Tasks.TaskCompletionSource;return setTimeout((function(){n.setResult(t)}),e),n.task},fromResult:function(e){var t=new System.Threading.Tasks.Task;return t.status=System.Threading.Tasks.TaskStatus.ranToCompletion,t.result=e,t},run:function(e){var t=new System.Threading.Tasks.TaskCompletionSource;return setTimeout((function(){try{t.setResult(e())}catch(e){t.setException(System.Exception.create(e))}}),0),t.task},whenAll:function(e){var t,n,r,i=new System.Threading.Tasks.TaskCompletionSource,s=!1,o=[];if(Bridge.is(e,System.Collections.IEnumerable)?e=Bridge.toArray(e):Bridge.isArray(e)||(e=Array.prototype.slice.call(arguments,0)),0===e.length)return i.setResult([]),i.task;for(n=e.length,t=new Array(e.length),r=0;r<e.length;r++)!function(r){e[r].continueWith((function(e){switch(e.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:t[r]=e.getResult();break;case System.Threading.Tasks.TaskStatus.canceled:s=!0;break;case System.Threading.Tasks.TaskStatus.faulted:System.Array.addRange(o,e.exception.innerExceptions);break;default:throw new System.InvalidOperationException("Invalid task status: "+e.status)}0==--n&&(o.length>0?i.setException(o):s?i.setCanceled():i.setResult(t))}))}(r);return i.task},whenAny:function(e){if(Bridge.is(e,System.Collections.IEnumerable)?e=Bridge.toArray(e):Bridge.isArray(e)||(e=Array.prototype.slice.call(arguments,0)),!e.length)throw new System.ArgumentException("At least one task is required");for(var t=new System.Threading.Tasks.TaskCompletionSource,n=0;n<e.length;n++)e[n].continueWith((function(e){switch(e.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:t.trySetResult(e);break;case System.Threading.Tasks.TaskStatus.canceled:t.trySetCanceled();break;case System.Threading.Tasks.TaskStatus.faulted:t.trySetException(e.exception.innerExceptions);break;default:throw new System.InvalidOperationException("Invalid task status: "+e.status)}}));return t.task},fromCallback:function(e,t){var n,r=new System.Threading.Tasks.TaskCompletionSource,i=Array.prototype.slice.call(arguments,2);return n=function(e){r.setResult(e)},i.push(n),e[t].apply(e,i),r.task},fromCallbackResult:function(e,t,n){var r,i=new System.Threading.Tasks.TaskCompletionSource,s=Array.prototype.slice.call(arguments,3);return r=function(e){i.setResult(e)},n(s,r),e[t].apply(e,s),i.task},fromCallbackOptions:function(e,t,n){var r,i=new System.Threading.Tasks.TaskCompletionSource,s=Array.prototype.slice.call(arguments,3);return r=function(e){i.setResult(e)},s[0]=s[0]||{},s[0][n]=r,e[t].apply(e,s),i.task},fromPromise:function(e,t,n,r){var i=new System.Threading.Tasks.TaskCompletionSource;return e.then||(e=e.promise()),"number"==typeof t?t=function(e){return function(){return arguments[e>=0?e:arguments.length+e]}}(t):"function"!=typeof t&&(t=function(){return Array.prototype.slice.call(arguments,0)}),e.then((function(){i.setResult(t?t.apply(null,arguments):Array.prototype.slice.call(arguments,0))}),(function(){i.setException(n?n.apply(null,arguments):new Bridge.PromiseException(Array.prototype.slice.call(arguments,0)))}),r),i.task}},continueWith:function(e,t){var n=new System.Threading.Tasks.TaskCompletionSource,r=this,i=t?function(){n.setResult(e(r))}:function(){try{n.setResult(e(r))}catch(e){n.setException(System.Exception.create(e))}};return this.isCompleted()?setTimeout(i,0):this.callbacks.push(i),n.task},start:function(){if(this.status!==System.Threading.Tasks.TaskStatus.created)throw new System.InvalidOperationException("Task was already started.");var e=this;this.status=System.Threading.Tasks.TaskStatus.running,setTimeout((function(){try{var t=e.action(e.state);delete e.action,delete e.state,e.complete(t)}catch(t){e.fail(new System.AggregateException(null,[System.Exception.create(t)]))}}),0)},runCallbacks:function(){var e=this;setTimeout((function(){for(var t=0;t<e.callbacks.length;t++)e.callbacks[t](e);delete e.callbacks}),0)},complete:function(e){return!this.isCompleted()&&(this.result=e,this.status=System.Threading.Tasks.TaskStatus.ranToCompletion,this.runCallbacks(),!0)},fail:function(e){return!this.isCompleted()&&(this.exception=e,this.status=System.Threading.Tasks.TaskStatus.faulted,this.runCallbacks(),!0)},cancel:function(){return!this.isCompleted()&&(this.status=System.Threading.Tasks.TaskStatus.canceled,this.runCallbacks(),!0)},isCanceled:function(){return this.status===System.Threading.Tasks.TaskStatus.canceled},isCompleted:function(){return this.status===System.Threading.Tasks.TaskStatus.ranToCompletion||this.status===System.Threading.Tasks.TaskStatus.canceled||this.status===System.Threading.Tasks.TaskStatus.faulted},isFaulted:function(){return this.status===System.Threading.Tasks.TaskStatus.faulted},_getResult:function(e){switch(this.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:return this.result;case System.Threading.Tasks.TaskStatus.canceled:var t=new System.Threading.Tasks.TaskCanceledException(null,this);throw e?t:new System.AggregateException(null,[t]);case System.Threading.Tasks.TaskStatus.faulted:throw e?this.exception.innerExceptions.getCount()>0?this.exception.innerExceptions.get(0):null:this.exception;default:throw new System.InvalidOperationException("Task is not yet completed.")}},getResult:function(){return this._getResult(!1)},dispose:function(){},getAwaiter:function(){return this},getAwaitedResult:function(){return this._getResult(!0)}}),Bridge.define("System.Threading.Tasks.TaskStatus",{$kind:"enum",$statics:{created:0,waitingForActivation:1,waitingToRun:2,running:3,waitingForChildrenToComplete:4,ranToCompletion:5,canceled:6,faulted:7}}),Bridge.define("System.Threading.Tasks.TaskCompletionSource",{ctor:function(){this.$initialize(),this.task=new System.Threading.Tasks.Task,this.task.status=System.Threading.Tasks.TaskStatus.running},setCanceled:function(){if(!this.task.cancel())throw new System.InvalidOperationException("Task was already completed.")},setResult:function(e){if(!this.task.complete(e))throw new System.InvalidOperationException("Task was already completed.")},setException:function(e){if(!this.trySetException(e))throw new System.InvalidOperationException("Task was already completed.")},trySetCanceled:function(){return this.task.cancel()},trySetResult:function(e){return this.task.complete(e)},trySetException:function(e){return Bridge.is(e,System.Exception)&&(e=[e]),this.task.fail(new System.AggregateException(null,e))}}),Bridge.define("System.Threading.CancellationTokenSource",{inherits:[System.IDisposable],config:{alias:["dispose","System$IDisposable$dispose"]},ctor:function(e){this.$initialize(),this.timeout="number"==typeof e&&e>=0?setTimeout(Bridge.fn.bind(this,this.cancel),e,-1):null,this.isCancellationRequested=!1,this.token=new System.Threading.CancellationToken(this),this.handlers=[]},cancel:function(e){var t,n,r;if(!this.isCancellationRequested){for(this.isCancellationRequested=!0,t=[],n=this.handlers,this.clean(),r=0;r<n.length;r++)try{n[r].f(n[r].s)}catch(n){if(e&&-1!==e)throw n;t.push(n)}if(t.length>0&&-1!==e)throw new System.AggregateException(null,t)}},cancelAfter:function(e){this.isCancellationRequested||(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(Bridge.fn.bind(this,this.cancel),e,-1))},register:function(e,t){if(this.isCancellationRequested)return e(t),new System.Threading.CancellationTokenRegistration;var n={f:e,s:t};return this.handlers.push(n),new System.Threading.CancellationTokenRegistration(this,n)},deregister:function(e){var t=this.handlers.indexOf(e);t>=0&&this.handlers.splice(t,1)},dispose:function(){this.clean()},clean:function(){if(this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.handlers=[],this.links){for(var e=0;e<this.links.length;e++)this.links[e].dispose();this.links=null}},statics:{createLinked:function(){var e,t,n=new System.Threading.CancellationTokenSource;for(n.links=[],e=Bridge.fn.bind(n,n.cancel),t=0;t<arguments.length;t++)n.links.push(arguments[t].register(e));return n}}}),Bridge.define("System.Threading.CancellationToken",{$kind:"struct",ctor:function(e){this.$initialize(),Bridge.is(e,System.Threading.CancellationTokenSource)||(e=e?System.Threading.CancellationToken.sourceTrue:System.Threading.CancellationToken.sourceFalse),this.source=e},getCanBeCanceled:function(){return!this.source.uncancellable},getIsCancellationRequested:function(){return this.source.isCancellationRequested},throwIfCancellationRequested:function(){if(this.source.isCancellationRequested)throw new System.OperationCanceledException(this)},register:function(e,t){return this.source.register(e,t)},getHashCode:function(){return Bridge.getHashCode(this.source)},equals:function(e){return e.source===this.source},equalsT:function(e){return e.source===this.source},statics:{sourceTrue:{isCancellationRequested:!0,register:function(e,t){return e(t),new System.Threading.CancellationTokenRegistration}},sourceFalse:{uncancellable:!0,isCancellationRequested:!1,register:function(){return new System.Threading.CancellationTokenRegistration}},getDefaultValue:function(){return new System.Threading.CancellationToken}}}),System.Threading.CancellationToken.none=new System.Threading.CancellationToken,Bridge.define("System.Threading.CancellationTokenRegistration",{inherits:function(){return[System.IDisposable,System.IEquatable$1(System.Threading.CancellationTokenRegistration)]},$kind:"struct",config:{alias:["dispose","System$IDisposable$dispose"]},ctor:function(e,t){this.$initialize(),this.cts=e,this.o=t},dispose:function(){this.cts&&(this.cts.deregister(this.o),this.cts=this.o=null)},equalsT:function(e){return this===e},equals:function(e){return this===e},statics:{getDefaultValue:function(){return new System.Threading.CancellationTokenRegistration}}}),l={isNull:function(e){return!Bridge.isDefined(e,!0)},isEmpty:function(e){return!(null!=e&&0!==e.length&&!Bridge.is(e,System.Collections.ICollection))&&0===e.getCount()},isNotEmptyOrWhitespace:function(e){return Bridge.isDefined(e,!0)&&!/^$|\s+/.test(e)},isNotNull:function(e){return Bridge.isDefined(e,!0)},isNotEmpty:function(e){return!Bridge.Validation.isEmpty(e)},email:function(e){return/^(")?(?:[^\."])(?:(?:[\.])?(?:[\w\-!#$%&'*+/=?^_`{|}~]))*\1@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/.test(e)},url:function(e){return/(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:\.\d{1,3}){3})(?!(?:\.\d{1,3}){2})(?!\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/.test(e)},alpha:function(e){return/^[a-zA-Z_]+$/.test(e)},alphaNum:function(e){return/^[a-zA-Z_]+$/.test(e)},creditCard:function(e,t){var n,r,i,s,o=!1;if("Visa"===t)n=/^4\d{3}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("MasterCard"===t)n=/^5[1-5]\d{2}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("Discover"===t)n=/^6011[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("AmericanExpress"===t)n=/^3[4,7]\d{13}$/;else if("DinersClub"===t)n=/^(3[0,6,8]\d{12})|(5[45]\d{14})$/;else{if(!e||e.length<13||e.length>19)return!1;n=/[^0-9 \-]+/,o=!0}if(!n.test(e))return!1;for(r=0,i=2-(e=e.split(o?"-":/[- ]/).join("")).length%2;i<=e.length;i+=2)r+=parseInt(e.charAt(i-1));for(i=e.length%2+1;i<e.length;i+=2)r+=(s=2*parseInt(e.charAt(i-1)))<10?s:s-9;return r%10==0}},Bridge.Validation=l,Bridge.define("System.Version",{inherits:function(){return[System.ICloneable,System.IComparable$1(System.Version),System.IEquatable$1(System.Version)]},statics:{separatorsArray:".",ZERO_CHAR_VALUE:48,appendPositiveNumber:function(e,t){var n,r=t.getLength();do{n=e%10,e=0|Bridge.Int.div(e,10),t.insert(r,String.fromCharCode(65535&(System.Version.ZERO_CHAR_VALUE+n|0)))}while(e>0)},parse:function(e){if(null==e)throw new System.ArgumentNullException("input");var t={v:new System.Version.VersionResult};if(t.v.init("input",!0),!System.Version.tryParseVersion(e,t))throw t.v.getVersionParseException();return t.v.m_parsedVersion},tryParse:function(e,t){var n,r={v:new System.Version.VersionResult};return r.v.init("input",!1),n=System.Version.tryParseVersion(e,r),t.v=r.v.m_parsedVersion,n},tryParseVersion:function(e,t){var n,r,i={},s={},o={},a={};if(null==e)return t.v.setFailure(System.Version.ParseFailureKind.ArgumentNullException),!1;if((r=(n=e.split(System.Version.separatorsArray)).length)<2||r>4)return t.v.setFailure(System.Version.ParseFailureKind.ArgumentException),!1;if(!System.Version.tryParseComponent(n[0],"version",t,i)||!System.Version.tryParseComponent(n[1],"version",t,s))return!1;if((r=r-2|0)>0){if(!System.Version.tryParseComponent(n[2],"build",t,o))return!1;if((r=r-1|0)>0){if(!System.Version.tryParseComponent(n[3],"revision",t,a))return!1;t.v.m_parsedVersion=new System.Version.$ctor3(i.v,s.v,o.v,a.v)}else t.v.m_parsedVersion=new System.Version.$ctor2(i.v,s.v,o.v)}else t.v.m_parsedVersion=new System.Version.$ctor1(i.v,s.v);return!0},tryParseComponent:function(e,t,n,r){return System.Int32.tryParse(e,r)?!(r.v<0&&(n.v.setFailure$1(System.Version.ParseFailureKind.ArgumentOutOfRangeException,t),1)):(n.v.setFailure$1(System.Version.ParseFailureKind.FormatException,e),!1)},op_Equality:function(e,t){return Bridge.referenceEquals(e,null)?Bridge.referenceEquals(t,null):e.equalsT(t)},op_Inequality:function(e,t){return!System.Version.op_Equality(e,t)},op_LessThan:function(e,t){if(null==e)throw new System.ArgumentNullException("v1");return e.compareTo(t)<0},op_LessThanOrEqual:function(e,t){if(null==e)throw new System.ArgumentNullException("v1");return e.compareTo(t)<=0},op_GreaterThan:function(e,t){return System.Version.op_LessThan(t,e)},op_GreaterThanOrEqual:function(e,t){return System.Version.op_LessThanOrEqual(t,e)}},_Major:0,_Minor:0,_Build:-1,_Revision:-1,config:{alias:["clone","System$ICloneable$clone","compareTo","System$IComparable$1$System$Version$compareTo","equalsT","System$IEquatable$1$System$Version$equalsT"]},$ctor3:function(e,t,n,r){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException("major","Cannot be < 0");if(t<0)throw new System.ArgumentOutOfRangeException("minor","Cannot be < 0");if(n<0)throw new System.ArgumentOutOfRangeException("build","Cannot be < 0");if(r<0)throw new System.ArgumentOutOfRangeException("revision","Cannot be < 0");this._Major=e,this._Minor=t,this._Build=n,this._Revision=r},$ctor2:function(e,t,n){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException("major","Cannot be < 0");if(t<0)throw new System.ArgumentOutOfRangeException("minor","Cannot be < 0");if(n<0)throw new System.ArgumentOutOfRangeException("build","Cannot be < 0");this._Major=e,this._Minor=t,this._Build=n},$ctor1:function(e,t){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException("major","Cannot be < 0");if(t<0)throw new System.ArgumentOutOfRangeException("minor","Cannot be < 0");this._Major=e,this._Minor=t},$ctor4:function(e){this.$initialize();var t=System.Version.parse(e);this._Major=t.getMajor(),this._Minor=t.getMinor(),this._Build=t.getBuild(),this._Revision=t.getRevision()},ctor:function(){this.$initialize(),this._Major=0,this._Minor=0},getMajor:function(){return this._Major},getMinor:function(){return this._Minor},getBuild:function(){return this._Build},getRevision:function(){return this._Revision},getMajorRevision:function(){return Bridge.Int.sxs(this._Revision>>16&65535)},getMinorRevision:function(){return Bridge.Int.sxs(65535&this._Revision)},clone:function(){var e=new System.Version.ctor;return e._Major=this._Major,e._Minor=this._Minor,e._Build=this._Build,e._Revision=this._Revision,e},compareTo$1:function(e){if(null==e)return 1;var t=Bridge.as(e,System.Version);if(System.Version.op_Equality(t,null))throw new System.ArgumentException("version should be of System.Version type");return this._Major!==t._Major?this._Major>t._Major?1:-1:this._Minor!==t._Minor?this._Minor>t._Minor?1:-1:this._Build!==t._Build?this._Build>t._Build?1:-1:this._Revision!==t._Revision?this._Revision>t._Revision?1:-1:0},compareTo:function(e){return System.Version.op_Equality(e,null)?1:this._Major!==e._Major?this._Major>e._Major?1:-1:this._Minor!==e._Minor?this._Minor>e._Minor?1:-1:this._Build!==e._Build?this._Build>e._Build?1:-1:this._Revision!==e._Revision?this._Revision>e._Revision?1:-1:0},equals:function(e){return this.equalsT(Bridge.as(e,System.Version))},equalsT:function(e){return!System.Version.op_Equality(e,null)&&this._Major===e._Major&&this._Minor===e._Minor&&this._Build===e._Build&&this._Revision===e._Revision},getHashCode:function(){var e=0;return e|=(15&this._Major)<<28,e|=(255&this._Minor)<<20,(e|=(255&this._Build)<<12)|4095&this._Revision},toString:function(){return-1===this._Build?this.toString$1(2):-1===this._Revision?this.toString$1(3):this.toString$1(4)},toString$1:function(e){var t;switch(e){case 0:return"";case 1:return this._Major.toString();case 2:return t=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,t),t.toString();default:if(-1===this._Build)throw new System.ArgumentException("Build should be > 0 if fieldCount > 2","fieldCount");if(3===e)return t=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Build,t),t.toString();if(-1===this._Revision)throw new System.ArgumentException("Revision should be > 0 if fieldCount > 3","fieldCount");if(4===e)return t=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Build,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Revision,t),t.toString();throw new System.ArgumentException("Should be < 5","fieldCount")}}}),Bridge.define("System.Version.ParseFailureKind",{$kind:"enum",statics:{ArgumentNullException:0,ArgumentException:1,ArgumentOutOfRangeException:2,FormatException:3}}),Bridge.define("System.Version.VersionResult",{$kind:"struct",statics:{getDefaultValue:function(){return new System.Version.VersionResult}},m_parsedVersion:null,m_failure:0,m_exceptionArgument:null,m_argumentName:null,m_canThrow:!1,ctor:function(){this.$initialize()},init:function(e,t){this.m_canThrow=t,this.m_argumentName=e},setFailure:function(e){this.setFailure$1(e,"")},setFailure$1:function(e,t){if(this.m_failure=e,this.m_exceptionArgument=t,this.m_canThrow)throw this.getVersionParseException()},getVersionParseException:function(){switch(this.m_failure){case System.Version.ParseFailureKind.ArgumentNullException:return new System.ArgumentNullException(this.m_argumentName);case System.Version.ParseFailureKind.ArgumentException:return new System.ArgumentException("VersionString");case System.Version.ParseFailureKind.ArgumentOutOfRangeException:return new System.ArgumentOutOfRangeException(this.m_exceptionArgument,"Cannot be < 0");case System.Version.ParseFailureKind.FormatException:try{System.Int32.parse(this.m_exceptionArgument)}catch(e){if(e=System.Exception.create(e),Bridge.is(e,System.FormatException)||Bridge.is(e,System.OverflowException))return e;throw e}return new System.FormatException("InvalidString");default:return new System.ArgumentException("VersionString")}},getHashCode:function(){return Bridge.addHash([5139482776,this.m_parsedVersion,this.m_failure,this.m_exceptionArgument,this.m_argumentName,this.m_canThrow])},equals:function(e){return!!Bridge.is(e,System.Version.VersionResult)&&Bridge.equals(this.m_parsedVersion,e.m_parsedVersion)&&Bridge.equals(this.m_failure,e.m_failure)&&Bridge.equals(this.m_exceptionArgument,e.m_exceptionArgument)&&Bridge.equals(this.m_argumentName,e.m_argumentName)&&Bridge.equals(this.m_canThrow,e.m_canThrow)},$clone:function(e){var t=e||new System.Version.VersionResult;return t.m_parsedVersion=this.m_parsedVersion,t.m_failure=this.m_failure,t.m_exceptionArgument=this.m_exceptionArgument,t.m_argumentName=this.m_argumentName,t.m_canThrow=this.m_canThrow,t}}),Bridge.define("System.Attribute",{statics:{getCustomAttributes:function(e,t){if(null==e)throw new System.ArgumentNullException("element");if(null==t)throw new System.ArgumentNullException("attributeType");var n=e.at||[];return t?n.filter((function(e){return Bridge.is(e,t)})):n},getCustomAttributes$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException("element");if(null==t)throw new System.ArgumentNullException("attributeType");return e.getCustomAttributes(t||n)}}}),Bridge.define("System.ComponentModel.INotifyPropertyChanged",{$kind:"interface"}),Bridge.define("System.ComponentModel.PropertyChangedEventArgs",{ctor:function(e,t,n){this.$initialize(),this.propertyName=e,this.newValue=t,this.oldValue=n}}),(c={}).convert={typeCodes:{Empty:0,Object:1,DBNull:2,Boolean:3,Char:4,SByte:5,Byte:6,Int16:7,UInt16:8,Int32:9,UInt32:10,Int64:11,UInt64:12,Single:13,Double:14,Decimal:15,DateTime:16,String:18},toBoolean:function(e,t){var n,r;switch(typeof e){case"boolean":return e;case"number":return 0!==e;case"string":if("true"===(n=e.toLowerCase().trim()))return!0;if("false"===n)return!1;throw new System.FormatException("String was not recognized as a valid Boolean.");case"object":if(null==e)return!1;if(e instanceof System.Decimal)return!e.isZero();if(System.Int64.is64Bit(e))return e.ne(0)}return r=c.internal.suggestTypeCode(e),c.internal.throwInvalidCastEx(r,c.convert.typeCodes.Boolean),c.convert.convertToType(c.convert.typeCodes.Boolean,e,t||null)},toChar:function(e,t,n){var r,i=c.convert.typeCodes;if(e instanceof System.Decimal&&(e=e.toFloat()),(e instanceof System.Int64||e instanceof System.UInt64)&&(e=e.toNumber()),r=typeof e,(n=n||c.internal.suggestTypeCode(e))===i.String&&null==e&&(r="string"),n!==i.Object)switch(r){case"boolean":c.internal.throwInvalidCastEx(i.Boolean,i.Char);case"number":return(c.internal.isFloatingType(n)||e%1!=0)&&c.internal.throwInvalidCastEx(n,i.Char),c.internal.validateNumberRange(e,i.Char,!0),e;case"string":if(null==e)throw new System.ArgumentNullException("value");if(1!==e.length)throw new System.FormatException("String must be exactly one character long.");return e.charCodeAt(0)}if(n===i.Object||"object"===r){if(null==e)return 0;Bridge.isDate(e)&&c.internal.throwInvalidCastEx(i.DateTime,i.Char)}return c.internal.throwInvalidCastEx(n,c.convert.typeCodes.Char),c.convert.convertToType(i.Char,e,t||null)},toSByte:function(e,t,n){return c.internal.toNumber(e,t||null,c.convert.typeCodes.SByte,n||null)},toByte:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.Byte)},toInt16:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.Int16)},toUInt16:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.UInt16)},toInt32:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.Int32)},toUInt32:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.UInt32)},toInt64:function(e,t){var n=c.internal.toNumber(e,t||null,c.convert.typeCodes.Int64);return new System.Int64(n)},toUInt64:function(e,t){var n=c.internal.toNumber(e,t||null,c.convert.typeCodes.UInt64);return new System.UInt64(n)},toSingle:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.Single)},toDouble:function(e,t){return c.internal.toNumber(e,t||null,c.convert.typeCodes.Double)},toDecimal:function(e,t){return e instanceof System.Decimal?e:new System.Decimal(c.internal.toNumber(e,t||null,c.convert.typeCodes.Decimal))},toDateTime:function(e,t){var n,r,i=c.convert.typeCodes;switch(typeof e){case"boolean":c.internal.throwInvalidCastEx(i.Boolean,i.DateTime);case"number":n=c.internal.suggestTypeCode(e),c.internal.throwInvalidCastEx(n,i.DateTime);case"string":return Bridge.Date.parse(e,t||null);case"object":if(null==e)return c.internal.getMinValue(i.DateTime);if(Bridge.isDate(e))return e;e instanceof System.Decimal&&c.internal.throwInvalidCastEx(i.Decimal,i.DateTime),e instanceof System.Int64&&c.internal.throwInvalidCastEx(i.Int64,i.DateTime),e instanceof System.UInt64&&c.internal.throwInvalidCastEx(i.UInt64,i.DateTime)}return r=c.internal.suggestTypeCode(e),c.internal.throwInvalidCastEx(r,c.convert.typeCodes.DateTime),c.convert.convertToType(i.DateTime,e,t||null)},toString:function(e,t,n){var r=c.convert.typeCodes;switch(typeof e){case"boolean":return e?"True":"False";case"number":return(n||null)===r.Char?String.fromCharCode(e):isNaN(e)?"NaN":(e%1!=0&&(e=parseFloat(e.toPrecision(15))),e.toString());case"string":return e;case"object":return null==e?"":Bridge.isDate(e)?Bridge.Date.format(e,null,t||null):e instanceof System.Decimal?e.isInteger()?e.toFixed(0,4):e.toPrecision(e.precision()):System.Int64.is64Bit(e)?e.toString():e.format?e.format(null,t||null):Bridge.getTypeName(e)}return c.convert.convertToType(c.convert.typeCodes.String,e,t||null)},toNumberInBase:function(e,t,n){var r,i,s,o,a,u,l,h,m,g;if(2!==t&&8!==t&&10!==t&&16!==t)throw new System.ArgumentException("Invalid Base.");if(r=c.convert.typeCodes,null==e)return n===r.Int64?System.Int64.Zero:n===r.UInt64?System.UInt64.Zero:0;if(0===e.length)throw new System.ArgumentOutOfRangeException("Index was out of range. Must be non-negative and less than the size of the collection.");e=e.toLowerCase();var f=c.internal.getMinValue(n),p=c.internal.getMaxValue(n),d=!1,y=0;if("-"===e[y]){if(10!==t)throw new System.ArgumentException("String cannot contain a minus sign if the base is not 10.");if(f>=0)throw new System.OverflowException("The string was being parsed as an unsigned number and could not have a negative sign.");d=!0,++y}else"+"===e[y]&&++y;if(16===t&&e.length>=2&&"0"===e[y]&&"x"===e[y+1]&&(y+=2),2===t)i=c.internal.charsToCodes("01");else if(8===t)i=c.internal.charsToCodes("01234567");else if(10===t)i=c.internal.charsToCodes("0123456789");else{if(16!==t)throw new System.ArgumentException("Invalid Base.");i=c.internal.charsToCodes("0123456789abcdef")}for(s={},o=0;o<i.length;o++)s[i[o]]=o;if(a=i[0],u=i[i.length-1],n===r.Int64||n===r.UInt64){for(g=y;g<e.length;g++)if(!((m=e[g].charCodeAt(0))>=a&&m<=u))throw g===y?new System.FormatException("Could not find any recognizable digits."):new System.FormatException("Additional non-parsable characters are at the end of the string.");if((l=n===r.Int64?new System.Int64(Bridge.$Long.fromString(e,!1,t)):new System.UInt64(Bridge.$Long.fromString(e,!0,t))).toString(t)!==e)throw new System.OverflowException("Value was either too large or too small.");return l}for(l=0,h=p-f+1,g=y;g<e.length;g++){if(!((m=e[g].charCodeAt(0))>=a&&m<=u))throw g===y?new System.FormatException("Could not find any recognizable digits."):new System.FormatException("Additional non-parsable characters are at the end of the string.");if(l*=t,(l+=s[m])>c.internal.typeRanges.Int64_MaxValue)throw new System.OverflowException("Value was either too large or too small.")}if(d&&(l*=-1),l>p&&10!==t&&f<0&&(l-=h),l<f||l>p)throw new System.OverflowException("Value was either too large or too small.");return l},toStringInBase:function(e,t,n){var r,i,s,o,a,u,l,h;if(c.convert.typeCodes,2!==t&&8!==t&&10!==t&&16!==t)throw new System.ArgumentException("Invalid Base.");var m=c.internal.getMinValue(n),g=c.internal.getMaxValue(n),f=System.Int64.is64Bit(e);if(f){if(e.lt(m)||e.gt(g))throw new System.OverflowException("Value was either too large or too small for an unsigned byte.")}else if(e<m||e>g)throw new System.OverflowException("Value was either too large or too small for an unsigned byte.");if(r=!1,f)return 10===t?e.toString():e.value.toUnsigned().toString(t);if(e<0&&(10===t?(r=!0,e*=-1):e=g+1-m+e),2===t)i="01";else if(8===t)i="01234567";else if(10===t)i="0123456789";else{if(16!==t)throw new System.ArgumentException("Invalid Base.");i="0123456789abcdef"}for(s={},o=i.split(""),u=0;u<o.length;u++)a=o[u],s[u]=a;if(l="",0===e||f&&e.eq(0))l="0";else if(f)for(;e.gt(0);)h=e.mod(t),e=e.sub(h).div(t),l+=s[h.toNumber()];else for(;e>0;)e=(e-(h=e%t))/t,l+=s[h];return r&&(l+="-"),l.split("").reverse().join("")},toBase64String:function(e,t,n,r){var i;if(null==e)throw new System.ArgumentNullException("inArray");if(t=t||0,r=r||0,(n=null!=n?n:e.length)<0)throw new System.ArgumentOutOfRangeException("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException("offset","Value must be positive.");if(r<0||r>1)throw new System.ArgumentException("Illegal enum value.");if(t>(i=e.length)-n)throw new System.ArgumentOutOfRangeException("offset","Offset and length must refer to a position in the string.");if(0===i)return"";var s=1===r,o=c.internal.toBase64_CalculateAndValidateOutputLength(n,s),a=[];return a.length=o,c.internal.convertToBase64Array(a,e,t,n,s),a.join("")},toBase64CharArray:function(e,t,n,r,i,s){var o,a,u;if(null==e)throw new System.ArgumentNullException("inArray");if(null==r)throw new System.ArgumentNullException("outArray");if(n<0)throw new System.ArgumentOutOfRangeException("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException("offsetIn","Value must be positive.");if(i<0)throw new System.ArgumentOutOfRangeException("offsetOut","Value must be positive.");if((s=s||0)<0||s>1)throw new System.ArgumentException("Illegal enum value.");if(t>(o=e.length)-n)throw new System.ArgumentOutOfRangeException("offsetIn","Offset and length must refer to a position in the string.");if(0===o)return 0;var l=1===s;if(i>r.length-c.internal.toBase64_CalculateAndValidateOutputLength(n,l))throw new System.ArgumentOutOfRangeException("offsetOut","Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.");return a=[],u=c.internal.convertToBase64Array(a,e,t,n,l),c.internal.charsToCodes(a,r,i),u},fromBase64String:function(e){if(null==e)throw new System.ArgumentNullException("s");var t=e.split("");return c.internal.fromBase64CharPtr(t,0,t.length)},fromBase64CharArray:function(e,t,n){if(null==e)throw new System.ArgumentNullException("inArray");if(n<0)throw new System.ArgumentOutOfRangeException("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException("offset","Value must be positive.");if(t>e.length-n)throw new System.ArgumentOutOfRangeException("offset","Offset and length must refer to a position in the string.");var r=c.internal.codesToChars(e);return c.internal.fromBase64CharPtr(r,t,n)},convertToType:function(){throw new System.NotSupportedException("IConvertible interface is not supported.")}},c.internal={base64Table:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],typeRanges:{Char_MinValue:0,Char_MaxValue:65535,Byte_MinValue:0,Byte_MaxValue:255,SByte_MinValue:-128,SByte_MaxValue:127,Int16_MinValue:-32768,Int16_MaxValue:32767,UInt16_MinValue:0,UInt16_MaxValue:65535,Int32_MinValue:-2147483648,Int32_MaxValue:2147483647,UInt32_MinValue:0,UInt32_MaxValue:4294967295,Int64_MinValue:System.Int64.MinValue,Int64_MaxValue:System.Int64.MaxValue,UInt64_MinValue:System.UInt64.MinValue,UInt64_MaxValue:System.UInt64.MaxValue,Single_MinValue:-340282347e30,Single_MaxValue:340282347e30,Double_MinValue:-17976931348623157e292,Double_MaxValue:17976931348623157e292,Decimal_MinValue:System.Decimal.MinValue,Decimal_MaxValue:System.Decimal.MaxValue},base64LineBreakPosition:76,getTypeCodeName:function(e){var t,n,r,i=c.convert.typeCodes;if(null==c.internal.typeCodeNames){for(n in t={},i)i.hasOwnProperty(n)&&(t[i[n]]=n);c.internal.typeCodeNames=t}if(null==(r=c.internal.typeCodeNames[e]))throw System.ArgumentOutOfRangeException("typeCode","The specified typeCode is undefined.");return r},suggestTypeCode:function(e){var t=c.convert.typeCodes;switch(typeof e){case"boolean":return t.Boolean;case"number":return e%1!=0?t.Double:t.Int32;case"string":return t.String;case"object":if(Bridge.isDate(e))return t.DateTime;if(null!=e)return t.Object}return null},getMinValue:function(e){var t,n=c.convert.typeCodes;switch(e){case n.Char:return c.internal.typeRanges.Char_MinValue;case n.SByte:return c.internal.typeRanges.SByte_MinValue;case n.Byte:return c.internal.typeRanges.Byte_MinValue;case n.Int16:return c.internal.typeRanges.Int16_MinValue;case n.UInt16:return c.internal.typeRanges.UInt16_MinValue;case n.Int32:return c.internal.typeRanges.Int32_MinValue;case n.UInt32:return c.internal.typeRanges.UInt32_MinValue;case n.Int64:return c.internal.typeRanges.Int64_MinValue;case n.UInt64:return c.internal.typeRanges.UInt64_MinValue;case n.Single:return c.internal.typeRanges.Single_MinValue;case n.Double:return c.internal.typeRanges.Double_MinValue;case n.Decimal:return c.internal.typeRanges.Decimal_MinValue;case n.DateTime:return(t=new Date(0)).setFullYear(1),t;default:return null}},getMaxValue:function(e){var t=c.convert.typeCodes;switch(e){case t.Char:return c.internal.typeRanges.Char_MaxValue;case t.SByte:return c.internal.typeRanges.SByte_MaxValue;case t.Byte:return c.internal.typeRanges.Byte_MaxValue;case t.Int16:return c.internal.typeRanges.Int16_MaxValue;case t.UInt16:return c.internal.typeRanges.UInt16_MaxValue;case t.Int32:return c.internal.typeRanges.Int32_MaxValue;case t.UInt32:return c.internal.typeRanges.UInt32_MaxValue;case t.Int64:return c.internal.typeRanges.Int64_MaxValue;case t.UInt64:return c.internal.typeRanges.UInt64_MaxValue;case t.Single:return c.internal.typeRanges.Single_MaxValue;case t.Double:return c.internal.typeRanges.Double_MaxValue;case t.Decimal:return c.internal.typeRanges.Decimal_MaxValue;default:throw new System.ArgumentOutOfRangeException("typeCode","The specified typeCode is undefined.")}},isFloatingType:function(e){var t=c.convert.typeCodes;return e===t.Single||e===t.Double||e===t.Decimal},toNumber:function(e,t,n,r){var i,s,o=c.convert.typeCodes,a=typeof e,u=c.internal.isFloatingType(n);switch(r===o.String&&(a="string"),(System.Int64.is64Bit(e)||e instanceof System.Decimal)&&(a="number"),a){case"boolean":return e?1:0;case"number":return n===o.Decimal?(c.internal.validateNumberRange(e,n,!0),new System.Decimal(e,t)):n===o.Int64?(c.internal.validateNumberRange(e,n,!0),new System.Int64(e)):n===o.UInt64?(c.internal.validateNumberRange(e,n,!0),new System.UInt64(e)):(System.Int64.is64Bit(e)?e=e.toNumber():e instanceof System.Decimal&&(e=e.toFloat()),u||e%1==0||(e=c.internal.roundToInt(e,n)),u&&(i=c.internal.getMinValue(n),e>c.internal.getMaxValue(n)?e=1/0:e<i&&(e=-1/0)),c.internal.validateNumberRange(e,n,!1),e);case"string":if(null==e){if(null!=t)throw new System.ArgumentNullException("String","Value cannot be null.");return 0}if(u)if(n===o.Decimal){if(!/^[+-]?(\d+|\d+.|\d*\.\d+)$/.test(e)&&!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException("Input string was not in a correct format.");e=System.Decimal(e,t)}else{if(!/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/.test(e))throw new System.FormatException("Input string was not in a correct format.");e=parseFloat(e)}else{if(!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException("Input string was not in a correct format.");s=e,n===o.Int64?s!==(e=new System.Int64(e)).toString()&&this.throwOverflow(c.internal.getTypeCodeName(n)):n===o.UInt64?s!==(e=new System.UInt64(e)).toString()&&this.throwOverflow(c.internal.getTypeCodeName(n)):e=parseInt(e,10)}if(isNaN(e))throw new System.FormatException("Input string was not in a correct format.");return c.internal.validateNumberRange(e,n,!0),e;case"object":if(null==e)return 0;Bridge.isDate(e)&&c.internal.throwInvalidCastEx(c.convert.typeCodes.DateTime,n)}return r=r||c.internal.suggestTypeCode(e),c.internal.throwInvalidCastEx(r,n),c.convert.convertToType(n,e,t)},validateNumberRange:function(e,t,n){var r=c.convert.typeCodes,i=c.internal.getMinValue(t),s=c.internal.getMaxValue(t),o=c.internal.getTypeCodeName(t);(t!==r.Single&&t!==r.Double||n||e!==1/0&&e!==-1/0)&&(t===r.Decimal||t===r.Int64||t===r.UInt64?t===r.Decimal?(System.Int64.is64Bit(e)||(i.gt(e)||s.lt(e))&&this.throwOverflow(o),e=new System.Decimal(e)):t===r.Int64?(e instanceof System.UInt64?e.gt(System.Int64.MaxValue)&&this.throwOverflow(o):e instanceof System.Decimal?(e.gt(new System.Decimal(s))||e.lt(new System.Decimal(i)))&&this.throwOverflow(o):e instanceof System.Int64||(i.toNumber()>e||s.toNumber()<e)&&this.throwOverflow(o),e=new System.Int64(e)):t===r.UInt64&&(e instanceof System.Int64?e.isNegative()&&this.throwOverflow(o):e instanceof System.Decimal?(e.gt(new System.Decimal(s))||e.lt(new System.Decimal(i)))&&this.throwOverflow(o):e instanceof System.UInt64||(i.toNumber()>e||s.toNumber()<e)&&this.throwOverflow(o),e=new System.UInt64(e)):(e<i||e>s)&&this.throwOverflow(o))},throwOverflow:function(e){throw new System.OverflowException("Value was either too large or too small for '"+e+"'.")},roundToInt:function(e,t){var n,r;if(e%1==0)return e;var i=e-(n=e>=0?Math.floor(e):-1*Math.floor(-e)),s=c.internal.getMinValue(t),o=c.internal.getMaxValue(t);if(e>=0){if(e<o+.5)return(i>.5||.5===i&&0!=(1&n))&&++n,n}else if(e>=s-.5)return(i<-.5||-.5===i&&0!=(1&n))&&--n,n;throw r=c.internal.getTypeCodeName(t),new System.OverflowException("Value was either too large or too small for an '"+r+"'.")},toBase64_CalculateAndValidateOutputLength:function(e,t){var n,r=c.internal.base64LineBreakPosition,i=4*~~(e/3);if(0===(i+=e%3!=0?4:0))return 0;if(t&&(n=~~(i/r),i%r==0&&--n,i+=2*n),i>2147483647)throw new System.OutOfMemoryException;return i},convertToBase64Array:function(e,t,n,r,i){for(var s=c.internal.base64Table,o=c.internal.base64LineBreakPosition,a=r%3,u=n+(r-a),l=0,h=0,m=n;m<u;m+=3)i&&(l===o&&(e[h++]="\r",e[h++]="\n",l=0),l+=4),e[h]=s[(252&t[m])>>2],e[h+1]=s[(3&t[m])<<4|(240&t[m+1])>>4],e[h+2]=s[(15&t[m+1])<<2|(192&t[m+2])>>6],e[h+3]=s[63&t[m+2]],h+=4;switch(m=u,i&&0!==a&&l===c.internal.base64LineBreakPosition&&(e[h++]="\r",e[h++]="\n"),a){case 2:e[h]=s[(252&t[m])>>2],e[h+1]=s[(3&t[m])<<4|(240&t[m+1])>>4],e[h+2]=s[(15&t[m+1])<<2],e[h+3]=s[64],h+=4;break;case 1:e[h]=s[(252&t[m])>>2],e[h+1]=s[(3&t[m])<<4],e[h+2]=s[64],e[h+3]=s[64],h+=4}return h},fromBase64CharPtr:function(e,t,n){var r,i,s;if(n<0)throw new System.ArgumentOutOfRangeException("inputLength","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException("offset","Value must be positive.");for(;n>0&&(" "===(r=e[t+n-1])||"\n"===r||"\r"===r||"\t"===r);)n--;if(0>(i=c.internal.fromBase64_ComputeResultLength(e,t,n)))throw new System.InvalidOperationException("Contract voilation: 0 <= resultLength.");return(s=[]).length=i,c.internal.fromBase64_Decode(e,t,n,s,0,i),s},fromBase64_Decode:function(e,t,n,r,i,s){for(var o,a,u=i,l="A".charCodeAt(0),c="a".charCodeAt(0),h="0".charCodeAt(0),m="=".charCodeAt(0),g="+".charCodeAt(0),f="/".charCodeAt(0),p=" ".charCodeAt(0),d="\t".charCodeAt(0),y="\n".charCodeAt(0),S="\r".charCodeAt(0),x="Z".charCodeAt(0)-"A".charCodeAt(0),w="9".charCodeAt(0)-"0".charCodeAt(0),v=t+n,b=i+s,I=255,C=!1,E=!1;;){if(t>=v){C=!0;break}if(o=e[t].charCodeAt(0),t++,o-l>>>0<=x)o-=l;else if(o-c>>>0<=x)o-=c-26;else if(o-h>>>0<=w)o-=h-52;else switch(o){case g:o=62;break;case f:o=63;break;case S:case y:case p:case d:continue;case m:E=!0;break;default:throw new System.FormatException("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.")}if(E)break;if(0!=(2147483648&(I=I<<6|o))){if(b-i<3)return-1;r[i]=255&I>>16,r[i+1]=255&I>>8,r[i+2]=255&I,i+=3,I=255}}if(!C&&!E)throw new System.InvalidOperationException("Contract violation: should never get here.");if(E){if(o!==m)throw new System.InvalidOperationException("Contract violation: currCode == intEq.");if(t===v){if(0==(2147483648&(I<<=6)))throw new System.FormatException("Invalid length for a Base-64 char array or string.");if(b-i<2)return-1;r[i]=255&I>>16,r[i+1]=255&I>>8,i+=2,I=255}else{for(;t<v-1&&(" "===(a=e[t])||"\n"===a||"\r"===a||"\t"===a);)t++;if(t!==v-1||"="!==e[t])throw new System.FormatException("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.");if(0==(2147483648&(I<<=12)))throw new System.FormatException("Invalid length for a Base-64 char array or string.");if(b-i<1)return-1;r[i]=255&I>>16,i++,I=255}}if(255!==I)throw new System.FormatException("Invalid length for a Base-64 char array or string.");return i-u},fromBase64_ComputeResultLength:function(e,t,n){var r;if(n<0)throw new System.ArgumentOutOfRangeException("inputLength","Index was out of range. Must be non-negative and less than the size of the collection.");for(var i=t+n,s=n,o=0;t<i;)r=e[t],t++,r<=" "?s--:"="===r&&(s--,o++);if(0>s)throw new System.InvalidOperationException("Contract violation: 0 <= usefulInputLength.");if(0>o)throw new System.InvalidOperationException("Contract violation: 0 <= padding.");if(0!==o)if(1===o)o=2;else{if(2!==o)throw new System.FormatException("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.");o=1}return 3*~~(s/4)+o},charsToCodes:function(e,t,n){if(null==e)return null;n=n||0,null==t&&((t=[]).length=e.length);for(var r=0;r<e.length;r++)t[r+n]=e[r].charCodeAt(0);return t},codesToChars:function(e,t){var n,r;if(null==e)return null;for(t=t||[],n=0;n<e.length;n++)r=e[n],t[n]=String.fromCharCode(r);return t},throwInvalidCastEx:function(e,t){var n=c.internal.getTypeCodeName(e),r=c.internal.getTypeCodeName(t);throw new System.InvalidCastException("Invalid cast from '"+n+"' to '"+r+"'.")}},System.Convert=c.convert,Bridge.define("System.Net.WebSockets.ClientWebSocket",{inherits:[System.IDisposable],ctor:function(){this.$initialize(),this.messageBuffer=[],this.state="none",this.options=new System.Net.WebSockets.ClientWebSocketOptions,this.disposed=!1,this.closeStatus=null,this.closeStatusDescription=null},getCloseStatus:function(){return this.closeStatus},getState:function(){return this.state},getCloseStatusDescription:function(){return this.closeStatusDescription},getSubProtocol:function(){return this.socket?this.socket.protocol:null},connectAsync:function(e){if("none"!==this.state)throw new System.InvalidOperationException("Socket is not in initial state");this.options.setToReadOnly(),this.state="connecting";var t=new System.Threading.Tasks.TaskCompletionSource,n=this;try{this.socket=new WebSocket(e.getAbsoluteUri(),this.options.requestedSubProtocols),this.socket.binaryType="arraybuffer",this.socket.onopen=function(){n.state="open",t.setResult(null)},this.socket.onmessage=function(e){var t,r,i=e.data,s={bytes:[]};if("string"==typeof i){for(t=0;t<i.length;++t)s.bytes.push(i.charCodeAt(t));return s.messageType="text",void n.messageBuffer.push(s)}if(i instanceof ArrayBuffer){for(r=new Uint8Array(i),t=0;t<r.length;t++)s.bytes.push(r[t]);return s.messageType="binary",void n.messageBuffer.push(s)}throw new System.ArgumentException("Invalid message type.")},this.socket.onclose=function(e){n.state="closed",n.closeStatus=e.code,n.closeStatusDescription=e.reason}}catch(e){t.setException(System.Exception.create(e))}return t.task},sendAsync:function(e,t){var n,r,i,s,o;this.throwIfNotConnected(),n=new System.Threading.Tasks.TaskCompletionSource;try{switch(r=e.getArray(),t){case"binary":for(i=new ArrayBuffer(r.length),s=new Int8Array(i),o=0;o<r.length;o++)s[o]=r[o];break;case"text":i=String.fromCharCode.apply(null,r)}"close"===t?this.socket.close():this.socket.send(i),n.setResult(null)}catch(e){n.setException(System.Exception.create(e))}return n.task},receiveAsync:function(e,t){this.throwIfNotConnected();var n=new System.Threading.Tasks.TaskCompletionSource,r=this,i=Bridge.fn.bind(this,(function(){var s,o,a,u,l;try{if(t.getIsCancellationRequested())return void n.setException(new System.Threading.Tasks.TaskCanceledException("Receive has been cancelled.",n.task));if(0===r.messageBuffer.length)return void System.Threading.Tasks.Task.delay(0).continueWith(i);for(s=r.messageBuffer[0],o=e.getArray(),s.bytes.length<=o.length?(r.messageBuffer.shift(),a=s.bytes,u=!0):(a=s.bytes.slice(0,o.length),s.bytes=s.bytes.slice(o.length,s.bytes.length),u=!1),l=0;l<a.length;l++)o[l]=a[l];n.setResult(new System.Net.WebSockets.WebSocketReceiveResult(a.length,s.messageType,u))}catch(e){n.setException(System.Exception.create(e))}}),arguments);return i(),n.task},closeAsync:function(e,t,n){if(this.throwIfNotConnected(),"open"!==this.state)throw new System.InvalidOperationException("Socket is not in connected state");var r=new System.Threading.Tasks.TaskCompletionSource,i=this,s=function(){"closed"!==i.state?n.getIsCancellationRequested()?r.setException(new System.Threading.Tasks.TaskCanceledException("Closing has been cancelled.",r.task)):System.Threading.Tasks.Task.delay(0).continueWith(s):r.setResult(null)};try{this.state="closesent",this.socket.close(e,t)}catch(e){r.setException(System.Exception.create(e))}return s(),r.task},closeOutputAsync:function(e,t){if(this.throwIfNotConnected(),"open"!==this.state)throw new System.InvalidOperationException("Socket is not in connected state");var n=new System.Threading.Tasks.TaskCompletionSource;try{this.state="closesent",this.socket.close(e,t),n.setResult(null)}catch(e){n.setException(System.Exception.create(e))}return n.task},abort:function(){this.dispose()},dispose:function(){this.disposed||(this.disposed=!0,this.messageBuffer=[],"open"===state&&(this.state="closesent",this.socket.close()))},throwIfNotConnected:function(){if(this.disposed)throw new System.InvalidOperationException("Socket is disposed.");if(1!==this.socket.readyState)throw new System.InvalidOperationException("Socket is not connected.")}}),Bridge.define("System.Net.WebSockets.ClientWebSocketOptions",{ctor:function(){this.$initialize(),this.isReadOnly=!1,this.requestedSubProtocols=[]},setToReadOnly:function(){if(this.isReadOnly)throw new System.InvalidOperationException("Options are already readonly.");this.isReadOnly=!0},addSubProtocol:function(e){if(this.isReadOnly)throw new System.InvalidOperationException("Socket already started.");if(this.requestedSubProtocols.indexOf(e)>-1)throw new System.ArgumentException("Socket cannot have duplicate sub-protocols.","subProtocol");this.requestedSubProtocols.push(e)}}),Bridge.define("System.Net.WebSockets.WebSocketReceiveResult",{ctor:function(e,t,n,r,i){this.$initialize(),this.count=e,this.messageType=t,this.endOfMessage=n,this.closeStatus=r,this.closeStatusDescription=i},getCount:function(){return this.count},getMessageType:function(){return this.messageType},getEndOfMessage:function(){return this.endOfMessage},getCloseStatus:function(){return this.closeStatus},getCloseStatusDescription:function(){return this.closeStatusDescription}}),Bridge.define("System.Uri",{ctor:function(e){this.$initialize(),this.absoluteUri=e},getAbsoluteUri:function(){return this.absoluteUri}}),function(e,t){var n,r,i,s,o,a,u,l,c,h,m,g={Identity:function(e){return e},True:function(){return!0},Blank:function(){}},f="number",p="string",d=typeof t,y="function",S={"":g.Identity},x={createLambda:function(e){var t,n,r,i,s,o,a,u,l,c,h;if(null==e)return g.Identity;if(typeof e===p){if(null!=(t=S[e]))return t;if(-1===e.indexOf("=>")){for(n=new RegExp("[$]+","g"),r=0;null!=(i=n.exec(e));)(s=i[0].length)>r&&(r=s);for(o=[],a=1;a<=r;a++){for(u="",l=0;l<a;l++)u+="$";o.push(u)}return c=Array.prototype.join.call(o,","),t=new Function(c,"return "+e),S[e]=t,t}return h=e.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/),t=new Function(h[1],"return "+h[2]),S[e]=t,t}return e},isIEnumerable:function(e){if(typeof Enumerator!==d)try{return new Enumerator(e),!0}catch(e){}return!1},defineProperty:null!=Object.defineProperties?function(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(e,t,n){e[t]=n},compare:function(e,t){return e===t?0:e>t?1:-1},dispose:function(e){null!=e&&e.dispose()}},w=function(e,t,r){var i=new n,s=0;this.getCurrent=i.getCurrent,this.reset=function(){throw new Error("Reset is not supported")},this.moveNext=function(){try{switch(s){case 0:s=1,e();case 1:return!!t.apply(i)||(this.dispose(),!1);case 2:return!1}}catch(e){throw this.dispose(),e}},this.dispose=function(){if(1==s)try{r()}finally{s=2}},this.getCurrent$1=this.getCurrent,this.System$Collections$IEnumerator$getCurrent=this.getCurrent,this.System$Collections$IEnumerator$moveNext=this.moveNext,this.System$Collections$IEnumerator$reset=this.reset};w.$$inherits=[],Bridge.Class.addExtend(w,[System.IDisposable,System.Collections.IEnumerator]),n=function(){var e=null;this.getCurrent=function(){return e},this.yieldReturn=function(t){return e=t,!0},this.yieldBreak=function(){return!1}},r=function(e){this.getEnumerator=e},r.$$inherits=[],Bridge.Class.addExtend(r,[System.Collections.IEnumerable]),(r.Utils={}).createLambda=function(e){return x.createLambda(e)},r.Utils.createEnumerable=function(e){return new r(e)},r.Utils.createEnumerator=function(e,t,n){return new w(e,t,n)},r.Utils.extendTo=function(e){var t,n,i,s=e.prototype;for(n in e===Array?(t=u.prototype,x.defineProperty(s,"getSource",(function(){return this}))):(t=r.prototype,x.defineProperty(s,"getEnumerator",(function(){return r.from(this).getEnumerator()}))),t)i=t[n],s[n]!=i&&(null==s[n]||s[n+="ByLinq"]!=i)&&i instanceof Function&&x.defineProperty(s,n,i)},r.choice=function(){var e=arguments;return new r((function(){return new w((function(){e=e[0]instanceof Array?e[0]:null!=e[0].getEnumerator?e[0].toArray():e}),(function(){return this.yieldReturn(e[Math.floor(Math.random()*e.length)])}),g.Blank)}))},r.cycle=function(){var e=arguments;return new r((function(){var t=0;return new w((function(){e=e[0]instanceof Array?e[0]:null!=e[0].getEnumerator?e[0].toArray():e}),(function(){return t>=e.length&&(t=0),this.yieldReturn(e[t++])}),g.Blank)}))},i=new r((function(){return new w(g.Blank,(function(){return!1}),g.Blank)})),r.empty=function(){return i},r.from=function(e){if(null==e)return r.empty();if(e instanceof r)return e;if(typeof e==f||"boolean"==typeof e)return r.repeat(e,1);if(typeof e==p)return new r((function(){var t=0;return new w(g.Blank,(function(){return t<e.length&&this.yieldReturn(e.charCodeAt(t++))}),g.Blank)}));var t=Bridge.as(e,System.Collections.IEnumerable);if(t)return new r((function(){var e;return new w((function(){e=Bridge.getEnumerator(t)}),(function(){return!!e.moveNext()&&this.yieldReturn(e.getCurrent())}),(function(){var t=Bridge.as(e,System.IDisposable);t&&t.dispose()}))}));if(typeof e!=y){if(typeof e.length==f)return new u(e);if(!(e instanceof Object)&&x.isIEnumerable(e))return new r((function(){var t,n=!0;return new w((function(){t=new Enumerator(e)}),(function(){return n?n=!1:t.moveNext(),!t.atEnd()&&this.yieldReturn(t.item())}),g.Blank)}));if("object"==typeof Windows&&typeof e.first===y)return new r((function(){var t,n=!0;return new w((function(){t=e.first()}),(function(){return n?n=!1:t.moveNext(),t.hasCurrent?this.yieldReturn(t.current):this.yieldBreak()}),g.Blank)}))}return new r((function(){var t=[],n=0;return new w((function(){var n,r;for(n in e)(r=e[n])instanceof Function||!Object.prototype.hasOwnProperty.call(e,n)||t.push({key:n,value:r})}),(function(){return n<t.length&&this.yieldReturn(t[n++])}),g.Blank)}))},r.make=function(e){return r.repeat(e,1)},r.matches=function(e,t,n){return null==n&&(n=""),t instanceof RegExp&&(n+=t.ignoreCase?"i":"",n+=t.multiline?"m":"",t=t.source),-1===n.indexOf("g")&&(n+="g"),new r((function(){var r;return new w((function(){r=new RegExp(t,n)}),(function(){var t=r.exec(e);return!!t&&this.yieldReturn(t)}),g.Blank)}))},r.range=function(e,t,n){return null==n&&(n=1),new r((function(){var r,i=0;return new w((function(){r=e-n}),(function(){return i++<t?this.yieldReturn(r+=n):this.yieldBreak()}),g.Blank)}))},r.rangeDown=function(e,t,n){return null==n&&(n=1),new r((function(){var r,i=0;return new w((function(){r=e+n}),(function(){return i++<t?this.yieldReturn(r-=n):this.yieldBreak()}),g.Blank)}))},r.rangeTo=function(e,t,n){return null==n&&(n=1),new r(e<t?function(){var r;return new w((function(){r=e-n}),(function(){var e=r+=n;return e<=t?this.yieldReturn(e):this.yieldBreak()}),g.Blank)}:function(){var r;return new w((function(){r=e+n}),(function(){var e=r-=n;return e>=t?this.yieldReturn(e):this.yieldBreak()}),g.Blank)})},r.repeat=function(e,t){return null!=t?r.repeat(e).take(t):new r((function(){return new w(g.Blank,(function(){return this.yieldReturn(e)}),g.Blank)}))},r.repeatWithFinalize=function(e,t){return e=x.createLambda(e),t=x.createLambda(t),new r((function(){var n;return new w((function(){n=e()}),(function(){return this.yieldReturn(n)}),(function(){null!=n&&(t(n),n=null)}))}))},r.generate=function(e,t){return null!=t?r.generate(e).take(t):(e=x.createLambda(e),new r((function(){return new w(g.Blank,(function(){return this.yieldReturn(e())}),g.Blank)})))},r.toInfinity=function(e,t){return null==e&&(e=0),null==t&&(t=1),new r((function(){var n;return new w((function(){n=e-t}),(function(){return this.yieldReturn(n+=t)}),g.Blank)}))},r.toNegativeInfinity=function(e,t){return null==e&&(e=0),null==t&&(t=1),new r((function(){var n;return new w((function(){n=e+t}),(function(){return this.yieldReturn(n-=t)}),g.Blank)}))},r.unfold=function(e,t){return t=x.createLambda(t),new r((function(){var n,r=!0;return new w(g.Blank,(function(){return r?(r=!1,n=e,this.yieldReturn(n)):(n=t(n),this.yieldReturn(n))}),g.Blank)}))},r.defer=function(e){return new r((function(){var t;return new w((function(){t=r.from(e()).getEnumerator()}),(function(){return t.moveNext()?this.yieldReturn(t.getCurrent()):this.yieldBreak()}),(function(){x.dispose(t)}))}))},r.prototype.traverseBreadthFirst=function(e,t){var n=this;return e=x.createLambda(e),t=x.createLambda(t),new r((function(){var i,s=0,o=[];return new w((function(){i=n.getEnumerator()}),(function(){for(;;){if(i.moveNext())return o.push(i.getCurrent()),this.yieldReturn(t(i.getCurrent(),s));var n=r.from(o).selectMany((function(t){return e(t)}));if(!n.any())return!1;s++,o=[],x.dispose(i),i=n.getEnumerator()}}),(function(){x.dispose(i)}))}))},r.prototype.traverseDepthFirst=function(e,t){var n=this;return e=x.createLambda(e),t=x.createLambda(t),new r((function(){var i,s=[];return new w((function(){i=n.getEnumerator()}),(function(){for(;;){if(i.moveNext()){var n=t(i.getCurrent(),s.length);return s.push(i),i=r.from(e(i.getCurrent())).getEnumerator(),this.yieldReturn(n)}if(s.length<=0)return!1;x.dispose(i),i=s.pop()}}),(function(){try{x.dispose(i)}finally{r.from(s).forEach((function(e){e.dispose()}))}}))}))},r.prototype.flatten=function(){var e=this;return new r((function(){var t,n=null;return new w((function(){t=e.getEnumerator()}),(function(){for(;;){if(null!=n){if(n.moveNext())return this.yieldReturn(n.getCurrent());n=null}if(t.moveNext()){if(t.getCurrent()instanceof Array){x.dispose(n),n=r.from(t.getCurrent()).selectMany(g.Identity).flatten().getEnumerator();continue}return this.yieldReturn(t.getCurrent())}return!1}}),(function(){try{x.dispose(t)}finally{x.dispose(n)}}))}))},r.prototype.pairwise=function(e){var t=this;return e=x.createLambda(e),new r((function(){var n;return new w((function(){(n=t.getEnumerator()).moveNext()}),(function(){var t=n.getCurrent();return!!n.moveNext()&&this.yieldReturn(e(t,n.getCurrent()))}),(function(){x.dispose(n)}))}))},r.prototype.scan=function(e,t){var n,i;return null==t?(t=x.createLambda(e),n=!1):(t=x.createLambda(t),n=!0),i=this,new r((function(){var r,s,o=!0;return new w((function(){r=i.getEnumerator()}),(function(){if(o){if(o=!1,n)return this.yieldReturn(s=e);if(r.moveNext())return this.yieldReturn(s=r.getCurrent())}return!!r.moveNext()&&this.yieldReturn(s=t(s,r.getCurrent()))}),(function(){x.dispose(r)}))}))},r.prototype.select=function(e){if((e=x.createLambda(e)).length<=1)return new c(this,null,e);var t=this;return new r((function(){var n,r=0;return new w((function(){n=t.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(e(n.getCurrent(),r++))}),(function(){x.dispose(n)}))}))},r.prototype.selectMany=function(e,n){var i=this;return e=x.createLambda(e),null==n&&(n=function(e,t){return t}),n=x.createLambda(n),new r((function(){var s,o=t,a=0;return new w((function(){s=i.getEnumerator()}),(function(){if(o===t&&!s.moveNext())return!1;do{if(null==o){var i=e(s.getCurrent(),a++);o=r.from(i).getEnumerator()}if(o.moveNext())return this.yieldReturn(n(s.getCurrent(),o.getCurrent()));x.dispose(o),o=null}while(s.moveNext());return!1}),(function(){try{x.dispose(s)}finally{x.dispose(o)}}))}))},r.prototype.where=function(e){if((e=x.createLambda(e)).length<=1)return new l(this,e);var t=this;return new r((function(){var n,r=0;return new w((function(){n=t.getEnumerator()}),(function(){for(;n.moveNext();)if(e(n.getCurrent(),r++))return this.yieldReturn(n.getCurrent());return!1}),(function(){x.dispose(n)}))}))},r.prototype.choose=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n,r=0;return new w((function(){n=t.getEnumerator()}),(function(){for(;n.moveNext();){var t=e(n.getCurrent(),r++);if(null!=t)return this.yieldReturn(t)}return this.yieldBreak()}),(function(){x.dispose(n)}))}))},r.prototype.ofType=function(e){var t=this;return new r((function(){var n;return new w((function(){n=Bridge.getEnumerator(t)}),(function(){for(;n.moveNext();){var t=Bridge.as(n.getCurrent(),e);if(Bridge.hasValue(t))return this.yieldReturn(t)}return!1}),(function(){x.dispose(n)}))}))},r.prototype.zip=function(){var e,t=arguments,n=x.createLambda(arguments[arguments.length-1]),i=this;return 2==arguments.length?(e=arguments[0],new r((function(){var t,s,o=0;return new w((function(){t=i.getEnumerator(),s=r.from(e).getEnumerator()}),(function(){return!(!t.moveNext()||!s.moveNext())&&this.yieldReturn(n(t.getCurrent(),s.getCurrent(),o++))}),(function(){try{x.dispose(t)}finally{x.dispose(s)}}))}))):new r((function(){var e,s=0;return new w((function(){var n=r.make(i).concat(r.from(t).takeExceptLast().select(r.from)).select((function(e){return e.getEnumerator()})).toArray();e=r.from(n)}),(function(){if(e.all((function(e){return e.moveNext()}))){var t=e.select((function(e){return e.getCurrent()})).toArray();return t.push(s++),this.yieldReturn(n.apply(null,t))}return this.yieldBreak()}),(function(){r.from(e).forEach(x.dispose)}))}))},r.prototype.merge=function(){var e=arguments,t=this;return new r((function(){var n,i=-1;return new w((function(){n=r.make(t).concat(r.from(e).select(r.from)).select((function(e){return e.getEnumerator()})).toArray()}),(function(){for(;n.length>0;){i=i>=n.length-1?0:i+1;var e=n[i];if(e.moveNext())return this.yieldReturn(e.getCurrent());e.dispose(),n.splice(i--,1)}return this.yieldBreak()}),(function(){r.from(n).forEach(x.dispose)}))}))},r.prototype.join=function(e,n,i,s,o){n=x.createLambda(n),i=x.createLambda(i),s=x.createLambda(s);var a=this;return new r((function(){var u,l,c=null,h=0;return new w((function(){u=a.getEnumerator(),l=r.from(e).toLookup(i,g.Identity,o)}),(function(){for(var e,r;;){if(null!=c){if((e=c[h++])!==t)return this.yieldReturn(s(u.getCurrent(),e));e=null,h=0}if(!u.moveNext())return!1;r=n(u.getCurrent()),c=l.get(r).toArray()}}),(function(){x.dispose(u)}))}))},r.prototype.groupJoin=function(e,t,n,i,s){t=x.createLambda(t),n=x.createLambda(n),i=x.createLambda(i);var o=this;return new r((function(){var a=o.getEnumerator(),u=null;return new w((function(){a=o.getEnumerator(),u=r.from(e).toLookup(n,g.Identity,s)}),(function(){if(a.moveNext()){var e=u.get(t(a.getCurrent()));return this.yieldReturn(i(a.getCurrent(),e))}return!1}),(function(){x.dispose(a)}))}))},r.prototype.all=function(e){e=x.createLambda(e);var t=!0;return this.forEach((function(n){if(!e(n))return t=!1,!1})),t},r.prototype.any=function(e){e=x.createLambda(e);var t=this.getEnumerator();try{if(0==arguments.length)return t.moveNext();for(;t.moveNext();)if(e(t.getCurrent()))return!0;return!1}finally{x.dispose(t)}},r.prototype.isEmpty=function(){return!this.any()},r.prototype.concat=function(){var e,t,n=this;return 1==arguments.length?(e=arguments[0],new r((function(){var t,i;return new w((function(){t=n.getEnumerator()}),(function(){if(null==i){if(t.moveNext())return this.yieldReturn(t.getCurrent());i=r.from(e).getEnumerator()}return!!i.moveNext()&&this.yieldReturn(i.getCurrent())}),(function(){try{x.dispose(t)}finally{x.dispose(i)}}))}))):(t=arguments,new r((function(){var e;return new w((function(){e=r.make(n).concat(r.from(t).select(r.from)).select((function(e){return e.getEnumerator()})).toArray()}),(function(){for(;e.length>0;){var t=e[0];if(t.moveNext())return this.yieldReturn(t.getCurrent());t.dispose(),e.splice(0,1)}return this.yieldBreak()}),(function(){r.from(e).forEach(x.dispose)}))})))},r.prototype.insert=function(e,t){var n=this;return new r((function(){var i,s,o=0,a=!1;return new w((function(){i=n.getEnumerator(),s=r.from(t).getEnumerator()}),(function(){return o==e&&s.moveNext()?(a=!0,this.yieldReturn(s.getCurrent())):i.moveNext()?(o++,this.yieldReturn(i.getCurrent())):!(a||!s.moveNext())&&this.yieldReturn(s.getCurrent())}),(function(){try{x.dispose(i)}finally{x.dispose(s)}}))}))},r.prototype.alternate=function(e){var t=this;return new r((function(){var n,i,s,o;return new w((function(){s=e instanceof Array||null!=e.getEnumerator?r.from(r.from(e).toArray()):r.make(e),(i=t.getEnumerator()).moveNext()&&(n=i.getCurrent())}),(function(){for(;;){if(null!=o){if(o.moveNext())return this.yieldReturn(o.getCurrent());o=null}if(null!=n||!i.moveNext()){if(null!=n){var e=n;return n=null,this.yieldReturn(e)}return this.yieldBreak()}n=i.getCurrent(),o=s.getEnumerator()}}),(function(){try{x.dispose(i)}finally{x.dispose(o)}}))}))},r.prototype.contains=function(e,t){t=t||System.Collections.Generic.EqualityComparer$1.$default;var n=this.getEnumerator();try{for(;n.moveNext();)if(t.equals2(n.getCurrent(),e))return!0;return!1}finally{x.dispose(n)}},r.prototype.defaultIfEmpty=function(e){var n=this;return e===t&&(e=null),new r((function(){var t,r=!0;return new w((function(){t=n.getEnumerator()}),(function(){return t.moveNext()?(r=!1,this.yieldReturn(t.getCurrent())):!!r&&(r=!1,this.yieldReturn(e))}),(function(){x.dispose(t)}))}))},r.prototype.distinct=function(e){return this.except(r.empty(),e)},r.prototype.distinctUntilChanged=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n,r,i;return new w((function(){n=t.getEnumerator()}),(function(){for(;n.moveNext();){var t=e(n.getCurrent());if(i)return i=!1,r=t,this.yieldReturn(n.getCurrent());if(r!==t)return r=t,this.yieldReturn(n.getCurrent())}return this.yieldBreak()}),(function(){x.dispose(n)}))}))},r.prototype.except=function(e,t){var n=this;return new r((function(){var i,s;return new w((function(){i=n.getEnumerator(),s=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,t),r.from(e).forEach((function(e){s.containsKey(e)||s.add(e)}))}),(function(){for(;i.moveNext();){var e=i.getCurrent();if(!s.containsKey(e))return s.add(e),this.yieldReturn(e)}return!1}),(function(){x.dispose(i)}))}))},r.prototype.intersect=function(e,t){var n=this;return new r((function(){var i,s,o;return new w((function(){i=n.getEnumerator(),s=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,t),r.from(e).forEach((function(e){s.containsKey(e)||s.add(e)})),o=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,t)}),(function(){for(;i.moveNext();){var e=i.getCurrent();if(!o.containsKey(e)&&s.containsKey(e))return o.add(e),this.yieldReturn(e)}return!1}),(function(){x.dispose(i)}))}))},r.prototype.sequenceEqual=function(e,t){var n,i;t=t||System.Collections.Generic.EqualityComparer$1.$default,n=this.getEnumerator();try{i=r.from(e).getEnumerator();try{for(;n.moveNext();)if(!i.moveNext()||!t.equals2(n.getCurrent(),i.getCurrent()))return!1;return!i.moveNext()}finally{x.dispose(i)}}finally{x.dispose(n)}},r.prototype.union=function(e,n){var i=this;return new r((function(){var s,o,a;return new w((function(){s=i.getEnumerator(),a=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,n)}),(function(){var n;if(o===t){for(;s.moveNext();)if(n=s.getCurrent(),!a.containsKey(n))return a.add(n),this.yieldReturn(n);o=r.from(e).getEnumerator()}for(;o.moveNext();)if(n=o.getCurrent(),!a.containsKey(n))return a.add(n),this.yieldReturn(n);return!1}),(function(){try{x.dispose(s)}finally{x.dispose(o)}}))}))},r.prototype.orderBy=function(e,t){return new s(this,e,t,!1)},r.prototype.orderByDescending=function(e,t){return new s(this,e,t,!0)},r.prototype.reverse=function(){var e=this;return new r((function(){var t,n;return new w((function(){t=e.toArray(),n=t.length}),(function(){return n>0&&this.yieldReturn(t[--n])}),g.Blank)}))},r.prototype.shuffle=function(){var e=this;return new r((function(){var t;return new w((function(){t=e.toArray()}),(function(){if(t.length>0){var e=Math.floor(Math.random()*t.length);return this.yieldReturn(t.splice(e,1)[0])}return!1}),g.Blank)}))},r.prototype.weightedSample=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n,r=0;return new w((function(){n=t.choose((function(t){var n=e(t);return n<=0?null:{value:t,bound:r+=n}})).toArray()}),(function(){var e;if(n.length>0){for(var t=Math.floor(Math.random()*r)+1,i=-1,s=n.length;s-i>1;)e=Math.floor((i+s)/2),n[e].bound>=t?s=e:i=e;return this.yieldReturn(n[s].value)}return this.yieldBreak()}),g.Blank)}))},r.prototype.groupBy=function(e,t,n,i){var s=this;return e=x.createLambda(e),t=x.createLambda(t),null!=n&&(n=x.createLambda(n)),new r((function(){var r;return new w((function(){r=s.toLookup(e,t,i).toEnumerable().getEnumerator()}),(function(){for(;r.moveNext();)return null==n?this.yieldReturn(r.getCurrent()):this.yieldReturn(n(r.getCurrent().key(),r.getCurrent()));return!1}),(function(){x.dispose(r)}))}))},r.prototype.partitionBy=function(e,t,n,i){var s,o=this;return e=x.createLambda(e),t=x.createLambda(t),i=i||System.Collections.Generic.EqualityComparer$1.$default,null==n?(s=!1,n=function(e,t){return new m(e,t)}):(s=!0,n=x.createLambda(n)),new r((function(){var a,u,l=[];return new w((function(){(a=o.getEnumerator()).moveNext()&&(u=e(a.getCurrent()),l.push(t(a.getCurrent())))}),(function(){for(var o,c;1==(o=a.moveNext())&&i.equals2(u,e(a.getCurrent()));)l.push(t(a.getCurrent()));return l.length>0&&(c=n(u,s?r.from(l):l),o?(u=e(a.getCurrent()),l=[t(a.getCurrent())]):l=[],this.yieldReturn(c))}),(function(){x.dispose(a)}))}))},r.prototype.buffer=function(e){var t=this;return new r((function(){var n;return new w((function(){n=t.getEnumerator()}),(function(){for(var t=[],r=0;n.moveNext();)if(t.push(n.getCurrent()),++r>=e)return this.yieldReturn(t);return t.length>0&&this.yieldReturn(t)}),(function(){x.dispose(n)}))}))},r.prototype.aggregate=function(e,t,n){return(n=x.createLambda(n))(this.scan(e,t,n).last())},r.prototype.average=function(e,t){!e||t||Bridge.isFunction(e)||(t=e,e=null),e=x.createLambda(e);var n=t||0,r=0;if(this.forEach((function(t){(t=e(t))instanceof System.Decimal||System.Int64.is64Bit(t)?n=t.add(n):n instanceof System.Decimal||System.Int64.is64Bit(n)?n=n.add(t):n+=t,++r})),0===r)throw new System.InvalidOperationException("Sequence contains no elements");return n instanceof System.Decimal||System.Int64.is64Bit(n)?n.div(r):n/r},r.prototype.nullableAverage=function(e,t){return this.any(Bridge.isNull)?null:this.average(e,t)},r.prototype.count=function(e){e=null==e?g.True:x.createLambda(e);var t=0;return this.forEach((function(n,r){e(n,r)&&++t})),t},r.prototype.max=function(e){return null==e&&(e=g.Identity),this.select(e).aggregate((function(e,t){return 1===Bridge.compare(e,t,!0)?e:t}))},r.prototype.nullableMax=function(e){return this.any(Bridge.isNull)?null:this.max(e)},r.prototype.min=function(e){return null==e&&(e=g.Identity),this.select(e).aggregate((function(e,t){return-1===Bridge.compare(e,t,!0)?e:t}))},r.prototype.nullableMin=function(e){return this.any(Bridge.isNull)?null:this.min(e)},r.prototype.maxBy=function(e){return e=x.createLambda(e),this.aggregate((function(t,n){return 1===Bridge.compare(e(t),e(n),!0)?t:n}))},r.prototype.minBy=function(e){return e=x.createLambda(e),this.aggregate((function(t,n){return-1===Bridge.compare(e(t),e(n),!0)?t:n}))},r.prototype.sum=function(e,t){!e||t||Bridge.isFunction(e)||(t=e,e=null),null==e&&(e=g.Identity);var n=this.select(e).aggregate(0,(function(e,t){return e instanceof System.Decimal||System.Int64.is64Bit(e)?e.add(t):t instanceof System.Decimal||System.Int64.is64Bit(t)?t.add(e):e+t}));return 0===n&&t?t:n},r.prototype.nullableSum=function(e,t){return this.any(Bridge.isNull)?null:this.sum(e,t)},r.prototype.elementAt=function(e){var t,n=!1;if(this.forEach((function(r,i){if(i==e)return t=r,n=!0,!1})),!n)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return t},r.prototype.elementAtOrDefault=function(e,n){n===t&&(n=null);var r,i=!1;return this.forEach((function(t,n){if(n==e)return r=t,i=!0,!1})),i?r:n},r.prototype.first=function(e){if(null!=e)return this.where(e).first();var t,n=!1;if(this.forEach((function(e){return t=e,n=!0,!1})),!n)throw new Error("first:No element satisfies the condition.");return t},r.prototype.firstOrDefault=function(e,n){if(n===t&&(n=null),null!=e)return this.where(e).firstOrDefault(null,n);var r,i=!1;return this.forEach((function(e){return r=e,i=!0,!1})),i?r:n},r.prototype.last=function(e){if(null!=e)return this.where(e).last();var t,n=!1;if(this.forEach((function(e){n=!0,t=e})),!n)throw new Error("last:No element satisfies the condition.");return t},r.prototype.lastOrDefault=function(e,n){if(n===t&&(n=null),null!=e)return this.where(e).lastOrDefault(null,n);var r,i=!1;return this.forEach((function(e){i=!0,r=e})),i?r:n},r.prototype.single=function(e){if(null!=e)return this.where(e).single();var t,n=!1;if(this.forEach((function(e){if(n)throw new Error("single:sequence contains more than one element.");n=!0,t=e})),!n)throw new Error("single:No element satisfies the condition.");return t},r.prototype.singleOrDefault=function(e,n){if(n===t&&(n=null),null!=e)return this.where(e).singleOrDefault(null,n);var r,i=!1;return this.forEach((function(e){if(i)throw new Error("single:sequence contains more than one element.");i=!0,r=e})),i?r:n},r.prototype.skip=function(e){var t=this;return new r((function(){var n,r=0;return new w((function(){for(n=t.getEnumerator();r++<e&&n.moveNext(););}),(function(){return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){x.dispose(n)}))}))},r.prototype.skipWhile=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n,r=0,i=!1;return new w((function(){n=t.getEnumerator()}),(function(){for(;!i;){if(!n.moveNext())return!1;if(!e(n.getCurrent(),r++))return i=!0,this.yieldReturn(n.getCurrent())}return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){x.dispose(n)}))}))},r.prototype.take=function(e){var t=this;return new r((function(){var n,r=0;return new w((function(){n=t.getEnumerator()}),(function(){return!!(r++<e&&n.moveNext())&&this.yieldReturn(n.getCurrent())}),(function(){x.dispose(n)}))}))},r.prototype.takeWhile=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n,r=0;return new w((function(){n=t.getEnumerator()}),(function(){return!(!n.moveNext()||!e(n.getCurrent(),r++))&&this.yieldReturn(n.getCurrent())}),(function(){x.dispose(n)}))}))},r.prototype.takeExceptLast=function(e){null==e&&(e=1);var t=this;return new r((function(){if(e<=0)return t.getEnumerator();var n,r=[];return new w((function(){n=t.getEnumerator()}),(function(){for(;n.moveNext();){if(r.length==e)return r.push(n.getCurrent()),this.yieldReturn(r.shift());r.push(n.getCurrent())}return!1}),(function(){x.dispose(n)}))}))},r.prototype.takeFromLast=function(e){if(e<=0||null==e)return r.empty();var t=this;return new r((function(){var n,i,s=[];return new w((function(){n=t.getEnumerator()}),(function(){if(null==i){for(;n.moveNext();)s.length==e&&s.shift(),s.push(n.getCurrent());i=r.from(s).getEnumerator()}return!!i.moveNext()&&this.yieldReturn(i.getCurrent())}),(function(){x.dispose(i)}))}))},r.prototype.indexOf=function(e,t){var n=null;return typeof e===y?this.forEach((function(t,r){if(e(t,r))return n=r,!1})):(t=t||System.Collections.Generic.EqualityComparer$1.$default,this.forEach((function(r,i){if(t.equals2(r,e))return n=i,!1}))),null!==n?n:-1},r.prototype.lastIndexOf=function(e,t){var n=-1;return typeof e===y?this.forEach((function(t,r){e(t,r)&&(n=r)})):(t=t||System.Collections.Generic.EqualityComparer$1.$default,this.forEach((function(r,i){t.equals2(r,e)&&(n=i)}))),n},r.prototype.asEnumerable=function(){return r.from(this)},r.prototype.toArray=function(){var e=[];return this.forEach((function(t){e.push(t)})),e},r.prototype.toList=function(e){var t=[];return this.forEach((function(e){t.push(e)})),new(System.Collections.Generic.List$1(e||Object))(t)},r.prototype.toLookup=function(e,t,n){e=x.createLambda(e),t=x.createLambda(t);var r=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,n),i=[];return this.forEach((function(n){var s=e(n),o=t(n),a={v:null};r.tryGetValue(s,a)?a.v.push(o):(i.push(s),r.add(s,[o]))})),new h(r,i)},r.prototype.toObject=function(e,t){e=x.createLambda(e),t=x.createLambda(t);var n={};return this.forEach((function(r){n[e(r)]=t(r)})),n},r.prototype.toDictionary=function(e,t,n,r,i){e=x.createLambda(e),t=x.createLambda(t);var s=new(System.Collections.Generic.Dictionary$2(n,r))(null,i);return this.forEach((function(n){s.add(e(n),t(n))})),s},r.prototype.toJSONString=function(e,t){if(typeof JSON===d||null==JSON.stringify)throw new Error("toJSONString can't find JSON.stringify. This works native JSON support Browser or include json2.js");return JSON.stringify(this.toArray(),e,t)},r.prototype.toJoinedString=function(e,t){return null==e&&(e=""),null==t&&(t=g.Identity),this.select(t).toArray().join(e)},r.prototype.doAction=function(e){var t=this;return e=x.createLambda(e),new r((function(){var n,r=0;return new w((function(){n=t.getEnumerator()}),(function(){return!!n.moveNext()&&(e(n.getCurrent(),r++),this.yieldReturn(n.getCurrent()))}),(function(){x.dispose(n)}))}))},r.prototype.forEach=function(e){e=x.createLambda(e);var t=0,n=this.getEnumerator();try{for(;n.moveNext()&&!1!==e(n.getCurrent(),t++););}finally{x.dispose(n)}},r.prototype.write=function(e,t){null==e&&(e=""),t=x.createLambda(t);var n=!0;this.forEach((function(r){n?n=!1:document.write(e),document.write(t(r))}))},r.prototype.writeLine=function(e){e=x.createLambda(e),this.forEach((function(t){document.writeln(e(t)+"<br />")}))},r.prototype.force=function(){var e=this.getEnumerator();try{for(;e.moveNext(););}finally{x.dispose(e)}},r.prototype.letBind=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n;return new w((function(){n=r.from(e(t)).getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){x.dispose(n)}))}))},r.prototype.share=function(){var e,t=this,n=!1;return new a((function(){return new w((function(){null==e&&(e=t.getEnumerator())}),(function(){if(n)throw new Error("enumerator is disposed");return!!e.moveNext()&&this.yieldReturn(e.getCurrent())}),g.Blank)}),(function(){n=!0,x.dispose(e)}))},r.prototype.memoize=function(){var e,t,n=this,r=!1;return new a((function(){var i=-1;return new w((function(){null==t&&(t=n.getEnumerator(),e=[])}),(function(){if(r)throw new Error("enumerator is disposed");return i++,e.length<=i?!!t.moveNext()&&this.yieldReturn(e[i]=t.getCurrent()):this.yieldReturn(e[i])}),g.Blank)}),(function(){r=!0,x.dispose(t),e=null}))},r.prototype.catchError=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n;return new w((function(){n=t.getEnumerator()}),(function(){try{return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}catch(t){return e(t),!1}}),(function(){x.dispose(n)}))}))},r.prototype.finallyAction=function(e){e=x.createLambda(e);var t=this;return new r((function(){var n;return new w((function(){n=t.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){try{x.dispose(n)}finally{e()}}))}))},r.prototype.log=function(e){return e=x.createLambda(e),this.doAction((function(t){typeof console!==d&&console.log(e(t))}))},r.prototype.trace=function(e,t){return null==e&&(e="Trace"),t=x.createLambda(t),this.doAction((function(n){typeof console!==d&&console.log(e,t(n))}))},s=function(e,t,n,r,i){this.source=e,this.keySelector=x.createLambda(t),this.comparer=n||System.Collections.Generic.Comparer$1.$default,this.descending=r,this.parent=i},s.prototype=new r,s.prototype.createOrderedEnumerable=function(e,t,n){return new s(this.source,e,t,n,this)},s.prototype.thenBy=function(e,t){return this.createOrderedEnumerable(e,t,!1)},s.prototype.thenByDescending=function(e,t){return this.createOrderedEnumerable(e,t,!0)},s.prototype.getEnumerator=function(){var e,t,n=this,r=0;return new w((function(){e=[],t=[],n.source.forEach((function(n,r){e.push(n),t.push(r)}));var r=o.create(n,null);r.GenerateKeys(e),t.sort((function(e,t){return r.compare(e,t)}))}),(function(){return r<t.length&&this.yieldReturn(e[t[r++]])}),g.Blank)},o=function(e,t,n,r){this.keySelector=e,this.comparer=t,this.descending=n,this.child=r,this.keys=null},o.create=function(e,t){var n=new o(e.keySelector,e.comparer,e.descending,t);return null!=e.parent?o.create(e.parent,n):n},o.prototype.GenerateKeys=function(e){for(var t=e.length,n=this.keySelector,r=new Array(t),i=0;i<t;i++)r[i]=n(e[i]);this.keys=r,null!=this.child&&this.child.GenerateKeys(e)},o.prototype.compare=function(e,t){var n=this.comparer.compare(this.keys[e],this.keys[t]);return 0==n?null!=this.child?this.child.compare(e,t):x.compare(e,t):this.descending?-n:n},a=function(e,t){this.dispose=t,r.call(this,e)},a.prototype=new r,u=function(e){this.getSource=function(){return e}},u.prototype=new r,u.prototype.any=function(e){return null==e?this.getSource().length>0:r.prototype.any.apply(this,arguments)},u.prototype.count=function(e){return null==e?this.getSource().length:r.prototype.count.apply(this,arguments)},u.prototype.elementAt=function(e){var t=this.getSource();return 0<=e&&e<t.length?t[e]:r.prototype.elementAt.apply(this,arguments)},u.prototype.elementAtOrDefault=function(e,n){n===t&&(n=null);var r=this.getSource();return 0<=e&&e<r.length?r[e]:n},u.prototype.first=function(e){var t=this.getSource();return null==e&&t.length>0?t[0]:r.prototype.first.apply(this,arguments)},u.prototype.firstOrDefault=function(e,n){if(n===t&&(n=null),null!=e)return r.prototype.firstOrDefault.apply(this,arguments);var i=this.getSource();return i.length>0?i[0]:n},u.prototype.last=function(e){var t=this.getSource();return null==e&&t.length>0?t[t.length-1]:r.prototype.last.apply(this,arguments)},u.prototype.lastOrDefault=function(e,n){if(n===t&&(n=null),null!=e)return r.prototype.lastOrDefault.apply(this,arguments);var i=this.getSource();return i.length>0?i[i.length-1]:n},u.prototype.skip=function(e){var t=this.getSource();return new r((function(){var n;return new w((function(){n=e<0?0:e}),(function(){return n<t.length&&this.yieldReturn(t[n++])}),g.Blank)}))},u.prototype.takeExceptLast=function(e){return null==e&&(e=1),this.take(this.getSource().length-e)},u.prototype.takeFromLast=function(e){return this.skip(this.getSource().length-e)},u.prototype.reverse=function(){var e=this.getSource();return new r((function(){var t;return new w((function(){t=e.length}),(function(){return t>0&&this.yieldReturn(e[--t])}),g.Blank)}))},u.prototype.sequenceEqual=function(e,t){return(!(e instanceof u||e instanceof Array)||null!=t||r.from(e).count()==this.count())&&r.prototype.sequenceEqual.apply(this,arguments)},u.prototype.toJoinedString=function(e,t){var n=this.getSource();return null==t&&n instanceof Array?(null==e&&(e=""),n.join(e)):r.prototype.toJoinedString.apply(this,arguments)},u.prototype.getEnumerator=function(){return new Bridge.ArrayEnumerator(this.getSource())},l=function(e,t){this.prevSource=e,this.prevPredicate=t},l.prototype=new r,l.prototype.where=function(e){if((e=x.createLambda(e)).length<=1){var t=this.prevPredicate;return new l(this.prevSource,(function(n){return t(n)&&e(n)}))}return r.prototype.where.call(this,e)},l.prototype.select=function(e){return(e=x.createLambda(e)).length<=1?new c(this.prevSource,this.prevPredicate,e):r.prototype.select.call(this,e)},l.prototype.getEnumerator=function(){var e,t=this.prevPredicate,n=this.prevSource;return new w((function(){e=n.getEnumerator()}),(function(){for(;e.moveNext();)if(t(e.getCurrent()))return this.yieldReturn(e.getCurrent());return!1}),(function(){x.dispose(e)}))},c=function(e,t,n){this.prevSource=e,this.prevPredicate=t,this.prevSelector=n},c.prototype=new r,c.prototype.where=function(e){return(e=x.createLambda(e)).length<=1?new l(this,e):r.prototype.where.call(this,e)},c.prototype.select=function(e){if((e=x.createLambda(e)).length<=1){var t=this.prevSelector;return new c(this.prevSource,this.prevPredicate,(function(n){return e(t(n))}))}return r.prototype.select.call(this,e)},c.prototype.getEnumerator=function(){var e,t=this.prevPredicate,n=this.prevSelector,r=this.prevSource;return new w((function(){e=r.getEnumerator()}),(function(){for(;e.moveNext();)if(null==t||t(e.getCurrent()))return this.yieldReturn(n(e.getCurrent()));return!1}),(function(){x.dispose(e)}))},h=function(e,t){this.count=function(){return e.getCount()},this.get=function(t){var n={v:null},i=e.tryGetValue(t,n);return r.from(i?n.v:[])},this.contains=function(t){return e.containsKey(t)},this.toEnumerable=function(){return r.from(t).select((function(t){return new m(t,e.get(t))}))},this.getEnumerator=function(){return this.toEnumerable().getEnumerator()}},h.$$inherits=[],Bridge.Class.addExtend(h,[System.Collections.IEnumerable]),m=function(e,t){this.key=function(){return e},u.call(this,t)},m.prototype=new u,m.$$inherits=[],Bridge.Class.addExtend(m,[System.Collections.IEnumerable]),Bridge.Linq={},Bridge.Linq.Enumerable=r,System.Linq={},System.Linq.Enumerable=r}(Bridge.global),Bridge.define("System.Guid",{inherits:function(){return[System.IEquatable$1(System.Guid),System.IComparable$1(System.Guid),System.IFormattable]},$kind:"struct",statics:{error1:"Byte array for GUID must be exactly {0} bytes long",valid:null,split:null,nonFormat:null,replace:null,rnd:null,config:{init:function(){this.valid=new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","i"),this.split=new RegExp("^(.{8})(.{4})(.{4})(.{4})(.{12})$"),this.nonFormat=new RegExp("^[{(]?([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})[)}]?$","i"),this.replace=new RegExp("-","g"),this.rnd=new System.Random.ctor,this.empty=new System.Guid.ctor}},parse:function(e){return System.Guid.parseExact(e,null)},parseExact:function(e,t){var n=new System.Guid.ctor;return n.parseInternal(e,t,!0),n},tryParse:function(e,t){return System.Guid.tryParseExact(e,null,t)},tryParseExact:function(e,t,n){return n.v=new System.Guid.ctor,n.v.parseInternal(e,t,!1)},newGuid:function(){var e=System.Array.init(16,0);return System.Guid.rnd.nextBytes(e),e[7]=255&(15&e[7]|64),e[8]=255&(191&e[8]|128),new System.Guid.$ctor1(e)},makeBinary:function(e){return System.Int32.format(255&e,"x2")},op_Equality:function(e,t){return Bridge.referenceEquals(e,null)?Bridge.referenceEquals(t,null):e.equalsT(t)},op_Inequality:function(e,t){return!System.Guid.op_Equality(e,t)},getDefaultValue:function(){return new System.Guid}},_a:0,_b:0,_c:0,_d:0,_e:0,_f:0,_g:0,_h:0,_i:0,_j:0,_k:0,config:{alias:["equalsT","System$IEquatable$1$System$Guid$equalsT","compareTo","System$IComparable$1$System$Guid$compareTo","format","System$IFormattable$format"]},$ctor4:function(e){this.$initialize(),(new System.Guid.ctor).$clone(this),this.parseInternal(e,null,!0)},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException("b");if(16!==e.length)throw new System.ArgumentException(System.String.format(System.Guid.error1,16));this._a=e[3]<<24|e[2]<<16|e[1]<<8|e[0],this._b=Bridge.Int.sxs(65535&(e[5]<<8|e[4])),this._c=Bridge.Int.sxs(65535&(e[7]<<8|e[6])),this._d=e[8],this._e=e[9],this._f=e[10],this._g=e[11],this._h=e[12],this._i=e[13],this._j=e[14],this._k=e[15]},$ctor5:function(e,t,n,r,i,s,o,a,u,l,c){this.$initialize(),this._a=0|e,this._b=Bridge.Int.sxs(65535&t),this._c=Bridge.Int.sxs(65535&n),this._d=r,this._e=i,this._f=s,this._g=o,this._h=a,this._i=u,this._j=l,this._k=c},$ctor3:function(e,t,n,r){if(this.$initialize(),null==r)throw new System.ArgumentNullException("d");if(8!==r.length)throw new System.ArgumentException(System.String.format(System.Guid.error1,8));this._a=e,this._b=t,this._c=n,this._d=r[0],this._e=r[1],this._f=r[2],this._g=r[3],this._h=r[4],this._i=r[5],this._j=r[6],this._k=r[7]},$ctor2:function(e,t,n,r,i,s,o,a,u,l,c){this.$initialize(),this._a=e,this._b=t,this._c=n,this._d=r,this._e=i,this._f=s,this._g=o,this._h=a,this._i=u,this._j=l,this._k=c},ctor:function(){this.$initialize()},equalsT:function(e){return this._a===e._a&&this._b===e._b&&this._c===e._c&&this._d===e._d&&this._e===e._e&&this._f===e._f&&this._g===e._g&&this._h===e._h&&this._i===e._i&&this._j===e._j&&this._k===e._k},compareTo:function(e){return System.String.compare(this.toString(),e.toString())},toString:function(){return this.format$1(null)},toString$1:function(e){return this.format$1(e)},format:function(e){return this.format$1(e)},toByteArray:function(){var e=System.Array.init(16,0);return e[0]=255&this._a,e[1]=this._a>>8&255,e[2]=this._a>>16&255,e[3]=this._a>>24&255,e[4]=255&this._b,e[5]=this._b>>8&255,e[6]=255&this._c,e[7]=this._c>>8&255,e[8]=this._d,e[9]=this._e,e[10]=this._f,e[11]=this._g,e[12]=this._h,e[13]=this._i,e[14]=this._j,e[15]=this._k,e},parseInternal:function(e,t,n){var r,i,s,o,a=null;if(System.String.isNullOrEmpty(e))throw new System.ArgumentNullException("input");if(System.String.isNullOrEmpty(t)?null!=(r=System.Guid.nonFormat.exec(e))&&(a=r.slice(1).join("-").toLowerCase()):(t=t.toUpperCase(),i=!1,Bridge.referenceEquals(t,"N")?null!=(s=System.Guid.split.exec(e))&&(i=!0,e=s.slice(1).join("-")):Bridge.referenceEquals(t,"B")||Bridge.referenceEquals(t,"P")?(o=Bridge.referenceEquals(t,"B")?[123,125]:[40,41],e.charCodeAt(0)===o[0]&&e.charCodeAt(e.length-1|0)===o[1]&&(i=!0,e=e.substr(1,e.length-2|0))):i=!0,i&&null!=e.match(System.Guid.valid)&&(a=e.toLowerCase())),null!=a)return this.fromString(a),!0;if(n)throw new System.FormatException("input is not in a recognized format");return!1},format$1:function(e){var t=System.String.concat(System.UInt32.format(this._a>>>0,"x8"),System.UInt16.format(65535&this._b,"x4"),System.UInt16.format(65535&this._c,"x4"));switch(t=System.String.concat(t,[this._d,this._e,this._f,this._g,this._h,this._i,this._j,this._k].map(System.Guid.makeBinary).join("")),t=System.Guid.split.exec(t).slice(1).join("-"),e){case"n":case"N":return t.replace(System.Guid.replace,"");case"b":case"B":return System.String.concat(String.fromCharCode(123),t,String.fromCharCode(125));case"p":case"P":return System.String.concat(String.fromCharCode(40),t,String.fromCharCode(41));default:return t}},fromString:function(e){var t,n;if(!System.String.isNullOrEmpty(e)){for(e=e.replace(System.Guid.replace,""),t=System.Array.init(8,0),this._a=0|System.UInt32.parse(e.substr(0,8),16),this._b=Bridge.Int.sxs(65535&System.UInt16.parse(e.substr(8,4),16)),this._c=Bridge.Int.sxs(65535&System.UInt16.parse(e.substr(12,4),16)),n=8;n<16;n=n+1|0)t[n-8|0]=System.Byte.parse(e.substr(2*n|0,2),16);this._d=t[0],this._e=t[1],this._f=t[2],this._g=t[3],this._h=t[4],this._i=t[5],this._j=t[6],this._k=t[7]}},getHashCode:function(){return Bridge.addHash([1684632903,this._a,this._b,this._c,this._d,this._e,this._f,this._g,this._h,this._i,this._j,this._k])},$clone:function(){return this}}),Bridge.define("System.Text.RegularExpressions.Regex",{statics:{_cacheSize:15,_defaultMatchTimeout:System.TimeSpan.fromMilliseconds(-1),getCacheSize:function(){return System.Text.RegularExpressions.Regex._cacheSize},setCacheSize:function(e){if(e<0)throw new System.ArgumentOutOfRangeException("value");System.Text.RegularExpressions.Regex._cacheSize=e},escape:function(e){if(null==e)throw new System.ArgumentNullException("str");return System.Text.RegularExpressions.RegexParser.escape(e)},unescape:function(e){if(null==e)throw new System.ArgumentNullException("str");return System.Text.RegularExpressions.RegexParser.unescape(e)},isMatch:function(e,t){var n=System.Text.RegularExpressions;return n.Regex.isMatch$2(e,t,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},isMatch$1:function(e,t,n){var r=System.Text.RegularExpressions;return r.Regex.isMatch$2(e,t,n,r.Regex._defaultMatchTimeout)},isMatch$2:function(e,t,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(t,n,r,!0).isMatch(e)},match:function(e,t){var n=System.Text.RegularExpressions;return n.Regex.match$2(e,t,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},match$1:function(e,t,n){var r=System.Text.RegularExpressions;return r.Regex.match$2(e,t,n,r.Regex._defaultMatchTimeout)},match$2:function(e,t,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(t,n,r,!0).match(e)},matches:function(e,t){var n=System.Text.RegularExpressions;return n.Regex.matches$2(e,t,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},matches$1:function(e,t,n){var r=System.Text.RegularExpressions;return r.Regex.matches$2(e,t,n,r.Regex._defaultMatchTimeout)},matches$2:function(e,t,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(t,n,r,!0).matches(e)},replace:function(e,t,n){var r=System.Text.RegularExpressions;return r.Regex.replace$2(e,t,n,r.RegexOptions.None,r.Regex._defaultMatchTimeout)},replace$1:function(e,t,n,r){var i=System.Text.RegularExpressions;return i.Regex.replace$2(e,t,n,r,i.Regex._defaultMatchTimeout)},replace$2:function(e,t,n,r,i){return new System.Text.RegularExpressions.Regex.$ctor3(t,r,i,!0).replace(e,n)},replace$3:function(e,t,n){var r=System.Text.RegularExpressions;return r.Regex.replace$5(e,t,n,r.RegexOptions.None,r.Regex._defaultMatchTimeout)},replace$4:function(e,t,n,r){var i=System.Text.RegularExpressions;return i.Regex.replace$5(e,t,n,r,i.Regex._defaultMatchTimeout)},replace$5:function(e,t,n,r,i){return new System.Text.RegularExpressions.Regex.$ctor3(t,r,i,!0).replace$3(e,n)},split:function(e,t){var n=System.Text.RegularExpressions;return n.Regex.split$2(e,t,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},split$1:function(e,t,n){var r=System.Text.RegularExpressions;return r.Regex.split$2(e,t,n,r.Regex._defaultMatchTimeout)},split$2:function(e,t,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(t,n,r,!0).split(e)}},_pattern:"",_matchTimeout:System.TimeSpan.fromMilliseconds(-1),_runner:null,_caps:null,_capsize:0,_capnames:null,_capslist:null,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(e){this.$ctor1(e,System.Text.RegularExpressions.RegexOptions.None)},$ctor1:function(e,t){this.$ctor2(e,t,System.TimeSpan.fromMilliseconds(-1))},$ctor2:function(e,t,n){this.$ctor3(e,t,n,!1)},$ctor3:function(e,t,n){var r,i,s;if(this.$initialize(),r=System.Text.RegularExpressions,null==e)throw new System.ArgumentNullException("pattern");if(t<r.RegexOptions.None||t>>10!=0)throw new System.ArgumentOutOfRangeException("options");if(0!=(t&r.RegexOptions.ECMAScript)&&0!=(t&~(r.RegexOptions.ECMAScript|r.RegexOptions.IgnoreCase|r.RegexOptions.Multiline|r.RegexOptions.CultureInvariant)))throw new System.ArgumentOutOfRangeException("options");if((t|(i=System.Text.RegularExpressions.RegexOptions.IgnoreCase|System.Text.RegularExpressions.RegexOptions.Multiline|System.Text.RegularExpressions.RegexOptions.Singleline|System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace|System.Text.RegularExpressions.RegexOptions.ExplicitCapture))!==i)throw new System.NotSupportedException("Specified Regex options are not supported.");this._validateMatchTimeout(n),this._pattern=e,this._options=t,this._matchTimeout=n,this._runner=new r.RegexRunner(this),s=this._runner.parsePattern(),this._capnames=s.sparseSettings.sparseSlotNameMap,this._capslist=s.sparseSettings.sparseSlotNameMap.keys,this._capsize=this._capslist.length},getMatchTimeout:function(){return this._matchTimeout},getOptions:function(){return this._options},getRightToLeft:function(){return 0!=(this._options&System.Text.RegularExpressions.RegexOptions.RightToLeft)},isMatch:function(e){if(null==e)throw new System.ArgumentNullException("input");var t=this.getRightToLeft()?e.length:0;return this.isMatch$1(e,t)},isMatch$1:function(e,t){if(null==e)throw new System.ArgumentNullException("input");return null==this._runner.run(!0,-1,e,0,e.length,t)},match:function(e){if(null==e)throw new System.ArgumentNullException("input");var t=this.getRightToLeft()?e.length:0;return this.match$1(e,t)},match$1:function(e,t){if(null==e)throw new System.ArgumentNullException("input");return this._runner.run(!1,-1,e,0,e.length,t)},match$2:function(e,t,n){if(null==e)throw new System.ArgumentNullException("input");var r=this.getRightToLeft()?t+n:t;return this._runner.run(!1,-1,e,t,n,r)},matches:function(e){if(null==e)throw new System.ArgumentNullException("input");var t=this.getRightToLeft()?e.length:0;return this.matches$1(e,t)},matches$1:function(e,t){if(null==e)throw new System.ArgumentNullException("input");return new System.Text.RegularExpressions.MatchCollection(this,e,0,e.length,t)},getGroupNames:function(){if(null==this._capslist){for(var e=System.Globalization.CultureInfo.invariantCulture,t=[],n=this._capsize,r=0;r<n;r++)t[r]=System.Convert.toString(r,e,System.Convert.typeCodes.Int32);return t}return this._capslist.slice()},getGroupNumbers:function(){var e,t,n,r,i=this._caps;if(null==i)for(e=[],n=this._capsize,r=0;r<n;r++)e.push(r);else for(t in e=[],i)i.hasOwnProperty(t)&&(e[i[t]]=t);return e},groupNameFromNumber:function(e){var t,n;return null==this._capslist?e>=0&&e<this._capsize?(t=System.Globalization.CultureInfo.invariantCulture,System.Convert.toString(e,t,System.Convert.typeCodes.Int32)):"":null!=this._caps?null==(n=this._caps[e])?"":parseInt(n):e>=0&&e<this._capslist.length?this._capslist[e]:""},groupNumberFromName:function(e){var t,n,r,i;if(null==e)throw new System.ArgumentNullException("name");if(null!=this._capnames)return null==(t=this._capnames[e])?-1:parseInt(t);for(n=0,i=0;i<e.Length;i++){if((r=e[i])>"9"||r<"0")return-1;n*=10,n+=r-"0"}return n>=0&&n<this._capsize?n:-1},replace:function(e,t){if(null==e)throw new System.ArgumentNullException("input");var n=this.getRightToLeft()?e.length:0;return this.replace$2(e,t,-1,n)},replace$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException("input");var r=this.getRightToLeft()?e.length:0;return this.replace$2(e,t,n,r)},replace$2:function(e,t,n,r){if(null==e)throw new System.ArgumentNullException("input");if(null==t)throw new System.ArgumentNullException("replacement");return System.Text.RegularExpressions.RegexParser.parseReplacement(t,this._caps,this._capsize,this._capnames,this._options).replace(this,e,n,r)},replace$3:function(e,t){if(null==e)throw new System.ArgumentNullException("input");var n=this.getRightToLeft()?e.length:0;return this.replace$5(e,t,-1,n)},replace$4:function(e,t,n){if(null==e)throw new System.ArgumentNullException("input");var r=this.getRightToLeft()?e.length:0;return this.replace$5(e,t,n,r)},replace$5:function(e,t,n,r){if(null==e)throw new System.ArgumentNullException("input");return System.Text.RegularExpressions.RegexReplacement.replace(t,this,e,n,r)},split:function(e){if(null==e)throw new System.ArgumentNullException("input");var t=this.getRightToLeft()?e.length:0;return this.split$2(e,0,t)},split$1:function(e,t){if(null==e)throw new System.ArgumentNullException("input");var n=this.getRightToLeft()?e.length:0;return this.split$2(e,t,n)},split$2:function(e,t,n){if(null==e)throw new System.ArgumentNullException("input");return System.Text.RegularExpressions.RegexReplacement.split(this,e,t,n)},_validateMatchTimeout:function(e){var t=e.getTotalMilliseconds();if(!(-1===t||t>0&&t<=2147483646))throw new System.ArgumentOutOfRangeException("matchTimeout")}}),Bridge.define("System.Text.RegularExpressions.Capture",{_text:"",_index:0,_length:0,ctor:function(e,t,n){this.$initialize(),this._text=e,this._index=t,this._length=n},getIndex:function(){return this._index},getLength:function(){return this._length},getValue:function(){return this._text.substr(this._index,this._length)},toString:function(){return this.getValue()},_getOriginalString:function(){return this._text},_getLeftSubstring:function(){return this._text.slice(0,_index)},_getRightSubstring:function(){return this._text.slice(this._index+this._length,this._text.length)}}),Bridge.define("System.Text.RegularExpressions.CaptureCollection",{inherits:function(){return[System.Collections.ICollection]},config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator","getCount","System$Collections$ICollection$getCount"]},_group:null,_capcount:0,_captures:null,ctor:function(e){this.$initialize(),this._group=e,this._capcount=e._capcount},getSyncRoot:function(){return this._group},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},getCount:function(){return this._capcount},get:function(e){if(e===this._capcount-1&&e>=0)return this._group;if(e>=this._capcount||e<0)throw new System.ArgumentOutOfRangeException("i");return this._ensureCapturesInited(),this._captures[e]},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException("array");if(e.length<t+this._capcount)throw new System.IndexOutOfRangeException;for(var n,r=t,i=0;i<this._capcount;r++,i++)n=this.get(i),System.Array.set(e,n,[r])},getEnumerator:function(){return new System.Text.RegularExpressions.CaptureEnumerator(this)},_ensureCapturesInited:function(){var e,t,n,r;if(null==this._captures){for((e=[]).length=this._capcount,t=0;t<this._capcount-1;t++)n=this._group._caps[2*t],r=this._group._caps[2*t+1],e[t]=new System.Text.RegularExpressions.Capture(this._group._text,n,r);this._capcount>0&&(e[this._capcount-1]=this._group),this._captures=e}}}),Bridge.define("System.Text.RegularExpressions.CaptureEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},_captureColl:null,_curindex:0,ctor:function(e){this.$initialize(),this._curindex=-1,this._captureColl=e},moveNext:function(){var e=this._captureColl.getCount();return!(this._curindex>=e)&&(this._curindex++,this._curindex<e)},getCurrent:function(){return this.getCapture()},getCapture:function(){if(this._curindex<0||this._curindex>=this._captureColl.getCount())throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this._captureColl.get(this._curindex)},reset:function(){this._curindex=-1}}),Bridge.define("System.Text.RegularExpressions.Group",{inherits:function(){return[System.Text.RegularExpressions.Capture]},statics:{config:{init:function(){var e=new System.Text.RegularExpressions.Group("",[],0);this.getEmpty=function(){return e}}},synchronized:function(e){if(null==e)throw new System.ArgumentNullException("group");var t=e.getCaptures();return t.getCount()>0&&t.get(0),e}},_caps:null,_capcount:0,_capColl:null,ctor:function(e,t,n){this.$initialize();var r=System.Text.RegularExpressions,i=0===n?0:t[2*(n-1)],s=0===n?0:t[2*n-1];r.Capture.ctor.call(this,e,i,s),this._caps=t,this._capcount=n},getSuccess:function(){return 0!==this._capcount},getCaptures:function(){return null==this._capColl&&(this._capColl=new System.Text.RegularExpressions.CaptureCollection(this)),this._capColl}}),Bridge.define("System.Text.RegularExpressions.GroupCollection",{inherits:function(){return[System.Collections.ICollection]},config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator","getCount","System$Collections$ICollection$getCount"]},_match:null,_captureMap:null,_groups:null,ctor:function(e,t){this.$initialize(),this._match=e,this._captureMap=t},getSyncRoot:function(){return this._match},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},getCount:function(){return this._match._matchcount.length},get:function(e){return this._getGroup(e)},getByName:function(e){if(null==this._match._regex)return System.Text.RegularExpressions.Group.getEmpty();var t=this._match._regex.groupNumberFromName(e);return this._getGroup(t)},copyTo:function(e,t){var n,r,i,s;if(null==e)throw new System.ArgumentNullException("array");if(n=this.getCount(),e.length<t+n)throw new System.IndexOutOfRangeException;for(i=t,s=0;s<n;i++,s++)r=this._getGroup(s),System.Array.set(e,r,[i])},getEnumerator:function(){return new System.Text.RegularExpressions.GroupEnumerator(this)},_getGroup:function(e){var t;return null!=this._captureMap?null==(t=this._captureMap[e])?System.Text.RegularExpressions.Group.getEmpty():this._getGroupImpl(t):e>=this._match._matchcount.length||e<0?System.Text.RegularExpressions.Group.getEmpty():this._getGroupImpl(e)},_getGroupImpl:function(e){return 0===e?this._match:(this._ensureGroupsInited(),this._groups[e])},_ensureGroupsInited:function(){var e,t,n,r,i;if(null==this._groups){for((e=[]).length=this._match._matchcount.length,e.length>0&&(e[0]=this._match),i=0;i<e.length-1;i++)t=this._match._text,n=this._match._matches[i+1],r=this._match._matchcount[i+1],e[i+1]=new System.Text.RegularExpressions.Group(t,n,r);this._groups=e}}}),Bridge.define("System.Text.RegularExpressions.GroupEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},_groupColl:null,_curindex:0,ctor:function(e){this.$initialize(),this._curindex=-1,this._groupColl=e},moveNext:function(){var e=this._groupColl.getCount();return!(this._curindex>=e)&&(this._curindex++,this._curindex<e)},getCurrent:function(){return this.getCapture()},getCapture:function(){if(this._curindex<0||this._curindex>=this._groupColl.getCount())throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this._groupColl.get(this._curindex)},reset:function(){this._curindex=-1}}),Bridge.define("System.Text.RegularExpressions.Match",{inherits:function(){return[System.Text.RegularExpressions.Group]},statics:{config:{init:function(){var e=new System.Text.RegularExpressions.Match(null,1,"",0,0,0);this.getEmpty=function(){return e}}},synchronized:function(e){if(null==e)throw new System.ArgumentNullException("match");for(var t,n=e.getGroups(),r=n.getCount(),i=0;i<r;i++)t=n.get(i),System.Text.RegularExpressions.Group.synchronized(t);return e}},_regex:null,_matchcount:null,_matches:null,_textbeg:0,_textend:0,_textstart:0,_groupColl:null,_textpos:0,ctor:function(e,t,n,r,i,s){var o,a;for(this.$initialize(),o=[0,0],System.Text.RegularExpressions.Group.ctor.call(this,n,o,0),this._regex=e,this._matchcount=[],this._matchcount.length=t,a=0;a<t;a++)this._matchcount[a]=0;this._matches=[],this._matches.length=t,this._matches[0]=o,this._textbeg=r,this._textend=r+i,this._textstart=s},getGroups:function(){return null==this._groupColl&&(this._groupColl=new System.Text.RegularExpressions.GroupCollection(this,null)),this._groupColl},nextMatch:function(){return null==this._regex?this:this._regex._runner.run(!1,this._length,this._text,this._textbeg,this._textend-this._textbeg,this._textpos)},result:function(e){if(null==e)throw new System.ArgumentNullException("replacement");if(null==this._regex)throw new System.NotSupportedException("Result cannot be called on a failed Match.");return System.Text.RegularExpressions.RegexParser.parseReplacement(e,this._regex._caps,this._regex._capsize,this._regex._capnames,this._regex._options).replacement(this)},_isMatched:function(e){return e<this._matchcount.length&&this._matchcount[e]>0&&-2!==this._matches[e][2*this._matchcount[e]-1]},_addMatch:function(e,t,n){var r,i,s,o;if(null==this._matches[e]&&(this._matches[e]=new Array(2)),2*(r=this._matchcount[e])+2>this._matches[e].length){for(i=this._matches[e],s=new Array(8*r),o=0;o<2*r;o++)s[o]=i[o];this._matches[e]=s}this._matches[e][2*r]=t,this._matches[e][2*r+1]=n,this._matchcount[e]=r+1},_tidy:function(e){var t=this._matches[0];this._index=t[0],this._length=t[1],this._textpos=e,this._capcount=this._matchcount[0]},_groupToStringImpl:function(e){var t=this._matchcount[e];if(0===t)return"";var n=this._matches[e],r=n[2*(t-1)],i=n[2*t-1];return this._text.slice(r,r+i)},_lastGroupToStringImpl:function(){return this._groupToStringImpl(this._matchcount.length-1)}}),Bridge.define("System.Text.RegularExpressions.MatchSparse",{inherits:function(){return[System.Text.RegularExpressions.Match]},_caps:null,ctor:function(e,t,n,r,i,s,o){this.$initialize(),System.Text.RegularExpressions.Match.ctor.call(this,e,n,r,i,s,o),this._caps=t},getGroups:function(){return null==this._groupColl&&(this._groupColl=new System.Text.RegularExpressions.GroupCollection(this,this._caps)),this._groupColl}}),Bridge.define("System.Text.RegularExpressions.MatchCollection",{inherits:function(){return[System.Collections.ICollection]},config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator","getCount","System$Collections$ICollection$getCount"]},_regex:null,_input:null,_beginning:0,_length:0,_startat:0,_prevlen:0,_matches:null,_done:!1,ctor:function(e,t,n,r,i){if(this.$initialize(),i<0||i>t.Length)throw new System.ArgumentOutOfRangeException("startat");this._regex=e,this._input=t,this._beginning=n,this._length=r,this._startat=i,this._prevlen=-1,this._matches=[]},getCount:function(){return this._done||this._getMatch(2147483647),this._matches.length},getSyncRoot:function(){return this},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},get:function(e){var t=this._getMatch(e);if(null==t)throw new System.ArgumentOutOfRangeException("i");return t},copyTo:function(e,t){var n,r,i,s;if(null==e)throw new System.ArgumentNullException("array");if(n=this.getCount(),e.length<t+n)throw new System.IndexOutOfRangeException;for(i=t,s=0;s<n;i++,s++)r=this._getMatch(s),System.Array.set(e,r,[i])},getEnumerator:function(){return new System.Text.RegularExpressions.MatchEnumerator(this)},_getMatch:function(e){if(e<0)return null;if(this._matches.length>e)return this._matches[e];if(this._done)return null;var t;do{if(!(t=this._regex._runner.run(!1,this._prevLen,this._input,this._beginning,this._length,this._startat)).getSuccess())return this._done=!0,null;this._matches.push(t),this._prevLen=t._length,this._startat=t._textpos}while(this._matches.length<=e);return t}}),Bridge.define("System.Text.RegularExpressions.MatchEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},_matchcoll:null,_match:null,_curindex:0,_done:!1,ctor:function(e){this.$initialize(),this._matchcoll=e},moveNext:function(){return!this._done&&(this._match=this._matchcoll._getMatch(this._curindex),this._curindex++,null!=this._match||(this._done=!0,!1))},getCurrent:function(){if(null==this._match)throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this._match},reset:function(){this._curindex=0,this._done=!1,this._match=null}}),Bridge.define("System.Text.RegularExpressions.RegexOptions",{statics:{None:0,IgnoreCase:1,Multiline:2,ExplicitCapture:4,Compiled:8,Singleline:16,IgnorePatternWhitespace:32,RightToLeft:64,ECMAScript:256,CultureInvariant:512},$kind:"enum",$flags:!0}),Bridge.define("System.Text.RegularExpressions.RegexRunner",{statics:{},_runregex:null,_netEngine:null,_runtext:"",_runtextpos:0,_runtextbeg:0,_runtextend:0,_runtextstart:0,_quick:!1,_prevlen:0,ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException("regex");this._runregex=e;var t=e.getOptions(),n=System.Text.RegularExpressions.RegexOptions,r=(t&n.IgnoreCase)===n.IgnoreCase,i=(t&n.Multiline)===n.Multiline,s=(t&n.Singleline)===n.Singleline,o=(t&n.IgnorePatternWhitespace)===n.IgnorePatternWhitespace,a=(t&n.ExplicitCapture)===n.ExplicitCapture,u=e._matchTimeout.getTotalMilliseconds();this._netEngine=new System.Text.RegularExpressions.RegexEngine(e._pattern,r,i,s,o,a,u)},run:function(e,t,n,r,i,s){var o,a,u;if(s<0||s>n.Length)throw new System.ArgumentOutOfRangeException("start","Start index cannot be less than 0 or greater than input length.");if(i<0||i>n.Length)throw new ArgumentOutOfRangeException("length","Length cannot be less than 0 or exceed input length.");if(this._runtext=n,this._runtextbeg=r,this._runtextend=r+i,this._runtextstart=s,this._quick=e,this._prevlen=t,this._runregex.getRightToLeft()?(o=this._runtextbeg,a=-1):(o=this._runtextend,a=1),0===this._prevlen){if(this._runtextstart===o)return System.Text.RegularExpressions.Match.getEmpty();this._runtextstart+=a}return u=this._netEngine.match(this._runtext,this._runtextstart),this._convertNetEngineResults(u)},parsePattern:function(){return this._netEngine.parsePattern()},_convertNetEngineResults:function(e){var t,n,r,i,s,o,a,u;if(e.success&&this._quick)return null;if(!e.success)return System.Text.RegularExpressions.Match.getEmpty();for(n=(t=this.parsePattern()).sparseSettings.isSparse?new System.Text.RegularExpressions.MatchSparse(this._runregex,t.sparseSettings.sparseSlotMap,e.groups.length,this._runtext,0,this._runtext.length,this._runtextstart):new System.Text.RegularExpressions.Match(this._runregex,e.groups.length,this._runtext,0,this._runtext.length,this._runtextstart),o=0;o<e.groups.length;o++)for(s=0,null!=(r=e.groups[o]).descriptor&&(s=this._runregex.groupNumberFromName(r.descriptor.name)),a=0;a<r.captures.length;a++)i=r.captures[a],n._addMatch(s,i.capIndex,i.capLength);return u=e.capIndex+e.capLength,n._tidy(u),n}}),Bridge.define("System.Text.RegularExpressions.RegexParser",{statics:{_Q:5,_S:4,_Z:3,_X:2,_E:1,_category:[0,0,0,0,0,0,0,0,0,2,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,4,0,0,0,4,4,5,5,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,4,0,0,0],escape:function(e){for(var t,n,r,i=0;i<e.length;i++)if(System.Text.RegularExpressions.RegexParser._isMetachar(e[i])){t="",n=e[i],t+=e.slice(0,i);do{switch(t+="\\",n){case"\n":n="n";break;case"\r":n="r";break;case"\t":n="t";break;case"\f":n="f"}for(t+=n,r=++i;i<e.length&&(n=e[i],!System.Text.RegularExpressions.RegexParser._isMetachar(n));)i++;t+=e.slice(r,i)}while(i<e.length);return t}return e},unescape:function(e){for(var t,n,r,i=System.Globalization.CultureInfo.invariantCulture,s=0;s<e.length;s++)if("\\"===e[s]){t="",(r=new System.Text.RegularExpressions.RegexParser(i))._setPattern(e),t+=e.slice(0,s);do{for(s++,r._textto(s),s<e.length&&(t+=r._scanCharEscape()),n=s=r._textpos();s<e.length&&"\\"!==e[s];)s++;t+=e.slice(n,s)}while(s<e.length);return t}return e},parseReplacement:function(e,t,n,r,i){var s,o=System.Globalization.CultureInfo.getCurrentCulture(),a=new System.Text.RegularExpressions.RegexParser(o);return a._options=i,a._noteCaptures(t,n,r),a._setPattern(e),s=a._scanReplacement(),new System.Text.RegularExpressions.RegexReplacement(e,s,t)},_isMetachar:function(e){var t=e.charCodeAt(0);return t<="|".charCodeAt(0)&&System.Text.RegularExpressions.RegexParser._category[t]>=System.Text.RegularExpressions.RegexParser._E}},_caps:null,_capsize:0,_capnames:null,_pattern:"",_currentPos:0,_concatenation:null,_culture:null,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(e){this.$initialize(),this._culture=e,this._caps={}},_noteCaptures:function(e,t,n){this._caps=e,this._capsize=t,this._capnames=n},_setPattern:function(e){null==e&&(e=""),this._pattern=e||"",this._currentPos=0},_scanReplacement:function(){this._concatenation=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Concatenate,this._options);for(var e,t,n;0!==(e=this._charsRight());){for(t=this._textpos();e>0&&"$"!==this._rightChar();)this._moveRight(),e--;this._addConcatenate(t,this._textpos()-t),e>0&&"$"===this._moveRightGetChar()&&(n=this._scanDollar(),this._concatenation.addChild(n))}return this._concatenation},_addConcatenate:function(e,t){var n,r,i;0!==t&&(t>1?(r=this._pattern.slice(e,e+t),n=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Multi,this._options,r)):(i=this._pattern[e],n=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,i)),this._concatenation.addChild(n))},_useOptionE:function(){return 0!=(this._options&System.Text.RegularExpressions.RegexOptions.ECMAScript)},_makeException:function(e){return new System.ArgumentException("Incorrect pattern. "+e)},_scanDollar:function(){var e,t,n,r,i,s=214748364;if(0===this._charsRight())return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$");var o,a=this._rightChar(),u=this._textpos(),l=u;if("{"===a&&this._charsRight()>1?(o=!0,this._moveRight(),a=this._rightChar()):o=!1,a>="0"&&a<="9"){if(!o&&this._useOptionE()){for(e=-1,n=a-"0",this._moveRight(),this._isCaptureSlot(n)&&(e=n,l=this._textpos());this._charsRight()>0&&(a=this._rightChar())>="0"&&a<="9";){if(t=a-"0",n>s||n===s&&t>7)throw this._makeException("Capture group is out of range.");n=10*n+t,this._moveRight(),this._isCaptureSlot(n)&&(e=n,l=this._textpos())}if(this._textto(l),e>=0)return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,e)}else if(e=this._scanDecimal(),(!o||this._charsRight()>0&&"}"===this._moveRightGetChar())&&this._isCaptureSlot(e))return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,e)}else if(o&&this._isWordChar(a)){if(r=this._scanCapname(),this._charsRight()>0&&"}"===this._moveRightGetChar()&&this._isCaptureName(r))return i=this._captureSlotFromName(r),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,i)}else if(!o){switch(e=1,a){case"$":return this._moveRight(),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$");case"&":e=0;break;case"`":e=System.Text.RegularExpressions.RegexReplacement.LeftPortion;break;case"'":e=System.Text.RegularExpressions.RegexReplacement.RightPortion;break;case"+":e=System.Text.RegularExpressions.RegexReplacement.LastGroup;break;case"_":e=System.Text.RegularExpressions.RegexReplacement.WholeString}if(1!==e)return this._moveRight(),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,e)}return this._textto(u),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$")},_scanDecimal:function(){for(var e,t,n=214748364,r=0;this._charsRight()>0&&!((e=this._rightChar())<"0"||e>"9");){if(t=e-"0",this._moveRight(),r>n||r===n&&t>7)throw this._makeException("Capture group is out of range.");r*=10,r+=t}return r},_scanOctal:function(){var e,t,n;for((n=3)>this._charsRight()&&(n=this._charsRight()),t=0;n>0&&(e=this._rightChar()-"0")<=7&&(this._moveRight(),t*=8,t+=e,!(this._useOptionE()&&t>=32));n-=1);return t&=255,String.fromCharCode(t)},_scanHex:function(e){var t,n;if(t=0,this._charsRight()>=e)for(;e>0&&(n=this._hexDigit(this._moveRightGetChar()))>=0;e-=1)t*=16,t+=n;if(e>0)throw this._makeException("Insufficient hexadecimal digits.");return t},_hexDigit:function(e){var t,n=e.charCodeAt(0);return(t=n-"0".charCodeAt(0))<=9?t:(t=n-"a".charCodeAt(0))<=5||(t=n-"A".charCodeAt(0))<=5?t+10:-1},_scanControl:function(){if(this._charsRight()<=0)throw this._makeException("Missing control character.");var e=this._moveRightGetChar().charCodeAt(0);if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)&&(e-="a".charCodeAt(0)-"A".charCodeAt(0)),(e-="@".charCodeAt(0))<" ".charCodeAt(0))return String.fromCharCode(e);throw this._makeException("Unrecognized control character.")},_scanCapname:function(){for(var e=this._textpos();this._charsRight()>0;)if(!this._isWordChar(this._moveRightGetChar())){this._moveLeft();break}return _pattern.slice(e,this._textpos())},_scanCharEscape:function(){var e=this._moveRightGetChar();if(e>="0"&&e<="7")return this._moveLeft(),this._scanOctal();switch(e){case"x":return this._scanHex(2);case"u":return this._scanHex(4);case"a":return"";case"b":return"\b";case"e":return"";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"c":return this._scanControl();default:if("8"===e||"9"===e||"_"===e||!this._useOptionE()&&this._isWordChar(e))throw this._makeException("Unrecognized escape sequence \\"+e+".");return e}},_captureSlotFromName:function(e){return this._capnames[e]},_isCaptureSlot:function(e){return null!=this._caps?null!=this._caps[e]:e>=0&&e<this._capsize},_isCaptureName:function(e){return null!=this._capnames&&null!=_capnames[e]},_isWordChar:function(e){return System.Char.isLetter(e.charCodeAt(0))},_charsRight:function(){return this._pattern.length-this._currentPos},_rightChar:function(){return this._pattern[this._currentPos]},_moveRightGetChar:function(){return this._pattern[this._currentPos++]},_moveRight:function(){this._currentPos++},_textpos:function(){return this._currentPos},_textto:function(e){this._currentPos=e},_moveLeft:function(){this._currentPos--}}),Bridge.define("System.Text.RegularExpressions.RegexNode",{statics:{One:9,Multi:12,Ref:13,Empty:23,Concatenate:25},_type:0,_str:null,_children:null,_next:null,_m:0,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(e,t,n){this.$initialize(),this._type=e,this._options=t,e===System.Text.RegularExpressions.RegexNode.Ref?this._m=n:this._str=n||null},addChild:function(e){null==this._children&&(this._children=[]);var t=e._reduce();this._children.push(t),t._next=this},childCount:function(){return null==this._children?0:this._children.length},child:function(e){return this._children[e]},_reduce:function(){return this._type===System.Text.RegularExpressions.RegexNode.Concatenate?this._reduceConcatenation():this},_reduceConcatenation:function(){var e,t,n,r,i,s,o=!1,a=0;if(null==this._children)return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Empty,this._options);for(r=0,i=0;r<this._children.length;r++,i++)if(t=this._children[r],i<r&&(this._children[i]=t),t._type===System.Text.RegularExpressions.RegexNode.Concatenate&&t._isRightToLeft()){for(s=0;s<t._children.length;s++)t._children[s]._next=this;this._children.splice.apply(this._children,[r+1,0].concat(t._children)),i--}else if(t._type===System.Text.RegularExpressions.RegexNode.Multi||t._type===System.Text.RegularExpressions.RegexNode.One){if(e=t._options&(System.Text.RegularExpressions.RegexOptions.RightToLeft|System.Text.RegularExpressions.RegexOptions.IgnoreCase),!o||a!==e){o=!0,a=e;continue}(n=this._children[--i])._type===System.Text.RegularExpressions.RegexNode.One&&(n._type=System.Text.RegularExpressions.RegexNode.Multi,n._str=n._str),0==(e&System.Text.RegularExpressions.RegexOptions.RightToLeft)?n._str+=t._str:n._str=t._str+n._str}else t._type===System.Text.RegularExpressions.RegexNode.Empty?i--:o=!1;return i<r&&this._children.splice(i,r-i),this._stripEnation(System.Text.RegularExpressions.RegexNode.Empty)},_stripEnation:function(e){switch(this.childCount()){case 0:return new c.RegexNode(e,this._options);case 1:return this.child(0);default:return this}},_isRightToLeft:function(){return(this._options&System.Text.RegularExpressions.RegexOptions.RightToLeft)>0}}),Bridge.define("System.Text.RegularExpressions.RegexReplacement",{statics:{replace:function(e,t,n,r,i){var s,o,a,u,l,c,h;if(null==e)throw new System.ArgumentNullException("evaluator");if(r<-1)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than -1.");if(i<0||i>n.length)throw new System.ArgumentOutOfRangeException("startat","Start index cannot be less than 0 or greater than input length.");if(0===r)return n;if((s=t.match$1(n,i)).getSuccess()){if(o="",t.getRightToLeft()){c=[],a=n.length;do{if((u=s.getIndex())+(l=s.getLength())!==a&&c.push(n.slice(u+l,a)),a=u,c.push(e(s)),0==--r)break;s=s.nextMatch()}while(s.getSuccess());for(o=new StringBuilder,a>0&&(o+=o.slice(0,a)),h=c.length-1;h>=0;h--)o+=c[h]}else{a=0;do{if(u=s.getIndex(),l=s.getLength(),u!==a&&(o+=n.slice(a,u)),a=u+l,o+=e(s),0==--r)break;s=s.nextMatch()}while(s.getSuccess());a<n.length&&(o+=n.slice(a,n.length))}return o}return n},split:function(e,t,n,r){var i,s,o,a,u,l,c,h;if(n<0)throw new System.ArgumentOutOfRangeException("count","Count can't be less than 0.");if(r<0||r>t.length)throw new System.ArgumentOutOfRangeException("startat","Start index cannot be less than 0 or greater than input length.");if(i=[],1===n)return i.push(t),i;if(--n,(s=e.match$1(t,r)).getSuccess())if(e.getRightToLeft()){for(a=t.length;;){for(u=s.getIndex(),l=s.getLength(),h=(c=s.getGroups()).getCount(),i.push(t.slice(u+l,a)),a=u,o=1;o<h;o++)s._isMatched(o)&&i.push(c.get(o).toString());if(0==--n)break;if(!(s=s.nextMatch()).getSuccess())break}i.push(t.slice(0,a)),i.reverse()}else{for(a=0;;){for(u=s.getIndex(),l=s.getLength(),h=(c=s.getGroups()).getCount(),i.push(t.slice(a,u)),a=u+l,o=1;o<h;o++)s._isMatched(o)&&i.push(c.get(o).toString());if(0==--n)break;if(!(s=s.nextMatch()).getSuccess())break}i.push(t.slice(a,t.length))}else i.push(t);return i},Specials:4,LeftPortion:-1,RightPortion:-2,LastGroup:-3,WholeString:-4},_rep:"",_strings:[],_rules:[],ctor:function(e,t,n){if(this.$initialize(),this._rep=e,t._type!==System.Text.RegularExpressions.RegexNode.Concatenate)throw new System.ArgumentException("Replacement error.");for(var r,i,s="",o=[],a=[],u=0;u<t.childCount();u++)switch((i=t.child(u))._type){case System.Text.RegularExpressions.RegexNode.Multi:case System.Text.RegularExpressions.RegexNode.One:s+=i._str;break;case System.Text.RegularExpressions.RegexNode.Ref:s.length>0&&(a.push(o.length),o.push(s),s=""),r=i._m,null!=n&&r>=0&&(r=n[r]),a.push(-System.Text.RegularExpressions.RegexReplacement.Specials-1-r);break;default:throw new System.ArgumentException("Replacement error.")}s.length>0&&(a.push(o.length),o.push(s)),this._strings=o,this._rules=a},getPattern:function(){return _rep},replacement:function(e){return this._replacementImpl("",e)},replace:function(e,t,n,r){var i,s,o,a,u,l,c;if(n<-1)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than -1.");if(r<0||r>t.length)throw new System.ArgumentOutOfRangeException("startat","Start index cannot be less than 0 or greater than input length.");if(0===n)return t;if((i=e.match$1(t,r)).getSuccess()){if(s="",e.getRightToLeft()){l=[],o=t.length;do{if((a=i.getIndex())+(u=i.getLength())!==o&&l.push(t.slice(a+u,o)),o=a,this._replacementImplRTL(l,i),0==--n)break;i=i.nextMatch()}while(i.getSuccess());for(o>0&&(s+=s.slice(0,o)),c=l.length-1;c>=0;c--)s+=l[c]}else{o=0;do{if(a=i.getIndex(),u=i.getLength(),a!==o&&(s+=t.slice(o,a)),o=a+u,s=this._replacementImpl(s,i),0==--n)break;i=i.nextMatch()}while(i.getSuccess());o<t.length&&(s+=t.slice(o,t.length))}return s}return t},_replacementImpl:function(e,t){for(var n,r=System.Text.RegularExpressions.RegexReplacement.Specials,i=0;i<this._rules.length;i++)if((n=this._rules[i])>=0)e+=this._strings[n];else if(n<-r)e+=t._groupToStringImpl(-r-1-n);else switch(-r-1-n){case System.Text.RegularExpressions.RegexReplacement.LeftPortion:e+=t._getLeftSubstring();break;case System.Text.RegularExpressions.RegexReplacement.RightPortion:e+=t._getRightSubstring();break;case System.Text.RegularExpressions.RegexReplacement.LastGroup:e+=t._lastGroupToStringImpl();break;case System.Text.RegularExpressions.RegexReplacement.WholeString:e+=t._getOriginalString()}return e},_replacementImplRTL:function(e,t){for(var n,r=System.Text.RegularExpressions.RegexReplacement.Specials,i=_rules.length-1;i>=0;i--)if((n=this._rules[i])>=0)e.push(this._strings[n]);else if(n<-r)e.push(t._groupToStringImpl(-r-1-n));else switch(-r-1-n){case System.Text.RegularExpressions.RegexReplacement.LeftPortion:e.push(t._getLeftSubstring());break;case System.Text.RegularExpressions.RegexReplacement.RightPortion:e.push(t._getRightSubstring());break;case System.Text.RegularExpressions.RegexReplacement.LastGroup:e.push(t._lastGroupToStringImpl());break;case System.Text.RegularExpressions.RegexReplacement.WholeString:e.push(t._getOriginalString())}}}),Bridge.define("System.Text.RegularExpressions.RegexEngine",{_pattern:"",_patternInfo:null,_text:"",_textStart:0,_timeoutMs:-1,_timeoutTime:-1,_settings:null,_branchType:{base:0,offset:1,lazy:2,greedy:3,or:4},_branchResultKind:{ok:1,endPass:2,nextPass:3,nextBranch:4},ctor:function(e,t,n,r,i,s,o){if(this.$initialize(),null==e)throw new System.ArgumentNullException("pattern");this._pattern=e,this._timeoutMs=o,this._settings={ignoreCase:t,multiline:n,singleline:r,ignoreWhitespace:i,explicitCapture:s}},match:function(e,t){var n;if(null==e)throw new System.ArgumentNullException("text");if(null!=t&&(t<0||t>e.length))throw new System.ArgumentOutOfRangeException("textStart","Start index cannot be less than 0 or greater than input length.");return this._text=e,this._textStart=t,this._timeoutTime=this._timeoutMs>0?(new Date).getTime()+System.Convert.toInt32(this._timeoutMs+.5):-1,(n=this.parsePattern()).shouldFail?this._getEmptyMatch():(this._checkTimeout(),this._scanAndTransformResult(t,n.tokens,!1,null))},parsePattern:function(){if(null==this._patternInfo){var e=System.Text.RegularExpressions.RegexEngineParser.parsePattern(this._pattern,this._cloneSettings(this._settings));this._patternInfo=e}return this._patternInfo},_scanAndTransformResult:function(e,t,n,r){var i=this._scan(e,this._text.length,t,n,r);return this._collectScanResults(i,e)},_scan:function(e,t,n,r,i){var s,o,a=this._branchResultKind,u=[];if(u.grCaptureCache={},s=null,0===n.length)return(o=new System.Text.RegularExpressions.RegexEngineState).capIndex=e,o.txtIndex=e,o.capLength=0,o;var l=r?this._branchType.base:this._branchType.offset,c=this._patternInfo.isContiguous?e:t,h=new System.Text.RegularExpressions.RegexEngineBranch(l,e,e,c);for(h.pushPass(0,n,this._cloneSettings(this._settings)),h.started=!0,h.state.txtIndex=e,u.push(h);u.length;){if(s=u[u.length-1],this._scanBranch(t,u,s)===a.ok&&(null==i||s.state.capLength===i))return s.state;this._advanceToNextBranch(u,s),this._checkTimeout()}return null},_scanBranch:function(e,t,n){var r,i,s=this._branchResultKind;if(n.mustFail)return n.mustFail=!1,s.nextBranch;for(;n.hasPass();){if(null==(r=n.peekPass()).tokens||0===r.tokens.length)i=s.endPass;else{if(this._addAlternationBranches(t,n,r)===s.nextBranch)return s.nextBranch;i=this._scanPass(e,t,n,r)}switch(i){case s.nextBranch:return i;case s.nextPass:continue;case s.endPass:case s.ok:n.popPass();break;default:throw new System.InvalidOperationException("Unexpected branch result.")}}return s.ok},_scanPass:function(e,t,n,r){for(var i,s,o,a=this._branchResultKind,u=r.tokens.length;r.index<u;)if(i=r.tokens[r.index],null==(s=r.probe)){if(this._addBranchBeforeProbing(t,n,r,i))return a.nextBranch;switch(o=this._scanToken(e,t,n,r,i)){case a.nextBranch:case a.nextPass:case a.endPass:return o;case a.ok:r.index++;break;default:throw new System.InvalidOperationException("Unexpected branch-pass result.")}}else{if(s.value<s.min||s.forced){if((o=this._scanToken(e,t,n,r,i))!==a.ok)return o;s.value+=1,s.forced=!1;continue}if(this._addBranchAfterProbing(t,n,r,s),s.forced)continue;r.probe=null,r.index++}return a.ok},_addAlternationBranches:function(e,t,n){var r,i,s,o,a=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,u=this._branchType,l=n.tokens.length,c=this._branchResultKind;if(!n.alternationHandled&&!n.tokens.noAlternation){for(r=[-1],o=0;o<l;o++)n.tokens[o].type===a.alternation&&r.push(o);if(r.length>1){for(o=0;o<r.length;o++)(i=new System.Text.RegularExpressions.RegexEngineBranch(u.or,o,0,r.length,t.state)).isNotFailing=!0,(s=i.peekPass()).alternationHandled=!0,s.index=r[o]+1,e.splice(e.length-o,0,i);return e[e.length-r.length].isNotFailing=!1,t.mustFail=!0,n.alternationHandled=!0,c.nextBranch}n.tokens.noAlternation=!0}return c.ok},_addBranchBeforeProbing:function(e,t,n,r){var i,s,o=this._tryGetTokenProbe(r);return null!=o&&(n.probe=o,i=o.isLazy?this._branchType.lazy:this._branchType.greedy,s=new System.Text.RegularExpressions.RegexEngineBranch(i,o.value,o.min,o.max,t.state),e.push(s),!0)},_addBranchAfterProbing:function(e,t,n,r){var i,s,o;r.isLazy?r.value+1<=r.max&&(s=(i=t.clone()).peekPass().probe,i.value+=1,s.forced=!0,e.splice(e.length-1,0,i),t.isNotFailing=!0):r.value+1<=r.max&&((o=t.clone()).started=!0,o.peekPass().probe=null,o.peekPass().index++,e.splice(e.length-1,0,o),r.forced=!0,t.value+=1,t.isNotFailing=!0)},_tryGetTokenProbe:function(e){var t,n,r,i=e.qtoken;if(null==i)return null;if(t=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,i.type===t.quantifier)switch(i.value){case"*":case"*?":n=0,r=2147483647;break;case"+":case"+?":n=1,r=2147483647;break;case"?":case"??":n=0,r=1;break;default:throw new System.InvalidOperationException("Unexpected quantifier value.")}else if(i.type===t.quantifierN)n=i.data.n,r=i.data.n;else{if(i.type!==t.quantifierNM)return null;n=i.data.n,r=null!=i.data.m?i.data.m:2147483647}return new System.Text.RegularExpressions.RegexEngineProbe(n,r,0,i.data.isLazy)},_advanceToNextBranch:function(e,t){if(0!==e.length){var n=e[e.length-1];if(!n.started)return void(n.started=!0);if(t!==n)throw new System.InvalidOperationException("Current branch is supposed to be the last one.");if(1===e.length&&t.type===this._branchType.offset)t.value++,t.state.txtIndex=t.value,t.mustFail=!1,t.state.capIndex=null,t.state.capLength=0,t.state.groups.length=0,t.state.passes.length=1,t.state.passes[0].clearState(this._cloneSettings(this._settings)),t.value>t.max&&e.pop();else if(e.pop(),!t.isNotFailing)return n=e[e.length-1],void this._advanceToNextBranch(e,n)}},_collectScanResults:function(e,t){var n,r,i,s,o,a,u=this._patternInfo.groups,l=this._text,c={},h={},m=this._getEmptyMatch();if(null!=e){for(n=e.groups,this._fillMatch(m,e.capIndex,e.capLength,t),a=0;a<n.length;a++)(i=u[(r=n[a]).rawIndex-1]).constructs.skipCapture||(s={capIndex:r.capIndex,capLength:r.capLength,value:l.slice(r.capIndex,r.capIndex+r.capLength)},null==(o=h[i.name])?(o={capIndex:0,capLength:0,value:"",success:!1,captures:[s]},h[i.name]=o):o.captures.push(s));for(a=0;a<u.length;a++)(i=u[a]).constructs.skipCapture||!0!==c[i.name]&&(null==(o=h[i.name])?o={capIndex:0,capLength:0,value:"",success:!1,captures:[]}:o.captures.length>0&&(s=o.captures[o.captures.length-1],o.capIndex=s.capIndex,o.capLength=s.capLength,o.value=s.value,o.success=!0),c[i.name]=!0,o.descriptor=i,m.groups.push(o))}return m},_scanToken:function(e,t,n,r,i){var s=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,o=this._branchResultKind;switch(i.type){case s.group:case s.groupImnsx:case s.alternationGroup:return this._scanGroupToken(e,t,n,r,i);case s.groupImnsxMisc:return this._scanGroupImnsxToken(i.group.constructs,r.settings);case s.charGroup:return this._scanCharGroupToken(t,n,r,i,!1);case s.charNegativeGroup:return this._scanCharNegativeGroupToken(t,n,r,i,!1);case s.escChar:case s.escCharOctal:case s.escCharHex:case s.escCharUnicode:case s.escCharCtrl:return this._scanLiteral(e,t,n,r,i.data.ch);case s.escCharOther:case s.escCharClass:return this._scanEscapeToken(t,n,r,i);case s.escCharClassCategory:throw new System.NotSupportedException("Unicode Category constructions are not supported.");case s.escCharClassBlock:throw new System.NotSupportedException("Unicode Named block constructions are not supported.");case s.escCharClassDot:return this._scanDotToken(e,t,n,r);case s.escBackrefNumber:return this._scanBackrefNumberToken(e,t,n,r,i);case s.escBackrefName:return this._scanBackrefNameToken(e,t,n,r,i);case s.anchor:case s.escAnchor:return this._scanAnchorToken(e,t,n,r,i);case s.groupConstruct:case s.groupConstructName:case s.groupConstructImnsx:case s.groupConstructImnsxMisc:return o.ok;case s.alternationGroupCondition:case s.alternationGroupRefNameCondition:case s.alternationGroupRefNumberCondition:return this._scanAlternationConditionToken(e,t,n,r,i);case s.alternation:return o.endPass;case s.commentInline:case s.commentXMode:return o.ok;default:return this._scanLiteral(e,t,n,r,i.value)}},_scanGroupToken:function(e,t,n,r,i){var s,o,a=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,u=this._branchResultKind,l=n.state.txtIndex;if(r.onHold){if(i.type===a.group){var c=i.group.rawIndex,h=r.onHoldTextIndex,m=l-h,g=t.grCaptureCache[c];if(null==g&&(g={},t.grCaptureCache[c]=g),null!=g[s=h.toString()+"_"+m.toString()])return u.nextBranch;g[s]=!0,i.group.constructs.emptyCapture||(i.group.isBalancing?n.state.logCaptureGroupBalancing(i.group,h):n.state.logCaptureGroup(i.group,h,m))}return r.onHold=!1,r.onHoldTextIndex=-1,u.ok}if(i.type===a.group||i.type===a.groupImnsx){if(o=i.group.constructs,this._scanGroupImnsxToken(o,r.settings),o.isPositiveLookahead||o.isNegativeLookahead||o.isPositiveLookbehind||o.isNegativeLookbehind)return this._scanLook(n,l,e,i);if(o.isNonbacktracking)return this._scanNonBacktracking(n,l,e,i)}return r.onHoldTextIndex=l,r.onHold=!0,n.pushPass(0,i.children,this._cloneSettings(r.settings)),u.nextPass},_scanGroupImnsxToken:function(e,t){var n=this._branchResultKind;return null!=e.isIgnoreCase&&(t.ignoreCase=e.isIgnoreCase),null!=e.isMultiline&&(t.multiline=e.isMultiline),null!=e.isSingleLine&&(t.singleline=e.isSingleLine),null!=e.isIgnoreWhitespace&&(t.ignoreWhitespace=e.isIgnoreWhitespace),null!=e.isExplicitCapture&&(t.explicitCapture=e.isExplicitCapture),n.ok},_scanAlternationConditionToken:function(e,t,n,r,i){var s,o=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,a=this._branchResultKind,u=i.children,l=n.state.txtIndex,c=a.nextBranch;return i.type===o.alternationGroupRefNameCondition||i.type===o.alternationGroupRefNumberCondition?c=null!=n.state.resolveBackref(i.data.packedSlotId)?a.ok:a.nextBranch:(s=this._scan(l,e,u,!0,null),this._combineScanResults(n,s)&&(c=a.ok)),c===a.nextBranch&&r.tokens.noAlternation&&(c=a.endPass),c},_scanLook:function(e,t,n,r){var i=r.group.constructs,s=this._branchResultKind,o=r.children,a=i.isPositiveLookahead||i.isNegativeLookahead,u=i.isPositiveLookbehind||i.isNegativeLookbehind;return a||u?(o=o.slice(1,o.length),(i.isPositiveLookahead||i.isPositiveLookbehind)===(a?this._scanLookAhead(e,t,n,o):this._scanLookBehind(e,t,n,o))?s.ok:s.nextBranch):null},_scanLookAhead:function(e,t,n,r){var i=this._scan(t,n,r,!0,null);return this._combineScanResults(e,i)},_scanLookBehind:function(e,t,n,r){for(var i,s,o=t;o>=0;){if(i=t-o,s=this._scan(o,n,r,!0,i),this._combineScanResults(e,s))return!0;--o}return!1},_scanNonBacktracking:function(e,t,n,r){var i,s=this._branchResultKind,o=r.children;return o=o.slice(1,o.length),(i=this._scan(t,n,o,!0,null))?(e.state.logCapture(i.capLength),s.ok):s.nextBranch},_scanLiteral:function(e,t,n,r,i){var s,o=this._branchResultKind,a=n.state.txtIndex;if(a+i.length>e)return o.nextBranch;if(r.settings.ignoreCase){for(s=0;s<i.length;s++)if(this._text[a+s].toLowerCase()!==i[s].toLowerCase())return o.nextBranch}else for(s=0;s<i.length;s++)if(this._text[a+s]!==i[s])return o.nextBranch;return n.state.logCapture(i.length),o.ok},_scanWithJsRegex:function(e,t,n,r,i){var s,o,a=this._branchResultKind,u=t.state.txtIndex,l=this._text[u];return null==l&&(l=""),s=n.settings.ignoreCase?"i":"",null==(o=r.rgx)&&(null==i&&(i=r.value),o=new RegExp(i,s),r.rgx=o),o.test(l)?(t.state.logCapture(l.length),a.ok):a.nextBranch},_scanWithJsRegex2:function(e,t){var n=this._branchResultKind,r=this._text[e];return null==r&&(r=""),new RegExp(t,"").test(r)?n.ok:n.nextBranch},_scanCharGroupToken:function(e,t,n,r,i){var s,o,a,u,l,c,h,m=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,g=this._branchResultKind,f=t.state.txtIndex,p=this._text[f];if(null==p)return g.nextBranch;if(a=p.charCodeAt(0),u=r.data.ranges,null!=r.data.substractToken){if(r.data.substractToken.type===m.charGroup)h=this._scanCharGroupToken(e,t,n,r.data.substractToken,!0);else{if(r.data.substractToken.type!==m.charNegativeGroup)throw new System.InvalidOperationException("Unexpected substuct group token.");h=this._scanCharNegativeGroupToken(e,t,n,r.data.substractToken,!0)}if(h===g.ok)return r.type===m.charGroup?g.nextBranch:g.ok}if(null!=u.charClassToken&&this._scanWithJsRegex(e,t,n,u.charClassToken)===g.ok)return g.ok;for(o=0;o<2;o++){for(s=0;s<u.length&&!((l=u[s]).n>a);s++)if(a<=l.m)return i||t.state.logCapture(1),g.ok;null==c&&n.settings.ignoreCase&&(c=p.toUpperCase(),a=(p=p===c?p.toLowerCase():c).charCodeAt(0))}return g.nextBranch},_scanCharNegativeGroupToken:function(e,t,n,r,i){var s=this._branchResultKind,o=t.state.txtIndex;return null==this._text[o]||this._scanCharGroupToken(e,t,n,r,!0)===s.ok?s.nextBranch:(i||t.state.logCapture(1),s.ok)},_scanEscapeToken:function(e,t,n,r){return this._scanWithJsRegex(e,t,n,r)},_scanDotToken:function(e,t,n,r){var i=this._branchResultKind,s=n.state.txtIndex;if(r.settings.singleline){if(s<e)return n.state.logCapture(1),i.ok}else if(s<e&&"\n"!==this._text[s])return n.state.logCapture(1),i.ok;return i.nextBranch},_scanBackrefNumberToken:function(e,t,n,r,i){var s,o=this._branchResultKind,a=n.state.resolveBackref(i.data.slotId);return null==a?o.nextBranch:(s=this._text.slice(a.capIndex,a.capIndex+a.capLength),this._scanLiteral(e,t,n,r,s))},_scanBackrefNameToken:function(e,t,n,r,i){var s,o=this._branchResultKind,a=n.state.resolveBackref(i.data.slotId);return null==a?o.nextBranch:(s=this._text.slice(a.capIndex,a.capIndex+a.capLength),this._scanLiteral(e,t,n,r,s))},_scanAnchorToken:function(e,t,n,r,i){var s=this._branchResultKind,o=n.state.txtIndex;if("\\b"===i.value||"\\B"===i.value){if((o>0&&this._scanWithJsRegex2(o-1,"\\w")===s.ok)==(this._scanWithJsRegex2(o,"\\w")===s.ok)==("\\B"===i.value))return s.ok}else if("^"===i.value){if(0===o||r.settings.multiline&&"\n"===this._text[o-1])return s.ok}else if("$"===i.value){if(o===e||r.settings.multiline&&"\n"===this._text[o])return s.ok}else if("\\A"===i.value){if(0===o)return s.ok}else if("\\z"===i.value){if(o===e)return s.ok}else if("\\Z"===i.value){if(o===e||o===e-1&&"\n"===this._text[o])return s.ok}else if("\\G"===i.value)return s.ok;return s.nextBranch},_cloneSettings:function(e){return{ignoreCase:e.ignoreCase,multiline:e.multiline,singleline:e.singleline,ignoreWhitespace:e.ignoreWhitespace,explicitCapture:e.explicitCapture}},_combineScanResults:function(e,t){if(null!=t){for(var n=e.state.groups,r=t.groups,i=r.length,s=0;s<i;++s)n.push(r[s]);return!0}return!1},_getEmptyMatch:function(){return{capIndex:0,capLength:0,success:!1,value:"",groups:[],captures:[]}},_fillMatch:function(e,t,n,r){null==t&&(t=r),e.capIndex=t,e.capLength=n,e.success=!0,e.value=this._text.slice(t,t+n),e.groups.push({capIndex:t,capLength:n,value:e.value,success:!0,captures:[{capIndex:t,capLength:n,value:e.value}]}),e.captures.push(e.groups[0].captures[0])},_checkTimeout:function(){if(!(this._timeoutTime<0)&&(new Date).getTime()>=this._timeoutTime)throw new System.RegexMatchTimeoutException(this._text,this._pattern,System.TimeSpan.fromMilliseconds(this._timeoutMs))}}),Bridge.define("System.Text.RegularExpressions.RegexEngineBranch",{type:0,value:0,min:0,max:0,isStarted:!1,isNotFailing:!1,state:null,ctor:function(e,t,n,r,i){this.$initialize(),this.type=e,this.value=t,this.min=n,this.max=r,this.state=null!=i?i.clone():new System.Text.RegularExpressions.RegexEngineState},pushPass:function(e,t,n){var r=new System.Text.RegularExpressions.RegexEnginePass(e,t,n);this.state.passes.push(r)},peekPass:function(){return this.state.passes[this.state.passes.length-1]},popPass:function(){return this.state.passes.pop()},hasPass:function(){return this.state.passes.length>0},clone:function(){var e=new System.Text.RegularExpressions.RegexEngineBranch(this.type,this.value,this.min,this.max,this.state);return e.isNotFailing=this.isNotFailing,e}}),Bridge.define("System.Text.RegularExpressions.RegexEngineState",{txtIndex:0,capIndex:null,capLength:0,passes:null,groups:null,ctor:function(){this.$initialize(),this.passes=[],this.groups=[]},logCapture:function(e){null==this.capIndex&&(this.capIndex=this.txtIndex),this.txtIndex+=e,this.capLength+=e},logCaptureGroup:function(e,t,n){this.groups.push({rawIndex:e.rawIndex,slotId:e.packedSlotId,capIndex:t,capLength:n})},logCaptureGroupBalancing:function(e,t){for(var n,r,i,s,o=e.balancingSlotId,a=this.groups,u=a.length-1;u>=0;){if(a[u].slotId===o){n=a[u],r=u;break}--u}return null!=n&&null!=r&&(a.splice(r,1),null!=e.constructs.name1&&(s=t-(i=n.capIndex+n.capLength),this.logCaptureGroup(e,i,s)),!0)},resolveBackref:function(e){for(var t=this.groups,n=t.length-1;n>=0;){if(t[n].slotId===e)return t[n];--n}return null},clone:function(){var e,t,n=new System.Text.RegularExpressions.RegexEngineState;n.txtIndex=this.txtIndex,n.capIndex=this.capIndex,n.capLength=this.capLength;for(var r,i=n.passes,s=this.passes,o=s.length,a=0;a<o;a++)r=s[a].clone(),i.push(r);for(e=n.groups,o=(t=this.groups).length,a=0;a<o;a++)r=t[a],e.push(r);return n}}),Bridge.define("System.Text.RegularExpressions.RegexEnginePass",{index:0,tokens:null,probe:null,onHold:!1,onHoldTextIndex:-1,alternationHandled:!1,settings:null,ctor:function(e,t,n){this.$initialize(),this.index=e,this.tokens=t,this.settings=n},clearState:function(e){this.index=0,this.probe=null,this.onHold=!1,this.onHoldTextIndex=-1,this.alternationHandled=!1,this.settings=e},clone:function(){var e=new System.Text.RegularExpressions.RegexEnginePass(this.index,this.tokens,this.settings);return e.onHold=this.onHold,e.onHoldTextIndex=this.onHoldTextIndex,e.alternationHandled=this.alternationHandled,e.probe=null!=this.probe?this.probe.clone():null,e}}),Bridge.define("System.Text.RegularExpressions.RegexEngineProbe",{min:0,max:0,value:0,isLazy:!1,forced:!1,ctor:function(e,t,n,r){this.$initialize(),this.min=e,this.max=t,this.value=n,this.isLazy=r,this.forced=!1},clone:function(){var e=new System.Text.RegularExpressions.RegexEngineProbe(this.min,this.max,this.value,this.isLazy);return e.forced=this.forced,e}}),Bridge.define("System.Text.RegularExpressions.RegexEngineParser",{statics:{_hexSymbols:"0123456789abcdefABCDEF",_octSymbols:"01234567",_decSymbols:"0123456789",_escapedChars:"abtrvfnexcu",_escapedCharClasses:"pPwWsSdD",_escapedAnchors:"AZzGbB",_escapedSpecialSymbols:" .,$^{}[]()|*+-=?\\|/\"':;~!@#%&",_whiteSpaceChars:" \r\n\t\v\f \ufeff",_unicodeCategories:["Lu","Ll","Lt","Lm","Lo","L","Mn","Mc","Me","M","Nd","Nl","No","N","Pc","Pd","Ps","Pe","Pi","Pf","Po","P","Sm","Sc","Sk","So","S","Zs","Zl","Zp","Z","Cc","Cf","Cs","Co","Cn","C"],_namedCharBlocks:["IsBasicLatin","IsLatin-1Supplement","IsLatinExtended-A","IsLatinExtended-B","IsIPAExtensions","IsSpacingModifierLetters","IsCombiningDiacriticalMarks","IsGreek","IsGreekandCoptic","IsCyrillic","IsCyrillicSupplement","IsArmenian","IsHebrew","IsArabic","IsSyriac","IsThaana","IsDevanagari","IsBengali","IsGurmukhi","IsGujarati","IsOriya","IsTamil","IsTelugu","IsKannada","IsMalayalam","IsSinhala","IsThai","IsLao","IsTibetan","IsMyanmar","IsGeorgian","IsHangulJamo","IsEthiopic","IsCherokee","IsUnifiedCanadianAboriginalSyllabics","IsOgham","IsRunic","IsTagalog","IsHanunoo","IsBuhid","IsTagbanwa","IsKhmer","IsMongolian","IsLimbu","IsTaiLe","IsKhmerSymbols","IsPhoneticExtensions","IsLatinExtendedAdditional","IsGreekExtended","IsGeneralPunctuation","IsSuperscriptsandSubscripts","IsCurrencySymbols","IsCombiningDiacriticalMarksforSymbols","IsCombiningMarksforSymbols","IsLetterlikeSymbols","IsNumberForms","IsArrows","IsMathematicalOperators","IsMiscellaneousTechnical","IsControlPictures","IsOpticalCharacterRecognition","IsEnclosedAlphanumerics","IsBoxDrawing","IsBlockElements","IsGeometricShapes","IsMiscellaneousSymbols","IsDingbats","IsMiscellaneousMathematicalSymbols-A","IsSupplementalArrows-A","IsBraillePatterns","IsSupplementalArrows-B","IsMiscellaneousMathematicalSymbols-B","IsSupplementalMathematicalOperators","IsMiscellaneousSymbolsandArrows","IsCJKRadicalsSupplement","IsKangxiRadicals","IsIdeographicDescriptionCharacters","IsCJKSymbolsandPunctuation","IsHiragana","IsKatakana","IsBopomofo","IsHangulCompatibilityJamo","IsKanbun","IsBopomofoExtended","IsKatakanaPhoneticExtensions","IsEnclosedCJKLettersandMonths","IsCJKCompatibility","IsCJKUnifiedIdeographsExtensionA","IsYijingHexagramSymbols","IsCJKUnifiedIdeographs","IsYiSyllables","IsYiRadicals","IsHangulSyllables","IsHighSurrogates","IsHighPrivateUseSurrogates","IsLowSurrogates","IsPrivateUse or IsPrivateUseArea","IsCJKCompatibilityIdeographs","IsAlphabeticPresentationForms","IsArabicPresentationForms-A","IsVariationSelectors","IsCombiningHalfMarks","IsCJKCompatibilityForms","IsSmallFormVariants","IsArabicPresentationForms-B","IsHalfwidthandFullwidthForms","IsSpecials"],_controlChars:["@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_"],tokenTypes:{literal:0,escChar:110,escCharOctal:111,escCharHex:112,escCharCtrl:113,escCharUnicode:114,escCharOther:115,escCharClass:120,escCharClassCategory:121,escCharClassBlock:122,escCharClassDot:123,escAnchor:130,escBackrefNumber:140,escBackrefName:141,charGroup:200,charNegativeGroup:201,charInterval:202,anchor:300,group:400,groupImnsx:401,groupImnsxMisc:402,groupConstruct:403,groupConstructName:404,groupConstructImnsx:405,groupConstructImnsxMisc:406,quantifier:500,quantifierN:501,quantifierNM:502,alternation:600,alternationGroup:601,alternationGroupCondition:602,alternationGroupRefNumberCondition:603,alternationGroupRefNameCondition:604,commentInline:700,commentXMode:701},parsePattern:function(e,t){var n,r=System.Text.RegularExpressions.RegexEngineParser,i=r._parsePatternImpl(e,t,0,e.length),s=[];return r._fillGroupDescriptors(i,s),n=r._getGroupSparseInfo(s),r._fillBalancingGroupInfo(s,n),r._preTransformBackrefTokens(e,i,n),r._transformRawTokens(t,i,n,[],[],0),r._updateGroupDescriptors(i),{groups:s,sparseSettings:n,isContiguous:t.isContiguous||!1,shouldFail:t.shouldFail||!1,tokens:i}},_transformRawTokens:function(e,t,n,r,i,s){for(var o,a,u,l,c,h,m,g,f=System.Text.RegularExpressions.RegexEngineParser,p=f.tokenTypes,d=0;d<t.length;d++){if(a=t[d],d<t.length-1)switch((g=t[d+1]).type){case p.quantifier:case p.quantifierN:case p.quantifierNM:a.qtoken=g,t.splice(d+1,1),--d}if(a.type===p.escBackrefNumber){if(c=a.data.number,null==(l=n.getPackedSlotIdBySlotNumber(c)))throw new System.ArgumentException("Reference to undefined group number "+c.toString()+".");if(r.indexOf(l)<0){e.shouldFail=!0;continue}a.data.slotId=l}else if(a.type===p.escBackrefName){if(u=a.data.name,null==(l=n.getPackedSlotIdBySlotName(u))){if(f._matchChars(u,0,u.length,f._decSymbols).matchLength===u.length){u="\\"+u,f._updatePatternToken(a,p.escBackrefNumber,a.index,u.length,u),--d;continue}throw new System.ArgumentException("Reference to undefined group name '"+u+"'.")}if(r.indexOf(l)<0){e.shouldFail=!0;continue}a.data.slotId=l}else if(a.type===p.anchor||a.type===p.escAnchor){if("\\G"===a.value){0===s&&0===d?e.isContiguous=!0:e.shouldFail=!0,t.splice(d,1),--d;continue}}else{if(a.type===p.commentInline||a.type===p.commentXMode){t.splice(d,1),--d;continue}if(a.type===p.literal){if(d>0&&!a.qtoken&&(o=t[d-1]).type===p.literal&&!o.qtoken){o.value+=a.value,o.length+=a.length,t.splice(d,1),--d;continue}}else if(a.type===p.alternationGroupCondition&&null!=a.data)if(null!=a.data.number){if(null==(l=n.getPackedSlotIdBySlotNumber(a.data.number)))throw new System.ArgumentException("Reference to undefined group number "+u+".");a.data.packedSlotId=l,f._updatePatternToken(a,p.alternationGroupRefNumberCondition,a.index,a.length,a.value)}else null!=(l=n.getPackedSlotIdBySlotName(a.data.name))?(a.data.packedSlotId=l,f._updatePatternToken(a,p.alternationGroupRefNameCondition,a.index,a.length,a.value)):delete a.data}a.children&&a.children.length&&(h=(h=a.type===p.group?[a.group.rawIndex]:[]).concat(i),m=a.localSettings||e,f._transformRawTokens(m,a.children,n,r,h,s+1),e.shouldFail=e.shouldFail||m.shouldFail,e.isContiguous=e.isContiguous||m.isContiguous),a.type===p.group&&r.push(a.group.packedSlotId)}},_fillGroupDescriptors:function(e,t){var n,r,i;for(System.Text.RegularExpressions.RegexEngineParser._fillGroupStructure(t,e,null),i=1,r=0;r<t.length;r++)null!=(n=t[r]).constructs.name1?(n.name=n.constructs.name1,n.hasName=!0):(n.hasName=!1,n.name=i.toString(),++i)},_fillGroupStructure:function(e,t,n){for(var r,i,s,o,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes,c=0;c<t.length;c++)a=(i=t[c]).children&&i.children.length,(i.type===l.group||i.type===l.groupImnsx||i.type===l.groupImnsxMisc)&&(r={rawIndex:e.length+1,number:-1,parentGroup:null,innerGroups:[],name:null,hasName:!1,constructs:null,quantifier:null,exprIndex:-1,exprLength:0,expr:null,exprFull:null},i.group=r,i.type===l.group&&(e.push(r),null!=n&&(i.group.parentGroup=n,n.innerGroups.push(r))),o=a?i.children[0]:null,r.constructs=u._fillGroupConstructs(o),s=r.constructs,i.isNonCapturingExplicit&&(delete i.isNonCapturingExplicit,s.isNonCapturingExplicit=!0),i.isEmptyCapturing&&(delete i.isEmptyCapturing,s.emptyCapture=!0),s.skipCapture=s.isNonCapturing||s.isNonCapturingExplicit||s.isNonbacktracking||s.isPositiveLookahead||s.isNegativeLookahead||s.isPositiveLookbehind||s.isNegativeLookbehind||null==s.name1&&null!=s.name2),a&&u._fillGroupStructure(e,i.children,i.group)},_getGroupSparseInfo:function(e){var t,n,r,i,s,o,a,u,l,c,h=System.Text.RegularExpressions.RegexEngineParser,m={},g=[],f={},p={0:0,lastSlot:0};for((u={0:0}).keys=["0"],o=0;o<e.length;o++)(s=e[o]).constructs.skipCapture||(s.constructs.isNumberName1?(r=parseInt(s.constructs.name1),g.push(r),m[r]?m[r].push(s):m[r]=[s]):f[i=s.constructs.name1]?f[i].push(s):f[i]=[s]);for(l=function(e,t){return e-t},g.sort(l),c=!1,a=0;a<2;a++){for(o=0;o<e.length;o++)(s=e[o]).constructs.skipCapture||!0===s.constructs.emptyCapture===c&&(r=u.keys.length,s.hasName||(n=[s],null!=(t=m[r])&&(n=n.concat(t),m[r]=null),h._addSparseSlotForSameNamedGroups(n,r,p,u)));c=!0}for(o=0;o<e.length;o++)if(!(s=e[o]).constructs.skipCapture&&s.hasName&&!s.constructs.isNumberName1){for(t=m[r=u.keys.length];null!=t;)h._addSparseSlotForSameNamedGroups(t,r,p,u),m[r]=null,t=m[r=u.keys.length];if(!s.constructs.isNumberName1)for(t=m[r=u.keys.length];null!=t;)h._addSparseSlotForSameNamedGroups(t,r,p,u),m[r]=null,t=m[r=u.keys.length];null!=(t=f[i=s.constructs.name1])&&(h._addSparseSlotForSameNamedGroups(t,r,p,u),f[i]=null)}for(o=0;o<g.length;o++)null!=(t=m[r=g[o]])&&(h._addSparseSlotForSameNamedGroups(t,r,p,u),m[r]=null);return{isSparse:p.isSparse||!1,sparseSlotMap:p,sparseSlotNameMap:u,getPackedSlotIdBySlotNumber:function(e){return this.sparseSlotMap[e]},getPackedSlotIdBySlotName:function(e){return this.sparseSlotNameMap[e]}}},_addSparseSlot:function(e,t,n,r){var i=r.keys.length;e.packedSlotId=i,n[t]=i,r[e.name]=i,r.keys.push(e.name),!n.isSparse&&t-n.lastSlot>1&&(n.isSparse=!0),n.lastSlot=t},_addSparseSlotForSameNamedGroups:function(e,t,n,r){var i,s,o;if(System.Text.RegularExpressions.RegexEngineParser._addSparseSlot(e[0],t,n,r),s=e[0].sparseSlotId,o=e[0].packedSlotId,e.length>1)for(i=1;i<e.length;i++)e[i].sparseSlotId=s,e[i].packedSlotId=o},_fillGroupConstructs:function(e){var t,n,r,i=System.Text.RegularExpressions.RegexEngineParser,s=i.tokenTypes,o={name1:null,name2:null,isNumberName1:!1,isNumberName2:!1,isNonCapturing:!1,isNonCapturingExplicit:!1,isIgnoreCase:null,isMultiline:null,isExplicitCapture:null,isSingleLine:null,isIgnoreWhitespace:null,isPositiveLookahead:!1,isNegativeLookahead:!1,isPositiveLookbehind:!1,isNegativeLookbehind:!1,isNonbacktracking:!1};if(null==e)return o;if(e.type===s.groupConstruct)switch(e.value){case"?:":o.isNonCapturing=!0;break;case"?=":o.isPositiveLookahead=!0;break;case"?!":o.isNegativeLookahead=!0;break;case"?>":o.isNonbacktracking=!0;break;case"?<=":o.isPositiveLookbehind=!0;break;case"?<!":o.isNegativeLookbehind=!0;break;default:throw new System.ArgumentException("Unrecognized grouping construct.")}else if(e.type===s.groupConstructName){if(0===(t=e.value.slice(2,e.length-1).split("-")).length||t.length>2)throw new System.ArgumentException("Invalid group name.");t[0].length&&(o.name1=t[0],n=i._validateGroupName(t[0]),o.isNumberName1=n.isNumberName),2===t.length&&(o.name2=t[1],r=i._validateGroupName(t[1]),o.isNumberName2=r.isNumberName)}else if(e.type===s.groupConstructImnsx||e.type===s.groupConstructImnsxMisc)for(var a,u=e.type===s.groupConstructImnsx?1:0,l=e.length-1-u,c=!0,h=1;h<=l;h++)"-"===(a=e.value[h])?c=!1:"i"===a?o.isIgnoreCase=c:"m"===a?o.isMultiline=c:"n"===a?o.isExplicitCapture=c:"s"===a?o.isSingleLine=c:"x"===a&&(o.isIgnoreWhitespace=c);return o},_validateGroupName:function(e){var t,n;if(!e||!e.length)throw new System.ArgumentException("Invalid group name: Group names must begin with a word character.");if((t=e[0]>="0"&&e[0]<="9")&&(n=System.Text.RegularExpressions.RegexEngineParser)._matchChars(e,0,e.length,n._decSymbols).matchLength!==e.length)throw new System.ArgumentException("Invalid group name: Group names must begin with a word character.");return{isNumberName:t}},_fillBalancingGroupInfo:function(e,t){for(var n,r=0;r<e.length;r++)if(null!=(n=e[r]).constructs.name2&&(n.isBalancing=!0,n.balancingSlotId=t.getPackedSlotIdBySlotName(n.constructs.name2),null==n.balancingSlotId))throw new System.ArgumentException("Reference to undefined group name '"+n.constructs.name2+"'.")},_preTransformBackrefTokens:function(e,t,n){for(var r,i,s,o,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes,c=0;c<t.length;c++){if((a=t[c]).type===l.escBackrefNumber){if((r=a.data.number)>=1&&null!=n.getPackedSlotIdBySlotNumber(r))continue;if(r<=9)throw new System.ArgumentException("Reference to undefined group number "+r.toString()+".");if(null==(i=u._parseOctalCharToken(a.value,0,a.length)))throw new System.ArgumentException("Unrecognized escape sequence "+a.value.slice(0,2)+".");s=a.length-i.length,u._modifyPatternToken(a,e,l.escCharOctal,null,i.length),a.data=i.data,s>0&&(o=u._createPatternToken(e,l.literal,a.index+a.length,s),t.splice(c+1,0,o))}a.children&&a.children.length&&u._preTransformBackrefTokens(e,a.children,n)}},_updateGroupDescriptors:function(e,t){for(var n,r,i,s,o,a=System.Text.RegularExpressions.RegexEngineParser,u=a.tokenTypes,l=t||0,c=0;c<e.length;c++)(r=e[c]).index=l,r.children&&(o=r.childrenPostfix.length,a._updateGroupDescriptors(r.children,l+o),s=a._constructPattern(r.children),r.value=r.childrenPrefix+s+r.childrenPostfix,r.length=r.value.length),r.type===u.group&&r.group&&((n=r.group).exprIndex=r.index,n.exprLength=r.length,c+1<e.length&&((i=e[c+1]).type===u.quantifier||i.type===u.quantifierN||i.type===u.quantifierNM)&&(n.quantifier=i.value),n.expr=r.value,n.exprFull=n.expr+(null!=n.quantifier?n.quantifier:"")),l+=r.length},_constructPattern:function(e){for(var t="",n=0;n<e.length;n++)t+=e[n].value;return t},_parsePatternImpl:function(e,t,n,r){if(null==e)throw new System.ArgumentNullException("pattern");if(n<0||n>e.length)throw new System.ArgumentOutOfRangeException("startIndex");if(r<n||r>e.length)throw new System.ArgumentOutOfRangeException("endIndex");for(var i,s,o=System.Text.RegularExpressions.RegexEngineParser,a=o.tokenTypes,u=[],l=n;l<r;)s=e[l],t.ignoreWhitespace&&o._whiteSpaceChars.indexOf(s)>=0?++l:(null==(i="."===s?o._parseDotToken(e,l,r):"\\"===s?o._parseEscapeToken(e,l,r):"["===s?o._parseCharRangeToken(e,l,r):"^"===s||"$"===s?o._parseAnchorToken(e,l):"("===s?o._parseGroupToken(e,t,l,r):"|"===s?o._parseAlternationToken(e,l):"#"===s&&t.ignoreWhitespace?o._parseXModeCommentToken(e,l,r):o._parseQuantifierToken(e,l,r))&&(i=o._createPatternToken(e,a.literal,l,1)),null!=i&&(u.push(i),l+=i.length));return u},_parseEscapeToken:function(e,t,n){var r,i,s,o,a,u,l,c,h,m=System.Text.RegularExpressions.RegexEngineParser,g=m.tokenTypes,f=e[t];if("\\"!==f)return null;if(t+1>=n)throw new System.ArgumentException("Illegal \\ at end of pattern.");if((f=e[t+1])>="1"&&f<="9")return r=m._matchChars(e,t+1,n,m._decSymbols,3),(i=m._createPatternToken(e,g.escBackrefNumber,t,1+r.matchLength)).data={number:parseInt(r.match,10)},i;if(m._escapedAnchors.indexOf(f)>=0)return m._createPatternToken(e,g.escAnchor,t,2);if(null!=(s=m._parseEscapedChar(e,t,n)))return s;if("k"===f){if(t+2<n&&("'"===(o=e[t+2])||"<"===o)&&(a="<"===o?">":"'",1===(u=m._matchUntil(e,t+3,n,a)).unmatchLength&&u.matchLength>0))return(l=m._createPatternToken(e,g.escBackrefName,t,3+u.matchLength+1)).data={name:u.match},l;throw new System.ArgumentException("Malformed \\k<...> named back reference.")}if((c=f.charCodeAt(0))>=0&&c<48||c>57&&c<65||c>90&&c<95||96===c||c>122&&c<128)return(h=m._createPatternToken(e,g.escChar,t,2)).data={n:c,ch:f},h;throw new System.ArgumentException("Unrecognized escape sequence \\"+f+".")},_parseOctalCharToken:function(e,t,n){var r=System.Text.RegularExpressions.RegexEngineParser,i=r.tokenTypes,s=e[t];if("\\"===s&&t+1<n&&(s=e[t+1])>="0"&&s<="7"){var o=r._matchChars(e,t+1,n,r._octSymbols,3),a=parseInt(o.match,8),u=r._createPatternToken(e,i.escCharOctal,t,1+o.matchLength);return u.data={n:a,ch:String.fromCharCode(a)},u}return null},_parseEscapedChar:function(e,t,n){var r,i,s,o,a,u,l,c,h,m,g=System.Text.RegularExpressions.RegexEngineParser,f=g.tokenTypes,p=e[t];if("\\"!==p||t+1>=n)return null;if(p=e[t+1],g._escapedChars.indexOf(p)>=0){if("x"===p){if(2!==(i=g._matchChars(e,t+2,n,g._hexSymbols,2)).matchLength)throw new System.ArgumentException("Insufficient hexadecimal digits.");return s=parseInt(i.match,16),(r=g._createPatternToken(e,f.escCharHex,t,4)).data={n:s,ch:String.fromCharCode(s)},r}if("c"===p){if(t+2>=n)throw new System.ArgumentException("Missing control character.");if(o=(o=e[t+2]).toUpperCase(),(a=this._controlChars.indexOf(o))>=0)return(r=g._createPatternToken(e,f.escCharCtrl,t,3)).data={n:a,ch:String.fromCharCode(a)},r;throw new System.ArgumentException("Unrecognized control character.")}if("u"===p){if(4!==(u=g._matchChars(e,t+2,n,g._hexSymbols,4)).matchLength)throw new System.ArgumentException("Insufficient hexadecimal digits.");return l=parseInt(u.match,16),(r=g._createPatternToken(e,f.escCharUnicode,t,6)).data={n:l,ch:String.fromCharCode(l)},r}switch(r=g._createPatternToken(e,f.escChar,t,2),p){case"a":c=7;break;case"b":c=8;break;case"t":c=9;break;case"r":c=13;break;case"v":c=11;break;case"f":c=12;break;case"n":c=10;break;case"e":c=27;break;default:throw new System.ArgumentException("Unexpected escaped char: '"+p+"'.")}return r.data={n:c,ch:String.fromCharCode(c)},r}if(p>="0"&&p<="7")return g._parseOctalCharToken(e,t,n);if(g._escapedCharClasses.indexOf(p)>=0){if("p"===p||"P"===p){if((h=g._matchUntil(e,t+2,n,"}")).matchLength<2||"{"!==h.match[0]||1!==h.unmatchLength)throw new System.ArgumentException("Incomplete p{X} character escape.");if(m=h.match.slice(1),g._unicodeCategories.indexOf(m)>=0)return g._createPatternToken(e,f.escCharClassCategory,t,2+h.matchLength+1);if(g._namedCharBlocks.indexOf(m)>=0)return g._createPatternToken(e,f.escCharClassBlock,t,2+h.matchLength+1);throw new System.ArgumentException("Unknown property '"+m+"'.")}return g._createPatternToken(e,f.escCharClass,t,2)}return g._escapedSpecialSymbols.indexOf(p)>=0?((r=g._createPatternToken(e,f.escCharOther,t,2)).data={n:p.charCodeAt(0),ch:p},r):null},_parseCharRangeToken:function(e,t,n){var r,i,s,o,a,u,l,c,h,m=System.Text.RegularExpressions.RegexEngineParser,g=m.tokenTypes,f=[],p=!1,d=!1,y=!1,S=e[t];if("["!==S)return null;for(a=-1,(o=t+1)<n&&"^"===e[o]&&(p=!0,o++),l=o;o<n;){if(d=y,"-"===(S=e[o])&&o+1<n&&"["===e[o+1])(i=m._parseCharRangeToken(e,o+1,n)).childrenPrefix="-"+i.childrenPrefix,i.length++,s=i,u=i.length,y=!0;else if("\\"===S){if(null==(s=m._parseEscapedChar(e,o,n)))throw new System.ArgumentException("Unrecognized escape sequence \\"+S+".");u=s.length}else{if("]"===S&&o>l){a=o;break}s=m._createPatternToken(e,g.literal,o,1),u=1}if(d)throw new System.ArgumentException("A subtraction must be the last element in a character class.");f.length>1&&null!=(r=m._parseCharIntervalToken(e,f[f.length-2],f[f.length-1],s))&&(f.pop(),f.pop(),s=r),null!=s&&(f.push(s),o+=u)}if(a<0||f.length<1)throw new System.ArgumentException("Unterminated [] set.");return c=p?m._createPatternToken(e,g.charNegativeGroup,t,1+a-t,f,"[^","]"):m._createPatternToken(e,g.charGroup,t,1+a-t,f,"[","]"),h=m._tidyCharRange(f),c.data={ranges:h},null!=i&&(c.data.substractToken=i),c},_parseCharIntervalToken:function(e,t,n,r){var i,s,o,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes;if(n.type!==l.literal||"-"!==n.value||t.type!==l.literal&&t.type!==l.escChar&&t.type!==l.escCharOctal&&t.type!==l.escCharHex&&t.type!==l.escCharCtrl&&t.type!==l.escCharUnicode&&t.type!==l.escCharOther||r.type!==l.literal&&r.type!==l.escChar&&r.type!==l.escCharOctal&&r.type!==l.escCharHex&&r.type!==l.escCharCtrl&&r.type!==l.escCharUnicode&&r.type!==l.escCharOther)return null;if(t.type===l.literal?(i=t.value.charCodeAt(0),s=t.value):(i=t.data.n,s=t.data.ch),r.type===l.literal?(o=r.value.charCodeAt(0),a=r.value):(o=r.data.n,a=r.data.ch),i>o)throw new System.NotSupportedException("[x-y] range in reverse order.");var c=t.index,h=t.length+n.length+r.length,m=u._createPatternToken(e,l.charInterval,c,h,[t,n,r],"","");return m.data={startN:i,startCh:s,endN:o,endCh:a},m},_tidyCharRange:function(e){for(var t,n,r,i,s,o,a,u,l=System.Text.RegularExpressions.RegexEngineParser,c=l.tokenTypes,h=[],m=[],g=0;g<e.length;g++){if((i=e[g]).type===c.literal)r=n=i.value.charCodeAt(0);else if(i.type===c.charInterval)n=i.data.startN,r=i.data.endN;else{if(i.type!==c.literal&&i.type!==c.escChar&&i.type!==c.escCharOctal&&i.type!==c.escCharHex&&i.type!==c.escCharCtrl&&i.type!==c.escCharUnicode&&i.type!==c.escCharOther){if(i.type===c.charGroup||i.type===c.charNegativeGroup)continue;m.push(i);continue}r=n=i.data.n}if(0!==h.length){for(t=0;t<h.length&&!(h[t].n>n);t++);h.splice(t,0,{n,m:r})}else h.push({n,m:r})}for(g=0;g<h.length;g++){for(s=h[g],a=0,t=g+1;t<h.length&&!((o=h[t]).n>1+s.m);t++)a++,o.m>s.m&&(s.m=o.m);a>0&&h.splice(g+1,a)}return m.length>0&&(u="["+l._constructPattern(m)+"]",h.charClassToken=l._createPatternToken(u,c.charGroup,0,u.length,e,"[","]")),h},_parseDotToken:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes;return"."!==e[t]?null:n._createPatternToken(e,r.escCharClassDot,t,1)},_parseAnchorToken:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes,i=e[t];return"^"!==i&&"$"!==i?null:n._createPatternToken(e,r.anchor,t,1)},_updateSettingsFromConstructs:function(e,t){null!=t.isIgnoreWhitespace&&(e.ignoreWhitespace=t.isIgnoreWhitespace),null!=t.isExplicitCapture&&(e.explicitCapture=t.isExplicitCapture)},_parseGroupToken:function(e,t,n,r){var i,s,o,a,u,l,c,h,m=System.Text.RegularExpressions.RegexEngineParser,g=m.tokenTypes,f={ignoreWhitespace:t.ignoreWhitespace,explicitCapture:t.explicitCapture},p=e[n];if("("!==p)return null;var d=1,y=!1,S=n+1,x=-1,w=!1,v=!1,b=!1,I=!1,C=!1,E=null,$=m._parseGroupConstructToken(e,f,n+1,r);for(null!=$&&(E=this._fillGroupConstructs($),S+=$.length,$.type===g.commentInline?w=!0:$.type===g.alternationGroupCondition?v=!0:$.type===g.groupConstructImnsx?(this._updateSettingsFromConstructs(f,E),I=!0):$.type===g.groupConstructImnsxMisc&&(this._updateSettingsFromConstructs(t,E),b=!0)),f.explicitCapture&&(null==E||null==E.name1)&&(C=!0),i=S;i<r;){if("\\"===(p=e[i]))i++;else if("["===p)y=!0;else if("]"===p&&y)y=!1;else if(!y)if("("!==p||w){if(")"===p&&0==--d){x=i;break}}else++d;++i}if(s=null,w){if(x<0)throw new System.ArgumentException("Unterminated (?#...) comment.");s=m._createPatternToken(e,g.commentInline,n,1+x-n)}else{if(x<0)throw new System.ArgumentException("Not enough )'s.");if(o=m._parsePatternImpl(e,f,S,x),null!=$&&o.splice(0,0,$),v){for(a=o.length,l=0,u=0;u<a;u++)if(o[u].type===g.alternation&&++l>1)throw new System.ArgumentException("Too many | in (?()|).");if(0===l)throw new System.NotSupportedException("Alternation group without | is not supported.");s=m._createPatternToken(e,g.alternationGroup,n,1+x-n,o,"(",")")}else c=g.group,b?c=g.groupImnsxMisc:I&&(c=g.groupImnsx),(h=m._createPatternToken(e,c,n,1+x-n,o,"(",")")).localSettings=f,s=h}return C&&(s.isNonCapturingExplicit=!0),s},_parseGroupConstructToken:function(e,t,n,r){var i,s,o,a,u,l,c,h=System.Text.RegularExpressions.RegexEngineParser,m=h.tokenTypes,g=e[n];if("?"!==g||n+1>=r)return null;if(":"===(g=e[n+1])||"="===g||"!"===g||">"===g)return h._createPatternToken(e,m.groupConstruct,n,2);if("#"===g)return h._createPatternToken(e,m.commentInline,n,2);if("("===g)return h._parseAlternationGroupConditionToken(e,t,n,r);if("<"===g&&n+2<r&&("="===(i=e[n+2])||"!"===i))return h._createPatternToken(e,m.groupConstruct,n,3);if("<"===g||"'"===g){if(s="<"===g?">":g,1!==(o=h._matchUntil(e,n+2,r,s)).unmatchLength||0===o.matchLength)throw new System.ArgumentException("Unrecognized grouping construct.");if(a=o.match.slice(0,1),"`~@#$%^&*()+{}[]|\\/|'\";:,.?".indexOf(a)>=0)throw new System.ArgumentException("Invalid group name: Group names must begin with a word character.");return h._createPatternToken(e,m.groupConstructName,n,2+o.matchLength+1)}if((u=h._matchChars(e,n+1,r,"imnsx-")).matchLength>0&&(":"===u.unmatchCh||")"===u.unmatchCh))return l=":"===u.unmatchCh?m.groupConstructImnsx:m.groupConstructImnsxMisc,c=":"===u.unmatchCh?1:0,h._createPatternToken(e,l,n,1+u.matchLength+c);throw new System.ArgumentException("Unrecognized grouping construct.")},_parseQuantifierToken:function(e,t,n){var r,i,s,o=System.Text.RegularExpressions.RegexEngineParser,a=o.tokenTypes,u=null,l=e[t];if("*"===l||"+"===l||"?"===l)(u=o._createPatternToken(e,a.quantifier,t,1)).data={val:l};else if("{"===l&&0!==(r=o._matchChars(e,t+1,n,o._decSymbols)).matchLength)if("}"===r.unmatchCh)(u=o._createPatternToken(e,a.quantifierN,t,1+r.matchLength+1)).data={n:parseInt(r.match,10)};else if(","===r.unmatchCh&&"}"===(i=o._matchChars(e,r.unmatchIndex+1,n,o._decSymbols)).unmatchCh&&((u=o._createPatternToken(e,a.quantifierNM,t,1+r.matchLength+1+i.matchLength+1)).data={n:parseInt(r.match,10),m:null},0!==i.matchLength&&(u.data.m=parseInt(i.match,10),u.data.n>u.data.m)))throw new System.ArgumentException("Illegal {x,y} with x > y.");return null!=u&&(s=t+u.length)<n&&"?"===e[s]&&(this._modifyPatternToken(u,e,u.type,u.index,u.length+1),u.data.isLazy=!0),u},_parseAlternationToken:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes;return"|"!==e[t]?null:n._createPatternToken(e,r.alternation,t,1)},_parseAlternationGroupConditionToken:function(e,t,n,r){var i,s,o,a,u,l,c=System.Text.RegularExpressions.RegexEngineParser,h=c.tokenTypes,m=null;if("?"!==e[n]||n+1>=r||"("!==e[n+1]||null==(o=c._parseGroupToken(e,t,n+1,r)))return null;if(o.type===h.commentInline)throw new System.ArgumentException("Alternation conditions cannot be comments.");if((a=o.children)&&a.length){if((i=a[0]).type===h.groupConstructName)throw new System.ArgumentException("Alternation conditions do not capture and cannot be named.");if((i.type===h.groupConstruct||i.type===h.groupConstructImnsx)&&null!=(s=c._findFirstGroupWithoutConstructs(a))&&(s.isEmptyCapturing=!0),i.type===h.literal)if((u=o.value.slice(1,o.value.length-1))[0]>="0"&&u[0]<="9"){if(c._matchChars(u,0,u.length,c._decSymbols).matchLength!==u.length)throw new System.ArgumentException("Malformed Alternation group number: "+u+".");m={number:parseInt(u,10)}}else m={name:u}}return a.length&&(a[0].type===h.groupConstruct||a[0].type===h.groupConstructImnsx)||(i=c._createPatternToken("?:",h.groupConstruct,0,2),a.splice(0,0,i)),l=c._createPatternToken(e,h.alternationGroupCondition,o.index-1,1+o.length,[o],"?",""),null!=m&&(l.data=m),l},_findFirstGroupWithoutConstructs:function(e){for(var t,n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes,i=null,s=0;s<e.length;++s)if((t=e[s]).type===r.group&&t.children&&t.children.length){if(t.children[0].type!==r.groupConstruct&&t.children[0].type!==r.groupConstructImnsx){i=t;break}if(t.children&&t.children.length&&null!=(i=n._findFirstGroupWithoutConstructs(t.children)))break}return i},_parseXModeCommentToken:function(e,t,n){var r,i=System.Text.RegularExpressions.RegexEngineParser,s=i.tokenTypes,o=e[t];if("#"!==o)return null;for(r=t+1;r<n&&(o=e[r],++r,"\n"!==o););return i._createPatternToken(e,s.commentXMode,t,r-t)},_createLiteralToken:function(e){var t=System.Text.RegularExpressions.RegexEngineParser;return t._createPatternToken(e,t.tokenTypes.literal,0,e.length)},_createPositiveLookaheadToken:function(e,t){var n="(?="+e+")";return System.Text.RegularExpressions.RegexEngineParser._parseGroupToken(n,t,0,n.length)},_createPatternToken:function(e,t,n,r,i,s,o){var a={type:t,index:n,length:r,value:e.slice(n,n+r)};return null!=i&&i.length>0&&(a.children=i,a.childrenPrefix=s,a.childrenPostfix=o),a},_modifyPatternToken:function(e,t,n,r,i){null!=n&&(e.type=n),(null!=r||null!=i)&&(null!=r&&(e.index=r),null!=i&&(e.length=i),e.value=t.slice(e.index,e.index+e.length))},_updatePatternToken:function(e,t,n,r,i){e.type=t,e.index=n,e.length=r,e.value=i},_matchChars:function(e,t,n,r,i){var s,o={match:"",matchIndex:-1,matchLength:0,unmatchCh:"",unmatchIndex:-1,unmatchLength:0},a=t;for(null!=i&&i>=0&&(n=t+i);a<n;){if(s=e[a],r.indexOf(s)<0){o.unmatchCh=s,o.unmatchIndex=a,o.unmatchLength=1;break}a++}return a>t&&(o.match=e.slice(t,a),o.matchIndex=t,o.matchLength=a-t),o},_matchUntil:function(e,t,n,r,i){var s,o={match:"",matchIndex:-1,matchLength:0,unmatchCh:"",unmatchIndex:-1,unmatchLength:0},a=t;for(null!=i&&i>=0&&(n=t+i);a<n;){if(s=e[a],r.indexOf(s)>=0){o.unmatchCh=s,o.unmatchIndex=a,o.unmatchLength=1;break}a++}return a>t&&(o.match=e.slice(t,a),o.matchIndex=t,o.matchLength=a-t),o}}}),Bridge.define("System.Random",{statics:{MBIG:2147483647,MSEED:161803398,MZ:0},inext:0,inextp:0,seedArray:null,config:{init:function(){this.seedArray=System.Array.init(56,0)}},ctor:function(){System.Random.$ctor1.call(this,System.Int64.clip32(System.Int64((new Date).getTime()).mul(1e4)))},$ctor1:function(e){var t,n,r,i,s,o,a;for(this.$initialize(),i=-2147483648===e?2147483647:Math.abs(e),n=System.Random.MSEED-i|0,this.seedArray[55]=n,r=1,s=1;s<55;s=s+1|0)t=(21*s|0)%55,this.seedArray[t]=r,(r=n-r|0)<0&&(r=r+System.Random.MBIG|0),n=this.seedArray[t];for(o=1;o<5;o=o+1|0)for(a=1;a<56;a=a+1|0)this.seedArray[a]=this.seedArray[a]-this.seedArray[1+(a+30|0)%55|0]|0,this.seedArray[a]<0&&(this.seedArray[a]=this.seedArray[a]+System.Random.MBIG|0);this.inext=0,this.inextp=21,e=1},sample:function(){return 4.656612875245797e-10*this.internalSample()},internalSample:function(){var e,t=this.inext,n=this.inextp;return(t=t+1|0)>=56&&(t=1),(n=n+1|0)>=56&&(n=1),(e=this.seedArray[t]-this.seedArray[n]|0)===System.Random.MBIG&&(e=e-1|0),e<0&&(e=e+System.Random.MBIG|0),this.seedArray[t]=e,this.inext=t,this.inextp=n,e},next:function(){return this.internalSample()},next$2:function(e,t){if(e>t)throw new System.ArgumentOutOfRangeException("minValue","'minValue' cannot be greater than maxValue.");var n=System.Int64(t).sub(System.Int64(e));return n.lte(System.Int64(2147483647))?Bridge.Int.clip32(this.sample()*System.Int64.toNumber(n))+e|0:System.Int64.clip32(Bridge.Int.clip64(this.getSampleForLargeRange()*System.Int64.toNumber(n)).add(System.Int64(e)))},next$1:function(e){if(e<0)throw new System.ArgumentOutOfRangeException("maxValue","'maxValue' must be greater than zero.");return Bridge.Int.clip32(this.sample()*e)},getSampleForLargeRange:function(){var e,t=this.internalSample();return this.internalSample()%2==0&&(t=0|-t),e=t,(e+=2147483646)/4294967293},nextDouble:function(){return this.sample()},nextBytes:function(e){if(null==e)throw new System.ArgumentNullException("buffer");for(var t=0;t<e.length;t=t+1|0)e[t]=this.internalSample()%256&255}}),Bridge.define("System.Threading.Timer",{inherits:[System.IDisposable],statics:{MAX_SUPPORTED_TIMEOUT:4294967294,EXC_LESS:"Number must be either non-negative and less than or equal to Int32.MaxValue or -1.",EXC_MORE:"Time-out interval must be less than 2^32-2.",EXC_DISPOSED:"The timer has been already disposed."},dueTime:System.Int64(0),period:System.Int64(0),timerCallback:null,state:null,id:null,disposed:!1,config:{alias:["dispose","System$IDisposable$dispose"]},$ctor1:function(e,t,n,r){this.$initialize(),this.timerSetup(e,t,System.Int64(n),System.Int64(r))},$ctor3:function(e,t,n,r){this.$initialize();var i=Bridge.Int.clip64(n.getTotalMilliseconds()),s=Bridge.Int.clip64(r.getTotalMilliseconds());this.timerSetup(e,t,i,s)},$ctor4:function(e,t,n,r){this.$initialize(),this.timerSetup(e,t,System.Int64(n),System.Int64(r))},$ctor2:function(e,t,n,r){this.$initialize(),this.timerSetup(e,t,n,r)},ctor:function(e){this.$initialize(),this.timerSetup(e,this,System.Int64(-1),System.Int64(-1))},timerSetup:function(e,t,n,r){if(this.disposed)throw new System.InvalidOperationException(System.Threading.Timer.EXC_DISPOSED);if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException("TimerCallback");if(n.lt(System.Int64(-1)))throw new System.ArgumentOutOfRangeException("dueTime",System.Threading.Timer.EXC_LESS);if(r.lt(System.Int64(-1)))throw new System.ArgumentOutOfRangeException("period",System.Threading.Timer.EXC_LESS);if(n.gt(System.Int64(System.Threading.Timer.MAX_SUPPORTED_TIMEOUT)))throw new System.ArgumentOutOfRangeException("dueTime",System.Threading.Timer.EXC_MORE);if(r.gt(System.Int64(System.Threading.Timer.MAX_SUPPORTED_TIMEOUT)))throw new System.ArgumentOutOfRangeException("period",System.Threading.Timer.EXC_MORE);return this.dueTime=n,this.period=r,this.state=t,this.timerCallback=e,this.runTimer(this.dueTime)},handleCallback:function(){if(!this.disposed&&!Bridge.staticEquals(this.timerCallback,null)){var e=this.id;this.timerCallback(this.state),System.Nullable.eq(this.id,e)&&this.runTimer(this.period,!1)}},runTimer:function(e,t){if(void 0===t&&(t=!0),t&&this.disposed)throw new System.InvalidOperationException(System.Threading.Timer.EXC_DISPOSED);if(e.ne(System.Int64(-1))&&!this.disposed){var n=e.toNumber();return this.id=Bridge.global.setTimeout(Bridge.fn.bind(this,this.handleCallback),n),!0}return!1},change:function(e,t){return this.changeTimer(System.Int64(e),System.Int64(t))},change$2:function(e,t){return this.changeTimer(Bridge.Int.clip64(e.getTotalMilliseconds()),Bridge.Int.clip64(t.getTotalMilliseconds()))},change$3:function(e,t){return this.changeTimer(System.Int64(e),System.Int64(t))},change$1:function(e,t){return this.changeTimer(e,t)},changeTimer:function(e,t){return this.clearTimeout(),this.timerSetup(this.timerCallback,this.state,e,t)},clearTimeout:function(){System.Nullable.hasValue(this.id)&&(Bridge.global.clearTimeout(System.Nullable.getValue(this.id)),this.id=null)},dispose:function(){this.clearTimeout(),this.disposed=!0}}),Bridge.define("Bridge.Console",{statics:{BODY_WRAPPER_ID:"bridge-body-wrapper",CONSOLE_MESSAGES_ID:"bridge-console-messages",position:"horizontal",instance:null,getInstance:function(){return null==Bridge.Console.instance&&(Bridge.Console.instance=new Bridge.Console),Bridge.Console.instance},logBase:function(e,t){var n,r,i;void 0===t&&(t=0),n=Bridge.Console.getInstance(),r=null!=e?e.toString():"null",null==n.bufferedOutput?(Bridge.Console.show(),i=n.buildConsoleMessage(r,t),n.consoleMessages.appendChild(i),n.currentMessageElement=i,n.consoleDefined?1===t&&n.consoleDebugDefined?Bridge.global.console.debug(r):Bridge.global.console.log(r):n.operaPostErrorDefined&&Bridge.global.opera.postError(r)):n.bufferedOutput=System.String.concat(n.bufferedOutput,r)},error:function(e){Bridge.Console.logBase(e,2)},debug:function(e){Bridge.Console.logBase(e,1)},log:function(e){Bridge.Console.logBase(e)},hide:function(){if(null!=Bridge.Console.instance){var e=Bridge.Console.getInstance();e.hidden||e.close()}},show:function(){var e=Bridge.Console.getInstance();e.hidden&&e.init(!0)},toggle:function(){Bridge.Console.getInstance().hidden?Bridge.Console.show():Bridge.Console.hide()}},svgNS:"http://www.w3.org/2000/svg",consoleHeight:"300px",consoleHeaderHeight:"35px",tooltip:null,consoleWrapper:null,consoleMessages:null,bridgeIcon:null,bridgeIconPath:null,bridgeConsoleLabel:null,closeBtn:null,closeIcon:null,closeIconPath:null,consoleHeader:null,consoleBody:null,hidden:!0,consoleDefined:!1,consoleDebugDefined:!1,operaPostErrorDefined:!1,currentMessageElement:null,bufferedOutput:null,ctor:function(){this.$initialize(),this.init()},init:function(e){var t,n,r,s,o,a;void 0===e&&(e=!1),this.hidden=!1;var u=Bridge.fn.bind(this,i.$.Bridge.Console.f1)(new(System.Collections.Generic.Dictionary$2(String,String))),l=i.$.Bridge.Console.f2(new(System.Collections.Generic.Dictionary$2(String,String))),c=i.$.Bridge.Console.f3(new(System.Collections.Generic.Dictionary$2(String,String)));this.bridgeIcon=this.bridgeIcon||document.createElementNS(this.svgNS,"svg"),t=Bridge.fn.bind(this,i.$.Bridge.Console.f4)(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(this.bridgeIcon,t),this.bridgeIconPath=this.bridgeIconPath||document.createElementNS(this.svgNS,"path"),(n=new(System.Collections.Generic.Dictionary$2(String,String))).set("d","M19 14.4h2.2V9.6L19 7.1v7.3zm4.3-2.5v2.5h2.2l-2.2-2.5zm-8.5 2.5H17V4.8l-2.2-2.5v12.1zM0 14.4h3l7.5-8.5v8.5h2.2V0L0 14.4z"),n.set("fill","#555"),this.setAttributes(this.bridgeIconPath,n),this.bridgeConsoleLabel=this.bridgeConsoleLabel||document.createElement("span"),this.bridgeConsoleLabel.innerHTML="Bridge Console",this.closeBtn=this.closeBtn||document.createElement("span"),this.closeBtn.setAttribute("style","position: relative;display: inline-block;float: right;cursor: pointer"),this.closeIcon=this.closeIcon||document.createElementNS(this.svgNS,"svg"),r=Bridge.fn.bind(this,i.$.Bridge.Console.f5)(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(this.closeIcon,r),this.closeIconPath=this.closeIconPath||document.createElementNS(this.svgNS,"path"),s=i.$.Bridge.Console.f6(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(this.closeIconPath,s),this.tooltip=this.tooltip||document.createElement("div"),this.tooltip.innerHTML="Refresh page to open Bridge Console",this.tooltip.setAttribute("style","position: absolute;right: 30px;top: -6px;white-space: nowrap;padding: 7px;border-radius: 3px;background-color: rgba(0, 0, 0, 0.75);color: #eee;text-align: center;visibility: hidden;opacity: 0;-webkit-transition: all 0.25s ease-in-out;transition: all 0.25s ease-in-out;z-index: 1;"),Bridge.Console.position="horizontal",Bridge.referenceEquals(Bridge.Console.position,"horizontal")?(this.wrapBodyContent(),u.set("right","0"),l.set("border-top","1px solid #a3a3a3"),c.set("height",this.consoleHeight)):Bridge.referenceEquals(Bridge.Console.position,"vertical")&&(o="400px",document.body.style.marginLeft=o,u.set("top","0"),u.set("width",o),u.set("border-right","1px solid #a3a3a3"),c.set("height","100%")),this.consoleWrapper=this.consoleWrapper||document.createElement("div"),this.consoleWrapper.setAttribute("style",this.obj2Css(u)),this.consoleHeader=this.consoleHeader||document.createElement("div"),this.consoleHeader.setAttribute("style",this.obj2Css(l)),this.consoleBody=this.consoleBody||document.createElement("div"),this.consoleBody.setAttribute("style",this.obj2Css(c)),this.consoleMessages=this.consoleMessages||document.createElement("ul"),(a=this.consoleMessages).id=Bridge.Console.CONSOLE_MESSAGES_ID,a.setAttribute("style","margin: 0;padding: 0;list-style: none;"),e||(this.bridgeIcon.appendChild(this.bridgeIconPath),this.closeIcon.appendChild(this.closeIconPath),this.closeBtn.appendChild(this.closeIcon),this.closeBtn.appendChild(this.tooltip),this.consoleHeader.appendChild(this.bridgeIcon),this.consoleHeader.appendChild(this.bridgeConsoleLabel),this.consoleHeader.appendChild(this.closeBtn),this.consoleBody.appendChild(a),this.consoleWrapper.appendChild(this.consoleHeader),this.consoleWrapper.appendChild(this.consoleBody),document.body.appendChild(this.consoleWrapper),this.closeBtn.addEventListener("click",Bridge.fn.bind(this,this.close)),this.closeBtn.addEventListener("mouseover",Bridge.fn.bind(this,this.showTooltip)),this.closeBtn.addEventListener("mouseout",Bridge.fn.bind(this,this.hideTooltip)),this.consoleDefined=Bridge.isDefined(Bridge.global)&&Bridge.isDefined(Bridge.global.console),this.consoleDebugDefined=this.consoleDefined&&Bridge.isDefined(Bridge.global.console.debug),this.operaPostErrorDefined=Bridge.isDefined(Bridge.global.opera)&&Bridge.isDefined(Bridge.global.opera.postError))},showTooltip:function(){var e=Bridge.Console.getInstance();e.tooltip.style.right="20px",e.tooltip.style.visibility="visible",e.tooltip.style.opacity="1"},hideTooltip:function(){var e=Bridge.Console.getInstance();e.tooltip.style.right="30px",e.tooltip.style.opacity="0"},close:function(){this.hidden=!0,this.consoleWrapper.style.display="none",Bridge.referenceEquals(Bridge.Console.position,"horizontal")?this.unwrapBodyContent():Bridge.referenceEquals(Bridge.Console.position,"vertical")&&document.body.removeAttribute("style")},wrapBodyContent:function(){if(null!=document.body){var e=document.defaultView.getComputedStyle(document.body,null),t=e.paddingTop,n=e.paddingRight,r=e.paddingBottom,i=e.paddingLeft,s=e.marginTop,o=e.marginRight,a=e.marginBottom,u=e.marginLeft,l=document.createElement("div");for(l.id=Bridge.Console.BODY_WRAPPER_ID,l.setAttribute("style",System.String.concat("height: calc(100vh - ",this.consoleHeight," - ",this.consoleHeaderHeight,");","margin-top: calc(-1 * ","(",System.String.concat(s," + ",t),"));","margin-right: calc(-1 * ","(",System.String.concat(o," + ",n),"));","margin-left: calc(-1 * ","(",System.String.concat(u," + ",i),"));","padding-top: calc(",System.String.concat(s," + ",t),");","padding-right: calc(",System.String.concat(o," + ",n),");","padding-bottom: calc(",System.String.concat(a," + ",r),");","padding-left: calc(",System.String.concat(u," + ",i),");","overflow-x: auto;","box-sizing: border-box !important;"));null!=document.body.firstChild;)l.appendChild(document.body.firstChild);document.body.appendChild(l)}},unwrapBodyContent:function(){var e=document.getElementById(Bridge.Console.BODY_WRAPPER_ID);if(null!=e){for(;null!=e.firstChild;)document.body.insertBefore(e.firstChild,e);document.body.removeChild(e)}},buildConsoleMessage:function(e,t){var n,r,s,o,a,u,l=document.createElement("li");return l.setAttribute("style","padding: 5px 10px;border-bottom: 1px solid #f0f0f0;"),n=document.createElementNS(this.svgNS,"svg"),r=Bridge.fn.bind(this,i.$.Bridge.Console.f7)(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(n,r),s="#555",2===t?s="#d65050":1===t&&(s="#1800FF"),o=document.createElementNS(this.svgNS,"path"),(a=new(System.Collections.Generic.Dictionary$2(String,String))).set("d","M3.8 3.5L.7 6.6s-.1.1-.2.1-.1 0-.2-.1l-.2-.3C0 6.2 0 6.2 0 6.1c0 0 0-.1.1-.1l2.6-2.6L.1.7C0 .7 0 .6 0 .6 0 .5 0 .5.1.4L.4.1c0-.1.1-.1.2-.1s.1 0 .2.1l3.1 3.1s.1.1.1.2-.1.1-.2.1z"),a.set("fill",s),this.setAttributes(o,a),n.appendChild(o),(u=document.createElement("span")).innerHTML=e,u.setAttribute("style",System.String.concat("color: ",s,"; white-space: pre;")),l.appendChild(n),l.appendChild(u),l},setAttributes:function(e,t){for(var n,r=Bridge.getEnumerator(t);r.moveNext();)n=r.getCurrent(),e.setAttribute(n.key,n.value)},obj2Css:function(e){for(var t,n="",r=Bridge.getEnumerator(e);r.moveNext();)t=r.getCurrent(),n=System.String.concat(n,System.String.concat(t.key.toLowerCase(),":",t.value,";"));return n}}),Bridge.ns("Bridge.Console",i.$),Bridge.apply(i.$.Bridge.Console,{f1:function(e){return e.add("position","fixed"),e.add("left","0"),e.add("bottom","0"),e.add("padding-top",this.consoleHeaderHeight),e.add("background-color","#fff"),e.add("font","normal normal normal 13px/1 sans-serif"),e.add("color","#555"),e},f2:function(e){return e.add("position","absolute"),e.add("top","0"),e.add("left","0"),e.add("right","0"),e.add("height","35px"),e.add("padding","9px 15px 7px 10px"),e.add("border-bottom","1px solid #ccc"),e.add("background-color","#f3f3f3"),e.add("box-sizing","border-box"),e},f3:function(e){return e.add("overflow-x","auto"),e.add("font-family","Menlo, Monaco, Consolas, 'Courier New', monospace"),e},f4:function(e){return e.add("xmlns",this.svgNS),e.add("width","25.5"),e.add("height","14.4"),e.add("viewBox","0 0 25.5 14.4"),e.add("style","margin: 0 3px 3px 0;vertical-align:middle;"),e},f5:function(e){return e.add("xmlns",this.svgNS),e.add("width","11.4"),e.add("height","11.4"),e.add("viewBox","0 0 11.4 11.4"),e.add("style","vertical-align: middle;"),e},f6:function(e){return e.add("d","M11.4 1.4L10 0 5.7 4.3 1.4 0 0 1.4l4.3 4.3L0 10l1.4 1.4 4.3-4.3 4.3 4.3 1.4-1.4-4.3-4.3"),e.add("fill","#555"),e},f7:function(e){return e.add("xmlns",this.svgNS),e.add("width","3.9"),e.add("height","6.7"),e.add("viewBox","0 0 3.9 6.7"),e.add("style","margin-right: 7px; vertical-align: middle;"),e}}),"function"==typeof define&&define.amd?define("bridge",[],(function(){return Bridge})):"undefined"!=typeof module&&module.exports&&(module.exports=Bridge)}(this);