fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
1.6 MiB

/*! time: 2020-7-3 12:02:09 */
!function(n){var i={};function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=i,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1247)}([,,,,,,,,,,,,,function(e,t,n){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function i(t){return typeof t}:function i(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(e)}var r=function(){return this}();try{r=r||new Function("return this")()}catch(a){"object"===("undefined"==typeof window?"undefined":i(window))&&(r=window)}e.exports=r},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(n,e,t){(function(e){var t=function(e){return e&&e.Math==Math&&e};n.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||Function("return this")()}).call(this,t(13))},,,,,function(e,t,n){var i=n(45),r=n(941),a=n(950),o=n(977),s=i.Symbol,l=r("wks");e.exports=function(e){return l[e]||(l[e]=o&&s[e]||(o?s:a)("Symbol."+e))}},function(e,t,n){var c=n(45),h=n(947).f,p=n(99),d=n(267),f=n(961),g=n(1007),m=n(965);e.exports=function(e,t){var n,i,r,a,o=e.target,s=e.global,l=e.stat,u=s?c:l?c[o]||f(o,{}):(c[o]||{}).prototype;if(u)for(n in t){if(r=t[n],i=e.noTargetGet?(a=h(u,n))&&a.value:u[n],!m(s?n:o+(l?".":"#")+n,e.forced)&&i!==undefined){if(typeof r==typeof i)continue;g(r,i)}(e.sham||i&&i.sham)&&p(r,"sham",!0),d(u,n,r,e)}}},function(e,r,a){"use strict";(function(e){var t=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new i(n.call(setTimeout,t,arguments),clearTimeout)},r.setInterval=function(){return new i(n.call(setInterval,t,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(t,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},a(106),r.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,r.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,a(13))},,,,,,,,,,,,,function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,n){"use strict";var i,r,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,c=[],h=!1,p=-1;function d(){h&&u&&(h=!1,u.length?c=u.concat(c):p=-1,c.length&&f())}function f(){if(!h){var e=l(d);h=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,h=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function m(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new g(e,t)),1!==c.length||h||l(f)},g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var i=n(67);e.exports=function(e){if(!i(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){var i=n(65);e.exports=!i(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var i=n(69),r=n(100),a=n(940);e.exports=i?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var i=n(69),r=n(972),a=n(68),o=n(959),s=Object.defineProperty;t.f=i?s:function(e,t,n){if(a(e),t=o(t,!0),a(n),r)try{return s(e,t,n)}catch(i){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){(function(e){_global=undefined,_global="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[])}).call(this,n(13))},function(e,t,n){n(103)(n(104))},function(e,t){e.exports=function(e){function t(e){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",e)}try{"undefined"!=typeof execScript&&"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener?execScript(e):"undefined"!=typeof eval?eval.call(null,e):t("EvalError: No eval function available")}catch(n){t(n)}}},function(e,t){e.exports="/**\n * @license\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash core plus=\"debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after\"`\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.5';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n /** Used to compose unicode capture groups. */\n var rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n return key == '__proto__'\n ? undefined\n : object[key];\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = root['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = root.isFinite,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n\n return result;\n }\n\n if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n\n return result;\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, baseIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n }\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(baseIteratee(predicate, 3)));\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, baseIteratee);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(baseIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, &amp; pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n function trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrim, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\n function mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n if (options == null &&\n !(isObject(source) && (methodNames.length || !props.length))) {\n options = source;\n source = object;\n object = this;\n methodNames = baseFunctions(source, keys(source));\n }\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n }\n\n /**\n * Reverts the `_` variable to its previous value and returns a reference to\n * the `lodash` function.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @returns {Function} Returns the `lodash` function.\n * @example\n *\n * var lodash = _.noConflict();\n */\n function noConflict() {\n if (root._ === this) {\n root._ = oldDash;\n }\n return this;\n }\n\n /**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\n function noop() {\n // No operation performed.\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\n function stubArray() {\n return [];\n }\n\n /**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\n function stubFalse() {\n return false;\n }\n\n /**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\n function uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\n function max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n }\n\n /**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\n function min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return wrapped values in chain sequences.\n lodash.after = after;\n lodash.assignIn = assignIn;\n lodash.before = before;\n lodash.bind = bind;\n lodash.chain = chain;\n lodash.compact = compact;\n lodash.concat = concat;\n lodash.countBy = countBy;\n lodash.create = create;\n lodash.debounce = debounce;\n lodash.defaults = defaults;\n lodash.defaultsDeep = defaultsDeep;\n lodash.defer = defer;\n lodash.delay = delay;\n lodash.difference = difference;\n lodash.drop = drop;\n lodash.filter = filter;\n lodash.flatten = flatten;\n lodash.flattenDeep = flattenDeep;\n lodash.groupBy = groupBy;\n lodash.initial = initial;\n lodash.intersection = intersection;\n lodash.invert = invert;\n lodash.invertBy = invertBy;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.matches = matches;\n lodash.merge = merge;\n lodash.mixin = mixin;\n lodash.negate = negate;\n lodash.omit = omit;\n lodash.omitBy = omitBy;\n lodash.once = once;\n lodash.pick = pick;\n lodash.range = range;\n lodash.reject = reject;\n lodash.rest = rest;\n lodash.set = set;\n lodash.slice = slice;\n lodash.sortBy = sortBy;\n lodash.take = take;\n lodash.takeRight = takeRight;\n lodash.tap = tap;\n lodash.throttle = throttle;\n lodash.thru = thru;\n lodash.toArray = toArray;\n lodash.union = union;\n lodash.uniq = uniq;\n lodash.uniqBy = uniqBy;\n lodash.unzip = unzip;\n lodash.values = values;\n lodash.without = without;\n lodash.zip = zip;\n lodash.zipObject = zipObject;\n\n // Add aliases.\n lodash.extend = assignIn;\n\n // Add methods to `lodash.prototype`.\n mixin(lodash, lodash);\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return unwrapped values in chain sequences.\n lodash.clamp = clamp;\n lodash.clone = clone;\n lodash.cloneDeep = cloneDeep;\n lodash.escape = escape;\n lodash.every = every;\n lodash.find = find;\n lodash.findIndex = findIndex;\n lodash.findKey = findKey;\n lodash.findLastIndex = findLastIndex;\n lodash.findLastKey = findLastKey;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.has = has;\n lodash.head = head;\n lodash.identity = identity;\n lodash.indexOf = indexOf;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isBoolean = isBoolean;\n lodash.isDate = isDate;\n lodash.isEmpty = isEmpty;\n lodash.isEqual = isEqual;\n lodash.isFinite = isFinite;\n lodash.isFunction = isFunction;\n lodash.isNaN = isNaN;\n lodash.isNull = isNull;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isPlainObject = isPlainObject;\n lodash.isRegExp = isRegExp;\n lodash.isString = isString;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.max = max;\n lodash.min = min;\n lodash.noConflict = noConflict;\n lodash.noop = noop;\n lodash.random = random;\n lodash.reduce = reduce;\n lodash.result = result;\n lodash.size = size;\n lodash.some = some;\n lodash.trim = trim;\n lodash.uniqueId = uniqueId;\n\n // Add aliases.\n lodash.each = forEach;\n lodash.first = head;\n\n mixin(lodash, (function() {\n var source = {};\n baseForOwn(lodash, function(func, methodName) {\n if (!hasOwnProperty.call(lodash.prototype, methodName)) {\n source[methodName] = func;\n }\n });\n return source;\n }()), { 'chain': false });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n arrayEach(['drop', 'take'], function(methodName, index) {\n LazyWrapper.prototype[methodName] = function(n) {\n n = n === undefined ? 1 : nativeMax(toInteger(n), 0);\n\n var result = (this.__filtered__ && !index)\n ? new LazyWrapper(this)\n : this.clone();\n\n if (result.__filtered__) {\n result.__takeCount__ = nativeMin(n, result.__takeCount__);\n } else {\n result.__views__.push({\n 'size': nativeMin(n, MAX_ARRAY_LENGTH),\n 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')\n });\n }\n return result;\n };\n\n LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n return this.reverse()[methodName](n).reverse();\n };\n });\n\n // Add `LazyWrapper` methods that accept an `iteratee` value.\n arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n var type = index + 1,\n isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;\n\n LazyWrapper.prototype[methodName] = function(iteratee) {\n var result = this.clone();\n result.__iteratees__.push({\n 'iteratee': getIteratee(iteratee, 3),\n 'type': type\n });\n result.__filtered__ = result.__filtered__ || isFilter;\n return result;\n };\n });\n\n // Add `LazyWrapper` methods for `_.head` and `_.last`.\n arrayEach(['head', 'last'], function(methodName, index) {\n var takeName = 'take' + (index ? 'Right' : '');\n\n LazyWrapper.prototype[methodName] = function() {\n return this[takeName](1).value()[0];\n };\n });\n\n // Add `LazyWrapper` methods for `_.initial` and `_.tail`.\n arrayEach(['initial', 'tail'], function(methodName, index) {\n var dropName = 'drop' + (index ? '' : 'Right');\n\n LazyWrapper.prototype[methodName] = function() {\n return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n };\n });\n\n LazyWrapper.prototype.compact = function() {\n return this.filter(identity);\n };\n\n LazyWrapper.prototype.find = function(predicate) {\n return this.filter(predicate).head();\n };\n\n LazyWrapper.prototype.findLast = function(predicate) {\n return this.reverse().find(predicate);\n };\n\n LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {\n if (typeof path == 'function') {\n return new LazyWrapper(this);\n }\n return this.map(function(value) {\n return baseInvoke(value, path, args);\n });\n });\n\n LazyWrapper.prototype.reject = function(predicate) {\n return this.filter(negate(getIteratee(predicate)));\n };\n\n LazyWrapper.prototype.slice = function(start, end) {\n start = toInteger(start);\n\n var result = this;\n if (result.__filtered__ && (start > 0 || end < 0)) {\n return new LazyWrapper(result);\n }\n if (start < 0) {\n result = result.takeRight(-start);\n } else if (start) {\n result = result.drop(start);\n }\n if (end !== undefined) {\n end = toInteger(end);\n result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n }\n return result;\n };\n\n LazyWrapper.prototype.takeRightWhile = function(predicate) {\n return this.reverse().takeWhile(predicate).reverse();\n };\n\n LazyWrapper.prototype.toArray = function() {\n return this.take(MAX_ARRAY_LENGTH);\n };\n\n // Add `LazyWrapper` methods to `lodash.prototype`.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),\n isTaker = /^(?:head|last)$/.test(methodName),\n lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],\n retUnwrapped = isTaker || /^find/.test(methodName);\n\n if (!lodashFunc) {\n return;\n }\n lodash.prototype[methodName] = function() {\n var value = this.__wrapped__,\n args = isTaker ? [1] : arguments,\n isLazy = value instanceof LazyWrapper,\n iteratee = args[0],\n useLazy = isLazy || isArray(value);\n\n var interceptor = function(value) {\n var result = lodashFunc.apply(lodash, arrayPush([value], args));\n return (isTaker && chainAll) ? result[0] : result;\n };\n\n if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n isLazy = useLazy = false;\n }\n var chainAll = this.__chain__,\n isHybrid = !!this.__actions__.length,\n isUnwrapped = retUnwrapped && !chainAll,\n onlyLazy = isLazy && !isHybrid;\n\n if (!retUnwrapped && useLazy) {\n value = onlyLazy ? value : new LazyWrapper(this);\n var result = func.apply(value, args);\n result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n return new LodashWrapper(result, chainAll);\n }\n if (isUnwrapped && onlyLazy) {\n return func.apply(this, args);\n }\n result = this.thru(interceptor);\n return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;\n };\n });\n\n // Add `Array` methods to `lodash.prototype`.\n arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {\n var func = arrayProto[methodName],\n chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n retUnwrapped = /^(?:pop|shift)$/.test(methodName);\n\n lodash.prototype[methodName] = function() {\n var args = arguments;\n if (retUnwrapped && !this.__chain__) {\n var value = this.value();\n return func.apply(isArray(value) ? value : [], args);\n }\n return this[chainName](function(value) {\n return func.apply(isArray(value) ? value : [], args);\n });\n };\n });\n\n // Map minified method names to their real names.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var lodashFunc = lodash[methodName];\n if (lodashFunc) {\n var key = (lodashFunc.name + ''),\n names = realNames[key] || (realNames[key] = []);\n\n names.push({ 'name': methodName, 'func': lodashFunc });\n }\n });\n\n realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{\n 'name': 'wrapper',\n 'func': undefined\n }];\n\n // Add methods to `LazyWrapper`.\n LazyWrapper.prototype.clone = lazyClone;\n LazyWrapper.prototype.reverse = lazyReverse;\n LazyWrapper.prototype.value = lazyValue;\n\n // Add lazy aliases.\n lodash.prototype.first = lodash.prototype.head;\n\n if (symIterator) {\n lodash.prototype[symIterator] = wrapperToIterator;\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Some AMD build optimizers, like r.js, check for condition patterns like:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Expose Lodash on the global object to prevent errors when Lodash is\n // loaded by a script tag in the presence of an AMD loader.\n // See http://requirejs.org/docs/errors.html#mismatch for more details.\n // Use `_.noConflict` to remove Lodash from the global object.\n root._ = lodash;\n\n // Define as an anonymous module so, through path mapping, it can be\n // referenced as the \"underscore\" module.\n define(function() {\n return lodash;\n });\n }\n // Check for `exports` after `define` in case a build optimizer adds it.\n else if (freeModule) {\n // Export for Node.js.\n (freeModule.exports = lodash)._ = lodash;\n // Export for CommonJS support.\n freeExports._ = lodash;\n }\n else {\n // Export to the global object.\n root._ = lodash;\n }\n}.call(this));\n"},function(e,t,n){(function(e,t){function n(){u=!1;for(var e=l.slice(0),t=l.length=0;t<e.length;t++)e[t]()}var i,r,a,o,s,l,u,c,h,p,d;_global=undefined,_global="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),h=function(i,r){return function(e,t,n){return i.call(r,t,e,n)}},p=function(e){return function(){return _[e].apply(_,arguments)}},d=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);return e[1]=_.isFunction(e[1])?h(e[1],e[2]):e[1],_[t].apply(_,e)}},_.extend(BI,{assert:function(e,t){if(this.isFunction(t)){if(t(e))return!0;throw new Error(e+" error")}if(this.isArray(t)||(t=[t]),!this.deepContains(t,e))throw new Error(e+" error");return!0},warn:function(e){console.warn(e)},UUID:function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t="",n=0;n<16;n++){t+=e[parseInt(e.length*Math.random(),10)]}return t},isWidget:function(e){return e instanceof BI.Widget||BI.View&&e instanceof BI.View},createWidgets:function(e,n,t){if(!BI.isArray(e))throw new Error("cannot create Widgets");return n=BI.isWidget(n)?{}:n||{},BI.map(BI.flatten(e),function(e,t){return BI.createWidget(t,BI.deepClone(n))})},createItems:function(e,n,i){return n=BI.isArray(n)?n:BI.makeArray(BI.flatten(e).length,n||{}),i=BI.isArray(i)?i:BI.makeArray(BI.flatten(e).length,i||{}),BI.map(e,function(e,t){return BI.isArray(t)?BI.createItems(t,n,i):t instanceof BI.Widget?BI.extend({},n.shift(),i.shift(),{type:null,el:t}):n[0]instanceof BI.Widget?(i.shift(),BI.extend({},t,{el:n.shift()})):t.el instanceof BI.Widget||BI.View&&t.el instanceof BI.View?(n.shift(),BI.extend({},i.shift(),{type:null},t)):t.el?BI.extend({},i.shift(),t,{el:BI.extend({},n.shift(),t.el)}):BI.extend({},i.shift(),{el:BI.extend({},n.shift(),t)})})},packageItems:function(e,n){for(var i=n.length-1;0<=i;i--)e=BI.map(e,function(e,t){return BI.extend({},n[i],{items:[BI.extend({},n[i].el,{el:t})]})});return e},formatEL:function(e){return e&&!e.type&&e.el?e:{el:e}},stripEL:function(e){return e.type&&e||e.el||e},trans2Element:function(e){return BI.map(e,function(e,t){return t.element})}}),_.each(["where","findWhere","invoke","pluck","shuffle","sample","toArray","size"],function(e){BI[e]=p(e)}),_.each(["get","set","each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","clamp"],function(e){BI[e]=d("any"===e?"some":e)}),_.extend(BI,{count:function(e,t,n){var i;if(n)for(i=e;i<t;i++)n(i);return t-e},inverse:function(e,t,n){return BI.count(t,e,n)},firstKey:function(e){var n=i;return BI.any(e,function(e,t){return n=e,!0}),n},lastKey:function(e){var n=i;return BI.each(e,function(e,t){return n=e,!0}),n},firstObject:function(e){var n=i;return BI.any(e,function(e,t){return n=t,!0}),n},lastObject:function(e){var n=i;return BI.each(e,function(e,t){return n=t,!0}),n},concat:function(e,t){return BI.isKey(e)?BI.map([].slice.apply(arguments),function(e,t){return t}).join(""):BI.isArray(e)?_.concat.apply([],arguments):BI.isObject(e)?_.extend.apply({},arguments):void 0},backEach:function(e,t,n){t=BI.iteratee(t,n);for(var i=e.length-1;0<=i;i--)t(i,e[i],e);return!1},backAny:function(e,t,n){t=BI.iteratee(t,n);for(var i=e.length-1;0<=i;i--)if(t(i,e[i],e))return!0;return!1},backEvery:function(e,t,n){t=BI.iteratee(t,n);for(var i=e.length-1;0<=i;i--)if(!t(i,e[i],e))return!1;return!0},backFindKey:function(e,t,n){t=BI.iteratee(t,n);for(var i,r=_.keys(e),a=r.length-1;0<=a;a--)if(t(e[i=r[a]],i,e))return i},backFind:function(e,t,n){var i=BI.isArray(e)?BI.findLastIndex(e,t,n):BI.backFindKey(e,t,n);if(void 0!==i&&-1!==i)return e[i]},remove:function(n,i,r){var e,a=BI.isFunction(i);if(i=a||BI.isArray(i)?i:[i],BI.isArray(n))for(e=0;e<n.length;e++)(a&&!0===i.apply(r,[e,n[e]])||!a&&BI.contains(i,n[e]))&&n.splice(e--,1);else BI.each(n,function(e,t){(a&&!0===i.apply(r,[e,n[e]])||!a&&BI.contains(i,n[e]))&&delete n[e]})},removeAt:function(e,t){t=BI.isArray(t)?t:[t];for(var n=BI.isArray(e),i=0;i<t.length;i++)n?e[t[i]]="$deleteIndex":delete e[t[i]];n&&BI.remove(e,"$deleteIndex")},string2Array:function(e){return e.split("&-&")},array2String:function(e){return e.join("&-&")},abc2Int:function(e){for(var t=0,n=0,i=(e=e.toUpperCase()).length;n<i;++n)if((t=e.charAt(n).charCodeAt(0)-"A".charCodeAt(0)+26*t+1)>(2147483646-e.charAt(n).charCodeAt(0)+"A".charCodeAt(0))/26)return 0;return t},int2Abc:function(e){var t=["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"],n=e,i="";if(0===e)return"";for(;0!==n;){var r=n%26;0===r&&(r=26),i=t[r-1]+i,n=(n-r)/26}return i}}),_.each(["first","initial","last","rest","compact","flatten","without","union","intersection","difference","zip","unzip","object","indexOf","lastIndexOf","sortedIndex","range","take","takeRight","uniqBy"],function(e){BI[e]=p(e)}),_.each(["findIndex","findLastIndex"],function(e){BI[e]=d(e)}),_.extend(BI,{makeArray:function(e,t){for(var n=[],i=0;i<e;i++)BI.isNull(t)?n.push(i):n.push(BI.deepClone(t));return n},makeObject:function(e,t){for(var n={},i=0;i<e.length;i++)BI.isNull(t)?n[e[i]]=e[i]:n[e[i]]=BI.deepClone(t);return n},makeArrayByArray:function(e,t){var n=[];if(!e)return n;for(var i=0,r=e.length;i<r;i++)BI.isArray(e[i])?n.push(arguments.callee(e[i],t)):n.push(BI.deepClone(t));return n},uniq:function(e,t,n,i){return null==e?[]:(_.isBoolean(t)||(i=n,n=t,t=!1),n=n&&h(n,i),_.uniq.call(_,e,t,n,i))}}),_.each(["keys","allKeys","values","pairs","invert","create","functions","extend","extendOwn","defaults","clone","property","propertyOf","matcher","isEqual","isMatch","isEmpty","isElement","isNumber","isString","isArray","isObject","isPlainObject","isArguments","isFunction","isFinite","isBoolean","isDate","isRegExp","isError","isNaN","isUndefined","zipObject","cloneDeep"],function(e){BI[e]=p(e)}),_.each(["mapObject","findKey","pick","omit","tap"],function(e){BI[e]=d(e)}),_.extend(BI,{inherit:function(e,t,n){"object"==typeof t&&(n=t,t=e,e=function(){return t.apply(this,arguments)});var i=function(){},r=t.prototype;return i.prototype=r,e.prototype=new i,e.superclass=r,_.extend(e.prototype,n,{superclass:t}),e},init:function(){for(;BI.prepares&&0<BI.prepares.length;)BI.prepares.shift()();for(;_global.___fineuiExposedFunction&&0<_global.___fineuiExposedFunction.length;)_global.___fineuiExposedFunction.shift()();BI.initialized=!0},has:function(n,e){return BI.isArray(e)?0!==e.length&&BI.every(e,function(e,t){return _.has(n,t)}):_.has.apply(_,arguments)},freeze:function(e){return Object.freeze&&BI.isObject(e)?Object.freeze(e):e},isKey:function(e){return BI.isNumber(e)||BI.isString(e)&&0<e.length},isCapitalEqual:function(e,t){return e=BI.isNull(e)?e:(""+e).toLowerCase(),t=BI.isNull(t)?t:(""+t).toLowerCase(),BI.isEqual(e,t)},isWidthOrHeight:function(e){return"number"==typeof e?0<=e:"string"==typeof e?/^\d{1,3}%$/.exec(e)||"auto"==e||/^\d+px$/.exec(e):void 0},isNotNull:function(e){return!BI.isNull(e)},isNull:function(e){return null==e},isEmptyArray:function(e){return BI.isArray(e)&&BI.isEmpty(e)},isNotEmptyArray:function(e){return BI.isArray(e)&&!BI.isEmpty(e)},isEmptyObject:function(e){return BI.isEqual(e,{})},isNotEmptyObject:function(e){return BI.isPlainObject(e)&&!BI.isEmptyObject(e)},isEmptyString:function(e){return BI.isString(e)&&0===e.length},isNotEmptyString:function(e){return BI.isString(e)&&!BI.isEmptyString(e)},isWindow:function(e){return null!=e&&e==e.window}}),_.extend(BI,{deepClone:_.cloneDeep,deepExtend:_.merge,isDeepMatch:function(e,t){var n=BI.keys(t),i=n.length;if(null==e)return!i;for(var r=Object(e),a=0;a<i;a++){var o=n[a];if(!(BI.isEqual(t[o],r[o])&&o in r))return!1}return!0},contains:function(e,t,n){return _.isArrayLike(e)||(e=_.values(e)),0<=_.indexOf(e,t,"number"==typeof n&&n)},deepContains:function(e,n){return BI.isObject(n)?BI.any(e,function(e,t){if(BI.isEqual(t,n))return!0}):BI.contains(e,n)},deepIndexOf:function(e,t){for(var n=0;n<e.length;n++)if(BI.isEqual(t,e[n]))return n;return-1},deepRemove:function(n,i){var e,r=!1;if(BI.isArray(n))for(e=0;e<n.length;e++)BI.isEqual(i,n[e])&&(n.splice(e--,1),r=!0);else BI.each(n,function(e,t){BI.isEqual(i,n[e])&&(delete n[e],r=!0)});return r},deepWithout:function(n,i){if(BI.isArray(n)){for(var r=[],e=0;e<n.length;e++)BI.isEqual(i,n[e])||r.push(n[e]);return r}r={};return BI.each(n,function(e,t){BI.isEqual(i,n[e])||(r[e]=t)}),r},deepUnique:function(e){var n=[];return BI.each(e,function(e,t){BI.deepContains(n,t)||n.push(t)}),n},deepDiff:function(e,t){e=e||{},t=t||{};var n=[],i=[];for(var r in e)this.has(e,r)&&(this.isEqual(e[r],t[r])||n.push(r),i.push(r));for(var r in t)this.has(t,r)&&!BI.contains(i,r)&&n.push(r);return n}}),_.each(["uniqueId","result","chain","iteratee","escape","unescape","before","after"],function(e){BI[e]=function(){return _[e].apply(_,arguments)}}),_.each(["bind","once","partial","debounce","throttle","delay","defer","wrap"],function(e){BI[e]=function(){return _[e].apply(_,arguments)}}),_.extend(BI,{nextTick:(u=!(l=[]),c=void 0,c="undefined"!=typeof Promise?(r=Promise.resolve(),function c(){r.then(n)}):"undefined"!=typeof MutationObserver?(a=1,o=new MutationObserver(n),s=document.createTextNode(String(a)),o.observe(s,{characterData:!0}),function c(){a=(a+1)%2,s.data=String(a)}):void 0!==t?function c(){t(n)}:function c(){setTimeout(n,0)},function(t){var n=void 0,i=[].slice.call(arguments,1);if(l.push(function(){if(t)try{t.apply(null,i)}catch(e){console.error(e)}else n&&n.apply(null,i)}),u||(u=!0,c()),!t&&"undefined"!=typeof Promise)return new Promise(function(e,t){n=e})})}),_.each(["random"],function(e){BI[e]=p(e)}),_.extend(BI,{getTime:function(){return _global.performance&&_global.performance.now?_global.performance.now():_global.performance&&_global.performance.webkitNow?_global.performance.webkitNow():Date.now?Date.now():BI.getDate().getTime()},parseInt:function(e){var t=10;/^0x/g.test(e)&&(t=16);try{return parseInt(e,t)}catch(n){throw new Error(e+"parse int error")}},parseSafeInt:function(e){var t=9007199254740991;return e?this.clamp(this.parseInt(e),-t,t):0===e?e:0},parseFloat:function(e){try{return parseFloat(e)}catch(t){throw new Error(e+"parse float error")}},isNaturalNumber:function(e){return!!/^\d+$/.test(e)},isPositiveInteger:function(e){return!!/^\+?[1-9][0-9]*$/.test(e)},isNegativeInteger:function(e){return!!/^\-[1-9][0-9]*$/.test(e)},isInteger:function(e){return!!/^\-?\d+$/.test(e)},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},isFloat:function(e){return!!/^([+-]?)\d*\.\d+$/.test(e)},isOdd:function(e){return!!BI.isInteger(e)&&1==(1&e)},isEven:function(e){return!!BI.isInteger(e)&&0==(1&e)},sum:function(e,n,i){var r=0;return BI.each(e,function(e,t){r+=n?Number(n.apply(i,[e,t])):Number(t)}),r},average:function(e,t,n){return BI.sum(e,t,n)/e.length}}),_.extend(BI,{trim:function(){return _.trim.apply(_,arguments)},toUpperCase:function(e){return(e+"").toLocaleUpperCase()},toLowerCase:function(e){return(e+"").toLocaleLowerCase()},isEndWithBlank:function(e){return/(\s|\u00A0)$/.test(e)},isLiteral:function(e){return/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/.test(e)},stripQuotes:function(e){var t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)},camelize:function(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})},hyphenate:function(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()},isNotEmptyString:function(e){return BI.isString(e)&&!BI.isEmpty(e)},isEmptyString:function(e){return BI.isString(e)&&BI.isEmpty(e)},encrypt:function(e,t,n){switch(e){case BI.CRYPT_TYPE.AES:default:return BI.aesEncrypt(t,n)}},decrypt:function(e,t,n){switch(e){case BI.CRYPT_TYPE.AES:default:return BI.aesDecrypt(t,n)}},escape:function(e){return e.replace(/('|\\)/g,"\\$1")},leftPad:function(e,t,n){var i=String(e);for(n=n||" ";i.length<t;)i=n+i;return i.toString()},format:function(e){var n=Array.prototype.slice.call(arguments,1);return e.replace(/\{(\d+)\}/g,function(e,t){return n[t]})}}),_.extend(BI,{isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},checkDateVoid:function(e,t,n,i,r){var a=[];return e|=0,t|=0,n|=0,i=BI.isString(i)?i.match(/\d+/g):i,r=BI.isString(r)?r.match(/\d+/g):r,e<i[0]?a=["y"]:e>r[0]?a=["y",1]:e>=i[0]&&e<=r[0]&&(e==i[0]&&(t<i[1]?a=["m"]:t==i[1]&&n<i[2]&&(a=["d"])),e==r[0]&&(t>r[1]?a=["m",1]:t==r[1]&&n>r[2]&&(a=["d",1]))),a},checkDateLegal:function(e){var t=e.match(/\d+/g),n=0|t[0],i=0|t[1],r=0|t[2];if(t.length<=1)return!0;if(t.length<=2)return 1<=i&&i<=12;var a=BI.Date._MD.slice(0);return a[1]=BI.isLeapYear(n)?29:28,1<=i&&i<=12&&r<=a[i-1]},parseDateTime:function(e,t){var n=BI.getDate(),i=0,r=0,a=1,o=e.split(/\W+/);"%y%x"!=t.toLowerCase()&&"%y%x%d"!=t.toLowerCase()||(o[0]=e.substring(0,4),o[1]=e.substring(4,6),o[2]=e.substring(6,8));for(var s=t.match(/%./g),l=0,u=0,c=0,h=0,p=0,l=0;l<o.length;++l)switch(s[l]){case"%d":case"%e":a=parseInt(o[l],10);break;case"%X":case"%x":r=parseInt(o[l],10)-1;break;case"%Y":case"%y":(i=parseInt(o[l],10))<100&&(i+=29<i?1900:2e3);break;case"%b":case"%B":for(u=0;u<12;++u)if(BI.Date._MN[u].substr(0,o[l].length).toLowerCase()==o[l].toLowerCase()){r=u;break}break;case"%H":case"%I":case"%k":case"%l":c=parseInt(o[l],10);break;case"%P":case"%p":/pm/i.test(o[l])&&c<12?c+=12:/am/i.test(o[l])&&12<=c&&(c-=12);break;case"%M":h=parseInt(o[l],10);case"%S":p=parseInt(o[l],10)}if(isNaN(i)&&(i=n.getFullYear()),isNaN(r)&&(r=n.getMonth()),isNaN(a)&&(a=n.getDate()),isNaN(c)&&(c=n.getHours()),isNaN(h)&&(h=n.getMinutes()),isNaN(p)&&(p=n.getSeconds()),0!=i)return BI.getDate(i,r,a,c,h,p);for(r=-1,l=a=i=0;l<o.length;++l)if(-1!=o[l].search(/[a-zA-Z]+/)){for(var d=-1,u=0;u<12;++u)if(BI.Date._MN[u].substr(0,o[l].length).toLowerCase()==o[l].toLowerCase()){d=u;break}-1!=d&&(-1!=r&&(a=r+1),r=d)}else parseInt(o[l],10)<=12&&-1==r?r=o[l]-1:31<parseInt(o[l],10)&&0==i?(i=parseInt(o[l],10))<100&&(i+=29<i?1900:2e3):0==a&&(a=o[l]);return 0==i&&(i=n.getFullYear()),-1!=r&&0!=a?BI.getDate(i,r,a,c,h,p):n},getDate:function(){var e,t=arguments;switch(arguments.length){case 0:e=new Date;break;case 1:e=new Date(t[0]);break;case 2:e=new Date(t[0],t[1]);break;case 3:e=new Date(t[0],t[1],t[2]);break;case 4:e=new Date(t[0],t[1],t[2],t[3]);break;case 5:e=new Date(t[0],t[1],t[2],t[3],t[4]);break;case 6:e=new Date(t[0],t[1],t[2],t[3],t[4],t[5]);break;case 7:e=new Date(t[0],t[1],t[2],t[3],t[4],t[5],t[6]);break;default:e=new Date}if(BI.isNotNull(BI.timeZone)&&(0===arguments.length||1===arguments.length&&BI.isNumber(arguments[0]))){var n=e.getTime(),i=6e4*e.getTimezoneOffset();return new Date(n+i+BI.timeZone)}return e},getTime:function(){var e,t=arguments;switch(arguments.length){case 0:e=new Date;break;case 1:e=new Date(t[0]);break;case 2:e=new Date(t[0],t[1]);break;case 3:e=new Date(t[0],t[1],t[2]);break;case 4:e=new Date(t[0],t[1],t[2],t[3]);break;case 5:e=new Date(t[0],t[1],t[2],t[3],t[4]);break;case 6:e=new Date(t[0],t[1],t[2],t[3],t[4],t[5]);break;case 7:e=new Date(t[0],t[1],t[2],t[3],t[4],t[5],t[6]);break;default:e=new Date}return BI.isNotNull(BI.timeZone)?e.getTime()-BI.timeZone-6e4*(new Date).getTimezoneOffset():e.getTime()}})}).call(this,n(13),n(52).setImmediate)},function(e,t,n){"use strict";(function(e,t){function n(e){delete s[e]}function i(e){if(l)setTimeout(i,0,e);else{var t=s[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(a,n)}}(t)}finally{n(e),l=!1}}}}var r,a,o,s,l,u,c,h,p,d,f,g;(r="undefined"==typeof self?void 0===e?void 0:e:self).setImmediate||(o=1,l=!(s={}),u=r.document,g=(g=Object.getPrototypeOf&&Object.getPrototypeOf(r))&&g.setTimeout?g:r,c="[object process]"==={}.toString.call(r.process)?function c(e){t.nextTick(function(){i(e)})}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1},r.postMessage("","*"),r.onmessage=t,e}}()?(d="setImmediate$"+Math.random()+"$",f=function f(e){e.source===r&&"string"==typeof e.data&&0===e.data.indexOf(d)&&i(+e.data.slice(d.length))},r.addEventListener?r.addEventListener("message",f,!1):r.attachEvent("onmessage",f),function c(e){r.postMessage(d+e,"*")}):r.MessageChannel?((p=new MessageChannel).port1.onmessage=function(e){i(e.data)},function c(e){p.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(h=u.documentElement,function c(e){var t=u.createElement("script");t.onreadystatechange=function(){i(e),t.onreadystatechange=null,h.removeChild(t),t=null},h.appendChild(t)}):function c(e){setTimeout(i,0,e)},g.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return s[o]=i,c(o),o++},g.clearImmediate=n)}).call(this,n(13),n(66))},function(e,t){BI.OB=function(e){this._constructor(e)},_.extend(BI.OB.prototype,{props:{},init:null,destroyed:null,_constructor:function(e){this._initProps(e),this._init(),this._initRef()},_defaultConfig:function(e){return{}},_initProps:function(e){var t=this.props;BI.isFunction(this.props)&&(t=this.props(e)),this.options=function(e){for(var t,n,i,r=e||{},a=arguments.length,o=1;o<a;o++)if(null!=(t=arguments[o]))for(n in t)r[n],r!==(i=t[n])&&i!==undefined&&(r[n]=i);return r}(this._defaultConfig(e),t,e)},_init:function(){this._initListeners(),this.init&&this.init()},_initListeners:function(){var t=this;null!=this.options.listeners&&(_.each(this.options.listeners,function(e){(e.target?e.target:t)[e.once?"once":"on"](e.eventName,_.bind(e.action,t))}),delete this.options.listeners)},_initRef:function(){this.options.ref&&this.options.ref.call(this,this)},_purgeRef:function(){this.options.ref&&(this.options.ref.call(null),this.options.ref=null)},_getEvents:function(){return _.isArray(this.events)||(this.events=[]),this.events},on:function(e,t){e=e.toLowerCase();var n=this._getEvents()[e];_.isArray(n)||(n=[],this._getEvents()[e]=n),n.push(t)},once:function(e,t){var n=function(){t.apply(this,arguments),this.un(e,n)};this.on(e,n)},un:function(e,t){var n,i;e=e.toLowerCase(),null==t?delete this._getEvents()[e]:(n=this._getEvents()[e],_.isArray(n)&&(i=[],_.each(n,function(e){e!=t&&i.push(e)}),this._getEvents()[e]=i))},purgeListeners:function(){this.events=[]},fireEvent:function(){var e=arguments[0].toLowerCase(),t=this._getEvents()[e];if(BI.isArray(t))if(BI.isArguments(arguments[1])){for(var n=0;n<t.length;n++)if(!1===t[n].apply(this,arguments[1]))return!1}else for(var i=Array.prototype.slice.call(arguments,1),n=0;n<t.length;n++)if(!1===t[n].apply(this,i))return!1;return!0},destroy:function(){this.destroyed&&this.destroyed(),this._purgeRef(),this.purgeListeners()}})},function(e,t){!function(){BI.CRYPT_TYPE=BI.CRYPT_TYPE||{},BI.CRYPT_TYPE.AES="aes";var c,e,t,n,h,i,r,a,o,s,l,p,u,d,f,g,m,I,B,E,b=b||(c=Math,t=(e={}).lib={},n=t.Base={extend:function(e){y.prototype=this;var t=new y;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},h=t.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||r).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,r=e.sigBytes;if(this.clamp(),i%4)for(var a=0;a<r;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else if(65535<n.length)for(a=0;a<r;a+=4)t[i+a>>>2]=n[a>>>2];else t.push.apply(t,n);return this.sigBytes+=r,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=c.ceil(t/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(4294967296*c.random()|0);return new h.init(t,e)}}),i=e.enc={},r=i.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var a=t[r>>>2]>>>24-r%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new h.init(n,t/2)}},a=i.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var a=t[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(a))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new h.init(n,t)}},o=i.Utf8={stringify:function(e){try{return decodeURIComponent(escape(a.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return a.parse(unescape(encodeURIComponent(e)))}},s=t.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=o.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,n=t.words,i=t.sigBytes,r=this.blockSize,a=i/(4*r),o=(a=e?c.ceil(a):c.max((0|a)-this._minBufferSize,0))*r,s=c.min(4*o,i);if(o){for(var l=0;l<o;l+=r)this._doProcessBlock(n,l);var u=n.splice(0,o);t.sigBytes-=s}return new h.init(u,s)},clone:function(){var e=n.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),t.Hasher=s.extend({cfg:n.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){s.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(n){return function(e,t){return new n.init(t).finalize(e)}},_createHmacHelper:function(n){return function(e,t){return new l.HMAC.init(n,t).finalize(e)}}}),l=e.algo={},e);function y(){}p=b.lib.WordArray,b.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var r=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)r.push(i.charAt(o>>>6*(3-s)&63));var l=i.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(e){var t,n=e.length,i=this._map,r=i.charAt(64);!r||-1!=(t=e.indexOf(r))&&(n=t);for(var a,o,s=[],l=0,u=0;u<n;u++){u%4&&(a=i.indexOf(e.charAt(u-1))<<u%4*2,o=i.indexOf(e.charAt(u))>>>6-u%4*2,s[l>>>2]|=(a|o)<<24-l%4*8,l++)}return p.create(s,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(c){var e=b,t=e.lib,n=t.WordArray,i=t.Hasher,r=e.algo,N=[];!function(){for(var e=0;e<64;e++)N[e]=4294967296*c.abs(c.sin(e+1))|0}();var a=r.MD5=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,r=e[i];e[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var a=this._hash.words,o=e[t+0],s=e[t+1],l=e[t+2],u=e[t+3],c=e[t+4],h=e[t+5],p=e[t+6],d=e[t+7],f=e[t+8],g=e[t+9],m=e[t+10],I=e[t+11],B=e[t+12],_=e[t+13],E=e[t+14],b=e[t+15],y=V(y=a[0],C=a[1],T=a[2],v=a[3],o,7,N[0]),v=V(v,y,C,T,s,12,N[1]),T=V(T,v,y,C,l,17,N[2]),C=V(C,T,v,y,u,22,N[3]);y=V(y,C,T,v,c,7,N[4]),v=V(v,y,C,T,h,12,N[5]),T=V(T,v,y,C,p,17,N[6]),C=V(C,T,v,y,d,22,N[7]),y=V(y,C,T,v,f,7,N[8]),v=V(v,y,C,T,g,12,N[9]),T=V(T,v,y,C,m,17,N[10]),C=V(C,T,v,y,I,22,N[11]),y=V(y,C,T,v,B,7,N[12]),v=V(v,y,C,T,_,12,N[13]),T=V(T,v,y,C,E,17,N[14]),y=S(y,C=V(C,T,v,y,b,22,N[15]),T,v,s,5,N[16]),v=S(v,y,C,T,p,9,N[17]),T=S(T,v,y,C,I,14,N[18]),C=S(C,T,v,y,o,20,N[19]),y=S(y,C,T,v,h,5,N[20]),v=S(v,y,C,T,m,9,N[21]),T=S(T,v,y,C,b,14,N[22]),C=S(C,T,v,y,c,20,N[23]),y=S(y,C,T,v,g,5,N[24]),v=S(v,y,C,T,E,9,N[25]),T=S(T,v,y,C,u,14,N[26]),C=S(C,T,v,y,f,20,N[27]),y=S(y,C,T,v,_,5,N[28]),v=S(v,y,C,T,l,9,N[29]),T=S(T,v,y,C,d,14,N[30]),y=x(y,C=S(C,T,v,y,B,20,N[31]),T,v,h,4,N[32]),v=x(v,y,C,T,f,11,N[33]),T=x(T,v,y,C,I,16,N[34]),C=x(C,T,v,y,E,23,N[35]),y=x(y,C,T,v,s,4,N[36]),v=x(v,y,C,T,c,11,N[37]),T=x(T,v,y,C,d,16,N[38]),C=x(C,T,v,y,m,23,N[39]),y=x(y,C,T,v,_,4,N[40]),v=x(v,y,C,T,o,11,N[41]),T=x(T,v,y,C,u,16,N[42]),C=x(C,T,v,y,p,23,N[43]),y=x(y,C,T,v,g,4,N[44]),v=x(v,y,C,T,B,11,N[45]),T=x(T,v,y,C,b,16,N[46]),y=w(y,C=x(C,T,v,y,l,23,N[47]),T,v,o,6,N[48]),v=w(v,y,C,T,d,10,N[49]),T=w(T,v,y,C,E,15,N[50]),C=w(C,T,v,y,h,21,N[51]),y=w(y,C,T,v,B,6,N[52]),v=w(v,y,C,T,u,10,N[53]),T=w(T,v,y,C,m,15,N[54]),C=w(C,T,v,y,s,21,N[55]),y=w(y,C,T,v,f,6,N[56]),v=w(v,y,C,T,b,10,N[57]),T=w(T,v,y,C,p,15,N[58]),C=w(C,T,v,y,_,21,N[59]),y=w(y,C,T,v,c,6,N[60]),v=w(v,y,C,T,I,10,N[61]),T=w(T,v,y,C,l,15,N[62]),C=w(C,T,v,y,g,21,N[63]),a[0]=a[0]+y|0,a[1]=a[1]+C|0,a[2]=a[2]+T|0,a[3]=a[3]+v|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var r=c.floor(n/4294967296),a=n;t[15+(64+i>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t[14+(64+i>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,l=0;l<4;l++){var u=s[l];s[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function V(e,t,n,i,r,a,o){var s=e+(t&n|~t&i)+r+o;return(s<<a|s>>>32-a)+t}function S(e,t,n,i,r,a,o){var s=e+(t&i|n&~i)+r+o;return(s<<a|s>>>32-a)+t}function x(e,t,n,i,r,a,o){var s=e+(t^n^i)+r+o;return(s<<a|s>>>32-a)+t}function w(e,t,n,i,r,a,o){var s=e+(n^(t|~i))+r+o;return(s<<a|s>>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),d=(u=b).lib,f=d.Base,g=d.WordArray,m=u.algo,I=m.MD5,B=m.EvpKDF=f.extend({cfg:f.extend({keySize:4,hasher:I,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=n.hasher.create(),r=g.create(),a=r.words,o=n.keySize,s=n.iterations;a.length<o;){l&&i.update(l);var l=i.update(e).finalize(t);i.reset();for(var u=1;u<s;u++)l=i.finalize(l),i.reset();r.concat(l)}return r.sigBytes=4*o,r}}),u.EvpKDF=function(e,t,n){return B.create(n).compute(e,t)},b.lib.Cipher||function(){var e=b,t=e.lib,n=t.Base,l=t.WordArray,i=t.BufferedBlockAlgorithm,r=e.enc,a=(r.Utf8,r.Base64),o=e.algo.EvpKDF,s=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(i){return{encrypt:function(e,t,n){return u(t).encrypt(i,e,t,n)},decrypt:function(e,t,n){return u(t).decrypt(i,e,t,n)}}}});function u(e){return"string"==typeof e?E:B}t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var c,h=e.mode={},p=t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=h.CBC=((c=p.extend()).Encryptor=c.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;f.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),c.Decryptor=c.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,r=e.slice(t,t+i);n.decryptBlock(e,t),f.call(this,e,t,i),this._prevBlock=r}}),c);function f(e,t,n){var i,r=this._iv;r?(i=r,this._iv=void 0):i=this._prevBlock;for(var a=0;a<n;a++)e[t+a]^=i[a]}var g=(e.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,i=n-e.sigBytes%n,r=i<<24|i<<16|i<<8|i,a=[],o=0;o<i;o+=4)a.push(r);var s=l.create(a,i);e.concat(s)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},m=(t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:d,padding:g}),reset:function(){s.reset.call(this);var e,t=this.cfg,n=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode=e.call(i,this,n&&n.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),I=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?l.create([1398893684,1701076831]).concat(n).concat(t):t).toString(a)},parse:function(e){var t,n=a.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=l.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),m.create({ciphertext:n,salt:t})}},B=t.SerializableCipher=n.extend({cfg:n.extend({format:I}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var r=e.createEncryptor(n,i),a=r.finalize(t),o=r.cfg;return m.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,n,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(e.kdf={}).OpenSSL={execute:function(e,t,n,i){i=i||l.random(8);var r=o.create({keySize:t+n}).compute(e,i),a=l.create(r.words.slice(t),4*n);return r.sigBytes=4*t,m.create({key:r,iv:a,salt:i})}},E=t.PasswordBasedCipher=B.extend({cfg:B.cfg.extend({kdf:_}),encrypt:function(e,t,n,i){var r=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize);i.iv=r.iv;var a=B.encrypt.call(this,e,t,r.key,i);return a.mixIn(r),a},decrypt:function(e,t,n,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var r=i.kdf.execute(n,e.keySize,e.ivSize,t.salt);return i.iv=r.iv,B.decrypt.call(this,e,t,r.key,i)}})}(),b.mode.ECB=((E=b.lib.BlockCipherMode.extend()).Encryptor=E.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),E.Decryptor=E.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),E),function(){var e=b,t=e.lib.BlockCipher,n=e.algo,u=[],c=[],h=[],p=[],d=[],f=[],g=[],m=[],I=[],B=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=0,i=0,t=0;t<256;t++){var r=(r=i^i<<1^i<<2^i<<3^i<<4)>>>8^255&r^99;u[n]=r;var a=e[c[r]=n],o=e[a],s=e[o],l=257*e[r]^16843008*r;h[n]=l<<24|l>>>8,p[n]=l<<16|l>>>16,d[n]=l<<8|l>>>24,f[n]=l;l=16843009*s^65537*o^257*a^16843008*n;g[r]=l<<24|l>>>8,m[r]=l<<16|l>>>16,I[r]=l<<8|l>>>24,B[r]=l,n?(n=a^e[e[e[s^a]]],i^=e[e[i]]):n=i=1}}();var _=[0,1,2,4,8,16,32,64,128,27,54],i=n.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,i=4*(1+(this._nRounds=6+n)),r=this._keySchedule=[],a=0;a<i;a++){a<n?r[a]=t[a]:(l=r[a-1],a%n?6<n&&a%n==4&&(l=u[l>>>24]<<24|u[l>>>16&255]<<16|u[l>>>8&255]<<8|u[255&l]):(l=u[(l=l<<8|l>>>24)>>>24]<<24|u[l>>>16&255]<<16|u[l>>>8&255]<<8|u[255&l],l^=_[a/n|0]<<24),r[a]=r[a-n]^l)}for(var o=this._invKeySchedule=[],s=0;s<i;s++){var l,a=i-s;l=s%4?r[a]:r[a-4],o[s]=s<4||a<=4?l:g[u[l>>>24]]^m[u[l>>>16&255]]^I[u[l>>>8&255]]^B[u[255&l]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,h,p,d,f,u)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,g,m,I,B,c);n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,r,a,o,s){for(var l=this._nRounds,u=e[t]^n[0],c=e[t+1]^n[1],h=e[t+2]^n[2],p=e[t+3]^n[3],d=4,f=1;f<l;f++)var g=i[u>>>24]^r[c>>>16&255]^a[h>>>8&255]^o[255&p]^n[d++],m=i[c>>>24]^r[h>>>16&255]^a[p>>>8&255]^o[255&u]^n[d++],I=i[h>>>24]^r[p>>>16&255]^a[u>>>8&255]^o[255&c]^n[d++],B=i[p>>>24]^r[u>>>16&255]^a[c>>>8&255]^o[255&h]^n[d++],u=g,c=m,h=I,p=B;g=(s[u>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&p])^n[d++],m=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[p>>>8&255]<<8|s[255&u])^n[d++],I=(s[h>>>24]<<24|s[p>>>16&255]<<16|s[u>>>8&255]<<8|s[255&c])^n[d++],B=(s[p>>>24]<<24|s[u>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^n[d++];e[t]=g,e[t+1]=m,e[t+2]=I,e[t+3]=B},keySize:8});e.AES=t._createHelper(i)}(),_.extend(BI,{aesEncrypt:function(e,t){return t=b.enc.Utf8.parse(t),b.AES.encrypt(e,t,{mode:b.mode.ECB,padding:b.pad.Pkcs7}).ciphertext.toString(b.enc.Base64)},aesDecrypt:function(e,t){t=b.enc.Utf8.parse(t);var n=b.AES.decrypt(e,t,{mode:b.mode.ECB,padding:b.pad.Pkcs7});return b.enc.Utf8.stringify(n)}})}()},function(e,t){function n(o){return function(e,t,n){var l,i=e[t];i&&i.target==e||((l=e[t]=function(){for(var e,t=l.before,n=arguments,i=t.length;i--;){if(!1===(e=t[i].advice.apply(this,n)))return!1;n=e||n}for(var r=l.method.apply(this,n),a=l.after,o=0,s=a.length;o<s;o++){if(e=a[o].advice.call(this,r,n),!1===r)return!1;n=e||n}return r}).before=[],l.after=[],i&&(l.method=i),l.target=e);var r=(l||i)[o],a={advice:n,_index:r.length,remove:function(){r.splice(this._index,1)}};return r.push(a),a}}BI.aspect={before:n("before"),after:n("after")},BI.aspect},function(e,t){var c;c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_.extend(BI,{encode:function(e){var t,n,i,r,a,o,s,l="",u=0;for(e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t}(e);u<e.length;)r=(t=e.charCodeAt(u++))>>2,a=(3&t)<<4|(n=e.charCodeAt(u++))>>4,o=(15&n)<<2|(i=e.charCodeAt(u++))>>6,s=63&i,isNaN(n)?o=s=64:isNaN(i)&&(s=64),l=l+c.charAt(r)+c.charAt(a)+c.charAt(o)+c.charAt(s);return l},decode:function(e){var t,n,i,r,a,o,s="",l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<e.length;)t=c.indexOf(e.charAt(l++))<<2|(r=c.indexOf(e.charAt(l++)))>>4,n=(15&r)<<4|(a=c.indexOf(e.charAt(l++)))>>2,i=(3&a)<<6|(o=c.indexOf(e.charAt(l++))),s+=String.fromCharCode(t),64!=a&&(s+=String.fromCharCode(n)),64!=o&&(s+=String.fromCharCode(i));return s=function(e){for(var t,n,i="",r=0,a=0;r<e.length;)(t=e.charCodeAt(r))<128?(i+=String.fromCharCode(t),r++):191<t&&t<224?(a=e.charCodeAt(r+1),i+=String.fromCharCode((31&t)<<6|63&a),r+=2):(a=e.charCodeAt(r+1),n=e.charCodeAt(r+2),i+=String.fromCharCode((15&t)<<12|(63&a)<<6|63&n),r+=3);return i}(s)}})},function(e,t){BI.Cache={_prefix:"bi",setUsername:function(e){localStorage.setItem(BI.Cache._prefix+".username",(e+""||"").toUpperCase())},getUsername:function(){return localStorage.getItem(BI.Cache._prefix+".username")||""},_getKeyPrefix:function(){return BI.Cache.getUsername()+"."+BI.Cache._prefix+"."},_generateKey:function(e){return BI.Cache._getKeyPrefix()+(e||"")},getItem:function(e){return localStorage.getItem(BI.Cache._generateKey(e))},setItem:function(e,t){localStorage.setItem(BI.Cache._generateKey(e),t)},removeItem:function(e){localStorage.removeItem(BI.Cache._generateKey(e))},clear:function(){for(var e=localStorage.length;0<=e;e--){var t=localStorage.key(e);t&&0===t.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(t)}},keys:function(){for(var e=[],t=localStorage.length;0<=t;t--){var n,i=localStorage.key(t);i&&(n=BI.Cache._getKeyPrefix(),0===i.indexOf(n)&&(e[e.length]=i.substring(n.length)))}return e},addCookie:function(e,t,n,i){var r,a=e+"="+escape(t);i&&0<i&&((r=new Date).setTime(r.getTime()+3600*i*1e3),a=a+"; expires="+r.toUTCString()),n&&(a=a+"; path="+n),document.cookie=a},getCookie:function(e){var t,n=new RegExp("(^| )"+e+"=([^;]*)(;|$)");return(t=document.cookie.match(n))?unescape(t[2]):null},deleteCookie:function(e,t){var n=new Date;n.setTime(n.getTime()-1e4);var i=e+"=v; expires="+n.toUTCString();t&&(i=i+"; path="+t),document.cookie=i}}},function(e,t){BI.CellSizeAndPositionManager=function(e,t,n){this._cellSizeGetter=t,this._cellCount=e,this._estimatedCellSize=n,this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1},BI.CellSizeAndPositionManager.prototype={constructor:BI.CellSizeAndPositionManager,configure:function(e,t){this._cellCount=e,this._estimatedCellSize=t},getCellCount:function(){return this._cellCount},getEstimatedCellSize:function(){return this._estimatedCellSize},getLastMeasuredIndex:function(){return this._lastMeasuredIndex},getSizeAndPositionOfCell:function(e){if(!(e<0||e>=this._cellCount)){if(e>this._lastMeasuredIndex){for(var t=this.getSizeAndPositionOfLastMeasuredCell(),n=t.offset+t.size,i=this._lastMeasuredIndex+1;i<=e;i++){var r=this._cellSizeGetter(i);null==r||isNaN(r)||(this._cellSizeAndPositionData[i]={offset:n,size:r},n+=r)}this._lastMeasuredIndex=e}return this._cellSizeAndPositionData[e]}},getSizeAndPositionOfLastMeasuredCell:function(){return 0<=this._lastMeasuredIndex?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}},getTotalSize:function(){var e=this.getSizeAndPositionOfLastMeasuredCell();return e.offset+e.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize},getUpdatedOffsetForIndex:function(e,t,n,i){var r,a=this.getSizeAndPositionOfCell(i),o=a.offset,s=o-t+a.size;switch(e){case"start":r=o;break;case"end":r=s;break;case"center":r=o-(t-a.size)/2;break;default:r=Math.max(s,Math.min(o,n))}var l=this.getTotalSize();return Math.max(0,Math.min(l-t,r))},getVisibleCellRange:function(e,t){if(0===this.getTotalSize())return{};var n=t+e,i=this._findNearestCell(t),r=this.getSizeAndPositionOfCell(i);t=r.offset+r.size;for(var a=i;t<n&&a<this._cellCount-1;)a++,t+=this.getSizeAndPositionOfCell(a).size;return{start:i,stop:a}},resetCell:function(e){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,e-1)},_binarySearch:function(e,t,n){for(var i,r;t<=e;){if(i=t+Math.floor((e-t)/2),(r=this.getSizeAndPositionOfCell(i).offset)===n)return i;r<n?t=i+1:n<r&&(e=i-1)}if(0<t)return t-1},_exponentialSearch:function(e,t){for(var n=1;e<this._cellCount&&this.getSizeAndPositionOfCell(e).offset<t;)e+=n,n*=2;return this._binarySearch(Math.min(e,this._cellCount-1),Math.floor(e/2),t)},_findNearestCell:function(e){if(!isNaN(e)){e=Math.max(0,e);var t=this.getSizeAndPositionOfLastMeasuredCell(),n=Math.max(0,this._lastMeasuredIndex);return t.offset>=e?this._binarySearch(n,0,e):this._exponentialSearch(n,e)}}},BI.ScalingCellSizeAndPositionManager=function(e,t,n,i){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(e,t,n),this._maxScrollSize=i||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(e,t){var n=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize(),r=this._getOffsetPercentage(e,t,i);return Math.round(r*(i-n))},getSizeAndPositionOfCell:function(e){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(e)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(e,t,n,i){n=this._safeOffsetToOffset(t,n);var r=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(e,t,n,i);return this._offsetToSafeOffset(t,r)},getVisibleCellRange:function(e,t){return t=this._safeOffsetToOffset(e,t),this._cellSizeAndPositionManager.getVisibleCellRange(e,t)},resetCell:function(e){this._cellSizeAndPositionManager.resetCell(e)},_getOffsetPercentage:function(e,t,n){return n<=e?0:t/(n-e)},_offsetToSafeOffset:function(e,t){var n=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(n===i)return t;var r=this._getOffsetPercentage(e,t,n);return Math.round(r*(i-e))},_safeOffsetToOffset:function(e,t){var n=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(n===i)return t;var r=this._getOffsetPercentage(e,t,i);return Math.round(r*(n-e))}}},function(e,t){var l;l={19969:"DZ",19975:"WM",19988:"QJ",20048:"YL",20056:"SC",20060:"NM",20094:"QG",20127:"QJ",20167:"QC",20193:"YG",20250:"KH",20256:"ZC",20282:"SC",20285:"QJG",20291:"TD",20314:"YD",20315:"BF",20340:"NE",20375:"TD",20389:"YJ",20391:"CZ",20415:"PB",20446:"YS",20447:"SQ",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20985:"AW",21032:"PB",21048:"XQ",21049:"SC",21089:"YS",21119:"JC",21242:"SB",21273:"SC",21305:"YP",21306:"QO",21330:"ZC",21333:"SDC",21345:"QK",21378:"CA",21397:"SC",21414:"XS",21442:"SC",21477:"JG",21480:"TD",21484:"ZS",21494:"YX",21505:"YX",21512:"HG",21523:"XH",21537:"PB",21542:"PF",21549:"KH",21571:"E",21574:"DA",21588:"TD",21589:"O",21618:"ZC",21621:"KHA",21632:"ZJ",21654:"KG",21679:"LKG",21683:"KH",21710:"A",21719:"YH",21734:"WOE",21769:"A",21780:"WN",21804:"XH",21834:"A",21899:"ZD",21903:"RN",21908:"WO",21939:"ZC",21956:"SA",21964:"YA",21970:"TD",22003:"A",22031:"JG",22040:"XS",22060:"ZC",22066:"ZC",22079:"MH",22129:"XJ",22179:"XA",22237:"NJ",22244:"TD",22280:"JQ",22300:"YH",22313:"XW",22331:"YQ",22343:"YJ",22351:"PH",22395:"DC",22412:"TD",22484:"PB",22500:"PB",22534:"ZD",22549:"DH",22561:"PB",22612:"TD",22771:"KQ",22831:"HB",22841:"JG",22855:"QJ",22865:"XQ",23013:"ML",23081:"WM",23487:"SX",23558:"QJ",23561:"YW",23586:"YW",23614:"YW",23615:"SN",23631:"PB",23646:"ZS",23663:"ZT",23673:"YG",23762:"TD",23769:"ZS",23780:"QJ",23884:"QK",24055:"XH",24113:"DC",24162:"ZC",24191:"GA",24273:"QJ",24324:"NL",24377:"TD",24378:"QJ",24439:"PF",24554:"ZS",24683:"TD",24694:"WE",24733:"LK",24925:"TN",25094:"ZG",25100:"XQ",25103:"XH",25153:"PB",25170:"PB",25179:"KG",25203:"PB",25240:"ZS",25282:"FB",25303:"NA",25324:"KG",25341:"ZY",25373:"WZ",25375:"XJ",25384:"A",25457:"A",25528:"SD",25530:"SC",25552:"TD",25774:"ZC",25874:"ZC",26044:"YW",26080:"WM",26292:"PB",26333:"PB",26355:"ZY",26366:"CZ",26397:"ZC",26399:"QJ",26415:"ZS",26451:"SB",26526:"ZC",26552:"JG",26561:"TD",26588:"JG",26597:"CZ",26629:"ZS",26638:"YL",26646:"XQ",26653:"KG",26657:"XJ",26727:"HG",26894:"ZC",26937:"ZS",26946:"ZC",26999:"KJ",27099:"KJ",27449:"YQ",27481:"XS",27542:"ZS",27663:"ZS",27748:"TS",27784:"SC",27788:"ZD",27795:"TD",27812:"O",27850:"PB",27852:"MB",27895:"SL",27898:"PL",27973:"QJ",27981:"KH",27986:"HX",27994:"XJ",28044:"YC",28065:"WG",28177:"SM",28267:"QJ",28291:"KH",28337:"ZQ",28463:"TL",28548:"DC",28601:"TD",28689:"PB",28805:"JG",28820:"QG",28846:"PB",28952:"TD",28975:"ZC",29100:"A",29325:"QJ",29575:"SL",29602:"FB",30010:"TD",30044:"CX",30058:"PF",30091:"YSP",30111:"YN",30229:"XJ",30427:"SC",30465:"SX",30631:"YQ",30655:"QJ",30684:"QJG",30707:"SD",30729:"XH",30796:"LG",30917:"PB",31074:"NM",31085:"JZ",31109:"SC",31181:"ZC",31192:"MLB",31293:"JQ",31400:"YX",31584:"YJ",31896:"ZN",31909:"ZY",31995:"XJ",32321:"PF",32327:"ZY",32418:"HG",32420:"XQ",32421:"HG",32438:"LG",32473:"GJ",32488:"TD",32521:"QJ",32527:"PB",32562:"ZSQ",32564:"JZ",32735:"ZD",32793:"PB",33071:"PF",33098:"XL",33100:"YA",33152:"PB",33261:"CX",33324:"BP",33333:"TD",33406:"YA",33426:"WM",33432:"PB",33445:"JG",33486:"ZN",33493:"TS",33507:"QJ",33540:"QJ",33544:"ZC",33564:"XQ",33617:"YT",33632:"QJ",33636:"XH",33637:"YX",33694:"WG",33705:"PF",33728:"YW",33882:"SR",34067:"WM",34074:"YW",34121:"QJ",34255:"ZC",34259:"XL",34425:"JH",34430:"XH",34485:"KH",34503:"YS",34532:"HG",34552:"XS",34558:"YE",34593:"ZL",34660:"YQ",34892:"XH",34928:"SC",34999:"QJ",35048:"PB",35059:"SC",35098:"ZC",35203:"TQ",35265:"JX",35299:"JX",35782:"SZ",35828:"YS",35830:"E",35843:"TD",35895:"YG",35977:"MH",36158:"JG",36228:"QJ",36426:"XQ",36466:"DC",36710:"CJ",36711:"ZYG",36767:"PB",36866:"SK",36951:"YW",37034:"YX",37063:"XH",37218:"ZC",37325:"ZC",38063:"PB",38079:"TD",38085:"QY",38107:"DC",38116:"TD",38123:"YD",38224:"HG",38241:"XTC",38271:"ZC",38415:"YE",38426:"KH",38461:"YD",38463:"AE",38466:"PB",38477:"XJ",38518:"YT",38551:"WK",38585:"ZC",38704:"XS",38739:"LJ",38761:"GJ",38808:"SQ",39048:"JG",39049:"XJ",39052:"HG",39076:"CZ",39271:"XT",39534:"TD",39552:"TD",39584:"PB",39647:"SB",39730:"LG",39748:"TPB",40109:"ZQ",40479:"ND",40516:"HG",40536:"HG",40583:"QJ",40765:"YQ",40784:"QJ",40840:"YK",40863:"QJG"},_.extend(BI,{makeFirstPY:function(e,t){if(t=t||{},"string"!=typeof e)return""+e;for(var n,i,r=[],a=0,o=e.length;a<o;a++){var s=e.charAt(a);r.push((i=void 0,40869<(i=(n=s).charCodeAt(0))||i<19968?n:l[i]?l[i]:"YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGHGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY".charAt(i-19968)))}return function(e,t){for(var n=t.ignoreMulti,i=t.splitChar,r=[""],a=0,o=0,s=e.length;o<s;o++){var l=e[o],u=l.length;if(1==u||14<a||n)for(var c=l.substring(0,1),h=0;h<r.length;h++)r[h]+=c;else{var p=r.slice(0),r=[];for(a++,h=0;h<u;h++){for(var d=p.slice(0),f=0;f<d.length;f++)d[f]+=l.charAt(h);r=r.concat(d)}}}return r.join(i||"").toLowerCase()}(r,t)}})},function(e,t){function n(e,t){return e<t}BI.Heap=function(e,t){this._items=e||[],this._size=this._items.length,this._comparator=t||n,this._heapify()},BI.Heap.prototype={constructor:BI.Heap,empty:function(){return 0===this._size},pop:function(){if(0!==this._size){var e=this._items[0],t=this._items.pop();return this._size--,0<this._size&&(this._items[0]=t,this._sinkDown(0)),e}},push:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var e=Math.floor((this._size+1)/2);0<=e;e--)this._sinkDown(e)},_bubbleUp:function(e){for(var t=this._items[e];0<e;){var n=Math.floor((e+1)/2)-1,i=this._items[n];if(this._comparator(i,t))return;this._items[n]=t,this._items[e]=i,e=n}},_sinkDown:function(e){for(var t=this._items[e];;){var n,i,r=2*(e+1)-1,a=2*(e+1),o=-1;if(r<this._size&&(n=this._items[r],this._comparator(n,t)&&(o=r)),a<this._size&&(i=this._items[a],this._comparator(i,t)&&(-1!==o&&!this._comparator(i,this._items[o])||(o=a))),-1===o)return;this._items[e]=this._items[o],this._items[o]=t,e=o}}}},function(e,t){BI.LinkHashMap=function(){this.array=[],this.map={}},BI.LinkHashMap.prototype={constructor:BI.LinkHashMap,has:function(e){return e in this.map},add:function(e,t){void 0!==e&&(e in this.map||this.array.push(e),this.map[e]=t)},remove:function(e){if(e in this.map){delete this.map[e];for(var t=0;t<this.array.length;t++)if(this.array[t]==e){this.array.splice(t,1);break}}},size:function(){return this.array.length},each:function(e,t){t=t||window;if(null!=(e=e||null)&&"function"==typeof e)for(var n=0;n<this.array.length;n++){var i=this.array[n],r=this.map[i];if(0==e.call(t,i,r,n,this.array,this.map))break}},get:function(e){return this.map[e]},toArray:function(){var n=[];return this.each(function(e,t){n.push(t)}),n}}},function(e,t){!function(){BI.LRU=function(e){this.size=0,this.limit=e,this.head=this.tail=undefined,this._keymap={}};var e=BI.LRU.prototype;e.put=function(e,t){var n;this.size===this.limit&&(n=this.shift());var i=this.get(e,!0);return i||(i={key:e},this._keymap[e]=i,this.tail?(this.tail.newer=i).older=this.tail:this.head=i,this.tail=i,this.size++),i.value=t,n},e.shift=function(){var e=this.head;return e&&(this.head=this.head.newer,this.head.older=undefined,e.newer=e.older=undefined,this._keymap[e.key]=undefined,this.size--),e},e.get=function(e,t){var n=this._keymap[e];if(n!==undefined)return n===this.tail||(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=undefined,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n),t?n:n.value},e.has=function(e){return null!=this._keymap[e]}}()},function(e,t){var i,n;i=function(e){return Math.floor(e/2)},n=_global.Int32Array||function(e){for(var t=[],n=e-1;0<=n;--n)t[n]=0;return t},BI.PrefixIntervalTree=function(e){var t;for(this._size=e.length,this._half=function(e){for(var t=1;t<e;)t*=2;return t}(this._size),this._heap=new n(2*this._half),t=0;t<this._size;++t)this._heap[this._half+t]=e[t];for(t=this._half-1;0<t;--t)this._heap[t]=this._heap[2*t]+this._heap[2*t+1]},BI.PrefixIntervalTree.prototype={constructor:BI.PrefixIntervalTree,set:function(e,t){var n=this._half+e;for(this._heap[n]=t,n=i(n);0!==n;n=i(n))this._heap[n]=this._heap[2*n]+this._heap[2*n+1]},get:function(e){var t=this._half+e;return this._heap[t]},getSize:function(){return this._size},sumUntil:function(e){if(0===e)return 0;for(var t=this._half+e-1,n=this._heap[t];1!==t;t=i(t))t%2==1&&(n+=this._heap[t-1]);return n},sumTo:function(e){return this.sumUntil(e+1)},sum:function(e,t){return this.sumUntil(t)-this.sumUntil(e)},greatestLowerBound:function(e){if(e<0)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;t<this._half;){var n=this._heap[2*t];e<n?t*=2:(t=2*t+1,e-=n)}return t-this._half},greatestStrictLowerBound:function(e){if(e<=0)return-1;var t=1;if(this._heap[t]<e)return this._size;for(;t<this._half;){var n=this._heap[2*t];e<=n?t*=2:(t=2*t+1,e-=n)}return t-this._half},leastUpperBound:function(e){return this.greatestStrictLowerBound(e)+1},leastStrictUpperBound:function(e){return this.greatestLowerBound(e)+1}},BI.PrefixIntervalTree.uniform=function(e,t){for(var n=[],i=e-1;0<=i;--i)n[i]=t;return new BI.PrefixIntervalTree(n)},BI.PrefixIntervalTree.empty=function(e){return BI.PrefixIntervalTree.uniform(e,0)}},function(e,t){BI.Queue=function(e){this.capacity=e,this.array=[]},BI.Queue.prototype={constructor:BI.Queue,contains:function(e){return BI.contains(this.array,e)},indexOf:function(e){return BI.contains(this.array,e)},getElementByIndex:function(e){return this.array[e]},push:function(e){this.array.push(e),this.capacity&&this.array.length>this.capacity&&this.array.shift()},pop:function(){this.array.pop()},shift:function(){this.array.shift()},unshift:function(e){this.array.unshift(e),this.capacity&&this.array.length>this.capacity&&this.array.pop()},remove:function(e){BI.remove(this.array,e)},splice:function(){this.array.splice.apply(this.array,arguments)},slice:function(){this.array.slice.apply(this.array,arguments)},size:function(){return this.array.length},each:function(e,t){t=t||window;if(null!=(e=e||null)&&"function"==typeof e)for(var n=0;n<this.array.length;n++){if(0==e.call(t,n,this.array[n],this.array))break}},toArray:function(){return this.array},fromArray:function(e){var n=this;BI.each(e,function(e,t){n.push(t)})},clear:function(){this.array.length=0}}},function(e,t){!function(){var p=function(e,t,n,i){this.height=e,this.width=t,this.x=n,this.y=i,this._indexMap={},this._indices=[]};p.prototype={constructor:p,addCellIndex:function(e){this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))},getCellIndices:function(){return this._indices}};BI.SectionManager=function(e){this._sectionSize=e||100,this._cellMetadata=[],this._sections={}},BI.SectionManager.prototype={constructor:BI.SectionManager,getCellIndices:function(e,t,n,i){var r={};return BI.each(this.getSections(e,t,n,i),function(e,t){BI.each(t.getCellIndices(),function(e,t){r[t]=t})}),BI.map(BI.keys(r),function(e,t){return r[t]})},getCellMetadata:function(e){return this._cellMetadata[e]},getSections:function(e,t,n,i){for(var r=Math.floor(n/this._sectionSize),a=Math.floor((n+t-1)/this._sectionSize),o=Math.floor(i/this._sectionSize),s=Math.floor((i+e-1)/this._sectionSize),l=[],u=r;u<=a;u++)for(var c=o;c<=s;c++){var h=u+"."+c;this._sections[h]||(this._sections[h]=new p(this._sectionSize,this._sectionSize,u*this._sectionSize,c*this._sectionSize)),l.push(this._sections[h])}return l},getTotalSectionCount:function(){return BI.size(this._sections)},registerCell:function(e,n){this._cellMetadata[n]=e,BI.each(this.getSections(e.height,e.width,e.x,e.y),function(e,t){t.addCellIndex(n)})}}}()},function(e,t){BI.Tree=function(){this.root=new BI.Node(BI.UUID())},BI.Tree.prototype={constructor:BI.Tree,addNode:function(e,t,n){BI.isNull(t)?this.root.addChild(e,n):BI.isNull(e)?this.root.addChild(t,n):e.addChild(t,n)},isRoot:function(e){return e===this.root},getRoot:function(){return this.root},clear:function(){this.root.clear()},initTree:function(e){var i=this;this.clear();var r=[];for(BI.each(e,function(e,t){var n=new BI.Node(t);n.set("data",t),i.addNode(n),r.push(n)});!BI.isEmpty(r);){var a=r.shift(),t=a.get("data");BI.each(t.children,function(e,t){var n=new BI.Node(t);n.set("data",t),r.push(n),i.addNode(a,n)})}},_toJSON:function(e){var n=this,i=[];return BI.each(e.getChildren(),function(e,t){i.push(n._toJSON(t))}),BI.extend({id:e.id},BI.deepClone(e.get("data")),0<i.length?{children:i}:{})},toJSON:function(e){var n=this,i=[];return BI.each((e||this.root).getChildren(),function(e,t){i.push(n._toJSON(t))}),i},_toJSONWithNode:function(e){var n=this,i=[];return BI.each(e.getChildren(),function(e,t){i.push(n._toJSONWithNode(t))}),BI.extend({id:e.id},BI.deepClone(e.get("data")),{node:e},0<i.length?{children:i}:{})},toJSONWithNode:function(e){var n=this,i=[];return BI.each((e||this.root).getChildren(),function(e,t){i.push(n._toJSONWithNode(t))}),i},search:function(e,n,i){if(!(e instanceof BI.Node))return arguments.callee.apply(this,[this.root,e,n]);var r=this,a=null;return BI.isNull(n)?null:BI.isEqual(e[i||"id"],n)?e:(BI.any(e.getChildren(),function(e,t){if(null!==(a=r.search(t,n,i)))return!0}),a)},_traverse:function(e,t){var n=[];for(n.push(e);!BI.isEmpty(n);){var i=n.shift(),r=t&&t(i);if(!1===r)break;!0!==r&&null!=i&&(n=n.concat(i.getChildren()))}},traverse:function(e){this._traverse(this.root,e)},_recursion:function(e,r,a){var o=this;return BI.every(e.getChildren(),function(e,t){var n=BI.clone(r);n.push(t.id);var i=a&&a(t,n);return!1!==i&&(!0===i||o._recursion(t,n,a))})},recursion:function(e){this._recursion(this.root,[],e)},inOrderTraverse:function(e){this._inOrderTraverse(this.root,e)},_inOrderTraverse:function(e,t){null!=e&&(this._inOrderTraverse(e.getLeft()),t&&t(e),this._inOrderTraverse(e.getRight()))},nrInOrderTraverse:function(e){for(var t=[],n=this.root;null!=n||!BI.isEmpty(t);){for(;null!=n;)t.push(n),n=n.getLeft();n=t.pop(),e&&e(n),n=n.getRight()}},preOrderTraverse:function(e){this._preOrderTraverse(this.root,e)},_preOrderTraverse:function(e,t){null!=e&&(t&&t(e),this._preOrderTraverse(e.getLeft()),this._preOrderTraverse(e.getRight()))},nrPreOrderTraverse:function(e){for(var t=[],n=this.root;null!=n||!BI.isEmpty(t);){for(;null!=n;)e&&e(n),t.push(n),n=n.getLeft();n=(n=t.pop()).getRight()}},postOrderTraverse:function(e){this._postOrderTraverse(this.root,e)},_postOrderTraverse:function(e,t){null!=e&&(this._postOrderTraverse(e.getLeft()),this._postOrderTraverse(e.getRight()),t&&t(e))},nrPostOrderTraverse:function(e){for(var t=[],n=this.root,i=null;null!=n||!BI.isEmpty(t);){for(;null!=n;)t.push(n),n=n.getLeft();n=null==(n=BI.last(t)).getRight()||n.getRight()==i?(e&&e(n),i=n=t.pop(),null):n.getRight()}}},BI.Node=function(e){BI.isObject(e)?BI.extend(this,e):this.id=e,this.clear.apply(this,arguments)},BI.Node.prototype={constructor:BI.Node,set:function(e,t){BI.isObject(e)?BI.extend(this,e):this[e]=t},get:function(e){return this[e]},isLeaf:function(){return BI.isEmpty(this.children)},getChildren:function(){return this.children},getChildrenLength:function(){return this.children.length},getFirstChild:function(){return BI.first(this.children)},getLastChild:function(){return BI.last(this.children)},setLeft:function(e){this.left=e},getLeft:function(){return this.left},setRight:function(e){this.right=e},getRight:function(){return this.right},setParent:function(e){this.parent=e},getParent:function(){return this.parent},getChild:function(e){return this.children[e]},getChildIndex:function(n){return BI.findIndex(this.children,function(e,t){return t.get("id")===n})},removeChild:function(e){this.removeChildByIndex(this.getChildIndex(e))},removeChildByIndex:function(e){var t=this.getChild(e-1),n=this.getChild(e+1);null!=t&&t.setRight(n||null),null!=n&&n.setLeft(t||null),this.children.splice(e,1)},removeAllChilds:function(){this.children=[]},addChild:function(e,t){var n=null,n=BI.isUndefined(t)?this.children.length-1:t-1;e.setParent(this),0<=n&&(this.getChild(n)&&this.getChild(n).setRight(e),e.setLeft(this.getChild(n))),BI.isUndefined(t)?this.children.push(e):this.children.splice(t,0,e)},equals:function(e){return this===e||this.id===e.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(e,t){if(!e)return[];var n=[];if(BI.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=BI.clone(e[i]);a.pId=null==a.pId?t:a.pId,delete a.children,n.push(a),e[i].children&&(n=n.concat(BI.Tree.transformToArrayFormat(e[i].children,a.id)))}else{var o=BI.clone(e);o.pId=null==o.pId?t:o.pId,delete o.children,n.push(o),e.children&&(n=n.concat(BI.Tree.transformToArrayFormat(e.children,o.id)))}return n},arrayFormat:function(e,t){if(!e)return[];var n=[];if(BI.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];a.pId=null==a.pId?t:a.pId,n.push(a),e[i].children&&(n=n.concat(BI.Tree.arrayFormat(e[i].children,a.id)))}else{var o=e;o.pId=null==o.pId?t:o.pId,n.push(o),e.children&&(n=n.concat(BI.Tree.arrayFormat(e.children,o.id)))}return n},transformToTreeFormat:function(e){if(!e)return[];if(BI.isArray(e)){for(var t=[],n={},i=0,r=e.length;i<r;i++){if(BI.isNull(e[i].id))return e;n[e[i].id]=BI.clone(e[i])}for(i=0,r=e.length;i<r;i++)n[e[i].pId]&&e[i].id!==e[i].pId?(n[e[i].pId].children||(n[e[i].pId].children=[]),n[e[i].pId].children.push(n[e[i].id])):t.push(n[e[i].id]),delete n[e[i].id].pId;return t}return[e]},treeFormat:function(e){if(!e)return[];if(BI.isArray(e)){for(var t=[],n={},i=0,r=e.length;i<r;i++){if(BI.isNull(e[i].id))return e;n[e[i].id]=e[i]}for(i=0,r=e.length;i<r;i++)n[e[i].pId]&&e[i].id!==e[i].pId?(n[e[i].pId].children||(n[e[i].pId].children=[]),n[e[i].pId].children.push(n[e[i].id])):t.push(n[e[i].id]);return t}return[e]},traversal:function(e,n){var i;BI.isNull(e)||(i=this,BI.some(e,function(e,t){return!1===n(e,t)||void i.traversal(t.children,n)}))}})},function(e,t){BI.Vector=function(e,t){this.x=e,this.y=t},BI.Vector.prototype={constructor:BI.Vector,cross:function(e){return this.x*e.y-this.y*e.x},length:function(e){return Math.sqrt(this.x*e.x+this.y*e.y)}},BI.Region=function(e,t,n,i){this.x=e,this.y=t,this.w=n,this.h=i},BI.Region.prototype={constructor:BI.Region,isIntersects:function(e){if(this.isPointInside(e.x,e.y)||this.isPointInside(e.x+e.w,e.y)||this.isPointInside(e.x,e.y+e.h)||this.isPointInside(e.x+e.w,e.y+e.h))return!0;if(e.isPointInside(this.x,this.y)||e.isPointInside(this.x+this.w,this.y)||e.isPointInside(this.x,this.y+this.h)||e.isPointInside(this.x+this.w,this.y+this.h))return!0;if(null!=e.x&&null!=e.y){var t=new BI.Vector(this.w,this.h),n=new BI.Vector(e.x-this.x,e.y-this.y),i=new BI.Vector(n.x+e.w,n.y+e.h);if(t.cross(n)*t.cross(i)<0)return!0}return!1},isPointInside:function(e,t){return null!=this.x&&null!=this.y&&(e>=this.x&&e<=this.x+this.w&&t>=this.y&&t<=this.y+this.h)},getPosition:function(){var e=[];return e.push(this.x+this.w/2),e.push(this.y+this.h/2),e}}},function(module,exports,__webpack_require__){(function(global){!function(){var _global;function isEmpty(e){return""===e||null===e||e===undefined}function isInvalidDate(e){return"Invalid Date"==e||"NaN"==e}function _eFormat(e,t){return function(e,t){var n=e<0?(e*=-1,"-"):"",i="",r=Math[0<e&&e<1?"floor":"ceil"](Math.log(e)/Math.log(10));if(!isFinite(r))return t.replace(/#/gi,"").replace(/\.e/gi,"E");0<(e/=Math.pow(10,r))&&e<1&&(e*=10,--r);var a=function(e,t){if(!/e/gi.test(t))return 0;var n,i,r=t.split(/e/gi)[0].split(".")[0],a=r.length,o=0;for(n=0;n<a;n++)(0==(i=r.charAt(n))||"#"==i&&a-n<=e+1)&&o++;return o}(r,t);1<a&&(r-=a-1,e*=Math.pow(10,a-1)),r<0&&(i="-",r*=-1);var o=function(e){if(!/e/gi.test(e))return 0;var t=e.split(/e/gi)[0].split(".");return 1<t.length?t[1].length:0}(t),s=function(e){var t=Math.round(e);return e=(e+"").split(".")[0],t=(t+"").split(".")[0],e.length!==t.length}(e);return e*=Math.pow(10,o),e=Math.round(e),s&&(e/=10,r+="-"===i?-1:1),e=(e/=Math.pow(10,o)).toFixed(o),r=function(e,t,n){if(t+="",!/e/gi.test(e))return t;e=e.split(/e/gi)[1];for(;t.length<e.length;)t="0"+t;for(var i=!0,r=0,a=t.length;r<a;r++)i=i&&"0"===t.charAt(r);return(n=i?"":n)+t}(t,r,i),n+e+"E"+r}(e=+e,t)}function _dealNumberPrecision(e,t){if(/[eE]/.test(e)){var n,i=0,r=0;/[%‰]$/.test(t)&&(i=/[%]$/.test(t)?2:3);for(var a=t.length;r<a;r++)"0"!=(n=t.charAt(r))&&"#"!=n||i++;return Number(e).toFixed(i)}return e}function _numberFormat(e,t){if(!/[0-9]/.test(e=e+"")||!t)return e;var n=t.indexOf(";");if(-1<n)return 0<=e?_numberFormat(e+"",t.substring(0,n)):_numberFormat(-e+"",t.substr(n+1));if(+e<0&&"-"!==t.charAt(0))return _numberFormat(-e+"","-"+t);var i,r=t.split("."),a=r[0]||"",o=r[1]||"",s=(e=_dealNumberPrecision(e,o)).split("."),l=s[0]||"",u=s[1]||"";/[%‰]$/.test(t)&&(l=(l+=(u+=i=/[%]$/.test(t)?"00":"000").substr(0,i.length)).replace(/^0+/gi,""),u=u.substr(i.length).replace(/0+$/gi,""));var c=_dealWithRight(u,o);c.leftPlus&&(l=parseInt(l)+1+"",l=isNaN(l)?"1":l),c=c.num;var h=_dealWithLeft(l,a);return/[0-9]/.test(h)||(h+="0"),/[0-9]/.test(c)?h+"."+c:h+c}function _dealWithRight(e,t){for(var n="",i=0,r=0,a=t.length;r<a;r++){var o=t.charAt(r),s=e.charAt(i);switch(o){case"0":isEmpty(s)&&(s="0"),n+=s,i++;break;case"#":n+=s,i++;break;default:n+=o}}var l,u,c,h,p=e.substr(i),d={};return!isEmpty(p)&&4<p.charAt(0)&&(d.leftPlus=!0,(l=n.match(/^[0-9]+/))&&(c=(u=l[0]).length,(h=parseInt(u)+1+"").length>c?h=h.substr(1):(h=BI.leftPad(h,c,"0"),d.leftPlus=!1),n=n.replace(/^[0-9]+/,h))),d.num=n,d}function _dealWithLeft(e,t){for(var n,i="",r=e.length-1,a=-1,o=-1,s=t.length-1;0<=s;s--){var l,u=t.charAt(s),c=e.charAt(r);switch(u){case"0":isEmpty(c)&&(c="0"),o=-1,i=c+i,r--;break;case"#":o=s,i=c+i,r--;break;case",":isEmpty(c)||((l=t.match(/,[#0]+/))&&(a=l[0].length-1),i=","+i);break;default:i=u+i}}if(-1<o&&(n=e.substr(0,r+1),i=i.substr(0,o)+n+i.substr(o)),0<a){var h=i.match(/[0-9]+,/);if(h){for(var p="",d=(h=h[0]).length-1-a;0<=d;d-=a)p=h.substr(d,a)+","+p;var f=h.substr(0,d+a);isEmpty(f)||(p=f+","+p)}i=i.replace(/[0-9]+,/,p)}return i}_global="undefined"!=typeof window?window:void 0!==global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),BI.cjkEncode=function(e){if("string"!=typeof e)return e;for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);t+=128<=i||91===i||93===i?"["+i.toString(16)+"]":e.charAt(n)}return t},BI.cjkDecode=function(text){if(null==text)return"";if(!isNaN(text)||-1==text.indexOf("["))return text;for(var newText="",i=0;i<text.length;i++){var ch=text.charAt(i),rightIdx,subText;"["==ch&&(rightIdx=text.indexOf("]",i+1),i+1<rightIdx&&(subText=text.substring(i+1,rightIdx),0<subText.length&&(ch=String.fromCharCode(eval("0x"+subText))),i=rightIdx)),newText+=ch}return newText};var SPECIAL_TAGS={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};BI.htmlEncode=function(e){return BI.isNull(e)?"":BI.replaceAll(e+"",'&|"|<|>',function(e){return SPECIAL_TAGS[e]?SPECIAL_TAGS[e]:"&nbsp;"})},BI.htmlDecode=function(e){return BI.isNull(e)?"":BI.replaceAll(e+"","&amp;|&quot;|&lt;|&gt;|&nbsp;",function(e){switch(e){case"&amp;":return"&";case"&quot;":return'"';case"&lt;":return"<";case"&gt;":return">";case"&nbsp;":default:return" "}})},BI.cjkEncodeDO=function(e){if(BI.isPlainObject(e)){var n={};return _.each(e,function(e,t){"string"!=typeof e&&(e=BI.jsonEncode(e)),t=BI.cjkEncode(t),n[t]=BI.cjkEncode(e)}),n}return e},BI.jsonEncode=function(e){var t,n=!!{}.hasOwnProperty,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(null==e)return"null";if(BI.isArray(e))return function(e){for(var t,n,i=["["],r=e.length,a=0;a<r;a+=1)switch(typeof(n=e[a])){case"undefined":case"function":case"unknown":break;default:t&&i.push(","),i.push(null===n?"null":BI.jsonEncode(n)),t=!0}return i.push("]"),i.join("")}(e);if(e instanceof Date)return BI.jsonEncode({__time__:e.getTime()});if("string"==typeof e)return/["\\\x00-\x1f]/.test(t=e)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(e,t){var n=i[t];return n||(n=t.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+t+'"';if("number"==typeof e)return isFinite(e)?String(e):"null";if("boolean"==typeof e)return String(e);if(BI.isFunction(e))return String(e);var r,a,o,s=["{"];for(a in e)if(!n||e.hasOwnProperty(a))switch(typeof(o=e[a])){case"undefined":case"unknown":break;default:r&&s.push(","),s.push(BI.jsonEncode(a),":",null===o?"null":BI.jsonEncode(o)),r=!0}return s.push("}"),s.join("")},BI.jsonDecode=function(e){try{var t=BI.$?BI.$.parseJSON(e):_global.JSON.parse(e);null==t&&(t={})}catch(i){try{t=new Function("return "+e)()||{}}catch(i){}null==t&&(t=[])}if(!(n=e)||"string"!=typeof n||-1==n.indexOf("__time__"))return t;var n;return function(e){if("string"==typeof e)return e;if(e&&null!=e.__time__)return new Date(e.__time__);for(var t in e){if(e[t]==e||"object"==typeof e[t]||_.isFunction(e[t]))break;e[t]=arguments.callee(e[t])}return e}(t)},BI.getEncodeURL=function(e,n){return BI.replaceAll(e,"\\{(.*?)\\}",function(e,t){return BI.encodeURIComponent(BI.isObject(n)?n[t]:n)})},BI.encodeURIComponent=function(e){return BI.specialCharsMap=BI.specialCharsMap||{},e=e||"",e=BI.replaceAll(e+"",BI.keys(BI.specialCharsMap||[]).join("|"),function(e){switch(e){case"\\":return BI.specialCharsMap["\\\\"]||e;default:return BI.specialCharsMap[e]||e}}),_global.encodeURIComponent(e)},BI.decodeURIComponent=function(e){var n={};return BI.each(BI.specialCharsMap,function(e,t){n[t]="\\\\"===e?"\\":e}),e=e||"",e=BI.replaceAll(e+"",BI.keys(n||[]).join("|"),function(e){return n[e]||e}),_global.decodeURIComponent(e)},BI.contentFormat=function(e,t){if(isEmpty(e))return"";var n,i=e.toString();return isEmpty(t)||t.match(/^T/)?i:(t.match(/^D/)?(e instanceof Date||(e="number"==typeof e?new Date(e):new Date(Date.parse((""+e).replace(/-|\./g,"/")))),isInvalidDate(e)||BI.isNull(e)||(n=t.match(/^DT/),i=BI.date2Str(e,t.substring(n?2:1)))):i=(t.match(/E/)?_eFormat:_numberFormat)(i,t),i=i.replace(/¤/g,"¥"))},BI.parseFmt=function(e){return e?(e=String(e).replace(/y{4,}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4,}/g,"%b").replace(/M{3}/g,"%B").replace(/M{2}/g,"%X").replace(/M{1}/g,"%x").replace(/a{1}/g,"%p"),e=new RegExp("d{2,}","g").test(e)?e.replace(/d{2,}/g,"%d"):e.replace(/d{1}/g,"%e"),e=new RegExp("h{2,}","g").test(e)?e.replace(/h{2,}/g,"%I"):e.replace(/h{1}/g,"%I"),e=(e=new RegExp("H{2,}","g").test(e)?e.replace(/H{2,}/g,"%H"):e.replace(/H{1}/g,"%H")).replace(/m{2,}/g,"%M").replace(/s{2,}/g,"%S")):""},BI.str2Date=function(e,t){if("string"!=typeof e||"string"!=typeof t)return null;var n=BI.parseFmt(t);return BI.parseDateTime(e,n)},BI.date2Str=function(e,t){if(!e)return"";var n=t.length,i="";if(0<n){for(var r=t.charAt(0),a=0,o=r,s=1;s<n;s++){var l=t.charAt(s);r!==l?(i+=u({"char":r,str:o,len:s-a},e),a=s,o=r=l):o+=l}i+=u({"char":r,str:o,len:n-a},e)}return i;function u(e,t){var n=e.str,i=e.len;switch(e["char"]){case"E":n=BI.Date._DN[t.getDay()];break;case"y":n=i<=3?(t.getFullYear()+"").slice(2,4):t.getFullYear();break;case"M":n=2<i?BI.Date._MN[t.getMonth()]:i<2?t.getMonth()+1:BI.leftPad(t.getMonth()+1+"",2,"0");break;case"d":n=1<i?BI.leftPad(t.getDate()+"",2,"0"):t.getDate();break;case"h":var r=t.getHours()%12;0===r&&(r=12),n=1<i?BI.leftPad(r+"",2,"0"):r;break;case"H":n=1<i?BI.leftPad(t.getHours()+"",2,"0"):t.getHours();break;case"m":n=1<i?BI.leftPad(t.getMinutes()+"",2,"0"):t.getMinutes();break;case"s":n=1<i?BI.leftPad(t.getSeconds()+"",2,"0"):t.getSeconds();break;case"a":n=t.getHours()<12?"am":"pm";break;case"z":n=BI.getTimezone(t);break;default:n=e.str}return n}},BI.object2Number=function(e){if(null==e)return 0;if("number"==typeof e)return e;var t=e+"";return(-1===t.indexOf(".")?parseInt:parseFloat)(t)},BI.object2Date=function(e){if(null==e)return new Date;if(e instanceof Date)return e;if("number"==typeof e)return new Date(e);var t=(t=e+"").replace(/-/g,"/"),n=new Date(t);return isInvalidDate(n)?new Date:n},BI.object2Time=function(e){if(null==e)return new Date;if(e instanceof Date)return e;var t=(t=e+"").replace(/-/g,"/"),n=new Date(t);return isInvalidDate(n)&&(-1!==t.indexOf("/")||-1===t.indexOf(":")||isInvalidDate(n=new Date("1970/01/01 "+t)))&&isInvalidDate(n=BI.parseDateTime(t,"HH:mm:ss"))?new Date:n}}()}).call(this,__webpack_require__(13))},function(e,t){_.extend(BI,{pushArray:function(e,t){for(var n=0;n<t.length;n++)e.push(t[n])},pushDistinct:function(e,t){BI.contains(e,t)||e.push(t)},pushDistinctArray:function(e,t){for(var n=0,i=t.length;n<i;n++)BI.pushDistinct(e,t[n])}})},function(e,t){BI.Date=BI.Date||{},BI.Date.SECOND=1e3,BI.Date.MINUTE=60*BI.Date.SECOND,BI.Date.HOUR=60*BI.Date.MINUTE,BI.Date.DAY=24*BI.Date.HOUR,BI.Date.WEEK=7*BI.Date.DAY,_.extend(BI,{getTimezone:function(e){return e.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getMonthDays:function(e,t){var n=e.getFullYear();return void 0===t&&(t=e.getMonth()),0!=n%4||0==n%100&&0!=n%400||1!=t?BI.Date._MD[t]:29},getLastDateOfMonth:function(e){return BI.getDate(e.getFullYear(),e.getMonth(),BI.getMonthDays(e))},getDayOfYear:function(e){var t=BI.getDate(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0)-BI.getDate(e.getFullYear(),0,0,0,0,0);return Math.floor(t/BI.Date.DAY)},getWeekNumber:function(e){var t=BI.getDate(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),n=t.getDay(),i=BI.StartOfWeek%7,r=(3+i)%7,a=n<i?7+n-i:n-i,o=(r=r||7)<i?7+r-i:r-i;t.setDate(t.getDate()-a+o);var s=t.valueOf();return t.setMonth(0),t.setDate(1),Math.floor((s-t.valueOf())/6048e5)+1},getQuarter:function(e){return Math.floor(e.getMonth()/3)+1},getOffsetDate:function(e,t){return BI.getDate(BI.getTime(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())+864e5*t)},getOffsetQuarter:function(e,t){var n=BI.getDate(BI.getTime(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())),i=n.getDate(),r=BI.getMonthDays(BI.getDate(n.getFullYear(),n.getMonth()+3*BI.parseInt(t),1));return r<i&&(i=r),n.setDate(i),n.setMonth(n.getMonth()+3*parseInt(t)),n},getQuarterStartMonth:function(e){var t=0,n=e.getMonth();return n<3&&(t=0),2<n&&n<6&&(t=3),5<n&&n<9&&(t=6),8<n&&(t=9),t},getQuarterStartDate:function(e){return BI.getDate(e.getFullYear(),BI.getQuarterStartMonth(e),1)},getQuarterEndDate:function(e){var t=BI.getQuarterStartMonth(e)+2;return BI.getDate(e.getFullYear(),t,BI.getMonthDays(e,t))},getOffsetMonth:function(e,t){var n=BI.getDate(BI.getTime(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())),i=n.getDate(),r=BI.getMonthDays(BI.getDate(n.getFullYear(),n.getMonth()+parseInt(t),1));return r<i&&(i=r),n.setDate(i),n.setMonth(n.getMonth()+parseInt(t)),n},getWeekStartDate:function(e){var t=e.getDay(),n=BI.StartOfWeek%7;return BI.getOffsetDate(e,BI.Date._OFFSET[t<n?7+t-n:t-n])},getWeekEndDate:function(e){var t=e.getDay(),n=BI.StartOfWeek%7;return BI.getOffsetDate(e,BI.Date._OFFSET[t<n?7+t-n:t-n]+6)},print:function(e,t){for(var n=e.getMonth(),i=e.getDate(),r=e.getFullYear(),a=r+"";a.length<4;)a="0"+a;var o=BI.getWeekNumber(e),s=BI.getQuarter(e),l=e.getDay(),u={},c=e.getHours(),h=12<=c,p=h?c-12:c,d=BI.getDayOfYear(e);0==p&&(p=12);var f=e.getMinutes(),g=e.getSeconds();u["%a"]=BI.Date._SDN[l],u["%A"]=BI.Date._DN[l],u["%b"]=BI.Date._SMN[n],u["%B"]=BI.Date._MN[n],u["%C"]=1+Math.floor(r/100),u["%d"]=i<10?"0"+i:i,u["%e"]=i,u["%H"]=c<10?"0"+c:c,u["%I"]=p<10?"0"+p:p,u["%j"]=d<100?d<10?"00"+d:"0"+d:d,u["%k"]=c+"",u["%l"]=p+"",u["%X"]=n<9?"0"+(1+n):1+n,u["%x"]=n+1,u["%M"]=f<10?"0"+f:f,u["%n"]="\n",u["%p"]=h?"PM":"AM",u["%P"]=h?"pm":"am",u["%s"]=Math.floor(e.getTime()/1e3),u["%S"]=g<10?"0"+g:g,u["%t"]="\t",u["%U"]=u["%W"]=u["%V"]=o<10?"0"+o:o,u["%u"]=l+1,u["%w"]=l,u["%y"]=a.substr(2,2),u["%Y"]=a,u["%%"]="%",u["%Q"]=s;var m=/%./g;if(BI.isKhtml=BI.isKhtml||function(){return!!_global.navigator&&/Konqueror|Safari|KHTML/i.test(navigator.userAgent)},!(-1===t.indexOf("%Y")&&-1===t.indexOf("%y")||-1===t.indexOf("%W")&&-1===t.indexOf("%U")&&-1===t.indexOf("%V")))switch(o){case 1:11===n&&(u["%y"]=parseInt(u["%y"])+1,u["%Y"]=parseInt(u["%Y"])+1);break;case 53:0===n&&(u["%y"]=parseInt(u["%y"])-1,u["%Y"]=parseInt(u["%Y"])-1)}if(!BI.isKhtml())return t.replace(m,function(e){return u[e]||e});for(var I=t.match(m),B=0;B<I.length;B++){var _=u[I[B]];_&&(m=new RegExp(I[B],"g"),t=t.replace(m,_))}return t}})},function(e,t){BI.Func={},_.extend(BI.Func,{createDistinctName:function(e,n){var t=n,i=1;for(n=n||"";!BI.every(e,function(e,t){return BI.isKey(t)?t!==n:t.name!==n});)n=t+i++;return n},getGBWidth:function(e){return e=(e+="").replace(/[^\x00-\xff]/g,"xx"),Math.ceil(e.length/2)},getSearchResult:function(e,n,i){var r,a,o,s=BI.isArray(e);if(e=s?BI.flatten(e):e,i=i||"text",!BI.isKey(n))return{find:BI.deepClone(e),match:s?[]:{}};n=BI.toUpperCase(n);var l=s?[]:{},u=s?[]:{};return BI.each(e,function(e,t){BI.isNull(t)||(t=BI.deepClone(t),r=BI.stripEL(t),a=BI.find([r[i],r.text,r.value,r.name,r],function(e,t){return BI.isNotNull(t)}),BI.isNull(a)||BI.isObject(a)||(o=BI.makeFirstPY(a,{splitChar:""}),a=BI.toUpperCase(a),o=BI.toUpperCase(o),-1<a.indexOf(n)?a===n?s?l.push(t):l[e]=t:s?u.push(t):u[e]=t:-1<o.indexOf(n)&&(a===n||n.length===a.length?s?l.push(t):l[e]=t:s?u.push(t):u[e]=t)))}),{match:l,find:u}}}),_.extend(BI,{beforeFunc:function(e,t){var n=e;return function(){return!1!==t.apply(e,arguments)&&n.apply(e,arguments)}},afterFunc:function(t,n){var i=t;return function(){var e=i.apply(t,arguments);return!1!==e&&(n.apply(t,arguments),e)}}})},function(e,t){_.extend(BI,{add:function(e,t){return function(e,t){var n,i,r,a;try{n=e.toString().split(".")[1].length}catch(s){n=0}try{i=t.toString().split(".")[1].length}catch(s){i=0}{var o;a=Math.abs(n-i),r=Math.pow(10,Math.max(n,i)),t=0<a?(o=Math.pow(10,a),i<n?(e=Number(e.toString().replace(".","")),Number(t.toString().replace(".",""))*o):(e=Number(e.toString().replace(".",""))*o,Number(t.toString().replace(".","")))):(e=Number(e.toString().replace(".","")),Number(t.toString().replace(".","")))}return(e+t)/r}(t,e)},sub:function(e,t){var n,i,r;try{n=e.toString().split(".")[1].length}catch(a){n=0}try{i=t.toString().split(".")[1].length}catch(a){i=0}return r=Math.pow(10,Math.max(n,i)),((e*r-t*r)/r).toFixed(i<=n?n:i)},mul:function(e,t){return function(e,t){var n=0,i=e.toString(),r=t.toString();try{n+=i.split(".")[1].length}catch(a){}try{n+=r.split(".")[1].length}catch(a){}return Number(i.replace(".",""))*Number(r.replace(".",""))/Math.pow(10,n)}(t,e)},div:function(e,t){return r(e,t);function s(e){var t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-(t[1]||0);return 0<n?n:0}function l(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=s(e);return 0<t?e*Math.pow(10,t):e}function u(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(0<n.length)return u.apply(void 0,[u(e,t),n[0]].concat(n.slice(1)));var r=l(e),a=l(t),o=s(e)+s(t);return r*a/Math.pow(10,o)}function r(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return 0<n.length?r.apply(void 0,[r(e,t),n[0]].concat(n.slice(1))):u(l(e)/l(t),Math.pow(10,s(t)-s(e)))}}})},function(e,t){_.extend(BI,{startWith:function(e,t){return e=e||"",!(null==t||""==t||0===e.length||t.length>e.length)&&e.substr(0,t.length)==t},endWith:function(e,t){return!(null==t||""==t||0===e.length||t.length>e.length)&&e.substring(e.length-t.length)==t},getQuery:function(e,t){var n=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),i=e.substr(e.indexOf("?")+1).match(n);return i?unescape(i[2]):null},appendQuery:function(e,t){if(!t)return e;var n=e;return-1===n.indexOf("?")&&(n+="?"),!1!==BI.endWith(n,"?")||(n+="&"),_.each(t,function(e,t){"string"==typeof t&&(n+=t+"="+e+"&")}),n=n.substr(0,n.length-1)},replaceAll:function(e,t,n){return BI.isString(e)?e.replace(new RegExp(t,"gm"),n):e},perfectStart:function(e,t){return BI.startWith(e,t)?e:t+e},allIndexOf:function(e,t){if("string"!=typeof t)return[];for(var n=[],i=0;0<e.length;){var r=e.indexOf(t);if(-1===r)break;n.push(i+r),e=e.substring(r+t.length,e.length),i+=r+t.length}return n}})},function(e,t){var o;o={},_.extend(BI,{addI18n:function(e){BI.extend(o,e)},i18nText:function(e){a=(a=o[e]||BI.i18n&&BI.i18n[e]||"")||e;var t=arguments.length;if(1<t){if(!(-1<a.indexOf("{R1}"))){var n=Array.prototype.slice.call(arguments),i=1;return BI.replaceAll(a,"\\{\\s*\\}",function(){return n[i++]+""})}for(var r=1;r<t;r++)var e="{R"+r+"}",a=BI.replaceAll(a,e,arguments[r]+"")}return a}})},function(e,t){!function(){var n={};BI.module=function(e,t){null!=n[e]&&_global.console&&console.error("module:["+e+"] has been registed"),n[e]=t};var i={};BI.constant=function(e,t){null!=i[e]&&_global.console&&console.error("constant:["+e+"] has been registed"),i[e]=t};var r={};BI.model=function(e,t){null!=r[e]&&_global.console&&console.error("model:["+e+"] has been registed"),r[e]=t};var a={};BI.store=function(e,t){null!=a[e]&&_global.console&&console.error("store:["+e+"] has been registed"),a[e]=t};var o={};BI.service=function(e,t){null!=o[e]&&_global.console&&console.error("service:["+e+"] has been registed"),o[e]=t};var s={};BI.provider=function(e,t){null!=s[e]&&_global.console&&console.error("provider:["+e+"] has been registed"),s[e]=t};var l={};BI.config=function(n,e){if(BI.initialized)return i[n]?i[n]=e(i[n]):s[n]?(g[n]||(g[n]=new s[n]),m[n]&&delete m[n],e(g[n])):BI.Plugin.configWidget(n,e);l[n]||(l[n]=[],BI.prepares.push(function(){for(var e=l[n],t=0;t<e.length;t++)i[n]?i[n]=e[t](i[n]):s[n]?(g[n]||(g[n]=new s[n]),m[n]&&delete m[n],e[t](g[n])):BI.Plugin.configWidget(n,e[t]);l[n]=null})),l[n].push(e)};var u={},c=[];BI.action=function(t,n){return BI.isFunction(t)?(c.push(t),function(){BI.remove(c,function(e){return c.indexOf(n)===e})}):(u[t]||(u[t]=[]),u[t].push(n),function(){BI.remove(u[t],function(e){return u[t].indexOf(n)===e}),0===u[t].length&&delete u[t]})};var h={};BI.point=function(e,t,n,i){h[e]||(h[e]={}),h[e][t]||(h[e][t]={}),h[e][t][i?"after":"before"]||(h[e][t][i?"after":"before"]=[]),h[e][t][i?"after":"before"].push(n)},BI.Modules={getModule:function(e){return n[e]?n[e]:(_global.console&&console.error("module:["+e+"] does not exists"),!1)},getAllModules:function(){return n}},BI.Constants={getConstant:function(e){return i[e]}};var p=function(a,e){e=BI.isArray(e)?e:[e],BI.each(e,function(e,t){if(h[t])for(var n in h[t]){var i=h[t][n].before;i&&BI.aspect.before(a,n,function(i){return function(){for(var e=0,t=i.length;e<t;e++)try{i[e].apply(a,arguments)}catch(n){_global.console&&console.error(n)}}}(i));var r=h[t][n].after;r&&BI.aspect.after(a,n,function(i){return function(){for(var e=0,t=i.length;e<t;e++)try{i[e].apply(a,arguments)}catch(n){_global.console&&console.error(n)}}}(r))}})};BI.Models={getModel:function(e,t){var n=new r[e](t);return n._constructor&&n._constructor(t),n.mixins&&p(n,n.mixins),p(n,e),n}};var d={};BI.Stores={getStore:function(e,t){if(d[e])return d[e];var n=d[e]=new a[e](t);return n._constructor&&n._constructor(t,function(){delete d[e]}),p(n,e),n}};var f={};BI.Services={getService:function(e,t){return f[e]||(f[e]=new o[e](t),p(f[e],e)),f[e]}};var g={},m={};BI.Providers={getProvider:function(e,t){return g[e]||(g[e]=new s[e]),m[e]||(m[e]=new(g[e].$get())(t)),m[e]}},BI.Actions={runAction:function(e,i,r){BI.each(u[e],function(e,t){try{t(i,r)}catch(n){_global.console&&console.error(n)}})},runGlobalAction:function(){var i=[].slice.call(arguments);BI.each(c,function(e,t){try{t.apply(null,i)}catch(n){_global.console&&console.error(n)}})}},BI.getContext=function(e,t){return i[e]?BI.Constants.getConstant(e):r[e]?BI.Models.getModel(e,t):a[e]?BI.Stores.getStore(e,t):o[e]?BI.Services.getService(e,t):s[e]?BI.Providers.getProvider(e,t):void 0}}()},function(e,t){_.extend(BI,{MAX:0x1000000000000000,MIN:-0x1000000000000000,EVENT_RESPONSE_TIME:200,zIndex_layer:1e5,zIndex_popover:1e6,zIndex_popup:1e7,zIndex_masker:1e8,zIndex_tip:1e9,emptyStr:"",emptyFn:function(){},empty:null,Key:{48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"},KeyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},Status:{SUCCESS:1,WRONG:2,START:3,END:4,WAITING:5,READY:6,RUNNING:7,OUTOFBOUNDS:8,NULL:-1},Direction:{Top:"top",Bottom:"bottom",Left:"left",Right:"right",Custom:"custom"},Axis:{Vertical:"vertical",Horizontal:"horizontal"},Selection:{Default:-2,None:-1,Single:0,Multi:1,All:2},HorizontalAlign:{Left:"left",Right:"right",Center:"center",Stretch:"stretch"},VerticalAlign:{Middle:"middle",Top:"top",Bottom:"bottom",Stretch:"stretch"},StartOfWeek:1})},function(e,t){var n;n={},BI.BufferPool={put:function(e,t){if(BI.isNotNull(n[e]))throw new Error("Buffer Pool has the key already!");n[e]=t},get:function(e){return n[e]}}},function(e,t){var i;i={},BI.SharingPool={_Shared:i,put:function(e,t){i[e]=t},cat:function(){for(var e=Array.prototype.slice.call(arguments,0),t=i,n=0;n<e.length;n++)t=t&&t[e[n]];return t},get:function(){return BI.deepClone(this.cat.apply(this,arguments))},remove:function(e){delete i[e]}}},function(e,t){BI.Req={}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){e.exports=n(45)},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){var s=n(45),i=n(941),l=n(99),u=n(98),c=n(961),r=n(973),a=n(734),o=a.get,h=a.enforce,p=String(r).split("toString");i("inspectSource",function(e){return r.call(e)}),(e.exports=function(e,t,n,i){var r=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,o=!!i&&!!i.noTargetGet;"function"==typeof n&&("string"!=typeof t||u(n,"name")||l(n,"name",t),h(n).source=p.join("string"==typeof t?t:"")),e!==s?(r?!o&&e[t]&&(a=!0):delete e[t],a?e[t]=n:l(e,t,n)):a?e[t]=n:c(t,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&o(this).source||r.call(this)})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){BI.Widget=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Widget.superclass._defaultConfig.apply(this),{root:!1,tagName:"div",attributes:null,data:null,tag:null,disabled:!1,invisible:!1,invalid:!1,baseCls:"",extraCls:"",cls:"",css:null})},_constructor:function(){},beforeInit:null,beforeCreate:null,created:null,render:null,beforeMount:null,mounted:null,shouldUpdate:null,update:function(){},beforeDestroy:null,destroyed:null,_init:function(){BI.Widget.superclass._init.apply(this,arguments),this._initRoot(),this._initElementWidth(),this._initElementHeight(),this._initVisual(),this._initState(),this._initRender()},_initRender:function(){this.beforeInit?(this.__asking=!0,this.beforeInit(BI.bind(this._render,this)),!0===this.__asking&&(this.__async=!0)):this._render()},_render:function(){this.__asking=!1,this.beforeCreate&&this.beforeCreate(),this._initElement(),this._initEffects(),this.created&&this.created()},_initRoot:function(){var e=this.options;this.widgetName=e.widgetName||BI.uniqueId("widget"),this._isRoot=e.root,BI.isWidget(e.element)?(e.element instanceof BI.Widget?(this._parent=e.element,this._parent.addWidget(this.widgetName,this)):this._isRoot=!0,this.element=this.options.element.element):e.element?(this.element=BI.Widget._renderEngine.createElement(this),this._isRoot=!0):this.element=BI.Widget._renderEngine.createElement(this),this.element._isWidget=!0,(e._baseCls||e.baseCls||e.extraCls||e.cls)&&this.element.addClass((e._baseCls||"")+" "+(e.baseCls||"")+" "+(e.extraCls||"")+" "+(e.cls||"")),e.attributes&&this.element.attr(e.attributes),e.data&&this.element.data(e.data),e.css&&this.element.css(e.css),this._children={}},_initElementWidth:function(){var e=this.options;BI.isWidthOrHeight(e.width)&&this.element.css("width",e.width)},_initElementHeight:function(){var e=this.options;BI.isWidthOrHeight(e.height)&&this.element.css("height",e.height)},_initVisual:function(){this.options.invisible&&this.element.css("display","none")},_initEffects:function(){var e=this.options;(e.disabled||e.invalid)&&(this.options.disabled&&this.setEnable(!1),this.options.invalid&&this.setValid(!1))},_initState:function(){this._isMounted=!1},_initElement:function(){var n=this,e=this.render&&this.render();BI.isPlainObject(e)&&(e=[e]),BI.isArray(e)&&BI.each(e,function(e,t){BI.createWidget(t,{element:n})}),this._mount()},_setParent:function(e){this._parent=e},_mount:function(n,i,r,a){var o=this;return!!(n||!this._isMounted&&this.isVisible()&&!0!==this.__asking&&(!0===this._isRoot||this._parent&&!0===this._parent._isMounted))&&(!1!==r&&this.beforeMount&&this.beforeMount(),this._isMounted=!0,this._mountChildren&&this._mountChildren(),BI.each(this._children,function(e,t){o.isEnabled()||t._setEnable(!1),o.isValid()||t._setValid(!1),t._mount&&t._mount(!!i&&n,i,r,a)}),!1!==r&&this.mounted&&this.mounted(),this.fireEvent(BI.Events.MOUNT),a&&a(this),!0)},_mountChildren:null,isMounted:function(){return this._isMounted},setWidth:function(e){this.options.width=e,this._initElementWidth()},setHeight:function(e){this.options.height=e,this._initElementHeight()},_setEnable:function(n){!0===n?this.options.disabled=!1:!1===n&&(this.options.disabled=!0),BI.each(this._children,function(e,t){!t._manualSetEnable&&t._setEnable&&t._setEnable(n)})},_setValid:function(n){!0===n?this.options.invalid=!1:!1===n&&(this.options.invalid=!0),BI.each(this._children,function(e,t){!t._manualSetValid&&t._setValid&&t._setValid(n)})},_setVisible:function(e){!0===e?this.options.invisible=!1:!1===e&&(this.options.invisible=!0)},setEnable:function(e){this._manualSetEnable=!0,this._setEnable(e),!0===e?this.element.removeClass("base-disabled disabled"):!1===e&&this.element.addClass("base-disabled disabled")},setVisible:function(e){this._setVisible(e),!0===e?(this.element.css("display",""),this._mount()):!1===e&&this.element.css("display","none"),this.fireEvent(BI.Events.VIEW,e)},setValid:function(e){this._manualSetValid=!0,this._setValid(e),!0===e?this.element.removeClass("base-invalid invalid"):!1===e&&this.element.addClass("base-invalid invalid")},doBehavior:function(){var n=arguments;BI.each(this._children,function(e,t){t.doBehavior&&t.doBehavior.apply(t,n)})},getWidth:function(){return this.options.width},getHeight:function(){return this.options.height},isValid:function(){return!this.options.invalid},addWidget:function(e,t){var n=this;if(e instanceof BI.Widget&&(e=(t=e).getName()),BI.isKey(e)&&(e+=""),e=e||t.getName()||BI.uniqueId("widget"),this._children[e])throw new Error("name has already been existed");return t._setParent&&t._setParent(this),t.on(BI.Events.DESTROY,function(){BI.remove(n._children,this)}),this._children[e]=t},getWidgetByName:function(n){if(!BI.isKey(n)||n===this.getName())return this;n+="";var i=void 0,r={};return BI.any(this._children,function(e,t){return e===n?(i=t,!0):void(r[e]=t)}),i||BI.any(r,function(e,t){return i=t.getWidgetByName(e)}),i},removeWidget:function(e){BI.isWidget(e)?BI.remove(this._children,e):delete this._children[e]},hasWidget:function(e){return null!=this._children[e]},getName:function(){return this.widgetName},setTag:function(e){this.options.tag=e},getTag:function(){return this.options.tag},attr:function(e,t){var n=this;if(!BI.isPlainObject(e))return BI.isNotNull(t)?this.options[e]=t:this.options[e];BI.each(e,function(e,t){n.attr(e,t)})},css:function(e,t){return this.element.css(e,t)},getText:function(){},setText:function(e){},getValue:function(){},setValue:function(e){},isEnabled:function(){return!this.options.disabled},isVisible:function(){return!this.options.invisible},disable:function(){this.setEnable(!1)},enable:function(){this.setEnable(!0)},valid:function(){this.setValid(!0)},invalid:function(){this.setValid(!1)},invisible:function(){this.setVisible(!1)},visible:function(){this.setVisible(!0)},__d:function(){this.beforeDestroy&&this.beforeDestroy(),this.beforeDestroy=null,BI.each(this._children,function(e,t){t&&t._unMount&&t._unMount()}),this._children={},this._parent=null,this._isMounted=!1,this.destroyed&&this.destroyed(),this.destroyed=null},_unMount:function(){this.__d(),this.fireEvent(BI.Events.UNMOUNT),this.purgeListeners()},isolate:function(){this._parent&&this._parent.removeWidget(this),BI.DOM.hang([this])},empty:function(){BI.each(this._children,function(e,t){t&&t._unMount&&t._unMount()}),this._children={},this.element.empty()},_destroy:function(){this.__d(),this.element.destroy(),this.purgeListeners()},destroy:function(){this.__d(),this.element.destroy(),this.fireEvent(BI.Events.DESTROY),this._purgeRef(),this.purgeListeners()}}),BI.Widget.registerRenderEngine=function(e){BI.Widget._renderEngine=e},BI.Widget.registerRenderEngine({createElement:function(e){if(BI.isWidget(e)){var t=e.options;return t.element?BI.$(t.element):BI.$(document.createElement(t.tagName))}return BI.$(e)},createFragment:function(){return document.createDocumentFragment()}}),BI.mount=function(e,t,n,i){if(!0!==i)return t&&BI.Widget._renderEngine.createElement(t).append(e.element),e._mount(!0,!1,!1,n);e.element.data("__widgets",[e]);var r=e._mount(!0,!1,!1,function(e){BI.each(e._children,function(e,t){var n=t.element.data("__widgets");(n=n||[]).push(t),t.element.data("__widgets",n)}),n&&n.apply(this,arguments)}),a=BI.Widget._renderEngine.createElement;BI.DOM.patchProps(e.element,a(a(t).children()[0]));var o=function(e){e.beforeMount&&e.beforeMount(),e.mounted&&e.mounted(),BI.each(e._children,function(e,t){o(t)})};return o(e),r}},function(e,t){!function(){var i={};BI.shortcut=BI.component=function(e,t){null!=i[e]&&_global.console&&console.error("shortcut:["+e+"] has been registed"),i[e]=t};var a=function(e){var t=i[e.type];if(!t)throw new Error("组件"+e.type+"未定义");var n=new t;return n._initProps(e),n._init(),n._initRef(),n};BI.createWidget=function(e,t,n){var i,r;if(BI.init(),e=e||{},t=BI.isWidget(t)?{}:t||{},BI.isEmpty(e)&&BI.isEmpty(t))return BI.createWidget({type:"bi.layout"});if(BI.isWidget(e))return e;if(e.type||t.type)return i=BI.extend({},t,e),(r=BI.Plugin.getWidget(i.type,i)).listeners=(r.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(i.type,this)}}]),r.type===i.type?a(r):BI.createWidget(BI.extend({},e,{type:r.type},t));if(e.el&&(e.el.type||t.type))return i=BI.extend({},t,e.el),(r=BI.Plugin.getWidget(i.type,i)).listeners=(r.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(i.type,this)}}]),r.type===i.type?a(r):BI.createWidget(BI.extend({},e,{type:r.type},t));if(BI.isWidget(e.el))return e.el;throw new Error("无法根据item创建组件")},BI.createElement=function(){return BI.createWidget.apply(this,arguments).element}}()},function(e,t){var n,i;n=_global.cancelAnimationFrame||_global.webkitCancelAnimationFrame||_global.mozCancelAnimationFrame||_global.oCancelAnimationFrame||_global.msCancelAnimationFrame||_global.clearTimeout,i=_global.requestAnimationFrame||_global.webkitRequestAnimationFrame||_global.mozRequestAnimationFrame||_global.oRequestAnimationFrame||_global.msRequestAnimationFrame||_global.setTimeout,BI.MouseMoveTracker=function(e,t,n){this._isDragging=!1,this._animationFrameID=null,this._domNode=n,this._onMove=e,this._onMoveEnd=t,this._onMouseMove=BI.bind(this._onMouseMove,this),this._onMouseUp=BI.bind(this._onMouseUp,this),this._didMouseMove=BI.bind(this._didMouseMove,this)},BI.MouseMoveTracker.prototype={constructor:BI.MouseMoveTracker,captureMouseMoves:function(e){this._eventMoveToken||this._eventUpToken||(this._eventMoveToken=BI.EventListener.listen(this._domNode,"mousemove",this._onMouseMove),this._eventUpToken=BI.EventListener.listen(this._domNode,"mouseup",this._onMouseUp)),this._isDragging||(this._deltaX=0,this._deltaY=0,this._isDragging=!0,this._x=e.clientX,this._y=e.clientY),e.preventDefault?e.preventDefault():e.returnValue=!1},releaseMouseMoves:function(){this._eventMoveToken&&this._eventUpToken&&(this._eventMoveToken.remove(),this._eventMoveToken=null,this._eventUpToken.remove(),this._eventUpToken=null),null!==this._animationFrameID&&(n(this._animationFrameID),this._animationFrameID=null),this._isDragging&&(this._isDragging=!1,this._x=null,this._y=null)},isDragging:function(){return this._isDragging},_onMouseMove:function(e){var t=e.clientX,n=e.clientY;this._deltaX+=t-this._x,this._deltaY+=n-this._y,null===this._animationFrameID&&(this._animationFrameID=i(this._didMouseMove)),this._x=t,this._y=n,e.preventDefault?e.preventDefault():e.returnValue=!1},_didMouseMove:function(){this._animationFrameID=null,this._onMove(this._deltaX,this._deltaY),this._deltaX=0,this._deltaY=0},_onMouseUp:function(){this._animationFrameID&&this._didMouseMove(),this._onMoveEnd()}}},function(e,t){var p;p=_global.requestAnimationFrame||_global.webkitRequestAnimationFrame||_global.mozRequestAnimationFrame||_global.oRequestAnimationFrame||_global.msRequestAnimationFrame||_global.setTimeout,BI.WheelHandler=function(e,t,n,i){this._animationFrameID=null,this._deltaX=0,this._deltaY=0,this._didWheel=BI.bind(this._didWheel,this),"function"!=typeof t&&(t=t?function(){return!0}:function(){return!1}),"function"!=typeof n&&(n=n?function(){return!0}:function(){return!1}),"function"!=typeof i&&(i=i?function(){return!0}:function(){return!1}),this._handleScrollX=t,this._handleScrollY=n,this._stopPropagation=i,this._onWheelCallback=e,this.onWheel=BI.bind(this.onWheel,this)},BI.WheelHandler.prototype={constructor:BI.WheelHandler,onWheel:function(e){var t,n,i,r,a,o,s=(a=r=i=n=0,"detail"in(t=e)&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(n=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=i,i=0),r=10*n,a=10*i,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||a)&&t.deltaMode&&(1===t.deltaMode?(r*=40,a*=40):(r*=800,a*=800)),r&&!n&&(n=r<1?-1:1),a&&!i&&(i=a<1?-1:1),{spinX:n,spinY:i,pixelX:r,pixelY:a}),l=this._deltaX+s.pixelX,u=this._deltaY+s.pixelY,c=this._handleScrollX(l,u),h=this._handleScrollY(u,l);(c||h)&&(this._deltaX+=c?s.pixelX:0,this._deltaY+=h?s.pixelY:0,e.preventDefault?e.preventDefault():e.returnValue=!1,0===this._deltaX&&0===this._deltaY||(this._stopPropagation()&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0),o=!0),!0===o&&null===this._animationFrameID&&(this._animationFrameID=p(this._didWheel)))},_didWheel:function(){this._animationFrameID=null,this._onWheelCallback(this._deltaX,this._deltaY),this._deltaX=0,this._deltaY=0}}},function(e,t){BI.BehaviorFactory={createBehavior:function(e,t){var n;switch(e){case"highlight":n=BI.HighlightBehavior;break;case"redmark":n=BI.RedMarkBehavior}return new n(t)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}})},function(e,t){BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},appendFragment:function(e){this.element.append(e)},_mountChildren:function(){var n=this,i=BI.Widget._renderEngine.createFragment(),r=!1;BI.each(this._children,function(e,t){t.element!==n.element&&(i.appendChild(t.element[0]),r=!0)}),!0===r&&this.appendFragment(i)},_getChildName:function(e){return e+""},_addElement:function(e,t,n){var i,r=this;return this.hasWidget(this._getChildName(e))?i=this.getWidgetByName(this._getChildName(e)):((i=BI.createWidget(t,n)).on(BI.Events.DESTROY,function(){BI.each(r._children,function(e,t){t===i&&(BI.remove(r._children,t),r.removeItemAt(0|e))})}),this.addWidget(this._getChildName(e),i)),i},_getOptions:function(e){return e instanceof BI.Widget&&(e=e.options),(e=BI.stripEL(e))instanceof BI.Widget&&(e=e.options),e},_compare:function(e,t){var u=this;return function c(e,t,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var r=Object.prototype.toString.call(e);switch(r){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t}var a="[object Array]"===r;if(!a){if(BI.isFunction(e)&&BI.isFunction(t))return!0;e=u._getOptions(e),t=u._getOptions(t)}n=n||[];i=i||[];var o=n.length;for(;o--;)if(n[o]===e)return i[o]===t;n.push(e);i.push(t);if(a){if((o=e.length)!==t.length)return!1;for(;o--;)if(!c(e[o],t[o],n,i))return!1}else{var s,l=_.keys(e);if(o=l.length,_.keys(t).length!==o)return!1;for(;o--;)if(s=l[o],!_.has(t,s)||!c(e[s],t[s],n,i))return!1}n.pop();i.pop();return!0}(e,t)},_getWrapper:function(){return this.element},_addItemAt:function(e,t){for(var n=this.options.items.length;e<n;n--)this._children[this._getChildName(n)]=this._children[this._getChildName(n-1)];delete this._children[this._getChildName(e)],this.options.items.splice(e,0,t)},_removeItemAt:function(e){for(var t=e;t<this.options.items.length-1;t++)this._children[this._getChildName(t)]=this._children[this._getChildName(t+1)];delete this._children[this._getChildName(this.options.items.length-1)],this.options.items.splice(e,1)},addItem:function(e){return this.addItemAt(this.options.items.length,e)},prependItem:function(e){return this.addItemAt(0,e)},addItemAt:function(e,t){if(!(e<0||e>this.options.items.length)){this._addItemAt(e,t);var n=this._addElement(e,t);return 0<e?this._children[this._getChildName(e-1)].element.after(n.element):n.element.prependTo(this._getWrapper()),n._mount(),n}},removeItemAt:function(e){e=BI.isArray(e)?e:[e];for(var t=[],n=[],i={},r=0,a=this.options.items.length;r<a;r++){var o=this._children[this._getChildName(r)];BI.contains(e,r)?o&&t.push(o):(i[this._getChildName(n.length)]=o,n.push(this.options.items[r]))}this.options.items=n,this._children=i,BI.each(t,function(e,t){t._destroy()})},shouldUpdateItem:function(e,t){if(e<0||e>this.options.items.length-1)return!1;var n=this._children[this._getChildName(e)];return n.shouldUpdate?!0===n.shouldUpdate(this._getOptions(t)):null},updateItemAt:function(e,t){if(!(e<0||e>this.options.items.length-1)){var n;if(n=this._children[this._getChildName(e)].update(this._getOptions(t)))return n;var i=this._children[this._getChildName(e)];delete this._children[this._getChildName(e)],this.options.items.splice(e,1);var r=this._addElement(e,t);this.options.items.splice(e,0,t),this._children[this._getChildName(e)]=r,0<e?this._children[this._getChildName(e-1)].element.after(r.element):r.element.prependTo(this._getWrapper()),i._destroy(),r._mount()}},addItems:function(e,i){var r=this,a=this.options,o=BI.Widget._renderEngine.createFragment(),s=[];BI.each(e,function(e,t){var n=r._addElement(a.items.length,t,i);r._children[r._getChildName(a.items.length)]=n,a.items.push(t),s.push(n),o.appendChild(n.element[0])}),this._isMounted&&(this._getWrapper().append(o),BI.each(s,function(e,t){t._mount()}))},prependItems:function(e,t){e=e||[];for(var n=BI.Widget._renderEngine.createFragment(),i=[],r=e.length-1;0<=r;r--){this._addItemAt(0,e[r]);var a=this._addElement(0,e[r],t);this._children[this._getChildName(0)]=a,this.options.items.unshift(e[r]),i.push(a),n.appendChild(a.element[0])}this._isMounted&&(this._getWrapper().prepend(n),BI.each(i,function(e,t){t._mount()}))},getValue:function(){var n,i=this,r=[];return BI.each(this.options.items,function(e){var t;(n=i._children[i._getChildName(e)])&&(t=n.getValue(),t=BI.isArray(t)?t:[t],r=r.concat(t))}),r},setValue:function(t){var n,i=this;BI.each(this.options.items,function(e){(n=i._children[i._getChildName(e)])&&n.setValue(t)})},setText:function(t){var n,i=this;BI.each(this.options.items,function(e){(n=i._children[i._getChildName(e)])&&n.setText(t)})},patchItem:function(e,t,n){var i=this.shouldUpdateItem(n,t);if(!0===i||null===i&&!this._compare(e,t))return this.updateItemAt(n,t)},updateChildren:function(n,e){var i,r,s=this,t=0,a=0,o=n.length-1,l=n[0],u=n[o],c=e.length-1,h=e[0],p=e[c],d={};for(BI.each(n,function(e,t){var n=null==(t=s._getOptions(t)).key?e:t.key;BI.isKey(n)&&(d[n]=s._children[s._getChildName(e)])});t<=o&&a<=c;){BI.isNull(l)?l=n[++t]:BI.isNull(u)?u=n[--o]:f(l,h,t,a)?(i=this.patchItem(l,h,t)||i,d[null==l.key?this._getChildName(t):l.key]=this._children[this._getChildName(t)],l=n[++t],h=e[++a]):f(u,p,o,c)?(i=this.patchItem(u,p,o)||i,d[null==u.key?this._getChildName(o):u.key]=this._children[this._getChildName(o)],u=n[--o],p=e[--c]):f(l,p)?(i=this.patchItem(l,p,t)||i,d[null==l.key?this._getChildName(t):l.key]=this._children[this._getChildName(t)],m(l,u,!0),l=n[++t],p=e[--c]):h=(f(u,h)?(i=this.patchItem(u,h,o)||i,d[null==u.key?this._getChildName(o):u.key]=this._children[this._getChildName(o)],m(u,l),u=n[--o]):(r=function(e,t,n,i){var r,a;for(r=n;r<=i;++r)e[r]&&f(e[r],t)&&(a=e[r]);return a}(n,h,t,o),BI.isNull(r)?m(g(h),l):BI.each(n,function(e,t){t&&f(t,h)&&(i=s.patchItem(r,h,e)||i,d[null==r.key?s._getChildName(e):r.key]=s._children[s._getChildName(e)],n[e]=undefined,m(r,l))})),e[++a])}function f(e,t,n,i){return e=s._getOptions(e),t=s._getOptions(t),BI.isKey(e.key)?e.key===t.key:0<=n&&n===i}function g(e,t){var n=s._getOptions(e),i=null==n.key?s._getChildName(t):n.key;return d[i]=s._addElement(i,e)}function m(e,t,n,i){e=s._getOptions(e),t=t&&s._getOptions(t);var r,a,o=BI.isKey(e.key)?e.key:s._getChildName(i);t&&d[t.key]?(r=BI.isKey(t.key)?t.key:s._getChildName(i),0<(a=n?d[r].element.next():d[r].element).length?a.before(d[o].element):s._getWrapper().append(d[o].element)):s._getWrapper().append(d[o].element)}return o<t?function(e,t,n,i){for(;n<=i;++n){m(g(t[n],n),e,!1,n)}}(BI.isNull(e[c+1])?null:e[c+1],e,a,c):c<a&&function(e,t,n){for(;t<=n;++t){var i,r,a=e[t];BI.isNotNull(a)&&(i=s._getOptions(a),r=null==i.key?s._getChildName(t):i.key,delete s._children[s._getChildName(r)],d[r]._destroy())}}(n,t,o),this._children={},BI.each(e,function(e,t){var n=s._getOptions(t),i=null==n.key?s._getChildName(e):n.key;d[i]._mount(),s._children[s._getChildName(e)]=d[i]}),i},update:function(e){var t=this.options,n=e.items||[],i=this.updateChildren(t.items,n);return this.options.items=n,i},stroke:function(e){var n=this;BI.each(e,function(e,t){t&&n._addElement(e,t)})},removeWidget:function(n){var i;BI.isWidget(n)?BI.each(this._children,function(e,t){t===n&&(i=e)}):i=n,i&&this._removeItemAt(0|i)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(e){this.options;e=e||[],this._isMounted?this.update({items:e}):(this.options.items=e,this.stroke(e))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout)},function(e,t){var a,o,s,l,u;BI.Plugin=BI.Plugin||{},a={},o={},s={},l=[],u=[],BI.extend(BI.Plugin,{getWidget:function(e,t){if(0<l.length)for(var n=l.slice(0),i=n.length-1;0<=i;i--)n[i](e,t);var r;if(s[e])for(i=s[e].length-1;0<=i;i--)(r=s[e][i](t))&&(t=r);if(a[e])for(i=a[e].length-1;0<=i;i--)if(r=a[e][i](t))return r;return t},config:function(e,t){l=l.concat(_.isArray(e)?e:[e]),u=u.concat(_.isArray(t)?t:[t])},configWidget:function(e,t){s[e]||(s[e]=[]),s[e].push(t)},registerWidget:function(e,t){a[e]||(a[e]=[]),0<a[e].length&&console.log("组件已经注册过了!"),a[e].push(t)},relieveWidget:function(e){delete a[e]},getObject:function(e,t){if(0<u.length)for(var n=u.slice(0),i=n.length-1;0<=i;i--)n[i](e,t);if(o[e])for(var r,i=0,a=o[e].length;i<a;i++)(r=o[e][i](t))&&(t=r);return r||t},registerObject:function(e,t){o[e]||(o[e]=[]),0<o[e].length&&console.log("对象已经注册过了!"),o[e].push(t)},relieveObject:function(e){delete o[e]}})},function(e,t){BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(e,t,n){},actionBack:function(e,t,n){}}),BI.ActionFactory={createAction:function(e,t){var n;switch(e){case"show":n=BI.ShowAction}return new n(t)}}},function(e,t){BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(e,t,n){(t=t||this.options.tar).setVisible(!0),n&&n()},actionBack:function(e,t,n){(e=e||this.options.tar).setVisible(!1),n&&n()}})},function(e,t){BI.HighlightBehavior=BI.inherit(BI.Behavior,{_defaultConfig:function(){return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.HighlightBehavior.superclass._init.apply(this,arguments)},doBehavior:function(e){var r=Array.prototype.slice.call(arguments,1),a=this.options;BI.each(e,function(e,t){function n(e){!0===e?t.doHighLight&&t.doHighLight.apply(t,r):t.unHighLight&&t.unHighLight.apply(t,r)}var i;t instanceof BI.Single?(i=a.rule(t.getValue(),t),BI.isFunction(i)?i(n):n(i)):t.doBehavior&&t.doBehavior.apply(t,r)})}})},function(e,t){BI.RedMarkBehavior=BI.inherit(BI.Behavior,{_defaultConfig:function(){return BI.extend(BI.RedMarkBehavior.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.RedMarkBehavior.superclass._init.apply(this,arguments)},doBehavior:function(e){var n=Array.prototype.slice.call(arguments,1),i=this.options;BI.each(e,function(e,t){t instanceof BI.Single?i.rule(t.getValue(),t)?t.doRedMark&&t.doRedMark.apply(t,n):t.doRedMark&&t.unRedMark.apply(t,n):t.doBehavior&&t.doBehavior.apply(t,n)})}})},function(e,t){BI.Controller=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Controller.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.Controller.superclass._init.apply(this,arguments)},destroy:function(){}}),BI.Controller.EVENT_CHANGE="__EVENT_CHANGE__"},function(e,t){BI.BroadcastController=BI.inherit(BI.Controller,{_defaultConfig:function(){return BI.extend(BI.BroadcastController.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.BroadcastController.superclass._init.apply(this,arguments),this._broadcasts={}},on:function(e,t){var n=this;return this._broadcasts[e]||(this._broadcasts[e]=[]),this._broadcasts[e].push(t),function(){n.remove(e,t)}},send:function(e){var n=[].slice.call(arguments,1);BI.each(this._broadcasts[e],function(e,t){t.apply(null,n)})},remove:function(t,n){var i=this;return n?(BI.remove(this._broadcasts[t],function(e){return i._broadcasts[t].indexOf(n)===e}),this._broadcasts[t].remove(n),0===this._broadcasts[t].length&&delete this._broadcasts[t]):delete this._broadcasts[t],this}})},function(e,t){BI.BubblesController=BI.inherit(BI.Controller,{_defaultConfig:function(){return BI.extend(BI.BubblesController.superclass._defaultConfig.apply(this,arguments),{})},_const:{bubbleHeight:18},_init:function(){BI.BubblesController.superclass._init.apply(this,arguments);var t=this;this.bubblesManager={},this.storeBubbles={},BI.Resizers.add("bubbleController"+BI.uniqueId(),function(){BI.each(t.bubblesManager,function(e){t.remove(e)}),t.bubblesManager={},t.storeBubbles={}})},_createBubble:function(e,t,n,i){return BI.createWidget({type:"bi.bubble",text:t,level:n,height:i||18,direction:e})},_getOffsetLeft:function(e,t,n){var i=0;return"center"===n?((i=t.element.offset().left+(t.element.bounds().width-this.get(e).element.bounds().width)/2)<0&&(i=0),i):"right"===n?((i=t.element.offset().left+t.element.bounds().width-this.get(e).element.bounds().width)<0&&(i=0),i):t.element.offset().left},_getOffsetTop:function(e,t,n){var i=0;return"center"===n?((i=t.element.offset().top+(t.element.bounds().height-this.get(e).element.bounds().height)/2)<0&&(i=0),i):"right"===n?((i=t.element.offset().top+t.element.bounds().height-this.get(e).element.bounds().height)<0&&(i=0),i):t.element.offset().top},_getLeftPosition:function(e,t,n){var i=BI.DOM.getLeftPosition(t,this.get(e));return i.top=this._getOffsetTop(e,t,n),i},_getBottomPosition:function(e,t,n){var i=BI.DOM.getBottomPosition(t,this.get(e));return i.left=this._getOffsetLeft(e,t,n),i},_getTopPosition:function(e,t,n){var i=BI.DOM.getTopPosition(t,this.get(e));return i.left=this._getOffsetLeft(e,t,n),i},_getRightPosition:function(e,t,n){var i=BI.DOM.getRightPosition(t,this.get(e));return i.top=this._getOffsetTop(e,t,n),i},show:function(e,t,n,i){var r=(i=i||{}).container||n,a=i.offsetStyle||{},o=i.level||"error",s=i.adjustYOffset||0,l=i.adjustXOffset||0;this.storeBubbles[e]||(this.storeBubbles[e]={}),this.storeBubbles[e].top||(this.storeBubbles[e].top=this._createBubble("top",t,o)),BI.createWidget({type:"bi.absolute",element:r,items:[{el:this.storeBubbles[e].top}]}),this.set(e,this.storeBubbles[e].top);var u=this._getTopPosition(e,n,a);return this.get(e).element.css({left:u.left+l,top:u.top-s}),this.get(e).invisible(),BI.DOM.isTopSpaceEnough(n,this.get(e),s)||(this.storeBubbles[e].left||(this.storeBubbles[e].left=this._createBubble("left",t,o,30)),BI.createWidget({type:"bi.absolute",element:r,items:[{el:this.storeBubbles[e].left}]}),this.set(e,this.storeBubbles[e].left),u=this._getLeftPosition(e,n,a),this.get(e).element.css({left:u.left-l,top:u.top-s}),this.get(e).invisible(),BI.DOM.isLeftSpaceEnough(n,this.get(e),l)||(this.storeBubbles[e].right||(this.storeBubbles[e].right=this._createBubble("right",t,o,30)),BI.createWidget({type:"bi.absolute",element:r,items:[{el:this.storeBubbles[e].right}]}),this.set(e,this.storeBubbles[e].right),u=this._getRightPosition(e,n,a),this.get(e).element.css({left:u.left+l,top:u.top-s}),this.get(e).invisible(),BI.DOM.isRightSpaceEnough(n,this.get(e),l)||(this.storeBubbles[e].bottom||(this.storeBubbles[e].bottom=this._createBubble("bottom",t,o)),BI.createWidget({type:"bi.absolute",element:r,items:[{el:this.storeBubbles[e].bottom}]}),this.set(e,this.storeBubbles[e].bottom),u=this._getBottomPosition(e,n,a),this.get(e).element.css({left:u.left+l,top:u.top+s}),this.get(e).invisible()))),this.get(e).setText(t),this.get(e).visible(),this},hide:function(e){return this.has(e)&&this.get(e).invisible(),this},add:function(e,t){return this.has(e)||this.set(e,t),this},get:function(e){return this.bubblesManager[e]},set:function(e,t){this.bubblesManager[e]=t},has:function(e){return null!=this.bubblesManager[e]},remove:function(e){return this.has(e)&&(BI.each(this.storeBubbles[e],function(e,t){t.destroy()}),delete this.storeBubbles[e],delete this.bubblesManager[e]),this}})},function(e,t){BI.LayerController=BI.inherit(BI.Controller,{_defaultConfig:function(){return BI.extend(BI.LayerController.superclass._defaultConfig.apply(this,arguments),{render:"body"})},_init:function(){BI.LayerController.superclass._init.apply(this,arguments),this.layerManager={},this.layouts={},this.zindex=BI.zIndex_layer,BI.Resizers.add("layerController"+BI.uniqueId(),BI.bind(this._resize,this))},_resize:function(){BI.each(this.layouts,function(e,t){t.element.is(":visible")&&t.element.trigger("__resize__")})},make:function(e,t,n,i){return BI.isWidget(t)?(n=n||{}).container=t:(i=n,n=t),this.create(e,null,n,i)},create:function(e,t,n,i){if(this.has(e))return this.get(e);var r=(n=n||{}).offset||{},a=t;if(BI.isWidget(t)&&(a=t.element),BI.isNotEmptyString(a)&&(a=BI.Widget._renderEngine.createElement(a)),this.has(e))return this.get(e);var o=BI.createWidget(n.render||{},BI.extend({type:"bi.layout"},n),i),s=BI.createWidget({type:"bi.absolute",invisible:!0,items:[{el:o,left:0,right:0,top:0,bottom:0}]},i);return BI.createWidget({type:"bi.absolute",element:n.container||this.options.render,items:[{el:s,left:r.left||0,right:r.right||0,top:r.top||0,bottom:r.bottom||0}]}),a&&(s.element.addClass("bi-popup-view"),s.element.css({left:a.offset().left+(r.left||0),top:a.offset().top+(r.top||0),width:r.width||a.outerWidth()-(r.left||0)-(r.right||0)||"",height:r.height||a.outerHeight()-(r.top||0)-(r.bottom||0)||""}),s.element.on("__resize__",function(){a.is(":visible")&&s.element.css({left:a.offset().left+(r.left||0),top:a.offset().top+(r.top||0),width:r.width||a.outerWidth()-(r.left||0)-(r.right||0)||"",height:r.height||a.outerHeight()-(r.top||0)-(r.bottom||0)||""})})),this.add(e,o,s),o},hide:function(e,t){return this.has(e)&&(this._getLayout(e).invisible(),this._getLayout(e).element.hide(0,t)),this},show:function(e,t){return this.has(e)&&(this._getLayout(e).visible(),this._getLayout(e).element.css("z-index",this.zindex++).show(0,t).trigger("__resize__")),this},isVisible:function(e){return this.has(e)&&this._getLayout(e).isVisible()},add:function(e,t,n){if(this.has(e))throw new Error("name is already exist");return n.setVisible(!1),this.layerManager[e]=t,(this.layouts[e]=n).element.css("z-index",this.zindex++),this},_getLayout:function(e){return this.layouts[e]},get:function(e){return this.layerManager[e]},has:function(e){return null!=this.layerManager[e]},remove:function(e){return this.has(e)&&(this.layerManager[e].destroy(),this.layouts[e].destroy(),delete this.layerManager[e],delete this.layouts[e]),this},removeAll:function(){var n=this;return BI.each(BI.keys(this.layerManager),function(e,t){n.layerManager[t].destroy(),n.layouts[t].destroy()}),this.layerManager={},this.layouts={},this}})},function(e,t){BI.MaskersController=BI.inherit(BI.LayerController,{_defaultConfig:function(){return BI.extend(BI.MaskersController.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.MaskersController.superclass._init.apply(this,arguments),this.zindex=BI.zIndex_masker}})},function(e,t){BI.PopoverController=BI.inherit(BI.Controller,{_defaultConfig:function(){return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this,arguments),{modal:!0,render:"body"})},_init:function(){BI.PopoverController.superclass._init.apply(this,arguments),this.modal=this.options.modal,this.floatManager={},this.floatLayer={},this.floatContainer={},this.floatOpened={},this.zindex=BI.zIndex_popover,this.zindexMap={}},_check:function(e){return BI.isNotNull(this.floatManager[e])},create:function(e,t,n){if(this._check(e))return this;var i=BI.createWidget(t||{},{type:"bi.popover"},n);return this.add(e,i,t,n),this},add:function(e,t,n,i){var r,a=this;return n=n||{},this._check(e)||(this.floatContainer[e]=BI.createWidget({type:"bi.absolute",cls:"bi-popup-view",items:[{el:this.floatLayer[e]=BI.createWidget({type:"bi.absolute",items:[t]},i),left:0,right:0,top:0,bottom:0}]}),this.floatManager[e]=t,r=e,t.on(BI.Popover.EVENT_CLOSE,function(){a.close(r)}),BI.createWidget({type:"bi.absolute",element:n.container||this.options.render,items:[{el:this.floatContainer[e],left:0,right:0,top:0,bottom:0}]})),this},open:function(e){return this._check(e)&&(this.floatOpened[e]||(this.floatOpened[e]=!0,(t=this.floatContainer[e]).element.css("zIndex",this.zindex++),this.modal&&t.element.__hasZIndexMask__(this.zindexMap[e])&&t.element.__releaseZIndexMask__(this.zindexMap[e]),this.zindexMap[e]=this.zindex,this.modal&&t.element.__buildZIndexMask__(this.zindex++),this.get(e).setZindex(this.zindex++),this.floatContainer[e].visible(),(n=this.get(e)).show&&n.show(),i=BI.Widget._renderEngine.createElement(this.options.render).width(),r=BI.Widget._renderEngine.createElement(this.options.render).height(),(a=(i-n.element.width())/2)<0&&(a=0),(o=(r-n.element.height())/2)<0&&(o=0),n.element.css({left:a+"px",top:o+"px"}))),this;var t,n,i,r,a,o},close:function(e){return this._check(e)&&this.floatOpened[e]&&(delete this.floatOpened[e],this.floatContainer[e].invisible(),this.modal&&this.floatContainer[e].element.__releaseZIndexMask__(this.zindexMap[e])),this},get:function(e){return this.floatManager[e]},remove:function(e){return this._check(e)&&(this.floatContainer[e].destroy(),this.modal&&this.floatContainer[e].element.__releaseZIndexMask__(this.zindexMap[e]),delete this.floatManager[e],delete this.floatLayer[e],delete this.zindexMap[e],delete this.floatContainer[e],delete this.floatOpened[e]),this},removeAll:function(){var n=this;return BI.each(this.floatContainer,function(e,t){t.destroy(),n.modal&&n.floatContainer[e].element.__releaseZIndexMask__(n.zindexMap[e])}),this.floatManager={},this.floatLayer={},this.floatContainer={},this.floatOpened={},this.zindexMap={},this}})},function(e,t){BI.ResizeController=BI.inherit(BI.Controller,{_defaultConfig:function(){return BI.extend(BI.ResizeController.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ResizeController.superclass._init.apply(this,arguments);var t=this;this.resizerManger={};var e=BI.debounce(function(e){t._resize(e)},30);BI.Widget._renderEngine.createElement(_global).resize(e)},_resize:function(n){BI.each(this.resizerManger,function(e,t){t instanceof BI.$?t.is(":visible")&&t.trigger("__resize__"):t instanceof BI.Layout?t.resize():BI.isFunction(t)&&t(n)})},add:function(e,t){var n=this;return this.has(e)?this:(this.resizerManger[e]=t,function(){n.remove(e)})},get:function(e){return this.resizerManger[e]},has:function(e){return null!=this.resizerManger[e]},remove:function(e){return this.has(e)&&delete this.resizerManger[e],this}})},function(e,t){BI.TooltipsController=BI.inherit(BI.Controller,{_defaultConfig:function(){return BI.extend(BI.TooltipsController.superclass._defaultConfig.apply(this,arguments),{})},_const:{height:18},_init:function(){BI.TooltipsController.superclass._init.apply(this,arguments),this.tooltipsManager={},this.showingTips={}},_createTooltip:function(e,t){return BI.createWidget({type:"bi.tooltip",text:e,level:t,stopEvent:!0})},hide:function(e,t){return this.has(e)&&(delete this.showingTips[e],this.get(e).element.hide(0,t),this.get(e).invisible()),this},create:function(e,t,n,i){var r;return this.has(e)||(r=this._createTooltip(t,n),this.add(e,r),BI.createWidget({type:"bi.absolute",element:i||"body",items:[{el:r}]}),r.invisible()),this.get(e)},show:function(e,t,n,i,r,a){a=a||{};var o=this;if(BI.each(this.showingTips,function(e,t){o.hide(e)}),this.showingTips={},this.has(t)||this.create(t,n,i,a.container||"body"),!a.belowMouse){var s=r.element.offset(),l=r.element.bounds();if(0===l.height||0===l.width)return;var u=s.top+l.height+5}var c=this.get(t);c.setText(n),c.element.css({left:"0px",top:"0px"}),c.visible(),c.element.height(c.element[0].scrollHeight),this.showingTips[t]=!0;var h=(e.pageX||e.clientX)+15,p=(e.pageY||e.clientY)+15;h+c.element.outerWidth()>BI.Widget._renderEngine.createElement("body").outerWidth()&&(h-=c.element.outerWidth()+15);var d=BI.Widget._renderEngine.createElement("body").outerHeight();return p+c.element.outerHeight()>d||u+c.element.outerHeight()>d?(p-=c.element.outerHeight()+15,a.belowMouse||(p=Math.min(p,s.top-c.element.outerHeight()-5))):a.belowMouse||(p=Math.max(p,u)),c.element.css({left:h<0?0:h+"px",top:p<0?0:p+"px"}),c.element.hover(function(){o.remove(t),r.element.trigger("mouseleave.title"+r.getName())}),this},add:function(e,t){return this.has(e)||this.set(e,t),this},get:function(e){return this.tooltipsManager[e]},set:function(e,t){this.tooltipsManager[e]=t},has:function(e){return null!=this.tooltipsManager[e]},remove:function(e){return this.has(e)&&(this.tooltipsManager[e].destroy(),delete this.tooltipsManager[e]),this}})},function(e,t){_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",MOUNT:"_MOUNT",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}})},function(e,t){BI.prepares.push(function(){BI.Date=BI.Date||{},BI.Date._DN=[BI.i18nText("BI-Basic_Sunday"),BI.i18nText("BI-Basic_Monday"),BI.i18nText("BI-Basic_Tuesday"),BI.i18nText("BI-Basic_Wednesday"),BI.i18nText("BI-Basic_Thursday"),BI.i18nText("BI-Basic_Friday"),BI.i18nText("BI-Basic_Saturday"),BI.i18nText("BI-Basic_Sunday")],BI.Date._SDN=[BI.i18nText("BI-Basic_Simple_Sunday"),BI.i18nText("BI-Basic_Simple_Monday"),BI.i18nText("BI-Basic_Simple_Tuesday"),BI.i18nText("BI-Basic_Simple_Wednesday"),BI.i18nText("BI-Basic_Simple_Thursday"),BI.i18nText("BI-Basic_Simple_Friday"),BI.i18nText("BI-Basic_Simple_Saturday"),BI.i18nText("BI-Basic_Simple_Sunday")],BI.Date._FD=1,BI.Date._MN=[BI.i18nText("BI-Basic_January"),BI.i18nText("BI-Basic_February"),BI.i18nText("BI-Basic_March"),BI.i18nText("BI-Basic_April"),BI.i18nText("BI-Basic_May"),BI.i18nText("BI-Basic_June"),BI.i18nText("BI-Basic_July"),BI.i18nText("BI-Basic_August"),BI.i18nText("BI-Basic_September"),BI.i18nText("BI-Basic_October"),BI.i18nText("BI-Basic_November"),BI.i18nText("BI-Basic_December")],BI.Date._SMN=[0,1,2,3,4,5,6,7,8,9,10,11],BI.Date._QN=["",BI.i18nText("BI-Quarter_1"),BI.i18nText("BI-Quarter_2"),BI.i18nText("BI-Quarter_3"),BI.i18nText("BI-Quarter_4")],BI.Date._MD=[31,28,31,30,31,30,31,31,30,31,30,31],BI.Date._OFFSET=[0,-1,-2,-3,-4,-5,-6]})},function(e,t){BI.ShowListener=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.ShowListener.superclass._defaultConfig.apply(this,arguments),{eventObj:BI.createWidget(),cardLayout:null,cardNameCreator:function(e){return e},cardCreator:BI.emptyFn,afterCardCreated:BI.emptyFn,afterCardShow:BI.emptyFn})},_init:function(){BI.ShowListener.superclass._init.apply(this,arguments);var a=this,o=this.options;o.eventObj&&o.eventObj.on(BI.Controller.EVENT_CHANGE,function(e,t,n){if(e===BI.Events.CLICK){if(t=t||o.eventObj.getValue(),t=BI.isArray(t)?1<t.length?t.toString():t[0]:t,BI.isNull(t))throw new Error("value cannot be null");var i,r=o.cardNameCreator(t);o.cardLayout.isCardExisted(r)||(i=o.cardCreator(r),o.cardLayout.addCardByName(r,i),o.afterCardCreated(r)),o.cardLayout.showCardByName(r),BI.nextTick(function(){o.afterCardShow(r),a.fireEvent(BI.ShowListener.EVENT_CHANGE,r)})}})}}),BI.ShowListener.EVENT_CHANGE="EVENT_CHANGE"},function(e,t){BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(e,t){if(_global.document){var n=document,i=n.createElement("style");return n.getElementsByTagName("head")[0].appendChild(i),i.setAttribute("type","text/css"),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),this.stylesManager[e]=i,this}},get:function(e){return this.stylesManager[e]},has:function(e){return null!=this.stylesManager[e]},removeStyle:function(e){return this.has(e)&&(this.stylesManager[e].parentNode.removeChild(this.stylesManager[e]),delete this.stylesManager[e]),this}})},function(e,t){BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(e,t){var n;switch(e){case BI.LogicFactory.Type.Vertical:n=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:n=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:n=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:n=BI.HorizontalFillLayoutLogic;break;default:n=BI.Logic}return new n(t).createLogic()},createLogicTypeByDirection:function(e){switch(e){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(e){var t=Array.prototype.slice.call(arguments,1),t=BI.map(t,function(e,t){return BI.isWidget(t)?{el:t,width:t.options.width,height:t.options.height}:t});switch(e){case BI.Direction.Bottom:BI.LogicFactory.Type.Vertical,t.reverse();break;case BI.Direction.Right:BI.LogicFactory.Type.Horizontal,t.reverse();break;case BI.Direction.Custom:t=t.slice(1)}return t}}},function(e,t){BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var e=this.options,t=e.dynamic?"bi.vertical":"bi.vtape";return{type:t,scrollable:e.scrollable,scrolly:e.scrolly,scrollx:e.scrollx,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,items:e.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var e=this.options,t=e.dynamic?"bi.vertical_adapt":"bi.htape";return{type:t,scrollable:e.scrollable,scrolly:e.scrolly,scrollx:e.scrollx,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,items:e.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var e=this.options,t=e.dynamic?"bi.table":"bi.window";return{type:t,scrollable:e.scrollable,scrolly:e.scrolly,scrollx:e.scrollx,columns:e.columns,rows:e.rows,columnSize:e.columnSize,rowSize:e.rowSize,hgap:e.hgap,vgap:e.vgap,items:e.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var e=this.options,n=[];return BI.each(e.items,function(e,t){n.push(t.width||0)}),{type:e.dynamic?"bi.horizontal_adapt":"bi.htape",columnSize:n,scrollable:e.scrollable,scrolly:e.scrolly,scrollx:e.scrollx,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,items:e.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}})},function(e,t){function u(e,t){for(var n=-1;++n<r;)t+=e*a[n],a[n]=t%i,t=Math.floor(t/i)}function c(e){for(var t=r,n=0;0<=--t;)n+=a[t],a[t]=Math.floor(n/e),n=n%e*i}function h(){for(var e,t=r,n="";0<=--t;){""===n&&0!==t&&0===a[t]||(e=String(a[t]),""===n?n=e:n+="0000000".slice(0,7-e.length)+e)}return n}function p(e,t,n){return 0===t?n:t%2==1?p(e,t-1,n*e):p(e*e,t/2,n)}var i,r,a;Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||(i=1e7,r=6,a=[0,0,0,0,0,0],Number.prototype.toFixed=function(e){var t,n,i,r,a,o,s,l=Number(e);if((l=l!=l?0:Math.floor(l))<0||20<l)throw new RangeError("Number.toFixed called with invalid number of decimals");if((t=Number(this))!=t)return"NaN";if(t<=-1e21||1e21<t)return String(t);if(n="",t<0&&(n="-",t=-t),i="0",1e-21<t)if(a=(r=function(e){for(var t=0;4096<=e;)t+=12,e/=4096;for(;2<=e;)t+=1,e/=2;return t}(t*p(2,69,1))-69)<0?t*p(2,-r,1):t/p(2,r,1),a*=4503599627370496,0<(r=52-r)){for(u(0,a),o=l;7<=o;)u(1e7,0),o-=7;for(u(p(10,o,1),0),o=r-1;23<=o;)c(1<<23),o-=23;c(1<<o),u(1,1),c(2),i=h()}else u(0,a),u(1<<-r,0),i=h()+"0.00000000000000000000".slice(2,2+l);return i=0<l?(s=i.length)<=l?n+"0.0000000000000000000".slice(0,l-s+2)+i:n+i.slice(0,s-l)+"."+i.slice(s-l):n+i})},function(e,t){BI.version="2.0"},function(e,t){BI.AbsoluteCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-center-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.AbsoluteCenterLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"absolute",left:n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0),right:n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0),top:n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0),bottom:n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0),margin:"auto"}),i},resize:function(){},populate:function(e){BI.AbsoluteCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_center_adapt",BI.AbsoluteCenterLayout)},function(e,t){BI.AbsoluteHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-horizontal-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"absolute",left:n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0),right:n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0),margin:"auto"}),n.vgap+n.tgap+(t.vgap||0)+(t.tgap||0)!==0&&i.element.css("top",n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)),n.vgap+n.bgap+(t.vgap||0)+(t.bgap||0)!==0&&i.element.css("bottom",n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)),i},resize:function(){},populate:function(e){BI.AbsoluteHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_horizontal_adapt",BI.AbsoluteHorizontalLayout)},function(e,t){BI.AbsoluteVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-vertical-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteVerticalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.AbsoluteVerticalLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"absolute",left:t.lgap,right:t.rgap,top:n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0),bottom:n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0),margin:"auto"}),n.hgap+n.lgap+(t.hgap||0)+(t.lgap||0)!==0&&i.element.css("left",n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)),n.hgap+n.rgap+(t.hgap||0)+(t.rgap||0)!==0&&i.element.css("right",n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)),i},resize:function(){},populate:function(e){BI.AbsoluteVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_vertical_adapt",BI.AbsoluteVerticalLayout)},function(e,t){BI.CenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var e=this.options,t=this;return BI.CenterAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:e.horizontalAlign,columnSize:e.columnSize,scrollx:e.scrollx,items:e.items,ref:function(e){t.layout=e},hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}},resize:function(){},populate:function(e){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout)},function(e,t){BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var t=this,e=this.options;return BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:e.horizontalAlign,columnSize:e.columnSize,items:e.items,scrollx:e.scrollx,ref:function(e){t.layout=e},hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}},resize:function(){},populate:function(e){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout)},function(e,t){BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){var e=this.options;BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments);var t=[];return"left"in e.items&&t.push({type:"bi.left",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:e.items.left,hgap:e.lhgap,lgap:e.llgap,rgap:e.lrgap}}]}),"right"in e.items&&t.push({type:"bi.right",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:e.items.right,textAlign:"right",hgap:e.rhgap,lgap:e.rlgap,rgap:e.rrgap}}]}),t},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(e){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var e=this.options,t=this;return BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.left",ref:function(e){t.layout=e},items:[{el:{type:"bi.vertical_adapt",height:"100%",items:e.items,lgap:e.lgap,hgap:e.hgap,rgap:e.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(e){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var e=this.options,t=this;return BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.right",ref:function(e){t.layout=e},items:[{el:{type:"bi.vertical_adapt",height:"100%",textAlign:"right",items:e.items,lgap:e.lgap,hgap:e.hgap,rgap:e.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(e){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout)},function(e,t){BI.TableAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-center-adapt-layout",columnSize:[],verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var e=this.options;BI.TableAdaptLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("<div>").css({position:"relative",display:"table",height:e.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:e.horizontalAlign===BI.HorizontalAlign.Center?"100%":"auto","white-space":"nowrap"}),this.populate(this.options.items)},_addElement:function(e,t){var n,i,r=this.options,a=r.columnSize[e]<=1?100*r.columnSize[e]+"%":r.columnSize[e];return this.hasWidget(this._getChildName(e))?(n=this.getWidgetByName(this._getChildName(e))).element.width(a):((i=BI.createWidget(t)).element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),n=BI.createWidget({type:"bi.default",width:a,items:[i]}),this.addWidget(this._getChildName(e),n)),n.element.css({"max-width":r.columnSize[e]<=1?a:a+"px"}),0===e&&n.element.addClass("first-element"),n.element.css({position:"relative",display:"table-cell","vertical-align":r.verticalAlign,margin:"0",padding:"0",height:"100%"}),r.vgap+r.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":r.vgap+r.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),r.hgap+r.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?r.hgap:0)+r.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),r.hgap+r.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":r.hgap+r.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),r.vgap+r.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":r.vgap+r.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),n},appendFragment:function(e){this.$table.append(e),this.element.append(this.$table)},resize:function(){},populate:function(e){BI.TableAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table_adapt",BI.TableAdaptLayout)},function(e,t){BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){var t=this,e=this.options;return BI.VerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:e.horizontalAlign,columnSize:e.columnSize,items:e.items,scrollx:e.scrollx,ref:function(e){t.layout=e},hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}},resize:function(){},populate:function(e){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout)},function(e,t){BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative",margin:"0px auto"}),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":(0===e?n.vgap:0)+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){},populate:function(e){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout)},function(e,t){BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var n=this,e=this.left.element.width(),t=this.left.element.height();this.left.element.width(e).height(t).css("float","none"),BI.remove(this._children,function(e,t){t===n.container&&delete n._children[e]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(e,t){var n=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[t],hgap:n.hgap,vgap:n.vgap,tgap:n.tgap,bgap:n.bgap,lgap:n.lgap,rgap:n.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(e){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout)},function(e,t){BI.InlineCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-center-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineCenterAdaptLayout.superclass.render.apply(this,arguments),this.element.css({whiteSpace:"nowrap",textAlign:"center"}),this.populate(this.options.items)},_addElement:function(e,t,n){var i=this.options,r=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return r.element.css({position:"relative","vertical-align":"middle"}),r.element.addClass("inline-center-adapt-item"),i.vgap+i.tgap+(t.tgap||0)+(t.vgap||0)!==0&&r.element.css({"margin-top":i.vgap+i.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),i.hgap+i.lgap+(t.lgap||0)+(t.hgap||0)!==0&&r.element.css({"margin-left":(0===e?i.hgap:0)+i.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),i.hgap+i.rgap+(t.rgap||0)+(t.hgap||0)!==0&&r.element.css({"margin-right":i.hgap+i.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),i.vgap+i.bgap+(t.bgap||0)+(t.vgap||0)!==0&&r.element.css({"margin-bottom":i.vgap+i.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),r},resize:function(){this.stroke(this.options.items)},addItem:function(e){throw new Error("不能添加元素")},stroke:function(n){var i=this;BI.each(n,function(e,t){t&&i._addElement(e,t,n.length)})},populate:function(e){BI.InlineCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_center_adapt",BI.InlineCenterAdaptLayout)},function(e,t){BI.InlineVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-vertical-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,textAlign:"left"})},render:function(){BI.InlineVerticalAdaptLayout.superclass.render.apply(this,arguments);var e=this.options;this.element.css({whiteSpace:"nowrap",textAlign:e.textAlign}),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","vertical-align":"middle"}),i.element.addClass("inline-vertical-adapt-item"),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?n.hgap:0)+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.InlineVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_vertical_adapt",BI.InlineVerticalAdaptLayout)},function(e,t){BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-adapt-layout",hgap:0,vgap:0})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FlexCenterLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","flex-shrink":"0","margin-left":(0===e?n.hgap:0)+"px","margin-right":n.hgap+"px","margin-top":n.vgap+"px","margin-bottom":n.vgap+"px"}),i},resize:function(){},populate:function(e){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center_adapt",BI.FlexCenterLayout)},function(e,t){BI.FlexHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-center-adapt-layout",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var t=this,e=this.options;return{type:"bi.flex_vertical",ref:function(e){t.wrapper=e},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:e.verticalAlign,rowSize:e.rowSize,scrollx:e.scrollx,scrolly:e.scrolly,scrollable:e.scrollable,hgap:e.hgap,vgap:e.vgap,tgap:e.tgap,bgap:e.bgap,items:e.items}},resize:function(){},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate(e)}}),BI.shortcut("bi.flex_horizontal_adapt",BI.FlexHorizontalCenter),BI.shortcut("bi.flex_horizontal_center_adapt",BI.FlexHorizontalCenter)},function(e,t){BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var e=this.options;this.element.addClass("v-"+e.verticalAlign).addClass("h-"+e.horizontalAlign),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","flex-shrink":"0"}),0<n.columnSize[e]&&i.element.width(n.columnSize[e]),"fill"===n.columnSize[e]&&i.element.css("flex","1"),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?n.hgap:0)+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){},populate:function(e){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout)},function(e,t){BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var t=this,e=this.options;return{type:"bi.flex_horizontal",ref:function(e){t.wrapper=e},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:e.horizontalAlign,columnSize:e.columnSize,scrollx:e.scrollx,scrolly:e.scrolly,scrollable:e.scrollable,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,hgap:e.hgap,items:e.items}},resize:function(){},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate(e)}}),BI.shortcut("bi.flex_vertical_adapt",BI.FlexVerticalCenter),BI.shortcut("bi.flex_vertical_center_adapt",BI.FlexVerticalCenter)},function(e,t){BI.FlexVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-layout",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalLayout.superclass.render.apply(this,arguments);var e=this.options;this.element.addClass("h-"+e.horizontalAlign).addClass("v-"+e.verticalAlign),this.populate(this.options.items)},_addElement:function(e,t){var n=BI.FlexVerticalLayout.superclass._addElement.apply(this,arguments),i=this.options;return n.element.css({position:"relative","flex-shrink":"0"}),0<i.rowSize[e]&&n.element.height(i.rowSize[e]),"fill"===i.rowSize[e]&&n.element.css("flex","1"),i.vgap+i.tgap+(t.tgap||0)+(t.vgap||0)!==0&&n.element.css({"margin-top":(0===e?i.vgap:0)+i.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),i.hgap+i.lgap+(t.lgap||0)+(t.hgap||0)!==0&&n.element.css({"margin-left":i.hgap+i.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),i.hgap+i.rgap+(t.rgap||0)+(t.hgap||0)!==0&&n.element.css({"margin-right":i.hgap+i.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),i.vgap+i.bgap+(t.bgap||0)+(t.vgap||0)!==0&&n.element.css({"margin-bottom":i.vgap+i.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),n},resize:function(){},populate:function(e){BI.FlexVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical",BI.FlexVerticalLayout)},function(e,t){BI.FlexWrapperCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-center-adapt-layout clearfix",scrollable:!0})},render:function(){BI.FlexWrapperCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-center-adapt-layout-wrapper"),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FlexWrapperCenterLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","margin-left":(0===e?n.hgap:0)+"px","margin-right":n.hgap+"px","margin-top":n.vgap+"px","margin-bottom":n.vgap+"px"}),i},appendFragment:function(e){this.$wrapper.append(e),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(e){BI.FlexWrapperCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_center_adapt",BI.FlexWrapperCenterLayout)},function(e,t){BI.FlexWrapperHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:!0,scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var t=this,e=this.options;return{type:"bi.flex_scrollable_vertical",ref:function(e){t.wrapper=e},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:e.verticalAlign,rowSize:e.rowSize,scrollx:e.scrollx,scrolly:e.scrolly,scrollable:e.scrollable,hgap:e.hgap,vgap:e.vgap,tgap:e.tgap,bgap:e.bgap,items:e.items}},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate(e)}}),BI.shortcut("bi.flex_scrollable_horizontal_adapt",BI.FlexWrapperHorizontalCenter),BI.shortcut("bi.flex_scrollable_horizontal_center_adapt",BI.FlexWrapperHorizontalCenter)},function(e,t){BI.FlexWrapperHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollable:null,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperHorizontalLayout.superclass.render.apply(this,arguments);var e=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-horizontal-layout-wrapper v-"+e.verticalAlign).addClass("h-"+e.horizontalAlign),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","flex-shrink":"0"}),0<n.columnSize[e]&&i.element.width(n.columnSize[e]),"fill"===n.columnSize[e]&&i.element.css("flex","1"),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?n.hgap:0)+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},appendFragment:function(e){this.$wrapper.append(e),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(e){BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_horizontal",BI.FlexWrapperHorizontalLayout)},function(e,t){BI.FlexWrapperVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var t=this,e=this.options;return{type:"bi.flex_scrollable_horizontal",ref:function(e){t.wrapper=e},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:e.horizontalAlign,columnSize:e.columnSize,scrollx:e.scrollx,scrolly:e.scrolly,scrollable:e.scrollable,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,items:e.items}},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate(e)}}),BI.shortcut("bi.flex_scrollable_vertical_adapt",BI.FlexWrapperVerticalCenter),BI.shortcut("bi.flex_scrollable_vertical_center_adapt",BI.FlexWrapperVerticalCenter)},function(e,t){BI.FlexWrapperVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:null,scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperVerticalLayout.superclass.render.apply(this,arguments);var e=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-vertical-layout-wrapper h-"+e.horizontalAlign).addClass("v-"+e.verticalAlign),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","flex-shrink":"0"}),0<n.rowSize[e]&&i.element.height(n.rowSize[e]),"fill"===n.rowSize[e]&&i.element.css("flex","1"),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":(0===e?n.vgap:0)+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},appendFragment:function(e){this.$wrapper.append(e),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(e){BI.FlexWrapperVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_vertical",BI.FlexWrapperVerticalLayout)},function(e,t){BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),r=0,a=0,o=0,s=0;return BI.isNotNull(t.left)&&(i.element.css({left:t.left}),r+=t.left),BI.isNotNull(t.right)&&(i.element.css({right:t.right}),a+=t.right),BI.isNotNull(t.top)&&(i.element.css({top:t.top}),o+=t.top),BI.isNotNull(t.bottom)&&(i.element.css({bottom:t.bottom}),s+=t.bottom),BI.isNotNull(n.hgap)&&(r+=n.hgap,i.element.css({left:r}),a+=n.hgap,i.element.css({right:a})),BI.isNotNull(n.vgap)&&(o+=n.vgap,i.element.css({top:o}),s+=n.vgap,i.element.css({bottom:s})),BI.isNotNull(n.lgap)&&(r+=n.lgap,i.element.css({left:r})),BI.isNotNull(n.rgap)&&(a+=n.rgap,i.element.css({right:a})),BI.isNotNull(n.tgap)&&(o+=n.tgap,i.element.css({top:o})),BI.isNotNull(n.bgap)&&(s+=n.bgap,i.element.css({bottom:s})),BI.isNotNull(t.width)&&i.element.css({width:t.width}),BI.isNotNull(t.height)&&i.element.css({height:t.height}),i.element.css({position:"absolute"}),i},resize:function(){this.stroke(this.options.items)},stroke:function(e){this.options.items=e||[];var n=this;BI.each(e,function(e,t){if(t){if(!BI.isWidget(t)&&!t.el)throw new Error("el must be exist");n._addElement(e,t)}})},populate:function(e){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout)},function(e,t){BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);i.element.css({position:"relative"});var r=0,a=0,o=0,s=0;return BI.isNotNull(t.left)&&i.element.css({left:t.left}),BI.isNotNull(t.right)&&i.element.css({right:t.right}),BI.isNotNull(t.top)&&i.element.css({top:t.top}),BI.isNotNull(t.bottom)&&i.element.css({bottom:t.bottom}),BI.isNotNull(n.hgap)&&(r+=n.hgap,i.element.css({"margin-left":r}),a+=n.hgap,i.element.css({"margin-right":a})),BI.isNotNull(n.vgap)&&(o+=n.vgap,i.element.css({"margin-top":o}),s+=n.vgap,i.element.css({"margin-bottom":s})),BI.isNotNull(n.lgap)&&(r+=n.lgap,i.element.css({"margin-left":r})),BI.isNotNull(n.rgap)&&(a+=n.rgap,i.element.css({"margin-right":a})),BI.isNotNull(n.tgap)&&(o+=n.tgap,i.element.css({"margin-top":o})),BI.isNotNull(n.bgap)&&(s+=n.bgap,i.element.css({"margin-bottom":s})),BI.isNotNull(t.width)&&i.element.css({width:t.width}),BI.isNotNull(t.height)&&i.element.css({height:t.height}),i},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.adaptive",BI.AdaptiveLayout)},function(e,t){BI.BorderLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.BorderLayout.superclass.props.apply(this,arguments),{baseCls:"bi-border-layout",items:{}})},render:function(){BI.BorderLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(e){throw new Error("cannot be added")},stroke:function(e){var t,n,i=0,r=0,a=0,o=0;"north"in e&&null!=(t=e.north)&&(t.el&&(this.hasWidget(this.getName()+"north")||(n=BI.createWidget(t),this.addWidget(this.getName()+"north",n)),this.getWidgetByName(this.getName()+"north").element.height(t.height).css({position:"absolute",top:t.top||0,left:t.left||0,right:t.right||0,bottom:"initial"})),i=(t.height||0)+(t.top||0)+(t.bottom||0)),"south"in e&&null!=(t=e.south)&&(t.el&&(this.hasWidget(this.getName()+"south")||(n=BI.createWidget(t),this.addWidget(this.getName()+"south",n)),this.getWidgetByName(this.getName()+"south").element.height(t.height).css({position:"absolute",bottom:t.bottom||0,left:t.left||0,right:t.right||0,top:"initial"})),r=(t.height||0)+(t.top||0)+(t.bottom||0)),"west"in e&&null!=(t=e.west)&&(t.el&&(this.hasWidget(this.getName()+"west")||(n=BI.createWidget(t),this.addWidget(this.getName()+"west",n)),this.getWidgetByName(this.getName()+"west").element.width(t.width).css({position:"absolute",left:t.left||0,top:i,bottom:r,right:"initial"})),a=(t.width||0)+(t.left||0)+(t.right||0)),"east"in e&&null!=(t=e.east)&&(t.el&&(this.hasWidget(this.getName()+"east")||(n=BI.createWidget(t),this.addWidget(this.getName()+"east",n)),this.getWidgetByName(this.getName()+"east").element.width(t.width).css({position:"absolute",right:t.right||0,top:i,bottom:r,left:"initial"})),o=(t.width||0)+(t.left||0)+(t.right||0)),"center"in e&&null!=(t=e.center)&&(this.hasWidget(this.getName()+"center")||(n=BI.createWidget(t),this.addWidget(this.getName()+"center",n)),this.getWidgetByName(this.getName()+"center").element.css({position:"absolute",top:i,bottom:r,left:a,right:o}))},update:function(e){},populate:function(e){BI.BorderLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.border",BI.BorderLayout)},function(e,t){BI.CardLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CardLayout.superclass.props.apply(this,arguments),{baseCls:"bi-card-layout",items:[]})},render:function(){BI.CardLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},stroke:function(e){var i=this,r=this.options;this.showIndex=void 0,BI.each(e,function(e,n){var t;n&&(i.hasWidget(n.cardName)?t=i.getWidgetByName(n.cardName):((t=BI.createWidget(n)).on(BI.Events.DESTROY,function(){var e=BI.findIndex(r.items,function(e,t){return t.cardName==n.cardName});-1<e&&r.items.splice(e,1)}),i.addWidget(n.cardName,t)),t.element.css({position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}),t.setVisible(!1))})},update:function(){},empty:function(){BI.CardLayout.superclass.empty.apply(this,arguments),this.options.items=[]},populate:function(e){BI.CardLayout.superclass.populate.apply(this,arguments),this._mount(),this.options.defaultShowName&&this.showCardByName(this.options.defaultShowName)},isCardExisted:function(n){return BI.some(this.options.items,function(e,t){return t.cardName==n&&t.el})},getCardByName:function(e){if(!this.isCardExisted(e))throw new Error("cardName is not exist");return this._children[e]},_deleteCardByName:function(n){delete this._children[n];var e=BI.findIndex(this.options.items,function(e,t){return t.cardName==n});-1<e&&this.options.items.splice(e,1)},deleteCardByName:function(e){if(!this.isCardExisted(e))throw new Error("cardName is not exist");var t=this._children[e];this._deleteCardByName(e),t&&t._destroy()},addCardByName:function(e,t){if(this.isCardExisted(e))throw new Error("cardName is already exist");var n=BI.createWidget(t,this);return n.element.css({position:"relative",top:"0",left:"0",width:"100%",height:"100%"}).appendTo(this.element),n.invisible(),this.addWidget(e,n),this.options.items.push({el:t,cardName:e}),n},showCardByName:function(i,r,a){var o=this,s=this.isCardExisted(i);null!=this.showIndex&&(this.lastShowIndex=this.showIndex),this.showIndex=i;var l=!1;BI.each(this.options.items,function(e,t){var n=o._children[t.cardName];n&&(i!=t.cardName?!l&&!s&&BI.Action&&r instanceof BI.Action?(r.actionBack(n),l=!0):n.invisible():BI.Action&&r instanceof BI.Action?r.actionPerformed(void 0,n,a):(n.visible(),a&&a()))})},showLastCard:function(){var n=this;this.showIndex=this.lastShowIndex,BI.each(this.options.items,function(e,t){n._children[t.cardName].setVisible(n.showIndex==e)})},setDefaultShowName:function(e){return this.options.defaultShowName=e,this},getDefaultShowName:function(){return this.options.defaultShowName},getAllCardNames:function(){return BI.map(this.options.items,function(e,t){return t.cardName})},getShowingCard:function(){if(BI.isKey(this.showIndex))return this.getWidgetByName(this.showIndex)},deleteAllCard:function(){var n=this;BI.each(this.getAllCardNames(),function(e,t){n.deleteCardByName(t)})},hideAllCard:function(){var n=this;BI.each(this.options.items,function(e,t){n._children[t.cardName].invisible()})},isAllCardHide:function(){var n=this,i=!0;return BI.some(this.options.items,function(e,t){if(n._children[t.cardName].isVisible())return i=!1}),i},removeWidget:function(n){var i;BI.isWidget(n)?BI.each(this._children,function(e,t){t===n&&(i=e)}):i=n,i&&this._deleteCardByName(i)}}),BI.shortcut("bi.card",BI.CardLayout)},function(e,t){BI.DefaultLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DefaultLayout.superclass.props.apply(this,arguments),{hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[]})},render:function(){BI.DefaultLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.DefaultLayout.superclass._addElement.apply(this,arguments);return n.vgap+n.tgap+(t.tgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)!==0&&i.element.css({"margin-left":n.hgap+n.lgap+(t.lgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+"px"}),i},resize:function(){},populate:function(e){BI.DefaultLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.default",BI.DefaultLayout)},function(e,t){BI.DivisionLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DivisionLayout.superclass.props.apply(this,arguments),{baseCls:"bi-division-layout",columns:null,rows:null,items:[]})},render:function(){BI.DivisionLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.opitons.items)},addItem:function(e){throw new Error("cannot be added")},stroke:function(e){var t=this.options,n=t.rows||t.items.length,i=t.columns||0|(t.items[0]&&t.items[0].length),r=BI.makeArray(n),a={},o={};function s(e,t,n){0===t&&e.addClass("first-row"),0===n&&e.addClass("first-col"),e.addClass(BI.isOdd(t+1)?"odd-row":"even-row"),e.addClass(BI.isOdd(n+1)?"odd-col":"even-col"),e.addClass("center-element")}function l(e,t,n){var i="";0===t&&(i+=" first-row"),0===n&&(i+=" first-col"),BI.isOdd(t+1)?i+=" odd-row":i+=" even-row",BI.isOdd(n+1)?i+=" odd-col":i+=" even-col",e.cls=(e.cls||"")+i+" center-element"}BI.each(r,function(e){r[e]=BI.makeArray(i)}),BI.each(e,function(n,i){BI.isArray(i)?BI.each(i,function(e,t){a[n]=(a[n]||0)+i.width,o[e]=(o[e]||0)+i.height,r[n][e]=t}):(a[i.row]=(a[i.row]||0)+i.width,o[i.column]=(o[i.column]||0)+i.height,r[i.row][i.column]=i)});for(var u,c,h,p=0;p<n;p++)for(var d=0,f=0;f<i;f++){if(!r[p][f])throw new Error("item be required");this.hasWidget(this.getName()+p+"_"+f)?I=this.getWidgetByName(this.getName()+p+"_"+f):(I=BI.createWidget(r[p][f]),this.addWidget(this.getName()+p+"_"+f,I));var g=100*d/a[p];I.element.css({position:"absolute",left:g+"%"}),0<f&&this.getWidgetByName(this.getName()+p+"_"+(f-1)).element.css({right:100-g+"%"}),f==t.columns-1&&I.element.css({right:"0%"}),c=p,h=f,(u=I)instanceof BI.Widget?s(u.element,c,h):u.el instanceof BI.Widget?s(u.el.element,c,h):u.el?l(u.el,c,h):l(u,c,h),d+=r[p][f].width}for(f=0;f<t.columns;f++)for(var m=0,p=0;p<t.rows;p++){var I=this.getWidgetByName(this.getName()+p+"_"+f),B=100*m/o[f];I.element.css({top:B+"%"}),0<p&&this.getWidgetByName(this.getName()+(p-1)+"_"+f).element.css({bottom:100-B+"%"}),p==t.rows-1&&I.element.css({bottom:"0%"}),m+=r[p][f].height}},update:function(){},populate:function(e){BI.DivisionLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.division",BI.DivisionLayout)},function(e,t){BI.FloatLeftLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-left-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatLeftLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FloatLeftLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","float":"left"}),BI.isNotNull(t.left)&&i.element.css({left:t.left}),BI.isNotNull(t.right)&&i.element.css({right:t.right}),BI.isNotNull(t.top)&&i.element.css({top:t.top}),BI.isNotNull(t.bottom)&&i.element.css({bottom:t.bottom}),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?n.hgap:0)+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.FloatLeftLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left",BI.FloatLeftLayout),BI.FloatRightLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatRightLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-right-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatRightLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.FloatRightLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative","float":"right"}),BI.isNotNull(t.left)&&i.element.css({left:t.left}),BI.isNotNull(t.right)&&i.element.css({right:t.right}),BI.isNotNull(t.top)&&i.element.css({top:t.top}),BI.isNotNull(t.bottom)&&i.element.css({bottom:t.bottom}),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":(0===e?n.hgap:0)+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.FloatRightLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right",BI.FloatRightLayout)},function(e,t){BI.GridLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.GridLayout.superclass.props.apply(this,arguments),{baseCls:"bi-grid-layout",columns:null,rows:null,items:[]})},render:function(){BI.GridLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(e){for(var t=this.options,n=t.rows||t.items.length,i=t.columns||0|(t.items[0]&&t.items[0].length),r=100/i,a=100/n,o=[],s=0;s<n;s++)o[s]=[];function l(e,t,n){0===t&&e.addClass("first-row"),0===n&&e.addClass("first-col"),e.addClass(BI.isOdd(t+1)?"odd-row":"even-row"),e.addClass(BI.isOdd(n+1)?"odd-col":"even-col"),e.addClass("center-element")}function u(e,t,n){var i="";0===t&&(i+=" first-row"),0===n&&(i+=" first-col"),BI.isOdd(t+1)?i+=" odd-row":i+=" even-row",BI.isOdd(n+1)?i+=" odd-col":i+=" even-col",e.cls=(e.cls||"")+i+" center-element"}BI.each(e,function(n,e){BI.isArray(e)?BI.each(e,function(e,t){o[n][e]=BI.createWidget(t)}):o[e.row][e.column]=BI.createWidget(e)});for(var c,h,p,s=0;s<n;s++)for(var d=0;d<i;d++)o[s][d]||(o[s][d]=BI.createWidget({type:"bi.layout"})),c=o[s][d],h=s,p=d,c instanceof BI.Widget?l(c.element,h,p):c.el instanceof BI.Widget?l(c.el.element,h,p):c.el?u(c.el,h,p):u(c,h,p),o[s][d].element.css({position:"absolute",top:a*s+"%",left:r*d+"%",right:100-r*(d+1)+"%",bottom:100-a*(s+1)+"%"}),this.addWidget(o[s][d])},update:function(){},populate:function(e){BI.GridLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.grid",BI.GridLayout)},function(e,t){BI.HorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var e=this.options;BI.HorizontalLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("<table>").attr({cellspacing:0,cellpadding:0}).css({position:"relative","white-space":"nowrap",height:e.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:e.horizontalAlign===BI.HorizontalAlign.Center||e.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=BI.Widget._renderEngine.createElement("<tr>"),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(e,t){var n,i,r=this.options,a=r.columnSize[e]<=1?100*r.columnSize[e]+"%":r.columnSize[e];return this.hasWidget(this._getChildName(e))?(n=this.getWidgetByName(this._getChildName(e))).element.attr("width",a):((i=BI.createWidget(t)).element.css({position:"relative",margin:"0px auto"}),n=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:a},items:[i]}),this.addWidget(this._getChildName(e),n)),n.element.css({"max-width":r.columnSize[e]<=1?a:a+"px"}),0===e&&n.element.addClass("first-element"),n.element.css({position:"relative","vertical-align":r.verticalAlign,margin:"0",padding:"0",border:"none"}),r.vgap+r.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":r.vgap+r.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),r.hgap+r.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?r.hgap:0)+r.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),r.hgap+r.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":r.hgap+r.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),r.vgap+r.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":r.vgap+r.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),n},appendFragment:function(e){this.$tr.append(e),this.element.append(this.$table)},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(e){BI.HorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal",BI.HorizontalLayout),BI.HorizontalCellLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-cell-layout",scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCellLayout.superclass.render.apply(this,arguments),this.element.css({display:"table","vertical-align":"top"}),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.HorizontalCellLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative",display:"table-cell","vertical-align":"middle"}),0<n.hgap+n.lgap&&i.element.css({"margin-left":n.hgap+n.lgap+"px"}),0<n.hgap+n.rgap&&i.element.css({"margin-right":n.hgap+n.rgap+"px"}),0<n.vgap+n.tgap&&i.element.css({"margin-top":n.vgap+n.tgap+"px"}),0<n.vgap+n.bgap&&i.element.css({"margin-bottom":n.vgap+n.bgap+"px"}),i},resize:function(){},populate:function(e){BI.HorizontalCellLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_cell",BI.HorizontalCellLayout)},function(e,t){BI.InlineLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.InlineLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative",display:"inline-block","*display":"inline","*zoom":1}),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":(0===e?n.hgap:0)+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.InlineLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline",BI.InlineLayout)},function(e,t){BI.LatticeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LatticeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-lattice-layout clearfix"})},render:function(){BI.LatticeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n,i=this.options,r=BI.LatticeLayout.superclass._addElement.apply(this,arguments);return n=i.columnSize&&i.columnSize[e]?i.columnSize[e]/BI.sum(i.columnSize)*100+"%":1/this.options.items.length*100+"%",r.element.css({position:"relative","float":"left",width:n}),r},addItem:function(e){var t=BI.LatticeLayout.superclass.addItem.apply(this,arguments);return this.resize(),t},addItemAt:function(e){var t=BI.LatticeLayout.superclass.addItemAt.apply(this,arguments);return this.resize(),t},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.LatticeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.lattice",BI.LatticeLayout)},function(e,t){BI.TableLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-layout",scrolly:!0,columnSize:[200,200,"fill"],rowSize:30,hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TableLayout.superclass.render.apply(this,arguments),this.rows=0,this.populate(this.options.items)},_addElement:function(e,t){var n,i,r=this.options,a=[],o=0,s=0;function l(e,t,n){0===t&&e.addClass("first-row"),0===n&&e.addClass("first-col"),e.addClass(BI.isOdd(t+1)?"odd-row":"even-row"),e.addClass(BI.isOdd(n+1)?"odd-col":"even-col"),e.addClass("center-element")}function u(e,t,n){var i="";0===t&&(i+=" first-row"),0===n&&(i+=" first-col"),BI.isOdd(t+1)?i+=" odd-row":i+=" even-row",BI.isOdd(n+1)?i+=" odd-col":i+=" even-col",e.cls=(e.cls||"")+i+" center-element"}function c(e,t,n){e instanceof BI.Widget?l(e.element,t,n):e.el instanceof BI.Widget?l(e.el.element,t,n):e.el?u(e.el,t,n):u(e,t,n)}for(n=0;n<t.length&&BI.isNumber(r.columnSize[n]);n++)c(t[n],this.rows,n),a.push(BI.extend({top:0,bottom:0,left:r.columnSize[n]<=1?100*o+"%":o,width:r.columnSize[n]<=1?100*r.columnSize[n]+"%":r.columnSize[n]},t[n])),o+=r.columnSize[n]+(r.columnSize[n]<1?0:r.hgap);for(i=t.length-1;n<i;i--){if(!BI.isNumber(r.columnSize[i]))throw new Error("item with fill can only be one");c(t[i],this.rows,i),a.push(BI.extend({top:0,bottom:0,right:r.columnSize[i]<=1?100*s+"%":s,width:r.columnSize[i]<=1?100*r.columnSize[i]+"%":r.columnSize[i]},t[i])),s+=r.columnSize[i]+(r.columnSize[i]<1?0:r.hgap)}0<=n&&n<t.length&&(c(t[n],this.rows,n),a.push(BI.extend({top:0,bottom:0,left:o<=1?100*o+"%":o,right:s<=1?100*s+"%":s},t[n])));var h=BI.createWidget({type:"bi.absolute",height:BI.isArray(r.rowSize)?r.rowSize[this.rows]:r.rowSize,items:a});return 0<this.rows&&this.getWidgetByName(this.getName()+(this.rows-1)).element.css({"margin-bottom":r.vgap}),h.element.css({position:"relative"}),this.addWidget(this.getName()+this.rows++,h),h},resize:function(){},addItem:function(e){if(!BI.isArray(e))throw new Error("item must be array");return BI.TableLayout.superclass.addItem.apply(this,arguments)},update:function(){},populate:function(e){BI.TableLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table",BI.TableLayout)},function(e,t){BI.HTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-h-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{width:100,el:{type:"bi.button",text:"button1"}},{width:"fill",el:{type:"bi.button",text:"button2"}},{width:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.HTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(e){throw new Error("cannot be added")},stroke:function(i){var r=this,a=this.options;i=BI.compact(i),BI.each(i,function(e,t){var n;r.hasWidget(r.getName()+e+"")?n=r.getWidgetByName(r.getName()+e+""):(n=BI.createWidget(t),r.addWidget(r.getName()+e+"",n)),n.element.css({position:"absolute",top:(t.vgap||0)+(t.tgap||0)+a.vgap+a.tgap+"px",bottom:(t.bgap||0)+(t.vgap||0)+a.vgap+a.bgap+"px"})});var o={},s={};o[0]=0,s[i.length-1]=0,BI.any(i,function(e,t){var n=r.getWidgetByName(r.getName()+e+"");if(BI.isNull(o[e])&&(o[e]=o[e-1]+i[e-1].width+(i[e-1].lgap||0)+2*(i[e-1].hgap||0)+a.hgap+a.lgap+a.rgap),t.width<1&&0<=t.width?n.element.css({left:100*o[e]+"%",width:100*t.width+"%"}):n.element.css({left:o[e]+(t.lgap||0)+(t.hgap||0)+a.hgap+a.lgap+"px",width:BI.isNumber(t.width)?t.width:""}),!BI.isNumber(t.width))return!0}),BI.backAny(i,function(e,t){var n=r.getWidgetByName(r.getName()+e+"");if(BI.isNull(s[e])&&(s[e]=s[e+1]+i[e+1].width+(i[e+1].rgap||0)+2*(i[e+1].hgap||0)+a.hgap+a.lgap+a.rgap),t.width<1&&0<=t.width?n.element.css({right:100*s[e]+"%",width:100*t.width+"%"}):n.element.css({right:s[e]+(t.rgap||0)+(t.hgap||0)+a.hgap+a.rgap+"px",width:BI.isNumber(t.width)?t.width:""}),!BI.isNumber(t.width))return!0})},update:function(){var n;return BI.each(this._children,function(e,t){n=t.update()||n}),n},populate:function(e){BI.HTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.htape",BI.HTapeLayout),BI.VTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-v-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(e){throw new Error("cannot be added")},stroke:function(i){var r=this,a=this.options;i=BI.compact(i),BI.each(i,function(e,t){var n;r.hasWidget(r.getName()+e+"")?n=r.getWidgetByName(r.getName()+e+""):(n=BI.createWidget(t),r.addWidget(r.getName()+e+"",n)),n.element.css({position:"absolute",left:(t.lgap||0)+(t.hgap||0)+a.hgap+a.lgap+"px",right:+(t.hgap||0)+(t.rgap||0)+a.hgap+a.rgap+"px"})});var o={},s={};o[0]=0,s[i.length-1]=0,BI.any(i,function(e,t){var n=r.getWidgetByName(r.getName()+e+"");if(BI.isNull(o[e])&&(o[e]=o[e-1]+i[e-1].height+(i[e-1].tgap||0)+2*(i[e-1].vgap||0)+a.vgap+a.tgap+a.bgap),t.height<1&&0<=t.height?n.element.css({top:100*o[e]+"%",height:100*t.height+"%"}):n.element.css({top:o[e]+(t.vgap||0)+(t.tgap||0)+a.vgap+a.tgap+"px",height:BI.isNumber(t.height)?t.height:""}),!BI.isNumber(t.height))return!0}),BI.backAny(i,function(e,t){var n=r.getWidgetByName(r.getName()+e+"");if(BI.isNull(s[e])&&(s[e]=s[e+1]+i[e+1].height+(i[e+1].bgap||0)+2*(i[e+1].vgap||0)+a.vgap+a.tgap+a.bgap),t.height<1&&0<=t.height?n.element.css({bottom:100*s[e]+"%",height:100*t.height+"%"}):n.element.css({bottom:s[e]+(t.vgap||0)+(t.bgap||0)+a.vgap+a.bgap+"px",height:BI.isNumber(t.height)?t.height:""}),!BI.isNumber(t.height))return!0})},update:function(){},populate:function(e){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout)},function(e,t){BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("<table>").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(e,t){var n=this.options;function i(e,t,n){0===t&&e.addClass("first-row"),0===n&&e.addClass("first-col"),e.addClass(BI.isOdd(t+1)?"odd-row":"even-row"),e.addClass(BI.isOdd(n+1)?"odd-col":"even-col"),e.addClass("center-element")}function r(e,t,n){var i="";0===t&&(i+=" first-row"),0===n&&(i+=" first-col"),BI.isOdd(t+1)?i+=" odd-row":i+=" even-row",BI.isOdd(n+1)?i+=" odd-col":i+=" even-col",e.cls=(e.cls||"")+i+" center-element"}for(var a,o,s,l=BI.createWidget({type:"bi.default",tagName:"tr"}),u=0;u<t.length;u++){var c=BI.createWidget(t[u]);c.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),t[u].lgap&&c.element.css({"margin-left":t[u].lgap+"px"}),t[u].rgap&&c.element.css({"margin-right":t[u].rgap+"px"}),t[u].tgap&&c.element.css({"margin-top":t[u].tgap+"px"}),t[u].bgap&&c.element.css({"margin-bottom":t[u].bgap+"px"}),a=c,o=this.rows++,s=u,a instanceof BI.Widget?i(a.element,o,s):a.el instanceof BI.Widget?i(a.el.element,o,s):a.el?r(a.el,o,s):r(a,o,s);var h=BI.createWidget({type:"bi.default",attributes:{width:n.columnSize[u]<=1?100*n.columnSize[u]+"%":n.columnSize[u]},tagName:"td",items:[c]});h.element.css({position:"relative","vertical-align":"middle",margin:"0",padding:"0",border:"none"}),l.addItem(h)}return this.addWidget(this.getName()+e,l),l},appendFragment:function(e){this.$table.append(e),this.element.append(this.$table)},resize:function(){},addItem:function(e){if(!BI.isArray(e))throw new Error("item must be array");return BI.TdLayout.superclass.addItem.apply(this,arguments)},update:function(){},populate:function(e){BI.TdLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.td",BI.TdLayout)},function(e,t){BI.VerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-vertical-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,scrolly:!0})},render:function(){BI.VerticalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(e,t){var n=this.options,i=BI.VerticalLayout.superclass._addElement.apply(this,arguments);return i.element.css({position:"relative"}),n.vgap+n.tgap+(t.tgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-top":(0===e?n.vgap:0)+n.tgap+(t.tgap||0)+(t.vgap||0)+"px"}),n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-left":n.hgap+n.lgap+(t.lgap||0)+(t.hgap||0)+"px"}),n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)!==0&&i.element.css({"margin-right":n.hgap+n.rgap+(t.rgap||0)+(t.hgap||0)+"px"}),n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)!==0&&i.element.css({"margin-bottom":n.vgap+n.bgap+(t.bgap||0)+(t.vgap||0)+"px"}),i},resize:function(){this.stroke(this.options.items)},populate:function(e){BI.VerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vertical",BI.VerticalLayout)},function(e,t){BI.WindowLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.WindowLayout.superclass.props.apply(this,arguments),{baseCls:"bi-window-layout",columns:3,rows:2,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,columnSize:[100,"fill",200],rowSize:[100,"fill"],items:[[{el:{type:"bi.button",text:"button1"}},{el:{type:"bi.button",text:"button2"}},{el:{type:"bi.button",text:"button3"}}]]})},render:function(){BI.WindowLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(e){throw new Error("cannot be added")},stroke:function(e){var t=this.options;function i(e,t,n){0===t&&e.addClass("first-row"),0===n&&e.addClass("first-col"),e.addClass(BI.isOdd(t+1)?"odd-row":"even-row"),e.addClass(BI.isOdd(n+1)?"odd-col":"even-col"),e.addClass("center-element")}function r(e,t,n){var i="";0===t&&(i+=" first-row"),0===n&&(i+=" first-col"),BI.isOdd(t+1)?i+=" odd-row":i+=" even-row",BI.isOdd(n+1)?i+=" odd-col":i+=" even-col",e.cls=(e.cls||"")+i+" center-element"}function n(e,t,n){e instanceof BI.Widget?i(e.element,t,n):e.el instanceof BI.Widget?i(e.el.element,t,n):e.el?r(e.el,t,n):r(e,t,n)}BI.isNumber(t.rowSize)&&(t.rowSize=BI.makeArray(t.items.length,1/t.items.length)),BI.isNumber(t.columnSize)&&(t.columnSize=BI.makeArray(t.items[0].length,1/t.items[0].length));for(var a=0;a<t.rows;a++)for(var o=0;o<t.columns;o++){if(!t.items[a][o])throw new Error("item be required");this.hasWidget(this.getName()+a+"_"+o)||((m=BI.createWidget(t.items[a][o])).element.css({position:"absolute"}),this.addWidget(this.getName()+a+"_"+o,m))}var s={},l={},u={},c={};u[s[0]=0]=0,l[t.columns-1]=0;for(a=c[t.rows-1]=0;a<t.rows;a++){for(o=0;o<t.columns;o++){var h=this.getWidgetByName(this.getName()+a+"_"+o);BI.isNull(u[a])&&(u[a]=u[a-1]+(t.rowSize[a-1]<1?t.rowSize[a-1]:t.rowSize[a-1]+t.vgap+t.bgap));var p=u[a]<=1?100*u[a]+"%":u[a]+t.vgap+t.tgap+"px",d="";BI.isNumber(t.rowSize[a])&&(d=t.rowSize[a]<=1?100*t.rowSize[a]+"%":t.rowSize[a]+"px"),h.element.css({top:p,height:d}),n(h,a,o)}if(!BI.isNumber(t.rowSize[a]))break}for(a=t.rows-1;0<=a;a--){for(o=0;o<t.columns;o++){h=this.getWidgetByName(this.getName()+a+"_"+o);BI.isNull(c[a])&&(c[a]=c[a+1]+(t.rowSize[a+1]<1?t.rowSize[a+1]:t.rowSize[a+1]+t.vgap+t.tgap));var f=c[a]<=1?100*c[a]+"%":c[a]+t.vgap+t.bgap+"px",d="";BI.isNumber(t.rowSize[a])&&(d=t.rowSize[a]<=1?100*t.rowSize[a]+"%":t.rowSize[a]+"px"),h.element.css({bottom:f,height:d}),n(h,a,o)}if(!BI.isNumber(t.rowSize[a]))break}for(o=0;o<t.columns;o++){for(a=0;a<t.rows;a++){h=this.getWidgetByName(this.getName()+a+"_"+o);BI.isNull(s[o])&&(s[o]=s[o-1]+(t.columnSize[o-1]<1?t.columnSize[o-1]:t.columnSize[o-1]+t.hgap+t.rgap));var g=s[o]<=1?100*s[o]+"%":s[o]+t.hgap+t.lgap+"px",m="";BI.isNumber(t.columnSize[o])&&(m=t.columnSize[o]<=1?100*t.columnSize[o]+"%":t.columnSize[o]+"px"),h.element.css({left:g,width:m}),n(h,a,o)}if(!BI.isNumber(t.columnSize[o]))break}for(o=t.columns-1;0<=o;o--){for(a=0;a<t.rows;a++){h=this.getWidgetByName(this.getName()+a+"_"+o);BI.isNull(l[o])&&(l[o]=l[o+1]+(t.columnSize[o+1]<1?t.columnSize[o+1]:t.columnSize[o+1]+t.hgap+t.lgap));var I=l[o]<=1?100*l[o]+"%":l[o]+t.hgap+t.rgap+"px",m="";BI.isNumber(t.columnSize[o])&&(m=t.columnSize[o]<=1?100*t.columnSize[o]+"%":t.columnSize[o]+"px"),h.element.css({right:I,width:m}),n(h,a,o)}if(!BI.isNumber(t.columnSize[o]))break}},update:function(){},populate:function(e){BI.WindowLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.window",BI.WindowLayout)},function(e,t){BI.CenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-center-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.CenterLayout.superclass.render.apply(this,arguments);var t=this,i=this.options,r=[],n=i.items;return BI.each(n,function(e){r.push({column:e,row:0,el:BI.createWidget({type:"bi.default",cls:"center-element "+(0===e?"first-element ":"")+(e===n.length-1?"last-element":"")})})}),BI.each(n,function(e,t){var n;t&&((n=BI.createWidget(t)).element.css({position:"absolute",left:i.hgap+i.lgap,right:i.hgap+i.rgap,top:i.vgap+i.tgap,bottom:i.vgap+i.bgap,width:"auto",height:"auto"}),r[e].el.addItem(n))}),{type:"bi.grid",ref:function(e){t.wrapper=e},columns:r.length,rows:1,items:r}},resize:function(){},addItem:function(e){throw new Error("cannot be added")},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate.apply(this.wrapper,arguments)}}),BI.shortcut("bi.center",BI.CenterLayout)},function(e,t){BI.FloatCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-center-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatCenterLayout.superclass.render.apply(this,arguments);var t=this,i=this.options,n=i.items,r=[],a=100/n.length;return BI.each(n,function(e){var t=BI.createWidget({type:"bi.default"});t.element.addClass("center-element "+(0===e?"first-element ":"")+(e===n.length-1?"last-element":"")).css({width:a+"%",height:"100%"}),r.push({el:t})}),BI.each(n,function(e,t){var n;t&&((n=BI.createWidget(t)).element.css({position:"absolute",left:i.hgap+i.lgap,right:i.hgap+i.rgap,top:i.vgap+i.tgap,bottom:i.vgap+i.bgap,width:"auto",height:"auto"}),r[e].el.addItem(n))}),{type:"bi.left",ref:function(e){t.wrapper=e},items:r}},resize:function(){},addItem:function(e){throw new Error("cannot be added")},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate.apply(this.wrapper,arguments)}}),BI.shortcut("bi.float_center",BI.FloatCenterLayout)},function(e,t){BI.HorizontalCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-center-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCenterLayout.superclass.render.apply(this,arguments);var t=this,i=this.options,n=i.items,r=[];return BI.each(n,function(e){r.push({column:e,row:0,el:BI.createWidget({type:"bi.default",cls:"center-element "+(0===e?"first-element ":"")+(e===n.length-1?"last-element":"")})})}),BI.each(n,function(e,t){var n;t&&((n=BI.createWidget(t)).element.css({position:"absolute",left:i.hgap+i.lgap,right:i.hgap+i.rgap,top:i.vgap+i.tgap,bottom:i.vgap+i.bgap,width:"auto"}),r[e].el.addItem(n))}),{type:"bi.grid",ref:function(e){t.wrapper=e},columns:r.length,rows:1,items:r}},resize:function(){},addItem:function(e){throw new Error("cannot be added")},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate.apply(this.wrapper,arguments)}}),BI.shortcut("bi.horizontal_center",BI.HorizontalCenterLayout)},function(e,t){BI.VerticalCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VerticalCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-vertical-center-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.VerticalCenterLayout.superclass.render.apply(this,arguments);var t=this,i=this.options,n=i.items,r=[];return BI.each(n,function(e){r.push({column:0,row:e,el:BI.createWidget({type:"bi.default",cls:"center-element "+(0===e?"first-element ":"")+(e===n.length-1?"last-element":"")})})}),BI.each(n,function(e,t){var n;t&&((n=BI.createWidget(t)).element.css({position:"absolute",left:i.hgap+i.lgap,right:i.hgap+i.rgap,top:i.vgap+i.tgap,bottom:i.vgap+i.bgap,height:"auto"}),r[e].el.addItem(n))}),{type:"bi.grid",ref:function(e){t.wrapper=e},columns:1,rows:r.length,items:r}},resize:function(){},addItem:function(e){throw new Error("cannot be added")},update:function(e){return this.wrapper.update(e)},populate:function(e){this.wrapper.populate.apply(this.wrapper,arguments)}}),BI.shortcut("bi.vertical_center",BI.VerticalCenterLayout)},function(e,t){BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_assertTip:function(){var e=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:e.tipText,height:25}),BI.createWidget({type:"bi.absolute_center_adapt",element:this,items:[this._tipText]}))},loading:function(){var e=this.options,t=BI.isIE(),n=BI.createWidget({type:"bi.horizontal",cls:"bi-loading-widget"+(t?" wave-loading hack":""),height:30,width:30,hgap:5,vgap:2.5,items:t?[]:[{type:"bi.layout",cls:"animate-rect rect1",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect2",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect3",height:25,width:3}]});this.setTipVisible(!1),!0===e.overlap?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.absolute_center_adapt",cls:"loading-container",items:[{el:n}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(this.getName())):BI.isNull(this._loading)&&(this._loading=n,this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute_center_adapt",element:this,cls:"loading-container",items:[{el:this._loading,left:0,right:0,top:0}]})),this.element.addClass("loading-status")},loaded:function(){var e=this.options;BI.Layers.remove(this.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._loading=null),e.onLoaded(),this.fireEvent(BI.Pane.EVENT_LOADED),this.element.removeClass("loading-status")},check:function(){this.setTipVisible(BI.isEmpty(this.options.items))},setTipVisible:function(e){!0===e?(this._assertTip(),this._tipText.setVisible(!0)):this._tipText&&this._tipText.setVisible(!1)},populate:function(e){this.options.items=e||[],this.check()},empty:function(){}}),BI.Pane.EVENT_LOADED="EVENT_LOADED"},function(e,t){BI.Single=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.Single.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-single",readonly:!1,title:null,warningTitle:null,tipType:null,value:null,belowMouse:!1})},_showToolTip:function(e,t){t=t||{};var n=this.options,i=this.getTipType()||(this.isEnabled()?"success":"warning"),r="success"!==i&&this.getWarningTitle()||this.getTitle();BI.isKey(r)&&(BI.Tooltips.show(e,this.getName(),r,i,this,t),n.action&&BI.Actions.runAction(n.action,"hover",n,this),BI.Actions.runGlobalAction("hover",n,this))},_hideTooltip:function(){var e=this,t=BI.Tooltips.get(this.getName());BI.isNotNull(t)&&t.element.fadeOut(200,function(){BI.Tooltips.remove(e.getName())})},_init:function(){BI.Single.superclass._init.apply(this,arguments);var e=this.options;(BI.isKey(e.title)||BI.isKey(e.warningTitle)||BI.isFunction(e.title)||BI.isFunction(e.warningTitle))&&this.enableHover({belowMouse:e.belowMouse,container:e.container})},_clearTimeOut:function(){BI.isNotNull(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=null),BI.isNotNull(this.hideTimeout)&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},enableHover:function(t){t=t||{};var n=this;this._hoverBinded||(this.element.on("mouseenter.title"+this.getName(),function(e){n._e=e,"warning"===n.getTipType()||BI.isKey(n.getWarningTitle())&&!n.isEnabled()?n.showTimeout=BI.delay(function(){BI.isNotNull(n.showTimeout)&&n._showToolTip(n._e||e,t)},200):"success"!==n.getTipType()&&!n.isEnabled()||(n.showTimeout=BI.delay(function(){BI.isNotNull(n.showTimeout)&&n._showToolTip(n._e||e,t)},500))}),this.element.on("mousemove.title"+this.getName(),function(e){n._e=e,BI.isNotNull(n.showTimeout)&&(clearTimeout(n.showTimeout),n.showTimeout=null),BI.isNull(n.hideTimeout)&&(n.hideTimeout=BI.delay(function(){BI.isNotNull(n.hideTimeout)&&n._hideTooltip()},500)),n.showTimeout=BI.delay(function(){BI.isNotNull(n.showTimeout)&&(BI.isNotNull(n.hideTimeout)&&(clearTimeout(n.hideTimeout),n.hideTimeout=null),n.element.__isMouseInBounds__(n._e||e)&&n._showToolTip(n._e||e,t))},500)}),this.element.on("mouseleave.title"+this.getName(),function(e){n._e=null,n._clearTimeOut(),n._hideTooltip()}),this._hoverBinded=!0)},disabledHover:function(){this._clearTimeOut(),this._hideTooltip(),this.element.unbind("mouseenter.title"+this.getName()).unbind("mousemove.title"+this.getName()).unbind("mouseleave.title"+this.getName()),this._hoverBinded=!1},populate:function(e){this.items=e||[]},setTitle:function(e,t){this.options.title=e,BI.isKey(e)||BI.isFunction(e)?this.enableHover(t):this.disabledHover()},setWarningTitle:function(e,t){this.options.warningTitle=e,BI.isKey(e)||BI.isFunction(e)?this.enableHover(t):this.disabledHover()},setTipType:function(e){this.options.tipType=e},getTipType:function(){return this.options.tipType},isReadOnly:function(){return!!this.options.readonly},getTitle:function(){var e=this.options.title;return BI.isFunction(e)?e():e},getWarningTitle:function(){var e=this.options.warningTitle;return BI.isFunction(e)?e():e},setValue:function(e){this.options.readonly||(this.options.value=e)},getValue:function(){return this.options.value},_unMount:function(){BI.Single.superclass._unMount.apply(this,arguments),BI.isNotNull(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=null),BI.Tooltips.remove(this.getName())}})},function(e,t){BI.Text=BI.inherit(BI.Single,{props:{baseCls:"bi-text",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",py:"",highLight:!1},render:function(){var e=this,t=this.options;0<t.hgap+t.lgap&&this.element.css({"padding-left":t.hgap+t.lgap+"px"}),0<t.hgap+t.rgap&&this.element.css({"padding-right":t.hgap+t.rgap+"px"}),0<t.vgap+t.tgap&&this.element.css({"padding-top":t.vgap+t.tgap+"px"}),0<t.vgap+t.bgap&&this.element.css({"padding-bottom":t.vgap+t.bgap+"px"}),BI.isNumber(t.height)&&this.element.css({lineHeight:t.height+"px"}),BI.isNumber(t.lineHeight)&&this.element.css({lineHeight:t.lineHeight+"px"}),BI.isWidthOrHeight(t.maxWidth)&&this.element.css({maxWidth:t.maxWidth}),this.element.css({textAlign:t.textAlign,whiteSpace:this._getTextWrap(),textOverflow:"nowrap"===t.whiteSpace?"ellipsis":"",overflow:"nowrap"!==t.whiteSpace&&BI.isWidthOrHeight(t.height)?"auto":""}),t.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){t.handler(e.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this;var n=this._getShowText();BI.isKey(n)?this.setText(n):BI.isKey(t.value)&&this.setText(t.value),BI.isKey(t.keyword)&&this.doRedMark(t.keyword),t.highLight&&this.doHighLight()},_getTextWrap:function(){switch(this.options.whiteSpace){case"nowrap":return"pre";case"normal":default:return"pre-wrap"}},_getShowText:function(){var e=this.options;return BI.isFunction(e.text)?e.text():e.text},doRedMark:function(e){var t=this.options;t.keyword=e,this.text.element.__textKeywordMarked__(this._getShowText()||t.value,e,t.py)},unRedMark:function(){var e=this.options;e.keyword="",this.text.element.__textKeywordMarked__(this._getShowText()||e.value,"",e.py)},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(e){BI.Text.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(e)},setStyle:function(e){this.text.element.css(e)},setText:function(e){BI.Text.superclass.setText.apply(this,arguments),this.options.text=BI.isNotNull(e)?e:"",BI.isIE9Below()?this.text.element.html(BI.htmlEncode(this._getShowText())):(this.text.element[0].textContent=this._getShowText(),BI.isKey(this.options.keyword)&&this.doRedMark(this.options.keyword))}}),BI.shortcut("bi.text",BI.Text)},function(e,t){BI.BasicButton=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.BasicButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-basic-button"+(e.invalid?"":" cursor-pointer")+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),value:"",text:"",stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn,bubble:null})},_init:function(){BI.BasicButton.superclass._init.apply(this,arguments);var e=this.options;!0===e.selected&&BI.nextTick(BI.bind(function(){this.setSelected(e.selected)},this)),BI.nextTick(BI.bind(this.bindEvent,this)),e.shadow&&this._createShadow(),e.level&&this.element.addClass("button-"+e.level)},_createShadow:function(){var t=this,n=this.options,i=function(){t.$mask||(t.$mask=BI.createWidget(BI.isObject(n.shadow)?n.shadow:{},{type:"bi.layout",cls:"bi-button-mask"}),t.$mask.invisible(),BI.createWidget({type:"bi.absolute",element:t,items:[{el:t.$mask,left:0,right:0,top:0,bottom:0}]}))};this.element.mouseup(function(){t._hover||n.isShadowShowingOnSelected||(i(),t.$mask.invisible())}),this.element.on("mouseenter."+this.getName(),function(e){t.element.__isMouseInBounds__(e)&&(!t.isEnabled()||t._hover||!n.isShadowShowingOnSelected&&t.isSelected()||(i(),t.$mask.visible()))}),this.element.on("mousemove."+this.getName(),function(e){t.element.__isMouseInBounds__(e)||t.isEnabled()&&!t._hover&&(i(),t.$mask.invisible())}),this.element.on("mouseleave."+this.getName(),function(){t.isEnabled()&&!t._hover&&(i(),t.$mask.invisible())})},bindEvent:function(){var e,n,a=this,o=this.options,s=this.handle();function l(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()}function u(e){if(l(e),!(!a.isEnabled()||a.isOnce()&&a.isSelected())){var t;if(BI.isKey(o.bubble)||BI.isFunction(o.bubble))return BI.isNull(a.combo)&&BI.createWidget({type:"bi.absolute",element:a,items:[{el:{type:"bi.bubble_combo",trigger:"",destroyWhenHide:!0,ref:function(){a.combo=this},el:{type:"bi.layout",height:"100%"},popup:{type:"bi.text_bubble_bar_popup_view",text:i(),ref:function(){t=this},listeners:[{eventName:BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,action:function(e){a.combo.hideView(),e&&n.apply(a,arguments)}}]},listeners:[{eventName:BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,action:function(){t.populate(i())}}]},left:0,right:0,bottom:0,top:0}]}),void(a.combo.isViewVisible()?a.combo.hideView():a.combo.showView());n.apply(a,arguments)}}function i(){var e=a.options.bubble;return BI.isFunction(e)?e():e}s&&(s=s.element,e=(o.trigger||"").split(","),BI.each(e,function(e,t){switch(t){case"mouseup":var n=!1;s.mousedown(function(){n=!0}),s.mouseup(function(e){!0===n&&u(e),n=!1,l(e)});break;case"mousedown":var n=!1,i=!1;s.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+a.getName(),function(e){!BI.DOM.isExist(a)||s.__isMouseInBounds__(e)||!0!==n||i||a._trigger(),n=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+a.getName())}),!0!==n&&(a.isSelected()?i=!0:u(e),n=!0,l(e))}),s.mouseup(function(e){BI.DOM.isExist(a)&&!0===n&&!0===i&&u(e),i=n=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+a.getName())});break;case"dblclick":s.dblclick(u);break;case"lclick":var r,n=!1;s.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+a.getName(),function(e){r&&clearInterval(r),r=null,n=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+a.getName())}),!0!==n&&(!a.isEnabled()||a.isOnce()&&a.isSelected()||(r=setInterval(function(){a.isEnabled()&&a.doClick()},180),n=!0,l(e)))});break;default:(o.stopEvent||o.stopPropagation)&&s.mousedown(function(e){l(e)}),s.click(u)}}),n=BI.debounce(this._doClick,BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))},_trigger:function(e){var t,n=this.options;this.isEnabled()&&(this.isDisableSelected()||(this.isForceSelected()?this.setSelected(!0):this.isForceNotSelected()?this.setSelected(!1):this.setSelected(!this.isSelected())),this.isValid()&&(n.handler.call(this,this.getValue(),this,e),t=this.getValue(),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,t,this,e),this.fireEvent(BI.BasicButton.EVENT_CHANGE,t,this),n.action&&BI.Actions.runAction(n.action,"click",n,this),BI.Actions.runGlobalAction("click",n,this)))},_doClick:function(e){this.isValid()&&this.beforeClick(e),this._trigger(e),this.isValid()&&this.doClick(e)},beforeClick:function(){},doClick:function(){},handle:function(){return this},hover:function(){this._hover=!0,this.handle().element.addClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!0)},dishover:function(){this._hover=!1,this.handle().element.removeClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},setSelected:function(e){var t=this.options;(t.selected=e)?this.handle().element.addClass("active"):this.handle().element.removeClass("active"),t.shadow&&!t.isShadowShowingOnSelected&&this.$mask&&this.$mask.setVisible(!1)},isSelected:function(){return this.options.selected},isOnce:function(){return this.options.once},isForceSelected:function(){return this.options.forceSelected},isForceNotSelected:function(){return this.options.forceNotSelected},isDisableSelected:function(){return this.options.disableSelected},setText:function(e){this.options.text=e},getText:function(){return this.options.text},_setEnable:function(e){BI.BasicButton.superclass._setEnable.apply(this,arguments),!0===e?this.element.removeClass("base-disabled disabled"):!1===e&&this.element.addClass("base-disabled disabled"),e||this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},empty:function(){BI.Widget._renderEngine.createElement(document).unbind("mouseup."+this.getName()),BI.BasicButton.superclass.empty.apply(this,arguments)},destroy:function(){BI.BasicButton.superclass.destroy.apply(this,arguments)}}),BI.BasicButton.EVENT_CHANGE="BasicButton.EVENT_CHANGE"},function(e,t){BI.NodeButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.NodeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-node",open:!1})},_init:function(){BI.NodeButton.superclass._init.apply(this,arguments);var e=this;BI.nextTick(function(){e.setOpened(e.isOpened())})},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.setOpened(!this.isOpened())},isOnce:function(){return!1},isOpened:function(){return!!this.options.open},setOpened:function(e){this.options.open=!!e},triggerCollapse:function(){this.isOpened()&&(this.setOpened(!1),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,this.getValue(),this))},triggerExpand:function(){this.isOpened()||(this.setOpened(!0),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,this.getValue(),this))}})},function(e,t){BI.Tip=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Tip.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-tip",zIndex:BI.zIndex_tip})},_init:function(){BI.Tip.superclass._init.apply(this,arguments),this.element.css({zIndex:this.options.zIndex})}})},function(e,t){BI.ButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-group",behaviors:{},items:[],value:"",chooseType:BI.Selection.Single,layouts:[{type:"bi.center",hgap:0,vgap:0}]})},_init:function(){BI.ButtonGroup.superclass._init.apply(this,arguments);var e=this.options,n={};BI.each(e.behaviors,function(e,t){n[e]=BI.BehaviorFactory.createBehavior(e,{rule:t})}),this.behaviors=n,this.populate(e.items),(BI.isKey(e.value)||BI.isNotEmptyArray(e.value))&&this.setValue(e.value)},_createBtns:function(e){this.options;return BI.createWidgets(BI.createItems(e,{type:"bi.text_button"}))},_btnsCreator:function(e){var r=this,n=Array.prototype.slice.call(arguments),a=this.options,t=this._createBtns(e);return n[0]=t,BI.each(this.behaviors,function(e,t){t.doBehavior.apply(t,n)}),BI.each(t,function(e,i){i.on(BI.Controller.EVENT_CHANGE,function(e,t,n){if(e===BI.Events.CLICK){switch(a.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:r.setValue(i.getValue());break;case BI.ButtonGroup.CHOOSE_TYPE_NONE:r.setValue([])}r.fireEvent(BI.Controller.EVENT_CHANGE,arguments),r.fireEvent(BI.ButtonGroup.EVENT_CHANGE,t,n)}else r.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),i.on(BI.Events.DESTROY,function(){BI.remove(r.buttons,i)})}),t},_packageBtns:function(e){for(var n=this.options,i=n.layouts.length-1;0<i;i--)e=BI.map(e,function(e,t){return BI.extend({},n.layouts[i],{items:[BI.extend({},n.layouts[i].el,{el:t})]})});return e},_packageSimpleItems:function(n){var e=this.options;return BI.map(e.items,function(e,t){return BI.stripEL(t)===t?n[e]:BI.extend({},t,{el:n[e]})})},_packageItems:function(e,t){return BI.createItems(BI.makeArrayByArray(e,{}),BI.clone(t))},_packageLayout:function(e){for(var t=this.options,n=BI.deepClone(t.layouts[0]),i=BI.formatEL(n).el;i&&i.items&&!BI.isEmpty(i.items);)i=BI.formatEL(i.items[0]).el;return i.items=e,n},_isSimpleLayout:function(){var e=this.options;return 1===e.layouts.length&&!BI.isArray(e.items[0])},doBehavior:function(){var n=Array.prototype.slice.call(arguments);n.unshift(this.buttons),BI.each(this.behaviors,function(e,t){t.doBehavior.apply(t,n)})},prependItems:function(e){this.options;var t=this._btnsCreator.apply(this,arguments);this.buttons=BI.concat(t,this.buttons),this._isSimpleLayout()&&this.layouts&&this.layouts.prependItems?this.layouts.prependItems(t):(e=this._packageItems(e,this._packageBtns(t)),this.layouts.prependItems(this._packageLayout(e).items))},addItems:function(e){this.options;var t=this._btnsCreator.apply(this,arguments);this.buttons=BI.concat(this.buttons,t),this._isSimpleLayout()&&this.layouts&&this.layouts.addItems?this.layouts.addItems(t):(e=this._packageItems(e,this._packageBtns(t)),this.layouts.addItems(this._packageLayout(e).items))},removeItemAt:function(e){BI.removeAt(this.buttons,e),this.layouts.removeItemAt(e)},removeItems:function(n){n=BI.isArray(n)?n:[n];var i=[];BI.each(this.buttons,function(e,t){BI.deepContains(n,t.getValue())&&i.push(e)}),BI.removeAt(this.buttons,i),this.layouts.removeItemAt(i)},populate:function(e){e=e||[],this.empty(),this.options.items=e,this.buttons=this._btnsCreator.apply(this,arguments),e=this._isSimpleLayout()?this._packageSimpleItems(this.buttons):this._packageItems(e,this._packageBtns(this.buttons)),this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(e)))},setNotSelectedValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttons,function(e,t){BI.deepContains(n,t.getValue())?t.setSelected&&t.setSelected(!1):t.setSelected&&t.setSelected(!0)})},setEnabledValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttons,function(e,t){BI.deepContains(n,t.getValue())?t.setEnable(!0):t.setEnable(!1)})},setValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttons,function(e,t){BI.deepContains(n,t.getValue())?t.setSelected&&t.setSelected(!0):t.setSelected&&t.setSelected(!1)})},getNotSelectedValue:function(){var n=[];return BI.each(this.buttons,function(e,t){!t.isEnabled()||t.isSelected&&t.isSelected()||n.push(t.getValue())}),n},getValue:function(){var n=[];return BI.each(this.buttons,function(e,t){t.isEnabled()&&t.isSelected&&t.isSelected()&&n.push(t.getValue())}),n},getAllButtons:function(){return this.buttons},getAllLeaves:function(){return this.buttons},getSelectedButtons:function(){var n=[];return BI.each(this.buttons,function(e,t){t.isSelected&&t.isSelected()&&n.push(t)}),n},getNotSelectedButtons:function(){var n=[];return BI.each(this.buttons,function(e,t){t.isSelected&&!t.isSelected()&&n.push(t)}),n},getIndexByValue:function(n){var i=-1;return BI.any(this.buttons,function(e,t){if(t.isEnabled()&&t.getValue()===n)return i=e,!0}),i},getNodeById:function(n){var i;return BI.any(this.buttons,function(e,t){if(t.isEnabled()&&t.options.id===n)return i=t,!0}),i},getNodeByValue:function(n){var i;return BI.any(this.buttons,function(e,t){if(t.isEnabled()&&t.getValue()===n)return i=t,!0}),i},empty:function(){BI.ButtonGroup.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.ButtonGroup.superclass.destroy.apply(this,arguments),this.options.items=[]}}),BI.extend(BI.ButtonGroup,{CHOOSE_TYPE_SINGLE:BI.Selection.Single,CHOOSE_TYPE_MULTI:BI.Selection.Multi,CHOOSE_TYPE_ALL:BI.Selection.All,CHOOSE_TYPE_NONE:BI.Selection.None,CHOOSE_TYPE_DEFAULT:BI.Selection.Default}),BI.ButtonGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_group",BI.ButtonGroup)},function(e,t){BI.ButtonTree=BI.inherit(BI.ButtonGroup,{_defaultConfig:function(){return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-tree"})},_init:function(){BI.ButtonTree.superclass._init.apply(this,arguments)},setNotSelectedValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttons,function(e,t){BI.isFunction(t.setSelected)?BI.deepContains(n,t.getValue())?t.setSelected(!1):t.setSelected(!0):t.setNotSelectedValue(n)})},setEnabledValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttons,function(e,t){BI.isFunction(t.setEnabledValue)?t.setEnabledValue(n):BI.deepContains(n,t.getValue())?t.setEnable(!0):t.setEnable(!1)})},setValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttons,function(e,t){BI.isFunction(t.setSelected)?BI.deepContains(n,t.getValue())?t.setSelected(!0):t.setSelected(!1):t.setValue(n)})},getNotSelectedValue:function(){var n=[];return BI.each(this.buttons,function(e,t){!t.isEnabled()||BI.isFunction(t.setSelected)?t.isEnabled()&&t.isSelected&&!t.isSelected()&&n.push(t.getValue()):n=BI.concat(n,t.getNotSelectedValue())}),n},getValue:function(){var n=[];return BI.each(this.buttons,function(e,t){!t.isEnabled()||BI.isFunction(t.setSelected)?t.isEnabled()&&t.isSelected&&t.isSelected()&&n.push(t.getValue()):n=BI.concat(n,t.getValue())}),n},getSelectedButtons:function(){var n=[];return BI.each(this.buttons,function(e,t){!t.isEnabled()||BI.isFunction(t.setSelected)?t.isSelected&&t.isSelected()&&n.push(t):n=n.concat(t.getSelectedButtons())}),n},getNotSelectedButtons:function(){var n=[];return BI.each(this.buttons,function(e,t){!t.isEnabled()||BI.isFunction(t.setSelected)?t.isSelected&&!t.isSelected()&&n.push(t):n=n.concat(t.getNotSelectedButtons())}),n},getAllLeaves:function(){var n=[];return BI.each(this.buttons,function(e,t){!t.isEnabled()||BI.isFunction(t.setSelected)?t.isEnabled()&&n.push(t):n=n.concat(t.getAllLeaves())}),n},getIndexByValue:function(i){var r=-1;return BI.any(this.buttons,function(e,t){var n=t.getValue();if(t.isEnabled()&&(n===i||BI.contains(n,i)))return r=e,!0}),r},getNodeById:function(n){var i;return BI.any(this.buttons,function(e,t){if(t.isEnabled()){if(t.attr("id")===n)return i=t,!0;if(BI.isFunction(t.getNodeById)&&(i=t.getNodeById(n)))return!0}}),i},getNodeByValue:function(n){var i;return BI.any(this.buttons,function(e,t){if(t.isEnabled())if(BI.isFunction(t.getNodeByValue)){if(i=t.getNodeByValue(n))return!0}else if(t.attr("value")===n)return i=t,!0}),i}}),BI.ButtonTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_tree",BI.ButtonTree)},function(e,t){BI.prepares.push(function(){BI.Resizers=new BI.ResizeController,BI.Layers=new BI.LayerController,BI.Maskers=new BI.MaskersController,BI.Bubbles=new BI.BubblesController,BI.Tooltips=new BI.TooltipsController,BI.Popovers=new BI.PopoverController,BI.Broadcasts=new BI.BroadcastController,BI.StyleLoaders=new BI.StyleLoaderManager})},function(e,t){BI.CollectionView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection",overflowX:!0,overflowY:!0,cellSizeAndPositionGetter:BI.emptyFn,horizontalOverscanSize:0,verticalOverscanSize:0,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.CollectionView.superclass._init.apply(this,arguments);var e=this,t=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){e._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){!0!==e._scrollLock&&(t.scrollLeft=e.element.scrollLeft(),t.scrollTop=e.element.scrollTop(),e._calculateChildrenToRender(),e.fireEvent(BI.CollectionView.EVENT_SCROLL,{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:!0===t.overflowX&&!0===t.overflowY,scrolly:!1===t.overflowX&&!0===t.overflowY,scrollx:!0===t.overflowX&&!1===t.overflowY,items:[this.container]}),0<t.items.length&&(this._calculateSizeAndPositionData(),this._populate())},mounted:function(){var e=this.options;0===e.scrollLeft&&0===e.scrollTop||(this.element.scrollTop(e.scrollTop),this.element.scrollLeft(e.scrollLeft))},_calculateSizeAndPositionData:function(){for(var e=this.options,t=[],n=new BI.SectionManager,i=0,r=0,a=0,o=e.items.length;a<o;a++){var s=e.cellSizeAndPositionGetter(a);if(null==s.height||isNaN(s.height)||null==s.width||isNaN(s.width)||null==s.x||isNaN(s.x)||null==s.y||isNaN(s.y))throw Error();i=Math.max(i,s.y+s.height),r=Math.max(r,s.x+s.width),t[s.index=a]=s,n.registerCell(s,a)}this._cellMetadata=t,this._sectionManager=n,this._height=i,this._width=r},_cellRenderers:function(e,t,n,i){return this._lastRenderedCellIndices=this._sectionManager.getCellIndices(e,t,n,i),this._cellGroupRenderer()},_cellGroupRenderer:function(){var i=this,r=(this.options,[]);return BI.each(this._lastRenderedCellIndices,function(e,t){var n=i._sectionManager.getCellMetadata(t);r.push(n)}),r},_calculateChildrenToRender:function(){var n=this,e=this.options,t=BI.clamp(e.scrollLeft,0,this._getMaxScrollLeft()),i=BI.clamp(e.scrollTop,0,this._getMaxScrollTop()),r=Math.max(0,t-e.horizontalOverscanSize),a=Math.max(0,i-e.verticalOverscanSize),o=Math.min(this._width,t+e.width+e.horizontalOverscanSize),s=Math.min(this._height,i+e.height+e.verticalOverscanSize);if(0<o&&0<s){if(a>=this.renderRange.minY&&s<=this.renderRange.maxY&&r>=this.renderRange.minX&&o<=this.renderRange.maxX)return;for(var l=this._cellRenderers(s-a,o-r,r,a),u=[],c={},h={},p={},d={},f=0,g=l.length;f<g;f++){p[(C=l[f]).x]=C.x,p[C.x+C.width]=C.x+C.width,d[C.y]=C.y,d[C.y+C.height]=C.y+C.height}p=BI.toArray(p),d=BI.toArray(d);for(var m=BI.invert(p),I=BI.invert(d),B={},_={},E={},b={},y=function(e,t){null==e[t]&&(e[t]=Number.MAX_VALUE)},v=function(e,t){null==e[t]&&(e[t]=0)},f=0,g=l.length;f<g;f++){var T,C=l[f],N=this.renderedKeys[C.index]&&this.renderedKeys[C.index][1];0<=N?(C.width!==this.renderedCells[N]._width&&(this.renderedCells[N]._width=C.width,this.renderedCells[N].el.setWidth(C.width)),C.height!==this.renderedCells[N]._height&&(this.renderedCells[N]._height=C.height,this.renderedCells[N].el.setHeight(C.height)),this.renderedCells[N]._left!==C.x&&this.renderedCells[N].el.element.css("left",C.x+"px"),this.renderedCells[N]._top!==C.y&&this.renderedCells[N].el.element.css("top",C.y+"px"),u.push(T=this.renderedCells[N])):(T=BI.createWidget(BI.extend({type:"bi.label",width:C.width,height:C.height},e.items[C.index],{cls:(e.items[C.index].cls||"")+" container-cell"+(0===C.y?" first-row":"")+(0===C.x?" first-col":""),_left:C.x,_top:C.y})),u.push({el:T,left:C.x,top:C.y,_left:C.x,_top:C.y,_width:C.width,_height:C.height}));for(var V=0|I[C.y],S=0|I[C.y+C.height],x=V;x<=S;x++){var w=d[x];y(B,w),v(_,w),B[w]=Math.min(B[w],C.x),_[w]=Math.max(_[w],C.x+C.width)}for(var A=0|m[C.x],L=0|m[C.x+C.width],x=A;x<=L;x++){var k=p[x];y(E,k),v(b,k),E[k]=Math.min(E[k],C.y),b[k]=Math.max(b[k],C.y+C.height)}c[C.index]=[C.index,f],h[f]=T}var D={},M={},P=[];BI.each(c,function(e,t){n.renderedKeys[e]?D[e]=t:M[e]=t}),BI.each(this.renderedKeys,function(e,t){D[e]||M[e]||P.push(t[1])}),BI.each(P,function(e,t){n.renderedCells[t].el._destroy()});var R=[];BI.each(M,function(e,t){R.push(u[t[1]])}),this.container.addItems(R),this.container._children=h,this.container.attr("items",u),this.renderedCells=u,this.renderedKeys=c;var H=BI.min(B),O=BI.max(_),F=BI.max(E),Y=BI.min(b);this.renderRange={minX:H,minY:F,maxX:O,maxY:Y}}},_getMaxScrollLeft:function(){return Math.max(0,this._width-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._height-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(e){var t=this.options;if(this._reRange(),e&&e!==this.options.items&&(this.options.items=e,this._calculateSizeAndPositionData()),0<t.items.length){this.container.setWidth(this._width),this.container.setHeight(this._height),this._calculateChildrenToRender();try{this.element.scrollTop(t.scrollTop),this.element.scrollLeft(t.scrollLeft)}catch(n){}}},setScrollLeft:function(e){this.options.scrollLeft!==e&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(e||0,0,this._getMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(e){this.options.scrollTop!==e&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(e||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setOverflowX:function(e){var t=this;this.options.overflowX!==!!e&&(this.options.overflowX=!!e,BI.nextTick(function(){t.element.css({overflowX:e?"auto":"hidden"})}))},setOverflowY:function(e){var t=this;this.options.overflowY!==!!e&&(this.options.overflowY=!!e,BI.nextTick(function(){t.element.css({overflowY:e?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(e,t){t.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(e){e&&e!==this.options.items&&this.restore(),this._populate(e)}}),BI.CollectionView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.collection_view",BI.CollectionView)},function(e,t){BI.Combo=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-combo",trigger:"click",toggle:!0,direction:"bottom",logic:{dynamic:!0},container:null,isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover"})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var i=this,t=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.isEnabled()&&i.isValid()&&(e===BI.Events.EXPAND&&i._popupView(),e===BI.Events.COLLAPSE&&i._hideView(),e===BI.Events.EXPAND&&(i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),i.fireEvent(BI.Combo.EVENT_EXPAND)),e===BI.Events.COLLAPSE&&(i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),i.isViewVisible()&&i.fireEvent(BI.Combo.EVENT_COLLAPSE)),e===BI.Events.CLICK&&i.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,n))}),i.element.on("mouseenter."+i.getName(),function(e){i.isEnabled()&&i.isValid()&&i.combo.isEnabled()&&i.combo.isValid()&&i.element.addClass(t.hoverClass)}),i.element.on("mouseleave."+i.getName(),function(e){i.isEnabled()&&i.isValid()&&i.combo.isEnabled()&&i.combo.isValid()&&i.element.removeClass(t.hoverClass)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(t.logic,{items:[{el:this.combo}]})))),t.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind(function(){this.isViewVisible()&&this._hideView()},this))},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var i=this,r=this.options,e=(this.options.trigger||"").split(","),a=function(e){r.stopEvent&&e.stopEvent(),r.stopPropagation&&e.stopPropagation()},o=!1;function s(){i.isEnabled()&&i.isValid()&&i.combo.isEnabled()&&i.combo.isValid()&&!0===r.toggle&&(i._hideView(),i.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",i.combo),i.fireEvent(BI.Combo.EVENT_COLLAPSE)),i.popupView&&i.popupView.element.off("mouseenter."+i.getName()).off("mouseleave."+i.getName()),o=!1}BI.each(e,function(e,t){switch(t){case"hover":i.element.on("mouseenter."+i.getName(),function(e){i.isEnabled()&&i.isValid()&&i.combo.isEnabled()&&i.combo.isValid()&&(i._popupView(),i.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",i.combo),i.fireEvent(BI.Combo.EVENT_EXPAND))}),i.element.on("mouseleave."+i.getName(),function(e){i.popupView&&(i.popupView.element.on("mouseenter."+i.getName(),function(e){o=!0,i.popupView.element.on("mouseleave."+i.getName(),function(e){s()}),i.popupView.element.off("mouseenter."+i.getName())}),BI.defer(function(){o||s()},50))});break;case"click":var n=BI.debounce(function(e){i.combo.element.__isMouseInBounds__(e)&&i.isEnabled()&&i.isValid()&&i.combo.isEnabled()&&i.combo.isValid()&&(r.toggle?i._toggle():i._popupView(),i.isViewVisible()?(i.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",i.combo),i.fireEvent(BI.Combo.EVENT_EXPAND)):(i.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",i.combo),i.fireEvent(BI.Combo.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});i.element.off(t+"."+i.getName()).on(t+"."+i.getName(),function(e){n(e),a(e)});break;case"click-hover":n=BI.debounce(function(e){i.combo.element.__isMouseInBounds__(e)&&i.isEnabled()&&i.isValid()&&i.combo.isEnabled()&&i.combo.isValid()&&(i._popupView(),i.isViewVisible()&&(i.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",i.combo),i.fireEvent(BI.Combo.EVENT_EXPAND)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});i.element.off("click."+i.getName()).on("click."+i.getName(),function(e){n(e),a(e)}),i.element.on("mouseleave."+i.getName(),function(e){i.popupView&&(i.popupView.element.on("mouseenter."+i.getName(),function(e){o=!0,i.popupView.element.on("mouseleave."+i.getName(),function(e){s()}),i.popupView.element.off("mouseenter."+i.getName())}),BI.defer(function(){o||s()},50))})}})},_initCombo:function(){this.combo=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var i=this,e=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view",value:e.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(e,t,n){e===BI.Events.CLICK&&(i.combo.setValue(i.getValue()),i.fireEvent(BI.Combo.EVENT_CHANGE,t,n)),i.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popupView.setVisible(!1),BI.nextTick(function(){i.fireEvent(BI.Combo.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(e){var t;0<this.element.find(e.target).length||this.popupView&&0<this.popupView.element.find(e.target).length||"CodeMirror-cursor"===e.target.className||0<BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length?(t=this.options.direction.split(","),(BI.contains(t,"innerLeft")||BI.contains(t,"innerRight"))&&(this.adjustWidth(),this.adjustHeight())):!1!==this.options.hideChecker.apply(this,[e])&&this._hideView()},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),!0===this.options.destroyWhenHide?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var t,n,i=this.options;this.popupView&&!0===i.isNeedAdjustWidth&&(this.resetListWidth(""),t=this.popupView.element.outerWidth(),(n=this.element.outerWidth()||i.width)+80<t?n+=80:n<t&&(n=t),this.resetListWidth(n<100?100:n))},adjustHeight:function(e){var t=this.options,n={};if(this.popupView){var i=this.popupView.isVisible();this.popupView.visible();var r=BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(t.direction){case"bottom":case"bottom,right":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["bottom","top","right","left"],t.offsetStyle);break;case"top":case"top,right":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["top","bottom","right","left"],t.offsetStyle);break;case"left":case"left,bottom":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["left","right","bottom","top"],t.offsetStyle);break;case"right":case"right,bottom":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","bottom","top"],t.offsetStyle);break;case"top,left":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["top","bottom","left","right"],t.offsetStyle);break;case"bottom,left":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["bottom","top","left","right"],t.offsetStyle);break;case"left,top":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["left","right","top","bottom"],t.offsetStyle);break;case"right,top":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","top","bottom"],t.offsetStyle);break;case"right,innerRight":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],t.offsetStyle);break;case"right,innerLeft":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],t.offsetStyle);break;case"innerRight":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],t.offsetStyle);break;case"innerLeft":n=BI.DOM.getComboPosition(r,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],t.offsetStyle);break;case"top,custom":case"custom,top":n=BI.DOM.getTopAdaptPosition(r,this.popupView,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":n=BI.DOM.getBottomAdaptPosition(r,this.popupView,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight);break;case"left,custom":case"custom,left":delete(n=BI.DOM.getLeftAdaptPosition(r,this.popupView,t.adjustXOffset||t.adjustLength)).top,delete n.adaptHeight;break;case"custom,right":case"right,custom":delete(n=BI.DOM.getRightAdaptPosition(r,this.popupView,t.adjustXOffset||t.adjustLength)).top,delete n.adaptHeight}"adaptHeight"in n&&this.resetListHeight(n.adaptHeight),"left"in n&&this.popupView.element.css({left:n.left}),"top"in n&&this.popupView.element.css({top:n.top}),this.position=n,this.popupView.setVisible(i)}},resetListHeight:function(e){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(e)},resetListWidth:function(e){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(e)},populate:function(e){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate.apply(this.combo,arguments)},_setEnable:function(e){BI.Combo.superclass._setEnable.apply(this,arguments),!0===e?this.element.removeClass("base-disabled disabled"):!1===e&&this.element.addClass("base-disabled disabled"),e||this.element.removeClass(this.options.hoverClass),!e&&this.isViewVisible()&&this._hideView()},setValue:function(e){this.combo.setValue(e),BI.isNull(this.popupView)?this.options.popup.value=e:this.popupView.setValue(e)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(e){this.isEnabled()&&this.combo.isEnabled()&&!this.isViewVisible()&&this._popupView(e)},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroyed:function(){BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()),BI.Resizers.remove(this.getName()),this.popupView&&this.popupView._destroy()}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.combo",BI.Combo)},function(e,t){BI.Expander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Expander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-expander",trigger:"click",toggle:!0,isDefaultInit:!1,el:{},popup:{},expanderClass:"bi-expander-popup",hoverClass:"bi-expander-hover"})},_init:function(){BI.Expander.superclass._init.apply(this,arguments);var i=this,e=this.options;this._expanded=!!e.el.open,this._initExpander(),this._initPullDownAction(),this.expander.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.isEnabled()&&i.isValid()&&(e===BI.Events.EXPAND&&i._popupView(),e===BI.Events.COLLAPSE&&i._hideView(),e===BI.Events.EXPAND&&(i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),i.fireEvent(BI.Expander.EVENT_EXPAND)),e===BI.Events.COLLAPSE&&(i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),i.isViewVisible()&&i.fireEvent(BI.Expander.EVENT_COLLAPSE)),e===BI.Events.CLICK&&i.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE,t,n))}),this.element.hover(function(){i.isEnabled()&&i.isValid()&&i.expander.isEnabled()&&i.expander.isValid()&&i.element.addClass(e.hoverClass)},function(){i.isEnabled()&&i.isValid()&&i.expander.isEnabled()&&i.expander.isValid()&&i.element.removeClass(e.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.expander}]}),e.isDefaultInit&&this._assertPopupView(),!0===this.expander.isOpened()&&this._popupView()},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var n=this,i=this.options,e=this.options.trigger.split(",");BI.each(e,function(e,t){switch(t){case"hover":n.element[t](function(e){n.isEnabled()&&n.isValid()&&n.expander.isEnabled()&&n.expander.isValid()&&(n._popupView(),n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",n.expander),n.fireEvent(BI.Expander.EVENT_EXPAND))},function(){n.isEnabled()&&n.isValid()&&n.expander.isEnabled()&&n.expander.isValid()&&i.toggle&&(n._hideView(),n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",n.expander),n.fireEvent(BI.Expander.EVENT_COLLAPSE))});break;case"click":t&&n.element.off(t+"."+n.getName()).on(t+"."+n.getName(),BI.debounce(function(e){n.expander.element.__isMouseInBounds__(e)&&n.isEnabled()&&n.isValid()&&n.expander.isEnabled()&&n.expander.isValid()&&(i.toggle?n._toggle():n._popupView(),n.isExpanded()?(n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",n.expander),n.fireEvent(BI.Expander.EVENT_EXPAND)):(n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",n.expander),n.fireEvent(BI.Expander.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initExpander:function(){this.expander=BI.createWidget(this.options.el)},_assertPopupView:function(){var i=this,e=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.button_group",cls:"expander-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:e.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.Expander.EVENT_CHANGE,t,n)}),this.popupView.setVisible(this.isExpanded()),BI.nextTick(function(){i.fireEvent(BI.Expander.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideView:function(){this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW),this._expanded=!1,this.expander.setOpened(!1),this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW),this._expanded=!0,this.expander.setOpened(!0),this.popupView.visible(),this.element.addClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW)},populate:function(e){this.popupView&&this.popupView.populate.apply(this.popupView,arguments),this.expander.populate.apply(this.expander,arguments)},_setEnable:function(e){BI.Expander.superclass._setEnable.apply(this,arguments),e||this.element.removeClass(this.options.hoverClass),!e&&this.isViewVisible()&&this._hideView()},setValue:function(e){this.expander.setValue(e),BI.isNull(this.popupView)?this.options.popup.value=e:this.popupView.setValue(e)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.expander.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},isExpanded:function(){return this._expanded},showView:function(){this.isEnabled()&&this.expander.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(e){return this.expander.options.id===e?this.expander:this.popupView&&this.popupView.getNodeById(e)},getNodeByValue:function(e){return this.expander.getValue()===e?this.expander:this.popupView&&this.popupView.getNodeByValue(e)},destroy:function(){BI.Expander.superclass.destroy.apply(this,arguments)}}),BI.Expander.EVENT_EXPAND="EVENT_EXPAND",BI.Expander.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Expander.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Expander.EVENT_CHANGE="EVENT_CHANGE",BI.Expander.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Expander.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Expander.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Expander.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Expander.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.expander",BI.Expander)},function(e,t){BI.ComboGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-combo-group bi-list-item",trigger:"click,hover",direction:"right",adjustLength:0,isDefaultInit:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.text_button",text:"",value:""},children:[],popup:{el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}}})},_init:function(){BI.ComboGroup.superclass._init.apply(this,arguments),this._populate(this.options.el)},_populate:function(e){var i=this,r=this.options,t=r.children;if(BI.isEmpty(t))throw new Error("ComboGroup构造错误");BI.each(t,function(e,t){var n=BI.formatEL(t).el.children;t=BI.formatEL(t).el,BI.isEmpty(n)||(t.el=BI.clone(t),t.children=n,t.type="bi.combo_group",t.action=r.action,t.height=r.height,t.direction=r.direction,t.isDefaultInit=r.isDefaultInit,t.isNeedAdjustHeight=r.isNeedAdjustHeight,t.isNeedAdjustWidth=r.isNeedAdjustWidth,t.adjustLength=r.adjustLength,t.popup=r.popup)}),this.combo=BI.createWidget({type:"bi.combo",element:this,container:r.container,height:r.height,trigger:r.trigger,direction:r.direction,isDefaultInit:r.isDefaultInit,isNeedAdjustWidth:r.isNeedAdjustWidth,isNeedAdjustHeight:r.isNeedAdjustHeight,adjustLength:r.adjustLength,el:e,popup:BI.extend({},r.popup,{el:BI.extend({items:t},r.popup.el)})}),this.combo.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.ComboGroup.EVENT_CHANGE,n)})},getValue:function(){return this.combo.getValue()},setValue:function(e){this.combo.setValue(e)}}),BI.ComboGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.combo_group",BI.ComboGroup)},function(e,t){BI.VirtualGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-virtual-group",items:[],layouts:[{type:"bi.center",hgap:0,vgap:0}]})},render:function(){var e=this.options;this.populate(e.items),BI.isKey(e.value)&&this.setValue(e.value)},_packageBtns:function(e){for(var i=this.options,r=this.buttonMap={},a=i.layouts.length-1;0<a;a--)e=BI.map(e,function(e,t){var n=BI.stripEL(t);return BI.extend({},i.layouts[a],{items:[BI.extend({},i.layouts[a].el,{el:BI.extend({ref:function(e){BI.isKey(r[n.value])&&(r[n.value]=e)}},n)})]})});return e},_packageLayout:function(e){for(var t=this.options,n=BI.deepClone(t.layouts[0]),i=BI.formatEL(n).el;i&&i.items&&!BI.isEmpty(i.items);)i=BI.formatEL(i.items[0]).el;return i.items=e,n},addItems:function(e){this.layouts.addItems(e)},prependItems:function(e){this.layouts.prependItems(e)},setValue:function(n){n=BI.isArray(n)?n:[n],BI.each(this.buttonMap,function(e,t){t&&(n.deepContains(e)?t.setSelected&&t.setSelected(!0):t.setSelected&&t.setSelected(!1))})},getNotSelectedValue:function(){var n=[];return BI.each(this.buttonMap,function(e,t){t&&(!t.isEnabled()||t.isSelected&&t.isSelected()||n.push(t.getValue()))}),n},getValue:function(){var n=[];return BI.each(this.buttonMap,function(e,t){t&&t.isEnabled()&&t.isSelected&&t.isSelected()&&n.push(t.getValue())}),n},populate:function(e){e=e||[],this.options.items=e,e=this._packageBtns(e),this.layouts?this.layouts.populate(e):this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(e)))}}),BI.VirtualGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.virtual_group",BI.VirtualGroup)},function(e,t){BI.Loader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Loader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-loader",direction:"top",isDefaultInit:!0,logic:{dynamic:!0,scrolly:!0},el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,prev:!1,next:{},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_prevLoad:function(){var e=this,t=this.options;this.prev.setLoading(),t.itemsCreator.apply(this,[{times:--this.times},function(){e.prev.setLoaded(),e.prependItems.apply(e,arguments)}])},_nextLoad:function(){var e=this,t=this.options;this.next.setLoading(),t.itemsCreator.apply(this,[{times:++this.times},function(){e.next.setLoaded(),e.addItems.apply(e,arguments)}])},_init:function(){BI.Loader.superclass._init.apply(this,arguments);var i=this,e=this.options;!1===e.itemsCreator&&(e.prev=!1,e.next=!1),!1!==e.prev&&(this.prev=BI.createWidget(BI.extend({type:"bi.loading_bar"},e.prev)),this.prev.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&i._prevLoad()})),this.button_group=BI.createWidget(e.el,{type:"bi.button_group",chooseType:0,items:e.items,behaviors:{},layouts:[{type:"bi.vertical"}],value:e.value}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.Loader.EVENT_CHANGE,n)}),!1!==e.next&&(this.next=BI.createWidget(BI.extend({type:"bi.loading_bar"},e.next)),this.next.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&i._nextLoad()})),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(e.direction),BI.extend({scrolly:!0},e.logic,{items:BI.LogicFactory.createLogicItemsByDirection(e.direction,this.prev,this.button_group,this.next)})))),e.isDefaultInit&&BI.isEmpty(e.items)&&BI.nextTick(BI.bind(function(){e.isDefaultInit&&BI.isEmpty(e.items)&&this._populate()},this)),BI.isNotEmptyArray(e.items)&&this._populate(e.items)},hasPrev:function(){var e=this.options;return BI.isNumber(e.count)?this.count<e.count:!!e.hasPrev.apply(this,[{times:this.times,count:this.count}])},hasNext:function(){var e=this.options;return BI.isNumber(e.count)?this.count<e.count:!!e.hasNext.apply(this,[{times:this.times,count:this.count}])},prependItems:function(e){this.count+=e.length,!1!==this.next&&(this.hasPrev()?(this.options.items=this.options.items.concat(e),this.prev.setLoaded()):this.prev.setEnd()),this.button_group.prependItems.apply(this.button_group,arguments)},addItems:function(e){this.count+=e.length,BI.isObject(this.next)&&(this.hasNext()?(this.options.items=this.options.items.concat(e),this.next.setLoaded()):this.next.setEnd()),this.button_group.addItems.apply(this.button_group,arguments)},_populate:function(e){var t=this,n=this.options;return 0===arguments.length&&BI.isFunction(n.itemsCreator)?(n.itemsCreator.apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("arguments can not be null!!!");t.populate.apply(t,arguments),n.onLoaded()}]),!1):(this.options.items=e,this.times=1,this.count=0,this.count+=e.length,BI.isObject(this.next)&&(this.hasNext()?this.next.setLoaded():this.next.invisible()),BI.isObject(this.prev)&&(this.hasPrev()?this.prev.setLoaded():this.prev.invisible()),!0)},populate:function(){this._populate.apply(this,arguments)&&this.button_group.populate.apply(this.button_group,arguments)},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(e){return this.button_group.getIndexByValue(e)},getNodeById:function(e){return this.button_group.getNodeById(e)},getNodeByValue:function(e){return this.button_group.getNodeByValue(e)},empty:function(){this.button_group.empty(),BI.each([this.prev,this.next],function(e,t){t&&t.setVisible(!1)})},destroy:function(){BI.Loader.superclass.destroy.apply(this,arguments)}}),BI.Loader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.loader",BI.Loader)},function(e,t){BI.Navigation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Navigation.superclass._defaultConfig.apply(this,arguments),{direction:"bottom",logic:{dynamic:!1},single:!1,showIndex:!1,tab:!1,cardCreator:function(e){return BI.createWidget()},afterCardCreated:BI.emptyFn,afterCardShow:BI.emptyFn})},render:function(){var n=this,i=this.options;this.tab=BI.createWidget(this.options.tab,{type:"bi.button_group"}),this.cardMap={},this.showIndex=0,this.layout=BI.createWidget({type:"bi.card"}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(i.direction),BI.extend({},i.logic,{items:BI.LogicFactory.createLogicItemsByDirection(i.direction,this.tab,this.layout)})))),new BI.ShowListener({eventObj:this.tab,cardLayout:this.layout,cardNameCreator:function(e){return n.showIndex+e},cardCreator:function(e){var t=i.cardCreator(e);return n.cardMap[e]=t},afterCardCreated:BI.bind(this.afterCardCreated,this),afterCardShow:BI.bind(this.afterCardShow,this)})},mounted:function(){var e=this.options;!1!==e.showIndex&&this.setSelect(e.showIndex)},_deleteOtherCards:function(n){var i=this;!0===this.options.single&&BI.each(this.cardMap,function(e,t){e!==n+""&&(i.layout.deleteCardByName(e),delete i.cardMap[e])})},afterCardCreated:function(e){var i=this;this.cardMap[e].on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.Navigation.EVENT_CHANGE,n)}),this.options.afterCardCreated.apply(this,arguments)},afterCardShow:function(e){this.showIndex=e,this._deleteOtherCards(e),this.options.afterCardShow.apply(this,arguments)},populate:function(){var e=this.layout.getShowingCard();if(e)return e.populate.apply(e,arguments)},_assertCard:function(e){var t;this.layout.isCardExisted(e)||(t=this.options.cardCreator(e),this.cardMap[e]=t,this.layout.addCardByName(e,t),this.afterCardCreated(e))},setSelect:function(e){this._assertCard(e),this.layout.showCardByName(e),this._deleteOtherCards(e),this.showIndex!==e&&(this.showIndex=e,BI.nextTick(BI.bind(this.afterCardShow,this,e)))},getSelect:function(){return this.showIndex},getSelectedCard:function(){if(BI.isKey(this.showIndex))return this.cardMap[this.showIndex]},setValue:function(e){var t=this.layout.getShowingCard();t&&t.setValue(e)},getValue:function(){var e=this.layout.getShowingCard();if(e)return e.getValue()},empty:function(){this.layout.deleteAllCard(),this.cardMap={}},destroy:function(){BI.Navigation.superclass.destroy.apply(this,arguments)}}),BI.Navigation.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.navigation",BI.Navigation)},function(e,t){BI.Searcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Searcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-searcher",lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,isDefaultInit:!1,isAutoSearch:!0,isAutoSync:!0,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,allowSearchBlank:!0,onSearch:function(e,t){t([])},el:{type:"bi.search_editor"},popup:{type:"bi.searcher_view"},adapter:null,masker:{offset:{}}})},_init:function(){BI.Searcher.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget(e.el,{type:"bi.search_editor"}),BI.createWidget({type:"bi.vertical",element:this,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,vgap:e.vgap,hgap:e.hgap,items:[this.editor]}),e.isDefaultInit&&this._assertPopupView();var n=BI.debounce(BI.bind(this._search,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this.editor.on(BI.Controller.EVENT_CHANGE,function(e){switch(e){case BI.Events.STARTEDIT:t._startSearch();break;case BI.Events.EMPTY:t._stopSearch();break;case BI.Events.CHANGE:n();break;case BI.Events.PAUSE:t._pauseSearch()}})},_assertPopupView:function(){var r=this,a=this.options;(a.masker&&!BI.Maskers.has(this.getName())||!1===a.masker&&!this.popupView)&&(this.popupView=BI.createWidget(a.popup,{type:"bi.searcher_view",chooseType:a.chooseType}),this.popupView.on(BI.Controller.EVENT_CHANGE,function(e,t,n){if(r.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK){if(a.isAutoSync){var i=a.adapter&&a.adapter.getValue();if(n.isSelected())switch(a.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:a.adapter&&a.adapter.setValue([n.getValue()]);break;case BI.ButtonGroup.CHOOSE_TYPE_MULTI:i.push(n.getValue()),a.adapter&&a.adapter.setValue(i)}else a.adapter&&a.adapter.setValue(BI.deepWithout(i,n.getValue()))}r.fireEvent(BI.Searcher.EVENT_CHANGE,t,n)}}),BI.nextTick(function(){r.fireEvent(BI.Searcher.EVENT_AFTER_INIT)})),a.masker&&!BI.Maskers.has(this.getName())&&BI.Maskers.create(this.getName(),a.adapter,BI.extend({container:this,render:this.popupView},a.masker),this)},_startSearch:function(){this._assertPopupView(),this._stop=!1,this._isSearching=!0,this.fireEvent(BI.Searcher.EVENT_START),this.popupView.startSearch&&this.popupView.startSearch(),BI.nextTick(function(e){BI.Maskers.show(e)},this.getName())},_pauseSearch:function(){this.options,this.getName();this._stop=!0,BI.nextTick(function(e){BI.Maskers.hide(e)},this.getName()),!0===this._isSearching&&(this.popupView&&this.popupView.pauseSearch&&this.popupView.pauseSearch(),this.fireEvent(BI.Searcher.EVENT_PAUSE)),this._isSearching=!1},_stopSearch:function(){this.options;var e=this.getName();this._stop=!0,BI.Maskers.hide(e),!0===this._isSearching&&(this.popupView&&this.popupView.stopSearch&&this.popupView.stopSearch(),this.fireEvent(BI.Searcher.EVENT_STOP)),this._isSearching=!1},_search:function(){var i=this,r=this.options,a=r.allowSearchBlank?this.editor.getValue():this._getLastSearchKeyword();if(""!==a&&!this._stop){if(r.isAutoSearch){var e=r.adapter&&(r.adapter.getItems&&r.adapter.getItems()||r.adapter.attr("items"))||[],t=BI.Func.getSearchResult(e,a),n=t.match,o=t.find;return this.popupView.populate(o,n,a),r.isAutoSync&&r.adapter&&r.adapter.getValue&&this.popupView.setValue(r.adapter.getValue()),void i.fireEvent(BI.Searcher.EVENT_SEARCHING)}this.popupView.loading&&this.popupView.loading(),r.onSearch({times:1,keyword:a,selectedValues:r.adapter&&r.adapter.getValue()},function(e,t){var n;i._stop||(0<(n=[].slice.call(arguments)).length&&n.push(a),BI.Maskers.show(i.getName()),i.popupView.populate.apply(i.popupView,n),r.isAutoSync&&r.adapter&&r.adapter.getValue&&i.popupView.setValue(r.adapter.getValue()),i.popupView.loaded&&i.popupView.loaded(),i.fireEvent(BI.Searcher.EVENT_SEARCHING))})}},_getLastSearchKeyword:function(){if(this.isValid()){var e=this.editor.getValue().match(/[\S]+/g);return BI.isNull(e)?"":e[e.length-1]}},setAdapter:function(e){this.options.adapter=e,BI.Maskers.remove(this.getName())},doSearch:function(){this.isSearching()&&this._search()},stopSearch:function(){this._stopSearch();try{this.editor.blur()}catch(e){if(!this.editor.blur)throw new Error("editor没有实现blur方法")}finally{this.editor.setValue("")}},isSearching:function(){return this._isSearching},isViewVisible:function(){return this.editor.isEnabled()&&BI.Maskers.isVisible(this.getName())},getView:function(){return this.popupView},hasMatched:function(){return this._assertPopupView(),this.popupView.hasMatched()},adjustHeight:function(){BI.Maskers.has(this.getName())&&BI.Maskers.get(this.getName()).isVisible()&&BI.Maskers.show(this.getName())},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},setValue:function(e){BI.isNull(this.popupView)?this.options.popup.value=e:this.popupView.setValue(e)},getKeyword:function(){return this._getLastSearchKeyword()},getKeywords:function(){return this.editor.getKeywords()},getValue:function(){var e=this.options;return e.isAutoSync&&e.adapter&&e.adapter.getValue?e.adapter.getValue():this.isSearching()?this.popupView.getValue():e.adapter&&e.adapter.getValue?e.adapter.getValue():BI.isNull(this.popupView)?e.popup.value:this.popupView.getValue()},populate:function(e,t,n){var i=this.options;this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),i.isAutoSync&&i.adapter&&i.adapter.getValue&&this.popupView.setValue(i.adapter.getValue())},empty:function(){this.popupView&&this.popupView.empty()},destroyed:function(){BI.Maskers.remove(this.getName())}}),BI.Searcher.EVENT_CHANGE="EVENT_CHANGE",BI.Searcher.EVENT_START="EVENT_START",BI.Searcher.EVENT_STOP="EVENT_STOP",BI.Searcher.EVENT_PAUSE="EVENT_PAUSE",BI.Searcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.Searcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.shortcut("bi.searcher",BI.Searcher)},function(e,t){BI.Switcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-switcher",direction:BI.Direction.Top,trigger:"click",toggle:!0,el:{},popup:{},adapter:null,masker:{},switcherClass:"bi-switcher-popup",hoverClass:"bi-switcher-hover"})},_init:function(){BI.Switcher.superclass._init.apply(this,arguments);var i=this,e=this.options;this._initSwitcher(),this._initPullDownAction(),this.switcher.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.isEnabled()&&i.isValid()&&(e===BI.Events.EXPAND&&i._popupView(),e===BI.Events.COLLAPSE&&i._hideView(),e===BI.Events.EXPAND&&(i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),i.fireEvent(BI.Switcher.EVENT_EXPAND)),e===BI.Events.COLLAPSE&&(i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),i.isViewVisible()&&i.fireEvent(BI.Switcher.EVENT_COLLAPSE)),e===BI.Events.CLICK&&i.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE,t,n))}),this.element.hover(function(){i.isEnabled()&&i.switcher.isEnabled()&&i.element.addClass(e.hoverClass)},function(){i.isEnabled()&&i.switcher.isEnabled()&&i.element.removeClass(e.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.switcher}]}),e.isDefaultInit&&this._assertPopupView()},_toggle:function(){this._assertPopupView(),this.isExpanded()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var n=this,i=this.options,e=this.options.trigger.split(",");BI.each(e,function(e,t){switch(t){case"hover":n.element[t](function(e){n.isEnabled()&&n.switcher.isEnabled()&&(n._popupView(),n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",n.switcher),n.fireEvent(BI.Switcher.EVENT_EXPAND))},function(){n.isEnabled()&&n.switcher.isEnabled()&&i.toggle&&(n._hideView(),n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",n.switcher),n.fireEvent(BI.Switcher.EVENT_COLLAPSE))});break;default:t&&n.element.off(t+"."+n.getName()).on(t+"."+n.getName(),BI.debounce(function(e){n.switcher.element.__isMouseInBounds__(e)&&n.isEnabled()&&n.switcher.isEnabled()&&(i.toggle?n._toggle():n._popupView(),n.isExpanded()?(n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",n.switcher),n.fireEvent(BI.Switcher.EVENT_EXPAND)):(n.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",n.switcher),n.fireEvent(BI.Switcher.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initSwitcher:function(){this.switcher=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var i=this,e=this.options;this._created||(this.popupView=BI.createWidget(e.popup,{type:"bi.button_group",element:e.adapter&&BI.Maskers.create(this.getName(),e.adapter,BI.extend({container:this},e.masker)),cls:"switcher-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:e.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.Switcher.EVENT_CHANGE,t,n)}),e.direction===BI.Direction.Custom||e.adapter||BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._created=!0,BI.nextTick(function(){i.fireEvent(BI.Switcher.EVENT_AFTER_INIT)}))},_hideView:function(){this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);var e=this,t=this.options;t.adapter?BI.Maskers.hide(e.getName()):e.popupView&&e.popupView.setVisible(!1),BI.nextTick(function(){t.adapter?BI.Maskers.hide(e.getName()):e.popupView&&e.popupView.setVisible(!1),e.element.removeClass(t.switcherClass),e.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW)})},_popupView:function(){var t=this,n=this.options;this._assertPopupView(),this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW),n.adapter?BI.Maskers.show(this.getName()):t.popupView.setVisible(!0),BI.nextTick(function(e){n.adapter?BI.Maskers.show(e):t.popupView.setVisible(!0),t.element.addClass(n.switcherClass),t.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW)},this.getName())},populate:function(e){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.switcher.populate.apply(this.switcher,arguments)},_setEnable:function(e){BI.Switcher.superclass._setEnable.apply(this,arguments),!e&&this.isViewVisible()&&this._hideView()},setValue:function(e){this.switcher.setValue(e),BI.isNull(this.popupView)?this.options.popup.value=e:this.popupView.setValue(e)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},setAdapter:function(e){this.options.adapter=e,BI.Maskers.remove(this.getName())},isViewVisible:function(){return this.isEnabled()&&this.switcher.isEnabled()&&(this.options.adapter?BI.Maskers.isVisible(this.getName()):this.popupView&&this.popupView.isVisible())},isExpanded:function(){return this.isViewVisible()},showView:function(){this.isEnabled()&&this.switcher.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(e){return this.switcher.attr("id")===e?this.switcher:this.popupView&&this.popupView.getNodeById(e)},getNodeByValue:function(e){return this.switcher.getValue()===e?this.switcher:this.popupView&&this.popupView.getNodeByValue(e)},empty:function(){this.popupView&&this.popupView.empty()}}),BI.Switcher.EVENT_EXPAND="EVENT_EXPAND",BI.Switcher.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Switcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Switcher.EVENT_CHANGE="EVENT_CHANGE",BI.Switcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Switcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Switcher.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Switcher.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Switcher.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.switcher",BI.Switcher)},function(e,t){BI.Tab=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Tab.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tab",direction:"top",single:!1,logic:{dynamic:!1},showIndex:!1,tab:!1,cardCreator:function(e){return BI.createWidget()}})},render:function(){var i=this,n=this.options;BI.isObject(n.tab)&&(this.tab=BI.createWidget(this.options.tab,{type:"bi.button_group"}),this.tab.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})),this.cardMap={},this.layout=BI.createWidget({type:"bi.card"}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(n.direction),BI.extend({},n.logic,{items:BI.LogicFactory.createLogicItemsByDirection(n.direction,this.tab,this.layout)})))),new BI.ShowListener({eventObj:this.tab,cardLayout:this.layout,cardCreator:function(e){var t=n.cardCreator.apply(i,arguments);return i.cardMap[e]=t},afterCardShow:function(e){i._deleteOtherCards(e),i.curr=e}}).on(BI.ShowListener.EVENT_CHANGE,function(e){i.fireEvent(BI.Tab.EVENT_CHANGE,e,i)})},_deleteOtherCards:function(n){var i=this;!0===this.options.single&&BI.each(this.cardMap,function(e,t){e!==n+""&&(i.layout.deleteCardByName(e),delete i.cardMap[e])})},_assertCard:function(e){var t;this.layout.isCardExisted(e)||(t=this.options.cardCreator(e),this.cardMap[e]=t,this.layout.addCardByName(e,t))},mounted:function(){var e=this.options;!1!==e.showIndex&&this.setSelect(e.showIndex)},setSelect:function(e){this.tab&&this.tab.setValue(e),this._assertCard(e),this.layout.showCardByName(e),this._deleteOtherCards(e),this.curr!==e&&(this.curr=e)},removeTab:function(n){var i=this;this.options;BI.any(this.cardMap,function(e,t){if(BI.isEqual(e,n+""))return i.layout.deleteCardByName(e),delete i.cardMap[e],!0})},getSelect:function(){return this.curr},getSelectedTab:function(){return this.layout.getShowingCard()},getTab:function(e){return this._assertCard(e),this.layout.getCardByName(e)},setValue:function(e){var t=this.layout.getShowingCard();t&&t.setValue(e)},getValue:function(){var e=this.layout.getShowingCard();if(e)return e.getValue()},populate:function(){var e=this.layout.getShowingCard();if(e)return e.populate&&e.populate.apply(e,arguments)},empty:function(){this.layout.deleteAllCard(),this.cardMap={}},destroy:function(){this.cardMap={},BI.Tab.superclass.destroy.apply(this,arguments)}}),BI.Tab.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tab",BI.Tab)},function(e,t){BI.EL=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EL.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-el",el:{},layout:{}})},_init:function(){BI.EL.superclass._init.apply(this,arguments);var e=this,t=this.options;this.ele=BI.createWidget(t.el),BI.createWidget(t.layout,{type:"bi.adaptive",element:this,items:[this.ele]}),this.ele.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(e){this.ele.setValue(e)},getValue:function(){return this.ele.getValue()},populate:function(){this.ele.populate.apply(this,arguments)}}),BI.shortcut("bi.el",BI.EL)},function(e,t){var s,l,u,c;BI.Msg=(u=[],c=[],{alert:function(e,t,n){this._show(!1,e,t,n)},confirm:function(e,t,n){this._show(!0,e,t,n)},prompt:function(e,t,n,i,r){},toast:function(e,t,n){t=t||{},n=n||BI.Widget._renderEngine.createElement("body");var i=t.level||"normal",r=!!BI.isNull(t.autoClose)||t.autoClose,a=BI.isFunction(t.callback)?t.callback:BI.emptyFn,o=BI.createWidget({type:"bi.toast",cls:"bi-message-animate bi-message-leave",level:i,autoClose:r,text:e,listeners:[{eventName:BI.Toast.EVENT_DESTORY,action:function(){BI.remove(c,o.element);var n=10;BI.each(c,function(e,t){t.css({top:n}),n+=t.outerHeight()+10}),a()}}]}),s=10;BI.each(c,function(e,t){s+=t.outerHeight()+10}),BI.createWidget({type:"bi.absolute",element:n,items:[{el:o,left:"50%",top:s}]}),c.push(o.element),o.element.css({"margin-left":-1*o.element.outerWidth()/2}),o.element.removeClass("bi-message-leave").addClass("bi-message-enter"),r&&BI.delay(function(){o.element.removeClass("bi-message-enter").addClass("bi-message-leave"),o.destroy()},5e3)},_show:function(e,t,n,i){BI.isNull(s)&&(s=BI.Widget._renderEngine.createElement('<div class="bi-z-index-mask">').css({position:"absolute",zIndex:BI.zIndex_tip-2,top:0,left:0,right:0,bottom:0,opacity:.5}).appendTo("body")),l=BI.Widget._renderEngine.createElement('<div class="bi-message-depend">').css({position:"absolute",zIndex:BI.zIndex_tip-1,top:0,left:0,right:0,bottom:0}).appendTo("body");var r=function(){u[u.length-1].destroy(),u.pop(),0===u.length&&(s.remove(),s=null)},a=[];!0===e&&a.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_Cancel"),level:"ignore",handler:function(){r(),BI.isFunction(i)&&i.apply(null,[!1])}}}),a.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_OK"),handler:function(){r(),BI.isFunction(i)&&i.apply(null,[!0])}}});var o={element:l,type:"bi.center_adapt",items:[{type:"bi.border",cls:"bi-card",items:{north:{el:{type:"bi.border",cls:"bi-message-title bi-background",items:{center:{el:{type:"bi.label",cls:"bi-font-bold",text:t||BI.i18nText("BI-Basic_Prompt"),textAlign:"left",hgap:20,height:40}},east:{el:{type:"bi.icon_button",cls:"bi-message-close close-font",handler:function(){r(),BI.isFunction(i)&&i.apply(null,[!1])}},width:60}}},height:40},center:{el:{type:"bi.label",vgap:10,hgap:20,whiteSpace:"normal",text:n}},south:{el:{type:"bi.absolute",items:[{el:{type:"bi.right_vertical_adapt",lgap:10,items:a},top:0,left:20,right:20,bottom:0}]},height:44}},width:450,height:200}]};u[u.length]=BI.createWidget(o)}})},function(e,t){BI.GridView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-view",overflowX:!0,overflowY:!0,overscanColumnCount:0,overscanRowCount:0,rowHeightGetter:BI.emptyFn,columnWidthGetter:BI.emptyFn,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.GridView.superclass._init.apply(this,arguments);var e=this,t=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){e._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){!0!==e._scrollLock&&(t.scrollLeft=e.element.scrollLeft(),t.scrollTop=e.element.scrollTop(),e._calculateChildrenToRender(),e.fireEvent(BI.GridView.EVENT_SCROLL,{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:!0===t.overflowX&&!0===t.overflowY,scrolly:!1===t.overflowX&&!0===t.overflowY,scrollx:!0===t.overflowX&&!1===t.overflowY,items:[this.container]}),0<t.items.length&&this._populate()},mounted:function(){var e=this.options;0===e.scrollLeft&&0===e.scrollTop||(this.element.scrollTop(e.scrollTop),this.element.scrollLeft(e.scrollLeft))},_getOverscanIndices:function(e,t,n,i){return{overscanStartIndex:Math.max(0,n-t),overscanStopIndex:Math.min(e-1,i+t)}},_calculateChildrenToRender:function(){var n=this,e=this.options,t=e.width,i=e.height,r=BI.clamp(e.scrollLeft,0,this._getMaxScrollLeft()),a=BI.clamp(e.scrollTop,0,this._getMaxScrollTop()),o=e.overscanColumnCount,s=e.overscanRowCount;if(0<i&&0<t){var l=this._columnSizeAndPositionManager.getVisibleCellRange(t,r),u=this._rowSizeAndPositionManager.getVisibleCellRange(i,a);if(BI.isEmpty(l)||BI.isEmpty(u))return;var c=this._columnSizeAndPositionManager.getOffsetAdjustment(t,r),h=this._rowSizeAndPositionManager.getOffsetAdjustment(i,a);this._renderedColumnStartIndex=l.start,this._renderedColumnStopIndex=l.stop,this._renderedRowStartIndex=u.start,this._renderedRowStopIndex=u.stop;var p=this._getOverscanIndices(this.columnCount,o,this._renderedColumnStartIndex,this._renderedColumnStopIndex),d=this._getOverscanIndices(this.rowCount,s,this._renderedRowStartIndex,this._renderedRowStopIndex),f=p.overscanStartIndex,g=p.overscanStopIndex,m=d.overscanStartIndex,I=d.overscanStopIndex,B=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(m),_=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(f),E=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(I),b=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(g),y=B.offset+h,v=_.offset+c,T=E.offset+h+E.size,C=b.offset+c+b.size;if(y>=this.renderRange.minY&&T<=this.renderRange.maxY&&v>=this.renderRange.minX&&C<=this.renderRange.maxX)return;for(var N=[],V={},S={},x=this._getMaxScrollLeft(),w=this._getMaxScrollTop(),A=0,L=0,k=0,D=m;D<=I;D++)for(var M=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(D),P=f;P<=g;P++){var R,H=D+"-"+P,O=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(P),F=this.renderedKeys[H]&&this.renderedKeys[H][2];0<=F?(O.size!==this.renderedCells[F]._width&&(this.renderedCells[F]._width=O.size,this.renderedCells[F].el.setWidth(O.size)),M.size!==this.renderedCells[F]._height&&(this.renderedCells[F]._height=M.size,this.renderedCells[F].el.setHeight(M.size)),this.renderedCells[F]._left!==O.offset+c&&this.renderedCells[F].el.element.css("left",O.offset+c+"px"),this.renderedCells[F]._top!==M.offset+h&&this.renderedCells[F].el.element.css("top",M.offset+h+"px"),N.push(R=this.renderedCells[F])):(R=BI.createWidget(BI.extend({type:"bi.label",width:O.size,height:M.size},e.items[D][P],{cls:(e.items[D][P].cls||"")+" grid-cell"+(0===D?" first-row":"")+(0===P?" first-col":""),_rowIndex:D,_columnIndex:P,_left:O.offset+c,_top:M.offset+h}),this),N.push({el:R,left:O.offset+c,top:M.offset+h,_left:O.offset+c,_top:M.offset+h,_width:O.size,_height:M.size})),x=Math.min(x,O.offset+c),A=Math.max(A,O.offset+c+O.size),w=Math.min(w,M.offset+h),L=Math.max(L,M.offset+h+M.size),V[H]=[D,P,k],S[k]=R,k++}var Y={},W={},G=[];BI.each(V,function(e,t){n.renderedKeys[e]?Y[e]=t:W[e]=t}),BI.each(this.renderedKeys,function(e,t){Y[e]||W[e]||G.push(t[2])}),BI.each(G,function(e,t){n.renderedCells[t].el._destroy()});var j=[];BI.each(W,function(e,t){j.push(N[t[2]])}),this.container.addItems(j,this),this.container._children=S,this.container.attr("items",N),this.renderedCells=N,this.renderedKeys=V,this.renderRange={minX:x,minY:w,maxX:A,maxY:L}}},_getRealMaxScrollLeft:function(){var t=this.options,n=0;return BI.count(0,this.columnCount,function(e){n+=t.columnWidthGetter(e)}),Math.max(0,n-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollLeft:function(){return Math.max(0,this._columnSizeAndPositionManager.getTotalSize()-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._rowSizeAndPositionManager.getTotalSize()-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(e){var t=this.options;this._reRange(),this.columnCount=0,this.rowCount=0,e&&e!==this.options.items&&(this.options.items=e),BI.isNumber(t.columnCount)?this.columnCount=t.columnCount:0<t.items.length&&(this.columnCount=t.items[0].length),BI.isNumber(t.rowCount)?this.rowCount=t.rowCount:this.rowCount=t.items.length,this.container.setWidth(this.columnCount*t.estimatedColumnSize),this.container.setHeight(this.rowCount*t.estimatedRowSize),this._columnSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.columnCount,t.columnWidthGetter,t.estimatedColumnSize),this._rowSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.rowCount,t.rowHeightGetter,t.estimatedRowSize),this._calculateChildrenToRender();try{this.element.scrollTop(t.scrollTop),this.element.scrollLeft(t.scrollLeft)}catch(n){}},setScrollLeft:function(e){this.options.scrollLeft!==e&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(e||0,0,this._getRealMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(e){this.options.scrollTop!==e&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(e||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setColumnCount:function(e){this.options.columnCount=e},setRowCount:function(e){this.options.rowCount=e},setOverflowX:function(e){var t=this;this.options.overflowX!==!!e&&(this.options.overflowX=!!e,BI.nextTick(function(){t.element.css({overflowX:e?"auto":"hidden"})}))},setOverflowY:function(e){var t=this;this.options.overflowY!==!!e&&(this.options.overflowY=!!e,BI.nextTick(function(){t.element.css({overflowY:e?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},setEstimatedColumnSize:function(e){this.options.estimatedColumnSize=e},setEstimatedRowSize:function(e){this.options.estimatedRowSize=e},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(e,t){t.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(e){e&&e!==this.options.items&&this.restore(),this._populate(e)}}),BI.GridView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.grid_view",BI.GridView)},function(e,t){BI.Popover=BI.inherit(BI.Widget,{_constant:{SIZE:{SMALL:"small",NORMAL:"normal",BIG:"big"},HEADER_HEIGHT:40},_defaultConfig:function(){return BI.extend(BI.Popover.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-popover bi-card bi-border-radius",size:"normal",logic:{dynamic:!1},header:null,body:null,footer:null,closable:!0})},render:function(){var r=this,e=this.options;this.startX=0,this.startY=0,this.tracker=new BI.MouseMoveTracker(function(e,t){r._calculateSize();var n=BI.Widget._renderEngine.createElement("body").width(),i=BI.Widget._renderEngine.createElement("body").height();r.startX+=e,r.startY+=t,r.element.css({left:BI.clamp(r.startX,0,n-r.element.width())+"px",top:BI.clamp(r.startY,0,i-r.element.height())+"px"}),BI.Resizers._resize()},function(){r.tracker.releaseMouseMoves()},_global);var t=[{el:{type:"bi.htape",cls:"bi-message-title bi-header-background",ref:function(e){r.dragger=e},items:[{type:"bi.absolute",items:[{el:BI.isPlainObject(e.header)?BI.createWidget(e.header,{extraCls:"bi-font-bold"}):{type:"bi.label",cls:"bi-font-bold",height:this._constant.HEADER_HEIGHT,text:e.header,title:e.header,textAlign:"left"},left:20,top:0,right:0,bottom:0}]},{el:e.closable?{type:"bi.icon_button",cls:"bi-message-close close-font",height:this._constant.HEADER_HEIGHT,handler:function(){r.close()}}:{type:"bi.layout"},width:56}],height:this._constant.HEADER_HEIGHT},height:this._constant.HEADER_HEIGHT},{el:e.logic.dynamic?{type:"bi.vertical",scrolly:!1,cls:"popover-body",ref:function(){r.body=this},hgap:20,tgap:10,items:[{el:BI.createWidget(e.body)}]}:{type:"bi.absolute",items:[{el:BI.createWidget(e.body),left:20,top:10,right:20,bottom:0}]}}];e.footer&&t.push({el:{type:"bi.absolute",items:[{el:BI.createWidget(e.footer),left:20,top:0,right:20,bottom:0}],height:44},height:44});var n=this._calculateSize();return BI.extend({type:e.logic.dynamic?"bi.vertical":"bi.vtape",items:t,width:n.width},e.logic.dynamic?{type:"bi.vertical",scrolly:!1}:{type:"bi.vtape",height:n.height})},mounted:function(){var e,t,n,i=this,r=this.options;this.dragger.element.mousedown(function(e){var t=i.element.offset();i.startX=t.left,i.startY=t.top,i.tracker.captureMouseMoves(e)}),r.logic.dynamic&&(e=this._calculateSize(),t=this.element.height(),n=BI.clamp(t,e.height,600)-(r.footer?84:44),this.body.element.height(n))},_calculateSize:function(){var e=this.options,t={};if(BI.isNotNull(e.size))switch(e.size){case this._constant.SIZE.SMALL:t.width=450,t.height=200;break;case this._constant.SIZE.BIG:t.width=900,t.height=500;break;default:t.width=550,t.height=500}return{width:e.width||t.width,height:e.height||t.height}},hide:function(){},open:function(){this.show(),this.fireEvent(BI.Popover.EVENT_OPEN,arguments)},close:function(){this.hide(),this.fireEvent(BI.Popover.EVENT_CLOSE,arguments)},setZindex:function(e){this.element.css({"z-index":e})},destroyed:function(){}}),BI.shortcut("bi.popover",BI.Popover),BI.BarPopover=BI.inherit(BI.Popover,{_defaultConfig:function(){return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this,arguments),{btns:[BI.i18nText("BI-Basic_Sure"),BI.i18nText("BI-Basic_Cancel")]})},beforeCreate:function(){var t=this,e=this.options;e.footer||(e.footer={type:"bi.right_vertical_adapt",lgap:10,items:[{type:"bi.button",text:this.options.btns[1],value:1,level:"ignore",handler:function(e){t.fireEvent(BI.Popover.EVENT_CANCEL,e),t.close(e)}},{type:"bi.button",text:this.options.btns[0],warningTitle:e.warningTitle,value:0,handler:function(e){t.fireEvent(BI.Popover.EVENT_CONFIRM,e),t.close(e)}}]})}}),BI.shortcut("bi.bar_popover",BI.BarPopover),BI.Popover.EVENT_CLOSE="EVENT_CLOSE",BI.Popover.EVENT_OPEN="EVENT_OPEN",BI.Popover.EVENT_CANCEL="EVENT_CANCEL",BI.Popover.EVENT_CONFIRM="EVENT_CONFIRM"},function(e,t){BI.PopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-popup-view",maxWidth:"auto",minWidth:100,minHeight:24,lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,innerVGap:0,direction:BI.Direction.Top,stopEvent:!1,stopPropagation:!1,logic:{dynamic:!0},tool:!1,tabs:[],buttons:[],el:{type:"bi.button_group",items:[],chooseType:0,behaviors:{},layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.PopupView.superclass._init.apply(this,arguments);var t=this,e=this.options,n=function(e){e.stopPropagation()},i=function(e){return e.stopEvent(),!1};this.element.css({"z-index":BI.zIndex_popup,"min-width":e.minWidth+"px","max-width":e.maxWidth+"px"}).bind({click:n}),this.element.bind("mousewheel",n),e.stopPropagation&&this.element.bind({mousedown:n,mouseup:n,mouseover:n}),e.stopEvent&&this.element.bind({mousedown:i,mouseup:i,mouseover:i}),this.tool=this._createTool(),this.tab=this._createTab(),this.view=this._createView(),this.toolbar=this._createToolBar(),this.view.on(BI.Controller.EVENT_CHANGE,function(e){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&t.fireEvent(BI.PopupView.EVENT_CHANGE)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(e.direction),BI.extend({},e.logic,{scrolly:!1,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,vgap:e.vgap,hgap:e.hgap,items:BI.LogicFactory.createLogicItemsByDirection(e.direction,BI.extend({cls:"list-view-outer bi-card list-view-shadow"},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(e.direction),BI.extend({},e.logic,{items:BI.LogicFactory.createLogicItemsByDirection(e.direction,this.tool,this.tab,this.view,this.toolbar)}))))}))))},_createView:function(){var e=this.options;return this.button_group=BI.createWidget(e.el,{type:"bi.button_group",value:e.value}),this.button_group.element.css({"min-height":e.minHeight+"px","padding-top":e.innerVGap+"px","padding-bottom":e.innerVGap+"px"}),this.button_group},_createTool:function(){var e=this.options;if(!1!==e.tool)return BI.createWidget(e.tool)},_createTab:function(){var e=this.options;if(0!==e.tabs.length)return BI.createWidget({type:"bi.center",cls:"list-view-tab",height:25,items:e.tabs,value:e.value})},_createToolBar:function(){var e=this.options;if(0!==e.buttons.length)return BI.createWidget({type:"bi.center",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(e.buttons,{once:!1,shadow:!0,isShadowShowingOnSelected:!0})})},getView:function(){return this.view},populate:function(e){this.view.populate.apply(this.view,arguments)},resetWidth:function(e){this.options.width=e,this.element.width(e)},resetHeight:function(e){var t=e-(this.toolbar?this.toolbar.attr("height")||24:0)-(this.tab?this.tab.attr("height")||24:0)-(this.tool&&this.tool.attr("height")||24)*(this.tool&&this.tool.isVisible()?1:0)-2*this.options.innerVGap;this.view.resetHeight?this.view.resetHeight(t):this.view.element.css({"max-height":t+"px"})},setValue:function(e){this.tab&&this.tab.setValue(e),this.view.setValue(e)},getValue:function(){return this.view.getValue()}}),BI.PopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.popup_view",BI.PopupView)},function(e,t){BI.SearcherView=BI.inherit(BI.Pane,{_defaultConfig:function(){var e=BI.SearcherView.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-searcher-view bi-card",tipText:BI.i18nText("BI-No_Select"),chooseType:BI.Selection.Single,matcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]},searcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.SearcherView.superclass._init.apply(this,arguments);var i=this,e=this.options;this.matcher=BI.createWidget(e.matcher,{type:"bi.button_group",chooseType:e.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:e.value}),this.matcher.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.SearcherView.EVENT_CHANGE,t,n)}),this.spliter=BI.createWidget({type:"bi.vertical",height:1,hgap:10,items:[{type:"bi.layout",height:1,cls:"searcher-view-spliter bi-background"}]}),this.searcher=BI.createWidget(e.searcher,{type:"bi.button_group",chooseType:e.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:e.value}),this.searcher.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.SearcherView.EVENT_CHANGE,t,n)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.matcher,this.spliter,this.searcher]})},startSearch:function(){},stopSearch:function(){},setValue:function(e){this.matcher.setValue(e),this.searcher.setValue(e)},getValue:function(){return this.matcher.getValue().concat(this.searcher.getValue())},populate:function(e,t,n){e=e||[],t=t||[],this.setTipVisible(e.length+t.length===0),this.spliter.setVisible(BI.isNotEmptyArray(t)&&BI.isNotEmptyArray(e)),this.matcher.populate(t,n),this.searcher.populate(e,n)},empty:function(){this.searcher.empty(),this.matcher.empty()},hasMatched:function(){return 0<this.matcher.getAllButtons().length}}),BI.SearcherView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.searcher_view",BI.SearcherView)},function(e,t){BI.ListView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-list-view",overscanHeight:100,blockSize:10,scrollTop:0,el:{},items:[]}},init:function(){this.renderedIndex=-1,this.cache={}},render:function(){var e=this,t=this.options;return{type:"bi.vertical",items:[BI.extend({type:"bi.vertical",scrolly:!1,ref:function(){e.container=this}},t.el)],element:this}},mounted:function(){var n=this,t=this.options;this._populate(),this.element.scroll(function(e){t.scrollTop=n.element.scrollTop(),n._calculateBlocksToRender()});var i=this.element.width(),r=this.element.height();BI.ResizeDetector.addResizeListener(this,function(){var e=n.element.width(),t=n.element.height();e===i&&t===r||(i=e,r=t,n._calculateBlocksToRender())})},_renderMoreIf:function(){for(var e,t=this,n=this.options,i=this.element.height(),r=n.scrollTop+i+n.overscanHeight,a=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+n.blockSize||0,o=this.renderedIndex+1,s=function(){return t.container.element.height()};(e=s())<r&&a<n.items.length;){var l=n.items.slice(a,a+n.blockSize);this.container.addItems(l,this);var u=s()-e;this.cache[o]={index:a,scrollTop:e,height:u},this.renderedIndex=o,o++,a+=n.blockSize}},_calculateBlocksToRender:function(){this.options;this._renderMoreIf()},_populate:function(e){var t=this.options;e&&this.options.items!==e&&(this.options.items=e),this._calculateBlocksToRender(),this.element.scrollTop(t.scrollTop)},restore:function(){this.renderedIndex=-1,this.container.empty(),this.cache={}},populate:function(e){e&&this.options.items!==e&&this.restore(),this._populate(e)},destroyed:function(){this.restore()}}),BI.shortcut("bi.list_view",BI.ListView)},function(e,t){BI.VirtualList=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-virtual-list",overscanHeight:100,blockSize:10,scrollTop:0,items:[]}},init:function(){this.renderedIndex=-1,this.cache={}},render:function(){var e=this;this.options;return{type:"bi.vertical",items:[{type:"bi.layout",ref:function(){e.topBlank=this}},{type:"bi.vertical",scrolly:!1,ref:function(){e.container=this}},{type:"bi.layout",ref:function(){e.bottomBlank=this}}],element:this}},mounted:function(){var t=this,n=this.options;this._populate(),this.element.scroll(function(e){n.scrollTop=t.element.scrollTop(),t._calculateBlocksToRender()}),BI.ResizeDetector.addResizeListener(this,function(){t._calculateBlocksToRender()})},_renderMoreIf:function(){for(var e,t=this,n=this.options,i=this.element.height(),r=n.scrollTop+i+n.overscanHeight,a=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+n.blockSize||0,o=this.renderedIndex+1,s=function(){return t.container.element.height()+t.topBlank.element.height()+t.bottomBlank.element.height()};(e=s())<r&&a<n.items.length;){var l=n.items.slice(a,a+n.blockSize);this.container.addItems(l,this);var u=s()-e;this.cache[o]={index:a,scrollTop:e,height:u},this.tree.set(o,u),this.renderedIndex=o,o++,a+=n.blockSize}},_calculateBlocksToRender:function(){var e=this.options;this._renderMoreIf();for(var t=this.element.height(),n=e.scrollTop-e.overscanHeight,i=e.scrollTop+t+e.overscanHeight,r=this.tree.greatestLowerBound(n),a=this.tree.leastUpperBound(i),o=[],s=0;s<r;s++){var l=this.cache[s].index;if(!this.cache[s].destroyed){for(var u=l;u<l+e.blockSize&&u<e.items.length;u++)o.push(this.container._children[u]),this.container._children[u]=null;this.cache[s].destroyed=!0}}for(s=a+1;s<=this.renderedIndex;s++){l=this.cache[s].index;if(!this.cache[s].destroyed){for(u=l;u<l+e.blockSize&&u<e.items.length;u++)o.push(this.container._children[u]),this.container._children[u]=null;this.cache[s].destroyed=!0}}for(var c=BI.Widget._renderEngine.createFragment(),h=BI.Widget._renderEngine.createFragment(),p=c,s=r<0?0:r;s<=a&&s<=this.renderedIndex;s++){l=this.cache[s].index;if(this.cache[s].destroyed||(p=h),!0===this.cache[s].destroyed){for(u=l;u<l+e.blockSize&&u<e.items.length;u++){var d=this.container._addElement(u,BI.extend({root:!0},BI.stripEL(e.items[u])),this);p.appendChild(d.element[0])}this.cache[s].destroyed=!1}}this.container.element.prepend(c),this.container.element.append(h),this.topBlank.setHeight(this.tree.sumTo(Math.max(-1,r-1))),this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex)-this.tree.sumTo(Math.min(a,this.renderedIndex))),BI.each(o,function(e,t){t&&t._destroy()})},_populate:function(e){var t=this.options;e&&this.options.items!==e&&(this.options.items=e),this.tree=BI.PrefixIntervalTree.empty(Math.ceil(t.items.length/t.blockSize)),this._calculateBlocksToRender();try{this.element.scrollTop(t.scrollTop)}catch(n){}},_clearChildren:function(){BI.each(this.container._children,function(e,t){t&&t._destroy()}),this.container._children={},this.container.attr("items",[])},restore:function(){this.renderedIndex=-1,this._clearChildren(),this.cache={},this.options.scrollTop=0,this.topBlank.setHeight(0),this.bottomBlank.setHeight(0)},populate:function(e){e&&this.options.items!==e&&this.restore(),this._populate(e)},destroyed:function(){this.restore()}}),BI.shortcut("bi.virtual_list",BI.VirtualList)},function(e,t){BI.Pager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.Pager.superclass._init.apply(this,arguments);this.currPage=BI.result(this.options,"curr"),this._populate()},_populate:function(){var r=this,a=this.options,e=[],t={};this.empty();var n,o=BI.result(a,"pages"),i=BI.result(this,"currPage"),s=BI.result(a,"groups"),l=BI.result(a,"first"),u=BI.result(a,"last"),c=BI.result(a,"prev"),h=BI.result(a,"next");!1===o?(s=0,u=l=!1):o<s&&(s=o),t.index=Math.ceil((i+(1<s&&s!==o?1:0))/(0===s?1:s)),(!a.dynamicShow&&!a.dynamicShowPrevNext||1<i)&&!1!==c&&(BI.isKey(c)?e.push({text:c,value:"prev",disabled:!1===o?!1===a.hasPrev(i):!(1<i&&!1!==c)}):e.push(BI.extend({disabled:!1===o?!1===a.hasPrev(i):!(1<i&&!1!==c)},c))),(!a.dynamicShow&&!a.dynamicShowFirstLast||1<t.index&&0!==s)&&l&&(e.push({text:l,value:"first",disabled:!(1<t.index&&0!==s)}),1<t.index&&0!==s&&e.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),t.poor=Math.floor((s-1)/2),t.start=1<t.index?i-t.poor:1,t.end=1<t.index?(n=i+(s-t.poor-1),o<n?o:n):s,t.end-t.start<s-1&&(t.start=t.end-s+1);var p=t.start,d=t.end;for(l&&u&&1<t.index&&0!==s&&s<o&&t.end<o&&0!==s&&(p++,d--);p<=d;p++)p===i?e.push({text:p,value:p,selected:!0}):e.push({text:p,value:p});(!a.dynamicShow&&!a.dynamicShowFirstLast||s<o&&t.end<o&&0!==s)&&u&&(s<o&&t.end<o&&0!==s&&e.push({type:"bi.label",cls:"page-ellipsis",text:"…"}),e.push({text:u,value:"last",disabled:!(s<o&&t.end<o&&0!==s)})),t.flow=!c&&0===s,(!a.dynamicShow&&!a.dynamicShowPrevNext&&h||i!==o&&h||t.flow)&&e.push(BI.isKey(h)?!1===o?{text:h,value:"next",disabled:!1===a.hasNext(i)}:t.flow&&i===o?{text:h,value:"next",disabled:!0}:{text:h,value:"next",disabled:!(i!==o&&h||t.flow)}:BI.extend({disabled:!1===o?!1===a.hasNext(i):!(i!==o&&h||t.flow)},h)),this.button_group=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(e,{cls:"bi-list-item-select bi-border-radius",height:23,hgap:10}),behaviors:a.behaviors,layouts:a.layouts}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(e,t,n){if(e===BI.Events.CLICK){var i=r.button_group.getValue()[0];switch(i){case"first":r.currPage=1;break;case"last":r.currPage=o;break;case"prev":r.currPage--;break;case"next":r.currPage++;break;default:r.currPage=i}a.jump.apply(r,[{pages:o,curr:r.currPage}]),r._populate(),r.fireEvent(BI.Pager.EVENT_CHANGE,n)}r.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.fireEvent(BI.Pager.EVENT_AFTER_POPULATE)},getCurrentPage:function(){return this.currPage},setAllPages:function(e){this.options.pages=e},hasPrev:function(e){e=e||1;var t=this.options;return!1===this.options.pages?t.hasPrev(e):1<e},hasNext:function(e){e=e||1;var t=this.options,n=this.options.pages;return!1===n?t.hasNext(e):e<n},setValue:function(e){var t,n,i=this.options;e=(e=e||0)<1?1:e,!1===i.pages?(t=BI.result(i,"lastPage"),n=1,this.currPage=t<e?t:e<(n=BI.result(i,"firstPage"))?n:e):(e=e>i.pages?i.pages:e,this.currPage=e),this._populate()},getValue:function(){var e=this.button_group.getValue()[0];switch(e){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return e}},attr:function(e,t){BI.Pager.superclass.attr.apply(this,arguments),"curr"===e&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.Pager.EVENT_CHANGE="EVENT_CHANGE",BI.Pager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.pager",BI.Pager)},function(e,t){BI.A=BI.inherit(BI.Text,{_defaultConfig:function(){var e=BI.A.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-a display-block",href:"",target:"_blank",el:null,tagName:"a"})},_init:function(){var e=this.options;BI.A.superclass._init.apply(this,arguments),this.element.attr({href:e.href,target:e.target}),e.el&&BI.createWidget(e.el,{element:this})}}),BI.shortcut("bi.a",BI.A)},function(e,t){BI.LoadingBar=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.LoadingBar.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-loading-bar bi-tips",height:30,handler:BI.emptyFn})},_init:function(){BI.LoadingBar.superclass._init.apply(this,arguments);var t=this;this.loaded=BI.createWidget({type:"bi.text_button",cls:"loading-text bi-list-item-simple",text:BI.i18nText("BI-Load_More"),width:120,handler:this.options.handler}),this.loaded.on(BI.Controller.EVENT_CHANGE,function(e){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.loading=BI.createWidget({type:"bi.layout",width:this.options.height,height:this.options.height,cls:"loading-background cursor-default"});var e=BI.createWidget({type:"bi.center_adapt",items:[this.loaded]}),n=BI.createWidget({type:"bi.center_adapt",items:[this.loading]});this.cardLayout=BI.createWidget({type:"bi.card",element:this,items:[{el:e,cardName:"loaded"},{el:n,cardName:"loading"}]}),this.invisible()},_reset:function(){this.visible(),this.loaded.setText(BI.i18nText("BI-Load_More")),this.loaded.enable()},setLoaded:function(){this._reset(),this.cardLayout.showCardByName("loaded")},setEnd:function(){this.setLoaded(),this.loaded.setText(BI.i18nText("BI-No_More_Data")),this.loaded.disable()},setLoading:function(){this._reset(),this.cardLayout.showCardByName("loading")}}),BI.shortcut("bi.loading_bar",BI.LoadingBar)},function(e,t){BI.IconButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.IconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-icon-button horizon-center",iconWidth:null,iconHeight:null})},_init:function(){BI.IconButton.superclass._init.apply(this,arguments);var e=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:e.iconWidth,height:e.iconHeight}),BI.isNumber(e.height)&&0<e.height&&BI.isNull(e.iconWidth)&&BI.isNull(e.iconHeight)?(this.element.css("lineHeight",e.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))},doClick:function(){BI.IconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconButton.EVENT_CHANGE,this)}}),BI.IconButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_button",BI.IconButton)},function(e,t){BI.ImageButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.ImageButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-image-button",src:"",iconWidth:"100%",iconHeight:"100%"})},_init:function(){BI.ImageButton.superclass._init.apply(this,arguments);var e=this.options;this.image=BI.createWidget({type:"bi.img",width:e.iconWidth,height:e.iconHeight,src:e.src}),BI.isNumber(e.iconWidth)||BI.isNumber(e.iconHeight)?BI.createWidget({type:"bi.center_adapt",element:this,items:[this.image]}):BI.createWidget({type:"bi.adaptive",element:this,items:[this.image],scrollable:!1})},setWidth:function(e){BI.ImageButton.superclass.setWidth.apply(this,arguments),this.options.width=e},setHeight:function(e){BI.ImageButton.superclass.setHeight.apply(this,arguments),this.options.height=e},setImageWidth:function(e){this.image.setWidth(e)},setImageHeight:function(e){this.image.setHeight(e)},getImageWidth:function(){return this.image.element.width()},getImageHeight:function(){return this.image.element.height()},setSrc:function(e){this.options.src=e,this.image.setSrc(e)},getSrc:function(){return this.image.getSrc()},doClick:function(){BI.ImageButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageButton.EVENT_CHANGE,this)}}),BI.ImageButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.image_button",BI.ImageButton)},function(e,t){BI.Button=BI.inherit(BI.BasicButton,{_const:{iconWidth:18},_defaultConfig:function(e){var t=BI.Button.superclass._defaultConfig.apply(this,arguments);return BI.extend(t,{baseCls:(t.baseCls||"")+" bi-button"+(BI.isIE()&&BI.isIE9Below()?" hack":""),minWidth:!0===e.block||!0===e.clear?0:80,height:24,shadow:!0!==e.clear,isShadowShowingOnSelected:!0,readonly:!0,iconCls:"",level:"common",block:!1,clear:!1,ghost:!1,textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:e.clear?0:10,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},_init:function(){BI.Button.superclass._init.apply(this,arguments);var e=this.options;!BI.isNumber(e.height)||e.clear||e.block?e.clear||e.block?this.element.css({lineHeight:e.height+"px"}):this.element.css({lineHeight:e.height-2+"px"}):this.element.css({height:e.height+"px",lineHeight:e.height-2+"px"}),BI.isKey(e.iconCls)?(this.icon=BI.createWidget({type:"bi.icon_label",cls:e.iconCls,width:this._const.iconWidth,height:e.height-2,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),this.text=BI.createWidget({type:"bi.label",text:e.text,textWidth:BI.isNotNull(e.textWidth)?e.textWidth-this._const.iconWidth:null,textHeight:e.textHeight,value:e.value,height:e.height-2}),BI.createWidget({type:"bi.center_adapt",element:this,hgap:e.hgap,vgap:e.vgap,items:[{type:"bi.horizontal",items:[this.icon,this.text]}]})):this.text=BI.createWidget({type:"bi.label",textAlign:e.textAlign,whiteSpace:e.whiteSpace,textWidth:e.textWidth,textHeight:e.textHeight,hgap:e.hgap,vgap:e.vgap,tgap:e.tgap,bgap:e.bgap,lgap:e.lgap,rgap:e.rgap,element:this,text:e.text,value:e.value}),!0===e.block&&this.element.addClass("block"),!0===e.clear&&this.element.addClass("clear"),!0===e.ghost&&this.element.addClass("ghost"),0<e.minWidth&&this.element.css({"min-width":e.minWidth+"px"})},doClick:function(){BI.Button.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Button.EVENT_CHANGE,this)},setText:function(e){BI.Button.superclass.setText.apply(this,arguments),this.text.setText(e)},setValue:function(e){BI.Button.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(e)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},destroy:function(){BI.Button.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.button",BI.Button),BI.Button.EVENT_CHANGE="EVENT_CHANGE"},function(e,t){BI.TextButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.TextButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-button",textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,lgap:0,rgap:0,vgap:0,text:"",py:""})},_init:function(){BI.TextButton.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:e.textAlign,whiteSpace:e.whiteSpace,textWidth:e.textWidth,textHeight:e.textHeight,width:e.width,height:e.height,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword})},doClick:function(){BI.TextButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextButton.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(e){BI.TextButton.superclass.setText.apply(this,arguments),e=BI.isArray(e)?e.join(","):e,this.text.setText(e)},setStyle:function(e){this.text.setStyle(e)},setValue:function(e){BI.TextButton.superclass.setValue.apply(this,arguments),this.isReadOnly()||(e=BI.isArray(e)?e.join(","):e,this.text.setValue(e))}}),BI.TextButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_button",BI.TextButton)},function(e,t){BI.BlankIconIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconIconTextItem.superclass._init.apply(this,arguments);var e=this.options,t=(this._const,BI.createWidget({type:"bi.layout",width:e.blankWidth,height:e.height}));this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:e.iconCls1,forceNotSelected:!0,width:e.height,height:e.height}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:e.iconCls2,forceNotSelected:!0,width:e.height,height:e.height}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",t,this.icon1,this.icon2,this.text)}))))},doClick:function(){BI.BlankIconIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(e){BI.BlankIconIconTextItem.superclass.setSelected.apply(this,arguments),this.icon1.setSelected(e),this.icon2.setSelected(e)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_icon_text_item",BI.BlankIconIconTextItem)},function(e,t){BI.BlankIconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-blank-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextIconItem.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height});var t=BI.createWidget({type:"bi.icon_label",cls:e.iconCls1,width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:e.iconCls2,width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.layout",width:e.blankWidth},t,this.text,{type:"bi.layout",width:e.height})}))))},doClick:function(){BI.BlankIconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.BlankIconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_icon_item",BI.BlankIconTextIconItem)},function(e,t){BI.BlankIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.BlankIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},cls:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextItem.superclass._init.apply(this,arguments);var e=this.options,t=(this._const,BI.createWidget({type:"bi.layout",width:e.blankWidth}));this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",t,this.icon,this.text)}))))},doClick:function(){BI.BlankIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_item",BI.BlankIconTextItem)},function(e,t){BI.IconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.IconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconItem.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height});var t=BI.createWidget({type:"bi.icon_label",cls:e.iconCls1,width:e.leftIconWrapperWidth,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),n=BI.createWidget({type:"bi.layout",width:e.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:e.iconCls2,width:e.rightIconWrapperWidth,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",t,this.text,n)}))))},doClick:function(){BI.IconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_item",BI.IconTextIconItem)},function(e,t){BI.IconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.IconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-icon-text-item",direction:BI.Direction.Left,logic:{dynamic:!1},iconWrapperWidth:null,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextItem.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:e.iconWrapperWidth||e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(e.direction),BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection(e.direction,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.IconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_item",BI.IconTextItem)},function(e,t){BI.TextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.TextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-icon-item",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconItem.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.TextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_item",BI.TextIconItem)},function(e,t){BI.TextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.TextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-item",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:e.textAlign,whiteSpace:e.whiteSpace,textHeight:"nowrap"==e.whiteSpace?e.height:e.textHeight,height:e.height,hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py})},doClick:function(){BI.TextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_item",BI.TextItem)},function(e,t){BI.IconTextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.IconTextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-icon-text-icon-node",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconNode.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height});var t=BI.createWidget({type:"bi.icon_label",cls:e.iconCls1,width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),n=BI.createWidget({type:"bi.layout",width:e.height,height:e.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:e.iconCls2,width:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",t,this.text,n)}))))},doClick:function(){BI.IconTextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_node",BI.IconTextIconNode)},function(e,t){BI.IconTextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.IconTextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-icon-text-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextNode.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.IconTextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_node",BI.IconTextNode)},function(e,t){BI.TextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.TextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-icon-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconNode.superclass._init.apply(this,arguments);var e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:e.height,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconNode.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.TextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_node",BI.TextIconNode)},function(e,t){BI.TextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.TextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-node",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextNode.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:e.textAlign,whiteSpace:e.whiteSpace,textHeight:"nowrap"==e.whiteSpace?e.height:e.textHeight,height:e.height,hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py})},doClick:function(){BI.TextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_node",BI.TextNode)},function(e,t){BI.Editor=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Editor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-editor bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,tipType:"warning",inputType:"text",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){BI.Editor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=this.addWidget(BI.createWidget({type:"bi.input",element:"<input type='"+e.inputType+"'/>",root:!0,value:e.value,watermark:e.watermark,validationChecker:e.validationChecker,quitChecker:e.quitChecker,allowBlank:e.allowBlank})),this.editor.element.css({width:"100%",height:"100%",border:"none",outline:"none",padding:"0",margin:"0"}),BI.isKey(this.options.watermark)&&this._assertWaterMark();var n=[];this.watermark&&n.push({el:this.watermark,left:3,right:3,top:0,bottom:0}),n.push({el:this.editor,left:0,right:0,top:0,bottom:0});var i=[{el:{type:"bi.absolute",ref:function(e){t.contentWrapper=e},items:n},left:e.hgap+e.lgap,right:e.hgap+e.rgap,top:e.vgap+e.tgap,bottom:e.vgap+e.bgap}];BI.createWidget({type:"bi.absolute",element:this,items:i}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_FOCUS,function(){t._checkError(),t.element.addClass("bi-editor-focus"),t.fireEvent(BI.Editor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Input.EVENT_BLUR,function(){t._setErrorVisible(!1),t.element.removeClass("bi-editor-focus"),t.fireEvent(BI.Editor.EVENT_BLUR,arguments)}),this.editor.on(BI.Input.EVENT_CLICK,function(){t.fireEvent(BI.Editor.EVENT_CLICK,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE,function(){t.fireEvent(BI.Editor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.Editor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Input.EVENT_QUICK_DOWN,function(e){e.keyCode!==BI.KeyCode.TAB&&t.watermark&&t.watermark.invisible()}),this.editor.on(BI.Input.EVENT_VALID,function(){t._checkWaterMark(),t._setErrorVisible(!1),t.fireEvent(BI.Editor.EVENT_VALID,arguments)}),this.editor.on(BI.Input.EVENT_ERROR,function(){t._checkWaterMark(),t.fireEvent(BI.Editor.EVENT_ERROR,arguments),t._setErrorVisible(t.isEditing())}),this.editor.on(BI.Input.EVENT_RESTRICT,function(){t._checkWaterMark();var e=t._setErrorVisible(!0);e&&e.element.fadeOut(100,function(){e.element.fadeIn(100)}),t.fireEvent(BI.Editor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Input.EVENT_EMPTY,function(){t._checkWaterMark(),t.fireEvent(BI.Editor.EVENT_EMPTY,arguments)}),this.editor.on(BI.Input.EVENT_ENTER,function(){t.fireEvent(BI.Editor.EVENT_ENTER,arguments)}),this.editor.on(BI.Input.EVENT_SPACE,function(){t.fireEvent(BI.Editor.EVENT_SPACE,arguments)}),this.editor.on(BI.Input.EVENT_BACKSPACE,function(){t.fireEvent(BI.Editor.EVENT_BACKSPACE,arguments)}),this.editor.on(BI.Input.EVENT_REMOVE,function(){t.fireEvent(BI.Editor.EVENT_REMOVE,arguments)}),this.editor.on(BI.Input.EVENT_START,function(){t.fireEvent(BI.Editor.EVENT_START,arguments)}),this.editor.on(BI.Input.EVENT_PAUSE,function(){t.fireEvent(BI.Editor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Input.EVENT_STOP,function(){t.fireEvent(BI.Editor.EVENT_STOP,arguments)}),this.editor.on(BI.Input.EVENT_CONFIRM,function(){t.fireEvent(BI.Editor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE_CONFIRM,function(){t.fireEvent(BI.Editor.EVENT_CHANGE_CONFIRM,arguments)}),this.element.click(function(e){return e.stopPropagation(),!1}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this._checkError(),this._checkWaterMark()},_checkToolTip:function(){var e=this.options.errorText;BI.isFunction(e)&&(e=e(this.editor.getValue())),BI.isKey(e)&&(!this.isEnabled()||this.isValid()||BI.Bubbles.has(this.getName())&&BI.Bubbles.get(this.getName()).isVisible()?this.setTitle(""):this.setTitle(e))},_assertWaterMark:function(){var t=this,e=this.options;BI.isNull(this.watermark)&&(this.watermark=BI.createWidget({type:"bi.label",cls:"bi-water-mark",text:this.options.watermark,height:e.height-2*(e.vgap+e.tgap),whiteSpace:"nowrap",textAlign:"left"}),this.watermark.element.bind({mousedown:function(e){t.isEnabled()?t.editor.isEditing()||t.editor.focus():t.editor.isEditing()&&t.editor.blur(),e.stopEvent()}}),this.watermark.element.bind("click",function(e){t.isEnabled()?t.editor.isEditing()||t.editor.focus():t.editor.isEditing()&&t.editor.blur(),e.stopEvent()}))},_checkError:function(){this._setErrorVisible(this.isEnabled()&&!this.isValid()),this._checkToolTip()},_checkWaterMark:function(){var e=this.options;!this.disabledWaterMark&&""===this.editor.getValue()&&BI.isKey(e.watermark)?this.watermark&&this.watermark.visible():this.watermark&&this.watermark.invisible()},setErrorText:function(e){this.options.errorText=e},getErrorText:function(){return this.options.errorText},setWaterMark:function(e){this.options.watermark=e,BI.isNull(this.watermark)&&(this._assertWaterMark(),BI.createWidget({type:"bi.absolute",element:this.contentWrapper,items:[{el:this.watermark,left:3,right:3,top:0,bottom:0}]})),BI.isKey(e)&&this.watermark.setText(e)},_setErrorVisible:function(e){var t=this.options.errorText;if(BI.isFunction(t)&&(t=t(BI.trim(this.editor.getValue()))),!this.disabledError&&BI.isKey(t))return BI.Bubbles[e?"show":"hide"](this.getName(),t,this,{adjustYOffset:2}),this._checkToolTip(),BI.Bubbles.get(this.getName())},disableError:function(){this.disabledError=!0,this._checkError()},enableError:function(){this.disabledError=!1,this._checkError()},disableWaterMark:function(){this.disabledWaterMark=!0,this._checkWaterMark()},enableWaterMark:function(){this.disabledWaterMark=!1,this._checkWaterMark()},focus:function(){this.element.addClass("text-editor-focus"),this.editor.focus()},blur:function(){this.element.removeClass("text-editor-focus"),this.editor.blur()},selectAll:function(){this.editor.selectAll()},onKeyDown:function(e){this.editor.onKeyDown(e)},setValue:function(e){BI.Editor.superclass.setValue.apply(this,arguments),this.editor.setValue(e),this._checkError(),this._checkWaterMark()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.isValid()?BI.trim(this.editor.getValue()):BI.trim(this.editor.getLastValidValue())},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()},destroyed:function(){BI.Bubbles.remove(this.getName())}}),BI.Editor.EVENT_CHANGE="EVENT_CHANGE",BI.Editor.EVENT_FOCUS="EVENT_FOCUS",BI.Editor.EVENT_BLUR="EVENT_BLUR",BI.Editor.EVENT_CLICK="EVENT_CLICK",BI.Editor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Editor.EVENT_SPACE="EVENT_SPACE",BI.Editor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Editor.EVENT_START="EVENT_START",BI.Editor.EVENT_PAUSE="EVENT_PAUSE",BI.Editor.EVENT_STOP="EVENT_STOP",BI.Editor.EVENT_CONFIRM="EVENT_CONFIRM",BI.Editor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Editor.EVENT_VALID="EVENT_VALID",BI.Editor.EVENT_ERROR="EVENT_ERROR",BI.Editor.EVENT_ENTER="EVENT_ENTER",BI.Editor.EVENT_RESTRICT="EVENT_RESTRICT",BI.Editor.EVENT_REMOVE="EVENT_REMOVE",BI.Editor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.editor",BI.Editor)},function(e,t){BI.MultifileEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.MultifileEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-multifile-editor",multiple:!1,maxSize:-1,accept:"",url:""})},_init:function(){var e=this,t=this.options;BI.MultifileEditor.superclass._init.apply(this,arguments),this.file=BI.createWidget({type:"bi.file",cls:"multifile-editor",width:"100%",height:"100%",name:t.name,url:t.url,multiple:t.multiple,accept:t.accept,maxSize:t.maxSize,title:t.title}),this.file.on(BI.File.EVENT_CHANGE,function(){e.fireEvent(BI.MultifileEditor.EVENT_CHANGE,arguments)}),this.file.on(BI.File.EVENT_UPLOADSTART,function(){e.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART,arguments)}),this.file.on(BI.File.EVENT_ERROR,function(){e.fireEvent(BI.MultifileEditor.EVENT_ERROR,arguments)}),this.file.on(BI.File.EVENT_PROGRESS,function(){e.fireEvent(BI.MultifileEditor.EVENT_PROGRESS,arguments)}),this.file.on(BI.File.EVENT_UPLOADED,function(){e.fireEvent(BI.MultifileEditor.EVENT_UPLOADED,arguments)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",scrollable:!1,items:[this.file]},top:0,right:0,left:0,bottom:0}]})},select:function(){this.file.select()},getValue:function(){return this.file.getValue()},upload:function(){this.file.upload()},reset:function(){this.file.reset()}}),BI.MultifileEditor.EVENT_CHANGE="EVENT_CHANGE",BI.MultifileEditor.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.MultifileEditor.EVENT_ERROR="EVENT_ERROR",BI.MultifileEditor.EVENT_PROGRESS="EVENT_PROGRESS",BI.MultifileEditor.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.multifile_editor",BI.MultifileEditor)},function(e,t){BI.TextAreaEditor=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(),{baseCls:"bi-textarea-editor",value:""})},render:function(){var e=this.options,t=this;this.content=BI.createWidget({type:"bi.layout",tagName:"textarea",width:"100%",height:"100%",cls:"bi-textarea textarea-editor-content display-block"}),this.content.element.css({resize:"none"}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",items:[this.content]},left:4,right:4,top:4,bottom:4}]}),this.content.element.on("input propertychange",function(e){t._checkWaterMark(),t.fireEvent(BI.TextAreaEditor.EVENT_CHANGE)}),this.content.element.focus(function(){t.isValid()&&(t._focus(),t.fireEvent(BI.TextAreaEditor.EVENT_FOCUS)),BI.Widget._renderEngine.createElement(document).bind("mousedown."+t.getName(),function(e){BI.DOM.isExist(t)&&!t.element.__isMouseInBounds__(e)&&(BI.Widget._renderEngine.createElement(document).unbind("mousedown."+t.getName()),t.content.element.blur())})}),this.content.element.blur(function(){t.isValid()&&(t._blur(),t.fireEvent(BI.TextAreaEditor.EVENT_BLUR)),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+t.getName())}),BI.isKey(e.value)&&this.setValue(e.value),BI.isNotNull(e.style)&&this.setStyle(e.style),this._checkWaterMark()},_checkWaterMark:function(){var e=this,t=this.options,n=this.getValue();BI.isNotEmptyString(n)?(this.watermark&&this.watermark.destroy(),this.watermark=null):BI.isNotEmptyString(t.watermark)&&(this.watermark?(this.watermark.setText(t.watermark),this.watermark.setValid(!t.invalid),this.watermark.setEnable(!t.disabled)):(this.watermark=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark cursor-default textarea-watermark",textAlign:"left",whiteSpace:"normal",text:t.watermark,invalid:t.invalid,disabled:t.disabled,hgap:4,vgap:4}),this.watermark.on(BI.TextButton.EVENT_CHANGE,function(){e.focus()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.watermark,left:0,top:0,right:0}]})))},_focus:function(){this.content.element.addClass("textarea-editor-focus"),this._checkWaterMark()},_blur:function(){this.content.element.removeClass("textarea-editor-focus"),this._checkWaterMark()},focus:function(){this._focus(),this.content.element.focus()},blur:function(){this._blur(),this.content.element.blur()},getValue:function(){return this.content.element.val()},setValue:function(e){this.content.element.val(e),this._checkWaterMark()},setStyle:function(e){this.style=e,this.element.css(e),this.content.element.css(BI.extend({},e,{color:e.color||BI.DOM.getContrastColor(BI.DOM.isRGBColor(e.backgroundColor)?BI.DOM.rgb2hex(e.backgroundColor):e.backgroundColor)}))},getStyle:function(){return this.style},_setValid:function(e){BI.TextAreaEditor.superclass._setValid.apply(this,arguments)},_setEnable:function(e){BI.TextAreaEditor.superclass._setEnable.apply(this,[e]),this.content&&(this.content.element[0].disabled=!e)}}),BI.TextAreaEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextAreaEditor.EVENT_BLUR="EVENT_BLUR",BI.TextAreaEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.textarea_editor",BI.TextAreaEditor)},function(e,t){BI.Html=BI.inherit(BI.Single,{props:{baseCls:"bi-html",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1},render:function(){var e=this,t=this.options;0<t.hgap+t.lgap&&this.element.css({"padding-left":t.hgap+t.lgap+"px"}),0<t.hgap+t.rgap&&this.element.css({"padding-right":t.hgap+t.rgap+"px"}),0<t.vgap+t.tgap&&this.element.css({"padding-top":t.vgap+t.tgap+"px"}),0<t.vgap+t.bgap&&this.element.css({"padding-bottom":t.vgap+t.bgap+"px"}),BI.isNumber(t.height)&&this.element.css({lineHeight:t.height+"px"}),BI.isNumber(t.lineHeight)&&this.element.css({lineHeight:t.lineHeight+"px"}),BI.isWidthOrHeight(t.maxWidth)&&this.element.css({maxWidth:t.maxWidth}),this.element.css({textAlign:t.textAlign,whiteSpace:t.whiteSpace,textOverflow:"nowrap"===t.whiteSpace?"ellipsis":"",overflow:"nowrap"===t.whiteSpace?"":"auto"}),t.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){t.handler(e.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this,BI.isKey(t.text)?this.setText(t.text):BI.isKey(t.value)&&this.setText(t.value),t.highLight&&this.doHighLight()},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(e){BI.Html.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(e)},setStyle:function(e){this.text.element.css(e)},setText:function(e){BI.Html.superclass.setText.apply(this,arguments),this.options.text=e,this.text.element.html(e)}}),BI.shortcut("bi.html",BI.Html)},function(e,t){BI.Icon=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Icon.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{tagName:"i",baseCls:(e.baseCls||"")+" x-icon b-font horizon-center display-block"})},_init:function(){BI.Icon.superclass._init.apply(this,arguments),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")}}),BI.shortcut("bi.icon",BI.Icon)},function(e,t){BI.Iframe=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Iframe.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{tagName:"iframe",baseCls:(e.baseCls||"")+" bi-iframe",src:"",name:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var e=this.options;e.attributes.frameborder="0",e.attributes.src=e.src,e.attributes.name=e.name,BI.Iframe.superclass._init.apply(this,arguments)},setSrc:function(e){this.options.src=e,this.element.attr("src",e)},getSrc:function(){return this.options.src},setName:function(e){this.options.name=e,this.element.attr("name",e)},getName:function(){return this.options.name}}),BI.shortcut("bi.iframe",BI.Iframe)},function(e,t){BI.Img=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Img.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{tagName:"img",baseCls:(e.baseCls||"")+" bi-img display-block",src:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var e=this.options;e.attributes.src=e.src,BI.Img.superclass._init.apply(this,arguments)},setSrc:function(e){this.options.src=e,this.element.attr("src",e)},getSrc:function(){return this.options.src}}),BI.shortcut("bi.img",BI.Img)},function(e,t){BI.ImageCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){var e=BI.ImageCheckbox.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-image-checkbox check-box-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})}}),BI.ImageCheckbox.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_checkbox",BI.ImageCheckbox)},function(e,t){BI.Checkbox=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-checkbox",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16},render:function(){var t=this,e=this.options;return{type:"bi.center_adapt",items:[{type:"bi.default",ref:function(e){t.checkbox=e},cls:"checkbox-content",width:e.iconWidth-2,height:e.iconHeight-2}]}},_setEnable:function(e){BI.Checkbox.superclass._setEnable.apply(this,arguments),!0===e?this.checkbox.element.removeClass("base-disabled disabled"):this.checkbox.element.addClass("base-disabled disabled")},doClick:function(){BI.Checkbox.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Checkbox.EVENT_CHANGE)},setSelected:function(e){BI.Checkbox.superclass.setSelected.apply(this,arguments),e?this.checkbox.element.addClass("bi-high-light-background"):this.checkbox.element.removeClass("bi-high-light-background")}}),BI.Checkbox.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.checkbox",BI.Checkbox)},function(e,t){BI.Input=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Input.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-input display-block overflow-dot",tagName:"input",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1})},_init:function(){BI.Input.superclass._init.apply(this,arguments);var n=this,t=!1,i=null,r=!1,a=BI.debounce(function(e){n.onKeyDown(e,t),n._keydown_=!1},300),o=BI.debounce(BI.bind(this._click,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this._focusDebounce=BI.debounce(BI.bind(this._focus,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this._blurDebounce=BI.debounce(BI.bind(this._blur,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this.element.keydown(function(e){r=!1,t=e.ctrlKey||e.metaKey,i=e.keyCode,n.fireEvent(BI.Input.EVENT_QUICK_DOWN,arguments)}).keyup(function(e){i=null,r&&e.keyCode===BI.KeyCode.ENTER||(n._keydown_=!0,a(e.keyCode))}).on("input propertychange",function(e){var t=e.originalEvent;!BI.isNull(t.propertyName)&&"value"!==t.propertyName||(r=!0,n._keydown_=!0,a(i),i=null)}).click(function(e){e.stopPropagation(),o()}).mousedown(function(e){n.element.val(n.element.val())}).focus(function(e){n._focusDebounce()}).focusout(function(e){n._blurDebounce()}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this.setValue(this.options.value)},_focus:function(){this.element.addClass("bi-input-focus"),this._checkValidationOnValueChange(),this._isEditing=!0,""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this.fireEvent(BI.Input.EVENT_FOCUS)},_blur:function(){var t=this;function e(){var e;t.isValid()||!1===t.options.quitChecker.apply(t,[BI.trim(t.getValue())])||(t.element.val(t._lastValidValue?t._lastValidValue:""),t._checkValidationOnValueChange(),t._defaultState()),t.element.removeClass("bi-input-focus"),t._isEditing=!1,t._start=!1,t.isValid()&&(e=t._lastValidValue,t._lastValidValue=t.getValue(),t.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CONFIRM,t.getValue(),t),t.fireEvent(BI.Input.EVENT_CONFIRM),t._lastValidValue!==e&&t.fireEvent(BI.Input.EVENT_CHANGE_CONFIRM)),t.fireEvent(BI.Input.EVENT_BLUR)}!0===t._keydown_?BI.delay(e,300):e()},_click:function(){!0!==this._isEditing&&(this.selectAll(),this.fireEvent(BI.Input.EVENT_CLICK))},onClick:function(){this._click()},onKeyDown:function(e,t){this.isValid()&&BI.trim(this._lastChangedValue)===BI.trim(this.getValue())||this._checkValidationOnValueChange(),this.isValid()&&""!==BI.trim(this.getValue())&&((BI.trim(this.getValue())===this._lastValue||this._start&&null!=this._lastValue&&""!==this._lastValue)&&(!0!==this._pause||/(\s|\u00A0)$/.test(this.getValue()))||(this._start=!0,this._pause=!1,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STARTEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_START))),e==BI.KeyCode.ENTER&&(this.isValid()||!1!==this.options.quitChecker.apply(this,[BI.trim(this.getValue())])?(this.blur(),this.fireEvent(BI.Input.EVENT_ENTER)):this.fireEvent(BI.Input.EVENT_RESTRICT)),e==BI.KeyCode.SPACE&&this.fireEvent(BI.Input.EVENT_SPACE),e==BI.KeyCode.BACKSPACE&&""==this._lastValue&&this.fireEvent(BI.Input.EVENT_REMOVE),e!=BI.KeyCode.BACKSPACE&&e!=BI.KeyCode.DELETE||this.fireEvent(BI.Input.EVENT_BACKSPACE),this.fireEvent(BI.Input.EVENT_KEY_DOWN,arguments);var n=this._lastValue;BI.trim(this.getValue())!==BI.trim(this._lastValue||"")&&this._valueChange(),BI.isEndWithBlank(this.getValue())?(this._pause=!0,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.PAUSE,"",this),this.fireEvent(BI.Input.EVENT_PAUSE),this._defaultState()):e!==BI.KeyCode.BACKSPACE&&e!==BI.KeyCode.DELETE||""!==BI.trim(this.getValue())||null===n||""===BI.trim(n)||(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_STOP))},_defaultState:function(){""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue(),this._lastSubmitValue=null},_valueChange:function(){this.isValid()&&BI.trim(this.getValue())!==this._lastSubmitValue&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,this.getValue(),this),this.fireEvent(BI.Input.EVENT_CHANGE),this._lastSubmitValue=BI.trim(this.getValue())),""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue()},_checkValidationOnValueChange:function(){var e=this.options,t=this.getValue();this.setValid(!0===e.allowBlank&&""==BI.trim(t)||BI.isNotEmptyString(BI.trim(t))&&!1!==e.validationChecker.apply(this,[BI.trim(t)]))},focus:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能focus");!0==!this._isEditing&&(this.element.focus(),this.selectAll())},blur:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能blur");!0===this._isEditing&&(this.element.blur(),this._blurDebounce())},selectAll:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能select");this.element.select(),this._isEditing=!0},setValue:function(e){this.element.val(e),BI.nextTick(BI.bind(function(){this._checkValidationOnValueChange(),this._defaultState(),this.isValid()&&(this._lastValidValue=this._lastSubmitValue=this.getValue())},this))},getValue:function(){return this.element.val()||""},isEditing:function(){return this._isEditing},getLastValidValue:function(){return this._lastValidValue},getLastChangedValue:function(){return this._lastChangedValue},_setValid:function(){BI.Input.superclass._setValid.apply(this,arguments),this.isValid()?(this._lastChangedValue=this.getValue(),this.element.removeClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_VALID,BI.trim(this.getValue()),this)):(this._lastChangedValue===this.getValue()&&(this._lastChangedValue=null),this.element.addClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_ERROR,BI.trim(this.getValue()),this))},_setEnable:function(e){BI.Input.superclass._setEnable.apply(this,[e]),this.element[0].disabled=!e}}),BI.Input.EVENT_CHANGE="EVENT_CHANGE",BI.Input.EVENT_FOCUS="EVENT_FOCUS",BI.Input.EVENT_CLICK="EVENT_CLICK",BI.Input.EVENT_BLUR="EVENT_BLUR",BI.Input.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Input.EVENT_QUICK_DOWN="EVENT_QUICK_DOWN",BI.Input.EVENT_SPACE="EVENT_SPACE",BI.Input.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Input.EVENT_START="EVENT_START",BI.Input.EVENT_PAUSE="EVENT_PAUSE",BI.Input.EVENT_STOP="EVENT_STOP",BI.Input.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Input.EVENT_CONFIRM="EVENT_CONFIRM",BI.Input.EVENT_REMOVE="EVENT_REMOVE",BI.Input.EVENT_EMPTY="EVENT_EMPTY",BI.Input.EVENT_VALID="EVENT_VALID",BI.Input.EVENT_ERROR="EVENT_ERROR",BI.Input.EVENT_ENTER="EVENT_ENTER",BI.Input.EVENT_RESTRICT="EVENT_RESTRICT",BI.shortcut("bi.input",BI.Input)},function(e,t){BI.ImageRadio=BI.inherit(BI.IconButton,{_defaultConfig:function(){var e=BI.ImageRadio.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-radio radio-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})},_init:function(){BI.ImageRadio.superclass._init.apply(this,arguments)},doClick:function(){BI.ImageRadio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageRadio.EVENT_CHANGE)}}),BI.ImageRadio.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_radio",BI.ImageRadio)},function(e,t){BI.Radio=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-radio",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:14,iconHeight:14},render:function(){var t=this,e=this.options;return{type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"radio-content",ref:function(e){t.radio=e},width:e.iconWidth,height:e.iconHeight}]}},_setEnable:function(e){BI.Radio.superclass._setEnable.apply(this,arguments),!0===e?this.radio.element.removeClass("base-disabled disabled"):this.radio.element.addClass("base-disabled disabled")},doClick:function(){BI.Radio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Radio.EVENT_CHANGE)},setSelected:function(e){BI.Radio.superclass.setSelected.apply(this,arguments),e?this.radio.element.addClass("bi-high-light-background"):this.radio.element.removeClass("bi-high-light-background")}}),BI.Radio.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.radio",BI.Radio)},function(e,t){BI.AbstractLabel=BI.inherit(BI.Single,{_defaultConfig:function(e){var t=BI.AbstractLabel.superclass._defaultConfig.apply(this,arguments);return BI.extend(t,{textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1})},_createJson:function(){var e=this.options;return{type:"bi.text",textAlign:e.textAlign,whiteSpace:e.whiteSpace,lineHeight:e.textHeight,text:e.text,value:e.value,py:e.py,keyword:e.keyword,highLight:e.highLight}},_init:function(){BI.AbstractLabel.superclass._init.apply(this,arguments),"center"===this.options.textAlign?this._createCenterEl():this._createNotCenterEl()},_createCenterEl:function(){var e=this.options,t=this._createJson();return t.textAlign="left",BI.isNumber(e.width)&&0<e.width?BI.isNumber(e.textWidth)&&0<e.textWidth?(t.maxWidth=e.textWidth,BI.isNumber(e.height)&&0<e.height?void BI.createWidget({type:"bi.center_adapt",height:e.height,scrollable:"normal"===e.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(t)}]}):void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===e.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(t)}]})):"normal"==e.whiteSpace?(BI.extend(t,{hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}),this.text=BI.createWidget(t),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===e.whiteSpace,element:this,items:[this.text]})):BI.isNumber(e.height)&&0<e.height?(this.element.css({"line-height":e.height+"px"}),t.textAlign=e.textAlign,void(this.text=BI.createWidget(BI.extend(t,{element:this,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap})))):(BI.extend(t,{hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,maxWidth:"100%"}),this.text=BI.createWidget(t),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===e.whiteSpace,element:this,items:[this.text]})):BI.isNumber(e.textWidth)&&0<e.textWidth?(t.maxWidth=e.textWidth,void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===e.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(t)}]})):"normal"==e.whiteSpace?(BI.extend(t,{hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}),this.text=BI.createWidget(t),void BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[this.text]})):BI.isNumber(e.height)&&0<e.height?(this.element.css({"line-height":e.height+"px"}),t.textAlign=e.textAlign,void(this.text=BI.createWidget(BI.extend(t,{element:this,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap})))):(BI.extend(t,{hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}),this.text=BI.createWidget(BI.extend(t,{maxWidth:"100%"})),void BI.createWidget({type:"bi.center_adapt",element:this,items:[this.text]}))},_createNotCenterEl:function(){var e=this.options,t="right"===e.textAlign?"bi.right_vertical_adapt":"bi.vertical_adapt",n=this._createJson();return BI.isNumber(e.width)&&0<e.width?BI.isNumber(e.textWidth)&&0<e.textWidth?(n.width=e.textWidth,BI.isNumber(e.height)&&0<e.height?void BI.createWidget({type:t,height:e.height,scrollable:"normal"===e.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(n)}]}):void BI.createWidget({type:t,scrollable:"normal"===e.whiteSpace,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,element:this,items:[{el:this.text=BI.createWidget(n)}]})):BI.isNumber(e.height)&&0<e.height?(this.text=BI.createWidget(BI.extend(n,{element:this,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap})),void("normal"!==e.whiteSpace&&this.element.css({"line-height":e.height-2*e.vgap+"px"}))):(n.width=e.width-2*e.hgap-e.lgap-e.rgap,void BI.createWidget({type:t,scrollable:"normal"===e.whiteSpace,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,element:this,items:[{el:this.text=BI.createWidget(n)}]})):BI.isNumber(e.textWidth)&&0<e.textWidth?(n.width=e.textWidth,void BI.createWidget({type:t,scrollable:"normal"===e.whiteSpace,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,element:this,items:[{el:this.text=BI.createWidget(n)}]})):BI.isNumber(e.height)&&0<e.height?("normal"!==e.whiteSpace&&this.element.css({"line-height":e.height-2*e.vgap+"px"}),void(this.text=BI.createWidget(BI.extend(n,{element:this,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap})))):(BI.extend(n,{hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap}),this.text=BI.createWidget(BI.extend(n,{maxWidth:"100%"})),void BI.createWidget({type:t,element:this,scrollable:"normal"===e.whiteSpace,items:[this.text]}))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(e){this.options.text=e,this.text.setText(e)},getText:function(){return this.options.text},setStyle:function(e){this.text.setStyle(e)},setValue:function(e){BI.AbstractLabel.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(e)},populate:function(){BI.AbstractLabel.superclass.populate.apply(this,arguments)}})},function(e,t){BI.HtmlLabel=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-html-label"},_createJson:function(){var e=this.options;return{type:"bi.html",textAlign:e.textAlign,whiteSpace:e.whiteSpace,lineHeight:e.textHeight,text:e.text,value:e.value}}}),BI.shortcut("bi.html_label",BI.HtmlLabel)},function(e,t){BI.IconLabel=BI.inherit(BI.Single,{props:{baseCls:"bi-icon-label horizon-center",iconWidth:null,iconHeight:null},_init:function(){BI.IconLabel.superclass._init.apply(this,arguments);var e=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:e.iconWidth,height:e.iconHeight}),BI.isNumber(e.height)&&0<e.height&&BI.isNull(e.iconWidth)&&BI.isNull(e.iconHeight)?(this.element.css("lineHeight",e.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))}}),BI.shortcut("bi.icon_label",BI.IconLabel)},function(e,t){BI.Label=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-label",py:"",keyword:""},_createJson:function(){var e=this.options;return{type:"bi.text",textAlign:e.textAlign,whiteSpace:e.whiteSpace,lineHeight:e.textHeight,text:e.text,value:e.value,py:e.py,keyword:e.keyword,highLight:e.highLight}},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.shortcut("bi.label",BI.Label)},function(e,t){BI.Link=BI.inherit(BI.Label,{_defaultConfig:function(){var e=BI.Link.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-link display-block",tagName:"a",href:"",target:"_blank"})},_createJson:function(){var e=this.options;return{type:"bi.a",textAlign:e.textAlign,whiteSpace:e.whiteSpace,lineHeight:e.textHeight,text:e.text,keyword:e.keyword,value:e.value,py:e.py,href:e.href,target:e.target}},_init:function(){BI.Link.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.link",BI.Link)},function(e,t){BI.Bubble=BI.inherit(BI.Tip,{_defaultConfig:function(){return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble",direction:"top",text:"",level:"error",height:18})},_init:function(){BI.Bubble.superclass._init.apply(this,arguments);var e=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:e,mousedown:e,mouseup:e,mouseover:e,mouseenter:e,mouseleave:e,mousemove:e}),BI.createWidget({type:"bi.left",element:this,items:[this["_"+this.options.direction]()]})},_createBubbleText:function(){var e=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"bubble-text bubble-"+e.level,text:e.text,hgap:5,height:18})},_top:function(){return BI.createWidget({type:"bi.vertical",items:[{el:this._createBubbleText(),height:18},{el:{type:"bi.layout"},height:3}]})},_bottom:function(){return BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout"},height:3},{el:this._createBubbleText(),height:18}]})},_left:function(){return BI.createWidget({type:"bi.right",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},_right:function(){return BI.createWidget({type:"bi.left",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},setText:function(e){this.text.setText(e)}}),BI.shortcut("bi.bubble",BI.Bubble)},function(e,t){BI.Toast=BI.inherit(BI.Tip,{_const:{minWidth:200,hgap:10},_defaultConfig:function(){return BI.extend(BI.Toast.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-toast",text:"",level:"success"})},_init:function(){BI.Toast.superclass._init.apply(this,arguments);var e=this,t=this.options;this.element.css({minWidth:this._const.minWidth+"px"}),this.element.addClass("toast-"+t.level);var n=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:n,mousedown:n,mouseup:n,mouseover:n,mouseenter:n,mouseleave:n,mousemove:n});var i="close-font";switch(t.level){case"success":i="toast-success-font";break;case"error":i="toast-error-font";break;case"warning":i="toast-warning-font";break;case"normal":default:i="toast-message-font"}var r=[{type:"bi.icon_label",cls:i+" toast-icon",width:36},{el:{type:"bi.label",whiteSpace:"normal",text:t.text,textHeight:16,textAlign:"left"},rgap:t.autoClose?this._const.hgap:0}],a=[36,""];!1===t.autoClose&&(r.push({type:"bi.icon_button",cls:"close-font toast-icon",handler:function(){e.destroy()},width:36}),a.push(36)),this.text=BI.createWidget({type:"bi.horizontal_adapt",element:this,items:r,vgap:7,columnSize:a})},setText:function(e){this.text.setText(e)},beforeDestroy:function(){this.fireEvent(BI.Toast.EVENT_DESTORY)}}),BI.Toast.EVENT_DESTORY="EVENT_DESTORY",BI.shortcut("bi.toast",BI.Toast)},function(e,t){BI.Tooltip=BI.inherit(BI.Tip,{_const:{hgap:5,vgap:3},_defaultConfig:function(){return BI.extend(BI.Tooltip.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tooltip",text:"",level:"success",stopEvent:!1,stopPropagation:!1})},_init:function(){BI.Tooltip.superclass._init.apply(this,arguments);var t=this.options;this.element.addClass("tooltip-"+t.level);var e=function(e){t.stopPropagation&&e.stopPropagation(),t.stopEvent&&e.stopEvent()};this.element.bind({click:e,mousedown:e,mouseup:e,mouseover:e,mouseenter:e,mouseleave:e,mousemove:e});var n=(t.text+"").split("\n");1<n.length?BI.createWidget({type:"bi.vertical",element:this,hgap:this._const.hgap,items:BI.map(n,function(e,t){return{type:"bi.label",textAlign:"left",whiteSpace:"normal",text:t,textHeight:18}})}):this.text=BI.createWidget({type:"bi.label",element:this,textAlign:"left",whiteSpace:"normal",text:t.text,textHeight:18,hgap:this._const.hgap})},setWidth:function(e){this.element.width(e-2*this._const.hgap)},setText:function(e){this.text&&this.text.setText(e)},setLevel:function(e){this.element.removeClass("tooltip-success").removeClass("tooltip-warning"),this.element.addClass("tooltip-"+e)}}),BI.shortcut("bi.tooltip",BI.Tooltip)},function(e,t){BI.Trigger=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.Trigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-trigger cursor-pointer",height:24})},_init:function(){BI.Trigger.superclass._init.apply(this,arguments)},setKey:function(){},getKey:function(){}})},function(e,t){BI.CustomTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-tree",expander:{el:{},popup:{type:"bi.custom_tree"}},items:[],itemsCreator:BI.emptyFn,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.CustomTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(e){var r=this,a=this.options;e=BI.Tree.transformToTreeFormat(e);var o=[];return BI.each(e,function(e,n){var t,i;BI.isNotEmptyArray(n.children)||!0===n.isParent?(t=BI.extend({type:"bi.expander",el:{value:n.value},popup:{type:"bi.custom_tree"}},BI.deepClone(a.expander),{id:n.id,pId:n.pId}),i=BI.stripEL(n),BI.isWidget(i)?t.el=i:(delete(i=BI.clone(i)).children,BI.extend(t.el,i)),t.popup.expander=BI.deepClone(a.expander),t.items=t.popup.items=n.children,t.itemsCreator=t.popup.itemsCreator=function(e){if(BI.isNotNull(e.node))return a.itemsCreator.apply(r,arguments);var t=Array.prototype.slice.call(arguments,0);return t[0].node=n,a.itemsCreator.apply(r,t)},BI.isNull(t.popup.el)&&(t.popup.el=BI.deepClone(a.el)),o.push(t)):o.push(n)}),o},initTree:function(e){var i=this,t=this.options;this.tree=BI.createWidget(t.el,{element:this,items:this._formatItems(e),itemsCreator:function(e,n){t.itemsCreator.apply(this,[e,function(e){var t=Array.prototype.slice.call(arguments,0);t[0]=i._formatItems(e),n.apply(null,t)}])},value:t.value}),this.tree.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.CustomTree.EVENT_CHANGE,t,n)})},stroke:function(e){this.populate.apply(this,arguments)},populate:function(e){var t=Array.prototype.slice.call(arguments,0);0<arguments.length&&(t[0]=this._formatItems(e)),this.tree.populate.apply(this.tree,t)},setValue:function(e){this.tree&&this.tree.setValue(e)},getValue:function(){return this.tree?this.tree.getValue():[]},getAllButtons:function(){return this.tree?this.tree.getAllButtons():[]},getAllLeaves:function(){return this.tree?this.tree.getAllLeaves():[]},getNodeById:function(e){return this.tree&&this.tree.getNodeById(e)},getNodeByValue:function(e){return this.tree&&this.tree.getNodeByValue(e)},empty:function(){this.tree.empty()}}),BI.CustomTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_tree",BI.CustomTree)},function(e,t){BI.IconChangeButton=BI.inherit(BI.Single,{_defaultConfig:function(){var e=BI.IconChangeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-icon-change-button",iconCls:"",iconWidth:null,iconHeight:null,stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.IconChangeButton.superclass._init.apply(this,arguments);var e=this,t=this.options;this.button=BI.createWidget({type:"bi.icon_button",element:this,cls:t.iconCls,height:t.height,iconWidth:t.iconWidth,iconHeight:t.iconHeight,stopEvent:t.stopEvent,stopPropagation:t.stopPropagation,selected:t.selected,once:t.once,forceSelected:t.forceSelected,forceNotSelected:t.forceNotSelected,disableSelected:t.disableSelected,shadow:t.shadow,isShadowShowingOnSelected:t.isShadowShowingOnSelected,trigger:t.trigger,handler:t.handler}),this.button.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button.on(BI.IconButton.EVENT_CHANGE,function(){e.fireEvent(BI.IconChangeButton.EVENT_CHANGE,arguments)})},isSelected:function(){return this.button.isSelected()},setSelected:function(e){this.button.setSelected(e)},setIcon:function(e){var t=this.options;t.iconCls!==e&&(this.element.removeClass(t.iconCls).addClass(e),t.iconCls=e)}}),BI.IconChangeButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_change_button",BI.IconChangeButton)},function(e,t){BI.TriggerIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var e=BI.TriggerIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-trigger-icon-button",extraCls:"pull-down-font"})}}),BI.TriggerIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.trigger_icon_button",BI.TriggerIconButton)},function(e,t){BI.HalfIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var e=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-half-icon-button check-half-select-icon",height:16,width:16,iconWidth:16,iconHeight:16,selected:!1})}}),BI.HalfIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.half_icon_button",BI.HalfIconButton)},function(e,t){BI.HalfButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-half-button bi-high-light-border",height:14,width:14,selected:!1})},_init:function(){BI.HalfButton.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"bi-high-light-background",width:8,height:8}]})},doClick:function(){BI.HalfButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.HalfButton.EVENT_CHANGE)}}),BI.HalfButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.half_button",BI.HalfButton)},function(e,t){BI.MultiSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-item",height:24,logic:{dynamic:!1},iconWrapperWidth:26})},_init:function(){BI.MultiSelectItem.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,rgap:e.rgap,text:e.text,keyword:e.keyword,value:e.value,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&t.setSelected(t.isSelected())}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.checkbox],width:e.iconWrapperWidth},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MultiSelectItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(e){BI.MultiSelectItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(e)}}),BI.MultiSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_item",BI.MultiSelectItem)},function(e,t){BI.SingleSelectIconTextItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-icon-text-item bi-list-item-active",iconCls:"",height:24})},_init:function(){BI.SingleSelectIconTextItem.superclass._init.apply(this,arguments);var e=this,t=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,cls:t.iconCls,once:t.once,iconWrapperWidth:t.iconWrapperWidth,selected:t.selected,height:t.height,iconHeight:t.iconHeight,iconWidth:t.iconWidth,text:t.text,keyword:t.keyword,value:t.value,py:t.py}),this.text.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},isSelected:function(){return this.text.isSelected()},setSelected:function(e){this.text.setSelected(e)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectIconTextItem.superclass.doClick.apply(this,arguments)}}),BI.shortcut("bi.single_select_icon_text_item",BI.SingleSelectIconTextItem)},function(e,t){BI.SingleSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-item bi-list-item-active",hgap:10,height:24,textAlign:"left"})},_init:function(){BI.SingleSelectItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:e.textAlign,whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,keyword:e.keyword,value:e.value,title:e.title||e.text,warningTitle:e.warningTitle,py:e.py})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(e){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)}}),BI.SingleSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_item",BI.SingleSelectItem)},function(e,t){BI.SingleSelectRadioItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},hgap:10,height:24})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var e=this.options;this.radio=BI.createWidget({type:"bi.radio",once:e.once}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,keyword:e.keyword,value:e.value,py:e.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectRadioItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(e){BI.SingleSelectRadioItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(e)}}),BI.SingleSelectRadioItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_radio_item",BI.SingleSelectRadioItem)},function(e,t){BI.ArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.ArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-arrow-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconWrapperWidth:16})},_init:function(){var t=this,e=this.options;BI.ArrowNode.superclass._init.apply(this,arguments),this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:e.iconWrapperWidth,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.ArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setText:function(e){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(e)},setOpened:function(e){BI.ArrowNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(e)}}),BI.shortcut("bi.arrow_group_node",BI.ArrowNode)},function(e,t){BI.FirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-first-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.FirstPlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.FirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(e){BI.FirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode)},function(e,t){BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconHeight:12,iconWidth:12,iconCls:"",iconWrapperWidth:16})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox",width:24,stopPropagation:!0});var n=BI.createWidget({type:"bi.icon_label",width:24,cls:e.iconCls,iconWidth:e.iconWidth,iconHeight:e.iconHeight});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var i=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),r=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:e.iconWrapperWidth,el:this.checkbox},{width:16,el:n},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(i,BI.extend(e.logic,{items:r,rgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.IconArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(e){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode)},function(e,t){BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.LastPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(e){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode)},function(e,t){BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MidPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(e){BI.MidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.mid_plus_group_node",BI.MidPlusGroupNode)},function(e,t){BI.MultiLayerIconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-icon-arrow-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24,iconHeight:16,iconWidth:16,iconCls:""})},_init:function(){BI.MultiLayerIconArrowNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.node=BI.createWidget({type:"bi.icon_arrow_node",iconCls:e.iconCls,cls:"bi-list-item-none",id:e.id,pId:e.pId,open:e.open,height:e.height,iconHeight:e.iconHeight,iconWidth:e.iconWidth,hgap:e.hgap,text:e.text,value:e.value,py:e.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(e){t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var n=[];BI.count(0,e.layer,function(){n.push({type:"bi.layout",width:15,height:e.height})}),n.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(e.layer,15),items:n})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(e){BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(e)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(e)}}),BI.shortcut("bi.multilayer_icon_arrow_node",BI.MultiLayerIconArrowNode)},function(e,t){BI.PlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.PlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.PlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.PlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(e){BI.PlusGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.plus_group_node",BI.PlusGroupNode)},function(e,t){BI.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var e=this;return{type:"bi.absolute",ref:function(){e.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(e){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=e?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch)},function(e,t){BI.FirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.FirstTreeLeafItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword});var t=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),n=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===e.layer?"":{width:12,el:{type:"bi.layout",cls:e.pNode&&e.pNode.isLastNode?"":"base-line-conn-background",width:12,height:e.height}},{width:24,el:{type:"bi.layout",cls:"first-line-conn-background",width:24,height:e.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(t,BI.extend(e.logic,{items:n}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.first_tree_leaf_item",BI.FirstTreeLeafItem)},function(e,t){BI.IconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},height:24,iconWidth:16,iconHeight:16,iconCls:""})},_init:function(){BI.IconTreeLeafItem.superclass._init.apply(this,arguments);var e=this.options,t=BI.createWidget({type:"bi.center_adapt",width:24,cls:e.iconCls,items:[{type:"bi.icon",width:e.iconWidth,height:e.iconHeight}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:t},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i,hgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.icon_tree_leaf_item",BI.IconTreeLeafItem)},function(e,t){BI.LastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.LastTreeLeafItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword});var t=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),n=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===e.layer?"":{width:12,el:{type:"bi.layout",cls:e.pNode&&e.pNode.isLastNode?"":"base-line-conn-background",width:12,height:e.height}},{width:24,el:{type:"bi.layout",cls:"last-line-conn-background",width:24,height:e.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(t,BI.extend(e.logic,{items:n}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.last_tree_leaf_item",BI.LastTreeLeafItem)},function(e,t){BI.MidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.MidTreeLeafItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword});var t=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),n=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===e.layer?"":{width:12,el:{type:"bi.layout",cls:e.pNode&&e.pNode.isLastNode?"":"base-line-conn-background",width:12,height:e.height}},{width:24,el:{type:"bi.layout",cls:"mid-line-conn-background",width:24,height:e.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(t,BI.extend(e.logic,{items:n}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.mid_tree_leaf_item",BI.MidTreeLeafItem)},function(e,t){BI.MultiLayerIconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-icon-tree-leaf-item bi-list-item-active",layer:0,height:24,iconCls:"",iconHeight:16,iconWidth:16})},_init:function(){BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this,arguments);var t=this,e=this.options;this.item=BI.createWidget({type:"bi.icon_tree_leaf_item",cls:"bi-list-item-none",iconCls:e.iconCls,id:e.id,pId:e.pId,isFront:!0,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,iconWidth:e.iconWidth,iconHeight:e.iconHeight}),this.item.on(BI.Controller.EVENT_CHANGE,function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var n=[];BI.count(0,e.layer,function(){n.push({type:"bi.layout",width:15,height:e.height})}),n.push(this.item),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(e.layer,15),items:n})},doRedMark:function(){this.item.doRedMark.apply(this.item,arguments)},unRedMark:function(){this.item.unRedMark.apply(this.item,arguments)},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(e){BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(e)},getValue:function(){return this.options.value}}),BI.shortcut("bi.multilayer_icon_tree_leaf_item",BI.MultiLayerIconTreeLeafItem)},function(e,t){BI.TreeTextLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tree-text-leaf-item bi-list-item-active",id:"",pId:"",height:24,hgap:0,lgap:0,rgap:0})},_init:function(){BI.TreeTextLeafItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,lgap:e.lgap,rgap:e.hgap,text:e.text,value:e.value,py:e.py}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text}]})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.tree_text_leaf_item",BI.TreeTextLeafItem)},function(e,t){BI.CalendarDateItem=BI.inherit(BI.BasicButton,{render:function(){var e=this,t=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",text:t.text,value:t.value,ref:function(){e.text=this}},left:t.lgap,right:t.rgap,top:0,bottom:0}]}},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},setSelected:function(e){BI.CalendarDateItem.superclass.setSelected.apply(this,arguments),this.text.setSelected(e)},getValue:function(){return this.text.getValue()}}),BI.shortcut("bi.calendar_date_item",BI.CalendarDateItem)},function(e,t){BI.Calendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.Calendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-calendar",logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:2015,month:8,day:25})},_dateCreator:function(e,t,n){var i=this.options,a={},r=BI.getDate(),o=i.min.match(/\d+/g),s=i.max.match(/\d+/g);e<(0|o[0])&&(e=0|o[0]),e>(0|s[0])&&(e=0|s[0]),r.setFullYear(e,t,n),a.ymd=[r.getFullYear(),r.getMonth(),r.getDate()];var l=BI.Date._MD.slice(0);l[1]=BI.isLeapYear(a.ymd[0])?29:28,r.setFullYear(a.ymd[0],a.ymd[1],1),a.FDay=r.getDay();var u=(7-BI.StartOfWeek+a.FDay)%7;a.PDay=l[0===t?11:t-1]-u+1,a.NDay=1;var c=[];return BI.each(BI.range(42),function(e){var t,n={},i=a.ymd[0],r=a.ymd[1]+1;e<u?(n.lastMonth=!0,t=e+a.PDay,1===r&&--i,r=1===r?12:r-1):u<=e&&e<u+l[a.ymd[1]]?(t=e-u+1)===a.ymd[2]&&(n.currentDay=!0):(n.nextMonth=!0,t=a.NDay++,12===r&&(i+=1),r=12===r?1:r+1),BI.checkDateVoid(i,r,t,o,s)[0]&&(n.disabled=!0),n.text=t,c.push(n)}),c},_init:function(){BI.Calendar.superclass._init.apply(this,arguments);var e=this,t=this.options,n=BI.map(this._getWeekLabel(),function(e,t){return{type:"bi.label",height:24,text:t}}),i=BI.createWidget({type:"bi.button_group",height:44,items:n,layouts:[{type:"bi.center",hgap:5,vgap:10}]});this.days=BI.createWidget({type:"bi.button_group",items:BI.createItems(this._getItems(),{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},t.logic,{columns:7,rows:6,columnSize:[1/7,1/7,1/7,1/7,1/7,1/7,1/7],rowSize:24,vgap:10}))]}),this.days.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},t.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",i,this.days)}))))},_getWeekLabel:function(){return BI.map(BI.range(0,7),function(e,t){return BI.Date._SDN[(t+BI.StartOfWeek)%7]})},isFrontDate:function(){var e=this.options,t=(this._const,e.year),n=e.month,i=BI.getDate(),r=i.getDay();t|=0,i.setFullYear(t,n,1);var a=BI.getOffsetDate(i,-1*(r+1));return!!BI.checkDateVoid(a.getFullYear(),a.getMonth(),a.getDate(),e.min,e.max)[0]},isFinalDate:function(){var e=this.options,t=(this._const,e.year),n=e.month,i=BI.getDate(),r=i.getDay();t|=0,i.setFullYear(t,n,1);var a=BI.getOffsetDate(i,42-r);return!!BI.checkDateVoid(a.getFullYear(),a.getMonth(),a.getDate(),e.min,e.max)[0]},_getItems:function(){var i=this.options,e=this._dateCreator(i.year,i.month-1,i.day),t=[];return t.push(e.slice(0,7)),t.push(e.slice(7,14)),t.push(e.slice(14,21)),t.push(e.slice(21,28)),t.push(e.slice(28,35)),t.push(e.slice(35,42)),BI.map(t,function(e,t){return BI.map(t,function(e,t){var n=t.lastMonth?i.month-1:t.nextMonth?i.month+1:i.month;return BI.extend(t,{type:"bi.calendar_date_item",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:24,value:i.year+"-"+n+"-"+t.text,disabled:t.lastMonth||t.nextMonth||t.disabled,lgap:5,rgap:5})})})},_populate:function(){this.days.populate(this._getItems())},setMinDate:function(e){var t=this.options;BI.isNotEmptyString(t.min)&&(t.min=e,this._populate())},setMaxDate:function(e){var t=this.options;BI.isNotEmptyString(t.max)&&(t.max=e,this._populate())},setValue:function(e){this.days.setValue([e.year+"-"+e.month+"-"+e.day])},getValue:function(){var e=this.days.getValue()[0].match(/\d+/g);return{year:0|e[0],month:0|e[1],day:0|e[2]}}}),BI.extend(BI.Calendar,{getPageByDateJSON:function(e){var t=BI.getDate().getFullYear(),n=BI.getDate().getMonth(),i=12*(e.year-t);return i+=e.month-1-n},getDateJSONByPage:function(e){var t=e;t+=BI.getDate().getMonth();var n=BI.parseInt(t/12);t<0&&t%12!=0&&n--;var i=0<=t?t%12:(12+t%12)%12;return{year:BI.getDate().getFullYear()+n,month:1+i}}}),BI.shortcut("bi.calendar",BI.Calendar)},function(e,t){BI.YearCalendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.YearCalendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-year-calendar",behaviors:{},logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:null})},_yearCreator:function(e){var t=this.options;e|=0;var n=BI.YearCalendar.getStartYear(e),i=[],r=BI.parseDateTime(t.min,"%Y-%X-%d"),a=BI.parseDateTime(t.max,"%Y-%X-%d");return BI.each(BI.range(BI.YearCalendar.INTERVAL),function(e){var t={};BI.checkDateVoid(n+e,1,1,BI.print(BI.getDate(r.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(a.getFullYear(),0,1),"%Y-%X-%d"))[0]&&(t.disabled=!0),t.text=n+e,i.push(t)}),i},_init:function(){BI.YearCalendar.superclass._init.apply(this,arguments);var e=this,t=this.options;this.currentYear=BI.getDate().getFullYear(),this.years=BI.createWidget({type:"bi.button_group",behaviors:t.behaviors,items:BI.createItems(this._getItems(),{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},t.logic,{columns:2,rows:6,columnSize:[.5,.5],rowSize:24})),{type:"bi.center_adapt",vgap:1}]}),this.years.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},t.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this.years)}))))},isFrontYear:function(){var e=this.options,t=e.year;return t|=0,!!BI.checkDateVoid(BI.YearCalendar.getStartYear(t)-1,1,1,e.min,e.max)[0]},isFinalYear:function(){var e=this.options,t=(this._const,e.year);return t|=0,!!BI.checkDateVoid(BI.YearCalendar.getEndYear(t)+1,1,1,e.min,e.max)[0]},_getItems:function(){var e=this.options,n=this._yearCreator(e.year||this.currentYear),t=n.length,i=BI.makeArray(t,""),r=[0,6,1,7,2,8,3,9,4,10,5,11];BI.each(n,function(e,t){i[e]=n[r[e]]});var a=[];return a.push(i.slice(0,2)),a.push(i.slice(2,4)),a.push(i.slice(4,6)),a.push(i.slice(6,8)),a.push(i.slice(8,10)),a.push(i.slice(10,12)),BI.map(a,function(e,t){return BI.map(t,function(e,t){return BI.extend(t,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:24,width:45,value:t.text,disabled:t.disabled})})})},_populate:function(){this.years.populate(this._getItems())},setMinDate:function(e){var t=this.options;BI.isNotEmptyString(t.min)&&(t.min=e,this._populate())},setMaxDate:function(e){var t=this.options;BI.isNotEmptyString(this.options.max)&&(t.max=e,this._populate())},setValue:function(e){this.years.setValue([e])},getValue:function(){return this.years.getValue()[0]}}),BI.extend(BI.YearCalendar,{INTERVAL:12,getStartYear:function(e){return e-((e-BI.getDate().getFullYear()+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(e){return BI.YearCalendar.getStartYear(e)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(e){var t=BI.getDate().getFullYear();return((e=BI.YearCalendar.getStartYear(e))-t+3)/BI.YearCalendar.INTERVAL}}),BI.shortcut("bi.year_calendar",BI.YearCalendar)},function(e,t){BI.ArrowTreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-arrow-group-node-checkbox"})},setSelected:function(e){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),e?this.element.removeClass("expander-right-font").addClass("expander-down-font"):this.element.removeClass("expander-down-font").addClass("expander-right-font")}}),BI.shortcut("bi.arrow_group_node_checkbox",BI.ArrowTreeGroupNodeCheckbox)},function(e,t){BI.CheckingMarkNode=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.CheckingMarkNode.superclass._defaultConfig.apply(this,arguments),{extraCls:"check-mark-font"})},_init:function(){BI.CheckingMarkNode.superclass._init.apply(this,arguments),this.setSelected(this.options.selected)},setSelected:function(e){BI.CheckingMarkNode.superclass.setSelected.apply(this,arguments),!0===e?this.element.addClass("check-mark-font"):this.element.removeClass("check-mark-font")}}),BI.shortcut("bi.checking_mark_node",BI.CheckingMarkNode)},function(e,t){BI.FirstTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type2",iconWidth:24,iconHeight:24})},setSelected:function(e){BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),!0===e?this.element.addClass("tree-expand-icon-type2"):this.element.removeClass("tree-expand-icon-type2")}}),BI.shortcut("bi.first_tree_node_checkbox",BI.FirstTreeNodeCheckbox)},function(e,t){BI.LastTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type4",iconWidth:24,iconHeight:24})},setSelected:function(e){BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),!0===e?this.element.addClass("tree-expand-icon-type4"):this.element.removeClass("tree-expand-icon-type4")}}),BI.shortcut("bi.last_tree_node_checkbox",BI.LastTreeNodeCheckbox)},function(e,t){BI.MidTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type3",iconWidth:24,iconHeight:24})},setSelected:function(e){BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),!0===e?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.mid_tree_node_checkbox",BI.MidTreeNodeCheckbox)},function(e,t){BI.TreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type1",iconWidth:24,iconHeight:24})},setSelected:function(e){BI.TreeNodeCheckbox.superclass.setSelected.apply(this,arguments),e?this.element.addClass("tree-expand-icon-type1"):this.element.removeClass("tree-expand-icon-type1")}}),BI.shortcut("bi.tree_node_checkbox",BI.TreeNodeCheckbox)},function(e,t){BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom,left",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:t.trigger,toggle:t.toggle,container:t.container,direction:t.direction,isDefaultInit:t.isDefaultInit,destroyWhenHide:t.destroyWhenHide,isNeedAdjustHeight:t.isNeedAdjustHeight,isNeedAdjustWidth:t.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:t.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:t.hideChecker,offsetStyle:t.offsetStyle,el:t.el,popup:BI.extend({type:"bi.bubble_popup_view"},t.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){e.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){e.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){e.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){e.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){e.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){e.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){e._showTriangle(),e.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){e._hideTriangle(),e.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){e.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(e){var t={},n={},i=this.options.adjustLength,r=this.element.offset(),a=r.left,o=r.left+this.element.outerWidth(),s=r.top,l=r.top+this.element.outerHeight();switch(e){case"left":t={top:s,height:this.element.outerHeight(),left:a-i-this._const.TRIANGLE_LENGTH},n={width:this._const.TRIANGLE_LENGTH};break;case"right":t={top:s,height:this.element.outerHeight(),left:o+i},n={width:this._const.TRIANGLE_LENGTH};break;case"top":t={left:a,width:this.element.outerWidth(),top:s-i-this._const.TRIANGLE_LENGTH},n={height:this._const.TRIANGLE_LENGTH};break;case"bottom":t={left:a,width:this.element.outerWidth(),top:l+i},n={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(n,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+e}]}),t.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[t]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){switch(this.combo.getPopupPosition().dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo)},function(e,t){BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var e=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:e.baseCls+" bi-bubble-popup-view",minWidth:220,maxWidth:300,minHeight:90})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:!1,text:BI.i18nText("BI-Basic_Cancel"),ghost:!0},{text:BI.i18nText(BI.i18nText("BI-Basic_Sure")),value:!0}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var e=this.options,n=this,i=[];return BI.each(e.buttons,function(e,t){BI.isWidget(t)?i.push(t):i.push(BI.extend({type:"bi.button",height:24,handler:function(e){n.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,e)}},t))}),BI.createWidget({type:"bi.center",height:44,rgap:15,items:[{type:"bi.right_vertical_adapt",lgap:10,items:i}]})},_createView:function(){var e=this.options,t=BI.createWidget({type:"bi.button_group",items:[e.el],layouts:[{type:"bi.vertical",cls:"bar-popup-container",hgap:15,tgap:10}]});return t.element.css("min-height",e.minHeight-44),t}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-text-bubble-bar-popup-view",text:"",buttons:[{level:"ignore",value:!1,stopPropagation:!0,text:BI.i18nText("BI-Basic_Cancel")},{value:!0,stopPropagation:!0,text:BI.i18nText("BI-Basic_Sure")}]}},render:function(){var n=this,e=this.options,t=BI.map(e.buttons,function(e,t){return BI.isWidget(t)?t:BI.extend({type:"bi.button",height:24,handler:function(e){n.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE,e)}},t)});return{type:"bi.bubble_bar_popup_view",minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,ref:function(){n.popup=this},el:{type:"bi.label",text:e.text,whiteSpace:"normal",textAlign:"left",ref:function(){n.text=this}},buttons:t}},populate:function(e){this.text.setText(e||this.options.text)}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView)},function(e,t){BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:t.items,height:t.height,validationChecker:t.validationChecker,quitChecker:t.quitChecker,allowBlank:t.allowBlank,watermark:t.watermark,errorText:t.errorText,value:t.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){e.popup.setValue(this.getValue()),e.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE,arguments)}),this.trigger.on(BI.EditorTrigger.EVENT_FOCUS,function(){e.fireEvent(BI.EditorIconCheckCombo.EVENT_FOCUS,arguments)}),this.trigger.on(BI.EditorTrigger.EVENT_EMPTY,function(){e.fireEvent(BI.EditorIconCheckCombo.EVENT_EMPTY,arguments)}),this.trigger.on(BI.EditorTrigger.EVENT_VALID,function(){e.fireEvent(BI.EditorIconCheckCombo.EVENT_VALID,arguments)}),this.trigger.on(BI.EditorTrigger.EVENT_ERROR,function(){e.fireEvent(BI.EditorIconCheckCombo.EVENT_ERROR,arguments)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:t.chooseType,items:t.items,value:t.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.editorIconCheckCombo.hideView(),e.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",container:t.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(e){this.editorIconCheckCombo.setValue(e)},getValue:function(){return this.trigger.getValue()},populate:function(e){this.options.items=e,this.editorIconCheckCombo.populate(e)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.EditorIconCheckCombo.EVENT_FOCUS="EVENT_FOCUS",BI.EditorIconCheckCombo.EVENT_EMPTY="EVENT_EMPTY",BI.EditorIconCheckCombo.EVENT_VALID="EVENT_VALID",BI.EditorIconCheckCombo.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo)},function(e,t){BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:24,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget(t.el,{type:"bi.icon_combo_trigger",iconCls:t.iconCls,title:t.title,items:t.items,width:t.width,height:t.height,iconWidth:t.iconWidth,iconHeight:t.iconHeight,value:t.value}),this.popup=BI.createWidget(t.popup,{type:"bi.icon_combo_popup",chooseType:t.chooseType,items:t.items,value:t.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.iconCombo.hideView(),e.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:t.direction,trigger:t.trigger,container:t.container,adjustLength:t.adjustLength,adjustXOffset:t.adjustXOffset,adjustYOffset:t.adjustYOffset,offsetStyle:t.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:t.maxWidth,maxHeight:t.maxHeight,minWidth:t.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e)},getValue:function(){var e=this.popup.getValue();return BI.isNull(e)?[]:BI.isArray(e)?e:[e]},populate:function(e){this.options.items=e,this.iconCombo.populate(e)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo)},function(e,t){BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var e=this.options,i=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(e.items,{type:"bi.single_select_icon_text_item",height:24}),chooseType:e.chooseType,layouts:[{type:"bi.vertical"}],value:e.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.IconComboPopup.EVENT_CHANGE,t,n)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(e){BI.IconComboPopup.superclass.populate.apply(this,arguments),e=BI.createItems(e,{type:"bi.single_select_icon_text_item",height:24}),this.popup.populate(e)},getValue:function(){return this.popup.getValue()},setValue:function(e){this.popup.setValue(e)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup)},function(e,t){BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:24,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var e=this.options,t="";BI.isKey(e.value)&&(t=this._digest(e.value,e.items)),this.button=BI.createWidget(e.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:t,disableSelected:!0,width:e.isShowDown?e.width-12:e.width,height:e.height,iconWidth:e.iconWidth,iconHeight:e.iconHeight,selected:BI.isNotEmptyString(t)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font font-size-12",width:12,height:8,selected:BI.isNotEmptyString(t)}),this.down.setVisible(e.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:3,bottom:0}]})},_digest:function(n,e){var i="";return n=BI.isArray(n)?n[0]:n,BI.any(e,function(e,t){if(n===t.value)return i=t.iconCls,!0}),i},populate:function(e){var t=this.options;this.options.items=e||[],this.button.setIcon(t.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(e){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var t=this.options,n=this._digest(e,this.options.items);e=BI.isArray(e)?e[0]:e,BI.isNotEmptyString(n)?(this.button.setIcon(n),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(t.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger)},function(e,t){BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-value-combo",height:24,iconHeight:null,iconWidth:null,value:"",attributes:{tabIndex:0}})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",cls:"icon-text-value-trigger",items:t.items,height:t.height,text:t.text,iconCls:t.iconCls,value:t.value,iconHeight:t.iconHeight,iconWidth:t.iconWidth,iconWrapperWidth:t.iconWrapperWidth,title:t.title,warningTitle:t.warningTitle}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:t.items,value:t.value,iconHeight:t.iconHeight,iconWidth:t.iconWidth,iconWrapperWidth:t.iconWrapperWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.textIconCombo.hideView(),e.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,container:t.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(t.value)&&this.setValue(t.value)},_checkError:function(n){var e;BI.isNull(n)||BI.isEmptyArray(n)||BI.isEmptyString(n)?(this.trigger.options.tipType="success",this.element.removeClass("combo-error")):(n=BI.isArray(n)?n:[n],e=BI.find(this.options.items,function(e,t){return BI.contains(n,t.value)}),BI.isNull(e)?(this.trigger.options.tipType="warning",this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.options.tipType="success",this.element.removeClass("combo-error")))},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e),this._checkError(e)},getValue:function(){var e=this.popup.getValue();return BI.isNull(e)?[]:BI.isArray(e)?e:[e]},populate:function(e){this.options.items=e,this.textIconCombo.populate(e)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo)},function(e,t){BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup",behaviors:{redmark:function(){return!0}}})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var e=this.options,i=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(e.items,{type:"bi.single_select_icon_text_item",height:24,iconHeight:e.iconHeight,iconWidth:e.iconWidth,iconWrapperWidth:e.iconWrapperWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:e.behaviors,value:e.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,t,n)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(e,t){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var n=this.options;e=BI.createItems(e,{type:"bi.single_select_icon_text_item",height:24,iconWrapperWidth:n.iconWrapperWidth,iconHeight:n.iconHeight,iconWidth:n.iconWidth}),this.popup.populate(e,t)},getValue:function(){return this.popup.getValue()},setValue:function(e){this.popup.setValue(e)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup)},function(e,t){BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:24,text:"",items:[],tipType:"",warningTitle:"",attributes:{tabIndex:0}},render:function(){var t=this,e=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",container:e.container,adjustLength:2,toggle:!1,ref:function(){t.combo=this},el:{type:"bi.search_text_value_trigger",cls:"search-text-value-trigger",ref:function(){t.trigger=this},items:e.items,height:e.height-2,text:e.text,value:e.value,tipType:e.tipType,warningTitle:e.warningTitle,title:e.title,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){t.setValue(this.getValue()),t.combo.hideView(),t.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:e.value,items:e.items,ref:function(){t.popup=this,t.trigger.getSearcher().setAdapter(t.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){t.setValue(this.getValue()),t.combo.hideView(),t.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},value:e.value,maxHeight:252,minHeight:25},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){t.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===t.triggerBtn.element.find(e.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){t.triggerBtn=this},width:e.height,height:e.height,handler:function(){t.combo.isViewVisible()?t.combo.hideView():t.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var e=this.options;BI.isKey(e.value)&&this._checkError(e.value)},_checkError:function(n){var e;BI.isNull(n)||BI.isEmptyArray(n)||BI.isEmptyString(n)?(this.trigger.options.tipType="success",this.element.removeClass("combo-error")):(n=BI.isArray(n)?n:[n],e=BI.find(this.options.items,function(e,t){return BI.contains(n,t.value)}),BI.isNull(e)?(this.element.removeClass("combo-error").addClass("combo-error"),this.trigger.attr("tipType","warning")):(this.element.removeClass("combo-error"),this.trigger.attr("tipType","success")))},populate:function(e){this.options.items=e,this.combo.populate(e)},setValue:function(e){this.combo.setValue(e),this._checkError(e)},getValue:function(){var e=this.combo.getValue();return BI.isNull(e)?[]:BI.isArray(e)?e:[e]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo)},function(e,t){BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var i=this,e=this.options;return{type:"bi.vertical",vgap:5,items:[{type:"bi.button_group",ref:function(){i.popup=this},items:BI.createItems(e.items,{type:"bi.single_select_item",textAlign:e.textAlign,height:24}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:e.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,t,n)}}]}]}},mounted:function(){this.check()},populate:function(e,t,n){var i=BI.concat(e,t);BI.SearchTextValueComboPopup.superclass.populate.apply(this,i),i=BI.createItems(i,{type:"bi.single_select_item",height:24}),this.popup.populate(i,n)},getValue:function(){return this.popup.getValue()},setValue:function(e){this.popup.setValue(e)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup)},function(e,t){BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{extraCls:"bi-search-text-value-trigger bi-border",height:24},render:function(){var e=this,a=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){e.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){e.editor=this},defaultText:a.text,text:this._digest(a.value,a.items),value:a.value,height:a.height,tipText:""},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(e,t){var n=e.keyword,i=BI.Func.getSearchResult(a.items,n),r=i.match;t(i.find,r)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){e.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]}},_setState:function(e){this.editor.setState(e)},_digest:function(n,e){var t=this.options;n=BI.isArray(n)?n:[n];var i=[],r=BI.Tree.transformToArrayFormat(e);return BI.each(r,function(e,t){BI.deepContains(n,t.value)&&!BI.contains(i,t.text||t.value)&&i.push(t.text||t.value)}),0<i.length?i.join(","):BI.isFunction(t.text)?t.text():t.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(e){this.options.items=e},setValue:function(e){this._setState(this._digest(e,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger)},function(e,t){BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:t.items,height:t.height,text:t.text,value:t.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:t.chooseType,items:t.items,value:t.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.textIconCheckCombo.hideView(),e.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",container:t.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(t.value)&&this.setValue(t.value)},setTitle:function(e){this.trigger.setTitle(e)},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e)},setWarningTitle:function(e){this.trigger.setWarningTitle(e)},getValue:function(){var e=this.popup.getValue();return BI.isNull(e)?[]:BI.isArray(e)?e:[e]},populate:function(e){this.options.items=e,this.textIconCheckCombo.populate(e)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo)},function(e,t){BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var e=this.options,i=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(e.items),chooseType:e.chooseType,layouts:[{type:"bi.vertical"}],value:e.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,t,n)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},_formatItems:function(e){return BI.map(e,function(e,t){return BI.extend({type:"bi.single_select_item",cls:"bi-list-item",height:24},t)})},populate:function(e){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(e))},getValue:function(){return this.popup.getValue()},setValue:function(e){this.popup.setValue(e)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup)},function(e,t){BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:t.items,height:t.height,text:t.text,value:t.value,warningTitle:t.warningTitle}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:t.chooseType,value:t.value,items:t.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.textIconCombo.hideView(),e.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",container:t.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(t.value)&&this._checkError(t.value)},_checkError:function(n){var e;BI.isNull(n)||BI.isEmptyArray(n)||BI.isEmptyString(n)?(this.trigger.options.tipType="success",this.element.removeClass("combo-error")):(n=BI.isArray(n)?n:[n],e=BI.find(this.options.items,function(e,t){return BI.contains(n,t.value)}),BI.isNull(e)?(this.trigger.setTipType("warning"),this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.setTipType("success"),this.element.removeClass("combo-error")))},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e),this._checkError(e)},getValue:function(){var e=this.popup.getValue();return BI.isNull(e)?[]:BI.isArray(e)?e:[e]},populate:function(e){this.options.items=e,this.textIconCombo.populate(e)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo)},function(e,t){BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:20,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget(t.el,{type:"bi.small_select_text_trigger",items:t.items,height:t.height,text:t.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:t.chooseType,items:t.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.SmallTextValueCombo.hideView(),e.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,container:t.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}})},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e)},getValue:function(){return this.popup.getValue()},populate:function(e){this.options.items=e,this.SmallTextValueCombo.populate(e)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo)},function(e,t){BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var e=this.options,i=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(e.items,{type:"bi.single_select_item",textAlign:e.textAlign,height:24}),chooseType:e.chooseType,layouts:[{type:"bi.vertical"}],value:e.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,t,n)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(e){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),e=BI.createItems(e,{type:"bi.single_select_item",height:24}),this.popup.populate(e)},getValue:function(){return this.popup.getValue()},setValue:function(e){this.popup.setValue(e)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup)},function(e,t){BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget({type:"bi.editor",height:e.height,watermark:e.watermark,allowBlank:!0,errorText:e.errorText,validationChecker:e.validationChecker,quitChecker:e.quitChecker,value:e.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){t.setValue(""),t.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),t.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t._checkClear(),t.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,e)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){t.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){t.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t._checkClear(),t.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){t.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t.fireEvent(BI.ClearEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(e.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid())return this.editor.getValue()},setValue:function(e){this.editor.setValue(e),BI.isKey(e)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor)},function(e,t){BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget({type:"bi.editor",height:e.height,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,value:e.value,validationChecker:e.validationChecker,quitChecker:e.quitChecker,allowBlank:e.allowBlank,watermark:e.watermark,errorText:e.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:e.title,warningTitle:e.warningTitle,tipType:e.tipType,textAlign:e.textAlign,height:e.height,hgap:e.hgap}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){(arguments[2]=t).fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){t.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t._showHint(),t._checkText(),t.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t._showHint(),t._checkText(),t.fireEvent(BI.ShelterEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){t.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t._checkText(),t.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),t._checkText()},_checkText:function(){var e=this.options;""===this.editor.getValue()?(this.text.setValue(e.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark")),BI.isKey(e.keyword)&&this.text.doRedMark(e.keyword)},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},setTitle:function(e){this.text.setTitle(e)},setWarningTitle:function(e){this.text.setWarningTitle(e)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(e){this.editor.setErrorText(e)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setTextStyle:function(e){this.text.setStyle(e)},setValue:function(e){this.options;this.editor.setValue(e),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(e){this._showHint(),this.text.setValue(e)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor)},function(e,t){BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget({type:"bi.editor",height:e.height,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,value:e.value,validationChecker:e.validationChecker,quitChecker:e.quitChecker,allowBlank:e.allowBlank,watermark:e.watermark,errorText:e.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:e.title,warningTitle:e.warningTitle,tipType:e.tipType,textAlign:"left",height:e.height,hgap:e.hgap,handler:function(){t._showInput(),t.editor.focus(),t.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){t.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t._showHint(),t._checkText(),t.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t._showHint(),t._checkText(),t.fireEvent(BI.SignEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){t.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t._checkText(),t.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),t._checkText()},_checkText:function(){var e=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(e.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"),BI.isKey(e.keyword)&&this.text.doRedMark(e.keyword))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(e){this.text.setTitle(e)},setWarningTitle:function(e){this.text.setWarningTitle(e)},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(e){this.editor.setErrorText(e)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(e){this.editor.setValue(e),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(e){this._showHint(),this.text.setValue(e)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor)},function(e,t){BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,defaultText:"",text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget({type:"bi.editor",height:e.height,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,value:e.value,validationChecker:e.validationChecker,quitChecker:e.quitChecker,allowBlank:e.allowBlank,watermark:e.watermark,errorText:e.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark tip-text-style",textAlign:"left",height:e.height,text:e.text,hgap:e.hgap,handler:function(){t._showInput(),t.editor.focus(),t.editor.setValue("")},title:BI.isNotNull(e.tipText)?e.tipText:function(){var e="";return BI.isString(t.stateValue)&&(e=t.stateValue),BI.isArray(t.stateValue)&&1===t.stateValue.length&&(e=t.stateValue[0]),e},warningTitle:e.warningTitle,tipType:e.tipType}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){t.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t._showHint(),t.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t._showHint(),t.fireEvent(BI.StateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){t.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(e.text)&&this.setState(e.text)},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){!1===this.options.disabled&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},_setText:function(e){this.text.setText(e),this.text.setTitle(e)},isValid:function(){return this.editor.isValid()},setErrorText:function(e){this.editor.setErrorText(e)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(e){this.editor.setValue(e)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(e){var t=this.options;if(BI.StateEditor.superclass.setValue.apply(this,arguments),this.stateValue=e,!BI.isNumber(e))return BI.isString(e)?(this._setText(e),void(BI.isKey(t.defaultText)&&t.defaultText===e?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):void(BI.isArray(e)&&(BI.isEmpty(e)?(this._setText(BI.isKey(t.defaultText)?t.defaultText:t.text),BI.isKey(t.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark")):(1===e.length?this._setText(e[0]):this._setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark"))));e===BI.Selection.All?(this._setText(BI.i18nText("BI-Select_All")),this.text.element.removeClass("bi-water-mark")):e===BI.Selection.Multi?(this._setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark")):(this._setText(BI.isKey(t.defaultText)?t.defaultText:t.text),BI.isKey(t.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))},setTipType:function(e){this.text.options.tipType=e},getText:function(){return this.text.getText()}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor)},function(e,t){BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24,text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget({type:"bi.editor",height:e.height,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,value:e.value,validationChecker:e.validationChecker,quitChecker:e.quitChecker,allowBlank:e.allowBlank,watermark:e.watermark,errorText:e.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark",textAlign:"left",text:e.text,height:e.height,hgap:e.hgap,handler:function(){t._showInput(),t.editor.focus(),t.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){t.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t._showHint(),t.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t._showHint(),t.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(e.text)&&this.setState(e.text)},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},_setText:function(e){this.text.setText(e),this.text.setTitle(e)},isValid:function(){return this.editor.isValid()},setErrorText:function(e){this.editor.setErrorText(e)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(e){this.editor.setValue(e)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(e){var t=this.options;BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(e)?e===BI.Selection.All||e===BI.Selection.Multi?(this._setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this._setText(t.text),this.text.element.addClass("bi-water-mark")):BI.isArray(e)&&1!==e.length?BI.isEmpty(e)?(this._setText(t.text),this.text.element.addClass("bi-water-mark")):(this._setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this._setText(e),this.text.element.removeClass("bi-water-mark"))},getText:function(){return this.text.getText()}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor)},function(e,t){BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var e=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{_baseCls:(e._baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var e=this.options,n=this;if(0!==e.buttons.length){var i=[];return BI.each(e.buttons,function(e,t){i.push({text:t,value:e})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(i,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(e,t){n.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,e,t)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView)},function(e,t){BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var e=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var e=this,t=this.options,n=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return n.on(BI.IconButton.EVENT_CHANGE,function(){e.setVisible(!1),e.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-header-background",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:t.title,height:25,lgap:10}},{el:n,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel)},function(e,t){BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var e=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var i=this,n=this.options;this.button_group=BI.createWidget(n.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:n.items,itemsCreator:function(e,t){1===e.times&&(i.empty(),BI.nextTick(function(){i.loading()})),n.itemsCreator(e,function(){t.apply(i,arguments),1===e.times&&BI.nextTick(function(){i.loaded(),i.check()})})},hasNext:n.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.ListPane.EVENT_CHANGE,t,n)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:n.lgap,rgap:n.rgap,tgap:n.tgap,bgap:n.bgap,vgap:n.vgap,hgap:n.hgap},n.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(e){this.options.items=e.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(e){this.options.items=this.options.items.concat(e),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(e){e=e||[],BI.removeAt(this.options.items,e),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(e){var t=this;this.options;0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");t.populate.apply(t,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(e){return this.button_group.getIndexByValue(e)},getNodeById:function(e){return this.button_group.getNodeById(e)},getNodeByValue:function(e){return this.button_group.getNodeByValue(e)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane)},function(e,t){BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var e=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var n=this,e=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:e.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:e.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(e,t){n.fireEvent(BI.Panel.EVENT_CHANGE,e,t)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-header-background bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(e){this.text.setValue(e)}}),BI.Panel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel)},function(e,t){BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var e=this,t=this.options;return[{type:"bi.label",text:t.text,height:t.height,value:t.value,hgap:t.hgap,ref:function(){e.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:2,ref:function(){e.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(e){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),e?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(e){this.text.setText(e)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton)},function(e,t){BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-split-bottom",items:[],layouts:[{type:"bi.center"}],height:29},render:function(){var e=this,t=this.options;return{type:"bi.button_group",items:BI.createItems(t.items,{type:"bi.linear_segment_button",height:t.height-1}),layouts:t.layouts,listeners:[{eventName:"__EVENT_CHANGE__",action:function(){e.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){e.fireEvent("EVENT_CHANGE")}}],ref:function(){e.buttonGroup=this}}},setValue:function(e){this.buttonGroup.setValue(e)},setEnabledValue:function(e){this.buttonGroup.setEnabledValue(e)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment)},function(e,t){BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar",iconWrapperWidth:36},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var i=this,e=this.options;this.toolbar=BI.createWidget(e.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.allSelected=this.isSelected(),e===BI.Events.CLICK&&(i.setAllSelected(i.allSelected),i.fireEvent(BI.SelectList.EVENT_CHANGE,t,n)),i.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(e.el,{type:"bi.list_pane",items:e.items,itemsCreator:function(t,n){1===t.times&&i.toolbar.setVisible(!1),e.itemsCreator(t,function(e){n.apply(i,arguments),1===t.times&&(i.toolbar.setVisible(e&&0<e.length),i.toolbar.setEnable(i.isEnabled()&&e&&0<e.length)),i._checkAllSelected()})},onLoaded:e.onLoaded,hasNext:e.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(e,t,n){e===BI.Events.CLICK&&(i._checkAllSelected(),i.fireEvent(BI.SelectList.EVENT_CHANGE,t,n)),i.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(e.direction),BI.extend({scrolly:!0},e.logic,{items:BI.LogicFactory.createLogicItemsByDirection(e.direction,this.toolbar,this.list)})))),e.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(e.value)&&this.setValue(e.value)},_checkAllSelected:function(){var e=this.list.getValue().length,t=this.getAllLeaves().length-e,n=this.list.hasNext(),i=this.toolbar.isSelected(),r=(r=0<e&&(0<t||!i&&n))||0<t&&n&&i;this.toolbar.setHalfSelected(r),r||this.toolbar.setSelected(0<e&&t<=0&&(!n||i))},setAllSelected:function(n){BI.each(this.getAllButtons(),function(e,t){(t.setSelected||t.setAllSelected).apply(t,[n])}),this.allSelected=!!n,this.toolbar.setSelected(n),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(e){this.toolbar.setVisible(e)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(e){this.list.prependItems.apply(this.list,arguments)},addItems:function(e){this.list.addItems.apply(this.list,arguments)},setValue:function(e){var t=e.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(t),this.list[t?"setNotSelectedValue":"setValue"](e.value),this._checkAllSelected()},getValue:function(){return!1===this.isAllSelected()?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(e){this.toolbar.setVisible(!BI.isEmptyArray(e)),this.toolbar.setEnable(this.isEnabled()&&!BI.isEmptyArray(e)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(e){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(e)},resetHeight:function(e){var t=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(e-t):this.list.element.css({"max-height":e-t+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(e){return this.list.getIndexByValue(e)},getNodeById:function(e){return this.list.getNodeById(e)},getNodeByValue:function(e){return this.list.getNodeByValue(e)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList)},function(e,t){BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{},items:[]})},_init:function(){var n=this,e=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var t=e.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:e.el,itemsCreator:function(e,t){t(n._getNextItems(e))},hasNext:function(e){return e.count<t}}),this.loader.on(BI.Loader.EVENT_CHANGE,function(e){n.fireEvent(BI.LazyLoader.EVENT_CHANGE,e)})},_getNextItems:function(e){var t=this.options,n=t.items.length-this._const.PAGE*(e.times-1),i=BI.takeRight(t.items,n);return BI.take(i,this._const.PAGE)},populate:function(e){this.loader.populate(e)},addItems:function(e){this.loader.addItems(e)},empty:function(){this.loader.empty()},setNotSelectedValue:function(){this.loader.setNotSelectedValue.apply(this.loader,arguments)},getNotSelectedValue:function(){return this.loader.getNotSelectedValue()},setValue:function(){this.loader.setValue.apply(this.loader,arguments)},getValue:function(){return this.loader.getValue.apply(this.loader,arguments)},getAllButtons:function(){return this.loader.getAllButtons()},getAllLeaves:function(){return this.loader.getAllLeaves()},getSelectedButtons:function(){return this.loader.getSelectedButtons()},getNotSelectedButtons:function(){return this.loader.getNotSelectedButtons()},getIndexByValue:function(e){return this.loader.getIndexByValue(e)},getNodeById:function(e){return this.loader.getNodeById(e)},getNodeByValue:function(e){return this.loader.getNodeByValue(e)}}),BI.LazyLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.lazy_loader",BI.LazyLoader)},function(e,t){BI.ListLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ListLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-loader",isDefaultInit:!0,el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,next:{},hasNext:BI.emptyFn})},_nextLoad:function(){var e=this,t=this.options;this.next.setLoading(),t.itemsCreator.apply(this,[{times:++this.times},function(){e.next.setLoaded(),e.addItems.apply(e,arguments)}])},_init:function(){BI.ListLoader.superclass._init.apply(this,arguments);var i=this,e=this.options;!1===e.itemsCreator&&(e.next=!1),this.button_group=BI.createWidget(e.el,{type:"bi.button_group",element:this,chooseType:0,items:e.items,behaviors:{},layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.ListLoader.EVENT_CHANGE,n)}),!1!==e.next&&(this.next=BI.createWidget(BI.extend({type:"bi.loading_bar"},e.next)),this.next.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&i._nextLoad()})),BI.createWidget({type:"bi.vertical",element:this,items:[this.next]}),e.isDefaultInit&&BI.isEmpty(e.items)&&BI.nextTick(BI.bind(function(){this.populate()},this)),BI.isNotEmptyArray(e.items)&&this.populate(e.items)},hasNext:function(){var e=this.options;return BI.isNumber(e.count)?this.count<e.count:!!e.hasNext.apply(this,[{times:this.times,count:this.count}])},addItems:function(e){this.count+=e.length,BI.isObject(this.next)&&(this.options.items=this.options.items.concat(e),this.hasNext()?this.next.setLoaded():this.next.setEnd()),this.button_group.addItems.apply(this.button_group,arguments),this.next.element.appendTo(this.element)},populate:function(e){var t=this,n=this.options;0===arguments.length&&BI.isFunction(n.itemsCreator)?n.itemsCreator.apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");t.populate.apply(t,arguments),n.onLoaded()}]):(this.options.items=e,this.times=1,this.count=0,this.count+=e.length,BI.isObject(this.next)&&(this.hasNext()?this.next.setLoaded():this.next.invisible()),BI.DOM.hang([this.next]),this.button_group.populate.apply(this.button_group,arguments),this.next.element.appendTo(this.element))},empty:function(){BI.DOM.hang([this.next]),this.button_group.empty(),this.next.element.appendTo(this.element),BI.each([this.next],function(e,t){t&&t.setVisible(!1)})},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(e){return this.button_group.getIndexByValue(e)},getNodeById:function(e){return this.button_group.getNodeById(e)},getNodeByValue:function(e){return this.button_group.getNodeByValue(e)}}),BI.ListLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_loader",BI.ListLoader)},function(e,t){BI.SortList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SortList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sort-list",isDefaultInit:!0,el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,next:{},hasNext:BI.emptyFn})},_init:function(){BI.SortList.superclass._init.apply(this,arguments);var i=this,n=this.options;this.loader=BI.createWidget({type:"bi.list_loader",element:this,isDefaultInit:n.isDefaultInit,el:n.el,items:this._formatItems(n.items),itemsCreator:function(e,t){n.itemsCreator(e,function(e){t(i._formatItems(e))})},onLoaded:n.onLoaded,count:n.count,next:n.next,hasNext:n.hasNext}),this.loader.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.SortList.EVENT_CHANGE,t,n)}),this.loader.element.sortable({containment:n.containment||this.element,connectWith:n.connectWith||".bi-sort-list",items:".sort-item",cursor:n.cursor||"drag",tolerance:n.tolerance||"intersect",placeholder:{element:function(e){var t=BI.createWidget({type:"bi.layout",cls:"bi-sortable-holder",height:e.outerHeight()});return t.element.css({"margin-left":e.css("margin-left"),"margin-right":e.css("margin-right"),"margin-top":e.css("margin-top"),"margin-bottom":e.css("margin-bottom"),margin:e.css("margin")}),t.element},update:function(){}},start:function(e,t){},stop:function(e,t){i.fireEvent(BI.SortList.EVENT_CHANGE)},over:function(e,t){}})},_formatItems:function(e){return BI.each(e,function(e,t){(t=BI.stripEL(t)).cls=t.cls?t.cls+" sort-item":"sort-item",t.attributes={sorted:t.value}}),e},hasNext:function(){return this.loader.hasNext()},addItems:function(e){this.loader.addItems(e)},populate:function(e){e&&(arguments[0]=this._formatItems(e)),this.loader.populate.apply(this.loader,arguments)},empty:function(){this.loader.empty()},setNotSelectedValue:function(){this.loader.setNotSelectedValue.apply(this.loader,arguments)},getNotSelectedValue:function(){return this.loader.getNotSelectedValue()},setValue:function(){this.loader.setValue.apply(this.loader,arguments)},getValue:function(){return this.loader.getValue()},getAllButtons:function(){return this.loader.getAllButtons()},getAllLeaves:function(){return this.loader.getAllLeaves()},getSelectedButtons:function(){return this.loader.getSelectedButtons()},getNotSelectedButtons:function(){return this.loader.getNotSelectedButtons()},getIndexByValue:function(e){return this.loader.getIndexByValue(e)},getNodeById:function(e){return this.loader.getNodeById(e)},getNodeByValue:function(e){return this.loader.getNodeByValue(e)},getSortedValues:function(){return this.loader.element.sortable("toArray",{attribute:"sorted"})}}),BI.SortList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.sort_list",BI.SortList)},function(e,t){BI.LoadingPane=BI.inherit(BI.Pane,{_mount:function(){BI.Pane.superclass._mount.apply(this,arguments)&&this.beforeInit&&(this.__asking=!0,this.loading(),this.beforeInit(BI.bind(this.__loaded,this)))},_initRender:function(){this.beforeInit?this.__async=!0:this._render()},__loaded:function(){this.__asking=!1,this.loaded(),this._render()}})},function(e,t){BI.AllCountPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AllCountPager.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-all-count-pager",pagerDirection:"vertical",height:24,pages:1,curr:1,count:1})},_init:function(){BI.AllCountPager.superclass._init.apply(this,arguments);var t=this,e=this.options,n=this._getPagerIconCls();this.editor=BI.createWidget({type:"bi.small_text_editor",cls:"pager-editor bi-border-radius",validationChecker:function(e){return 0===t.rowCount.getValue()&&"0"===e||BI.isPositiveInteger(e)},hgap:4,vgap:0,value:e.curr,errorText:BI.i18nText("BI-Please_Input_Positive_Integer"),width:40,height:24,invisible:e.pages<=1}),this.pager=BI.createWidget({type:"bi.pager",width:58,layouts:[{type:"bi.horizontal",lgap:5}],dynamicShow:!1,pages:e.pages,curr:e.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Previous_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius all-pager-prev bi-list-item-select2 "+n.preCls},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Next_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius all-pager-next bi-list-item-select2 "+n.nextCls},hasPrev:e.hasPrev,hasNext:e.hasNext,firstPage:e.firstPage,lastPage:e.lastPage,invisible:e.pages<=1}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){t.pager.setValue(BI.parseInt(t.editor.getValue())),t.fireEvent(BI.AllCountPager.EVENT_CHANGE)}),this.pager.on(BI.Pager.EVENT_CHANGE,function(){t.fireEvent(BI.AllCountPager.EVENT_CHANGE)}),this.pager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){t.editor.setValue(t.pager.getCurrentPage())}),this.allPages=BI.createWidget({type:"bi.label",title:e.pages,text:"/"+e.pages,lgap:5,invisible:e.pages<=1}),this.rowCount=BI.createWidget({type:"bi.label",cls:"row-count",height:e.height,hgap:5,text:e.count,title:e.count});var i=BI.createWidget({type:"bi.left",height:e.height,scrollable:!1,items:[{type:"bi.label",height:e.height,text:BI.i18nText("BI-Basic_Total"),width:15},this.rowCount,{type:"bi.label",height:e.height,text:BI.i18nText("BI-Tiao_Data"),width:50,textAlign:"left"}]});BI.createWidget({type:"bi.left_right_vertical_adapt",element:this,items:{left:[i],right:[this.editor,this.allPages,this.pager]}})},alwaysShowPager:!0,_getPagerIconCls:function(){switch(this.options.pagerDirection){case"horizontal":return{preCls:"row-pre-page-h-font ",nextCls:"row-next-page-h-font "};case"vertical":default:return{preCls:"column-pre-page-h-font ",nextCls:"column-next-page-h-font "}}},setAllPages:function(e){this.allPages.setText("/"+e),this.allPages.setTitle(e),this.options.pages=e,this.pager.setAllPages(e),this.editor.setEnable(1<=e),this.setPagerVisible(1<e)},setValue:function(e){this.pager.setValue(e)},setVPage:function(e){this.pager.setValue(e)},setCount:function(e){this.rowCount.setText(e),this.rowCount.setTitle(e)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(e){this.editor.setVisible(e),this.allPages.setVisible(e),this.pager.setVisible(e)},populate:function(){this.pager.populate(),this.setPagerVisible(1<this.options.pages)}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager)},function(e,t){BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:24,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var e=this.options;e.vertical,e.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:0,right:86},{el:this.vlabel,top:0,right:110},{el:this.hpager,top:0,right:0},{el:this.hlabel,top:0,right:24}]})},_createVPager:function(){var e=this,t=this.options.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:t.curr,title:t.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:t.pages,curr:t.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2"},hasPrev:t.hasPrev,hasNext:t.hasNext,firstPage:t.firstPage,lastPage:t.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){e.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){e.vlabel.setValue(this.getCurrentPage()),e.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var e=this,t=this.options.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:t.curr,title:t.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:t.pages,curr:t.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2"},hasPrev:t.hasPrev,hasNext:t.hasNext,firstPage:t.firstPage,lastPage:t.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){e.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){e.hlabel.setValue(this.getCurrentPage()),e.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(e){this.vpager.setValue(e),this.vlabel.setValue(e),this.vlabel.setTitle(e)},setHPage:function(e){this.hpager.setValue(e),this.hlabel.setValue(e),this.hlabel.setTitle(e)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(e){this.hpager.setVisible(e),this.hlabel.setVisible(e)},setVPagerVisible:function(e){this.vpager.setVisible(e),this.vlabel.setVisible(e)},populate:function(){this.vpager.populate(),this.hpager.populate();var e=!1,t=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),t=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),e=!0):this.setVPagerVisible(!1),this.setVisible(t||e);var n=[86,110,0,24],i=this.layout.attr("items");!0===e&&!0===t?(i[0].right=n[0],i[1].right=n[1],i[2].right=n[2],i[3].right=n[3]):!0===e?(i[0].right=n[2],i[1].right=n[3]):!0===t&&(i[2].right=n[2],i[3].right=n[3]),this.layout.attr("items",i),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager)},function(e,t){BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var e=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){e._lock=!1},300),this._populate()},_populate:function(){var r=this,a=this.options,e=[],t={};this.empty();var n,o=BI.result(a,"pages"),i=BI.result(this,"currPage"),s=BI.result(a,"groups"),l=BI.result(a,"first"),u=BI.result(a,"last"),c=BI.result(a,"prev"),h=BI.result(a,"next");!1===o?(s=0,u=l=!1):o<s&&(s=o),t.index=Math.ceil((i+(1<s&&s!==o?1:0))/(0===s?1:s)),(!a.dynamicShow&&!a.dynamicShowPrevNext||1<i)&&!1!==c&&(BI.isKey(c)?e.push({text:c,value:"prev",disabled:!1===o?!1===a.hasPrev(i):!(1<i&&!1!==c)}):e.push(BI.extend({disabled:!1===o?!1===a.hasPrev(i):!(1<i&&!1!==c)},c))),(!a.dynamicShow&&!a.dynamicShowFirstLast||1<t.index&&0!==s)&&l&&(e.push({text:l,value:"first",disabled:!(1<t.index&&0!==s)}),1<t.index&&0!==s&&e.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),t.poor=Math.floor((s-1)/2),t.start=1<t.index?i-t.poor:1,t.end=1<t.index?(n=i+(s-t.poor-1),o<n?o:n):s,t.end-t.start<s-1&&(t.start=t.end-s+1);var p=t.start,d=t.end;for(l&&u&&1<t.index&&0!==s&&s<o&&t.end<o&&0!==s&&(p++,d--);p<=d;p++)p===i?e.push({text:p,value:p,selected:!0}):e.push({text:p,value:p});(!a.dynamicShow&&!a.dynamicShowFirstLast||s<o&&t.end<o&&0!==s)&&u&&(s<o&&t.end<o&&0!==s&&e.push({type:"bi.label",cls:"page-ellipsis",text:"…"}),e.push({text:u,value:"last",disabled:!(s<o&&t.end<o&&0!==s)})),t.flow=!c&&0===s,(!a.dynamicShow&&!a.dynamicShowPrevNext&&h||i!==o&&h||t.flow)&&e.push(BI.isKey(h)?!1===o?{text:h,value:"next",disabled:!1===a.hasNext(i)}:t.flow&&i===o?{text:h,value:"next",disabled:!0}:{text:h,value:"next",disabled:!(i!==o&&h||t.flow)}:BI.extend({disabled:!1===o?!1===a.hasNext(i):!(i!==o&&h||t.flow)},h)),this.button_group=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(e,{cls:"page-item bi-border bi-list-item-active",height:23,hgap:10}),behaviors:a.behaviors,layouts:a.layouts}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(e,t,n){if(!0!==r._lock){if(r._lock=!0,r._debouce(),e===BI.Events.CLICK){var i=r.button_group.getValue()[0];switch(i){case"first":r.currPage=1;break;case"last":r.currPage=o;break;case"prev":r.currPage--;break;case"next":r.currPage++;break;default:r.currPage=i}a.jump.apply(r,[{pages:o,curr:r.currPage}]),r._populate(),r.fireEvent(BI.DetailPager.EVENT_CHANGE,n)}r.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}),this.fireEvent(BI.DetailPager.EVENT_AFTER_POPULATE)},getCurrentPage:function(){return this.currPage},setAllPages:function(e){this.options.pages=e},hasPrev:function(e){e=e||1;var t=this.options;return!1===this.options.pages?t.hasPrev(e):1<e},hasNext:function(e){e=e||1;var t=this.options,n=this.options.pages;return!1===n?t.hasNext(e):e<n},setValue:function(e){var t,n,i=this.options;e=(e=e||0)<1?1:e,!1===i.pages?(t=BI.result(i,"lastPage"),n=1,this.currPage=t<e?t:e<(n=BI.result(i,"firstPage"))?n:e):(e=e>i.pages?i.pages:e,this.currPage=e),this._populate()},getValue:function(){var e=this.button_group.getValue()[0];switch(e){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return e}},attr:function(e,t){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===e&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager)},function(e,t){BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-segment-button bi-list-item-select",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textHeight:e.height,whiteSpace:e.whiteSpace,text:e.text,value:e.value,hgap:e.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(e){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(e)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton)},function(e,t){BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var n=this,e=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:e.value,items:BI.createItems(e.items,{type:"bi.segment_button",height:e.height-2,whiteSpace:e.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(e,t){n.fireEvent(BI.Segment.EVENT_CHANGE,e,t)})},_setEnable:function(e){BI.Segment.superclass._setEnable.apply(this,arguments),!0===e?this.element.removeClass("base-disabled disabled"):!1===e&&this.element.addClass("base-disabled disabled")},setValue:function(e){this.buttonGroup.setValue(e)},setEnabledValue:function(e){this.buttonGroup.setEnabledValue(e)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment)},function(e,t){BI.MultiSelectBar=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectBar.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-bar",height:25,text:BI.i18nText("BI-Select_All"),isAllCheckedBySelectedValue:BI.emptyFn,disableSelected:!0,isHalfCheckedBySelectedValue:function(e){return 0<e.length},halfSelected:!1,iconWrapperWidth:26})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var e=this,t=this.options,n=!0===t.selected,i=!t.selected&&t.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){e.setSelected(e.isSelected())},selected:n,invisible:i}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){e.setSelected(!0)},invisible:n||!i}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,e.isSelected(),e)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,e.isSelected(),e)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,e.isSelected(),e)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,e.isSelected(),e)}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:t.height,height:t.height,hgap:t.hgap,text:t.text,keyword:t.keyword,value:t.value,py:t.py}),BI.createWidget({type:"bi.htape",element:this,items:[{width:t.iconWrapperWidth,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(e){this.checkbox.setSelected(!!e)},beforeClick:function(){var e=this.isHalfSelected(),t=this.isSelected();!0===e?this.setSelected(!0):this.setSelected(!t)},setSelected:function(e){this.checkbox.setSelected(e),this.setHalfSelected(!1)},setHalfSelected:function(e){this.halfSelected=!!e,!0===e?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(e){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var t=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(t),t||this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,this.isSelected(),this)}}),BI.MultiSelectBar.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar)},function(e,t){BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(i,r,a){var o=this;return BI.each(i,function(e,t){var n={layer:r};BI.isKey(t.id)||(t.id=BI.UUID()),n.pNode=a,!0===t.isParent||!0===t.parent||BI.isNotEmptyArray(t.children)?(n.type="bi.mid_plus_group_node",e===i.length-1&&(n.type="bi.last_plus_group_node",n.isLastNode=!0),0!==e||a||(n.type="bi.first_plus_group_node"),0===e&&e===i.length-1&&(n.type="bi.plus_group_node"),BI.defaults(t,n),o._formatItems(t.children,r+1,t)):(n.type="bi.mid_tree_leaf_item",0!==e||a||(n.type="bi.first_tree_leaf_item"),e===i.length-1&&(n.type="bi.last_tree_leaf_item"),BI.defaults(t,n))}),i},_assertId:function(e){BI.each(e,function(e,t){BI.isKey(t.id)||(t.id=BI.UUID())})},initTree:function(e){var i=this,t=this.options;this.empty(),this._assertId(e),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},t.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(e),0),value:t.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},t.el)}),this.tree.on(BI.Controller.EVENT_CHANGE,function(e,t,n){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&i.fireEvent(BI.LevelTree.EVENT_CHANGE,t,n)})},stroke:function(e){this.tree.stroke.apply(this.tree,arguments)},populate:function(e,t){e=this._formatItems(BI.Tree.transformToTreeFormat(e),0),this.tree.populate(e,t)},setValue:function(e){this.tree.setValue(e)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(e){return this.tree.getNodeById(e)},getNodeByValue:function(e){return this.tree.getNodeByValue(e)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree)},function(e,t){BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var e=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var e=this,t=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:t.height,value:t.value,validationChecker:t.validationChecker,quitChecker:t.quitChecker,allowBlank:t.allowBlank,watermark:t.watermark,errorText:t.errorText,title:function(){return e.getValue()}}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){e.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){e.fireEvent(BI.EditorTrigger.EVENT_FOCUS,arguments)}),this.editor.on(BI.SignEditor.EVENT_EMPTY,function(){e.fireEvent(BI.EditorTrigger.EVENT_EMPTY,arguments)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){e.fireEvent(BI.EditorTrigger.EVENT_VALID,arguments)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){e.fireEvent(BI.EditorTrigger.EVENT_ERROR,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:t.triggerWidth||t.height},width:t.triggerWidth||t.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(e){this.editor.setValue(e)},setText:function(e){this.editor.setState(e)}}),BI.EditorTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.EditorTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.EditorTrigger.EVENT_EMPTY="EVENT_EMPTY",BI.EditorTrigger.EVENT_VALID="EVENT_VALID",BI.EditorTrigger.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.editor_trigger",BI.EditorTrigger)},function(e,t){BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-trigger",extraCls:"pull-down-font",el:{},height:24})},_init:function(){var e=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(e.el,{type:"bi.trigger_icon_button",element:this,width:e.width,height:e.height,extraCls:e.extraCls})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger)},function(e,t){BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var e=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null,textCls:""})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var t=this,e=this.options;this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(e.textCls)?" "+e.textCls:""),textAlign:"left",height:e.height,text:e.text}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:e.triggerWidth||e.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(e){t.wrapper=e},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:e.iconCls,ref:function(e){t.icon=e},iconHeight:e.iconHeight,iconWidth:e.iconWidth,disableSelected:!0},width:BI.isEmptyString(e.iconCls)?0:e.iconWrapperWidth||e.height},{el:this.text,lgap:BI.isEmptyString(e.iconCls)?5:0},{el:this.trigerButton,width:e.triggerWidth||e.height}]})},setValue:function(e){this.text.setValue(e)},setIcon:function(e){var t=this.options;this.icon.setIcon(e);var n=this.wrapper.attr("items")[0],i=this.wrapper.attr("items")[1];BI.isNull(e)||BI.isEmptyString(e)?0!==n.width&&(n.width=0,i.lgap=5,this.wrapper.resize()):n.width!==(t.iconWrapperWidth||t.height)&&(n.width=t.iconWrapperWidth||t.height,i.lgap=0,this.wrapper.resize())},setTextCls:function(e){var t=this.options,n=t.textCls;t.textCls=e,this.text.element.removeClass(n).addClass(e)},setText:function(e){this.text.setText(e)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger)},function(e,t){BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var e=this.options,t=this._digist(e.value,e.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:t.text,textCls:t.textCls,iconCls:t.iconCls,height:e.height,iconHeight:e.iconHeight,iconWidth:e.iconWidth,iconWrapperWidth:e.iconWrapperWidth})},_digist:function(n,e){var i,t=this.options;n=BI.isArray(n)?n:[n];var r=BI.Tree.transformToArrayFormat(e);return BI.any(r,function(e,t){if(BI.deepContains(n,t.value))return i={text:t.text||t.value,iconCls:t.iconCls},!0}),BI.isNotNull(i)?{text:i.text,textCls:"",iconCls:i.iconCls}:{text:BI.isFunction(t.text)?t.text():t.text,textCls:"bi-water-mark",iconCls:t.iconCls}},setValue:function(e){var t=this._digist(e,this.options.items);this.trigger.setText(t.text),this.trigger.setIcon(t.iconCls),this.trigger.setTextCls(t.textCls)},populate:function(e){this.options.items=e}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger)},function(e,t){BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var e=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-trigger",height:24,textCls:""})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var e=this,t=this.options,n=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(t.textCls)?" "+t.textCls:""),textAlign:"left",height:t.height,text:t.text,title:function(){return e.text.getText()},tipType:t.tipType,warningTitle:t.warningTitle,hgap:n.hgap,readonly:t.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:t.triggerWidth||t.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:t.triggerWidth||t.height}]})},setTextCls:function(e){var t=this.options,n=t.textCls;t.textCls=e,this.text.element.removeClass(n).addClass(e)},setText:function(e){this.text.setText(e)},setTipType:function(e){this.text.options.tipType=e}}),BI.shortcut("bi.text_trigger",BI.TextTrigger)},function(e,t){BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border bi-focus-shadow",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var e=this.options,t=this._digest(e.value,e.items);this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:e.height,readonly:e.readonly,text:t.text,textCls:t.textCls,tipType:e.tipType,warningTitle:e.warningTitle})},_digest:function(n,e){var t=this.options;n=BI.isArray(n)?n:[n];var i=[],r=BI.Tree.transformToArrayFormat(e);return BI.each(r,function(e,t){BI.deepContains(n,t.value)&&!BI.contains(i,t.text||t.value)&&i.push(t.text||t.value)}),0<i.length?{textCls:"",text:i.join(",")}:{textCls:"bi-water-mark",text:BI.isFunction(t.text)?t.text():t.text}},setValue:function(e){var t=this._digest(e,this.options.items);this.trigger.setTextCls(t.textCls),this.trigger.setText(t.text)},setTipType:function(e){this.trigger.setTipType(e)},populate:function(e){this.options.items=e}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger)},function(e,t){BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var e=this.options,t=this._digest(e.value,e.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:e.height-2,text:t.text,cls:t.cls})},_digest:function(n,e){var t=this.options;n=BI.isArray(n)?n:[n];var i=[],r=BI.Tree.transformToArrayFormat(e);return BI.each(r,function(e,t){BI.deepContains(n,t.value)&&!BI.contains(i,t.text||t.value)&&i.push(t.text||t.value)}),0<i.length?{cls:"",text:i.join(",")}:{cls:"bi-water-mark",text:t.text}},setValue:function(e){var t=this._digest(e,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(t.cls),this.trigger.setText(t.text)},populate:function(e){this.options.items=e}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger)},function(e,t){BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var e=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var e=this.options,t=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:e.height,text:e.text,hgap:t.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:e.triggerWidth||e.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:e.triggerWidth||e.height}]})},setValue:function(e){this.text.setValue(e)},setText:function(e){this.text.setText(e)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger)},function(e,t){BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:24,container:null})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:t.behaviors}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",container:t.container,element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){e.combo.hideView(),e.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){e.doBehavior()})},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo)},function(e,t){BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:24,container:null})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:t.behaviors,min:t.min,max:t.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.combo.hideView(),e.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,container:t.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){e.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){e.doBehavior()})},setMinDate:function(e){this.popup.setMinDate(e)},setMaxDate:function(e){this.popup.setMaxDate(e)},setValue:function(e){this.trigger.setValue(e),this.popup.setValue(e)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo)},function(e,t){BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-date-picker",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var e=this,t=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===e._month?e.setValue({year:e.year.getValue()-1,month:12}):e.setValue({year:e.year.getValue(),month:e.month.getValue()-1}),e.fireEvent(BI.DatePicker.EVENT_CHANGE),e._checkLeftValid(),e._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===e._month?e.setValue({year:e.year.getValue()+1,month:1}):e.setValue({year:e.year.getValue(),month:e.month.getValue()+1}),e.fireEvent(BI.DatePicker.EVENT_CHANGE),e._checkLeftValid(),e._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",behaviors:t.behaviors,min:t.min,max:t.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){e.setValue({year:e.year.getValue(),month:e.month.getValue()}),e.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo",behaviors:t.behaviors}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){e.setValue({year:e.year.getValue(),month:e.month.getValue()}),e.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:24},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal",width:120,rgap:10,items:[{el:this.year,lgap:10},this.month]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:24}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var e=this.options,t=!(1===this._month&&this._year===BI.parseDateTime(e.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(t),t},_checkRightValid:function(){var e=this.options,t=!(12===this._month&&this._year===BI.parseDateTime(e.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(t),t},setMinDate:function(e){this.year.setMinDate(e)},setMaxDate:function(e){this.year.setMaxDate(e)},setValue:function(e){this._year=BI.parseInt(e.year),this._month=BI.parseInt(e.month),this.year.setValue(e.year),this.month.setValue(e.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker)},function(e,t){BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-year-picker",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var e=this,t=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){e.setValue(e.year.getValue()-1),e.fireEvent(BI.YearPicker.EVENT_CHANGE),e._checkLeftValid(),e._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){e.setValue(e.year.getValue()+1),e.fireEvent(BI.YearPicker.EVENT_CHANGE),e._checkLeftValid(),e._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:t.min,behaviors:t.behaviors,max:t.max,width:50}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){e.setValue(e.year.getValue()),e.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{el:this.year}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var e=this.options,t=!(this._year===BI.parseDateTime(e.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(t),t},_checkRightValid:function(){var e=this.options,t=!(this._year===BI.parseDateTime(e.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(t),t},setMinDate:function(e){this.options.min=e,this.year.setMinDate(e),this._checkLeftValid(),this._checkRightValid()},setMaxDate:function(e){this.options.max=e,this.year.setMaxDate(e),this._checkLeftValid(),this._checkRightValid()},setValue:function(e){this._year=e,this.year.setValue(e),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker)},function(e,t){BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(e){var t=BI.Calendar.getDateJSONByPage(e);return BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:t.year,month:t.month,day:1})},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=t.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:t.behaviors,min:t.min,max:t.max}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(e.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){e.selectedTime=e.datePicker.getValue(),e.selectedTime.day=1,e.calendar.setSelect(BI.Calendar.getPageByDateJSON(e.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){e.selectedTime=e.calendar.getValue(),e.setValue(e.selectedTime),e.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.calendar,left:5,right:5},{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},_checkMin:function(){var e=this.calendar.getSelectedCard();BI.isNotNull(e)&&e.setMinDate(this.options.min)},_checkMax:function(){var e=this.calendar.getSelectedCard();BI.isNotNull(e)&&e.setMaxDate(this.options.max)},setMinDate:function(e){BI.isNotEmptyString(this.options.min)&&(this.options.min=e,this.datePicker.setMinDate(e),this._checkMin())},setMaxDate:function(e){BI.isNotEmptyString(this.options.max)&&(this.options.max=e,this.datePicker.setMaxDate(e),this._checkMax())},setValue:function(e){this.datePicker.setValue(e),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(e)),this.calendar.setValue(e),this.selectedTime=e},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup)},function(e,t){BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var t=this,e=this.options,n=[1,7,2,8,3,9,4,10,5,11,6,12],i=[];i.push(n.slice(0,2)),i.push(n.slice(2,4)),i.push(n.slice(4,6)),i.push(n.slice(6,8)),i.push(n.slice(8,10)),i.push(n.slice(10,12)),i=BI.map(i,function(e,t){return BI.map(t,function(e,t){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:t,text:t}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:e.behaviors,items:BI.createItems(i,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:e.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(e){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&t.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(e){e=BI.parseInt(e),this.month.setValue([e])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup)},function(e,t){BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(e){var t=this.options,n=this._year,i=BI.createWidget({type:"bi.year_calendar",behaviors:t.behaviors,min:t.min,max:t.max,logic:{dynamic:!0},year:n+12*e});return i.setValue(this._year),i},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var t=this,e=this.options;this.selectedYear=this._year=BI.getDate().getFullYear(),this.backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24,value:-1}),this.preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24,value:1}),this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-split-top",height:24,items:[this.backBtn,this.preBtn]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(t.selectedYear);var e=this.getSelectedCard();e&&t.backBtn.setEnable(!e.isFrontYear()),e&&t.preBtn.setEnable(!e.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){t.selectedYear=this.getValue(),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments),t.fireEvent(BI.YearPopup.EVENT_CHANGE,t.selectedYear)}),BI.isKey(e.value)&&this.setValue(e.value)},_checkMin:function(){var e=this.navigation.getSelectedCard();BI.isNotNull(e)&&(e.setMinDate(this.options.min),this.backBtn.setEnable(!e.isFrontYear()),this.preBtn.setEnable(!e.isFinalYear()))},_checkMax:function(){var e=this.navigation.getSelectedCard();BI.isNotNull(e)&&(e.setMaxDate(this.options.max),this.backBtn.setEnable(!e.isFrontYear()),this.preBtn.setEnable(!e.isFinalYear()))},setMinDate:function(e){BI.isNotEmptyString(this.options.min)&&(this.options.min=e,this._checkMin())},setMaxDate:function(e){BI.isNotEmptyString(this.options.max)&&(this.options.max=e,this._checkMax())},getValue:function(){return this.selectedYear},setValue:function(e){var t=this.options;e=BI.parseInt(e);var n=BI.parseDateTime(t.min,"%Y-%X-%d"),i=BI.parseDateTime(t.max,"%Y-%X-%d");BI.checkDateVoid(e,1,1,BI.print(BI.getDate(n.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(i.getFullYear(),0,1),"%Y-%X-%d"))[0]?(e=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(e)),this.navigation.setValue("")):(this.selectedYear=e,this.navigation.setSelect(BI.YearCalendar.getPageByYear(e)),this.navigation.setValue(e))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup)},function(e,t){BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:24,iconWidth:12,iconHeight:12},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:24})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var e=this.options,t=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:e.text,value:e.value,height:t.height}),BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.text,rgap:5},{type:"bi.icon_label",width:16}]})},setValue:function(e){this.text.setValue(e)},getValue:function(){return this.text.getValue()},setText:function(e){this.text.setText(e)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger)},function(e,t){BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var i=this,e=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=e.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:e.behaviors,min:e.min,max:e.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var e=i.datePicker.getValue(),t=BI.getMonthDays(BI.getDate(e.year,e.month-1,1)),n=i.selectedTime.day||0;t<n&&(n=t),i.selectedTime={year:e.year,month:e.month},0!==n&&(i.selectedTime.day=n),i.calendar.setSelect(BI.Calendar.getPageByDateJSON(i.selectedTime)),i.calendar.setValue(i.selectedTime),0!==n&&i.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){i.selectedTime=i.calendar.getValue(),i.calendar.empty(),i.setValue(i.selectedTime),i.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(e.selectedTime),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.datePicker,height:40},this.calendar],hgap:10}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},_createNav:function(e){var t=BI.Calendar.getDateJSONByPage(e);return BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:t.year,month:t.month,day:this.selectedTime.day})},_getNewCurrentDate:function(){var e=BI.getDate();return{year:e.getFullYear(),month:e.getMonth()+1}},_setCalenderValue:function(e){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(e)),this.calendar.setValue(e),this.selectedTime=e},_setDatePicker:function(e){BI.isNull(e)||BI.isNull(e.year)||BI.isNull(e.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(e)},_setCalendar:function(e){BI.isNull(e)||BI.isNull(e.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(e)},setValue:function(e){this._setDatePicker(e),this._setCalendar(e)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard)},function(e,t){BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var n=this,t=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var e=this.getValue()[0];switch(n.dateTab.setSelect(e),e){case BI.DynamicDatePane.Static:var t=BI.DynamicDateHelper.getCalculation(n.dynamicPane.getValue());n.ymd.setValue({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()});break;case BI.DynamicDatePane.Dynamic:n.dynamicPane.setValue({year:0})}n.fireEvent("EVENT_CHANGE")}}],ref:function(){n.switcher=this}},height:30},{type:"bi.tab",ref:function(){n.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(e){switch(e){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",behaviors:t.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){n.fireEvent("EVENT_CHANGE")}}],ref:function(){n.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){n._checkValue(n.getValue())&&n.fireEvent("EVENT_CHANGE")}}],ref:function(){n.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(e){return BI.isNull(e)||BI.isEmptyObject(e)||BI.isEmptyString(e)},_checkValue:function(e){switch(e.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(e.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(e){var t,n=(e=e||{}).type||BI.DynamicDateCombo.Static,i=e.value||e;switch(this.switcher.setValue(n),this.dateTab.setSelect(n),n){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(i);break;case BI.DynamicDateCombo.Static:default:this._checkValueValid(i)?(t=BI.getDate(),this.ymd.setValue({year:t.getFullYear(),month:t.getMonth()+1})):this.ymd.setValue(i)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2})},function(e,t){BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border bi-border-radius",width:200,height:24,minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var e=this,t=this.options,n=BI.getDate();this.storeValue=BI.isNotNull(t.value)?t.value:{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate(),hour:n.getHours(),minute:n.getMinutes(),second:n.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:t.minDate,max:t.maxDate,value:t.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",behaviors:t.behaviors,min:t.minDate,max:t.maxDate,value:t.value}),e.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){e.setValue(e.storeValue),e.hidePopupView(),e.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){e.storeValue=e.popup.getValue(),e.setValue(e.storeValue),e.hidePopupView(),e.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",container:t.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===i.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){e.popup.setValue(e.storeValue),e.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var i=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24});i.on(BI.IconButton.EVENT_CHANGE,function(){e.combo.isViewVisible()||e.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:i,top:0,right:0}]}]})},setValue:function(e){this.storeValue=e,this.popup.setValue(e),this.trigger.setValue(e)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo)},function(e,t){BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var t=this,e=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){t.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){t.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",behaviors:e.behaviors,min:t.options.min,max:t.options.max}),t.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){t.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",ref:function(e){t.timeSelect=e}}]},height:50},{el:this.dateButton,height:30}]}),this.setValue(e.value)},setValue:function(e){var t,n=e;BI.isNull(n)?(t=BI.getDate(),this.dateCombo.setValue({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}),this.timeSelect.setValue({hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds()})):(this.dateCombo.setValue({year:n.year,month:n.month,day:n.day}),this.timeSelect.setValue({hour:n.hour,minute:n.minute,second:n.second}))},getValue:function(){return BI.extend({year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day},this.timeSelect.getValue())}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup)},function(e,t){BI.DateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){return BI.extend(BI.DateTimeTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,width:200})},_init:function(){BI.DateTimeTrigger.superclass._init.apply(this,arguments);var e=this.options,t=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:e.height,width:e.width,hgap:t.hgap}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text},{el:BI.createWidget(),width:e.height}]}),this.setValue(e.value)},_printTime:function(e){return e<10?"0"+e:e},setValue:function(e){var t,n,i=e;n=BI.isNull(i)?(i=BI.getDate(),BI.print(i,"%Y-%X-%d %H:%M:%S")):(t=BI.getDate(i.year,i.month-1,i.day,i.hour,i.minute,i.second),BI.print(t,"%Y-%X-%d %H:%M:%S")),this.text.setText(n),this.text.setTitle(n)}}),BI.shortcut("bi.date_time_trigger",BI.DateTimeTrigger)},function(e,t){BI.StaticDateTimePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.StaticDateTimePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-date-time-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDateTimePaneCard.superclass._init.apply(this,arguments);var i=this,e=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=e.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:e.behaviors,min:e.min,max:e.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var e=i.datePicker.getValue(),t=BI.getMonthDays(BI.getDate(e.year,e.month-1,1)),n=i.selectedTime.day||0;t<n&&(n=t),i.selectedTime=BI.extend(i.selectedTime,{year:e.year,month:e.month}),0!==n&&(i.selectedTime.day=n),i.calendar.setSelect(BI.Calendar.getPageByDateJSON(i.selectedTime)),i.calendar.setValue(i.selectedTime),0!==n&&i.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){i.selectedTime=BI.extend(i.calendar.getValue(),i.timeSelect.getValue()),i.calendar.empty(),i.setValue(i.selectedTime),i.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,hgap:10,items:[{el:this.datePicker,height:40},this.calendar,{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){i.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){i.selectedTime=BI.extend(i.calendar.getValue(),i.timeSelect.getValue()),i.fireEvent("EVENT_CHANGE")}}]},height:40}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]}),this.setValue(e.selectedTime)},_createNav:function(e){var t=BI.Calendar.getDateJSONByPage(e);return BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:t.year,month:t.month,day:this.selectedTime.day})},_getNewCurrentDate:function(){var e=BI.getDate();return{year:e.getFullYear(),month:e.getMonth()+1}},_setCalenderValue:function(e){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(e)),this.calendar.setValue(e),this.selectedTime=BI.extend({},this.timeSelect.getValue(),e)},_setDatePicker:function(e){BI.isNull(e)||BI.isNull(e.year)||BI.isNull(e.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(e)},_setCalendar:function(e){BI.isNull(e)||BI.isNull(e.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(e)},setValue:function(e){e=e||{},this._setDatePicker(e),this._setCalendar(e),this.timeSelect.setValue({hour:e.hour,minute:e.minute,second:e.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard)},function(e,t){BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var n=this,t=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var e=this.getValue()[0];switch(n.dateTab.setSelect(e),e){case BI.DynamicDateTimePane.Static:var t=BI.DynamicDateHelper.getCalculation(n.dynamicPane.getValue());n.ymd.setValue({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()});break;case BI.DynamicDateTimePane.Dynamic:n.dynamicPane.setValue({year:0})}}}],ref:function(){n.switcher=this}},height:30},{type:"bi.tab",ref:function(){n.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(e){switch(e){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",behaviors:t.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){n.fireEvent("EVENT_CHANGE")}}],ref:function(){n.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){n._checkValue(n.getValue())&&n.fireEvent("EVENT_CHANGE")}}],ref:function(){n.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(e){return BI.isNull(e)||BI.isEmptyObject(e)||BI.isEmptyString(e)},_checkValue:function(e){switch(e.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(e.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(e){var t,n=(e=e||{}).type||BI.DynamicDateTimePane.Static,i=e.value||e;switch(this.switcher.setValue(n),this.dateTab.setSelect(n),n){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(i);break;case BI.DynamicDateTimePane.Static:default:this._checkValueValid(i)?(t=BI.getDate(),this.ymd.setValue({year:t.getFullYear(),month:t.getMonth()+1})):this.ymd.setValue(i)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2})},function(e,t){BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var n=this,e=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:e.items,chooseType:e.chooseType,value:e.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(e){n.fireEvent(BI.DownListCombo.EVENT_CHANGE,e),n.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(e,t){n.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,e,t),n.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:e.trigger,isNeedAdjustWidth:!1,container:e.container,adjustLength:e.adjustLength,direction:e.direction,stopPropagation:e.stopPropagation,el:BI.createWidget(e.el,{type:"bi.icon_trigger",extraCls:e.iconCls,width:e.width,height:e.height}),popup:{el:this.popupview,stopPropagation:e.stopPropagation,maxHeight:1e3,minWidth:140}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){n.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(e){this.popupview.populate(e)},setValue:function(e){this.popupview.setValue(e)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo)},function(e,t){BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var e=this.options,t=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:e.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:e.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(e){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&t.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(e){this.downlistgroup.setValue(e)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup)},function(e,t){BI.DownListItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:24,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var e=this.options;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:e.textHgap,vgap:e.textVgap,lgap:e.textLgap,rgap:e.textRgap,text:e.text,value:e.value,keyword:e.keyword,height:e.height}),this.icon=BI.createWidget({type:"bi.center_adapt",width:36,height:e.height,items:[{el:{type:"bi.icon",width:e.iconWidth,height:e.iconHeight}}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.DownListItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem)},function(e,t){BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var e=this.options,t=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:e.text,value:e.value,height:e.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:e.iconCls1,width:36,disableSelected:!0,selected:this._digest(e.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:e.iconCls2,width:24,forceNotSelected:!0});var n=BI.createWidget({type:"bi.layout",width:24});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,n)})))),this.element.hover(function(){t.isEnabled()&&t.hover()},function(){t.isEnabled()&&t.dishover()})},_digest:function(e){var n=this.options;return e=BI.isArray(e)?e:[e],BI.any(e,function(e,t){return BI.contains(n.childValues,t)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(e){this.icon1.setSelected(this._digest(e))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem)},function(e,t){BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:24,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var e=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,e=this.options,t=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(t,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(e.value),chooseType:e.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(e,t){var n,i,r=e;BI.isNotNull(a.childValueMap[e])?(r=a.childValueMap[e],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,r,a.fatherValueMap[e])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,r,t),BI.contains(a.singleValues,r)||(n=a.getValue(),i=[],BI.each(n,function(e,t){t.value!=r&&i.push(t)}),a.setValue(i))}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createChildren:function(r){var a=this,o=[];return BI.each(r,function(e,t){var n,i={type:"bi.down_list_group",items:[]};BI.each(t,function(e,r){BI.isNotEmptyArray(r.children)&&!BI.isEmpty(r.el)?(r.type="bi.combo_group",r.isDefaultInit=!0,r.cls="down-list-group",r.trigger="hover",r.isNeedAdjustWidth=!1,r.el.title=r.el.title||r.el.text,r.el.type="bi.down_list_group_item",r.el.logic={dynamic:!0},r.el.height=a.constants.height,r.el.iconCls2=a.constants.nextIcon,r.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5,maxHeight:378},r.el.childValues=[],BI.each(r.children,function(e,t){var n=BI.deepClone(r.el.value),i=BI.deepClone(t.value);a.singleValues.push(t.value),t.type="bi.down_list_item",t.extraCls=" child-down-list-item",t.title=t.title||t.text,t.textRgap=10,t.isNeedAdjustWidth=!1,t.logic={dynamic:!0},t.father=n,a.fatherValueMap[a._createChildValue(n,i)]=n,a.childValueMap[a._createChildValue(n,i)]=i,t.value=a._createChildValue(n,i),r.el.childValues.push(t.value)})):(r.type="bi.down_list_item",r.title=r.title||r.text,r.textRgap=10,r.isNeedAdjustWidth=!1,r.logic={dynamic:!0});var t={};t.el=r,i.items.push(t)}),a._isGroup(i.items)&&BI.each(i.items,function(e,t){a.singleValues.push(t.el.value)}),o.push(i),a._needSpliter(e,r.length)&&(n=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-split-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10,rgap:0}),o.push(n))}),o},_isGroup:function(e){return 1<e.length},_needSpliter:function(e,t){return e<t-1},_createChildValue:function(e,t){return e+"_"+t},_digest:function(e){var i=this,r=[];return BI.each(e,function(e,t){var n=BI.isNotNull(t.childValue)?i._createChildValue(t.value,t.childValue):t.value;r.push(n)}),r},_checkValues:function(l){var u=[];return BI.each(this.items,function(s,e){BI.each(e,function(e,t){var n,i,r,a,o;BI.isNotNull(t.children)?(n=BI.map(t.children,"value"),r=n,a=l[s],o="",BI.some(r,function(e,n){return BI.some(a,function(e,t){if(n===t)return o=n,!0})}),i=o,BI.isNotEmptyString(i)&&u.push(i)):t.value===l[s][0]&&u.push(l[s][0])})}),u},populate:function(e){BI.DownListPopup.superclass.populate.apply(this,arguments),this.items=BI.deepClone(e),this.childValueMap={},this.fatherValueMap={},this.singleValues=[];var t=this._createChildren(this.items),n=BI.createItems(t,{},{adjustLength:-2});this.popup.populate(n)},setValue:function(e){this.popup.setValue(this._digest(e))},_getValue:function(){var n=[];return BI.each(this.popup.getAllButtons(),function(e,t){e%2==0&&n.push(t.getValue())}),n},getValue:function(){var r=this,a=[],e=this._checkValues(this._getValue());return BI.each(e,function(e,t){var n,i={};BI.isNotNull(r.childValueMap[t])?(n=r.fatherValueMap[t],i.childValue=r.childValueMap[t],i.value=n):i.value=t,a.push(i)}),a}}),BI.DownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.DownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.down_list_popup",BI.DownListPopup)},function(e,t){BI.DynamicDateHelper={},BI.extend(BI.DynamicDateHelper,{getCalculation:function(e){var t=BI.getDate();return this.getCalculationByDate(t,e)},getCalculationByDate:function(e,t){if(BI.isNotNull(t.year)&&(e=BI.getDate(e.getFullYear()+BI.parseInt(t.year),e.getMonth(),e.getDate())),BI.isNotNull(t.quarter)&&(e=BI.getOffsetQuarter(e,BI.parseInt(t.quarter))),BI.isNotNull(t.month)&&(e=BI.getOffsetMonth(e,BI.parseInt(t.month))),BI.isNotNull(t.week)&&(e=BI.getOffsetDate(e,7*BI.parseInt(t.week))),BI.isNotNull(t.day)&&(e=BI.getOffsetDate(e,BI.parseInt(t.day))),BI.isNotNull(t.workDay))if(BI.isNotNull(BI.holidays))for(var n=Math.abs(t.workDay),i=0;i<n;i++)e=BI.getOffsetDate(e,t.workDay<0?-1:1),BI.isNotNull(BI.holidays[BI.print(e,"%Y-%X-%d")])&&i--;else e=BI.getOffsetDate(e,BI.parseInt(t.workDay));return BI.isNotNull(t.position)&&t.position!==BI.DynamicDateCard.OFFSET.CURRENT&&(e=this.getBeginDate(e,t)),BI.getDate(e.getFullYear(),e.getMonth(),e.getDate())},getBeginDate:function(e,t){return BI.isNotNull(t.day)?t.position===BI.DynamicDateCard.OFFSET.BEGIN?BI.getDate(e.getFullYear(),e.getMonth(),1):BI.getDate(e.getFullYear(),e.getMonth(),BI.getLastDateOfMonth(e).getDate()):BI.isNotNull(t.week)?t.position===BI.DynamicDateCard.OFFSET.BEGIN?BI.getWeekStartDate(e):BI.getWeekEndDate(e):BI.isNotNull(t.month)?t.position===BI.DynamicDateCard.OFFSET.BEGIN?BI.getDate(e.getFullYear(),e.getMonth(),1):BI.getDate(e.getFullYear(),e.getMonth(),BI.getLastDateOfMonth(e).getDate()):BI.isNotNull(t.quarter)?t.position===BI.DynamicDateCard.OFFSET.BEGIN?BI.getQuarterStartDate(e):BI.getQuarterEndDate(e):BI.isNotNull(t.year)?t.position===BI.DynamicDateCard.OFFSET.BEGIN?BI.getDate(e.getFullYear(),0,1):BI.getDate(e.getFullYear(),11,31):e}})},function(e,t){BI.DynamicDateCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-card"},render:function(){var e=this;return this.position=BI.DynamicDateCard.OFFSET.CURRENT,{type:"bi.vertical",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:12,lgap:10},tgap:10,bgap:5},{type:"bi.button_group",ref:function(){e.checkgroup=this},chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,lgap:4,value:[BI.DynamicDateCard.TYPE.YEAR],items:BI.createItems([{text:BI.i18nText("BI-Basic_Year"),value:BI.DynamicDateCard.TYPE.YEAR},{text:BI.i18nText("BI-Basic_Single_Quarter"),value:BI.DynamicDateCard.TYPE.QUARTER},{text:BI.i18nText("BI-Basic_Month"),value:BI.DynamicDateCard.TYPE.MONTH},{text:BI.i18nText("BI-Basic_Week"),value:BI.DynamicDateCard.TYPE.WEEK},{text:BI.i18nText("BI-Basic_Day"),value:BI.DynamicDateCard.TYPE.DAY}],{type:"bi.multi_select_item",logic:{dynamic:!0}}),layouts:[{type:"bi.left",rgap:4}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){0!==e.checkgroup.getValue().length&&e.workDayBox.setSelected(!1);var i={};BI.each(e.resultPane.getAllButtons(),function(e,t){var n=t.getValue();BI.isNotNull(n.dateType)&&(i[n.dateType]={value:n.value,offset:n.offset})}),e.resultPane.populate(e._getParamJson(BI.map(e.checkgroup.getValue(),function(e,t){var n={dateType:t};return BI.has(i,t)&&(n.value=i[t].value,n.offset=i[t].offset),n}))),e.position=BI.DynamicDateCard.OFFSET.CURRENT,e.fireEvent("EVENT_CHANGE")}}]},{type:"bi.vertical_adapt",lgap:2,items:[{el:{type:"bi.multi_select_item",ref:function(){e.workDayBox=this},logic:{dynamic:!0},text:BI.i18nText("BI-Basic_Work_Day"),value:BI.DynamicDateCard.TYPE.WORK_DAY,listeners:[{eventName:BI.MultiSelectItem.EVENT_CHANGE,action:function(){this.isSelected()&&e.checkgroup.setValue(),e.resultPane.populate(this.isSelected()?e._getParamJson([{dateType:BI.DynamicDateCard.TYPE.WORK_DAY}]):[]),e.position=BI.DynamicDateCard.OFFSET.CURRENT,e.fireEvent("EVENT_CHANGE")}}]}}],ref:function(){e.workDay=this}},{type:"bi.button_group",items:this._getParamJson([{dateType:BI.DynamicDateCard.TYPE.YEAR}]),ref:function(){e.resultPane=this},layouts:[{type:"bi.vertical",bgap:10,hgap:10}]}]}},_getParamJson:function(e,t){var n,i=this,r=BI.map(e,function(e,t){return{el:{type:"bi.dynamic_date_param_item",dateType:t.dateType,value:t.value,offset:t.offset,listeners:[{eventName:"EVENT_CHANGE",action:function(){i.fireEvent("EVENT_CHANGE")}}]},tgap:0===e?5:0}});return 1===e.length&&e[0].dateType===BI.DynamicDateCard.TYPE.DAY?((n=this._getText(BI.DynamicDateCard.TYPE.MONTH))[0].text=BI.i18nText("BI-Basic_Empty"),r.push({type:"bi.text_value_combo",height:24,items:n,container:null,value:t||BI.DynamicDateCard.OFFSET.CURRENT,listeners:[{eventName:"EVENT_CHANGE",action:function(){i.position=this.getValue()[0],i.fireEvent("EVENT_CHANGE")}}]})):0!==e.length&&BI.last(e).dateType!==BI.DynamicDateCard.TYPE.DAY&&BI.last(e).dateType!==BI.DynamicDateCard.TYPE.WORK_DAY&&r.push({type:"bi.text_value_combo",height:24,container:null,items:this._getText(BI.last(e).dateType),value:t||BI.DynamicDateCard.OFFSET.CURRENT,listeners:[{eventName:"EVENT_CHANGE",action:function(){i.position=this.getValue()[0],i.fireEvent("EVENT_CHANGE")}}]}),r},_getText:function(e){switch(e){case BI.DynamicDateCard.TYPE.YEAR:return[{text:BI.i18nText("BI-Basic_Current_Day"),value:BI.DynamicDateCard.OFFSET.CURRENT},{text:BI.i18nText("BI-Basic_Year_Begin"),value:BI.DynamicDateCard.OFFSET.BEGIN},{text:BI.i18nText("BI-Basic_Year_End"),value:BI.DynamicDateCard.OFFSET.END}];case BI.DynamicDateCard.TYPE.QUARTER:return[{text:BI.i18nText("BI-Basic_Current_Day"),value:BI.DynamicDateCard.OFFSET.CURRENT},{text:BI.i18nText("BI-Basic_Quarter_Begin"),value:BI.DynamicDateCard.OFFSET.BEGIN},{text:BI.i18nText("BI-Basic_Quarter_End"),value:BI.DynamicDateCard.OFFSET.END}];case BI.DynamicDateCard.TYPE.MONTH:return[{text:BI.i18nText("BI-Basic_Current_Day"),value:BI.DynamicDateCard.OFFSET.CURRENT},{text:BI.i18nText("BI-Basic_Month_Begin"),value:BI.DynamicDateCard.OFFSET.BEGIN},{text:BI.i18nText("BI-Basic_Month_End"),value:BI.DynamicDateCard.OFFSET.END}];case BI.DynamicDateCard.TYPE.WEEK:default:return[{text:BI.i18nText("BI-Basic_Current_Day"),value:BI.DynamicDateCard.OFFSET.CURRENT},{text:BI.i18nText("BI-Basic_Week_Begin"),value:BI.DynamicDateCard.OFFSET.BEGIN},{text:BI.i18nText("BI-Basic_Week_End"),value:BI.DynamicDateCard.OFFSET.END}]}},_createValue:function(e,t){return{dateType:e,value:Math.abs(t),offset:0<t?1:0}},setValue:function(e){e=e||{},this.position=e.position||BI.DynamicDateCard.OFFSET.CURRENT;var t=[],n=[];BI.isNotNull(e.year)&&(t.push(BI.DynamicDateCard.TYPE.YEAR),n.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,e.year))),BI.isNotNull(e.quarter)&&(t.push(BI.DynamicDateCard.TYPE.QUARTER),n.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,e.quarter))),BI.isNotNull(e.month)&&(t.push(BI.DynamicDateCard.TYPE.MONTH),n.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,e.month))),BI.isNotNull(e.week)&&(t.push(BI.DynamicDateCard.TYPE.WEEK),n.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,e.week))),BI.isNotNull(e.day)&&(t.push(BI.DynamicDateCard.TYPE.DAY),n.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,e.day))),BI.isNotNull(e.workDay)&&(t.push(BI.DynamicDateCard.TYPE.WORK_DAY),n.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,e.workDay))),this.checkgroup.setValue(t),this.workDayBox.setSelected(BI.isNotNull(e.workDay)),this.resultPane.populate(this._getParamJson(n,e.position))},getValue:function(){var e,i=this,r={},t=this.checkgroup.getValue(),n=this.resultPane.getAllButtons();return 0!==t.length&&BI.each(n,function(e,t){var n=t.getValue();switch(n.dateType){case BI.DynamicDateCard.TYPE.YEAR:r.year=0===n.offset?-n.value:n.value;break;case BI.DynamicDateCard.TYPE.QUARTER:r.quarter=0===n.offset?-n.value:n.value;break;case BI.DynamicDateCard.TYPE.MONTH:r.month=0===n.offset?-n.value:n.value;break;case BI.DynamicDateCard.TYPE.WEEK:r.week=0===n.offset?-n.value:n.value;break;case BI.DynamicDateCard.TYPE.DAY:r.day=0===n.offset?-n.value:n.value}BI.isNull(n.dateType)&&(r.position=i.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()&&(e=n[0].getValue(),r.workDay=0===e.offset?-e.value:e.value),r}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}})},function(e,t){BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var n=this,e=this.options;this.storeTriggerValue="";var t=BI.getDate();return this.storeValue=e.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:e.height,height:e.height,ref:function(){n.changeIcon=this}},width:e.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:e.container,ref:function(){n.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,destroyWhenHide:!0,el:{type:"bi.dynamic_date_trigger",min:e.minDate,max:e.maxDate,format:e.format,allowEdit:e.allowEdit,watermark:e.watermark,height:e.height,value:e.value,ref:function(){n.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){n.combo.isViewVisible()&&n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){n.combo.isViewVisible()||n.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){n.storeTriggerValue=n.trigger.getKey(),n.combo.isViewVisible()||n.combo.showView(),n.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_BLUR,action:function(){n.fireEvent(BI.DynamicDateCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){n.storeValue={type:BI.DynamicDateCombo.Static,value:{year:t.getFullYear(),month:t.getMonth()+1}},n.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){n.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){n.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){var e,t;n.combo.isViewVisible()||(e=n.storeTriggerValue,t=n.trigger.getKey(),BI.isNotEmptyString(t)&&!BI.isEqual(t,e)?(n.storeValue=n.trigger.getValue(),n.setValue(n.trigger.getValue())):BI.isEmptyString(t)&&(n.storeValue=null,n.trigger.setValue()),n._checkDynamicValue(n.storeValue),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM))}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",behaviors:e.behaviors,min:e.minDate,max:e.maxDate,ref:function(){n.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){n.setValue(),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var e=BI.getDate();n.setValue({type:BI.DynamicDateCombo.Static,value:{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var e=n.popup.getValue();n._checkValue(e)&&n.setValue(e),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},hideChecker:function(e){return 0===n.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){n.popup.setValue(n.storeValue),n.popup.setMinDate(e.minDate),n.popup.setMaxDate(e.maxDate),n.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:e.height,height:e.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){n.combo.isViewVisible()||n.combo.showView()}}],ref:function(){n.triggerBtn=this}},top:0,right:0}]}],ref:function(e){n.comboWrapper=e}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(e){var t=this.options,n=null;switch(BI.isNotNull(e)&&(n=e.type),n){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=t.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(e){switch(e.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(e.value);case BI.DynamicDateCombo.Static:default:return!0}},_defaultState:function(){},setMinDate:function(e){this.options.minDate=e,this.trigger.setMinDate(e),this.popup&&this.popup.setMinDate(e)},setMaxDate:function(e){this.options.maxDate=e,this.trigger.setMaxDate(e),this.popup&&this.popup.setMaxDate(e)},setValue:function(e){this.storeValue=e,this.trigger.setValue(e),this._checkDynamicValue(e)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2})},function(e,t){BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var e=this,t=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(e){return BI.isNaturalNumber(e)},value:t.value,ref:function(){e.editor=this},errorText:function(e){return BI.isEmptyString(e)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Natural_Number")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){e.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:t.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){e.offsetCombo=this},container:null,value:t.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var e="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:e=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:e=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:e=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:e=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:e=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:e=BI.i18nText("BI-Basic_Work_Day")}return e},setValue:function(e){(e=e||{}).value=e.value||0,e.offset=e.offset||0,this.editor.setValue(e.value),this.offsetCombo.setValue(e.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem)},function(e,t){BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var e=this,t=this.options,n=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),textHeight:n.buttonHeight-1,listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,textHeight:n.buttonHeight-1,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){e.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:n.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(t.value)},_getTabJson:function(){var t=this,n=this.options;return{type:"bi.tab",ref:function(){t.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(e){switch(e){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){t._setInnerValue(t.year,e)}}],ref:function(){t.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",behaviors:n.behaviors,min:t.options.min,max:t.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){t.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){t.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){switch(t.dateTab.getSelect()){case BI.DynamicDateCombo.Static:var e=BI.DynamicDateHelper.getCalculation(t.dynamicPane.getValue());t.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),t._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:t.storeValue&&t.storeValue.type===BI.DynamicDateCombo.Dynamic?t.dynamicPane.setValue(t.storeValue.value):t.dynamicPane.setValue({year:0}),t._setInnerValue()}}}]}},_setInnerValue:function(){var e;this.dateTab.getSelect()===BI.DynamicDateCombo.Static?(this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0)):(e=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()),e=BI.print(e,"%Y-%X-%d"),this.textButton.setValue(e),this.textButton.setEnable(!1))},_checkValueValid:function(e){return BI.isNull(e)||BI.isEmptyObject(e)||BI.isEmptyString(e)},setMinDate:function(e){this.options.min!==e&&(this.options.min=e,this.ymd.setMinDate(e))},setMaxDate:function(e){this.options.max!==e&&(this.options.max=e,this.ymd.setMaxDate(e))},setValue:function(e){this.storeValue=e;var t,n=(e=e||{}).type||BI.DynamicDateCombo.Static,i=e.value||e;switch(this.dateTab.setSelect(n),n){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(i),this._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this._checkValueValid(i)?(t=BI.getDate(),this.ymd.setValue({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()})):this.ymd.setValue(i),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup)},function(e,t){BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d"},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var i=this,r=this.options,e=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:r.height,validationChecker:function(e){var t=i._getStandardDateStr(e),n=t.match(/\d+/g);return BI.isKey(r.format)||i._autoAppend(e,n),i._dateCheck(t)&&BI.checkDateLegal(t)&&i._checkVoid({year:0|n[0],month:0|n[1],day:0|n[2]})},quitChecker:function(){return!1},hgap:e.hgap,vgap:e.vgap,allowBlank:!0,watermark:BI.isKey(r.watermark)?r.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var e="";return BI.isKey(r.format)||(e=i.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),e},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){i.storeTriggerValue=i.getKey(),i.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var e,t=i.editor.getValue();BI.isNotNull(t)&&i.editor.setState(t),BI.isNotEmptyString(t)&&!BI.isEqual(i.storeTriggerValue,i.getKey())&&(e=i._getStandardDateStr(t).match(/\d+/g),i.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|e[0],month:0|e[1],day:0|e[2]}}),i.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){i.editor.isValid()&&i.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){i.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),r.allowEdit||BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(r.value)},_getTitle:function(){var e=this.storeValue||{},t=e.type||BI.DynamicDateCombo.Static,n=e.value;switch(t){case BI.DynamicDateCombo.Dynamic:var i=this._getText(n),r=BI.getDate(),r=BI.DynamicDateHelper.getCalculation(n),a=BI.print(r,this._getFormatString());return BI.isEmptyString(i)?a:i+":"+a;case BI.DynamicDateCombo.Static:default:return BI.isNull(n)||BI.isNull(n.day)?"":BI.print(BI.getDate(n.year,n.month-1,n.day),this._getFormatString())}},_getStandardDateStr:function(e){var t=this._const,n=[0,1,2],i=this._getFormatString().match(/%./g);BI.each(i,function(e,t){switch(t){case"%Y":case"%y":n[0]=e;break;case"%X":case"%x":n[1]=e;break;case"%d":case"%e":default:n[2]=e}});var r=BI.parseDateTime(e,this._getFormatString());BI.print(r,this._getFormatString())===e&&(e=BI.print(r,t.compareFormat),n=[0,1,2]);var a=e.match(/\d+/g),o=[];return BI.each(a,function(e){o[e]=a[n[e]]}),o.length===n.length&&2===o[0].length?BI.print(BI.parseDateTime(o.join("-"),t.compareFormat),t.compareFormat):o.join("-")},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(e){return BI.print(BI.parseDateTime(e,"%Y-%x-%d"),"%Y-%x-%d")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d")===e||BI.print(BI.parseDateTime(e,"%Y-%x-%e"),"%Y-%x-%e")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%e"),"%Y-%X-%e")===e},_checkVoid:function(e){return!BI.checkDateVoid(e.year,e.month,e.day,this.options.min,this.options.max)[0]},_autoAppend:function(e,t){if(BI.isNotNull(t)&&BI.checkDateLegal(e))switch(e.length){case this._const.yearLength:this._yearCheck(e)&&this.editor.setValue(e+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var n=e.split("-")[1];(BI.isNotNull(n)&&2===n.length||this._monthCheck(e))&&this.editor.setValue(e+"-")}},_yearCheck:function(e){var t=BI.print(BI.parseDateTime(e,this._getFormatString()),this._const.compareFormat);return BI.print(BI.parseDateTime(e,"%Y"),"%Y")===e&&t>=this.options.min&&t<=this.options.max},_monthCheck:function(e){var t=BI.parseDateTime(e,this._getFormatString()),n=BI.print(t,this._const.compareFormat);return 0<=t.getMonth()&&(BI.print(BI.parseDateTime(e,"%Y-%X"),"%Y-%X")===e||BI.print(BI.parseDateTime(e,"%Y-%x"),"%Y-%x")===e)&&n>=this.options.min&&n<=this.options.max},_setInnerValue:function(e){var t=BI.print(e,this._getFormatString());this.editor.setState(t),this.editor.setValue(t)},_getText:function(e){var t="",n="";return BI.isNotNull(e.year)&&(0!==BI.parseInt(e.year)&&(t+=Math.abs(e.year)+BI.i18nText("BI-Basic_Year")+(e.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Year"),e.position)),BI.isNotNull(e.quarter)&&(0!==BI.parseInt(e.quarter)&&(t+=Math.abs(e.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(e.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Single_Quarter"),e.position)),BI.isNotNull(e.month)&&(0!==BI.parseInt(e.month)&&(t+=Math.abs(e.month)+BI.i18nText("BI-Basic_Month")+(e.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Month"),e.position)),BI.isNotNull(e.week)&&(0!==BI.parseInt(e.week)&&(t+=Math.abs(e.week)+BI.i18nText("BI-Basic_Week")+(e.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Week"),e.position)),BI.isNotNull(e.day)&&(0!==BI.parseInt(e.day)&&(t+=Math.abs(e.day)+BI.i18nText("BI-Basic_Day")+(e.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=1===BI.size(e)?i(BI.i18nText("BI-Basic_Month"),e.position):""),BI.isNotNull(e.workDay)&&0!==BI.parseInt(e.workDay)&&(t+=Math.abs(e.workDay)+BI.i18nText("BI-Basic_Work_Day")+(e.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),t+n;function i(e,t){switch(t){case BI.DynamicDateCard.OFFSET.BEGIN:return e+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return e+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}},setValue:function(e){var t,n,i,r=BI.getDate();switch(this.storeValue=e,BI.isNotNull(e)&&(t=e.type||BI.DynamicDateCombo.Static,n=e.value||e),t){case BI.DynamicDateCombo.Dynamic:var a=this._getText(n),r=BI.DynamicDateHelper.getCalculation(n);this._setInnerValue(r,a);break;case BI.DynamicDateCombo.Static:default:BI.isNull(n)||BI.isNull(n.day)?(this.editor.setState(""),this.editor.setValue("")):(i=BI.print(BI.getDate(n.year,n.month-1,n.day),this._getFormatString()),this.editor.setState(i),this.editor.setValue(i))}},setMinDate:function(e){BI.isNotEmptyString(this.options.min)&&(this.options.min=e)},setMaxDate:function(e){BI.isNotEmptyString(this.options.max)&&(this.options.max=e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger)},function(e,t){BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var n=this,e=this.options;this.storeTriggerValue="";var t=BI.getDate();return this.storeValue=e.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:e.height,height:e.height,ref:function(){n.changeIcon=this}},width:e.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",destroyWhenHide:!0,container:e.container,ref:function(){n.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:e.minDate,max:e.maxDate,allowEdit:e.allowEdit,watermark:e.watermark,format:e.format,height:e.height,value:e.value,ref:function(){n.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){n.combo.isViewVisible()&&n.combo.hideView(),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){n.combo.isViewVisible()||n.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){n.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){n.storeTriggerValue=n.trigger.getKey(),n.combo.isViewVisible()||n.combo.showView(),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_BLUR,action:function(){n.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){n.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:t.getFullYear(),month:t.getMonth()+1}},n.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){n.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){n.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){var e,t;n.combo.isViewVisible()||(e=n.storeTriggerValue,t=n.trigger.getKey(),BI.isNotEmptyString(t)&&!BI.isEqual(t,e)?(n.storeValue=n.trigger.getValue(),n.setValue(n.trigger.getValue())):BI.isEmptyString(t)&&(n.storeValue=null,n.trigger.setValue()),n._checkDynamicValue(n.storeValue),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM))}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",behaviors:e.behaviors,min:e.minDate,max:e.maxDate,ref:function(){n.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){n.setValue(),n.combo.hideView(),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var e=BI.getDate();n.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:0,minute:0,second:0}}),n.combo.hideView(),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var e=n.popup.getValue();n._checkValue(e)&&n.setValue(e),n.combo.hideView(),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.combo.hideView(),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){n.popup.setValue(n.storeValue),n.popup.setMinDate(e.minDate),n.popup.setMaxDate(e.maxDate),n.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===n.triggerBtn.element.find(e.target).length}},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:e.height,height:e.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){n.combo.isViewVisible()||n.combo.showView()}}],ref:function(){n.triggerBtn=this}},top:0,right:0}]}],ref:function(e){n.comboWrapper=e}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(e){var t=this.options,n=null;switch(BI.isNotNull(e)&&(n=e.type),n){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=t.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(e){switch(e.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(e.value);case BI.DynamicDateCombo.Static:default:return!0}},setMinDate:function(e){this.options.minDate=e,this.trigger.setMinDate(e),this.popup&&this.popup.setMinDate(e)},setMaxDate:function(e){this.options.maxDate=e,this.trigger.setMaxDate(e),this.popup&&this.popup.setMaxDate(e)},setValue:function(e){this.storeValue=e,this.trigger.setValue(e),this._checkDynamicValue(e)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2})},function(e,t){BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var e=this,t=this.options,n=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:n.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:n.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){e.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:n.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(t.value)},_getTabJson:function(){var t=this,n=this.options;return{type:"bi.tab",ref:function(){t.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(e){switch(e){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){t._setInnerValue(t.year,e)}}],ref:function(){t.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",behaviors:n.behaviors,min:t.options.min,max:t.options.max,ref:function(){t.ymd=this}},{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){t.timeSelect=this}},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){switch(t.dateTab.getSelect()){case BI.DynamicDateCombo.Static:var e=BI.DynamicDateHelper.getCalculation(t.dynamicPane.getValue());t.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),t.timeSelect.setValue(),t._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:t.storeValue&&t.storeValue.type===BI.DynamicDateCombo.Dynamic?t.dynamicPane.setValue(t.storeValue.value):t.dynamicPane.setValue({year:0}),t._setInnerValue()}}}]}},_setInnerValue:function(){var e;this.dateTab.getSelect()===BI.DynamicDateCombo.Static?(this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0)):(e=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()),e=BI.print(e,"%Y-%X-%d"),this.textButton.setValue(e),this.textButton.setEnable(!1))},_checkValueValid:function(e){return BI.isNull(e)||BI.isEmptyObject(e)||BI.isEmptyString(e)},setMinDate:function(e){this.options.min!==e&&(this.options.min=e,this.ymd.setMinDate(e))},setMaxDate:function(e){this.options.max!==e&&(this.options.max=e,this.ymd.setMaxDate(e))},setValue:function(e){this.storeValue=e;var t,n=(e=e||{}).type||BI.DynamicDateCombo.Static,i=e.value||e;switch(this.dateTab.setSelect(n),n){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(i),this._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this._checkValueValid(i)?(t=BI.getDate(),this.ymd.setValue({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}),this.timeSelect.setValue()):(this.ymd.setValue(i),this.timeSelect.setValue({hour:i.hour,minute:i.minute,second:i.second})),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0)}},getValue:function(){var e=this.dateTab.getSelect();return{type:e,value:e===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup)},function(e,t){BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select"},render:function(){var t=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){t.hour=this},validationChecker:function(e){return BI.isNaturalNumber(e)&&BI.parseInt(e)<24},errorText:function(e){return BI.isNumeric(e)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var e=this.getValue();t._checkHour(e),this.setValue(t._formatValueToDoubleDigit(e)),t.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var e=t._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(e)}}],width:60,height:24}},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){t.minute=this},validationChecker:function(e){return BI.isNaturalNumber(e)&&BI.parseInt(e)<60},errorText:function(e){return BI.isNumeric(e)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var e=this.getValue();t._checkMinute(e),this.setValue(t._formatValueToDoubleDigit(e),BI.DynamicDateTimeSelect.MINUTE),t.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var e=t._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(e)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){t.second=this},validationChecker:function(e){return BI.isNaturalNumber(e)&&BI.parseInt(e)<60},errorText:function(e){return BI.isNumeric(e)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var e=this.getValue();t._checkSecond(e),this.setValue(t._formatValueToDoubleDigit(e)),t.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(e){e=e||{},this._checkHour(e.hour),this._checkMinute(e.minute),this._checkSecond(e.second)},_checkHour:function(e){this.hour.setDownEnable(0<BI.parseInt(e)),this.hour.setUpEnable(BI.parseInt(e)<23)},_checkMinute:function(e){this.minute.setDownEnable(0<BI.parseInt(e)),this.minute.setUpEnable(BI.parseInt(e)<59)},_checkSecond:function(e){this.second.setDownEnable(0<BI.parseInt(e)),this.second.setUpEnable(BI.parseInt(e)<59)},_autoSwitch:function(e,t){var n=0,i=e+"";switch(t){case BI.DynamicDateTimeSelect.HOUR:n=2;break;case BI.DynamicDateTimeSelect.MINUTE:n=5}if(1===i.length&&BI.parseInt(i)>n&&(i="0"+i),2===i.length)switch(t){case BI.DynamicDateTimeSelect.HOUR:this.hour.isEditing()&&this.minute.focus();break;case BI.DynamicDateTimeSelect.MINUTE:this.minute.isEditing()&&this.second.focus();break;case BI.DynamicDateTimeSelect.SECOND:}return i},_formatValueToDoubleDigit:function(e){(BI.isNull(e)||BI.isEmptyString(e))&&(e=0);var t=BI.parseInt(e);return t<10&&(t="0"+t),t},_assertValue:function(e){return(e=e||{}).hour=this._formatValueToDoubleDigit(e.hour)||"00",e.minute=this._formatValueToDoubleDigit(e.minute)||"00",e.second=this._formatValueToDoubleDigit(e.second)||"00",e},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(e){e=this._assertValue(e),this.hour.setValue(e.hour),this.minute.setValue(e.minute),this.second.setValue(e.second),this._checkBorder(e)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2,SECOND:3})},function(e,t){BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d %H:%M:%S"},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var i=this,r=this.options,e=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:r.height,validationChecker:function(e){var t=i._getStandardDateStr(e),n=t.match(/\d+/g);return BI.isKey(r.format)||i._autoAppend(e,n),i._dateCheck(t)&&BI.checkDateLegal(t)&&i._checkVoid({year:0|n[0],month:0|n[1],day:0|n[2]})},quitChecker:function(){return!1},hgap:e.hgap,vgap:e.vgap,allowBlank:!0,watermark:BI.isKey(r.watermark)?r.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var e="";return BI.isKey(r.format)||(e=i.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),e},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){i.storeTriggerValue=i.getKey(),i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var e,t=i.editor.getValue();BI.isNotNull(t)&&i.editor.setState(t),BI.isNotEmptyString(t)&&!BI.isEqual(i.storeTriggerValue,i.getKey())&&(e=i._getStandardDateStr(t).match(/\d+/g),i.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|e[0],month:0|e[1],day:0|e[2],hour:0|e[3],minute:0|e[4],second:0|e[5]}}),i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){i.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),r.allowEdit||BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(r.value)},_getTitle:function(){var e=this.storeValue||{},t=e.type||BI.DynamicDateCombo.Static,n=e.value;switch(t){case BI.DynamicDateCombo.Dynamic:var i=this._getText(n),r=BI.DynamicDateHelper.getCalculation(n),a=BI.print(r,this._getFormatString());return BI.isEmptyString(i)?a:i+":"+a;case BI.DynamicDateCombo.Static:default:return BI.isNull(n)||BI.isNull(n.day)?"":BI.print(BI.getDate(n.year,n.month-1,n.day,n.hour||0,n.minute||0,n.second||0),this._getFormatString())}},_getStandardDateStr:function(e){var t=this._const,n=[],i=!1,r=this._getFormatString().match(/%./g);BI.each(r,function(e,t){switch(t){case"%Y":case"%y":n[0]=e;break;case"%X":case"%x":n[1]=e;break;case"%d":case"%e":n[2]=e;break;case"%S":i=!0}});var a=BI.parseDateTime(e,this._getFormatString());BI.print(a,this._getFormatString())===e&&(e=BI.print(a,t.compareFormat),n=[0,1,2]);var o=e.match(/\d+/g)||[],s=[];BI.each(o.slice(0,3),function(e){s[e]=o[n[e]]});var l=o.slice(3);BI.each(l,function(e,t){BI.isNumeric(t)&&1===t.length&&(l[e]="0"+t)}),2!==l.length||i||l.push("00");var u=l.join(":"),c=s.slice(0,3).join("-");return BI.isNotEmptyString(u)&&(c+=" "+u),c},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(e){return BI.print(BI.parseDateTime(e,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%x-%d"),"%Y-%x-%d")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d")===e||BI.print(BI.parseDateTime(e,"%Y-%x-%e"),"%Y-%x-%e")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%e"),"%Y-%X-%e")===e},_checkVoid:function(e){return!BI.checkDateVoid(e.year,e.month,e.day,this.options.min,this.options.max)[0]},_autoAppend:function(e,t){if(BI.isNotNull(t)&&BI.checkDateLegal(e))switch(e.length){case this._const.yearLength:this._yearCheck(e)&&this.editor.setValue(e+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var n=e.split("-")[1];(BI.isNotNull(n)&&2===n.length||this._monthCheck(e))&&this.editor.setValue(e+"-")}},_yearCheck:function(e){var t=BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(e,"%Y"),"%Y")===e&&t>=this.options.min&&t<=this.options.max},_monthCheck:function(e){var t=BI.parseDateTime(e,"%Y-%X-%d"),n=BI.print(t,"%Y-%X-%d");return 0<t.getMonth()&&(BI.print(BI.parseDateTime(e,"%Y-%X"),"%Y-%X")===e||BI.print(BI.parseDateTime(e,"%Y-%x"),"%Y-%x")===e)&&n>=this.options.min&&n<=this.options.max},_setInnerValue:function(e){var t=BI.print(e,this._getFormatString());this.editor.setState(t),this.editor.setValue(t)},_getText:function(e){var t="",n="";return BI.isNotNull(e.year)&&(0!==BI.parseInt(e.year)&&(t+=Math.abs(e.year)+BI.i18nText("BI-Basic_Year")+(e.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Year"),e.position)),BI.isNotNull(e.quarter)&&(0!==BI.parseInt(e.quarter)&&(t+=Math.abs(e.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(e.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Single_Quarter"),e.position)),BI.isNotNull(e.month)&&(0!==BI.parseInt(e.month)&&(t+=Math.abs(e.month)+BI.i18nText("BI-Basic_Month")+(e.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Month"),e.position)),BI.isNotNull(e.week)&&(0!==BI.parseInt(e.week)&&(t+=Math.abs(e.week)+BI.i18nText("BI-Basic_Week")+(e.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=i(BI.i18nText("BI-Basic_Week"),e.position)),BI.isNotNull(e.day)&&(0!==BI.parseInt(e.day)&&(t+=Math.abs(e.day)+BI.i18nText("BI-Basic_Day")+(e.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),n=1===BI.size(e)?i(BI.i18nText("BI-Basic_Month"),e.position):""),BI.isNotNull(e.workDay)&&0!==BI.parseInt(e.workDay)&&(t+=Math.abs(e.workDay)+BI.i18nText("BI-Basic_Work_Day")+(e.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),t+n;function i(e,t){switch(t){case BI.DynamicDateCard.OFFSET.BEGIN:return e+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return e+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}},setMinDate:function(e){BI.isNotEmptyString(this.options.min)&&(this.options.min=e)},setMaxDate:function(e){BI.isNotEmptyString(this.options.max)&&(this.options.max=e)},setValue:function(e){var t,n,i,r=BI.getDate();switch(this.storeValue=e,BI.isNotNull(e)&&(t=e.type||BI.DynamicDateCombo.Static,n=e.value||e),t){case BI.DynamicDateCombo.Dynamic:var a=this._getText(n),r=BI.DynamicDateHelper.getCalculation(n);this._setInnerValue(r,a);break;case BI.DynamicDateCombo.Static:default:BI.isNull(n)||BI.isNull(n.day)?(this.editor.setState(""),this.editor.setValue("")):(i=BI.print(BI.getDate(n.year,n.month-1,n.day,n.hour||0,n.minute||0,n.second||0),this._getFormatString()),this.editor.setState(i),this.editor.setValue(i))}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger)},function(e,t){BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-search-editor bi-border bi-focus-shadow",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;this.editor=BI.createWidget({type:"bi.editor",height:e.height,watermark:e.watermark,allowBlank:!0,hgap:1,errorText:e.errorText,validationChecker:e.validationChecker,quitChecker:e.quitChecker,value:e.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"close-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){t.setValue(""),t.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),t.fireEvent(BI.SearchEditor.EVENT_CHANGE),t.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.icon_label",cls:"search-font"},width:24},{el:t.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t._checkClear(),t.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,e)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){t.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){t.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t._checkClear(),t.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){t.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t.fireEvent(BI.SearchEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid())return this.editor.getValue()},getKeywords:function(){var e=this.editor.getLastChangedValue(),t=e.match(/[\S]+/g);return BI.isEndWithBlank(e)?t.concat([" "]):t},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(e){this.editor.setValue(e),BI.isKey(e)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor)},function(e,t){BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var e=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-small-search-editor",height:20})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor)},function(e,t){BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-text-editor bi-border bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var t=this,e=this.options;BI.isNumber(e.height)&&this.element.css({height:e.height-2}),BI.isNumber(e.width)&&this.element.css({width:e.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:e.height-2,hgap:e.hgap,vgap:e.vgap,lgap:e.lgap,rgap:e.rgap,tgap:e.tgap,bgap:e.bgap,value:e.value,title:e.title,tipType:e.tipType,validationChecker:e.validationChecker,quitChecker:e.quitChecker,allowBlank:e.allowBlank,watermark:e.watermark,errorText:e.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){t.fireEvent(BI.TextEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){t.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){t.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){t.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(e){t.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(e){t.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(e){t.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){t.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){t.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){t.fireEvent(BI.TextEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(e){t.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){t.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){t.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){t.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){t.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){t.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){t.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){t.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},setWaterMark:function(e){this.options.watermark=e,this.editor.setWaterMark(e)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(e){this.editor.setErrorText(e)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(e){this.editor.setValue(e)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor)},function(e,t){BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var e=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-small-text-editor",height:20})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor)},function(e,t){BI.IntervalSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var r=this,e=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:e.EDITOR_WIDTH,validationChecker:function(e){return r._checkValidation(e)}}),this.labelOne.element.hover(function(){r.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){r.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var e=r.valueOne,t=BI.parseFloat(this.getValue());r.valueOne=t;var n=r._getPercentByValue(t),i=BI.parseFloat(n.toFixed(1));r._setSliderOnePosition(i),r._setBlueTrack(),r._checkLabelPosition(e,r.valueTwo,r.valueOne,r.valueTwo),r.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:e.EDITOR_WIDTH,validationChecker:function(e){return r._checkValidation(e)}}),this.labelTwo.element.hover(function(){r.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){r.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var e=r.valueTwo,t=BI.parseFloat(this.getValue());r.valueTwo=t;var n=r._getPercentByValue(t),i=BI.parseFloat(n.toFixed(1));r._setSliderTwoPosition(i),r._setBlueTrack(),r._checkLabelPosition(r.valueOne,e,r.valueOne,r.valueTwo),r.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:e.TRACK_HEIGHT}]}],hgap:7,height:e.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(e,t){var n=this.options,i=100*e/this._getGrayTrackLength(),r=BI.parseFloat(i.toFixed(1)),a=this._getValueByPercent(r),a=this._assertValue(a);a=!1===n.digit?a:a.toFixed(n.digit);var o=this.valueOne,s=this.valueTwo;t?(this._setSliderOnePosition(r),this.labelOne.setValue(a),this.valueOne=a,this._checkLabelPosition(o,s,a,this.valueTwo)):(this._setSliderTwoPosition(r),this.labelTwo.setValue(a),this.valueTwo=a,this._checkLabelPosition(o,s,this.valueOne,a)),this._setBlueTrack()},_rePosBySizeAfterStop:function(e,t){var n=100*e/this._getGrayTrackLength(),i=BI.parseFloat(n.toFixed(1));t?this._setSliderOnePosition(i):this._setSliderTwoPosition(i)},_draggable:function(t,n){var i=this,r=(this.options,!1),a=0,o=0,s=0,l=new BI.MouseMoveTracker(function(e){l.isDragging()&&(r=!0,a=u(s+(o+=e)),t.element.addClass("dragging"),i._rePosBySizeAfterMove(a,n))},function(){!0===r&&(a=u(a),i._rePosBySizeAfterStop(a,n),o=a=0,s=a,r=!1),t.element.removeClass("dragging"),l.releaseMouseMoves(),i.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);function u(e){return BI.clamp(e,0,i._getGrayTrackLength())}t.element.on("mousedown",function(e){t.isEnabled()&&(u(s=this.offsetLeft),l.captureMouseMoves(e))})},_createLabelWrapper:function(){var e=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:e.EDITOR_R_GAP,height:e.SLIDER_HEIGHT},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var e=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%"}]}],hgap:e.SLIDER_WIDTH_HALF,height:e.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(e){var t=this.options,n=!1,i=(e+"").split(".")[1];return BI.isEmptyString(i)||BI.isNumeric(e)&&!(BI.isNull(e)||e<this.min||e>this.max)&&(n=!(!1!==t.digit&&!BI.isInteger(e))||(i||"").length===t.digit),n},_checkOverlap:function(){var e=this.labelOne.element[0].offsetLeft,t=this.labelTwo.element[0].offsetLeft;e<=t?t-e<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):e-t<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_checkLabelPosition:function(e,t,n,i,r){var a;e=BI.parseFloat(e),t=BI.parseFloat(t),n=BI.parseFloat(n),i=BI.parseFloat(i),(e<=t&&i<n||t<=e&&n<i)&&(a=BI.parseFloat(this.sliderOne.element[0].style.left)<BI.parseFloat(this.sliderTwo.element[0].style.left),this._resetLabelPosition(!a))},_resetLabelPosition:function(e){this.labelOne.element.css({left:e?"100%":"0%"}),this.labelTwo.element.css({left:e?"0%":"100%"})},_setSliderOnePosition:function(e){this.sliderOne.element.css({left:e+"%"})},_setSliderTwoPosition:function(e){this.sliderTwo.element.css({left:e+"%"})},_setBlueTrackLeft:function(e){this.blueTrack.element.css({left:e+"%"})},_setBlueTrackWidth:function(e){this.blueTrack.element.css({width:e+"%"})},_setBlueTrack:function(){var e=this._getPercentByValue(this.labelOne.getValue()),t=this._getPercentByValue(this.labelTwo.getValue());e<=t?(this._setBlueTrackLeft(e),this._setBlueTrackWidth(t-e)):(this._setBlueTrackLeft(t),this._setBlueTrackWidth(e-t))},_setAllPosition:function(e,t){this._setSliderOnePosition(e),this._setSliderTwoPosition(t),this._setBlueTrack()},_setVisible:function(e){this.sliderOne.setVisible(e),this.sliderTwo.setVisible(e),this.labelOne.setVisible(e),this.labelTwo.setVisible(e)},_setErrorText:function(){var e=BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max);this.labelOne.setErrorText(e),this.labelTwo.setErrorText(e)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(e){if(0===e)return this.min;if(100===e)return this.max;var t=this.calculation.accurateSubtraction(this.max,this.min),n=this.calculation.accurateMultiplication(t,e),i=this.calculation.accurateDivisionTenExponent(n,2);if(this.precision<0){var r=BI.parseFloat(this.calculation.accurateAddition(i,this.min)),a=Math.round(this.calculation.accurateDivisionTenExponent(r,-this.precision));return this.calculation.accurateMultiplication(a,Math.pow(10,-this.precision))}return BI.parseFloat(this.calculation.accurateAddition(i,this.min).toFixed(this.precision))},_getPercentByValue:function(e){return 100*(e-this.min)/(this.max-this.min)},_setDraggableEnable:function(e){this.sliderOne.setEnable(e),this.sliderTwo.setEnable(e)},_getPrecision:function(){var e=this.calculation.accurateSubtraction(this.max,this.min).toPrecision(4),t=[];if(-1<e.indexOf("e")){t=e.split("e");return BI.size(t[0].split(".")[1])-BI.parseInt(t[1].substring(1))}return 1<(t=e.split(".")).length?t[1].length:0},_assertValue:function(e){return e<=this.min?this.min:e>=this.max?this.max:e},_setEnable:function(e){BI.IntervalSlider.superclass._setEnable.apply(this,[e]),e?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(e){var t=BI.parseFloat(e.min),n=BI.parseFloat(e.max);!isNaN(t)&&!isNaN(n)&&t<=n&&(this.min=t,this.max=n,this.valueOne=t,this.valueTwo=n,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),n===t&&this._setDraggableEnable(!1)},setValue:function(e){var t=this.options,n=BI.parseFloat(e.min),i=BI.parseFloat(e.max),n=!1===t.digit?n:BI.parseFloat(n.toFixed(t.digit)),i=!1===t.digit?i:BI.parseFloat(i.toFixed(t.digit));isNaN(n)||isNaN(i)||(this._checkValidation(n)&&(this.valueOne=this.valueOne<=this.valueTwo?n:i),this._checkValidation(i)&&(this.valueTwo=this.valueOne<=this.valueTwo?i:n),n<this.min&&(this.valueOne=this.min),i>this.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){var e=this.options;isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(!1===e.digit?this.valueOne:BI.parseFloat(this.valueOne).toFixed(e.digit)),this.labelTwo.setValue(!1===e.digit?this.valueTwo:BI.parseFloat(this.valueTwo).toFixed(e.digit)),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)),this._resetLabelPosition(this.valueOne>this.valueTwo))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider)},function(e,t){BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(e){for(var t="1",n=0;n<e;n++)t+="0";return BI.parseInt(t)},_formatDecimal:function(e,t){if(e.numDecimalLength!==t.numDecimalLength){var n,i=e.numDecimalLength-t.numDecimalLength;0<i?n=t:(n=e,i=0-i);for(var r=0;r<i;r++)"0"===n.numDecimal&&0===r||(n.numDecimal+="0")}},_stringNumberFactory:function(e){var t,n,i=e.toString().split("."),r=i[0];return n=1===i.length?(t="0",0):(t=i[1],i[1].length),{numInteger:r,numDecimal:t,numDecimalLength:n}},_accurateSubtraction:function(e,t){var n=this._stringNumberFactory(e),i=this._stringNumberFactory(t),r=BI.parseInt(n.numInteger)-BI.parseInt(i.numInteger);this._formatDecimal(n,i);var a,o=function(e,t){if(e.numDecimal.length>=t.numDecimal.length)return e.numDecimal.length;return t.numDecimal.length}(n,i);a=BI.parseInt(n.numDecimal)>=BI.parseInt(i.numDecimal)?l((BI.parseInt(n.numDecimal)-BI.parseInt(i.numDecimal)).toString(),o):(r--,l((this._getMagnitude(o)+BI.parseInt(n.numDecimal)-BI.parseInt(i.numDecimal)).toString(),o));var s=r+"."+a;return BI.parseFloat(s);function l(e,t){for(var n=t-e.length,i=0;i<n;i++)e="0"+e;return e}},_accurateAddition:function(e,t){var n=this._stringNumberFactory(e),i=this._stringNumberFactory(t),r=BI.parseInt(n.numInteger)+BI.parseInt(i.numInteger);this._formatDecimal(n,i);var a=(BI.parseInt(n.numDecimal)+BI.parseInt(i.numDecimal)).toString();"0"!==a&&(a=a.length<=n.numDecimal.length?function(e,t){for(var n=t-e.length,i=0;i<n;i++)e="0"+e;return e}(a,n.numDecimal.length):(r++,a.slice(1)));var o=r+"."+a;return BI.parseFloat(o)},_accurateMultiplication:function(e,t){var n=this._stringNumberFactory(e),i=this._stringNumberFactory(t),r=BI.parseInt(n.numInteger)*BI.parseInt(i.numInteger),a=this._accurateDivisionTenExponent(BI.parseInt(n.numDecimal)*BI.parseInt(i.numInteger),n.numDecimalLength),o=this._accurateDivisionTenExponent(BI.parseInt(n.numInteger)*BI.parseInt(i.numDecimal),i.numDecimalLength),s=this._accurateDivisionTenExponent(BI.parseInt(n.numDecimal)*BI.parseInt(i.numDecimal),n.numDecimalLength+i.numDecimalLength);return this._accurateAddition(this._accurateAddition(this._accurateAddition(r,a),o),s)},_accurateDivisionTenExponent:function(e,t){var n,i,r=this._stringNumberFactory(e);i=r.numInteger.length>t?(n=r.numInteger.slice(0,r.numInteger.length-t),r.numInteger.slice(-t)):(n="0",function(e,t){for(var n=t-e.length,i=0;i<n;i++)e="0"+e;return e}(r.numInteger,t));var a=n+"."+i+r.numDecimal;return BI.parseFloat(a)},accurateSubtraction:function(e,t){return 0<=e&&0<=t?t<=e?this._accurateSubtraction(e,t):-this._accurateSubtraction(t,e):0<=e&&t<0?this._accurateAddition(e,-t):e<0&&0<=t?-this._accurateAddition(-e,t):e<0&&t<0?t<=e?this._accurateSubtraction(-t,-e):this._accurateSubtraction(-e,-t):void 0},accurateAddition:function(e,t){return 0<=e&&0<=t?this._accurateAddition(e,t):0<=e&&t<0?this.accurateSubtraction(e,-t):e<0&&0<=t?this.accurateSubtraction(t,-e):e<0&&t<0?-this._accurateAddition(-e,-t):void 0},accurateMultiplication:function(e,t){return 0<=e&&0<=t?this._accurateMultiplication(e,t):0<=e&&t<0?-this._accurateMultiplication(e,-t):e<0&&0<=t?-this._accurateMultiplication(-e,t):e<0&&t<0?this._accurateMultiplication(-e,-t):void 0},accurateDivisionTenExponent:function(e,t){return 0<=e?this._accurateDivisionTenExponent(e,t):-this._accurateDivisionTenExponent(-e,t)}})},function(e,t){BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var n=this,e=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:e.items,chooseType:e.chooseType,value:e.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(e){n.fireEvent(BI.DownListCombo.EVENT_CHANGE,e),n.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(e,t){n.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,e,t),n.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:e.trigger,isNeedAdjustWidth:!1,container:e.container,adjustLength:e.adjustLength,direction:e.direction,stopPropagation:e.stopPropagation,el:BI.createWidget(e.el,{type:"bi.icon_trigger",extraCls:e.iconCls?e.iconCls:"pull-down-font",width:e.width,height:e.height}),popup:{el:this.popupview,stopPropagation:e.stopPropagation,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){n.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(e){this.popupview.populate(e)},setValue:function(e){this.popupview.setValue(e)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo)},function(e,t){BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var e=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var s=this,e=this.options,t=this._createPopupItems(e.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(t,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(e.value),chooseType:e.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(e,t){var n,i,r,a,o=e;BI.isNotNull(s.childValueMap[e])?(o=s.childValueMap[e],i=((n=s.fatherValueMap[e])+"").split("_"),s.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,o,1<i.length?i:n)):s.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,o,t),BI.contains(s.singleValues,o)||(r=s.getValue(),a=[],BI.each(r,function(e,t){t.value!=o&&a.push(t)}),s.setValue(a))}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createPopupItems:function(r){var a=this,o=[];return BI.each(r,function(e,t){var n,i={type:"bi.down_list_group",items:[]};BI.each(t,function(e,r){BI.isNotEmptyArray(r.children)&&!BI.isEmpty(r.el)?(r.type="bi.combo_group",r.cls="down-list-group",r.trigger="hover",r.isNeedAdjustWidth=!1,r.el.title=r.el.title||r.el.text,r.el.type="bi.down_list_group_item",r.el.logic={dynamic:!0},r.el.height=a.constants.height,r.el.iconCls2=a.constants.nextIcon,r.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5},r.el.childValues=[],BI.each(r.children,function(e,t){t=t.el?BI.extend(t.el,{children:t.children}):t;var n=BI.deepClone(r.el.value),i=BI.deepClone(t.value);a.singleValues.push(t.value),t.type="bi.down_list_item",t.extraCls=" child-down-list-item",t.title=t.title||t.text,t.textRgap=10,t.isNeedAdjustWidth=!1,t.logic={dynamic:!0},t.father=n,a.fatherValueMap[a._createChildValue(n,i)]=n,a.childValueMap[a._createChildValue(n,i)]=i,t.value=a._createChildValue(n,i),r.el.childValues.push(t.value),BI.isNotEmptyArray(t.children)&&(t.type="bi.down_list_group_item",a._createChildren(t),t.height=a.constants.height,t.iconCls2=a.constants.nextIcon,r.el.childValues=BI.concat(r.el.childValues,t.childValues))})):(r.type="bi.down_list_item",r.title=r.title||r.text,r.textRgap=10,r.isNeedAdjustWidth=!1,r.logic={dynamic:!0});var t={};t.el=r,i.items.push(t)}),a._isGroup(i.items)&&BI.each(i.items,function(e,t){a.singleValues.push(t.el.value)}),o.push(i),a._needSpliter(e,r.length)&&(n=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10}),o.push(n))}),o},_createChildren:function(r){var a=this;r.childValues=[],BI.each(r.children,function(e,t){var n=BI.deepClone(r.value),i=BI.deepClone(t.value);t.type="bi.down_list_item",t.title=t.title||t.text,t.textRgap=10,t.isNeedAdjustWidth=!1,t.logic={dynamic:!0},t.father=n,a.fatherValueMap[a._createChildValue(n,i)]=n,a.childValueMap[a._createChildValue(n,i)]=i,t.value=a._createChildValue(n,i),r.childValues.push(t.value)})},_isGroup:function(e){return 1<e.length},_needSpliter:function(e,t){return e<t-1},_createChildValue:function(e,t){var n=e;return BI.isArray(e)&&(n=e.join("_")),n+"_"+t},_digest:function(e){var i=this,r=[];return BI.each(e,function(e,t){var n=BI.isNotNull(t.childValue)?i._createChildValue(t.value,t.childValue):t.value;r.push(n)}),r},_checkValues:function(u){var e=this.options,c=[];return BI.each(e.items,function(l,e){BI.each(e,function(e,t){var n,i,r,a,o;BI.isNotNull(t.children)?(n=function s(e){var n=[];BI.isNotNull(e.children)?BI.each(e.children,function(e,t){n=BI.concat(n,s(t))}):n.push(e.value);return n}(t),r=n,a=u[l],o="",BI.some(r,function(e,n){return BI.some(a,function(e,t){if(n===t)return o=n,!0})}),i=o,BI.isNotEmptyString(i)&&c.push(i)):t.value===u[l][0]&&c.push(u[l][0])})}),c},populate:function(e){BI.MultiLayerDownListPopup.superclass.populate.apply(this,arguments);this.childValueMap={},this.fatherValueMap={},this.singleValues=[];var t=this._createPopupItems(e),n=BI.createItems(t,{},{adjustLength:-2});this.popup.populate(n)},setValue:function(e){this.popup.setValue(this._digest(e))},_getValue:function(){var n=[];return BI.each(this.popup.getAllButtons(),function(e,t){e%2==0&&n.push(t.getValue())}),n},getValue:function(){var a=this,o=[],e=this._checkValues(this._getValue());return BI.each(e,function(e,t){var n,i,r={};BI.isNotNull(a.childValueMap[t])?(n=a.fatherValueMap[t],r.childValue=a.childValueMap[t],i=(n+"").split("_"),r.value=1<i.length?i:n):r.value=t,o.push(r)}),o}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup)},function(e,t){BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1,isNeedAdjustWidth:!0})},render:function(){var t=this,e=this.options,n=e.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return e.allowEdit||e.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:n,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(e){t.triggerBtn=e},width:e.height,height:e.height,handler:function(){t.combo.isViewVisible()?t.combo.hideView():t.combo.showView()}},right:0,bottom:0,top:0}]}:n},_getBaseConfig:function(){var t=this,e=this.options;return{type:"bi.combo",container:e.container,destroyWhenHide:e.destroyWhenHide,adjustLength:2,ref:function(e){t.combo=e},popup:{el:{type:"bi.multilayer_select_tree_popup",isDefaultInit:e.isDefaultInit,itemsCreator:e.itemsCreator,items:e.items,ref:function(e){t.trigger&&t.trigger.getSearcher().setAdapter(e)},listeners:[{eventName:BI.MultiLayerSelectTreePopup.EVENT_CHANGE,action:function(){t.setValue(this.getValue()),t.combo.hideView(),t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}}],onLoaded:function(){BI.nextTick(function(){t.combo.adjustWidth(),t.combo.adjustHeight()})}},value:e.value,maxHeight:400,maxWidth:e.isNeedAdjustWidth?"auto":500,minHeight:240},isNeedAdjustWidth:e.isNeedAdjustWidth,listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW)}}]}},_getSearchConfig:function(){var t=this,n=this.options;return{el:{type:"bi.multilayer_select_tree_trigger",container:n.container,allowInsertValue:n.allowInsertValue,allowSearchValue:n.allowSearchValue,allowEdit:n.allowEdit,cls:"multilayer-select-tree-trigger",ref:function(e){t.trigger=e},items:n.items,itemsCreator:n.itemsCreator,valueFormatter:n.valueFormatter,watermark:n.watermark,height:n.height-2,text:n.text,value:n.value,tipType:n.tipType,warningTitle:n.warningTitle,title:n.title,listeners:[{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE,action:function(){t.setValue(this.getValue()),t.combo.hideView(),t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,action:function(){t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,action:function(){t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,action:function(){t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,action:function(){var e=t.trigger.getSearcher().getKeyword();t.combo.setValue([e]),t.combo.hideView()}}]},toggle:!n.allowEdit,hideChecker:function(e){return!(n.container&&t.trigger.getSearcher().isSearching()&&0<t.trigger.getSearcher().getView().element.find(e.target).length)&&0===t.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){t.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW)}}]}},_getSyncConfig:function(){var e=this.options,t=this._getBaseConfig();return BI.extend(t,e.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:e.text,height:e.height,items:e.items,value:e.value}})},_getAsyncConfig:function(){var e=this._getBaseConfig();return BI.extend(e,this._getSearchConfig())},setValue:function(e){e=BI.isArray(e)?e:[e],this.combo.setValue(e)},getValue:function(){return this.combo.getValue()},populate:function(e){this.combo.populate(e)}}),BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo)},function(e,t){BI.MultiLayerSelectTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var n=this,i=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:i.isDefaultInit,items:i.items,itemsCreator:i.itemsCreator===BI.emptyFn?BI.emptyFn:function(e,t){i.itemsCreator(e,function(e){t(e),n.setKeyword(i.keywordGetter())})},keywordGetter:i.keywordGetter,value:i.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){n.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(e){n.addNotMatchTip=e},handler:function(){n.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,i.keywordGetter())}},this.tree]}},setKeyword:function(e){var t=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(t),t&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",e))},getValue:function(){return this.tree.getValue()},setValue:function(e){e=BI.isArray(e)?e:[e],this.tree.setValue(e)},populate:function(e){this.tree.populate(e)}}),BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_insert_search_pane",BI.MultiLayerSelectTreeInsertSearchPane)},function(e,t){BI.MultiLayerSelectLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,value:"",scrollable:!0})},_init:function(){var e=this.options;BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.storeValue=e.value,this.initTree(this.options.items),this.check()},_formatItems:function(i,r,a){var o=this,s=this.options.keywordGetter();return BI.each(i,function(e,t){var n={};t.layer=r,BI.isKey(t.id)||(t.id=BI.UUID()),t.keyword=t.keyword||s,n.pNode=a,!0===t.isParent||!0===t.parent||BI.isNotEmptyArray(t.children)?(n.type="bi.multilayer_select_tree_mid_plus_group_node",e===i.length-1&&(n.type="bi.multilayer_select_tree_last_plus_group_node",n.isLastNode=!0),0!==e||a||(n.type="bi.multilayer_select_tree_first_plus_group_node"),0!==e||e!==i.length-1||a||(n.type="bi.multilayer_select_tree_plus_group_node"),BI.defaults(t,n),o._formatItems(t.children,r+1,t)):(n.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==e||a||(n.type="bi.multilayer_single_tree_first_tree_leaf_item"),e===i.length-1&&(n.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(t,n))}),i},_assertId:function(e){BI.each(e,function(e,t){t.id=t.id||BI.UUID()})},initTree:function(e){var i=this,r=this.options,a=!1;this.empty(),this._assertId(e),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{type:"bi.select_tree_expander",isDefaultInit:r.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(e),0),itemsCreator:function(t,n){1!==t.times||t.node||BI.nextTick(function(){i.loading()}),r.itemsCreator(t,function(e){a=e.hasNext,1!==t.times||t.node||i._populate(e.items),n(i._formatItems(BI.Tree.transformToTreeFormat(e.items),t.node?t.node.layer+1:0,t.node)),i.setValue(i.storeValue),1!==t.times||t.node||BI.nextTick(function(){i.loaded()})})},value:r.value,el:{type:"bi.loader",isDefaultInit:r.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:r.chooseType,behaviors:r.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return a}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(e,t){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&(i.setValue(t),i.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:r.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(e){this._populate(e),BI.isNull(e)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(e),0))},setValue:function(e){this.options.chooseType===BI.Selection.None||(this.storeValue=e,this.tree.setValue(e))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(e){return this.tree.getNodeById(e)},getNodeByValue:function(e){return this.tree.getNodeByValue(e)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree)},function(e,t){BI.MultiLayerSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:"",onLoaded:BI.emptyFn,minHeight:240})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:t.isDefaultInit,items:t.items,itemsCreator:t.itemsCreator,keywordGetter:t.keywordGetter,value:t.value,scrollable:null,onLoaded:function(){e.tree.check(),t.onLoaded()}}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){e.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)}),this.tree.css("min-height",t.minHeight-10)},getValue:function(){return this.tree.getValue()},setValue:function(e){e=BI.isArray(e)?e:[e],this.tree.setValue(e)},populate:function(e){this.tree.populate(e)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup)},function(e,t){BI.MultiLayerSelectTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow bi-border-radius",height:24,valueFormatter:function(e){return e},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1,title:BI.bind(this._getShowText,this)}},render:function(){var i=this,r=this.options;r.itemsCreator===BI.emptyFn&&this._initData();var e={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){i.searcher=this},masker:BI.isNotNull(r.container)?{offset:{},container:r.container}:{offset:{}},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){i.editor=this},defaultText:r.text,text:this._digest(r.value),value:r.value,height:r.height,tipText:"",watermark:r.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){i.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){i.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){i.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:r.allowInsertValue?"bi.multilayer_select_tree_insert_search_pane":"bi.multilayer_select_tree_popup",itemsCreator:r.itemsCreator===BI.emptyFn?BI.emptyFn:function(e,t){e.keyword=i.editor.getValue(),r.itemsCreator(e,t)},keywordGetter:function(){return i.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){i.options.text=i.getSearcher().getKeyword(),i.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(e){i.popup=e}},onSearch:function(e,t){var n=e.keyword;r.itemsCreator===BI.emptyFn?(t(i._getSearchItems(n)),r.allowInsertValue&&i.popup.setKeyword(n)):t()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){i.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return r.allowEdit?e:{type:"bi.absolute",items:[{el:e,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var e=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(e.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(n){var i=this,r=this.options,a=[];return this.tree.traverse(function(e){var t=BI.Func.getSearchResult(i.tree.isRoot(e)?[]:BI.concat([e.text],r.allowSearchValue?[e.value]:[]),n);if(0<t.find.length||0<t.match.length)return a.push(e),!0}),this._fillTreeStructure4Search(a,"id")},_createJson:function(e,t){return{id:e.id,pId:e.pId,text:e.text,value:e.value,isParent:BI.isNotEmptyArray(e.children),open:t}},_getChildren:function(e){var i=this;e.children=e.children||[];var r=[];return BI.each(e.children,function(e,t){var n=i._getChildren(t);r=r.concat(n)}),e.children.concat(r)},_fillTreeStructure4Search:function(e){var n=this,i=[],r=[];for(BI.each(e,function(e,t){r.push({pId:t.pId}),i.push(t),i=i.concat(n._getChildren(t))});BI.isNotEmptyArray(r);){var t=r.pop(),a=this.tree.search(this.tree.getRoot(),t.pId,"id");null!=a&&(a.open=!0,r.push({pId:a.pId}),i.push(a))}return BI.uniqBy(BI.map(i,function(e,t){return n._createJson(t,t.open)}),"id")},_digest:function(n){var e=this.options;if(e.itemsCreator!==BI.emptyFn)return e.valueFormatter(n);var t=BI.find(e.items,function(e,t){return t.value===n});return BI.isNotNull(t)?t.text:e.text},_getShowText:function(){return this.editor.getText()},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(e){this.options.items=e,this._initData(e)},setValue:function(e){this.editor.setState(this._digest(e[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSelectTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_select_tree_trigger",BI.MultiLayerSelectTreeTrigger)},function(e,t){BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var t=this,n=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:n.id,pId:n.pId,keyword:n.keyword,open:n.open,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(e){t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(e){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(e)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(e)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode)},function(e,t){BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var t=this,n=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:n.id,pId:n.pId,keyword:n.keyword,open:n.open,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(e){t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(e){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(e)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(e)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode)},function(e,t){BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var t=this,n=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:n.id,pId:n.pId,keyword:n.keyword,open:n.open,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(e){t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(e){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(e)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(e)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode)},function(e,t){BI.MultiLayerSelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreePlusGroupNode.superclass._init.apply(this,arguments);var t=this,n=this.options;this.node=BI.createWidget({type:"bi.select_tree_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:n.id,pId:n.pId,keyword:n.keyword,open:n.open,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(e){t.setSelected(t.isSelected()),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(e){BI.MultiLayerSelectTreePlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(e)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(e)}}),BI.shortcut("bi.multilayer_select_tree_plus_group_node",BI.MultiLayerSelectTreePlusGroupNode)},function(e,t){BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1,isNeedAdjustWidth:!0})},render:function(){var t=this,e=this.options,n=e.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return e.allowEdit||e.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:n,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(e){t.triggerBtn=e},width:e.height,height:e.height,handler:function(){t.combo.isViewVisible()?t.combo.hideView():t.combo.showView()}},right:0,bottom:0,top:0}]}:n},_getBaseConfig:function(){var t=this,e=this.options;return{type:"bi.combo",container:e.container,destroyWhenHide:e.destroyWhenHide,adjustLength:2,ref:function(e){t.combo=e},popup:{el:{type:"bi.multilayer_single_tree_popup",isDefaultInit:e.isDefaultInit,itemsCreator:e.itemsCreator,items:e.items,ref:function(e){t.trigger&&t.trigger.getSearcher().setAdapter(e)},listeners:[{eventName:BI.MultiLayerSingleTreePopup.EVENT_CHANGE,action:function(){t.setValue(this.getValue()),t.combo.hideView(),t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}}],onLoaded:function(){BI.nextTick(function(){t.combo.adjustWidth(),t.combo.adjustHeight()})}},value:e.value,maxHeight:400,maxWidth:e.isNeedAdjustWidth?"auto":500,minHeight:240},isNeedAdjustWidth:e.isNeedAdjustWidth,listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW)}}]}},_getSearchConfig:function(){var t=this,n=this.options;return{el:{type:"bi.multilayer_single_tree_trigger",container:n.container,allowInsertValue:n.allowInsertValue,allowSearchValue:n.allowSearchValue,allowEdit:n.allowEdit,cls:"multilayer-single-tree-trigger",ref:function(e){t.trigger=e},watermark:n.watermark,items:n.items,itemsCreator:n.itemsCreator,valueFormatter:n.valueFormatter,height:n.height-2,text:n.text,value:n.value,tipType:n.tipType,warningTitle:n.warningTitle,title:n.title,listeners:[{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE,action:function(){t.setValue(this.getValue()),t.combo.hideView(),t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,action:function(){t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,action:function(){t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,action:function(){t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,action:function(){var e=t.trigger.getSearcher().getKeyword();t.combo.setValue([e]),t.combo.hideView()}}]},toggle:!n.allowEdit,hideChecker:function(e){return!(n.container&&t.trigger.getSearcher().isSearching()&&0<t.trigger.getSearcher().getView().element.find(e.target).length)&&0===t.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){t.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW)}}]}},_getSyncConfig:function(){var e=this.options,t=this._getBaseConfig();return BI.extend(t,e.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:e.text,height:e.height,items:e.items,value:e.value}})},_getAsyncConfig:function(){var e=this._getBaseConfig();return BI.extend(e,this._getSearchConfig())},setValue:function(e){e=BI.isArray(e)?e:[e],this.combo.setValue(e)},getValue:function(){return this.combo.getValue()},populate:function(e){this.combo.populate(e)}}),BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multilayer_single_tree_combo",BI.MultiLayerSingleTreeCombo)},function(e,t){BI.MultiLayerSingleTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-single-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var n=this,i=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_single_level_tree",isDefaultInit:i.isDefaultInit,items:i.items,itemsCreator:i.itemsCreator===BI.emptyFn?BI.emptyFn:function(e,t){i.itemsCreator(e,function(e){t(e),n.setKeyword(i.keywordGetter())})},keywordGetter:i.keywordGetter,value:i.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){n.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(e){n.addNotMatchTip=e},handler:function(){n.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,i.keywordGetter())}},this.tree]}},setKeyword:function(e){var t=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(t),t&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",e))},getValue:function(){return this.tree.getValue()},setValue:function(e){e=BI.isArray(e)?e:[e],this.tree.setValue(e)},populate:function(e){this.tree.populate(e)}}),BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_insert_search_pane",BI.MultiLayerSingleTreeInsertSearchPane)},function(e,t){BI.MultiLayerSingleLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,chooseType:BI.Selection.Single,scrollable:!0})},_init:function(){var e=this.options;BI.MultiLayerSingleLevelTree.superclass._init.apply(this,arguments),this.storeValue=e.value,this.initTree(this.options.items),this.check()},_formatItems:function(i,r,a){var o=this,s=this.options.keywordGetter();return BI.each(i,function(e,t){var n={};t.layer=r,BI.isKey(t.id)||(t.id=BI.UUID()),t.keyword=t.keyword||s,n.pNode=a,!0===t.isParent||!0===t.parent||BI.isNotEmptyArray(t.children)?(n.type="bi.multilayer_single_tree_mid_plus_group_node",e===i.length-1&&(n.type="bi.multilayer_single_tree_last_plus_group_node",n.isLastNode=!0),0!==e||a||(n.type="bi.multilayer_single_tree_first_plus_group_node"),0!==e||e!==i.length-1||a||(n.type="bi.multilayer_single_tree_plus_group_node"),BI.defaults(t,n),o._formatItems(t.children,r+1,t)):(n.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==e||a||(n.type="bi.multilayer_single_tree_first_tree_leaf_item"),e===i.length-1&&(n.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(t,n))}),i},_assertId:function(e){BI.each(e,function(e,t){t.id=t.id||BI.UUID()})},initTree:function(e){var i=this,r=this.options,a=!1;this.empty(),this._assertId(e),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{isDefaultInit:r.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(e),0),value:r.value,itemsCreator:function(t,n){1!==t.times||t.node||BI.nextTick(function(){i.loading()}),r.itemsCreator(t,function(e){a=e.hasNext,1!==t.times||t.node||i._populate(e.items),n(i._formatItems(BI.Tree.transformToTreeFormat(e.items),t.node?t.node.layer+1:0,t.node)),i.setValue(i.storeValue),1!==t.times||t.node||BI.nextTick(function(){i.loaded()})})},el:{type:"bi.loader",isDefaultInit:r.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:r.chooseType,behaviors:r.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return a}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(e,t){i.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e===BI.Events.CLICK&&(i.setValue(t),i.fireEvent(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,t))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:r.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(e){this._populate(e),BI.isNull(e)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(e),0))},setValue:function(e){this.options.chooseType===BI.Selection.None||(this.storeValue=e,this.tree.setValue(e))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(e){return this.tree.getNodeById(e)},getNodeByValue:function(e){return this.tree.getNodeByValue(e)}}),BI.MultiLayerSingleLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_level_tree",BI.MultiLayerSingleLevelTree)},function(e,t){BI.MultiLayerSingleTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],onLoaded:BI.emptyFn,minHeight:240})},_init:function(){BI.MultiLayerSingleTreePopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.tree=BI.createWidget({type:"bi.multilayer_single_level_tree",isDefaultInit:t.isDefaultInit,items:t.items,itemsCreator:t.itemsCreator,keywordGetter:t.keywordGetter,value:t.value,scrollable:null,onLoaded:function(){e.tree.check(),t.onLoaded()}}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,function(){e.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE)}),this.tree.css("min-height",t.minHeight-10)},getValue:function(){return this.tree.getValue()},setValue:function(e){e=BI.isArray(e)?e:[e],this.tree.setValue(e)},populate:function(e){this.tree.populate(e)}}),BI.MultiLayerSingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_popup",BI.MultiLayerSingleTreePopup)},function(e,t){BI.MultiLayerSingleTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow bi-border-radius",height:24,valueFormatter:function(e){return e},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1,title:BI.bind(this._getShowText,this)}},render:function(){var i=this,r=this.options;r.itemsCreator===BI.emptyFn&&this._initData();var e={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){i.searcher=this},masker:BI.isNotNull(r.container)?{offset:{},container:r.container}:{offset:{}},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){i.editor=this},defaultText:r.text,text:this._digest(r.value),value:r.value,height:r.height,tipText:"",watermark:r.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){i.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){i.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){i.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:r.allowInsertValue?"bi.multilayer_single_tree_insert_search_pane":"bi.multilayer_single_tree_popup",itemsCreator:r.itemsCreator===BI.emptyFn?BI.emptyFn:function(e,t){e.keyword=i.editor.getValue(),r.itemsCreator(e,t)},keywordGetter:function(){return i.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){i.options.text=i.getSearcher().getKeyword(),i.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(e){i.popup=e}},onSearch:function(e,t){var n=e.keyword;r.itemsCreator===BI.emptyFn?(t(i._getSearchItems(n)),r.allowInsertValue&&i.popup.setKeyword(n)):t()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){i.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return r.allowEdit?e:{type:"bi.absolute",items:[{el:e,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var e=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(e.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(n){var i=this,r=this.options,a=[];return this.tree.traverse(function(e){var t=BI.Func.getSearchResult(i.tree.isRoot(e)?[]:BI.concat([e.text],r.allowSearchValue?[e.value]:[]),n);if(0<t.find.length||0<t.match.length)return a.push(e),!0}),this._fillTreeStructure4Search(a,"id")},_createJson:function(e,t){return{id:e.id,pId:e.pId,text:e.text,value:e.value,isParent:BI.isNotEmptyArray(e.children),open:t}},_getChildren:function(e){var i=this;e.children=e.children||[];var r=[];return BI.each(e.children,function(e,t){var n=i._getChildren(t);r=r.concat(n)}),e.children.concat(r)},_fillTreeStructure4Search:function(e){var n=this,i=[],r=[];for(BI.each(e,function(e,t){r.push({pId:t.pId}),i.push(t),i=i.concat(n._getChildren(t))});BI.isNotEmptyArray(r);){var t=r.pop(),a=this.tree.search(this.tree.getRoot(),t.pId,"id");null!=a&&(a.open=!0,r.push({pId:a.pId}),i.push(a))}return BI.uniqBy(BI.map(i,function(e,t){return n._createJson(t,t.open)}),"id")},_digest:function(n){var e=this.options;if(e.itemsCreator!==BI.emptyFn)return e.valueFormatter(n);var t=BI.find(e.items,function(e,t){return t.value===n});return BI.isNotNull(t)?t.text:e.text},_getShowText:function(){return this.editor.getText()},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(e){this.options.items=e,this._initData()},setValue:function(e){this.editor.setState(this._digest(e[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSingleTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_single_tree_trigger",BI.MultiLayerSingleTreeTrigger)},function(e,t){BI.MultiLayerSingleTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-single-tree-first-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var t=this.options;this.node=this._createNode();for(var n=[],e=t.pNode;e;)e.isLastNode&&n.push(e.layer),e=e.pNode;var i=[];BI.count(0,t.layer,function(e){i.push({type:"bi.layout",cls:BI.contains(n,e)?"":"base-line-conn-background",width:12,height:t.height})}),i.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(t.layer,12),items:i})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(e)},_createNode:function(){var t=this,e=this.options;return BI.createWidget({type:"bi.first_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:e.id,pId:e.pId,open:e.open,isLastNode:e.isLastNode,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_first_plus_group_node",BI.MultiLayerSingleTreeFirstPlusGroupNode)},function(e,t){BI.MultiLayerSingleTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-single-tree-last-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var t=this.options;this.node=this._createNode();for(var n=[],e=t.pNode;e;)e.isLastNode&&n.push(e.layer),e=e.pNode;var i=[];BI.count(0,t.layer,function(e){i.push({type:"bi.layout",cls:BI.contains(n,e)?"":"base-line-conn-background",width:12,height:t.height})}),i.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(t.layer,12),items:i})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(e)},_createNode:function(){var t=this,e=this.options;return BI.createWidget({type:"bi.last_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:e.id,pId:e.pId,open:e.open,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_last_plus_group_node",BI.MultiLayerSingleTreeLastPlusGroupNode)},function(e,t){BI.MultiLayerSingleTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-single-tree-mid-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var t=this.options;this.node=this._createNode();for(var n=[],e=t.pNode;e;)e.isLastNode&&n.push(e.layer),e=e.pNode;var i=[];BI.count(0,t.layer,function(e){i.push({type:"bi.layout",cls:BI.contains(n,e)?"":"base-line-conn-background",width:12,height:t.height})}),i.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(t.layer,12),items:i})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(e)},_createNode:function(){var t=this,e=this.options;return BI.createWidget({type:"bi.mid_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:e.id,pId:e.pId,open:e.open,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_mid_plus_group_node",BI.MultiLayerSingleTreeMidPlusGroupNode)},function(e,t){BI.MultiLayerSingleTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.MultiLayerSingleTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-multilayer-single-tree-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this,arguments);var t=this.options;this.node=this._createNode();for(var n=[],e=t.pNode;e;)e.isLastNode&&n.push(e.layer),e=e.pNode;var i=[];BI.count(0,t.layer,function(e){i.push({type:"bi.layout",cls:BI.contains(n,e)?"":"base-line-conn-background",width:12,height:t.height})}),i.push(this.node),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(t.layer,12),items:i})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(e){BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(e)},_createNode:function(){var t=this,e=this.options;return BI.createWidget({type:"bi.plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:e.id,pId:e.pId,open:e.open,isLastNode:e.isLastNode,height:e.height,hgap:e.hgap,text:e.text,value:e.value,py:e.py,keyword:e.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_plus_group_node",BI.MultiLayerSingleTreePlusGroupNode)},function(e,t){BI.MultiLayerSingleTreeFirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this,arguments);var t=this,n=this.options;this.item=BI.createWidget({type:"bi.first_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:n.id,pId:n.pId,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py,keyword:n.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.item),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(e){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(e)}}),BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item",BI.MultiLayerSingleTreeFirstTreeLeafItem)},function(e,t){BI.MultiLayerSingleTreeLastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this,arguments);var t=this,n=this.options;this.item=BI.createWidget({type:"bi.last_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:n.id,pId:n.pId,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py,keyword:n.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.item),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(e){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(e)}}),BI.shortcut("bi.multilayer_single_tree_last_tree_leaf_item",BI.MultiLayerSingleTreeLastTreeLeafItem)},function(e,t){BI.MultiLayerSingleTreeMidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._init.apply(this,arguments);var t=this,n=this.options;this.item=BI.createWidget({type:"bi.mid_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:n.id,pId:n.pId,height:n.height,hgap:n.hgap,text:n.text,value:n.value,py:n.py,keyword:n.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(e){e!==BI.Events.CLICK&&t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var i=[],e=n.pNode;e;)e.isLastNode&&i.push(e.layer),e=e.pNode;var r=[];BI.count(0,n.layer,function(e){r.push({type:"bi.layout",cls:BI.contains(i,e)?"":"base-line-conn-background",width:12,height:n.height})}),r.push(this.item),BI.createWidget({type:"bi.horizontal_adapt",element:this,columnSize:BI.makeArray(n.layer,12),items:r})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(e){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(e)}}),BI.shortcut("bi.multilayer_single_tree_mid_tree_leaf_item",BI.MultiLayerSingleTreeMidTreeLeafItem)},function(e,t){BI.MultiSelectCheckPane=BI.inherit(BI.Widget,{constants:{height:12,lgap:10,tgap:10,bgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-pane bi-background",items:[],itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,onClickContinueSelect:BI.emptyFn})},_init:function(){BI.MultiSelectCheckPane.superclass._init.apply(this,arguments);var n=this,i=this.options;this.storeValue=i.value||{},this.display=BI.createWidget({type:"bi.display_selected_list",items:i.items,itemsCreator:function(e,t){e=BI.extend(e||{},{selectedValues:n.storeValue.value}),n.storeValue.type!==BI.Selection.Multi?i.itemsCreator(e,t):t({items:BI.map(n.storeValue.value,function(e,t){var n=i.valueFormatter(t)||t;return{text:n,value:t,title:n}})})}}),this.continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-select-check-selected bi-high-light"}),this.continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){i.onClickContinueSelect()}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:{type:"bi.vertical_adapt",cls:"multi-select-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap},{el:this.continueSelect,lgap:this.constants.lgap}]},tgap:this.constants.tgap},{height:"fill",el:this.display,tgap:this.constants.bgap}]})},setValue:function(e){this.storeValue=e||{}},empty:function(){this.display.empty()},populate:function(){this.display.populate.apply(this.display,arguments)}}),BI.shortcut("bi.multi_select_check_pane",BI.MultiSelectCheckPane)},function(e,t){BI.DisplaySelectedList=BI.inherit(BI.Pane,{constants:{height:24,lgap:10},_defaultConfig:function(){return BI.extend(BI.DisplaySelectedList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-display-list",itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.DisplaySelectedList.superclass._init.apply(this,arguments);var n=this,i=this.options;this.hasNext=!1,this.button_group=BI.createWidget({type:"bi.list_pane",element:this,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},items:this._createItems(i.items),chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical",lgap:10}]},itemsCreator:function(e,t){i.itemsCreator(e,function(e){n.hasNext=!!e.hasNext,t(n._createItems(e.items))})},hasNext:function(){return n.hasNext}})},_createItems:function(e){return BI.createItems(e,{type:"bi.icon_text_item",cls:"cursor-default check-font icon-size-12 display-list-item bi-tips",once:!0,invalid:!0,selected:!0,height:this.constants.height,logic:{dynamic:!0}})},empty:function(){this.button_group.empty()},populate:function(e){0===arguments.length?this.button_group.populate():this.button_group.populate(this._createItems(e))}}),BI.shortcut("bi.display_selected_list",BI.DisplaySelectedList)},function(e,t){BI.MultiSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,i=function(){BI.isKey(n._startValue)&&(n.storeValue.type===BI.Selection.All?(BI.remove(n.storeValue.value,n._startValue),n.storeValue.assist=n.storeValue.assist||[],n.storeValue.assist.pushDistinct(n._startValue)):(BI.pushDistinct(n.storeValue.value,n._startValue),BI.remove(n.storeValue.assist,n._startValue))),n.trigger.getSearcher().setState(n.storeValue),n.numberCounter.setButtonChecked(n.storeValue)};this.storeValue=e.value||{},this._assertValue(this.storeValue),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:e.allowEdit,height:e.height,text:e.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){n.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){n.fireEvent(BI.MultiSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){n._setStartValue(""),this.getSearcher().setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){n._setStartValue(""),n.fireEvent(BI.MultiSelectCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){var e;this.getSearcher().hasMatched()&&(e=this.getSearcher().getKeyword(),n._join({type:BI.Selection.Multi,value:[e]},function(){n.combo.setValue(n.storeValue),n._setStartValue(e),i(),n.populate(),n._setStartValue("")}))}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&n._joinKeywords(e,function(){BI.isEndWithBlank(t)?(n.combo.setValue(n.storeValue),i(),n.combo.populate(),n._setStartValue("")):(n.combo.setValue(n.storeValue),i())}),n.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(e,t){t instanceof BI.MultiSelectBar?n._joinAll(this.getValue(),function(){i()}):n._join(this.getValue(),function(){i()}),n.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){n.numberCounter.updateSelectedValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){n.combo.isViewVisible()||n.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!e.allowEdit,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){n.storeValue=this.getValue(),n._adjust(function(){i()}),n.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){n._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){n.combo.adjustWidth(),n.combo.adjustHeight(),n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})}},value:e.value,hideChecker:function(e){return 0===t.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(n.storeValue),BI.nextTick(function(){n._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){n._stopEditing(),!0===n.requesting?n.wants2Quit=!0:n.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM)});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(n.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_itemsCreator4Trigger:function(t,n){var i=this;this.options.itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(BI.deepClone(i.getValue())),n.apply(i,arguments)})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),o._adjust(a)})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,u.storeValue.assist&&u.storeValue.assist.push(r[t]),delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void u._adjust(l)}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&(u.storeValue.assist&&u.storeValue.assist.push(a[n[e]]),delete a[n[e]]),BI.isNull(o[n[e]])&&(BI.remove(u.storeValue.assist,t),s.push(t))}),u.storeValue.value=s.concat(BI.values(a)),u._adjust(l)})},_adjust:function(e){var t=this;this.options;!function(){!0===t.wants2Quit&&(t.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM),t.wants2Quit=!1);t.requesting=!1}(),e()},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),BI.remove(n.storeValue.assist,t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,n.storeValue.assist&&n.storeValue.assist.push(i[t]),delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void n._adjust(t)}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},_populate:function(){this.combo.populate.apply(this.combo,arguments)},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._populate.apply(this,arguments),this.numberCounter.populateSwitcher.apply(this.numberCounter,arguments)}}),BI.extend(BI.MultiSelectCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_combo",BI.MultiSelectCombo)},function(e,t){BI.MultiSelectNoBarCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo-no-bar",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0}})},_init:function(){BI.MultiSelectNoBarCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,i=function(){BI.isKey(n._startValue)&&(n.storeValue.type===BI.Selection.All?(BI.remove(n.storeValue.value,n._startValue),n.storeValue.assist=n.storeValue.assist||[],n.storeValue.assist.pushDistinct(n._startValue)):(BI.pushDistinct(n.storeValue.value,n._startValue),BI.remove(n.storeValue.assist,n._startValue))),n.trigger.getSearcher().setState(n.storeValue),n.numberCounter.setButtonChecked(n.storeValue)};this.storeValue={type:BI.Selection.Multi,value:e.value||[]},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_trigger",height:e.height,text:e.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:e.value}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){n.fireEvent(BI.MultiSelectNoBarCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){n.fireEvent(BI.MultiSelectNoBarCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){n._setStartValue(""),this.getSearcher().setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){n._setStartValue(""),n.fireEvent(BI.MultiSelectNoBarCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&n._joinKeywords(e,function(){BI.isEndWithBlank(t)?(n.combo.setValue(n.storeValue),i(),n.combo.populate(),n._setStartValue("")):(n.combo.setValue(n.storeValue),i())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(e,t){t instanceof BI.MultiSelectBar?n._joinAll(this.getValue(),function(){i()}):n._join(this.getValue(),function(){i()}),n.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){n.numberCounter.updateSelectedValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){n.combo.isViewVisible()||n.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_no_bar_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){n.storeValue=this.getValue(),n._adjust(function(){i()}),n.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){n._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){n.combo.adjustWidth(),n.combo.adjustHeight(),n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})}},value:{type:BI.Selection.Multi,value:e.value},hideChecker:function(e){return 0===t.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(n.storeValue),BI.nextTick(function(){n._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){n._stopEditing(),!0===n.requesting?n.wants2Quit=!0:n.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CONFIRM)});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:e.value}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(n.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_itemsCreator4Trigger:function(t,n){var i=this;this.options.itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(BI.deepClone(i.storeValue)),n.apply(i,arguments)})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),o._adjust(a)})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,u.storeValue.assist&&u.storeValue.assist.push(r[t]),delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void u._adjust(l)}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&(u.storeValue.assist&&u.storeValue.assist.push(a[n[e]]),delete a[n[e]]),BI.isNull(o[n[e]])&&(BI.remove(u.storeValue.assist,t),s.push(t))}),u.storeValue.value=s.concat(BI.values(a)),u._adjust(l)})},_adjust:function(e){var t=this;this.options;!function(){!0===t.wants2Quit&&(t.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CONFIRM),t.wants2Quit=!1);t.requesting=!1}(),e()},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),BI.remove(n.storeValue.assist,t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,n.storeValue.assist&&n.storeValue.assist.push(i[t]),delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void n._adjust(t)}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},_populate:function(){this.combo.populate.apply(this.combo,arguments)},setValue:function(e){this.storeValue={type:BI.Selection.Multi,value:e||[]},this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this._populate.apply(this,arguments),this.numberCounter.populateSwitcher.apply(this.numberCounter,arguments)}}),BI.extend(BI.MultiSelectNoBarCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectNoBarCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectNoBarCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectNoBarCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectNoBarCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectNoBarCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_no_bar_combo",BI.MultiSelectNoBarCombo)},function(e,t){BI.MultiSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectInsertCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,i=function(){BI.isKey(n._startValue)&&(n.storeValue.type===BI.Selection.All?(BI.remove(n.storeValue.value,n._startValue),n.storeValue.assist=n.storeValue.assist||[],n.storeValue.assist.pushDistinct(n._startValue)):(BI.pushDistinct(n.storeValue.value,n._startValue),BI.remove(n.storeValue.assist,n._startValue))),n.trigger.getSearcher().setState(n.storeValue),n.numberCounter.setButtonChecked(n.storeValue)};this.storeValue=e.value||{},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",allowEdit:e.allowEdit,height:e.height,text:e.text,watermark:e.watermark,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:e.value}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS,function(){n.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR,function(){n.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){n._setStartValue(""),this.getSearcher().setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){n._setStartValue(""),n.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&n._addItem(i)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){var e;this.getSearcher().hasMatched()||(n._addItem(i),e=this.getSearcher().getKeyword(),n._stopEditing(),n.fireEvent(BI.MultiSelectInsertCombo.EVENT_ADD_ITEM,e))}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&n._joinKeywords(e,function(){BI.isEndWithBlank(t)?(n.combo.setValue(n.storeValue),i(),n.combo.populate(),n._setStartValue("")):(n.combo.setValue(n.storeValue),i())}),n.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(e,t){t instanceof BI.MultiSelectBar?n._joinAll(this.getValue(),function(){i()}):n._join(this.getValue(),function(){i()}),n.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){n.numberCounter.updateSelectedValue(n.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){n.combo.isViewVisible()||n.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!e.allowEdit,el:this.trigger,adjustLength:1,container:e.container,popup:{type:"bi.multi_select_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){n.storeValue=this.getValue(),n._adjust(function(){i()}),n.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){n._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){n.combo.adjustWidth(),n.combo.adjustHeight(),n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})}},value:e.value,hideChecker:function(e){return 0===t.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(n.storeValue),BI.nextTick(function(){n._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){n._stopEditing(),!0===n.requesting?n.wants2Quit=!0:n.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM)});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:e.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(n.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_itemsCreator4Trigger:function(t,n){var i=this;this.options.itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(BI.deepClone(i.getValue())),n.apply(i,arguments)})},_addItem:function(e){var t=this,n=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[n]},function(){t.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(t.storeValue.value,n),t.combo.setValue(t.storeValue),t._setStartValue(n),e(),t.populate(),t._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),o._adjust(a)})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,u.storeValue.assist&&u.storeValue.assist.push(r[t]),delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void u._adjust(l)}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&(u.storeValue.assist&&u.storeValue.assist.push(a[n[e]]),delete a[n[e]]),BI.isNull(o[n[e]])&&(BI.remove(u.storeValue.assist,t),s.push(t))}),u.storeValue.value=s.concat(BI.values(a)),u._adjust(l)})},_adjust:function(e){var t=this;this.options;!function(){!0===t.wants2Quit&&(t.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM),t.wants2Quit=!1);t.requesting=!1}(),e()},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),BI.remove(n.storeValue.assist,t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,n.storeValue.assist&&n.storeValue.assist.push(i[t]),delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void n._adjust(t)}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},_populate:function(){this.combo.populate.apply(this.combo,arguments)},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._populate.apply(this,arguments),this.numberCounter.populateSwitcher.apply(this.numberCounter,arguments)}}),BI.extend(BI.MultiSelectInsertCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MultiSelectInsertCombo.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_insert_combo",BI.MultiSelectInsertCombo)},function(e,t){BI.MultiSelectInsertNoBarCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo-no-bar",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0}})},_init:function(){BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,i=function(){BI.isKey(n._startValue)&&(n.storeValue.type===BI.Selection.All?(BI.remove(n.storeValue.value,n._startValue),n.storeValue.assist=n.storeValue.assist||[],n.storeValue.assist.pushDistinct(n._startValue)):(BI.pushDistinct(n.storeValue.value,n._startValue),BI.remove(n.storeValue.assist,n._startValue))),n.trigger.getSearcher().setState(n.storeValue),n.numberCounter.setButtonChecked(n.storeValue)};this.storeValue={type:BI.Selection.Multi,value:e.value||[]},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",height:e.height,text:e.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:e.value}}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){n._setStartValue(""),this.getSearcher().setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){n._setStartValue("")}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&n._addItem(i)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){var e;this.getSearcher().hasMatched()||(n._addItem(i),e=this.getSearcher().getKeyword(),n._stopEditing(),n.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_ADD_ITEM,e))}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&n._joinKeywords(e,function(){BI.isEndWithBlank(t)?(n.combo.setValue(n.storeValue),i(),n.combo.populate(),n._setStartValue("")):(n.combo.setValue(n.storeValue),i())})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(e,t){t instanceof BI.MultiSelectBar?n._joinAll(this.getValue(),function(){i()}):n._join(this.getValue(),function(){i()})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){n.numberCounter.updateSelectedValue(n.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){n.combo.isViewVisible()||n.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_no_bar_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){n.storeValue=this.getValue(),n._adjust(function(){i()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){n._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){n.combo.adjustWidth(),n.combo.adjustHeight(),n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})}},value:{type:BI.Selection.Multi,value:e.value},hideChecker:function(e){return 0===t.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(n.storeValue),BI.nextTick(function(){n._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){n._stopEditing(),!0===n.requesting?n.wants2Quit=!0:n.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM)});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:e.value}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(n.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_itemsCreator4Trigger:function(t,n){var i=this;this.options.itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(BI.deepClone(i.storeValue)),n.apply(i,arguments)})},_addItem:function(e){var t=this,n=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[n]},function(){t.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(t.storeValue.value,n),t.combo.setValue(t.storeValue),t._setStartValue(n),e(),t.populate(),t._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),o._adjust(a)})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),this.requesting=!0,e.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,u.storeValue.assist&&u.storeValue.assist.push(r[t]),delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void u._adjust(l)}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&(u.storeValue.assist&&u.storeValue.assist.push(a[n[e]]),delete a[n[e]]),BI.isNull(o[n[e]])&&(BI.remove(u.storeValue.assist,t),s.push(t))}),u.storeValue.value=s.concat(BI.values(a)),u._adjust(l)})},_adjust:function(e){var t=this;this.options;!function(){!0===t.wants2Quit&&(t.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM),t.wants2Quit=!1);t.requesting=!1}(),e()},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),BI.remove(n.storeValue.assist,t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,n.storeValue.assist&&n.storeValue.assist.push(i[t]),delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void n._adjust(t)}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},_populate:function(){this.combo.populate.apply(this.combo,arguments)},setValue:function(e){this.storeValue={type:BI.Selection.Multi,value:e||[]},this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this._populate.apply(this,arguments),this.numberCounter.populateSwitcher.apply(this.numberCounter,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MultiSelectInsertNoBarCombo.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_insert_no_bar_combo",BI.MultiSelectInsertNoBarCombo)},function(e,t){BI.MultiSelectInsertTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectInsertTrigger.superclass._init.apply(this,arguments);var e=this,t=this.options;t.height&&this.setHeight(t.height-2),this.searcher=BI.createWidget(t.searcher,{type:"bi.multi_select_insert_searcher",height:t.height,text:t.text,itemsCreator:t.itemsCreator,valueFormatter:t.valueFormatter,watermark:t.watermark,popup:{},adapter:t.adapter,masker:t.masker,value:t.value}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_STOP,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS,function(){e.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),t.allowEdit||BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:function(){return e.searcher.getState()}},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(e){this.wrapper.attr("items")[1].width=e,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(e){this.searcher.setAdapter(e)},setValue:function(e){this.searcher.setValue(e)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectInsertTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectInsertTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertTrigger.EVENT_START="EVENT_START",BI.MultiSelectInsertTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_trigger",BI.MultiSelectInsertTrigger)},function(e,t){BI.MultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectLoader.superclass._init.apply(this,arguments);var s=this,l=this.options,u=!1;this.storeValue=l.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",logic:l.logic,toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},el:BI.extend({onLoaded:l.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},l.el),itemsCreator:function(r,a){var o=s._startValue;s.storeValue&&(r=BI.extend(r||{},{selectedValues:BI.isKey(o)&&s.storeValue.type===BI.Selection.Multi?s.storeValue.value.concat(o):s.storeValue.value})),l.itemsCreator(r,function(e){u=e.hasNext;var t,n,i=[];1===r.times&&s.storeValue&&(t=BI.map(s.storeValue.value,function(e,t){var n=l.valueFormatter(t)||t;return{text:n,value:t,title:n,selected:s.storeValue.type===BI.Selection.Multi}}),BI.isKey(s._startValue)&&!BI.contains(s.storeValue.value,s._startValue)&&(n=l.valueFormatter(o)||o,t.unshift({text:n,value:o,title:n,selected:!0})),i=s._createItems(t)),a(i.concat(s._createItems(e.items)),e.keyword||""),1===r.times&&s.storeValue&&(BI.isKey(o)&&(s.storeValue.type===BI.Selection.All?BI.remove(s.storeValue.value,o):BI.pushDistinct(s.storeValue.value,o)),s.setValue(s.storeValue)),1===r.times&&s._scrollToTop()})},hasNext:function(){return u},value:this.storeValue}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,vgap:5},l.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)})))),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){s.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){s.fireEvent(BI.MultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(e){return BI.createItems(e,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var e=this;BI.delay(function(){e.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},setStartValue:function(e){this._startValue=e},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(e){arguments[0]=this._createItems(e),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(e){this.button_group.resetHeight(e-10)},resetWidth:function(e){this.button_group.resetWidth(e)}}),BI.MultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_loader",BI.MultiSelectLoader)},function(e,t){BI.MultiSelectNoBarLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarLoader.superclass._init.apply(this,arguments);var s=this,l=this.options,u=!1;this.storeValue=l.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget(BI.extend({type:"bi.list_pane",onLoaded:l.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}},itemsCreator:function(r,a){var o=s._startValue;s.storeValue&&(r=BI.extend(r||{},{selectedValues:BI.isKey(o)&&s.storeValue.type===BI.Selection.Multi?s.storeValue.value.concat(o):s.storeValue.value})),l.itemsCreator(r,function(e){u=e.hasNext;var t,n,i=[];1===r.times&&s.storeValue&&(t=BI.map(s.storeValue.value,function(e,t){var n=l.valueFormatter(t)||t;return{text:n,value:t,title:n,selected:s.storeValue.type===BI.Selection.Multi}}),BI.isKey(s._startValue)&&!BI.contains(s.storeValue.value,s._startValue)&&(n=l.valueFormatter(o)||o,t.unshift({text:n,value:o,title:n,selected:!0})),i=s._createItems(t)),a(i.concat(s._createItems(e.items)),e.keyword||""),1===r.times&&s.storeValue&&(BI.isKey(o)&&(s.storeValue.type===BI.Selection.All?BI.remove(s.storeValue.value,o):BI.pushDistinct(s.storeValue.value,o)),s.setValue(s.storeValue)),1===r.times&&s._scrollToTop()})},hasNext:function(){return u},value:this.storeValue},l.el)),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){s.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){s.fireEvent(BI.MultiSelectNoBarLoader.EVENT_CHANGE,arguments)})},_createItems:function(e){return BI.createItems(e,{type:"bi.multi_select_item",cls:"bi-list-item-active",logic:this.options.logic,height:24,iconWrapperWidth:36})},_scrollToTop:function(){var e=this;BI.delay(function(){e.button_group.element.scrollTop(0)},30)},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},setStartValue:function(e){this._startValue=e},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue.value)},getValue:function(){return{type:BI.Selection.Multi,value:this.button_group.getValue()}},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(e){arguments[0]=this._createItems(e),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(e){this.button_group.element.css({"max-height":e+"px"})},resetWidth:function(){}}),BI.MultiSelectNoBarLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_no_bar_loader",BI.MultiSelectNoBarLoader)},function(e,t){BI.MultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectPopupView.superclass._init.apply(this,arguments);var t=this,e=this.options;this.loader=BI.createWidget({type:"bi.multi_select_loader",itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:e.onLoaded,value:e.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:e.maxWidth,minWidth:e.minWidth,maxHeight:e.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:e.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){t.fireEvent(BI.MultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(e){switch(e){case 0:t.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:t.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(e){this.loader.setStartValue(e)},setValue:function(e){this.popupView.setValue(e)},getValue:function(){return this.popupView.getValue()},populate:function(e){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(e){this.popupView.resetHeight(e)},resetWidth:function(e){this.popupView.resetWidth(e)}}),BI.MultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_popup_view",BI.MultiSelectPopupView)},function(e,t){BI.MultiSelectNoBarPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarPopupView.superclass._init.apply(this,arguments);var t=this,e=this.options;this.loader=BI.createWidget({type:"bi.multi_select_no_bar_loader",itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:e.onLoaded,value:e.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:e.maxWidth,minWidth:e.minWidth,maxHeight:e.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:e.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){t.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(e){switch(e){case 0:t.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR);break;case 1:t.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM)}})},setStartValue:function(e){this.loader.setStartValue(e)},setValue:function(e){this.popupView.setValue(e)},getValue:function(){return this.popupView.getValue()},populate:function(e){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(e){this.popupView.resetHeight(e)},resetWidth:function(e){this.popupView.resetWidth(e)}}),BI.MultiSelectNoBarPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_no_bar_popup_view",BI.MultiSelectNoBarPopupView)},function(e,t){BI.MultiSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectTrigger.superclass._init.apply(this,arguments);var e=this,t=this.options;t.height&&this.setHeight(t.height-2),this.searcher=BI.createWidget(t.searcher,{type:"bi.multi_select_searcher",height:t.height,text:t.text,itemsCreator:t.itemsCreator,valueFormatter:t.valueFormatter,watermark:t.watermark,popup:{},adapter:t.adapter,masker:t.masker,value:t.value}),this.searcher.on(BI.MultiSelectSearcher.EVENT_START,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS,function(){e.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),t.allowEdit||BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:function(){return e.searcher.getState()}},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(e){this.wrapper.attr("items")[1].width=e,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(e){this.searcher.setAdapter(e)},setValue:function(e){this.searcher.setValue(e)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectTrigger.EVENT_START="EVENT_START",BI.MultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.multi_select_trigger",BI.MultiSelectTrigger)},function(e,t){BI.MultiSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchInsertPane.superclass._init.apply(this,arguments);var n=this,i=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){n.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,i.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:i.keywordGetter,valueFormatter:i.valueFormatter,itemsCreator:function(e,t){i.itemsCreator.apply(n,[e,function(e){t(e),n.setKeyword(i.keywordGetter())}])},value:i.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(n){var i=this.options,e=BI.some(this.loader.getAllButtons(),function(e,t){return n===(i.valueFormatter(t.getValue())||t.getValue())}),t=0<this.loader.getAllButtons().length&&e;this.tooltipClick.setVisible(t),this.addNotMatchTip.setVisible(!t),t||this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",n))},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(e){this.loader.setValue(e)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(e){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_search_insert_pane",BI.MultiSelectSearchInsertPane)},function(e,t){BI.MultiSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-loader",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchLoader.superclass._init.apply(this,arguments);var o=this,s=this.options,l=!1;this.storeValue=BI.deepClone(s.value),this.button_group=BI.createWidget({type:"bi.select_list",toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},element:this,logic:{dynamic:!1},value:s.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(r,a){o.storeValue&&(r=BI.extend(r||{},{selectedValues:o.storeValue.value})),s.itemsCreator(r,function(e){var t=e.keyword=s.keywordGetter();l=e.hasNext;var n,i=[];1===r.times&&o.storeValue&&(n=o._filterValues(o.storeValue),i=o._createItems(n)),a(i.concat(o._createItems(e.items)),t),1===r.times&&o.storeValue&&o.setValue(o.storeValue)})},hasNext:function(){return l}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){o.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){o.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(e){return BI.createItems(e,{type:"bi.multi_select_item",logic:{dynamic:!1},height:24,selected:this.isAllSelected(),cls:"bi-list-item-active",iconWrapperWidth:36})},isAllSelected:function(){return this.button_group.isAllSelected()},_filterValues:function(n){var e,i=this.options,t=i.keywordGetter(),r=BI.deepClone(n.value)||[],a=BI.map(r,function(e,t){return{text:i.valueFormatter(t)||t,value:t}});return BI.isKey(t)&&(r=(e=BI.Func.getSearchResult(a,t)).match.concat(e.find)),BI.map(r,function(e,t){return{text:t.text,title:t.text,value:t.value,selected:n.type===BI.Selection.All}})},setValue:function(e){this.storeValue=BI.deepClone(e),this.button_group.setValue(e)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(e){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(e){this.button_group.resetHeight(e)},resetWidth:function(e){this.button_group.resetWidth(e)}}),BI.MultiSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_loader",BI.MultiSelectSearchLoader)},function(e,t){BI.MultiSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchPane.superclass._init.apply(this,arguments);var n=this,i=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:i.keywordGetter,valueFormatter:i.valueFormatter,itemsCreator:function(e,t){i.itemsCreator.apply(n,[e,function(e){t(e),n.setKeyword(i.keywordGetter())}])},value:i.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(e){var t,n=this.options,i=0<this.loader.getAllButtons().length&&(t=this.loader.getAllButtons()[0])&&e===(n.valueFormatter(t.getValue())||t.getValue());i!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(i),this.resizer.attr("items")[0].height=i?this.constants.height:0,this.resizer.resize())},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(e){this.loader.setValue(e)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(e){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_pane",BI.MultiSelectSearchPane)},function(e,t){BI.MultiSelectCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectCheckSelectedButton.superclass._init.apply(this,arguments);var e=this,t=this.options;this.numberCounter=BI.createWidget({type:"bi.text_button",element:this,hgap:4,text:"0",textAlign:"center",textHeight:16,cls:"bi-high-light-background count-tip"}),this.numberCounter.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.numberCounter.on(BI.TextButton.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),this.numberCounter.element.hover(function(){e.numberCounter.setTag(e.numberCounter.getText()),e.numberCounter.setText(BI.i18nText("BI-Check_Selected"))},function(){e.numberCounter.setText(e.numberCounter.getTag())}),this.setVisible(!1),BI.isNotNull(t.value)&&this.setValue(t.value)},_populate:function(n){var i=this,e=this.options;n.type!==BI.Selection.All?BI.nextTick(function(){i.numberCounter.setText(n.value.length),i.setVisible(0<n.value.length)}):e.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_DATA_LENGTH},function(e){var t=e.count-n.value.length;BI.nextTick(function(){i.numberCounter.setText(t),i.setVisible(0<t)})})},_assertValue:function(e){return(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[]),e},setValue:function(e){e=this._assertValue(e),this.options.value=e,this._populate(e)},populate:function(){this._populate(this._assertValue(this.options.value))},getValue:function(){}}),BI.MultiSelectCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_check_selected_button",BI.MultiSelectCheckSelectedButton)},function(e,t){BI.MultiSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-editor",el:{},watermark:BI.i18nText("BI-Basic_Search")})},_init:function(){BI.MultiSelectEditor.superclass._init.apply(this,arguments);var e=this,t=this.options;this.editor=BI.createWidget(t.el,{type:"bi.state_editor",element:this,height:t.height,watermark:t.watermark,allowBlank:!0,value:t.value,defaultText:t.text,text:t.text,tipType:t.tipType,warningTitle:t.warningTitle}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){e.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){e.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){e.fireEvent(BI.MultiSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(e){this.editor.setState(e)},setValue:function(e){this.editor.setValue(e)},setTipType:function(e){this.editor.setTipType(e)},getValue:function(){var e=this.editor.getState();return BI.isArray(e)&&0<e.length?e[e.length-1]:""},getState:function(){return this.editor.getText()},getKeywords:function(){var e=this.editor.getLastChangedValue(),t=e.match(/[\S]+/g);return BI.isEndWithBlank(e)?t.concat([" "]):t},populate:function(e){}}),BI.MultiSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_select_editor",BI.MultiSelectEditor)},function(e,t){BI.MultiSelectInsertSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectInsertSearcher.superclass._init.apply(this,arguments);var i=this,r=this.options;this.editor=BI.createWidget(r.el,{type:"bi.multi_select_editor",watermark:r.watermark,height:r.height,text:r.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,element:this,height:r.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_insert_pane",valueFormatter:r.valueFormatter,keywordGetter:function(){return i.editor.getValue()},itemsCreator:function(e,t){var n=i.editor.getValue();e.keywords=[n],this.setKeyword(n),r.itemsCreator(e,t)},value:r.value,listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM)}}]},r.popup),adapter:r.adapter,masker:r.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var e=this.getKeywords();i.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,e)}),BI.isNotNull(r.value)&&this.setState(r.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(e){this.searcher.setAdapter(e)},setState:function(e){var n,i=this.options;(e=e||{}).value||(e.value=[]),e.type===BI.Selection.All?0===e.value.length?this.editor.setState(BI.Selection.All):BI.size(e.assist)<=20?(n="",BI.each(e.assist,function(e,t){n+=0===e?""+(i.valueFormatter(t+"")||t):","+(i.valueFormatter(t+"")||t)}),this.editor.setState(n)):this.editor.setState(BI.Selection.Multi):0===e.value.length?this.editor.setState(BI.Selection.None):BI.size(e.value)<=20?(n="",BI.each(e.value,function(e,t){n+=0===e?""+(i.valueFormatter(t+"")||t):","+(i.valueFormatter(t+"")||t)}),this.editor.setState(n)):this.editor.setState(BI.Selection.Multi)},getState:function(){return this.editor.getState()},setValue:function(e){this.setState(e),this.searcher.setValue(e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(e){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectInsertSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectInsertSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertSearcher.EVENT_START="EVENT_START",BI.MultiSelectInsertSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_searcher",BI.MultiSelectInsertSearcher)},function(e,t){BI.MultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectSearcher.superclass._init.apply(this,arguments);var i=this,r=this.options;this.editor=BI.createWidget(r.el,{type:"bi.multi_select_editor",height:r.height,text:r.text,watermark:r.watermark,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){i.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){i.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,element:this,height:r.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:r.valueFormatter,keywordGetter:function(){return i.editor.getValue()},itemsCreator:function(e,t){var n=i.editor.getValue();e.keywords=[n],this.setKeyword(n),r.itemsCreator(e,t)},value:r.value},r.popup),adapter:r.adapter,masker:r.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){i.fireEvent(BI.MultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),i.fireEvent(BI.MultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){i.fireEvent(BI.MultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){i.fireEvent(BI.MultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var e=this.getKeywords();i.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING,e)}),BI.isNotNull(r.value)&&this.setState(r.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(e){this.searcher.setAdapter(e)},setState:function(e){var n,i=this.options;(e=e||{}).value||(e.value=[]),e.type===BI.Selection.All?0===e.value.length?this.editor.setState(BI.Selection.All):BI.size(e.assist)<=20?(n="",BI.each(e.assist,function(e,t){n+=0===e?""+(i.valueFormatter(t+"")||t):","+(i.valueFormatter(t+"")||t)}),this.editor.setState(n)):this.editor.setState(BI.Selection.Multi):0===e.value.length?this.editor.setState(BI.Selection.None):BI.size(e.value)<=20?(n="",BI.each(e.value,function(e,t){n+=0===e?""+(i.valueFormatter(t+"")||t):","+(i.valueFormatter(t+"")||t)}),this.editor.setState(n)):this.editor.setState(BI.Selection.Multi)},getState:function(){return this.editor.getState()},setValue:function(e){this.setState(e),this.searcher.setValue(e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(e){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearcher.EVENT_START="EVENT_START",BI.MultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_searcher",BI.MultiSelectSearcher)},function(e,t){BI.MultiSelectCheckSelectedSwitcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedSwitcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-switcher",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,el:{},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiSelectCheckSelectedSwitcher.superclass._init.apply(this,arguments);var t=this,e=this.options;this.button=BI.createWidget(e.el,{type:"bi.multi_select_check_selected_button",itemsCreator:e.itemsCreator,value:e.value}),this.button.on(BI.Events.VIEW,function(){t.fireEvent(BI.Events.VIEW,arguments)}),this.switcher=BI.createWidget({type:"bi.switcher",toggle:!1,element:this,el:this.button,popup:BI.extend({type:"bi.multi_select_check_pane",valueFormatter:e.valueFormatter,itemsCreator:e.itemsCreator,onClickContinueSelect:function(){t.switcher.hideView()},ref:function(e){t.checkPane=e},value:e.value},e.popup),adapter:e.adapter,masker:e.masker}),this.switcher.on(BI.Switcher.EVENT_TRIGGER_CHANGE,function(){t.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE)}),this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW,function(){t.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW)}),this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW,function(){var e=this;BI.nextTick(function(){e.populate()})})},adjustView:function(){this.switcher.adjustView()},hideView:function(){this.switcher.empty(),this.switcher.hideView()},setAdapter:function(e){this.switcher.setAdapter(e)},setValue:function(e){this.switcher.setValue(e)},updateSelectedValue:function(e){this.checkPane.setValue(e)},setButtonChecked:function(e){this.button.setValue(e)},getValue:function(){},populate:function(e){this.switcher.populate.apply(this.switcher,arguments)},populateSwitcher:function(){this.button.populate.apply(this.button,arguments)}}),BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_select_check_selected_switcher",BI.MultiSelectCheckSelectedSwitcher)},function(e,t){BI.MultiSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertList.superclass._init.apply(this,arguments);var i=this,r=this.options;this.storeValue=r.value||{};var n=function(){BI.isKey(i._startValue)&&(i.storeValue.type===BI.Selection.All?BI.remove(i.storeValue.value,i._startValue):BI.pushDistinct(i.storeValue.value,i._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:r.itemsCreator,valueFormatter:r.valueFormatter,logic:{dynamic:!0},el:{},value:r.value}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){i.storeValue=this.getValue(),n(),i.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:r.valueFormatter,keywordGetter:function(){return i.trigger.getKeyword()},itemsCreator:function(e,t){var n=i.trigger.getKeyword();BI.isNotEmptyString(n)&&(e.keywords=[n],this.setKeyword(e.keywords[0]),r.itemsCreator(e,t))},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var e=i.trigger.getKeyword();i.trigger.hasMatched()||(i.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(i.storeValue.value,e),i._showAdapter(),i.adapter.setValue(i.storeValue),i.adapter.populate(),i.storeValue.type===BI.Selection.Multi&&i.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){i._showSearcherPane(),i._setStartValue(""),this.setValue(BI.deepClone(i.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){i._showAdapter(),i._setStartValue(""),i.adapter.setValue(i.storeValue),i.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var e=this.getKeyword();this.hasMatched()&&i._join({type:BI.Selection.Multi,value:[e]},function(){i.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(i.storeValue.value,e),i._showAdapter(),i.adapter.setValue(i.storeValue),i._setStartValue(e),n(),i.adapter.populate(),i._setStartValue(""),i.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),i._showAdapter()}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var e=this.getKeywords(),t=BI.last(e);0<(e=BI.initial(e||[])).length&&i._joinKeywords(e,function(){BI.isEndWithBlank(t)?(i.adapter.setValue(i.storeValue),n(),i.adapter.populate(),i._setStartValue("")):(i.adapter.setValue(i.storeValue),n()),i.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(e,t){t instanceof BI.MultiSelectBar?i._joinAll(this.getValue(),function(){n(),i.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}):i._join(this.getValue(),function(){n(),i.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}}],value:r.value}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),e.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),a()})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),e.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:[u.trigger.getKeyword()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void l()}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&delete a[n[e]],BI.isNull(o[n[e]])&&s.push(t)}),u.storeValue.value=s.concat(BI.values(a)),l()})},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void t()}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.adapter.setStartValue(e)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_list",BI.MultiSelectInsertList)},function(e,t){BI.MultiSelectInsertNoBarList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertNoBarList.superclass._init.apply(this,arguments);var i=this,r=this.options;this.storeValue={type:BI.Selection.Multi,value:r.value||[]};var n=function(){BI.isKey(i._startValue)&&(i.storeValue.type===BI.Selection.All?BI.remove(i.storeValue.value,i._startValue):BI.pushDistinct(i.storeValue.value,i._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_no_bar_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:r.itemsCreator,valueFormatter:r.valueFormatter,logic:{dynamic:!1},el:{},value:{type:BI.Selection.Multi,value:r.value||[]}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){i.storeValue=this.getValue(),n(),i.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:r.valueFormatter,keywordGetter:function(){return i.trigger.getKeyword()},itemsCreator:function(e,t){var n=i.trigger.getKeyword();BI.isNotEmptyString(n)&&(e.keywords=[n],this.setKeyword(e.keywords[0]),r.itemsCreator(e,t))},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var e=i.trigger.getKeyword();i.trigger.hasMatched()||(i.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(i.storeValue.value,e),i._showAdapter(),i.adapter.setValue(i.storeValue),i.adapter.populate(),i.storeValue.type===BI.Selection.Multi&&i.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){i._showSearcherPane(),i._setStartValue(""),this.setValue(BI.deepClone(i.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){i._showAdapter(),i._setStartValue(""),i.adapter.setValue(i.storeValue),i.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var e=this.getKeyword();this.hasMatched()&&i._join({type:BI.Selection.Multi,value:[e]},function(){i.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(i.storeValue.value,e),i._showAdapter(),i.adapter.setValue(i.storeValue),i._setStartValue(e),n(),i.adapter.populate(),i._setStartValue(""),i.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var e=this.getKeywords(),t=BI.last(e);0<(e=BI.initial(e||[])).length&&i._joinKeywords(e,function(){BI.isEndWithBlank(t)?(i.adapter.setValue(i.storeValue),n(),i.adapter.populate(),i._setStartValue("")):(i.adapter.setValue(i.storeValue),n()),i.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(e,t){t instanceof BI.MultiSelectBar?i._joinAll(this.getValue(),function(){n(),i.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}):i._join(this.getValue(),function(){n(),i.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}}],value:{type:BI.Selection.Multi,value:r.value||[]}}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),e.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),a()})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),e.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:[u.trigger.getKeyword()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void l()}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&delete a[n[e]],BI.isNull(o[n[e]])&&s.push(t)}),u.storeValue.value=s.concat(BI.values(a)),l()})},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void t()}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.adapter.setStartValue(e)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(e){this.storeValue={type:BI.Selection.Multi,value:e||[]},this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_no_bar_list",BI.MultiSelectInsertNoBarList)},function(e,t){BI.MultiSelectList=BI.inherit(BI.Widget,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectList.superclass._init.apply(this,arguments);var i=this,r=this.options;this.storeValue={};var n=function(){BI.isKey(i._startValue)&&(i.storeValue.type===BI.Selection.All?BI.remove(i.storeValue.value,i._startValue):BI.pushDistinct(i.storeValue.value,i._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:r.itemsCreator,valueFormatter:r.valueFormatter,logic:{dynamic:!1},el:{}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){i.storeValue=this.getValue(),i._adjust(function(){n(),i.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:r.valueFormatter,keywordGetter:function(){return i.trigger.getKeyword()},itemsCreator:function(e,t){var n=i.trigger.getKeyword();BI.isNotEmptyString(n)&&(e.keywords=[n],this.setKeyword(e.keywords[0]),r.itemsCreator(e,t))}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){i._showSearcherPane(),i._setStartValue(""),this.setValue(BI.deepClone(i.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){i._showAdapter(),i._setStartValue(""),i.adapter.setValue(i.storeValue),i.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var e=this.getKeyword();this.hasMatched()&&i._join({type:BI.Selection.Multi,value:[e]},function(){i._showAdapter(),i.adapter.setValue(i.storeValue),i._setStartValue(e),n(),i.adapter.populate(),i._setStartValue(""),i.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var e=this.getKeyword(),t=BI.last(e);0<(e=BI.initial(e||[])).length&&i._joinKeywords(e,function(){BI.isEndWithBlank(t)?(i.adapter.setValue(i.storeValue),n(),i.adapter.populate(),i._setStartValue("")):(i.adapter.setValue(i.storeValue),n()),i.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(e,t){t instanceof BI.MultiSelectBar?i._joinAll(this.getValue(),function(){n(),i.fireEvent(BI.MultiSelectList.EVENT_CHANGE)}):i._join(this.getValue(),function(){n(),i.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),e.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),o._adjust(a)})},_joinAll:function(t,l){var u=this,e=this.options;this._assertValue(t),e.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void u._adjust(l)}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&delete a[n[e]],BI.isNull(o[n[e]])&&s.push(t)}),u.storeValue.value=s.concat(BI.values(a)),u._adjust(l)})},_adjust:function(t){var n=this,e=this.options;function i(){n.storeValue.type===BI.Selection.All&&n.storeValue.value.length>=n._count?n.storeValue={type:BI.Selection.Multi,value:[]}:n.storeValue.type===BI.Selection.Multi&&n.storeValue.value.length>=n._count&&(n.storeValue={type:BI.Selection.All,value:[]})}this._count?(i(),t()):e.itemsCreator({type:BI.MultiSelectList.REQ_GET_DATA_LENGTH},function(e){n._count=e.count,i(),t()})},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void n._adjust(t)}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.adapter.setStartValue(e)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_list",BI.MultiSelectList)},function(e,t){BI.MultiSelectTree=BI.inherit(BI.Single,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTree.superclass._init.apply(this,arguments);var n=this,i=this.options;this.storeValue={value:{}},this.adapter=BI.createWidget({type:"bi.multi_select_tree_popup",itemsCreator:i.itemsCreator}),this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE,function(){n.searcher.isSearching()?n.storeValue={value:n.searcherPane.getValue()}:n.storeValue={value:n.adapter.getValue()},n.setSelectedValue(n.storeValue.value),n.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_tree_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",keywordGetter:function(){return n.searcher.getKeyword()},itemsCreator:function(e,t){e.keyword=n.searcher.getKeyword(),i.itemsCreator(e,t)}}),this.searcherPane.setVisible(!1),this.searcher=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t({keyword:n.searcher.getKeyword()})},adapter:this.adapter,popup:this.searcherPane,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){n._showSearcherPane()}},{eventName:BI.Searcher.EVENT_STOP,action:function(){n._showAdapter(),BI.nextTick(function(){n.adapter.populate()})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){n.searcher.isSearching()?n.storeValue={value:n.searcherPane.getValue()}:n.storeValue={value:n.adapter.getValue()},n.setSelectedValue(n.storeValue.value),n.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){n._showAdapter(),BI.nextTick(function(){n.adapter.populate()})}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.searcher,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},resize:function(){},setSelectedValue:function(e){this.storeValue.value=e||{},this.adapter.setSelectedValue(e),this.searcherPane.setSelectedValue(e),this.searcher.setValue({value:e||{}})},setValue:function(e){this.adapter.setValue(e)},stopSearch:function(){this.searcher.stopSearch()},updateValue:function(e){this.adapter.updateValue(e)},getValue:function(){return this.storeValue.value},populate:function(){this.searcher.populate.apply(this.searcher,arguments),this.adapter.populate.apply(this.adapter,arguments)}}),BI.MultiSelectTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree",BI.MultiSelectTree)},function(e,t){BI.MultiSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTreePopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.popup=BI.createWidget({type:"bi.async_tree",element:this,itemsCreator:t.itemsCreator}),this.popup.on(BI.TreeView.EVENT_AFTERINIT,function(){e.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT)}),this.popup.on(BI.TreeView.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE)})},hasChecked:function(){return this.popup.hasChecked()},getValue:function(){return this.popup.getValue()},setValue:function(e){e=e||{},this.popup.setValue(e)},setSelectedValue:function(e){e=e||{},this.popup.setSelectedValue(e)},updateValue:function(e){this.popup.updateValue(e),this.popup.refresh()},populate:function(e){this.popup.stroke(e)}}),BI.MultiSelectTreePopup.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.MultiSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree_popup",BI.MultiSelectTreePopup)},function(e,t){BI.MultiTreeCheckPane=BI.inherit(BI.Pane,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-pane bi-background",onClickContinueSelect:BI.emptyFn,el:{type:"bi.display_tree"}})},_init:function(){BI.MultiTreeCheckPane.superclass._init.apply(this,arguments);var e=this,n=this.options;this.selectedValues={};var t=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-tree-check-selected"});t.on(BI.TextButton.EVENT_CHANGE,function(){n.onClickContinueSelect(),BI.nextTick(function(){e.empty()})});var i=BI.createWidget({type:"bi.left",cls:"multi-tree-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap,tgap:this.constants.tgap},{el:t,lgap:this.constants.lgap,tgap:this.constants.tgap}]});this.display=BI.createWidget(n.el,{type:"bi.display_tree",cls:"bi-multi-tree-display",itemsCreator:function(e,t){e.type=BI.TreeView.REQ_TYPE_GET_SELECTED_DATA,n.itemsCreator(e,t)},value:(n.value||{}).value}),this.display.on(BI.Events.AFTERINIT,function(){e.fireEvent(BI.Events.AFTERINIT)}),this.display.on(BI.TreeView.EVENT_INIT,function(){i.setVisible(!1)}),this.display.on(BI.TreeView.EVENT_AFTERINIT,function(){i.setVisible(!0)}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:i},{height:"fill",el:this.display}]})},empty:function(){this.display.empty()},populate:function(e){this.display.stroke(e)},setValue:function(e){e=e||{},this.display.setSelectedValue(e.value)},getValue:function(){}}),BI.MultiTreeCheckPane.EVENT_CONTINUE_CLICK="EVENT_CONTINUE_CLICK",BI.shortcut("bi.multi_tree_check_pane",BI.MultiTreeCheckPane)},function(e,t){BI.MultiTreeCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,isNeedAdjustWidth:!0})},_init:function(){BI.MultiTreeCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,t=!1,i=!1;this.storeValue={value:e.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:e.allowEdit,height:e.height,valueFormatter:e.valueFormatter,text:e.text,watermark:e.watermark,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",itemsCreator:e.itemsCreator},value:{value:e.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!e.allowEdit,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){n.numberCounter.adjustView(),(t=!0)===i&&l()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){r=!0;var e={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};n.trigger.getSearcher().setState(e),n.numberCounter.setButtonChecked(e),n.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM,n.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){n.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){a=!0,n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,onLoaded:function(){BI.nextTick(function(){n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})},maxWidth:e.isNeedAdjustWidth?"auto":500},isNeedAdjustWidth:e.isNeedAdjustWidth,value:{value:e.value||{}},hideChecker:function(e){return 0===u.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}});var r=!1,a=!1,o=function(){return n.trigger.getSearcher().isSearching()},s=function(){return n.combo.isViewVisible()};function l(){o()?n.storeValue={value:n.trigger.getValue()}:s()&&(n.storeValue={value:n.combo.getValue()}),n.trigger.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue)}this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){n.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){n.fireEvent(BI.MultiTreeCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){n.storeValue={value:n.combo.getValue()},this.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){n.storeValue={value:this.getValue()},n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),BI.nextTick(function(){s()&&n.combo.populate()}),n.fireEvent(BI.MultiTreeCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){n.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){n.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){n.combo.isViewVisible()||n.combo.showView()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var e=this.getSearcher().hasChecked(),t={type:BI.Selection.Multi,value:e?{1:1}:{}};this.getSearcher().setState(e?BI.Selection.Multi:BI.Selection.None),n.numberCounter.setButtonChecked(t),n.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM,n.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){o()||(!0===r&&(n.storeValue={value:n.combo.getValue()},r=!1),n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),n.populate(),n.fireEvent(BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW))}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){o()?(n._stopEditing(),n.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)):s()&&(n._stopEditing(),n.storeValue={value:n.combo.getValue()},!0===a&&(n.storeValue={value:{}}),n.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)),r=a=!1});var u=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});u.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},masker:{offset:this.constants.offset},itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,value:{value:e.value||{}}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){!1===i&&(i=!0),!0===t&&(i=null,l())}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:u,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(e){this.storeValue.value=e||{},this.combo.setValue({value:e||{}}),this.numberCounter.setValue({value:e||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_tree_combo",BI.MultiTreeCombo)},function(e,t){BI.MultiTreeInsertCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,isNeedAdjustWidth:!0})},_init:function(){BI.MultiTreeInsertCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,t=!1,i=!1;this.storeValue={value:e.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:e.allowEdit,height:e.height,valueFormatter:e.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",text:e.text,watermark:e.watermark,itemsCreator:e.itemsCreator,popup:{type:"bi.multi_tree_search_insert_pane",listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){n.storeValue.value[n.trigger.getSearcher().getKeyword()]={},n._assertShowValue(),n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),n._stopEditing()}}]}},value:{value:e.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!e.allowEdit,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){n.numberCounter.adjustView(),(t=!0)===i&&l()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){r=!0;var e={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};n.trigger.getSearcher().setState(e),n.numberCounter.setButtonChecked(e),n.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,n.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){n.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){a=!0,n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,onLoaded:function(){BI.nextTick(function(){n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})},maxWidth:e.isNeedAdjustWidth?"auto":500},isNeedAdjustWidth:e.isNeedAdjustWidth,value:{value:e.value||{}},hideChecker:function(e){return 0===u.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}});var r=!1,a=!1,o=function(){return n.trigger.getSearcher().isSearching()},s=function(){return n.combo.isViewVisible()};function l(){o()?n.storeValue={value:n.trigger.getValue()}:s()&&(n.storeValue={value:n.combo.getValue()}),n.trigger.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue)}this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){n.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){n.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){n.storeValue={value:n.combo.getValue()},this.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){n.storeValue={value:this.getValue()},n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),BI.nextTick(function(){s()&&n.combo.populate()}),n.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){n.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){n.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var e=this.getSearcher().hasChecked(),t={type:BI.Selection.Multi,value:e?{1:1}:{}};this.getSearcher().setState(e?BI.Selection.Multi:BI.Selection.None),n.numberCounter.setButtonChecked(t),n.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,n.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){o()||(!0===r&&(n.storeValue={value:n.combo.getValue()},r=!1),n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),n.populate(),n.fireEvent(BI.MultiTreeInsertCombo.EVENT_BEFORE_POPUPVIEW))}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){o()?(n._stopEditing(),n.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)):s()&&(n._stopEditing(),n.storeValue={value:n.combo.getValue()},!0===a&&(n.storeValue={value:{}}),n.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)),r=a=!1});var u=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});u.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:e.itemsCreator,masker:{offset:this.constants.offset},valueFormatter:e.valueFormatter,value:e.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){!1===i&&(i=!0),!0===t&&(i=null,l())}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:u,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(e){this.storeValue.value=e||{},this.combo.setValue({value:e||{}}),this.numberCounter.setValue({value:e||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MultiTreeInsertCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_tree_insert_combo",BI.MultiTreeInsertCombo)},function(e,t){BI.MultiTreeListCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-list-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,allowInsertValue:!0,isNeedAdjustWidth:!0})},_init:function(){BI.MultiTreeListCombo.superclass._init.apply(this,arguments);var n=this,e=this.options,t=!1,i=!1;this.storeValue={value:e.value||[]},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:e.allowEdit,text:e.text,watermark:e.watermark,height:e.height,valueFormatter:e.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_list_tree_searcher",itemsCreator:e.itemsCreator,popup:{type:e.allowInsertValue?"bi.multi_tree_search_insert_pane":"bi.multi_tree_search_pane",el:{type:"bi.list_part_tree"},listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){n.storeValue.value.unshift([n.trigger.getSearcher().getKeyword()]),n._assertShowValue(),n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),n._stopEditing()}}]}},switcher:{el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane",el:{type:"bi.list_display_tree"},itemsCreator:e.itemsCreator}},value:{value:e.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!e.allowEdit,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){n.popup=this,n.trigger.setAdapter(this),n.numberCounter.setAdapter(this)},el:{type:"bi.list_async_tree"},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){n.numberCounter.adjustView(),(t=!0)===i&&l()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){r=!0;var e={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():[]};n.trigger.getSearcher().setState(e),n.numberCounter.setButtonChecked(e),n.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,n.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){n.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){a=!0,n.setValue(),n._defaultState()}}],itemsCreator:e.itemsCreator,onLoaded:function(){BI.nextTick(function(){n.numberCounter.adjustView(),n.trigger.getSearcher().adjustView()})},maxWidth:e.isNeedAdjustWidth?"auto":500},isNeedAdjustWidth:e.isNeedAdjustWidth,value:{value:e.value||{}},hideChecker:function(e){return 0===u.element.find(e.target).length&&0===n.numberCounter.element.find(e.target).length}});var r=!1,a=!1,o=function(){return n.trigger.getSearcher().isSearching()},s=function(){return n.combo.isViewVisible()};function l(){o()?n.storeValue={value:n.trigger.getValue()}:s()&&(n.storeValue={value:n.combo.getValue()}),n.trigger.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue)}this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){n.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){n.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){n.storeValue={value:n.combo.getValue()},this.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){n.storeValue={value:this.getValue()},n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),BI.nextTick(function(){s()&&n.combo.populate()}),n.fireEvent(BI.MultiTreeListCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){n.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){n.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var e=this.getSearcher().hasChecked(),t={type:BI.Selection.Multi,value:e?{1:1}:{}};this.getSearcher().setState(e?BI.Selection.Multi:BI.Selection.None),n.numberCounter.setButtonChecked(t),n.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,n.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){o()||(!0===r&&(n.storeValue={value:n.combo.getValue()},r=!1),n.combo.setValue(n.storeValue),n.numberCounter.setValue(n.storeValue),n.populate(),n.fireEvent(BI.MultiTreeListCombo.EVENT_BEFORE_POPUPVIEW))}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){o()?(n.trigger.stopEditing(),n.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)):s()&&(n._stopEditing(),n.storeValue={value:n.combo.getValue()},!0===a&&(n.storeValue={value:[]}),n.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)),r=a=!1});var u=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});u.on(BI.TriggerIconButton.EVENT_CHANGE,function(){n.numberCounter.hideView(),n.combo.isViewVisible()?n.combo.hideView():n.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:e.itemsCreator,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:e.valueFormatter,value:e.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){n.combo.isViewVisible()||n.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){!1===i&&(i=!0),!0===t&&(i=null,l())}),this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){n.trigger.refreshPlaceHolderWidth(!0===e?n.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){0<n.trigger.element.find(e.target).length&&n.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:u,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:e.height,top:0,height:e.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(e){this.storeValue.value=e||[],this.combo.setValue({value:e||[]}),this.numberCounter.setValue({value:e||[]})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeListCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeListCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeListCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeListCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeListCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeListCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MultiTreeListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_tree_list_combo",BI.MultiTreeListCombo)},function(e,t){BI.MultiTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-popup",maxWidth:"auto",minWidth:140,maxHeight:400,onLoaded:BI.emptyFn,el:{type:"bi.async_tree"}})},_init:function(){BI.MultiTreePopup.superclass._init.apply(this,arguments);var t=this,e=this.options,n=e.value;this.selectedValues={},this.tree=BI.createWidget(e.el,{type:"bi.async_tree",height:400,cls:"popup-view-tree",itemsCreator:e.itemsCreator,onLoaded:e.onLoaded,value:n.value||{}}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",element:this,stopPropagation:!1,maxWidth:e.maxWidth,minWidth:e.minWidth,maxHeight:e.maxHeight,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.tree}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(e){switch(e){case 0:t.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CLEAR);break;case 1:t.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CONFIRM)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){t.fireEvent(BI.MultiTreePopup.EVENT_CHANGE)}),this.tree.on(BI.TreeView.EVENT_AFTERINIT,function(){t.fireEvent(BI.MultiTreePopup.EVENT_AFTERINIT)})},getValue:function(){return this.tree.getValue()},setValue:function(e){e=e||{},this.tree.setSelectedValue(e.value)},populate:function(e){this.tree.stroke(e)},hasChecked:function(){return this.tree.hasChecked()},resetHeight:function(e){this.popupView.resetHeight(e)},resetWidth:function(e){this.popupView.resetWidth(e)}}),BI.MultiTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreePopup.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreePopup.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreePopup.EVENT_AFTERINIT="EVENT_AFTERINIT",BI.shortcut("bi.multi_tree_popup_view",BI.MultiTreePopup)},function(e,t){BI.MultiTreeCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiTreeCheckSelectedButton.superclass._init.apply(this,arguments);var e=this;this.indicator=BI.createWidget({type:"bi.icon_button",cls:"check-font trigger-check-selected icon-size-12",width:15,height:15,stopPropagation:!0}),this.checkSelected=BI.createWidget({type:"bi.text_button",cls:"trigger-check-selected",invisible:!0,hgap:4,text:BI.i18nText("BI-Check_Selected"),textAlign:"center",textHeight:15}),this.checkSelected.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.checkSelected.on(BI.TextButton.EVENT_CHANGE,function(){e.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.horizontal",element:this,items:[this.indicator,this.checkSelected]}),this.element.hover(function(){e.indicator.setVisible(!1),e.checkSelected.setVisible(!0)},function(){e.indicator.setVisible(!0),e.checkSelected.setVisible(!1)}),this.setVisible(!1)},setValue:function(e){e=e||{};var t=0<BI.size(e.value);this.setVisible(t)}}),BI.MultiTreeCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_tree_check_selected_button",BI.MultiTreeCheckSelectedButton)},function(e,t){BI.MultiTreeSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24},props:{baseCls:"bi-multi-tree-search-insert-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,el:{type:"bi.part_tree"}},render:function(){var n=this,i=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_button",invisible:!0,ref:function(e){n.addTip=e},text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",handler:function(){n.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,i.keywordGetter())}},top:5,left:0,right:0},{el:BI.extend({type:"bi.part_tree",tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(e,t){e.keyword=i.keywordGetter(),i.itemsCreator(e,function(e){t(e),n.setKeyword(i.keywordGetter(),e.items)})},ref:function(e){n.partTree=e},value:i.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.TreeView.EVENT_CHANGE,action:function(){n.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE)}}]},i.el),left:0,top:0,bottom:0,right:0}]}},setKeyword:function(e,t){var n=BI.isEmptyArray(t);this.addTip.setVisible(n),this.partTree.setVisible(!n),n&&this.addTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",e))},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(e){this.setSelectedValue(e.value)},setSelectedValue:function(e){e=e||{},this.partTree.setSelectedValue(e)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(e){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_tree_search_insert_pane",BI.MultiTreeSearchInsertPane)},function(e,t){BI.MultiTreeSearchPane=BI.inherit(BI.Pane,{props:{baseCls:"bi-multi-tree-search-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn},render:function(){var t=this,n=this.options;return BI.extend({type:"bi.part_tree",element:this,tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(e,t){e.keyword=n.keywordGetter(),n.itemsCreator(e,t)},value:n.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.TreeView.EVENT_CHANGE,action:function(){t.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE)}}],ref:function(e){t.partTree=e}},n.el)},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(e){this.setSelectedValue(e.value)},setSelectedValue:function(e){e=e||{},this.partTree.setSelectedValue(e)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(e){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_tree_search_pane",BI.MultiTreeSearchPane)},function(e,t){BI.MultiListTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(e){return e},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiListTreeSearcher.superclass._init.apply(this,arguments);var n=this,i=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",height:i.height,text:i.text,watermark:i.watermark,el:{type:"bi.simple_state_editor",height:i.height}}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t({keyword:n.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return n.editor.getValue()},itemsCreator:function(e,t){e.keyword=n.editor.getValue(),i.itemsCreator(e,t)},value:i.value},i.popup),adapter:i.adapter,masker:i.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){n.fireEvent(BI.MultiListTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),n.fireEvent(BI.MultiListTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){n.fireEvent(BI.MultiListTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){n.fireEvent(BI.MultiListTreeSearcher.EVENT_CHANGE,arguments)}),BI.isNotNull(i.value)&&this.setState(i.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(e){this.searcher.setAdapter(e)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(e){var i=this.options;(e=e||{}).value||(e.value=[]);var r,a=0;BI.isNumber(e)?this.editor.setState(e):0===BI.size(e.value)?this.editor.setState(BI.Selection.None):(r="",BI.each(e.value,function(e,t){var n=BI.last(t);r+=(i.valueFormatter(n+"")||n)+"; ",a++}),20<a?this.editor.setState(BI.Selection.Multi):this.editor.setState(r))},getState:function(){return this.editor.getState()},setValue:function(e){this.setState(e),this.searcher.setValue(e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(e){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiListTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiListTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiListTreeSearcher.EVENT_START="EVENT_START",BI.MultiListTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiListTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_list_tree_searcher",BI.MultiListTreeSearcher)},function(e,t){BI.MultiTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(e){return e},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiTreeSearcher.superclass._init.apply(this,arguments);var n=this,i=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",watermark:i.watermark,height:i.height,el:{type:"bi.simple_state_editor",text:i.text,height:i.height},listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){n.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){n.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t({keyword:n.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return n.editor.getValue()},itemsCreator:function(e,t){e.keyword=n.editor.getValue(),i.itemsCreator(e,t)},value:i.value},i.popup),adapter:i.adapter,masker:i.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){n.fireEvent(BI.MultiTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){n.fireEvent(BI.MultiTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){n.fireEvent(BI.MultiTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){n.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var e=this.getKeywords();n.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING,e)}),BI.isNotNull(i.value)&&this.setState(i.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(e){this.searcher.setAdapter(e)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(e){var s=this.options;(e=e||{}).value||(e.value={});var i,l=0;BI.isNumber(e)?this.editor.setState(e):0===BI.size(e.value)?this.editor.setState(BI.Selection.None):(i="",BI.each(e.value,function(e,t){var n=function o(e){var i="";var r=0,a=BI.size(e);BI.each(e,function(e,t){r++;var n=o(t);i+=(s.valueFormatter(e+"")||e)+(""===n?"":":"+n)+(r===a?"":","),""===n&&l++});return i}(t);i+=(s.valueFormatter(e+"")||e)+(""===n?"":":"+n)+"; ",""===n&&l++}),20<l?this.editor.setState(BI.Selection.Multi):this.editor.setState(i))},getState:function(){return this.editor.getState()},setValue:function(e){this.setState(e),this.searcher.setValue(e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(e){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiTreeSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearcher.EVENT_START="EVENT_START",BI.MultiTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_tree_searcher",BI.MultiTreeSearcher)},function(e,t){BI.NumberEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-number-editor bi-border bi-focus-shadow",validationChecker:function(){return!0},valueFormatter:function(e){return e},value:0,allowBlank:!1,errorText:"",step:1})},_init:function(){BI.NumberEditor.superclass._init.apply(this,arguments);var e=this,t=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",height:t.height-2,allowBlank:t.allowBlank,value:t.valueFormatter(t.value),validationChecker:t.validationChecker,errorText:t.errorText}),this.editor.on(BI.TextEditor.EVENT_CHANGE,function(){e.fireEvent(BI.NumberEditor.EVENT_CHANGE)}),this.editor.on(BI.TextEditor.EVENT_ERROR,function(){t.value=BI.parseFloat(this.getLastValidValue())}),this.editor.on(BI.TextEditor.EVENT_VALID,function(){t.value=BI.parseFloat(this.getValue())}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){e.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",forceNotSelected:!0,trigger:"lclick,",cls:"add-up-font top-button bi-border-left bi-list-item-active2 icon-size-12"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){e._finetuning(t.step),e.fireEvent(BI.NumberEditor.EVENT_CHANGE),e.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",trigger:"lclick,",forceNotSelected:!0,cls:"minus-down-font bottom-button bi-border-left bi-list-item-active2 icon-size-12"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){e._finetuning(-t.step),e.fireEvent(BI.NumberEditor.EVENT_CHANGE),e.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),BI.createWidget({type:"bi.htape",height:t.height-2,element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:23}]})},focus:function(){this.editor.focus()},isEditing:function(){return this.editor.isEditing()},_finetuning:function(e){var t=BI.parseFloat(this.getValue());this.setValue(BI.add(t,e))},setUpEnable:function(e){this.topBtn.setEnable(!!e)},setDownEnable:function(e){this.bottomBtn.setEnable(!!e)},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.options.value},setValue:function(e){var t=this.options;t.value=e,this.editor.setValue(t.valueFormatter(e))}}),BI.NumberEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.number_editor",BI.NumberEditor)},function(e,t){BI.NumberInterval=BI.inherit(BI.Single,{constants:{typeError:"typeBubble",numberError:"numberBubble",signalError:"signalBubble",editorWidth:114,columns:5,width:24,rows:1,numberErrorCls:"number-error",border:1,less:0,less_equal:1,numTip:"",adjustYOffset:2},_defaultConfig:function(){var e=BI.NumberInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-number-interval"+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),height:24,validation:"valid",closeMin:!0,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){var t=this,n=this.constants,e=this.options;BI.NumberInterval.superclass._init.apply(this,arguments),this.smallEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:e.height-2,watermark:e.watermark,allowBlank:e.allowBlank,value:e.min,level:"warning",tipType:"success",title:function(){return t.smallEditor&&t.smallEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(e){return!!BI.isNumeric(e)||(t.smallEditorBubbleType=n.typeError,!1)},cls:"number-interval-small-editor bi-border"}),this.smallTip=BI.createWidget({type:"bi.label",text:e.numTip,height:e.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.smallEditor.element,items:[{el:this.smallTip,top:0,right:5}]}),this.bigEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:e.height-2,watermark:e.watermark,allowBlank:e.allowBlank,value:e.max,title:function(){return t.bigEditor&&t.bigEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(e){return!!BI.isNumeric(e)||(t.bigEditorBubbleType=n.typeError,!1)},cls:"number-interval-big-editor bi-border"}),this.bigTip=BI.createWidget({type:"bi.label",text:e.numTip,height:e.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.bigEditor.element,items:[{el:this.bigTip,top:0,right:5}]}),this.smallCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-small-combo bi-border-top bi-border-bottom bi-border-right",height:e.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),!0===e.closeMin?this.smallCombo.setValue(1):this.smallCombo.setValue(0),this.bigCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-big-combo bi-border-top bi-border-bottom bi-border-left",height:e.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),!0===e.closeMax?this.bigCombo.setValue(1):this.bigCombo.setValue(0),this.label=BI.createWidget({type:"bi.label",text:BI.i18nText("BI-Basic_Value"),textHeight:e.height-2*n.border,width:n.width-2*n.border,height:e.height-2*n.border,level:"warning",tipType:"warning"}),this.left=BI.createWidget({type:"bi.htape",items:[{el:t.smallEditor},{el:t.smallCombo,width:n.width-n.border}]}),this.right=BI.createWidget({type:"bi.htape",items:[{el:t.bigCombo,width:n.width-n.border},{el:t.bigEditor,lgap:1}]}),BI.createWidget({element:t,type:"bi.center",hgap:15,height:e.height,items:[{type:"bi.absolute",items:[{el:t.left,left:-15,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:t.right,left:0,right:-15,top:0,bottom:0}]}]}),BI.createWidget({element:t,type:"bi.horizontal_auto",items:[t.label]}),t._setValidEvent(t.bigEditor,n.bigEditor),t._setValidEvent(t.smallEditor,n.smallEditor),t._setErrorEvent(t.bigEditor,n.bigEditor),t._setErrorEvent(t.smallEditor,n.smallEditor),t._setBlurEvent(t.bigEditor),t._setBlurEvent(t.smallEditor),t._setFocusEvent(t.bigEditor),t._setFocusEvent(t.smallEditor),t._setComboValueChangedEvent(t.bigCombo),t._setComboValueChangedEvent(t.smallCombo),t._setEditorValueChangedEvent(t.bigEditor),t._setEditorValueChangedEvent(t.smallEditor),t._checkValidation()},_checkValidation:function(){var e=this,t=this.constants,n=this.options;if(e._setTitle(""),BI.Bubbles.hide(t.typeError),BI.Bubbles.hide(t.numberError),BI.Bubbles.hide(t.signalError),!e.smallEditor.isValid()||!e.bigEditor.isValid())return e.element.removeClass("number-error"),n.validation="invalid",t.typeError;if(BI.isEmptyString(e.smallEditor.getValue())||BI.isEmptyString(e.bigEditor.getValue()))return e.element.removeClass("number-error"),n.validation="valid","";var i=parseFloat(e.smallEditor.getValue()),r=parseFloat(e.bigEditor.getValue()),a=e.bigCombo.getValue(),o=e.smallCombo.getValue();return a[0]===t.less_equal&&o[0]===t.less_equal?r<i?(e.element.addClass("number-error"),n.validation="invalid",t.numberError):(e.element.removeClass("number-error"),n.validation="valid",""):r<i?(e.element.addClass("number-error"),n.validation="invalid",t.numberError):i===r?(e.element.addClass("number-error"),n.validation="invalid",t.signalError):(e.element.removeClass("number-error"),n.validation="valid","")},_setTitle:function(e){this.label.setTitle(e)},_setFocusEvent:function(e){var t=this,n=this.constants;e.on(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,function(){switch(t._setTitle(""),t._checkValidation()){case n.typeError:BI.Bubbles.show(n.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset});break;case n.numberError:BI.Bubbles.show(n.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset});break;case n.signalError:BI.Bubbles.show(n.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset});break;default:return}})},_setBlurEvent:function(e){var t=this.constants,n=this;e.on(BI.NumberIntervalSingleEidtor.EVENT_BLUR,function(){switch(BI.Bubbles.hide(t.typeError),BI.Bubbles.hide(t.numberError),BI.Bubbles.hide(t.signalError),n._checkValidation()){case t.typeError:n._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));break;case t.numberError:n._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));break;case t.signalError:n._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));break;default:n._setTitle("")}})},_setErrorEvent:function(e){var t=this.constants,n=this;e.on(BI.NumberIntervalSingleEidtor.EVENT_ERROR,function(){n._checkValidation(),BI.Bubbles.show(t.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),n,{offsetStyle:"left",adjustYOffset:t.adjustYOffset}),n.fireEvent(BI.NumberInterval.EVENT_ERROR)})},_setValidEvent:function(e){var t=this,n=this.constants;e.on(BI.NumberIntervalSingleEidtor.EVENT_VALID,function(){switch(t._checkValidation()){case n.numberError:BI.Bubbles.show(n.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset}),t.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case n.signalError:BI.Bubbles.show(n.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset}),t.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:t.fireEvent(BI.NumberInterval.EVENT_VALID)}})},_setEditorValueChangedEvent:function(e){var t=this,n=this.constants;e.on(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,function(){switch(t._checkValidation()){case n.typeError:BI.Bubbles.show(n.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset});break;case n.numberError:BI.Bubbles.show(n.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset});break;case n.signalError:BI.Bubbles.show(n.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),t,{offsetStyle:"left",adjustYOffset:n.adjustYOffset})}t.fireEvent(BI.NumberInterval.EVENT_CHANGE)}),e.on(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,function(){t.fireEvent(BI.NumberInterval.EVENT_CONFIRM)})},_setComboValueChangedEvent:function(e){var t=this,n=this.constants;e.on(BI.IconCombo.EVENT_CHANGE,function(){switch(t._checkValidation()){case n.typeError:t._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data")),t.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case n.numberError:t._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value")),t.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case n.signalError:t._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value")),t.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:t.fireEvent(BI.NumberInterval.EVENT_CHANGE),t.fireEvent(BI.NumberInterval.EVENT_CONFIRM),t.fireEvent(BI.NumberInterval.EVENT_VALID)}})},isStateValid:function(){return"valid"===this.options.validation},setMinEnable:function(e){this.smallEditor.setEnable(e)},setCloseMinEnable:function(e){this.smallCombo.setEnable(e)},setMaxEnable:function(e){this.bigEditor.setEnable(e)},setCloseMaxEnable:function(e){this.bigCombo.setEnable(e)},showNumTip:function(){this.smallTip.setVisible(!0),this.bigTip.setVisible(!0)},hideNumTip:function(){this.smallTip.setVisible(!1),this.bigTip.setVisible(!1)},setNumTip:function(e){this.smallTip.setText(e),this.bigTip.setText(e)},getNumTip:function(){return this.smallTip.getText()},setValue:function(e){e=e||{};var t;(BI.isNumeric(e.min)||BI.isEmptyString(e.min))&&this.smallEditor.setValue(e.min),BI.isNotNull(e.min)||this.smallEditor.setValue(""),(BI.isNumeric(e.max)||BI.isEmptyString(e.max))&&this.bigEditor.setValue(e.max),BI.isNotNull(e.max)||this.bigEditor.setValue(""),BI.isNull(e.closeMin)||(t=!0===e.closeMin?1:0,this.smallCombo.setValue(t)),BI.isNull(e.closeMax)||(t=!0===e.closeMax?1:0,this.bigCombo.setValue(t)),this._checkValidation()},getValue:function(){var e={},t=this.smallCombo.getValue(),n=this.bigCombo.getValue();return e.min=this.smallEditor.getValue(),e.max=this.bigEditor.getValue(),0===t[0]?e.closeMin=!1:e.closeMin=!0,0===n[0]?e.closeMax=!1:e.closeMax=!0,e},destroyed:function(){var e=this.constants;BI.Bubbles.remove(e.typeError),BI.Bubbles.remove(e.numberError),BI.Bubbles.remove(e.signalError)}}),BI.NumberInterval.EVENT_CHANGE="EVENT_CHANGE",BI.NumberInterval.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberInterval.EVENT_VALID="EVENT_VALID",BI.NumberInterval.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.number_interval",BI.NumberInterval)},function(e,t){BI.NumberIntervalSingleEidtor=BI.inherit(BI.Single,{props:{baseCls:"bi-number-interval-single-editor",tipType:"success",title:""},render:function(){var t=this,e=this.options;return{type:"bi.vertical",items:[{type:"bi.editor",ref:function(e){t.editor=e},height:e.height-2,watermark:e.watermark,allowBlank:e.allowBlank,value:e.value,quitChecker:e.quitChecker,validationChecker:e.validationChecker,listeners:[{eventName:BI.Editor.EVENT_ERROR,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_ERROR,arguments)}},{eventName:BI.Editor.EVENT_FOCUS,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,arguments)}},{eventName:BI.Editor.EVENT_BLUR,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_BLUR,arguments)}},{eventName:BI.Editor.EVENT_VALID,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_VALID,arguments)}},{eventName:BI.Editor.EVENT_CHANGE,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,arguments)}},{eventName:BI.Editor.EVENT_CONFIRM,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,arguments)}},{eventName:BI.Editor.EVENT_CHANGE_CONFIRM,action:function(){t.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM,arguments)}}]}]}},isValid:function(){return this.editor.isValid()},getValue:function(){return this.editor.getValue()},setValue:function(e){return this.editor.setValue(e)}}),BI.NumberIntervalSingleEidtor.EVENT_FOCUS="EVENT_FOCUS",BI.NumberIntervalSingleEidtor.EVENT_BLUR="EVENT_BLUR",BI.NumberIntervalSingleEidtor.EVENT_ERROR="EVENT_ERROR",BI.NumberIntervalSingleEidtor.EVENT_VALID="EVENT_VALID",BI.NumberIntervalSingleEidtor.EVENT_CHANGE="EVENT_CHANGE",BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.NumberIntervalSingleEidtor.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.number_interval_single_editor",BI.NumberIntervalSingleEidtor)},function(e,t){BI.SearchMultiTextValueCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo bi-search-multi-text-value-combo",height:24,items:[]})},_init:function(){BI.SearchMultiTextValueCombo.superclass._init.apply(this,arguments);var i=this,e=this.options,n=function(){BI.isKey(i._startValue)&&(i.storeValue.type===BI.Selection.All?BI.remove(i.storeValue.value,i._startValue):BI.pushDistinct(i.storeValue.value,i._startValue)),i._updateAllValue(),i._checkError(),i.trigger.getSearcher().setState(i.storeValue),i.trigger.getCounter().setButtonChecked(i.storeValue)};this.storeValue=BI.deepClone(e.value||{}),this._updateAllValue(),this._assertValue(this.storeValue),this._checkError(),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.search_multi_select_trigger",text:e.text,height:e.height,masker:{offset:{left:0,top:0,right:0,bottom:25}},allValueGetter:function(){return i.allValue},valueFormatter:e.valueFormatter,itemsCreator:function(t,n){i._itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(BI.deepClone(i.getValue())),n.apply(i,arguments)})},value:this.storeValue,warningTitle:e.warningTitle}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){i._setStartValue(""),this.getSearcher().setValue(i.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){i._setStartValue("")}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){var e;this.getSearcher().hasMatched()&&(e=this.getSearcher().getKeyword(),i._join({type:BI.Selection.Multi,value:[e]},function(){i.combo.setValue(i.storeValue),i._setStartValue(e),n(),i._populate(),i._setStartValue("")}))}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&i._joinKeywords(e,function(){BI.isEndWithBlank(t)?(i.combo.setValue(i.storeValue),n(),i.combo.populate(),i._setStartValue("")):(i.combo.setValue(i.storeValue),n())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(e,t){t instanceof BI.MultiSelectBar?i._joinAll(this.getValue(),function(){n()}):i._join(this.getValue(),function(){n()})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){this.getCounter().setValue(i.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){i.combo.isViewVisible()||i.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:e.container,el:this.trigger,adjustLength:1,popup:{type:"bi.search_multi_select_popup_view",ref:function(){i.popup=this,i.trigger.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){i.storeValue=this.getValue(),i._adjust(function(){n()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){i._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){i.setValue(),i._defaultState()}}],itemsCreator:BI.bind(i._itemsCreator,this),valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){i.combo.adjustWidth(),i.combo.adjustHeight(),i.trigger.getCounter().adjustView(),i.trigger.getSearcher().adjustView()})}},value:e.value,hideChecker:function(e){return 0===t.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(i.storeValue),BI.nextTick(function(){i._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){i.trigger.stopEditing(),!0===i.requesting?i.wants2Quit=!0:(n(),i.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM))});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"multi-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){i.trigger.getCounter().hideView(),i.combo.isViewVisible()?i.combo.hideView():i.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0}]}),this._checkError()},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(e){var n=this.options;(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[]),BI.remove(e.value,function(e,t){return!BI.contains(BI.map(n.items,"value"),t)})},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this;this.options;this._assertValue(this.storeValue),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&(o.storeValue.type===BI.Selection.Multi?BI.pushDistinct(o.storeValue.value,t):BI.remove(o.storeValue.value,t))}),o._adjust(a)})},_joinAll:function(t,l){var u=this;this.options;this._assertValue(t),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(e){var n=BI.map(e.items,"value");if(u.storeValue.type===t.type){var i=!1,r=u._makeMap(u.storeValue.value);return BI.each(n,function(e,t){BI.isNotNull(r[t])&&(i=!0,u.storeValue.assist&&u.storeValue.assist.push(r[t]),delete r[t])}),i&&(u.storeValue.value=BI.values(r)),void u._adjust(l)}var a=u._makeMap(u.storeValue.value),o=u._makeMap(t.value),s=[];BI.each(n,function(e,t){BI.isNotNull(a[n[e]])&&(u.storeValue.assist&&u.storeValue.assist.push(a[n[e]]),delete a[n[e]]),BI.isNull(o[n[e]])&&(BI.remove(u.storeValue.assist,t),s.push(t))}),u.storeValue.value=s.concat(BI.values(a)),u._adjust(l)})},_adjust:function(t){var n=this;this.options;function i(){n.storeValue.type===BI.Selection.All&&n.storeValue.value.length>=n._count?n.storeValue={type:BI.Selection.Multi,value:[]}:n.storeValue.type===BI.Selection.Multi&&n.storeValue.value.length>=n._count&&(n.storeValue={type:BI.Selection.All,value:[]}),n._updateAllValue(),n._checkError(),!0===n.wants2Quit&&(n.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM),n.wants2Quit=!1),n.requesting=!1}this._count?(i(),t()):this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_DATA_LENGTH},function(e){n._count=e.count,i(),t()})},_join:function(e,t){var n=this;this.options;if(this._assertValue(e),this._assertValue(this.storeValue),this.storeValue.type===e.type){var i=this._makeMap(this.storeValue.value);BI.each(e.value,function(e,t){i[t]||(n.storeValue.value.push(t),BI.remove(n.storeValue.assist,t),i[t]=t)});var r=!1;return BI.each(e.assist,function(e,t){BI.isNotNull(i[t])&&(r=!0,n.storeValue.assist&&n.storeValue.assist.push(i[t]),delete i[t])}),r&&(this.storeValue.value=BI.values(i)),void n._adjust(t)}this._joinAll(e,t)},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},_getItemsByTimes:function(e,t){for(var n=[],i=100*(t-1);e[i]&&i<100*t;i++)n.push(e[i]);return n},_hasNextByTimes:function(e,t){return 100*t<e.length},_itemsCreator:function(e,t){var n,i=this.options.items,r=(e.keywords||[]).slice();e.keyword&&r.push(e.keyword),BI.each(r,function(e,t){var n=BI.Func.getSearchResult(i,t);i=n.match.concat(n.find)}),e.selectedValues&&(n=BI.makeObject(e.selectedValues,!0),i=BI.filter(i,function(e,t){return!n[t.value]})),e.type!=BI.MultiSelectCombo.REQ_GET_ALL_DATA?e.type!=BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?t({items:this._getItemsByTimes(i,e.times),hasNext:this._hasNextByTimes(i,e.times)}):t({count:i.length}):t({items:i})},_checkError:function(){var e,n=this.storeValue.value||[];BI.isNotEmptyArray(n)?(n=BI.isArray(n)?n:[n],e=BI.find(this.allValue,function(e,t){return!BI.contains(n,t)}),BI.isNull(e)?(BI.isNotNull(this.trigger)&&this.trigger.setTipType("success"),this.element.removeClass("combo-error")):(BI.isNotNull(this.trigger)&&this.trigger.setTipType("warning"),this.element.addClass("combo-error"))):n.length===this.allValue.length?(BI.isNotNull(this.trigger)&&this.trigger.setTipType("success"),this.element.removeClass("combo-error")):(BI.isNotNull(this.trigger)&&this.trigger.setTipType("warning"),this.element.addClass("combo-error"))},_updateAllValue:function(){this.storeValue=this.storeValue||{},this.allValue=BI.deepClone(this.storeValue.value||[])},setValue:function(e){this.storeValue=BI.deepClone(e||{}),this._updateAllValue(),this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this._checkError()},getValue:function(){return BI.deepClone(this.storeValue)},_populate:function(){this._count=null,this.combo.populate()},populate:function(e){this.options.items=e,this._populate()}}),BI.extend(BI.SearchMultiTextValueCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.SearchMultiTextValueCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.search_multi_text_value_combo",BI.SearchMultiTextValueCombo)},function(e,t){BI.SearchMultiSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{}})},_init:function(){BI.SearchMultiSelectTrigger.superclass._init.apply(this,arguments);var t=this,e=this.options;e.height&&this.setHeight(e.height-2),this.searcher=BI.createWidget(e.searcher,{type:"bi.search_multi_select_searcher",height:e.height,itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,allValueGetter:e.allValueGetter,popup:{},adapter:e.adapter,masker:e.masker,value:e.value,text:e.text,tipType:e.tipType,warningTitle:e.warningTitle}),this.searcher.on(BI.MultiSelectSearcher.EVENT_START,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_CHANGE,arguments)}),this.numberCounter=BI.createWidget(e.switcher,{type:"bi.multi_select_check_selected_switcher",valueFormatter:e.valueFormatter,itemsCreator:e.itemsCreator,adapter:e.adapter,masker:e.masker,value:e.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK)}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){t.fireEvent(BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW)});var n=BI.createWidget({type:"bi.right_vertical_adapt",hgap:4,items:[{el:this.numberCounter}]}),i=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:n,width:0},{el:BI.createWidget(),width:24}]});this.numberCounter.on(BI.Events.VIEW,function(e){BI.nextTick(function(){i.attr("items")[1].width=!0===e?t.numberCounter.element.outerWidth()+8:0,i.resize()})}),this.element.click(function(e){0<t.element.find(e.target).length&&t.numberCounter.hideView()})},getCounter:function(){return this.numberCounter},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch(),this.numberCounter.hideView()},setAdapter:function(e){this.searcher.setAdapter(e),this.numberCounter.setAdapter(e)},setValue:function(e){this.searcher.setValue(e),this.numberCounter.setValue(e)},setTipType:function(e){this.searcher.setTipType(e)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SearchMultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SearchMultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectTrigger.EVENT_START="EVENT_START",BI.SearchMultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.shortcut("bi.search_multi_select_trigger",BI.SearchMultiSelectTrigger)},function(e,t){BI.SearchMultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectLoader.superclass._init.apply(this,arguments);var s=this,l=this.options,u=!1;this.storeValue=l.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",element:this,logic:l.logic,el:BI.extend({onLoaded:l.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},l.el),itemsCreator:function(r,a){var o=s._startValue;s.storeValue&&(r=BI.extend(r||{},{selectedValues:BI.isKey(o)&&s.storeValue.type===BI.Selection.Multi?s.storeValue.value.concat(o):s.storeValue.value})),l.itemsCreator(r,function(e){u=e.hasNext;var t,n,i=[];1===r.times&&s.storeValue&&(t=BI.map(s.storeValue.value,function(e,t){var n=l.valueFormatter(t)||t;return{text:n,value:t,title:n,selected:s.storeValue.type===BI.Selection.Multi}}),BI.isKey(s._startValue)&&!BI.contains(s.storeValue.value,s._startValue)&&(n=l.valueFormatter(o)||o,t.unshift({text:n,value:o,title:n,selected:!0})),i=s._createItems(t)),a(i.concat(s._createItems(e.items)),e.keyword||""),1===r.times&&s.storeValue&&(BI.isKey(o)&&(s.storeValue.type===BI.Selection.All?BI.remove(s.storeValue.value,o):BI.pushDistinct(s.storeValue.value,o)),s.setValue(s.storeValue)),1===r.times&&s._scrollToTop()})},hasNext:function(){return u},value:this.storeValue}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){s.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){s.fireEvent(BI.SearchMultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(e){return BI.createItems(e,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var e=this;BI.delay(function(){e.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(e){(e=e||{}).type||(e.type=BI.Selection.Multi),e.value||(e.value=[])},setStartValue:function(e){this._startValue=e},setValue:function(e){this.storeValue=e||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(e){arguments[0]=this._createItems(e),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(e){this.button_group.resetHeight(e)},resetWidth:function(e){this.button_group.resetWidth(e)}}),BI.SearchMultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_multi_select_loader",BI.SearchMultiSelectLoader)},function(e,t){BI.SearchMultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectPopupView.superclass._init.apply(this,arguments);var t=this,e=this.options;this.loader=BI.createWidget({type:"bi.search_multi_select_loader",itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:e.onLoaded,value:e.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:e.maxWidth,minWidth:e.minWidth,maxHeight:e.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:e.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){t.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(e){switch(e){case 0:t.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:t.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(e){this.loader.setStartValue(e)},setValue:function(e){this.popupView.setValue(e)},getValue:function(){return this.popupView.getValue()},populate:function(e){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(e){this.popupView.resetHeight(e)},resetWidth:function(e){this.popupView.resetWidth(e)}}),BI.SearchMultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.search_multi_select_popup_view",BI.SearchMultiSelectPopupView)},function(e,t){BI.SearchMultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{}})},_init:function(){BI.SearchMultiSelectSearcher.superclass._init.apply(this,arguments);var i=this,r=this.options;this.editor=BI.createWidget(r.el,{type:"bi.multi_select_editor",height:r.height,text:r.text,tipType:r.tipType,warningTitle:r.warningTitle}),this.searcher=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,element:this,height:r.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:r.valueFormatter,keywordGetter:function(){return i.editor.getValue()},itemsCreator:function(e,t){var n=i.editor.getValue();e.keywords=[n],this.setKeyword(n),r.itemsCreator(e,t)},value:r.value},r.popup),adapter:r.adapter,masker:r.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){i.fireEvent(BI.SearchMultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),i.fireEvent(BI.SearchMultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){i.fireEvent(BI.SearchMultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){i.fireEvent(BI.SearchMultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var e=this.getKeywords();i.fireEvent(BI.SearchMultiSelectSearcher.EVENT_SEARCHING,e)}),BI.isNotNull(r.value)&&this.setState(r.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(e){this.searcher.setAdapter(e)},setState:function(e){var n,i=this.options,t={};t.type=e.type,t.value=i.allValueGetter()||[],t.assist=e.assist,t.type===BI.Selection.All?0===t.value.length?this.editor.setState(BI.Selection.All):BI.size(t.assist)<=20?(n="",BI.each(t.assist,function(e,t){n+=0===e?""+(i.valueFormatter(t+"")||t):","+(i.valueFormatter(t+"")||t)}),this.editor.setState(n)):this.editor.setState(BI.Selection.Multi):0===t.value.length?this.editor.setState(BI.Selection.None):BI.size(t.value)<=20?(n="",BI.each(t.value,function(e,t){n+=0===e?""+(i.valueFormatter(t+"")||t):","+(i.valueFormatter(t+"")||t)}),this.editor.setState(n)):this.editor.setState(BI.Selection.Multi)},setTipType:function(e){this.editor.setTipType(e)},setValue:function(e){this.setState(e),this.searcher.setValue(e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(e){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SearchMultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SearchMultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectSearcher.EVENT_START="EVENT_START",BI.SearchMultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.search_multi_select_searcher",BI.SearchMultiSelectSearcher)},function(e,t){BI.SelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.SelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-select-tree-first-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(e){BI.SelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.select_tree_first_plus_group_node",BI.SelectTreeFirstPlusGroupNode)},function(e,t){BI.SelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.SelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-select-tree-last-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(e){BI.SelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.select_tree_last_plus_group_node",BI.SelectTreeLastPlusGroupNode)},function(e,t){BI.SelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.SelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-select-tree-mid-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(e){BI.SelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.select_tree_mid_plus_group_node",BI.SelectTreeMidPlusGroupNode)},function(e,t){BI.SelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var e=BI.SelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-select-tree-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreePlusGroupNode.superclass._init.apply(this,arguments);var t=this,e=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,value:e.value,keyword:e.keyword,py:e.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&(this.isSelected()?t.triggerExpand():t.triggerCollapse())});var n=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),i=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(n,BI.extend(e.logic,{items:i}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(e){BI.SelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(e)}}),BI.shortcut("bi.select_tree_plus_group_node",BI.SelectTreePlusGroupNode)},function(e,t){BI.SelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-combo",height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SelectTreeCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:t.text,height:t.height,items:t.items,value:t.value}),this.popup=BI.createWidget({type:"bi.select_level_tree",items:t.items,value:t.value}),this.combo=BI.createWidget({type:"bi.combo",container:t.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.combo.hideView()})},setValue:function(e){e=BI.isArray(e)?e:[e],this.trigger.setValue(e),this.popup.setValue(e)},getValue:function(){return this.popup.getValue()},populate:function(e){this.combo.populate(e)}}),BI.shortcut("bi.select_tree_combo",BI.SelectTreeCombo)},function(e,t){BI.SelectTreeExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-expander",trigger:"",toggle:!0,direction:"bottom",isDefaultInit:!0,el:{},popup:{}})},_init:function(){BI.SelectTreeExpander.superclass._init.apply(this,arguments);var t=this,e=this.options;this.trigger=BI.createWidget(e.el),this.trigger.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&this.isSelected()&&t.expander.setValue([]),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.expander=BI.createWidget({type:"bi.expander",element:this,trigger:e.trigger,toggle:e.toggle,direction:e.direction,isDefaultInit:e.isDefaultInit,el:this.trigger,popup:e.popup}),this.expander.on(BI.Controller.EVENT_CHANGE,function(e){e===BI.Events.CLICK&&t.trigger.setSelected(!1),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},getAllLeaves:function(){return this.expander.getAllLeaves()},setValue:function(e){BI.contains(e,this.trigger.getValue())?(this.trigger.setSelected(!0),this.expander.setValue([])):(this.trigger.setSelected(!1),this.expander.setValue(e))},getValue:function(){return this.trigger.isSelected()?[this.trigger.getValue()]:this.expander.getValue()},populate:function(e){this.expander.populate(e)}}),BI.shortcut("bi.select_tree_expander",BI.SelectTreeExpander)},function(e,t){BI.SelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_formatItems:function(i,r,a){var o=this;return BI.each(i,function(e,t){var n={layer:r};t.id=t.id||BI.UUID(),n.pNode=a,!0===t.isParent||!0===t.parent||BI.isNotEmptyArray(t.children)?(n.type="bi.select_tree_mid_plus_group_node",e===i.length-1&&(n.type="bi.select_tree_last_plus_group_node",n.isLastNode=!0),0!==e||a||(n.type="bi.select_tree_first_plus_group_node"),0===e&&e===i.length-1&&(n.type="bi.select_tree_plus_group_node"),BI.defaults(t,n),o._formatItems(t.children,r+1,t)):(n.type="bi.mid_tree_leaf_item",0!==e||a||(n.type="bi.first_tree_leaf_item"),e===i.length-1&&(n.type="bi.last_tree_leaf_item"),BI.defaults(t,n))}),i},_init:function(){BI.SelectTreePopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{type:"bi.select_tree_expander",isDefaultInit:!0},items:this._formatItems(BI.Tree.transformToTreeFormat(t.items),0),value:t.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){e.fireEvent(BI.SelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(e){e=BI.isArray(e)?e:[e],this.tree.setValue(e)},populate:function(e){BI.SelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(e)))}}),BI.SelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_level_tree",BI.SelectTreePopup)},function(e,t){BI.SingleSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-loader",allowNoSelect:!1,itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchLoader.superclass._init.apply(this,arguments);var o=this,s=this.options,l=!1;this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:s.allowNoSelect,element:this,logic:{dynamic:!1},value:s.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(r,a){o.storeValue&&(r=BI.extend(r||{},{selectedValues:[o.storeValue]})),s.itemsCreator(r,function(e){var t=e.keyword=s.keywordGetter();l=e.hasNext;var n,i=[];1===r.times&&BI.isNotNull(o.storeValue)&&(n=o._filterValues(o.storeValue),i=o._createItems(n)),a(i.concat(o._createItems(e.items)),t||""),1===r.times&&o.storeValue&&o.setValue(o.storeValue)})},hasNext:function(){return l}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){o.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){o.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(e){return BI.createItems(e,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",cls:"bi-list-item-active",logic:{dynamic:!1},height:25,selected:!1})},_filterValues:function(e){var t,n=this.options,i=n.keywordGetter(),r=e||[],a=BI.map(BI.isArray(r)?r:[r],function(e,t){return{text:n.valueFormatter(t)||t,value:t}});return BI.isKey(i)&&(r=(t=BI.Func.getSearchResult(a,i)).match.concat(t.find)),BI.map(r,function(e,t){return{text:t.text,title:t.text,value:t.value,selected:!1}})},setValue:function(e){this.storeValue=e,this.button_group.setValue(e)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(e){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(e){this.button_group.resetHeight(e)},resetWidth:function(e){this.button_group.resetWidth(e)}}),BI.SingleSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_loader",BI.SingleSelectSearchLoader)},function(e,t){BI.SingleSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchInsertPane.superclass._init.apply(this,arguments);var n=this,i=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"single-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){n.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,i.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:i.allowNoSelect,keywordGetter:i.keywordGetter,valueFormatter:i.valueFormatter,itemsCreator:function(e,t){i.itemsCreator.apply(n,[e,function(e){t(e),n.setKeyword(i.keywordGetter())}])},value:i.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(n){var i=this.options,e=BI.some(this.loader.getAllButtons(),function(e,t){return n===(i.valueFormatter(t.getValue())||t.getValue())}),t=0<this.loader.getAllButtons().length&&e;this.tooltipClick.setVisible(t),this.addNotMatchTip.setVisible(!t),t||this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",n))},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(e){this.loader.setValue(e)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(e){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.single_select_search_insert_pane",BI.SingleSelectSearchInsertPane)},function(e,t){BI.SingleSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchPane.superclass._init.apply(this,arguments);var n=this,i=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"single-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:i.allowNoSelect,keywordGetter:i.keywordGetter,valueFormatter:i.valueFormatter,itemsCreator:function(e,t){i.itemsCreator.apply(n,[e,function(e){t(e),n.setKeyword(i.keywordGetter())}])},value:i.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){n.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(e){var t,n=this.options,i=0<this.loader.getAllButtons().length&&(t=this.loader.getAllButtons()[0])&&e===(n.valueFormatter(t.getValue())||t.getValue());i!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(i),this.resizer.attr("items")[0].height=i?this.constants.height:0,this.resizer.resize())},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(e){this.loader.setValue(e)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(e){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_pane",BI.SingleSelectSearchPane)},function(e,t){BI.SingleSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectCombo.superclass._init.apply(this,arguments);var i=this,e=this.options,n=function(){BI.isKey(i._startValue)&&(i.storeValue=i._startValue),i.trigger.getSearcher().setState(i.storeValue)};this.storeValue=e.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:e.height,allowNoSelect:e.allowNoSelect,allowEdit:e.allowEdit,valueFormatter:e.valueFormatter,itemsCreator:function(t,n){e.itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(i.getValue()),n.apply(i,arguments)})},text:e.text,value:this.storeValue}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){i.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){i.fireEvent(BI.SingleSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){i._setStartValue(),this.getSearcher().setValue(i.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){i._setStartValue(),i.fireEvent(BI.SingleSelectCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){var e;this.getSearcher().hasMatched()&&(e=this.getSearcher().getKeyword(),i.combo.setValue(i.storeValue),i._setStartValue(e),n(),i.populate(),i._setStartValue())}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&i._joinKeywords(e,function(){BI.isEndWithBlank(t)?(i.combo.setValue(i.storeValue),n(),i.combo.populate(),i._setStartValue()):(i.combo.setValue(i.storeValue),n())}),i.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(e,t){i.storeValue=this.getValue(),n(),i._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){i.combo.isViewVisible()||i.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:e.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:e.allowNoSelect,ref:function(){i.popup=this,i.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){i.storeValue=this.getValue(),i._adjust(function(){n(),i._defaultState()}),i.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM)}}],itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){i.combo.adjustWidth(),i.combo.adjustHeight(),i.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===t.element.find(e.target).length},value:e.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(i.storeValue),BI.nextTick(function(){i.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){i.trigger.stopEditing(),!0===i.requesting?i.wants2Quit=!0:i.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM)});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"single-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){i.combo.isViewVisible()?i.combo.hideView():i.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(e){},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),this.requesting=!0,e.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&BI.remove(o.storeValue.value,t)}),o._adjust(a)})},_adjust:function(t){var n=this,e=this.options;function i(){!0===n.wants2Quit&&(n.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM),n.wants2Quit=!1),n.requesting=!1}this._count?(i(),t()):e.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_DATA_LENGTH},function(e){n._count=e.count,i(),t()})},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},setValue:function(e){this.storeValue=e,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this._count=null,this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_combo",BI.SingleSelectCombo)},function(e,t){BI.SingleSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectInsertCombo.superclass._init.apply(this,arguments);var i=this,e=this.options,n=function(){BI.isKey(i._startValue)&&(i.storeValue=i._startValue),i.trigger.getSearcher().setState(i.storeValue)};this.storeValue=e.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:e.height,allowNoSelect:e.allowNoSelect,allowEdit:e.allowEdit,valueFormatter:e.valueFormatter,itemsCreator:function(t,n){e.itemsCreator(t,function(e){1===t.times&&BI.isNotNull(t.keywords)&&i.trigger.setValue(i.getValue()),n.apply(i,arguments)})},text:e.text,value:this.storeValue,searcher:{popup:{type:"bi.single_select_search_insert_pane",listeners:[{eventName:BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){i.trigger.getSearcher().hasMatched()||(i.storeValue=i.trigger.getSearcher().getKeyword(),n(),i._defaultState())}}]}}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){i.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){i.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){i._setStartValue(),this.getSearcher().setValue(i.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){i._setStartValue(),i.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){var e;this.getSearcher().hasMatched()&&(e=this.getSearcher().getKeyword(),i.storeValue=e,i.combo.setValue(i.storeValue),i._setStartValue(e),n(),i.populate(),i._setStartValue())}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(e){var t=BI.last(e);0<(e=BI.initial(e||[])).length&&i._joinKeywords(e,function(){BI.isEndWithBlank(t)?(i.combo.setValue(i.storeValue),n(),i.combo.populate(),i._setStartValue()):(i.combo.setValue(i.storeValue),n())}),i.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(e,t){i.storeValue=this.getValue(),n(),i._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){i.combo.isViewVisible()||i.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:e.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:e.allowNoSelect,ref:function(){i.popup=this,i.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){i.storeValue=this.getValue(),i._adjust(function(){n(),i._defaultState()}),i.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM)}}],itemsCreator:e.itemsCreator,valueFormatter:e.valueFormatter,onLoaded:function(){BI.nextTick(function(){i.combo.adjustWidth(),i.combo.adjustHeight(),i.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===t.element.find(e.target).length},value:e.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(i.storeValue),BI.nextTick(function(){i.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){i.trigger.stopEditing(),!0===i.requesting?i.wants2Quit=!0:i.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM)});var t=BI.createWidget({type:"bi.trigger_icon_button",width:e.height,height:e.height,cls:"single-select-trigger-icon-button"});t.on(BI.TriggerIconButton.EVENT_CHANGE,function(){i.combo.isViewVisible()?i.combo.hideView():i.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:t,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(e){},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(r,a){var o=this,e=this.options;this._assertValue(this.storeValue),this.requesting=!0,e.itemsCreator({type:BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,keywords:r},function(e){var t,n,i=BI.map(e.items,"value");t=i,n=o._makeMap(t),BI.each(r,function(e,t){BI.isNotNull(n[t])&&BI.remove(o.storeValue.value,t)}),o._adjust(a)})},_adjust:function(e){var t=this;this.options;!function(){!0===t.wants2Quit&&(t.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM),t.wants2Quit=!1);t.requesting=!1}(),e()},_setStartValue:function(e){this._startValue=e,this.popup.setStartValue(e)},setValue:function(e){this.storeValue=e,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectInsertCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_insert_combo",BI.SingleSelectInsertCombo)},function(e,t){BI.SingleSelectComboItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},height:24})},_init:function(){BI.SingleSelectComboItem.superclass._init.apply(this,arguments);var e=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:e.height,height:e.height,hgap:e.hgap,text:e.text,keyword:e.keyword,value:e.value,py:e.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(e.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:26},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectComboItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(e){BI.SingleSelectComboItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(e)}}),BI.SingleSelectComboItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_combo_item",BI.SingleSelectComboItem)},function(e,t){BI.SingleSelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.list_pane"},allowNoSelect:!1})},_init:function(){BI.SingleSelectList.superclass._init.apply(this,arguments);var i=this,e=this.options;this.list=BI.createWidget(e.el,{type:"bi.list_pane",items:e.items,itemsCreator:function(t,n){1===t.times&&i.toolbar&&i.toolbar.setVisible(!1),e.itemsCreator(t,function(e){n.apply(i,arguments),1===t.times&&(i.toolbar&&i.toolbar.setVisible(e&&0<e.length),i.toolbar&&i.toolbar.setEnable(e&&0<e.length))})},onLoaded:e.onLoaded,hasNext:e.hasNext,value:e.value}),this.list.on(BI.Controller.EVENT_CHANGE,function(e,t,n){e===BI.Events.CLICK&&i.fireEvent(BI.SingleSelectList.EVENT_CHANGE,t,n),i.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(e.direction),BI.extend({scrolly:!0},e.logic,{items:e.allowNoSelect?BI.LogicFactory.createLogicItemsByDirection(e.direction,{type:"bi.single_select_item",cls:"bi-list-item-active",height:24,forceNotSelected:!0,text:BI.i18nText("BI-Basic_No_Select"),ref:function(e){i.toolbar=e},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(e){e===BI.Events.CLICK&&(i.list.setValue(),i.fireEvent(BI.SingleSelectList.EVENT_CHANGE)),i.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},this.list):BI.LogicFactory.createLogicItemsByDirection(e.direction,this.list)}))))},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(e){this.list.prependItems.apply(this.list,arguments)},addItems:function(e){this.list.addItems.apply(this.list,arguments)},setValue:function(e){this.list.setValue([e])},getValue:function(){return this.list.getValue()[0]},empty:function(){this.list.empty()},populate:function(e){this.list.populate.apply(this.list,arguments)},resetHeight:function(e){this.list.resetHeight?this.list.resetHeight(e):this.list.element.css({"max-height":e+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments)},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(e){return this.list.getIndexByValue(e)},getNodeById:function(e){return this.list.getNodeById(e)},getNodeByValue:function(e){return this.list.getNodeByValue(e)}}),BI.SingleSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_list",BI.SingleSelectList)},function(e,t){BI.SingleSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-loader",logic:{dynamic:!0},el:{height:400},allowNoSelect:!1,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectLoader.superclass._init.apply(this,arguments);var o=this,s=this.options,l=!1;this.storeValue=s.value,this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:s.allowNoSelect,logic:s.logic,el:BI.extend({onLoaded:s.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},s.el),itemsCreator:function(i,r){var a=o._startValue;BI.isNotNull(o.storeValue)&&(i=BI.extend(i||{},{selectedValues:[o.storeValue]})),s.itemsCreator(i,function(e){l=e.hasNext;var t,n=[];1===i.times&&BI.isNotNull(o.storeValue)&&(t=BI.map([o.storeValue],function(e,t){var n=s.valueFormatter(t)||t;return{text:n,value:t,title:n,selected:!0}}),n=o._createItems(t)),r(n.concat(o._createItems(e.items)),e.keyword||""),1===i.times&&o.storeValue&&(BI.isKey(a)&&(o.storeValue=a),o.setValue(o.storeValue)),1===i.times&&o._scrollToTop()})},hasNext:function(){return l},value:this.storeValue}),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){o.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){o.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(e){return BI.createItems(e,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:!1})},_scrollToTop:function(){var e=this;BI.delay(function(){e.button_group.element.scrollTop(0)},30)},_assertValue:function(e){},setStartValue:function(e){this._startValue=e},setValue:function(e){this.storeValue=e,this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(e){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(e){this.button_group.resetHeight(e)},resetWidth:function(e){this.button_group.resetWidth(e)}}),BI.SingleSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_loader",BI.SingleSelectLoader)},function(e,t){BI.SingleSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-popup-view",allowNoSelect:!1,maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectPopupView.superclass._init.apply(this,arguments);var e=this,t=this.options;this.loader=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:t.allowNoSelect,itemsCreator:t.itemsCreator,valueFormatter:t.valueFormatter,onLoaded:t.onLoaded,value:t.value}),this.popupView=BI.createWidget({type:"bi.popup_view",stopPropagation:!1,maxWidth:t.maxWidth,minWidth:t.minWidth,maxHeight:t.maxHeight,element:this,el:this.loader,value:t.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){e.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE)})},setStartValue:function(e){this.loader.setStartValue(e)},setValue:function(e){this.popupView.setValue(e)},getValue:function(){return this.popupView.getValue()},populate:function(e){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(e){this.popupView.resetHeight(e)},resetWidth:function(e){this.popupView.resetWidth(e)}}),BI.SingleSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_popup_view",BI.SingleSelectPopupView)},function(e,t){BI.SingleSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-trigger bi-border bi-border-radius",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.SingleSelectTrigger.superclass._init.apply(this,arguments);var e=this,t=this.options;t.height&&this.setHeight(t.height-2),this.searcher=BI.createWidget(t.searcher,{type:"bi.single_select_searcher",allowNoSelect:t.allowNoSelect,text:t.text,height:t.height,itemsCreator:t.itemsCreator,valueFormatter:t.valueFormatter,popup:{},adapter:t.adapter,masker:t.masker,value:t.value}),this.searcher.on(BI.SingleSelectSearcher.EVENT_START,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_START)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR,function(){e.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR,arguments)});BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:BI.createWidget(),width:24}]});t.allowEdit||BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:function(){return e.searcher.getState()}},left:0,right:24,top:0,bottom:0}]})},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(e){this.searcher.setAdapter(e)},setValue:function(e){this.searcher.setValue(e)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SingleSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SingleSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectTrigger.EVENT_START="EVENT_START",BI.SingleSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SingleSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.SingleSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.single_select_trigger",BI.SingleSelectTrigger)},function(e,t){BI.SingleSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectInsertList.superclass._init.apply(this,arguments);var n=this,i=this.options;this.storeValue=i.value;var r=function(){BI.isKey(n._startValue)&&(n.storeValue=n._startValue)};this.adapter=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:i.allowNoSelect,cls:"popup-single-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:i.itemsCreator,valueFormatter:i.valueFormatter,logic:{dynamic:!0},el:{},value:i.value}),this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE,function(){n.storeValue=this.getValue(),r(),n.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.single_select_search_insert_pane",allowNoSelect:i.allowNoSelect,cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:i.valueFormatter,keywordGetter:function(){return n.trigger.getKeyword()},itemsCreator:function(e,t){e.keywords=[n.trigger.getKeyword()],this.setKeyword(e.keywords[0]),i.itemsCreator(e,t)},listeners:[{eventName:BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var e=n.trigger.getKeyword();n.trigger.hasMatched()||(n.storeValue=e,n._showAdapter(),n.adapter.setValue(n.storeValue),n.adapter.populate(),n.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,value:i.value,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){n._showSearcherPane(),n._setStartValue(),this.setValue(BI.deepClone(n.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){n._showAdapter(),n._setStartValue(),n.adapter.setValue(n.storeValue),n.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var e=this.getKeyword();this.hasMatched()?(n.storeValue=e,n._showAdapter(),n.adapter.setValue(n.storeValue),n._setStartValue(e),r(),n.adapter.populate(),n._setStartValue(),n.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)):n._showAdapter()}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var e=this.getKeyword(),t=BI.last(e);0<(e=BI.initial(e||[])).length&&n._joinKeywords(e,function(){BI.isEndWithBlank(t)?(n.adapter.setValue(n.storeValue),r(),n.adapter.populate(),n._setStartValue()):(n.adapter.setValue(n.storeValue),r())})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){n.storeValue=this.getValue(),n.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:24,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(){},_makeMap:function(e){return BI.makeObject(e||[])},_joinKeywords:function(t,i){var r=this,e=this.options;function n(e){var n=r._makeMap(e);BI.each(t,function(e,t){BI.isNotNull(n[t])&&BI.pushDistinct(r.storeValue.value,t)}),i()}this._assertValue(this.storeValue),this._allData?n(this._allData):e.itemsCreator({type:BI.SingleSelectInsertList.REQ_GET_ALL_DATA},function(e){r._allData=BI.map(e.items,"value"),n(r._allData)})},_setStartValue:function(e){this._startValue=e,this.adapter.setStartValue(e)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(e){this.storeValue=e,this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._count=null,this._allData=null,this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.SingleSelectInsertList,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_insert_list",BI.SingleSelectInsertList)},function(e,t){BI.SingleSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-editor",el:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.SingleSelectEditor.superclass._init.apply(this,arguments);var e=this,t=this.options;this.editor=BI.createWidget(t.el,{type:"bi.state_editor",element:this,height:t.height,watermark:BI.i18nText("BI-Basic_Search"),allowBlank:!0,value:t.value,defaultText:t.text,text:t.text}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){e.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){e.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){e.fireEvent(BI.SingleSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(e){this.editor.setState(e)},setValue:function(e){this.editor.setValue(e)},getValue:function(){var e=this.editor.getState();return BI.isArray(e)&&0<e.length?e[e.length-1]:""},getKeywords:function(){var e=this.editor.getLastChangedValue(),t=e.match(/[\S]+/g);return BI.isEndWithBlank(e)?t.concat([" "]):t},populate:function(e){}}),BI.SingleSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.single_select_editor",BI.SingleSelectEditor)},function(e,t){BI.SingleSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},allowNoSelect:!1})},_init:function(){BI.SingleSelectSearcher.superclass._init.apply(this,arguments);var i=this,r=this.options;this.editor=BI.createWidget(r.el,{type:"bi.single_select_editor",height:r.height,text:r.text,listeners:[{eventName:BI.SingleSelectEditor.EVENT_FOCUS,action:function(){i.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS)}},{eventName:BI.SingleSelectEditor.EVENT_BLUR,action:function(){i.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",allowSearchBlank:!1,element:this,height:r.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(e,t){t()},el:this.editor,popup:BI.extend({type:"bi.single_select_search_pane",allowNoSelect:r.allowNoSelect,valueFormatter:r.valueFormatter,keywordGetter:function(){return i.editor.getValue()},itemsCreator:function(e,t){var n=i.editor.getValue();e.keywords=[n],this.setKeyword(n),r.itemsCreator(e,t)},value:r.value},r.popup),adapter:r.adapter,masker:r.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){i.fireEvent(BI.SingleSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),i.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){i.fireEvent(BI.SingleSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){i.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var e=this.getKeywords();i.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING,e)}),BI.isNotNull(r.value)&&this.setState(r.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(e){this.searcher.setAdapter(e)},setState:function(e){var t=this.options;BI.isNull(e)?this.editor.setState(BI.Selection.None):this.editor.setState(t.valueFormatter(e+"")||e+"")},setValue:function(e){this.setState(e),this.searcher.setValue(e)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(e){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SingleSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SingleSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearcher.EVENT_START="EVENT_START",BI.SingleSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SingleSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.single_select_searcher",BI.SingleSelectSearcher)},function(e,t){BI.SignTextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.SignTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-sign-initial-editor",validationChecker:BI.emptyFn,text:"",height:24})},_init:function(){BI.SignTextEditor.superclass._init.apply(this,arguments);var e=this,t=this.options;this.editor=BI.createWidget({type:"bi.editor",height:t.height,hgap:4,vgap:2,value:t.value,validationChecker:t.validationChecker,allowBlank:!1}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:function(){return e.getValue()},textAlign:t.textAlign,height:t.height,hgap:4,handler:function(){e._showInput(),e.editor.focus(),e.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){e.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){e._showHint(),e._checkText(),e.fireEvent(BI.SignTextEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){e._showHint(),e._checkText(),e.fireEvent(BI.SignTextEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){e._checkText()}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),e._checkText()},_checkText:function(){var t=this.options;BI.nextTick(BI.bind(function(){var e;""===this.editor.getValue()?(this.text.setValue(t.watermark||""),this.text.element.addClass("bi-water-mark")):(e=this.editor.getValue(),e=BI.isEmpty(e)||e==t.text?t.text:e+t.text,this.text.setValue(e),this.text.element.removeClass("bi-water-mark"))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(e){this.text.setTitle(e)},setWarningTitle:function(e){this.text.setWarningTitle(e)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(e){this.editor.setErrorText(e)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(e){this.editor.setValue(e),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(e){var t=this.options;this._showHint(),e=BI.isEmpty(e)||e==t.text?t.text:e+t.text,this.text.setValue(e)}}),BI.SignTextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignTextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignTextEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.shortcut("bi.sign_text_editor",BI.SignTextEditor)},function(e,t){BI.SliderIconButton=BI.inherit(BI.Widget,{props:{baseCls:"bi-single-slider-button"},constants:{LARGE_SIZE:16,NORMAL_SIZE:12,LARGE_OFFSET:4,NORMAL_OFFSET:6},render:function(){var e=this;return{type:"bi.absolute",ref:function(){e.wrapper=this},items:[{el:{type:"bi.text_button",cls:"slider-button bi-high-light-border",ref:function(){e.slider=this}}}]}}}),BI.shortcut("bi.single_slider_button",BI.SliderIconButton)},function(e,t){BI.SingleSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24,TRACK_GAP_HALF:7,TRACK_GAP:14},props:{baseCls:"bi-single-slider bi-slider-track",digit:!1,unit:""},render:function(){var o=this,s=this.options,l=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var u=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:l.SLIDER_WIDTH_HALF,height:l.SLIDER_HEIGHT});return u.element.click(function(e){var t,n,i,r,a;o.enable&&o.isEnabled()&&u.element[0]===e.originalEvent.target&&(t=e.clientX-o.element.offset().left-l.SLIDER_WIDTH_HALF,n=o.track.element[0].scrollWidth-l.TRACK_GAP,(i=0)<t&&t<n&&(i=100*t/o._getGrayTrackLength()),n<=t&&(i=100),r=BI.parseFloat(i.toFixed(1)),o._setAllPosition(r),a=o._getValueByPercent(r),a=!1===s.digit?a:a.toFixed(s.digit),o.label.setValue(a),o.value=a,o.fireEvent(BI.SingleSlider.EVENT_CHANGE))}),this.label=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:s.unit,width:l.EDITOR_WIDTH-2,allowBlank:!1,textAlign:"center",validationChecker:function(e){return o._checkValidation(e)}}),this.label.element.hover(function(){o.label.element.removeClass("bi-border").addClass("bi-border")},function(){o.label.element.removeClass("bi-border")}),this.label.on(BI.SignEditor.EVENT_CONFIRM,function(){var e=BI.parseFloat(this.getValue()),t=o._getPercentByValue(e),n=BI.parseFloat(t.toFixed(1));o._setAllPosition(n),this.setValue(e),o.value=e,o.fireEvent(BI.SingleSlider.EVENT_CHANGE)}),this._setVisible(!1),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:l.TRACK_HEIGHT}]}],hgap:l.TRACK_GAP_HALF,height:l.TRACK_HEIGHT},top:23,left:0,width:"100%"},{el:u,top:20,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:l.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]}},_draggable:function(r){var a=this,o=this.options,s=!1,l=0,u=0,c=0,h=new BI.MouseMoveTracker(function(e){var t,n,i;h.isDragging()&&(s=!0,l=p(c+(u+=e)),r.element.addClass("dragging"),t=100*l/a._getGrayTrackLength(),n=BI.parseFloat(t.toFixed(1)),a._setBlueTrack(n),a._setLabelPosition(n),a._setSliderPosition(n),i=a._getValueByPercent(n),i=!1===o.digit?i:i.toFixed(o.digit),a.label.setValue(i),a.value=i)},function(){var e,t;!0===s&&(e=100*(l=p(l))/a._getGrayTrackLength(),t=BI.parseFloat(e.toFixed(1)),a._setSliderPosition(t),u=l=0,c=l,s=!1),r.element.removeClass("dragging"),h.releaseMouseMoves(),a.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);function p(e){return BI.clamp(e,0,a._getGrayTrackLength())}r.element.on("mousedown",function(e){r.isEnabled()&&(p(c=this.offsetLeft),h.captureMouseMoves(e))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(e){var t=this.options,n=!1;return BI.isNumeric(e)&&!(BI.isNull(e)||e<this.min||e>this.max)&&(n=!1===t.digit||((e+"").split(".")[1]||"").length===t.digit),n},_setBlueTrack:function(e){this.blueTrack.element.css({width:e+"%"})},_setLabelPosition:function(e){},_setSliderPosition:function(e){this.slider.element.css({left:e+"%"})},_setAllPosition:function(e){this._setSliderPosition(e),this._setLabelPosition(e),this._setBlueTrack(e)},_setVisible:function(e){this.slider.setVisible(e),this.label.setVisible(e)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(e){var t=BI.parseInt(10*e);return(this.max-this.min)*t/1e3+this.min},_getPercentByValue:function(e){return 100*(e-this.min)/(this.max-this.min)},getValue:function(){return this.value},setValue:function(e){var t=this.options;e=BI.parseFloat(e),e=!1===t.digit?e:e.toFixed(t.digit),isNaN(e)||(this._checkValidation(e)&&(this.value=e),e>this.max&&(this.value=this.max),e<this.min&&(this.value=this.min))},_setEnable:function(e){BI.SingleSlider.superclass._setEnable.apply(this,[e]),e?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},setMinAndMax:function(e){var t=BI.parseFloat(e.min),n=BI.parseFloat(e.max);!isNaN(t)&&!isNaN(n)&&t<n&&(this.min=t,this.max=n)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max)),BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max),this._setAllPosition(100)))}}),BI.SingleSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider",BI.SingleSlider)},function(e,t){BI.SingleSliderLabel=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:20,HEIGHT:20,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24,TRACK_GAP_HALF:7,TRACK_GAP:14},_defaultConfig:function(){return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-slider-label bi-slider-track",digit:!1,unit:""})},_init:function(){BI.SingleSliderLabel.superclass._init.apply(this,arguments);var o=this,s=this.options,l=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var u=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:l.SLIDER_WIDTH_HALF,height:l.SLIDER_HEIGHT});u.element.click(function(e){var t,n,i,r,a;o.enable&&o.isEnabled()&&u.element[0]===e.originalEvent.target&&(t=e.clientX-o.element.offset().left-l.SLIDER_WIDTH_HALF,n=o.track.element[0].scrollWidth-l.TRACK_GAP,(i=0)<t&&t<n&&(i=100*t/o._getGrayTrackLength()),n<=t&&(i=100),r=BI.parseFloat(i.toFixed(1)),o._setAllPosition(r),a=o._getValueByPercent(r),a=!1===s.digit?a:a.toFixed(s.digit),o.label.setText(a+s.unit),o.value=a,o.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE))}),this.label=BI.createWidget({type:"bi.label",height:l.HEIGHT,width:l.EDITOR_WIDTH-2}),this._setVisible(!1),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:l.TRACK_HEIGHT}]}],hgap:l.TRACK_GAP_HALF,height:l.TRACK_HEIGHT},top:13,left:0,width:"100%"},{el:u,top:10,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:l.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]})},_draggable:function(r){var a=this,o=this.options,s=!1,l=0,u=0,c=0,h=new BI.MouseMoveTracker(function(e){var t,n,i;h.isDragging()&&(s=!0,l=p(c+(u+=e)),r.element.addClass("dragging"),t=100*l/a._getGrayTrackLength(),n=BI.parseFloat(t.toFixed(1)),a._setBlueTrack(n),a._setLabelPosition(n),a._setSliderPosition(n),i=a._getValueByPercent(n),i=!1===o.digit?i:i.toFixed(o.digit),a.label.setValue(i+o.unit),a.value=i,a.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE))},function(){var e,t;!0===s&&(e=100*(l=p(l))/a._getGrayTrackLength(),t=BI.parseFloat(e.toFixed(1)),a._setSliderPosition(t),u=l=0,c=l,s=!1),r.element.removeClass("dragging"),h.releaseMouseMoves(),a.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)},window);function p(e){return BI.clamp(e,0,a._getGrayTrackLength())}r.element.on("mousedown",function(e){r.isEnabled()&&(p(c=this.offsetLeft),h.captureMouseMoves(e))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(e){return BI.isNumeric(e)&&!(BI.isNull(e)||e<this.min||e>this.max)},_setBlueTrack:function(e){this.blueTrack.element.css({width:e+"%"})},_setLabelPosition:function(e){},_setSliderPosition:function(e){this.slider.element.css({left:e+"%"})},_setAllPosition:function(e){this._setSliderPosition(e),this._setLabelPosition(e),this._setBlueTrack(e)},_setVisible:function(e){this.slider.setVisible(e),this.label.setVisible(e)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(e){var t=BI.parseInt(10*e);return(this.max-this.min)*t/1e3+this.min},_getPercentByValue:function(e){return 100*(e-this.min)/(this.max-this.min)},_setEnable:function(e){BI.SingleSliderLabel.superclass._setEnable.apply(this,[e]),e?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(e){var t=this.options;e=BI.parseFloat(e),e=!1===t.digit?e:e.toFixed(t.digit),isNaN(e)||(this._checkValidation(e)&&(this.value=e),e>this.max&&(this.value=this.max),e<this.min&&(this.value=this.min))},setMinAndMax:function(e){var t=BI.parseFloat(e.min),n=BI.parseFloat(e.max);!isNaN(t)&&!isNaN(n)&&t<n&&(this.min=t,this.max=n)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){var e=this.options;isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value+e.unit),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max+e.unit),this._setAllPosition(100)))}}),BI.SingleSliderLabel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider_label",BI.SingleSliderLabel)},function(e,t){BI.SingleSliderNormal=BI.inherit(BI.Single,{_constant:{HEIGHT:28,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24,TRACK_GAP_HALF:7,TRACK_GAP:14},props:{baseCls:"bi-single-slider-normal bi-slider-track",minMax:{min:0,max:100}},render:function(){var o=this,s=this._constant,e=this._createTrack();this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var l=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:s.SLIDER_WIDTH_HALF,height:s.SLIDER_HEIGHT});return l.element.click(function(e){var t,n,i,r,a;o.enable&&o.isEnabled()&&l.element[0]===e.originalEvent.target&&(t=e.clientX-o.element.offset().left-s.SLIDER_WIDTH_HALF,n=o.track.element[0].scrollWidth-s.TRACK_GAP,(i=0)<t&&t<n&&(i=100*t/o._getGrayTrackLength()),n<=t&&(i=100),r=BI.parseFloat(i.toFixed(1)),o._setAllPosition(r),a=o._getValueByPercent(r),o.value=a,o.fireEvent(BI.SingleSlider.EVENT_CHANGE))}),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:e,width:"100%",height:s.TRACK_HEIGHT}]}],hgap:s.TRACK_GAP_HALF,height:s.TRACK_HEIGHT},top:3,left:0,width:"100%"},{el:l,top:0,left:0,width:"100%"}]}},_draggable:function(r){var a=this,o=this.options,s=!1,l=0,u=0,c=0,h=new BI.MouseMoveTracker(function(e){var t,n,i;h.isDragging()&&(s=!0,l=p(c+(u+=e)),r.element.addClass("dragging"),t=100*l/a._getGrayTrackLength(),n=BI.parseFloat(t.toFixed(1)),a._setBlueTrack(n),a._setSliderPosition(n),i=a._getValueByPercent(n),i=!1===o.digit?i:i.toFixed(o.digit),a.value=i,a.fireEvent(BI.SingleSliderNormal.EVENT_DRAG,i))},function(){var e,t;!0===s&&(e=100*(l=p(l))/a._getGrayTrackLength(),t=BI.parseFloat(e.toFixed(1)),a._setSliderPosition(t),u=l=0,c=l,s=!1),r.element.removeClass("dragging"),h.releaseMouseMoves(),a.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);function p(e){return BI.clamp(e,0,a._getGrayTrackLength())}r.element.on("mousedown",function(e){r.isEnabled()&&(p(c=this.offsetLeft),h.captureMouseMoves(e))})},_createTrack:function(){var t=this;this._constant;return this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.options.color&&this.blueTrack.element.css({"background-color":this.options.color}),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}],ref:function(e){t.track=e}}},_checkValidation:function(e){return!(BI.isNull(e)||e<this.min||e>this.max)},_setBlueTrack:function(e){this.blueTrack.element.css({width:e+"%"})},_setSliderPosition:function(e){this.slider.element.css({left:e+"%"})},_setAllPosition:function(e){this._setSliderPosition(e),this._setBlueTrack(e)},_setVisible:function(e){this.slider.setVisible(e)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(e){var t=BI.parseInt(10*e);return(this.max-this.min)*t/1e3+this.min},_getPercentByValue:function(e){return 100*(e-this.min)/(this.max-this.min)},_setEnable:function(e){BI.SingleSliderNormal.superclass._setEnable.apply(this,[e]),e?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(e){var t=BI.parseFloat(e);isNaN(t)||(this._checkValidation(t)&&(this.value=t),t>this.max&&(this.value=this.max),t<this.min&&(this.value=this.min))},setMinAndMax:function(e){var t=BI.parseFloat(e.min),n=BI.parseFloat(e.max);!isNaN(t)&&!isNaN(n)&&t<n&&(this.min=t,this.max=n)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?this._setAllPosition(this._getPercentByValue(this.value)):this._setAllPosition(100))}}),BI.SingleSliderNormal.EVENT_DRAG="EVENT_DRAG",BI.shortcut("bi.single_slider_normal",BI.SingleSliderNormal)},function(e,t){BI.SingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-combo",trigger:{},height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SingleTreeCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;this.trigger=BI.createWidget(BI.extend({type:"bi.single_tree_trigger",text:t.text,height:t.height,items:t.items,value:t.value},t.trigger)),this.popup=BI.createWidget({type:"bi.single_level_tree",items:t.items,value:t.value}),this.combo=BI.createWidget({type:"bi.combo",container:t.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){e.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){e.setValue(e.popup.getValue()),e.combo.hideView(),e.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE)})},populate:function(e){this.combo.populate(e)},setValue:function(e){e=BI.isArray(e)?e:[e],this.trigger.setValue(e),this.popup.setValue(e)},getValue:function(){return this.popup.getValue()}}),BI.SingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.single_tree_combo",BI.SingleTreeCombo)},function(e,t){BI.SingleTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_init:function(){BI.SingleTreePopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{isDefaultInit:!0},items:t.items,value:t.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){e.fireEvent(BI.SingleTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(e){e=BI.isArray(e)?e:[e],this.tree.setValue(e)},populate:function(e){BI.SingleTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(e)}}),BI.SingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_level_tree",BI.SingleTreePopup)},function(e,t){BI.SingleTreeTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-trigger",height:24,text:"",items:[],value:""})},_init:function(){BI.SingleTreeTrigger.superclass._init.apply(this,arguments);var e=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,text:e.text,items:e.items,height:e.height,value:e.value})},_checkTitle:function(){var n=this,i=this.getValue();BI.any(this.options.items,function(e,t){if(BI.contains(i,t.value))return n.trigger.setTitle(t.text||t.value),!0})},setValue:function(e){e=BI.isArray(e)?e:[e],this.options.value=e,this.trigger.setValue(e),this._checkTitle()},getValue:function(){return this.options.value||[]},populate:function(e){BI.SingleTreeTrigger.superclass.populate.apply(this,arguments),this.trigger.populate(e)}}),BI.shortcut("bi.single_tree_trigger",BI.SingleTreeTrigger)},function(e,t){BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:24,attributes:{tabIndex:0}})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var e,t=this,n=this.options;this._createValueMap(),BI.isNotNull(n.value)&&(e=this._digest(n.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",cls:"text-value-down-list-trigger",height:n.height,items:n.items,text:n.text,value:e}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:n.height,el:this.trigger,value:BI.isNull(e)?[]:[e],items:BI.deepClone(n.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){var e=t.combo.getValue()[0].value;e!==t.value&&(t.setValue(e),t.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){var e=t.combo.getValue()[0].childValue;e!==t.value&&(t.setValue(e),t.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))})},_createValueMap:function(){var i=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(e,n){BI.has(n,"el")?BI.each(n.children,function(e,t){i.valueMap[t.value]={value:n.el.value,childValue:t.value}}):i.valueMap[n.value]={value:n.value}})},_digest:function(e){return this.value=e,this.valueMap[e]},setValue:function(e){e=this._digest(e),this.combo.setValue([e]),this.trigger.setValue(e)},getValue:function(){var e=this.combo.getValue()[0];return[e.childValue||e.value]},populate:function(e){this.options.items=BI.flatten(e),this.combo.populate(e),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo)},function(e,t){BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var e=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:e.height,items:this._formatItemArray(e.items),text:e.text,value:BI.isNull(e.value)?"":e.value.childValue||e.value.value})},_formatItemArray:function(){var e=BI.flatten(BI.deepClone(this.options.items)),t=[];return BI.each(e,function(e,n){BI.has(n,"el")?(BI.each(n.children,function(e,t){t.text=n.el.text+"("+t.text+")"}),t=BI.concat(t,n.children)):t.push(n)}),t},setValue:function(e){this.trigger.setValue(e.childValue||e.value)},populate:function(e){this.trigger.populate(this._formatItemArray(e))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger)},function(e,t){BI.TimePopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-popup",height:68},render:function(){var t=this;return{type:"bi.vtape",items:[{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",value:this.options.value,ref:function(e){t.timeSelect=e}}]},hgap:10,height:44},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clears"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){t.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Now"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){t.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){t.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},setValue:function(e){this._checkValueValid(e)?this.timeSelect.setValue():this.timeSelect.setValue({hour:e.hour,minute:e.minute,second:e.second})},getValue:function(){return this.timeSelect.getValue()},_checkValueValid:function(e){return BI.isNull(e)||BI.isEmptyObject(e)||BI.isEmptyString(e)}}),BI.TimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.TimePopup.BUTTON_NOW_EVENT_CHANGE="BUTTON_NOW_EVENT_CHANGE",BI.TimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.time_popup",BI.TimePopup)},function(e,t){BI.TimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:80,popupWidth:240,comboAdjustHeight:1,border:1},props:{baseCls:"bi-time-combo bi-border bi-border-radius bi-focus-shadow",width:78,height:22,format:"",allowEdit:!1},render:function(){var n=this,e=this.options;this.storeTriggerValue="",this.storeValue=e.value;var t={type:"bi.time_popup",value:e.value,listeners:[{eventName:BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){n.setValue(),n.hidePopupView(),n.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.hidePopupView(),n.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,action:function(){n._setNowTime()}}],ref:function(e){n.popup=e}};return{type:"bi.htape",items:[{type:"bi.absolute",items:[{el:{type:"bi.combo",container:e.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.time_trigger",height:e.height,allowEdit:e.allowEdit,watermark:e.watermark,format:e.format,value:e.value,ref:function(e){n.trigger=e},listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){n.combo.isViewVisible()&&n.combo.hideView(),n.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:"EVENT_STOP",action:function(){n.combo.isViewVisible()||n.combo.showView()}},{eventName:"EVENT_FOCUS",action:function(){n.storeTriggerValue=n.trigger.getKey(),n.combo.isViewVisible()||n.combo.showView(),n.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){n.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_ERROR",action:function(){var e=BI.getDate();n.storeValue={hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()},n.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_VALID",action:function(){n.fireEvent("EVENT_VALID")}},{eventName:"EVENT_CHANGE",action:function(){n.fireEvent("EVENT_CHANGE")}},{eventName:"EVENT_CONFIRM",action:function(){var e,t;n.combo.isViewVisible()||(e=n.storeTriggerValue,t=n.trigger.getKey(),BI.isNotEmptyString(t)&&!BI.isEqual(t,e)?(n.storeValue=n.trigger.getValue(),n.setValue(n.trigger.getValue())):BI.isEmptyString(t)&&(n.storeValue=null,n.trigger.setValue()),n.fireEvent("EVENT_CONFIRM"))}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:t,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===n.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){n.popup.setValue(n.storeValue),n.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW)}}],ref:function(e){n.combo=e}},top:0,left:0,right:22,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button time-font icon-size-16",width:22,height:22,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){n.combo.isViewVisible()||n.combo.showView()}}],ref:function(e){n.triggerBtn=e}},top:0,right:0}]}]}},setValue:function(e){this.storeValue=e,this.trigger.setValue(e)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()},_setNowTime:function(){var e=BI.getDate(),t={hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()};this.setValue(t),this.hidePopupView(),this.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}}),BI.TimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.TimeCombo.EVENT_VALID="EVENT_VALID",BI.TimeCombo.EVENT_ERROR="EVENT_ERROR",BI.TimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.time_combo",BI.TimeCombo)},function(e,t){BI.TimeTrigger=BI.inherit(BI.Trigger,{_const:{COMPARE_FORMAT:"%H:%M:%S",COMPLETE_COMPARE_FORMAT:"%Y-%M-%d %H:%M:%S %P",FORMAT_ARRAY:["%H:%M:%S","%I:%M:%S","%l:%M:%S","%k:%M:%S","%l:%M:%S %p","%l:%M:%S %P","%H:%M:%S %p","%H:%M:%S %P","%l:%M","%k:%M","%I:%M","%H:%M","%M:%S"],DEFAULT_DATE_STRING:"2000-01-01",DEFAULT_HOUR:"00"},props:{extraCls:"bi-time-trigger",value:{},format:"",allowEdit:!1},render:function(){var n=this,e=this.options;return this.storeTriggerValue="",this.storeValue=e.value,{type:"bi.absolute",items:[{el:{type:"bi.sign_editor",height:e.height,validationChecker:function(e){return n._dateCheck(e)},quitChecker:function(){return!1},ref:function(e){n.editor=e},value:this._formatValue(e.value),hgap:4,allowBlank:!0,watermark:BI.isKey(e.watermark)?e.watermark:BI.i18nText("BI-Basic_Unrestricted"),title:BI.bind(this._getTitle,this),listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){n.fireEvent("EVENT_KEY_DOWN",arguments)}},{eventName:"EVENT_FOCUS",action:function(){n.storeTriggerValue=n.getKey(),n.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){n.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_STOP",action:function(){n.fireEvent("EVENT_STOP")}},{eventName:"EVENT_VALID",action:function(){n.fireEvent("EVENT_VALID")}},{eventName:"EVENT_ERROR",action:function(){n.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_CONFIRM",action:function(){var e,t=n.editor.getValue();BI.isNotNull(t)&&n.editor.setState(t),BI.isNotEmptyString(t)&&!BI.isEqual(n.storeTriggerValue,n.getKey())&&(e=t.match(/\d+/g),n.storeValue={hour:0|e[0],minute:0|e[1],second:0|e[2]}),n.fireEvent("EVENT_CONFIRM")}},{eventName:"EVENT_START",action:function(){n.fireEvent("EVENT_START")}},{eventName:"EVENT_CHANGE",action:function(){n.fireEvent("EVENT_CHANGE")}}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.text",invisible:e.allowEdit,cls:"show-text",title:BI.bind(this._getTitle,this),hgap:4},left:0,right:0,top:0,bottom:0}]}},_dateCheck:function(n){var i=this._const,r=this;return BI.any(i.FORMAT_ARRAY,function(e,t){return BI.print(BI.parseDateTime(i.DEFAULT_DATE_STRING+" "+r._getCompleteHMS(n,t),i.COMPLETE_COMPARE_FORMAT),t)===n})},_getCompleteHMS:function(e,t){var n=this._const;switch(t){case"%M:%S":e=n.DEFAULT_HOUR+":"+e}return e},_getTitle:function(){var e=this.storeValue||{},t=BI.getDate();return BI.print(BI.getDate(t.getFullYear(),0,1,e.hour,e.minute,e.second),this._getFormatString())},_getFormatString:function(){return this.options.format||this._const.COMPARE_FORMAT},_formatValue:function(e){var t=BI.getDate();return BI.isNotEmptyObject(e)?BI.print(BI.getDate(t.getFullYear(),t.getMonth(),t.getDay(),e.hour,e.minute,e.second),this._getFormatString()):""},getKey:function(){return this.editor.getValue()},setValue:function(e){this.storeValue=e,this.editor.setValue(this._formatValue(e))},getValue:function(){return this.storeValue}}),BI.shortcut("bi.time_trigger",BI.TimeTrigger)},function(e,t){BI.DateInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var e=BI.DateInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-date-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var e=this.options;BI.DateInterval.superclass._init.apply(this,arguments),e.value=e.value||{},this.left=this._createCombo(e.value.start),this.right=this._createCombo(e.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:this,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:this.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:this.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.label]})},_createCombo:function(e){var n=this,t=this.options,i=BI.createWidget({type:"bi.dynamic_date_combo",behaviors:t.behaviors,value:e});return i.on(BI.DynamicDateCombo.EVENT_ERROR,function(){n._clearTitle(),BI.Bubbles.hide("error"),n.element.removeClass(n.constants.timeErrorCls),n.fireEvent(BI.DateInterval.EVENT_ERROR)}),i.on(BI.DynamicDateCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),n,{offsetStyle:"center"}),n.fireEvent(BI.DateInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls))}),i.on(BI.DynamicDateCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),n,{offsetStyle:"center"}),n.fireEvent(BI.DateInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls))}),i.on(BI.DynamicDateCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),n.fireEvent(BI.DateInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls),n.fireEvent(BI.DateInterval.EVENT_CHANGE))}),i},_dateCheck:function(e){return BI.print(BI.parseDateTime(e,"%Y-%x-%d"),"%Y-%x-%d")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d")===e||BI.print(BI.parseDateTime(e,"%Y-%x-%e"),"%Y-%x-%e")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%e"),"%Y-%X-%e")===e},_checkVoid:function(e){var t=this.options;return!BI.checkDateVoid(e.year,e.month,e.day,t.minDate,t.maxDate)[0]},_check:function(e,t){var n=e.match(/\d+/g),i=t.match(/\d+/g);return this._dateCheck(e)&&BI.checkDateLegal(e)&&this._checkVoid({year:n[0],month:n[1],day:n[2]})&&this._dateCheck(t)&&BI.checkDateLegal(t)&&this._checkVoid({year:i[0],month:i[1],day:i[2]})},_compare:function(e,t){return e=BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d"),t=BI.print(BI.parseDateTime(t,"%Y-%X-%d"),"%Y-%X-%d"),BI.isNotNull(e)&&BI.isNotNull(t)&&t<e},_setTitle:function(e){this.left.setTitle(e),this.right.setTitle(e),this.label.setTitle(e)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(e){e=e||{},this.left.setValue(e.start),this.right.setValue(e.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.DateInterval.EVENT_VALID="EVENT_VALID",BI.DateInterval.EVENT_ERROR="EVENT_ERROR",BI.DateInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_interval",BI.DateInterval)},function(e,t){BI.TimeInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var e=BI.TimeInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{extraCls:"bi-time-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var e=this.options;BI.TimeInterval.superclass._init.apply(this,arguments),e.value=e.value||{},this.left=this._createCombo(e.value.start),this.right=this._createCombo(e.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:this,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:this.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:this.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.label]})},_createCombo:function(e){var n=this,t=this.options,i=BI.createWidget({type:"bi.dynamic_date_time_combo",behaviors:t.behaviors,value:e});return i.on(BI.DynamicDateTimeCombo.EVENT_ERROR,function(){n._clearTitle(),BI.Bubbles.hide("error"),n.element.removeClass(n.constants.timeErrorCls),n.fireEvent(BI.TimeInterval.EVENT_ERROR)}),i.on(BI.DynamicDateTimeCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n.left.isValid()&&n.right.isValid()&&n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),n,{offsetStyle:"center"}),n.fireEvent(BI.TimeInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls))}),i.on(BI.DynamicDateTimeCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n.left.isValid()&&n.right.isValid()&&n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),n,{offsetStyle:"center"}),n.fireEvent(BI.TimeInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls))}),i.on(BI.DynamicDateTimeCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n.left.isValid()&&n.right.isValid()&&n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),n.fireEvent(BI.TimeInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls),n.fireEvent(BI.TimeInterval.EVENT_CHANGE))}),i},_dateCheck:function(e){return BI.print(BI.parseDateTime(e,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===e||BI.print(BI.parseDateTime(e,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===e},_checkVoid:function(e){var t=this.options;return!BI.checkDateVoid(e.year,e.month,e.day,t.minDate,t.maxDate)[0]},_check:function(e,t){var n=e.match(/\d+/g),i=t.match(/\d+/g);return this._dateCheck(e)&&BI.checkDateLegal(e)&&this._checkVoid({year:n[0],month:n[1],day:n[2]})&&this._dateCheck(t)&&BI.checkDateLegal(t)&&this._checkVoid({year:i[0],month:i[1],day:i[2]})},_compare:function(e,t){return e=BI.print(BI.parseDateTime(e,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),t=BI.print(BI.parseDateTime(t,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),BI.isNotNull(e)&&BI.isNotNull(t)&&t<e},_setTitle:function(e){this.left.setTitle(e),this.right.setTitle(e),this.label.setTitle(e)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(e){e=e||{},this.left.setValue(e.start),this.right.setValue(e.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimeInterval.EVENT_VALID="EVENT_VALID",BI.TimeInterval.EVENT_ERROR="EVENT_ERROR",BI.TimeInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_interval",BI.TimeInterval)},function(e,t){BI.TimePeriods=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0},props:{extraCls:"bi-time-interval",value:{}},render:function(){var t=this,e=this.options;return{type:"bi.absolute",height:this.constants.height,items:[{el:{type:"bi.horizontal_auto",items:[{type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-",ref:function(e){t.label=e}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:BI.extend({ref:function(e){t.left=e}},this._createCombo(e.value.start)),left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:BI.extend({ref:function(e){t.right=e}},this._createCombo(e.value.end)),left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]},top:0,left:0,right:0,bottom:0}]}},_createCombo:function(e){var t=this;return{type:"bi.time_combo",value:e,listeners:[{eventName:BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){t.left.hidePopupView(),t.right.hidePopupView()}},{eventName:BI.TimeCombo.EVENT_CHANGE,action:function(){t.fireEvent(BI.TimePeriods.EVENT_CHANGE)}},{eventName:BI.TimeCombo.EVENT_CONFIRM,action:function(){t.fireEvent(BI.TimePeriods.EVENT_CONFIRM)}}]}},setValue:function(e){e=e||{},this.left.setValue(e.start),this.right.setValue(e.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimePeriods.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimePeriods.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_periods",BI.TimePeriods)},function(e,t){BI.DynamicYearCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-card"},render:function(){var e=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){e.item=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(e,t){return{dateType:e,value:Math.abs(t),offset:0<t?1:0}},setValue:function(e){e=e||{year:0},this.item.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,e.year))},getValue:function(){var e=this.item.getValue();return{year:0===e.offset?-e.value:e.value}}}),BI.DynamicYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_card",BI.DynamicYearCard)},function(e,t){BI.StaticYearCard=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticYearCard.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-card",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(e){var t=this.options,n=this._year,i=BI.createWidget({type:"bi.year_calendar",behaviors:t.behaviors,min:t.min,max:t.max,logic:{dynamic:!0},year:n+12*e});return i.setValue(this._year),i},_init:function(){BI.StaticYearCard.superclass._init.apply(this,arguments);var t=this,e=this.options;this.selectedYear=this._year=BI.getDate().getFullYear(),this.backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){t.navigation.setSelect(t.navigation.getSelect()-1),t._checkLeftValid(),t._checkRightValid()}}]}),this.preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){t.navigation.setSelect(t.navigation.getSelect()+1),t._checkLeftValid(),t._checkRightValid()}}]}),this.navigation=BI.createWidget({type:"bi.navigation",direction:"top",element:this,single:!0,logic:{dynamic:!0},tab:{type:"bi.htape",cls:"bi-split-top bi-split-bottom",height:30,items:[{el:{type:"bi.center_adapt",items:[t.backBtn]},width:25},{type:"bi.layout"},{el:{type:"bi.center_adapt",items:[t.preBtn]},width:25}]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(t.selectedYear);var e=this.getSelectedCard();t.backBtn.setEnable(!e.isFrontYear()),t.preBtn.setEnable(!e.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){t.selectedYear=this.getValue(),t.fireEvent(BI.Controller.EVENT_CHANGE,arguments),t.fireEvent(BI.StaticYearCard.EVENT_CHANGE,t.selectedYear)}),BI.isKey(e.value)&&this.setValue(e.value)},_checkLeftValid:function(){this.options;return this.backBtn.setEnable(!0),!0},_checkRightValid:function(){this.options;return this.preBtn.setEnable(!0),!0},getValue:function(){return{year:this.selectedYear}},setValue:function(e){var t=this.options,n=(e=e||{}).year;BI.checkDateVoid(n,1,1,t.min,t.max)[0]?(n=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(n)),this.navigation.setValue("")):(this.selectedYear=BI.parseInt(n),this.navigation.setSelect(BI.YearCalendar.getPageByYear(n)),this.navigation.setValue(this.selectedYear)),this._checkLeftValid(),this._checkRightValid()}}),BI.StaticYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_card",BI.StaticYearCard)},function(e,t){BI.DynamicYearCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-combo bi-border bi-border-radius bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearCombo.superclass._init.apply(this,arguments);var t=this,e=this.options;this.storeValue=e.value,this.trigger=BI.createWidget({type:"bi.dynamic_year_trigger",min:e.min,max:e.max,height:e.height,value:e.value||""}),this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN,function(){t.combo.isViewVisible()&&t.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_FOCUS,function(){t.storeTriggerValue=this.getKey()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_START,function(){t.combo.isViewVisible()&&t.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_STOP,function(){t.combo.showView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_ERROR,function(){t.combo.isViewVisible()&&t.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_CONFIRM,function(){t.combo.isViewVisible()||(this.getKey()&&this.getKey()!==t.storeTriggerValue?(t.storeValue=t.trigger.getValue(),t.setValue(t.storeValue)):this.getKey()||(t.storeValue=null,t.setValue()),t._checkDynamicValue(t.storeValue),t.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM))}),this.combo=BI.createWidget({type:"bi.combo",container:e.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_popup",ref:function(){t.popup=this},listeners:[{eventName:BI.DynamicYearPopup.EVENT_CHANGE,action:function(){t.setValue(t.popup.getValue()),t.combo.hideView(),t.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){t.setValue(),t.combo.hideView(),t.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var e=BI.getDate();t.setValue({type:BI.DynamicYearCombo.Static,value:{year:e.getFullYear()}}),t.combo.hideView(),t.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE,action:function(){t.setValue(t.popup.getValue()),t.combo.hideView(),t.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:e.behaviors,min:e.min,max:e.max},value:e.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){t.popup.setValue(t.storeValue),t.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){t.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){t.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(e.value)},_checkDynamicValue:function(e){var t=null;switch(BI.isNotNull(e)&&(t=e.type),t){case BI.DynamicYearCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(e){this.storeValue=e,this.trigger.setValue(e),this._checkDynamicValue(e)},getValue:function(){return this.storeValue}}),BI.DynamicYearCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_combo",BI.DynamicYearCombo),BI.extend(BI.DynamicYearCombo,{Static:1,Dynamic:2})},function(e,t){BI.DynamicYearPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var e=this,t=(this.options,this.constants);return this.storeValue={type:BI.DynamicYearCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:t.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",textHeight:t.buttonHeight-1,cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Current_Year"),ref:function(){e.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:t.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){var e;this.dateTab.getSelect()===BI.DynamicDateCombo.Static?(this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)):(e=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()),e=BI.print(e,"%Y"),this.textButton.setValue(e),this.textButton.setEnable(!1))},_getTabJson:function(){var t=this,n=this.options;return{type:"bi.tab",ref:function(){t.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Fen"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(e){switch(e){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){t._setInnerValue(t.year,e)}}],ref:function(){t.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_card",behaviors:n.behaviors,min:t.options.min,max:t.options.max,listeners:[{eventName:BI.StaticYearCard.EVENT_CHANGE,action:function(){t.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE)}}],ref:function(){t.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){switch(t.dateTab.getSelect()){case BI.DynamicYearCombo.Static:var e=BI.DynamicDateHelper.getCalculation(t.dynamicPane.getValue());t.year.setValue({year:e.getFullYear()}),t._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:t.storeValue&&t.storeValue.type===BI.DynamicYearCombo.Dynamic?t.dynamicPane.setValue(t.storeValue.value):t.dynamicPane.setValue({year:0}),t._setInnerValue()}}}]}},setValue:function(e){this.storeValue=e;var t=(e=e||{}).type||BI.DynamicDateCombo.Static,n=e.value||e;switch(this.dateTab.setSelect(t),t){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(n),this._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(n),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_popup",BI.DynamicYearPopup)},function(e,t){BI.DynamicYearTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-year-trigger",min:"1900-01-01",max:"2099-12-31",height:24})},beforeInit:function(e){this.options.title=BI.bind(this._titleCreator,this),e()},_init:function(){BI.DynamicYearTrigger.superclass._init.apply(this,arguments);var t=this,n=this.options,e=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:n.height,validationChecker:function(e){return""===e||BI.isPositiveInteger(e)&&!BI.checkDateVoid(e,1,1,n.min,n.max)[0]},quitChecker:function(e){return!1},hgap:e.hgap,vgap:e.vgap,watermark:BI.i18nText("BI-Basic_Unrestricted"),allowBlank:!0,errorText:function(){return BI.i18nText("BI-Year_Trigger_Invalid_Text")}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){t.fireEvent(BI.DynamicYearTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){t.fireEvent(BI.DynamicYearTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){t.fireEvent(BI.DynamicYearTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var e=t.editor.getValue();BI.isNotNull(e)&&t.editor.setValue(e),BI.isNotEmptyString(e)&&(t.storeValue={type:BI.DynamicDateCombo.Static,value:{year:e}}),t.fireEvent(BI.DynamicYearTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){t.editor.isValid()&&t.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){t.fireEvent(BI.DynamicYearTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){t.fireEvent(BI.DynamicYearTrigger.EVENT_ERROR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",baseCls:"bi-trigger-year-text",text:BI.i18nText("BI-Multi_Date_Year"),width:n.height},width:n.height},{el:{type:"bi.trigger_icon_button",width:n.height},width:n.height}]}),this.setValue(n.value)},_getText:function(e){var t="";return BI.isNotNull(e.year)&&0!==BI.parseInt(e.year)&&(t+=Math.abs(e.year)+BI.i18nText("BI-Basic_Year")+(e.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),t},_setInnerValue:function(e,t){var n=BI.print(e,"%Y");this.editor.setState(n),this.editor.setValue(n)},_titleCreator:function(){var e=this.storeValue||{},t=e.type||BI.DynamicDateCombo.Static,n=e.value;if(!this.editor.isValid())return"";switch(t){case BI.DynamicDateCombo.Dynamic:var i=this._getText(n),r=BI.getDate(),r=BI.DynamicDateHelper.getCalculation(n),a=BI.print(r,"%Y");return BI.isEmptyString(i)?a:i+":"+a;case BI.DynamicDateCombo.Static:default:return(n=n||{}).year}},setValue:function(e){var t,n,i=BI.getDate();switch(this.storeValue=e,BI.isNotNull(e)&&(t=e.type||BI.DynamicDateCombo.Static,n=e.value||e),t){case BI.DynamicDateCombo.Dynamic:var r=this._getText(n),i=BI.DynamicDateHelper.getCalculation(n);this._setInnerValue(i,r);break;case BI.DynamicDateCombo.Static:default:n=n||{},this.editor.setState(n.year),this.editor.setValue(n.year)}},getValue:function(){return this.storeValue},getKey:function(){return 0|this.editor.getValue()}}),BI.DynamicYearTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicYearTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearTrigger.EVENT_START="EVENT_START",BI.DynamicYearTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearTrigger.EVENT_STOP="EVENT_STOP",BI.shortcut("bi.dynamic_year_trigger",BI.DynamicYearTrigger)},function(e,t){BI.DynamicYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var e=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){e.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.MONTH,ref:function(){e.month=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(e,t){return{dateType:e,value:Math.abs(t),offset:0<t?1:0}},setValue:function(e){e=e||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,e.year)),this.month.setValue(this._createValue(BI.DynamicDateCard.TYPE.MONTH,e.month))},getValue:function(){var e=this.year.getValue(),t=this.month.getValue();return{year:0===e.offset?-e.value:e.value,month:0===t.offset?-t.value:t.value}}}),BI.DynamicYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_card",BI.DynamicYearMonthCard)},function(e,t){BI.StaticYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-month-card",behaviors:{}},_createMonths:function(){var i=this,e=[1,7,2,8,3,9,4,10,5,11,6,12],t=[];return t.push(e.slice(0,2)),t.push(e.slice(2,4)),t.push(e.slice(4,6)),t.push(e.slice(6,8)),t.push(e.slice(8,10)),t.push(e.slice(10,12)),BI.map(t,function(n,e){return BI.map(e,function(t,e){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:e,text:e,ref:function(e){i.monthMap[0===t?n:n+6]=e}}})})},render:function(){var t=this,e=this.options;return this.monthMap={},{type:"bi.vertical",items:[{type:"bi.year_picker",min:e.min,max:e.max,ref:function(){t.yearPicker=this},behaviors:e.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var e=this.getValue();t._checkMonthStatus(e),t.setValue({year:e,month:t.selectedMonth})}}]},{type:"bi.button_group",cls:"bi-split-top",behaviors:e.behaviors,ref:function(){t.month=this},items:this._createMonths(),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:e.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){t.selectedYear=t.yearPicker.getValue(),t.selectedMonth=this.getValue()[0],t.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE)}}]}]}},mounted:function(){this._checkMonthStatus(this.selectedYear)},_checkMonthStatus:function(e){var t=this.options,n=BI.parseDateTime(t.min,"%Y-%X-%d"),i=BI.parseDateTime(t.max,"%Y-%X-%d"),r=n.getFullYear(),a=i.getFullYear(),o=0,s=11;r===e&&(o=n.getMonth()),a===e&&(s=i.getMonth());var l=e<r||a<e;BI.each(this.monthMap,function(e,t){var n=e<o||s<e;t.setEnable(!l&&!n)})},setMinDate:function(e){this.options.min!==e&&(this.options.min=e,this.yearPicker.setMinDate(e),this._checkMonthStatus(this.selectedYear))},setMaxDate:function(e){this.options.max!==e&&(this.options.max=e,this.yearPicker.setMaxDate(e),this._checkMonthStatus(this.selectedYear))},getValue:function(){return{year:this.selectedYear,month:this.selectedMonth}},setValue:function(e){var t,n=this.options,i={};i.year=e.year||0,i.month=e.month||0,0===i.year||0===i.month||BI.checkDateVoid(i.year,i.month,1,n.min,n.max)[0]?(t=i.year||BI.getDate().getFullYear(),this.selectedYear=t,this.selectedMonth="",this.yearPicker.setValue(t),this.month.setValue()):(this.selectedYear=BI.parseInt(i.year),this.selectedMonth=BI.parseInt(i.month),this.yearPicker.setValue(this.selectedYear),this.month.setValue(this.selectedMonth))}}),BI.StaticYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_month_card",BI.StaticYearMonthCard)},function(e,t){BI.DynamicYearMonthCombo=BI.inherit(BI.Single,{props:{baseCls:"bi-year-month-combo bi-border bi-border-radius bi-focus-shadow",behaviors:{},minDate:"1900-01-01",maxDate:"2099-12-31",height:22},_init:function(){BI.DynamicYearMonthCombo.superclass._init.apply(this,arguments);var n=this,e=this.options;this.storeValue=e.value,this.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_month_trigger",min:e.minDate,max:e.maxDate,height:e.height,value:e.value||""}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN,function(){n.combo.isViewVisible()&&n.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START,function(){n.combo.isViewVisible()&&n.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_STOP,function(){n.combo.showView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_ERROR,function(){n.combo.isViewVisible()&&n.combo.hideView(),n.fireEvent(BI.DynamicYearMonthCombo.EVENT_ERROR)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_VALID,function(){n.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM,function(){var e=n.storeTriggerValue,t=n.trigger.getKey();BI.isNotEmptyString(t)&&!BI.isEqual(t,e)&&(n.storeValue=n.trigger.getValue(),n.setValue(n.trigger.getValue())),n._checkDynamicValue(n.storeValue),n.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS,function(){n.storeTriggerValue=n.trigger.getKey(),n.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS)}),this.combo=BI.createWidget({type:"bi.combo",container:e.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:{type:"bi.dynamic_year_month_popup",ref:function(){n.popup=this},listeners:[{eventName:BI.DynamicYearMonthPopup.EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.combo.hideView(),n.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){n.setValue(),n.combo.hideView(),n.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var e=BI.getDate();n.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:e.getFullYear(),month:e.getMonth()+1}}),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:e.behaviors,min:e.minDate,max:e.maxDate},value:e.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){n.popup.setValue(n.storeValue),n.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){n.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){n.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(e.value)},_checkDynamicValue:function(e){var t=null;switch(BI.isNotNull(e)&&(t=e.type),t){case BI.DynamicYearMonthCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},hideView:function(){this.combo.hideView()},setValue:function(e){this.storeValue=e,this.trigger.setValue(e),this._checkDynamicValue(e)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicYearMonthCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthCombo.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_month_combo",BI.DynamicYearMonthCombo),BI.extend(BI.DynamicYearMonthCombo,{Static:1,Dynamic:2})},function(e,t){BI.DynamicYearMonthPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-month-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var e=this,t=(this.options,this.constants);return this.storeValue={type:BI.DynamicYearMonthCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:t.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:t.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Month"),ref:function(){e.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:t.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){var e;this.dateTab.getSelect()===BI.DynamicDateCombo.Static?(this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0)):(e=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()),e=BI.print(e,"%Y-%x"),this.textButton.setValue(e),this.textButton.setEnable(!1))},_getTabJson:function(){var t=this,n=this.options;return{type:"bi.tab",ref:function(){t.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Month"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(e){switch(e){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_month_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){t._setInnerValue(t.year,e)}}],ref:function(){t.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_month_card",behaviors:n.behaviors,min:t.options.min,max:t.options.max,listeners:[{eventName:BI.StaticYearMonthCard.EVENT_CHANGE,action:function(){t.fireEvent(BI.DynamicYearMonthPopup.EVENT_CHANGE)}}],ref:function(){t.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){switch(t.dateTab.getSelect()){case BI.DynamicYearCombo.Static:var e=BI.DynamicDateHelper.getCalculation(t.dynamicPane.getValue());t.year.setValue({year:e.getFullYear(),month:e.getMonth()+1}),t._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:t.storeValue&&t.storeValue.type===BI.DynamicYearCombo.Dynamic?t.dynamicPane.setValue(t.storeValue.value):t.dynamicPane.setValue({year:0}),t._setInnerValue()}}}]}},setMinDate:function(e){this.options.min!==e&&(this.options.min=e,this.year.setMinDate(e))},setMaxDate:function(e){this.options.max!==e&&(this.options.max=e,this.year.setMaxDate(e))},setValue:function(e){this.storeValue=e;var t=(e=e||{}).type||BI.DynamicDateCombo.Static,n=e.value||e;switch(this.dateTab.setSelect(t),t){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(n),this._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(n),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearMonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_popup",BI.DynamicYearMonthPopup)},function(e,t){BI.DynamicYearMonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-month-trigger",min:"1900-01-01",max:"2099-12-31",height:22},beforeInit:function(e){this.options.title=BI.bind(this._titleCreator,this),e()},_init:function(){BI.DynamicYearMonthTrigger.superclass._init.apply(this,arguments);var e=this.options;this.yearEditor=this._createEditor(!0),this.monthEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:e.height},width:e.height}]},{type:"bi.htape",items:[this.monthEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),width:e.height},width:e.height}]}]},{el:{type:"bi.trigger_icon_button",width:e.height},width:e.height}]}),this.setValue(e.value)},_createEditor:function(t){var n=this,i=this.options,e=this._const,r=BI.parseDateTime(i.min,"%Y-%X-%d"),a=BI.createWidget({type:"bi.sign_editor",height:i.height,validationChecker:function(e){return t?""===e||BI.isPositiveInteger(e)&&!BI.checkDateVoid(e,e===r.getFullYear()?r.getMonth()+1:1,1,i.min,i.max)[0]:""===e||BI.isPositiveInteger(e)&&1<=e&&e<=12&&!BI.checkDateVoid(BI.getDate().getFullYear(),e,1,i.min,i.max)[0]},quitChecker:function(){return!1},watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(e){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},hgap:e.hgap,vgap:e.vgap,allowBlank:!0});return a.on(BI.SignEditor.EVENT_KEY_DOWN,function(){n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN)}),a.on(BI.SignEditor.EVENT_FOCUS,function(){n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS)}),a.on(BI.SignEditor.EVENT_STOP,function(){n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP)}),a.on(BI.SignEditor.EVENT_CONFIRM,function(){n._doEditorConfirm(a),n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM)}),a.on(BI.SignEditor.EVENT_SPACE,function(){a.isValid()&&a.blur()}),a.on(BI.SignEditor.EVENT_START,function(){n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_START)}),a.on(BI.SignEditor.EVENT_ERROR,function(){n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_ERROR)}),a.on(BI.SignEditor.EVENT_VALID,function(){var e=n.yearEditor.getValue(),t=n.monthEditor.getValue();BI.isNotEmptyString(e)&&BI.isNotEmptyString(t)&&BI.isPositiveInteger(e)&&1<=t&&t<=12&&!BI.checkDateVoid(e,t,1,i.min,i.max)[0]&&n.fireEvent(BI.DynamicYearMonthTrigger.EVENT_VALID)}),a.on(BI.SignEditor.EVENT_CHANGE,function(){t&&n._autoSwitch(a)}),a},_titleCreator:function(){var e=this.storeValue||{},t=e.type||BI.DynamicDateCombo.Static,n=e.value;if(!this.monthEditor.isValid()||!this.yearEditor.isValid())return"";switch(t){case BI.DynamicDateCombo.Dynamic:var i=this._getText(n),r=BI.getDate(),r=BI.DynamicDateHelper.getCalculation(n),a=BI.print(r,"%Y-%x");return BI.isEmptyString(i)?a:i+":"+a;case BI.DynamicDateCombo.Static:default:return n=n||{},this._getStaticTitle(n)}},_doEditorConfirm:function(e){var t=e.getValue();BI.isNotNull(t)&&e.setValue(t);var n=this.monthEditor.getValue();this.storeValue={type:BI.DynamicDateCombo.Static,value:{year:this.yearEditor.getValue(),month:BI.isEmptyString(this.monthEditor.getValue())?"":n}}},_yearCheck:function(e){var t=BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(e,"%Y"),"%Y")===e&&t>=this.options.min&&t<=this.options.max},_autoSwitch:function(e){var t=e.getValue();BI.isNotEmptyString(t)&&BI.checkDateLegal(t)&&4===t.length&&this._yearCheck(t)&&(this._doEditorConfirm(e),this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM),this.monthEditor.focus())},_getText:function(e){var t="";return BI.isNotNull(e.year)&&0!==BI.parseInt(e.year)&&(t+=Math.abs(e.year)+BI.i18nText("BI-Basic_Year")+(e.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(e.month)&&0!==BI.parseInt(e.month)&&(t+=Math.abs(e.month)+BI.i18nText("BI-Basic_Month")+(e.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),t},_setInnerValue:function(e,t){this.yearEditor.setValue(e.getFullYear()),this.monthEditor.setValue(e.getMonth()+1)},_getStaticTitle:function(e){switch(e=e||{},!(BI.isNull(e.year)||BI.isEmptyString(e.year))<<1|!(BI.isNull(e.month)||BI.isEmptyString(e.month))){case 0:return"";case 1:return e.month;case 2:return e.year;case 3:default:return e.year+"-"+e.month}},setValue:function(e){var t,n,i=BI.getDate();switch(this.storeValue=e,BI.isNotNull(e)&&(t=e.type||BI.DynamicDateCombo.Static,n=e.value||e),t){case BI.DynamicDateCombo.Dynamic:var r=this._getText(n),i=BI.DynamicDateHelper.getCalculation(n);this._setInnerValue(i,r);break;case BI.DynamicDateCombo.Static:default:n=n||{};var a=BI.isNull(n.month)?null:n.month;this.yearEditor.setValue(n.year),this.monthEditor.setValue(a)}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.monthEditor.getValue()},isValid:function(){return this.yearEditor.isValid()&&this.monthEditor.isValid()}}),BI.DynamicYearMonthTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthTrigger.EVENT_START="EVENT_START",BI.DynamicYearMonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_month_trigger",BI.DynamicYearMonthTrigger)},function(e,t){BI.YearMonthInterval=BI.inherit(BI.Single,{constants:{height:24,width:25,lgap:15,offset:-15,timeErrorCls:"time-error"},props:{extraCls:"bi-year-month-interval",minDate:"1900-01-01",maxDate:"2099-12-31"},_init:function(){var e=this.options;BI.YearMonthInterval.superclass._init.apply(this,arguments),e.value=e.value||{},this.left=this._createCombo(e.value.start),this.right=this._createCombo(e.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:this,type:"bi.center",hgap:15,height:this.constants.height,items:[{type:"bi.absolute",items:[{el:this.left,left:this.constants.offset,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:this.right,left:0,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.label]})},_createCombo:function(e){var n=this,t=this.options,i=BI.createWidget({type:"bi.dynamic_year_month_combo",behaviors:t.behaviors,value:e,listeners:[{eventName:BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,action:function(){n.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW)}}]});return i.on(BI.DynamicYearMonthCombo.EVENT_ERROR,function(){n._clearTitle(),BI.Bubbles.hide("error"),n.element.removeClass(n.constants.timeErrorCls),n.fireEvent(BI.YearMonthInterval.EVENT_ERROR)}),i.on(BI.DynamicYearMonthCombo.EVENT_VALID,function(){n._checkValid()}),i.on(BI.DynamicYearMonthCombo.EVENT_FOCUS,function(){n._checkValid()}),i.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,function(){n.left.hideView(),n.right.hideView()}),i.on(BI.DynamicYearMonthCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var e=n.left.getKey(),t=n.right.getKey();n.left.isValid()&&n.right.isValid()&&n._check(e,t)&&n._compare(e,t)?(n._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),n.element.addClass(n.constants.timeErrorCls),n.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(n._clearTitle(),n.element.removeClass(n.constants.timeErrorCls),n.fireEvent(BI.YearMonthInterval.EVENT_CHANGE))}),i},_dateCheck:function(e){return BI.print(BI.parseDateTime(e,"%Y-%x"),"%Y-%x")===e||BI.print(BI.parseDateTime(e,"%Y-%X"),"%Y-%X")===e},_checkVoid:function(e){var t=this.options;return!BI.checkDateVoid(e.year,e.month,1,t.minDate,t.maxDate)[0]},_check:function(e,t){var n=e.match(/\d+/g),i=t.match(/\d+/g),r="";BI.isNotNull(n)&&(r=(n[0]||"")+"-"+(n[1]||1));var a="";return BI.isNotNull(i)&&(a=(i[0]||"")+"-"+(i[1]||1)),this._dateCheck(r)&&BI.checkDateLegal(r)&&this._checkVoid({year:n[0],month:n[1]||1,day:1})&&this._dateCheck(a)&&BI.checkDateLegal(a)&&this._checkVoid({year:i[0],month:i[1]||1,day:1})},_compare:function(e,t){return e=BI.print(BI.parseDateTime(e,"%Y-%X"),"%Y-%X"),t=BI.print(BI.parseDateTime(t,"%Y-%X"),"%Y-%X"),BI.isNotNull(e)&&BI.isNotNull(t)&&t<e},_setTitle:function(e){this.setTitle(e)},_clearTitle:function(){this.setTitle("")},_checkValid:function(){var e=this;BI.Bubbles.hide("error");var t=e.left.getKey(),n=e.right.getKey();e.left.isValid()&&e.right.isValid()&&e._check(t,n)&&e._compare(t,n)?(e._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),e.element.addClass(e.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),e,{offsetStyle:"center"}),e.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(e._clearTitle(),e.element.removeClass(e.constants.timeErrorCls))},setValue:function(e){e=e||{},this.left.setValue(e.start),this.right.setValue(e.end),this._checkValid()},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.YearMonthInterval.EVENT_VALID="EVENT_VALID",BI.YearMonthInterval.EVENT_ERROR="EVENT_ERROR",BI.YearMonthInterval.EVENT_CHANGE="EVENT_CHANGE",BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.year_month_interval",BI.YearMonthInterval)},function(e,t){BI.DynamicYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var e=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){e.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.QUARTER,ref:function(){e.quarter=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(e,t){return{dateType:e,value:Math.abs(t),offset:0<t?1:0}},setValue:function(e){e=e||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,e.year)),this.quarter.setValue(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,e.quarter))},getValue:function(){var e=this.year.getValue(),t=this.quarter.getValue();return{year:0===e.offset?-e.value:e.value,quarter:0===t.offset?-t.value:t.value}}}),BI.DynamicYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_card",BI.DynamicYearQuarterCard)},function(e,t){BI.StaticYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-quarter-card",behaviors:{}},_createQuarter:function(){var e=[{text:BI.Date._QN[1],value:1},{text:BI.Date._QN[2],value:2},{text:BI.Date._QN[3],value:3},{text:BI.Date._QN[4],value:4}];return BI.map(e,function(e,t){return BI.extend(t,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:24})})},render:function(){var t=this,e=this.options;return{type:"bi.vertical",items:[{type:"bi.year_picker",ref:function(){t.yearPicker=this},behaviors:e.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var e=this.getValue();t.setValue({year:e,quarter:t.selectedQuarter})}}]},{type:"bi.button_group",behaviors:e.behaviors,ref:function(){t.quarter=this},items:this._createQuarter(),layouts:[{type:"bi.vertical",vgap:10}],value:e.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){t.selectedYear=t.yearPicker.getValue(),t.selectedQuarter=this.getValue()[0],t.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE)}}]}]}},getValue:function(){return{year:this.selectedYear,quarter:this.selectedQuarter}},setValue:function(e){var t,n=this.options,i={};i.year=e.year||0,i.quarter=e.quarter||0,0===i.quarter||0===i.year||BI.checkDateVoid(i.year,i.quarter,1,n.min,n.max)[0]?(t=i.year||BI.getDate().getFullYear(),this.selectedYear=t,this.selectedQuarter="",this.yearPicker.setValue(t),this.quarter.setValue()):(this.selectedYear=BI.parseInt(i.year),this.selectedQuarter=BI.parseInt(i.quarter),this.yearPicker.setValue(this.selectedYear),this.quarter.setValue(this.selectedQuarter))}}),BI.StaticYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_quarter_card",BI.StaticYearQuarterCard)},function(e,t){BI.DynamicYearQuarterCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-quarter-combo bi-border bi-border-radius bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterCombo.superclass._init.apply(this,arguments);var n=this,e=this.options;this.storeValue=e.value,n.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_quarter_trigger",min:e.min,max:e.max,height:e.height,value:e.value||""}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN,function(){n.combo.isViewVisible()&&n.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START,function(){n.combo.isViewVisible()&&n.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP,function(){n.combo.showView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR,function(){n.combo.isViewVisible()&&n.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM,function(){var e=n.storeTriggerValue,t=n.trigger.getKey();BI.isNotEmptyString(t)&&!BI.isEqual(t,e)&&(n.storeValue=n.trigger.getValue(),n.setValue(n.trigger.getValue())),n._checkDynamicValue(n.storeValue),n.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS,function(){n.storeTriggerValue=n.trigger.getKey()}),this.combo=BI.createWidget({type:"bi.combo",container:e.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_quarter_popup",ref:function(){n.popup=this},listeners:[{eventName:BI.DynamicYearQuarterPopup.EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.combo.hideView(),n.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){n.setValue(),n.combo.hideView(),n.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var e=BI.getDate();n.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:e.getFullYear(),quarter:BI.getQuarter(e)}}),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,action:function(){n.setValue(n.popup.getValue()),n.combo.hideView(),n.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:e.behaviors,min:e.min,max:e.max},value:e.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){n.popup.setValue(n.storeValue),n.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){n.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){n.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(e.value)},_checkDynamicValue:function(e){var t=null;switch(BI.isNotNull(e)&&(t=e.type),t){case BI.DynamicYearQuarterCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(e){this.storeValue=e,this.trigger.setValue(e),this._checkDynamicValue(e)},getValue:function(){return this.storeValue}}),BI.DynamicYearQuarterCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_quarter_combo",BI.DynamicYearQuarterCombo),BI.extend(BI.DynamicYearQuarterCombo,{Static:1,Dynamic:2})},function(e,t){BI.DynamicYearQuarterPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-quarter-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var e=this,t=(this.options,this.constants);return this.storeValue={type:BI.DynamicYearQuarterCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:t.buttonHeight-1,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:t.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Quarter"),ref:function(){e.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:t.buttonHeight-1,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){e.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){var e;this.dateTab.getSelect()===BI.DynamicYearQuarterCombo.Static?(this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0)):(e=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()),e=BI.print(e,"%Y-%Q"),this.textButton.setValue(e),this.textButton.setEnable(!1))},_getTabJson:function(){var t=this,n=this.options;return{type:"bi.tab",ref:function(){t.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Quarter"),value:BI.DynamicYearQuarterCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearQuarterCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(e){switch(e){case BI.DynamicYearQuarterCombo.Dynamic:return{type:"bi.dynamic_year_quarter_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){t._setInnerValue(t.year,e)}}],ref:function(){t.dynamicPane=this}};case BI.DynamicYearQuarterCombo.Static:default:return{type:"bi.static_year_quarter_card",behaviors:n.behaviors,min:t.options.min,max:t.options.max,listeners:[{eventName:BI.DynamicYearCard.EVENT_CHANGE,action:function(){t.fireEvent(BI.DynamicYearQuarterPopup.EVENT_CHANGE)}}],ref:function(){t.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){switch(t.dateTab.getSelect()){case BI.DynamicYearQuarterCombo.Static:var e=BI.DynamicDateHelper.getCalculation(t.dynamicPane.getValue());t.year.setValue({year:e.getFullYear(),quarter:BI.getQuarter(e)}),t._setInnerValue();break;case BI.DynamicYearQuarterCombo.Dynamic:default:t.storeValue&&t.storeValue.type===BI.DynamicYearQuarterCombo.Dynamic?t.dynamicPane.setValue(t.storeValue.value):t.dynamicPane.setValue({year:0}),t._setInnerValue()}}}]}},setValue:function(e){this.storeValue=e;var t=(e=e||{}).type||BI.DynamicDateCombo.Static,n=e.value||e;switch(this.dateTab.setSelect(t),t){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(n),this._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(n),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearQuarterPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_popup",BI.DynamicYearQuarterPopup)},function(e,t){BI.DynamicYearQuarterTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-quarter-trigger",min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterTrigger.superclass._init.apply(this,arguments);var e=this.options;this.yearEditor=this._createEditor(!0),this.quarterEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:e.height},width:e.height}]},{type:"bi.htape",items:[this.quarterEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Quarter"),width:24},width:24}]}]},{el:{type:"bi.trigger_icon_button",width:e.height},width:e.height}]}),this.setValue(e.value)},_createEditor:function(t){var e=this,n=this.options,i=this._const,r=BI.createWidget({type:"bi.sign_editor",height:n.height,validationChecker:function(e){return t?""===e||BI.isPositiveInteger(e)&&!BI.checkDateVoid(e,1,1,n.min,n.max)[0]:""===e||BI.isPositiveInteger(e)&&1<=e&&e<=4&&!BI.checkDateVoid(BI.getDate().getFullYear(),e,1,n.min,n.max)[0]},quitChecker:function(){return!1},errorText:function(e){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},watermark:BI.i18nText("BI-Basic_Unrestricted"),hgap:i.hgap,vgap:i.vgap,title:"",allowBlank:!0});return r.on(BI.SignEditor.EVENT_KEY_DOWN,function(){e.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN)}),r.on(BI.SignEditor.EVENT_FOCUS,function(){e.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS)}),r.on(BI.SignEditor.EVENT_STOP,function(){e.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP)}),r.on(BI.SignEditor.EVENT_CONFIRM,function(){e._doEditorConfirm(r),e.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM)}),r.on(BI.SignEditor.EVENT_SPACE,function(){r.isValid()&&r.blur()}),r.on(BI.SignEditor.EVENT_START,function(){e.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_START)}),r.on(BI.SignEditor.EVENT_ERROR,function(){e.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_ERROR)}),r.on(BI.SignEditor.EVENT_CHANGE,function(){t&&e._autoSwitch(r)}),r},_doEditorConfirm:function(e){var t=e.getValue();BI.isNotNull(t)&&e.setValue(t);var n=this.quarterEditor.getValue();this.storeValue={type:BI.DynamicYearQuarterCombo.Static,value:{year:this.yearEditor.getValue(),quarter:BI.isEmptyString(this.quarterEditor.getValue())?"":n}},this.setTitle(this._getStaticTitle(this.storeValue.value))},_yearCheck:function(e){var t=BI.print(BI.parseDateTime(e,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(e,"%Y"),"%Y")===e&&t>=this.options.min&&t<=this.options.max},_autoSwitch:function(e){var t=e.getValue();BI.isNotEmptyString(t)&&BI.checkDateLegal(t)&&4===t.length&&this._yearCheck(t)&&(this._doEditorConfirm(e),this.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM),this.quarterEditor.focus())},_getStaticTitle:function(e){switch(e=e||{},!(BI.isNull(e.year)||BI.isEmptyString(e.year))<<1|!(BI.isNull(e.quarter)||BI.isEmptyString(e.quarter))){case 0:return"";case 1:return e.quarter;case 2:return e.year;case 3:default:return e.year+"-"+e.quarter}},_getText:function(e){var t="";return BI.isNotNull(e.year)&&0!==BI.parseInt(e.year)&&(t+=Math.abs(e.year)+BI.i18nText("BI-Basic_Year")+(e.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(e.quarter)&&0!==BI.parseInt(e.quarter)&&(t+=Math.abs(e.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(e.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),t},_setInnerValue:function(e,t){var n=BI.print(e,"%Y-%Q");this.yearEditor.setValue(e.getFullYear()),this.quarterEditor.setValue(BI.getQuarter(e)),this.setTitle(BI.isEmptyString(t)?n:t+":"+n)},setValue:function(e){var t,n,i=BI.getDate();switch(this.storeValue=e,BI.isNotNull(e)&&(t=e.type||BI.DynamicYearQuarterCombo.Static,n=e.value||e),t){case BI.DynamicYearQuarterCombo.Dynamic:var r=this._getText(n),i=BI.DynamicDateHelper.getCalculation(n);this._setInnerValue(i,r);break;case BI.DynamicYearQuarterCombo.Static:default:n=n||{};var a=BI.isNull(n.quarter)?null:n.quarter;this.yearEditor.setValue(n.year),this.yearEditor.setTitle(n.year),this.quarterEditor.setValue(a),this.quarterEditor.setTitle(a),this.setTitle(this._getStaticTitle(n))}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.quarterEditor.getValue()}}),BI.DynamicYearQuarterTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearQuarterTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearQuarterTrigger.EVENT_START="EVENT_START",BI.DynamicYearQuarterTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_quarter_trigger",BI.DynamicYearQuarterTrigger)},function(e,t){BI.AbstractAllValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractAllValueChooser.superclass._defaultConfig.apply(this,arguments),{width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(n){var i=n;return BI.isNotNull(this.items)&&BI.some(this.items,function(e,t){if(t.value===n||t.value+""===n)return i=t.text,!0}),i},_itemsCreator:function(t,a){var n=this,e=this.options;function i(i){var e=(t.keywords||[]).slice();t.keyword&&e.push(t.keyword);var n,r=i;BI.isNotEmptyArray(e)&&(r=[],BI.each(e,function(e,t){var n=BI.Func.getSearchResult(i,t);r=r.concat(n.match).concat(n.find)}),r=BI.uniq(r)),t.selectedValues&&(n=BI.makeObject(t.selectedValues,!0),r=BI.filter(r,function(e,t){return!n[t.value]})),t.type!==BI.MultiSelectCombo.REQ_GET_ALL_DATA?t.type!==BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?a({items:r,hasNext:!1}):a({count:r.length}):a({items:r})}e.cache&&this.items?i(this.items):e.itemsCreator({},function(e){i(n.items=e)})}})},function(e,t){BI.AllValueChooserCombo=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;BI.isNotNull(t.items)&&(this.items=t.items),this.combo=BI.createWidget({type:"bi.multi_select_combo",text:t.text,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:t.width,height:t.height,value:{type:BI.Selection.Multi,value:t.value||[]}}),this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM,function(){e.fireEvent(BI.AllValueChooserCombo.EVENT_CONFIRM)})},setValue:function(e){this.combo.setValue({type:BI.Selection.Multi,value:e||[]})},getValue:function(){var e=this.combo.getValue()||{};return e.type===BI.Selection.All?e.assist:e.value||[]},populate:function(e){this.items=e,this.combo.populate.apply(this.combo,arguments)}}),BI.AllValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_chooser_combo",BI.AllValueChooserCombo)},function(e,t){BI.AllValueChooserPane=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-pane",width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserPane.superclass._init.apply(this,arguments);var e=this,t=this.options;BI.isNotNull(t.items)&&(this.items=t.items),this.list=BI.createWidget({type:"bi.multi_select_list",element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:t.width,height:t.height}),this.list.on(BI.MultiSelectList.EVENT_CHANGE,function(){e.fireEvent(BI.AllValueChooserPane.EVENT_CHANGE)})},setValue:function(e){this.list.setValue({type:BI.Selection.Multi,value:e||[]})},getValue:function(){var e=this.list.getValue()||{};return e.type===BI.Selection.All?e.assist:e.value||[]},populate:function(e){this.items=e,this.list.populate.apply(this.list,arguments)}}),BI.AllValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_value_chooser_pane",BI.AllValueChooserPane)},function(e,t){BI.AllValueMultiTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-all-value-multi-text-value-combo",width:200,height:24,items:[]},render:function(){var e=this,t=this.options,n=this._digestValue(t.value);return{type:"bi.search_multi_text_value_combo",text:t.text,height:t.height,items:t.items,value:n,numOfPage:100,valueFormatter:t.valueFormatter,warningTitle:t.warningTitle,listeners:[{eventName:BI.SearchMultiTextValueCombo.EVENT_CONFIRM,action:function(){e.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM)}}],ref:function(){e.combo=this}}},setValue:function(e){var t=this._digestValue(e);this.combo.setValue(t)},getValue:function(){var n=this.combo.getValue()||{};if(n.value=n.value||[],n.type!==BI.Selection.All)return n.value||[];var i=[];return BI.each(this.options.items,function(e,t){BI.contains(n.value,t.value)||i.push(t.value)}),i},populate:function(e){this.options.items=e,this.combo.populate.apply(this.combo,arguments)},_digestValue:function(e){return{type:BI.Selection.Multi,value:e||[]}}}),BI.AllValueMultiTextValueCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_multi_text_value_combo",BI.AllValueMultiTextValueCombo)},function(e,t){BI.AbstractTreeValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,open:!1})},_valueFormatter:function(n){var i=n;return BI.isNotNull(this.items)&&BI.some(this.items,function(e,t){if(t.value===n||t.value+""===n)return i=t.text,!0}),i},_initData:function(e){this.items=e;var t=BI.Tree.treeFormat(e);this.tree=new BI.Tree,this.tree.initTree(t)},_itemsCreator:function(e,t){var n=this,i=this.options;function r(){switch(e.type){case BI.TreeView.REQ_TYPE_INIT_DATA:n._reqInitTreeNode(e,t);break;case BI.TreeView.REQ_TYPE_ADJUST_DATA:n._reqAdjustTreeNode(e,t);break;case BI.TreeView.REQ_TYPE_SELECT_DATA:n._reqSelectedTreeNode(e,t);break;case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:n._reqDisplayTreeNode(e,t);break;default:n._reqTreeNode(e,t)}}this.items?r():i.itemsCreator({},function(e){n._initData(e),r()})},_reqDisplayTreeNode:function(e,t){var o=this,i=[],n=e.selectedValues;function s(e,t){return null==e?0:BI.isEmpty(e)?o._getChildCount(t):BI.size(e)}function l(e,t,n){i.push({id:e.id,pId:t,text:e.text+(0<n?"("+BI.i18nText("BI-Basic_Altogether")+n+BI.i18nText("BI-Basic_Count")+")":""),value:e.value,open:!0})}null==n||BI.isEmpty(n)?t({}):(function u(r,a,i){if(null==i||BI.isEmpty(i))return void BI.each(a.getChildren(),function(e,t){var n=BI.clone(r);n.push(t.value);var i=o._getChildCount(n);l(t,a.id,i),u(n,t,{})});BI.each(i,function(e){var t,n=o._getTreeNode(r,e);BI.isNull(n)?l({id:BI.UUID(),text:e,value:e},BI.UUID(),0):((t=BI.clone(r)).push(n.value),l(n,n.parent&&n.parent.id,s(i[e],t)),u(t,n,i[e]))})}([],this.tree.getRoot(),n),t({items:i}))},_reqSelectedTreeNode:function(e,t){var p=this,n=BI.deepClone(e.selectedValues),a=e.notSelectedValue||{},l=e.keyword||"",o=e.parentValues||[];function s(o,s,l){var u=o,c=[],h=[];BI.some(s,function(n,e){var t=u[e];if(null==t){if(0===n)return!0;if(!BI.isEmpty(u))return!0;var i=s.slice(0,n),r=p._getChildren(i);if(h.push(i),c.push(r.length),n===s.length-1&&1===r.length&&r[0].value===l)for(var a=c.length-1;0<=a&&1===c[a];a--)p._deleteNode(o,h[a]);else BI.each(r,function(e,t){return n===s.length-1&&t.value===l||void(u[t.value]={})});u=u[e]}else u=t})}function u(e,t,i,n){var r=BI.clone(e);if(r.push(t),p._isMatch(e,t,l))return n&&n.push(r),!0;var a=p._getChildren(r),o=[],s=!1;return BI.each(a,function(e,t){u(r,t.value,i,n)?s=!0:o.push(t.value)}),!0===s&&BI.each(o,function(e,t){var n=BI.clone(r);n.push(t),i.push(n)}),s}function c(e){for(var t=0,n=e.length;t<n;t++)if(p._isMatch(e.slice(0,t),e[t],l))return 1}null==n||BI.isEmpty(n)?t({}):(function(n){var e=o.concat(a);{var t;!function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(null==(n=n[r]))return!1}return!0}(n,e)||(c(e)?p._deleteNode(n,e):(r=u(o,a,[],t=[]))&&BI.isNotEmptyArray(t)&&BI.each(t,function(e,t){p._getNode(n,t)?p._deleteNode(n,t):s(n,t,BI.last(t))}))}{var i,r;!function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(!BI.has(n,r))return!1;if(n=n[r],BI.isEmpty(n))return!0}return!1}(n,e)||(r=!(i=[]),c(e)?r=!0:(r=u(o,a,i),e=o),!0===r&&(s(n,e,a),0<i.length&&BI.each(i,function(e,t){p._buildTree(n,t)})))}}(n),t(n))},_reqAdjustTreeNode:function(e,t){var n,i=this,o=[],r=e.selectedValues;null==r||BI.isEmpty(r)?t({}):(BI.each(r,function(e,t){o.push([e])}),function s(n,r){if(null==n||BI.isEmpty(n))return!0;var a=!0;BI.each(n,function(e,t){var i=BI.clone(r);i.push(e),s(n[e],i)||(BI.each(n[e],function(e,t){var n=BI.clone(i);n.push(e),o.push(n)}),a=!1)});return a&&(e=n,t=r,BI.isEmpty(e)||i._getChildCount(t)===BI.size(e));var e,t}(r,[]),n={},BI.each(o,function(e,t){i._buildTree(n,t)}),t(n))},_reqInitTreeNode:function(l,e){var f=this,u=[],g=l.keyword||"",c=l.selectedValues,h=l.lastSearchValue||"",t=function(){var e=f._getChildren([]),t=e.length;if(""!==h){for(var n=0,i=t;n<i;n++)if(e[n].value===h){t=n+1;break}}else t=0;for(var r=[],a=t,i=e.length;a<i;a++){var o;if(r.length<f._const.perPage?o=m(1,[],e[a].value,!1,u):r.length===f._const.perPage&&(o=m(1,[],e[a].value,!1,[])),!0===o[0]&&r.push(e[a].value),r.length>f._const.perPage)break}{var s;1===l.times&&(s=f._getAddedValueNode([],c),u=BI.concat(BI.filter(s,function(e,t){var n=BI.Func.getSearchResult([t.text||t.value],g);return 0<n.find.length||0<n.match.length}),u))}return r}();function m(i,e,t,n,r){var a,o;if(f._isMatch(e,t,g))return I(e,t,!1,p=n||B(e,t),!n&&(a=t,null!=(o=_(e))?BI.any(o,function(e,t){if(e===a&&null!=t&&!BI.isEmpty(t))return!0}):null),!0,r),[!0,p];var s=BI.clone(e);s.push(t);var l,u,c=f._getChildren(s),h=!1,p=!1,d=n||(l=t,null!=(u=_(e))?BI.any(u,function(e,t){if(e===l&&null!=t&&BI.isEmpty(t))return!0}):null);return BI.each(c,function(e,t){var n=m(i+1,s,t.value,d,r);!0===n[1]&&(p=!0),!0===n[0]&&(h=!0)}),!0===h&&I(e,t,!0,p=d||B(e,t)&&p,!1,!1,r),[h,p]}function I(e,t,n,i,r,a,o){var s=f._getTreeNode(e,t);o.push({id:s.id,pId:s.pId,text:s.text,value:s.value,title:s.title,isParent:0<s.getChildrenLength(),open:n,checked:i,halfCheck:r,flag:a})}function B(e,t){var n=_(e);return null!=n&&BI.any(n,function(e){if(e===t)return!0})}function _(e){var n=c;return null==n?null:(BI.every(e,function(e,t){return null!=(n=n[t])}),n)}BI.nextTick(function(){e({hasNext:t.length>f._const.perPage,items:u,lastSearchValue:BI.last(t)})})},_reqTreeNode:function(e,t){for(var n,c=this,i=this.options,o=[],r=e.times,a=e.checkState||{},s=e.parentValues||[],l=e.selectedValues||{},u=f(s,l),h=this._getChildren(s),p=(r-1)*this._const.perPage;h[p]&&p<r*this._const.perPage;p++){var d=g(h[p].value,s,u,a);o.push({id:h[p].id,pId:h[p].pId,value:h[p].value,text:h[p].text,times:1,isParent:0<h[p].getChildrenLength(),checked:d[0],halfCheck:d[1],open:i.open})}function f(e,n){var i={};return BI.each(e,function(e,t){n=n[t]||{}}),BI.each(n,function(e,t){var n;BI.isNull(t)?i[e]=[0,0]:BI.isEmpty(t)?i[e]=[2,0]:(n={},BI.each(t,function(e,t){(BI.isNull(t)||BI.isEmpty(t))&&(n[e]=!0)}),i[e]=[1,BI.size(n)])}),i}function g(e,t,n,i){var r,a,o=i.checked,s=i.half,l=!1,u=!1;return BI.has(n,e)&&(1===n[e][0]?((r=BI.clone(t)).push(e),0<(a=c._getChildCount(r))&&a!==n[e][1]&&(u=!0)):2===n[e][0]&&(l=!0)),[(o||u||l)&&(l||o)&&!s||BI.has(n,e),u]}i.open&&(n=[],BI.each(h,function(e,t){n=BI.concat(n,c._getAllChildren(s.concat([t.value])))}),BI.each(n,function(e,n){var t=f(n.parentValues,l),i={},r=BI.find(o,function(e,t){return t.id===n.pId});r&&(i.checked=!r.halfCheck&&r.checked,i.half=r.halfCheck);var a=g(n.value,n.parentValues,t,i);o.push({id:n.id,pId:n.pId,value:n.value,text:n.text,times:1,isParent:0<n.getChildrenLength(),checked:a[0],halfCheck:a[1],open:c.options.open})})),0===s.length&&1===r&&(o=BI.concat(c._getAddedValueNode(s,l),o)),BI.nextTick(function(){t({items:o,hasNext:h.length>r*c._const.perPage})})},_getAddedValueNode:function(e,t){var n=this._getChildren(e);return BI.map(BI.difference(BI.keys(t),BI.map(n,"value")),function(e,t){return{id:BI.UUID(),pId:0<n.length?n[0].pId:BI.UUID(),value:t,text:t,times:1,isParent:!1,checked:!0,halfCheck:!1}})},_getNode:function(e,t){for(var n=e,i=0,r=t.length;i<r;i++){if(null==n)return null;n=n[t[i]]}return n},_deleteNode:function(e,t){var n=t[t.length-1],i=t.slice(0,t.length-1),r=this._getNode(e,i);if(null!=r&&r[n])for(delete r[n];0<i.length&&BI.isEmpty(r);)n=i[i.length-1],i=i.slice(0,i.length-1),null!=(r=this._getNode(e,i))&&delete r[n]},_buildTree:function(e,t){var n=e;BI.each(t,function(e,t){BI.has(n,t)||(n[t]={}),n=n[t]})},_isMatch:function(e,t,n){var i=this.options,r=this._getTreeNode(e,t);if(!r)return!1;var a=BI.Func.getSearchResult([r.text||r.value],n);if(i.allowSearchValue&&r.value){var o=BI.Func.getSearchResult([r.value],n);return 0<o.find.length||0<o.match.length||0<a.find.length||0<a.match.length}return 0<a.find.length||0<a.match.length},_getTreeNode:function(t,n){var i,r=this,a=0;return this.tree.traverse(function(e){if(!r.tree.isRoot(e)){if(a>t.length)return!1;if(a===t.length&&e.value===n)return i=e,!1;if(e.value!==t[a])return!0;a++}}),i},_getChildren:function(e){var t;return(0<e.length?(t=BI.last(e),this._getTreeNode(e.slice(0,e.length-1),t)):this.tree.getRoot()).getChildren()},_getAllChildren:function(n){var e=this._getChildren(n),t=[].concat(e);BI.each(t,function(e,t){t.parentValues=n});for(var i=BI.map(e,function(e,t){return{parentValues:n,value:t.value}});BI.isNotEmptyArray(i);){var r=i.shift(),a=r.parentValues.concat(r.value),o=this._getChildren(a);BI.each(o,function(e,t){t.parentValues=a}),i=i.concat(o),t=t.concat(o)}return t},_getChildCount:function(e){return this._getChildren(e).length}})},function(e,t){BI.AbstractListTreeValueChooser=BI.inherit(BI.AbstractTreeValueChooser,{_reqDisplayTreeNode:function(e,t){var n,a=this,o={},i=e.selectedValues;function s(e,t){o[e.id]={id:e.id,pId:t,text:e.text,value:e.value,open:!0,isLeaf:e.isLeaf}}null==i||BI.isEmpty(i)?t({}):(this.tree.getRoot(),n=i,BI.each(n,function(e,r){BI.each(r,function(e,t){var n=t,i=a._getTreeNode(r.slice(0,e),n);BI.isNull(i)?s({id:BI.UUID(),text:n,value:n,isLeaf:!0},BI.UUID()):(BI.has(o,i.id)||s(i,i.parent&&i.parent.id),!0!==o[i.id].isLeaf&&(o[i.id].isLeaf=e===r.length-1))})}),t({items:BI.values(o)}))},_reqInitTreeNode:function(l,e){var u=this,c=[],h=l.keyword||"",p=l.selectedValues,d=l.lastSearchValue||"",t=function(){var e=u._getChildren([]),t=e.length;if(""!==d){for(var n=0,i=t;n<i;n++)if(e[n].value===d){t=n+1;break}}else t=0;for(var r=[],a=t,i=e.length;a<i;a++){var o;if(r.length<u._const.perPage?o=f(1,[],e[a].value,c):r.length===u._const.perPage&&(o=f(1,[],e[a].value,[])),!0===o[0]&&r.push(e[a].value),r.length>u._const.perPage)break}{var s;1===l.times&&(s=u._getAddedValueNode([],p),c=BI.concat(BI.filter(s,function(e,t){var n=BI.Func.getSearchResult([t.text||t.value],h);return 0<n.find.length||0<n.match.length}),c))}return r}();function f(i,e,t,r){if(u._isMatch(e,t,h))return g(e,t,!1,s=m(e,t),!0,r),[!0,s];var a=BI.clone(e);a.push(t);var n=u._getChildren(a),o=!1,s=!1;return BI.each(n,function(e,t){var n=f(i+1,a,t.value,r);!0===n[1]&&(s=!0),!0===n[0]&&(o=!0)}),!0===o&&g(e,t,!0,s=m(e,t),!1,r),[o,s]}function g(e,t,n,i,r,a){var o=u._getTreeNode(e,t);a.push({id:o.id,pId:o.pId,text:o.text,value:o.value,title:o.title,isParent:0<o.getChildrenLength(),open:n,checked:i,halfCheck:!1,flag:r})}function m(n,i){return BI.any(p,function(e,t){return BI.isEqual(n,t.slice(0,n.length))&&BI.last(t)===i})}BI.nextTick(function(){e({hasNext:t.length>u._const.perPage,items:c,lastSearchValue:BI.last(t)})})},_reqTreeNode:function(e,t){for(var n,i=this,r=this.options,a=[],o=e.times,s=e.parentValues||[],l=e.selectedValues||[],u=d(s,l),c=this._getChildren(s),h=(o-1)*this._const.perPage;c[h]&&h<o*this._const.perPage;h++){var p=BI.has(u,c[h].value);a.push({id:c[h].id,pId:c[h].pId,value:c[h].value,text:c[h].text,times:1,isParent:0<c[h].getChildrenLength(),checked:p,halfCheck:!1,open:r.open})}function d(n,e){var i={};return BI.each(e,function(e,t){BI.isEqual(n,t.slice(0,n.length))&&(i[BI.last(t)]=[2,0])}),i}r.open&&(n=[],BI.each(c,function(e,t){n=BI.concat(n,i._getAllChildren(s.concat([t.value])))}),BI.each(n,function(e,t){var n=d(t.parentValues,l),i=BI.has(n,t.value);a.push({id:t.id,pId:t.pId,value:t.value,text:t.text,times:1,isParent:0<t.getChildrenLength(),checked:i,halfCheck:!1,open:r.open})})),0===s.length&&1===o&&(a=BI.concat(i._getAddedValueNode(s,l),a)),BI.nextTick(function(){t({items:a,hasNext:c.length>o*i._const.perPage})})},_getAddedValueNode:function(e,t){var n=this._getChildren(e),i=BI.flatten(BI.filter(t,function(e,t){return 1===t.length}));return BI.map(BI.difference(i,BI.map(n,"value")),function(e,t){return{id:BI.UUID(),pId:0<n.length?n[0].pId:BI.UUID(),value:t,text:t,times:1,isParent:!1,checked:!0,halfCheck:!1}})}})},function(e,t){BI.ListTreeValueChooserInsertCombo=BI.inherit(BI.AbstractListTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.ListTreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,isNeedAdjustWidth:!0})},_init:function(){BI.ListTreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var t=this,e=this.options;BI.isNotNull(e.items)&&this._initData(e.items),this.combo=BI.createWidget({type:"bi.multi_tree_list_combo",isNeedAdjustWidth:e.isNeedAdjustWidth,element:this,text:e.text,value:e.value,watermark:e.watermark,allowInsertValue:e.allowInsertValue,allowEdit:e.allowEdit,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:e.width,height:e.height,listeners:[{eventName:BI.MultiTreeListCombo.EVENT_FOCUS,action:function(){t.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeListCombo.EVENT_BLUR,action:function(){t.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeListCombo.EVENT_STOP,action:function(){t.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeListCombo.EVENT_CLICK_ITEM,action:function(e){t.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM,e)}},{eventName:BI.MultiTreeListCombo.EVENT_SEARCHING,action:function(){t.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeListCombo.EVENT_CONFIRM,action:function(){t.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM)}},{eventName:BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW)}}]})},setValue:function(e){this.combo.setValue(e)},getValue:function(){return this.combo.getValue()},populate:function(e){this._initData(e),this.combo.populate.apply(this.combo,arguments)}}),BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ListTreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.ListTreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.ListTreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.list_tree_value_chooser_insert_combo",BI.ListTreeValueChooserInsertCombo)},function(e,t){BI.TreeValueChooserInsertCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,isNeedAdjustWidth:!0})},_init:function(){BI.TreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var t=this,e=this.options;BI.isNotNull(e.items)&&this._initData(e.items),this.combo=BI.createWidget({type:"bi.multi_tree_insert_combo",isNeedAdjustWidth:e.isNeedAdjustWidth,allowEdit:e.allowEdit,text:e.text,value:e.value,watermark:e.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:e.width,height:e.height,listeners:[{eventName:BI.MultiTreeInsertCombo.EVENT_FOCUS,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeInsertCombo.EVENT_BLUR,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeInsertCombo.EVENT_STOP,action:function(){t.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,action:function(e){t.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM,e)}},{eventName:BI.MultiTreeInsertCombo.EVENT_SEARCHING,action:function(){t.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CONFIRM,action:function(){t.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM)}},{eventName:BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW)}}]})},setValue:function(e){this.combo.setValue(e)},getValue:function(){return this.combo.getValue()},populate:function(e){this._initData(e),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.TreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.tree_value_chooser_insert_combo",BI.TreeValueChooserInsertCombo)},function(e,t){BI.TreeValueChooserCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,isNeedAdjustWidth:!0})},_init:function(){BI.TreeValueChooserCombo.superclass._init.apply(this,arguments);var t=this,e=this.options;BI.isNotNull(e.items)&&this._initData(e.items),this.combo=BI.createWidget({type:"bi.multi_tree_combo",text:e.text,allowEdit:e.allowEdit,value:e.value,watermark:e.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:e.width,height:e.height,isNeedAdjustWidth:e.isNeedAdjustWidth,listeners:[{eventName:BI.MultiTreeCombo.EVENT_FOCUS,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeCombo.EVENT_BLUR,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeCombo.EVENT_STOP,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP)}},{eventName:BI.MultiTreeCombo.EVENT_CLICK_ITEM,action:function(e){t.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM,e)}},{eventName:BI.MultiTreeCombo.EVENT_SEARCHING,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeCombo.EVENT_CONFIRM,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM)}},{eventName:BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){t.fireEvent(BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW)}}]})},setValue:function(e){this.combo.setValue(e)},getValue:function(){return this.combo.getValue()},populate:function(e){this._initData(e),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.TreeValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TreeValueChooserCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.tree_value_chooser_combo",BI.TreeValueChooserCombo)},function(e,t){BI.TreeValueChooserPane=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-pane",items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserPane.superclass._init.apply(this,arguments);var e=this,t=this.options;this.pane=BI.createWidget({type:"bi.multi_select_tree",element:this,itemsCreator:BI.bind(this._itemsCreator,this)}),this.pane.on(BI.MultiSelectTree.EVENT_CHANGE,function(){e.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE)}),BI.isNotNull(t.items)&&(this._initData(t.items),this.populate())},setSelectedValue:function(e){this.pane.setSelectedValue(e)},setValue:function(e){this.pane.setValue(e)},getValue:function(){return this.pane.getValue()},populate:function(){this.pane.populate.apply(this.pane,arguments)}}),BI.TreeValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tree_value_chooser_pane",BI.TreeValueChooserPane)},function(e,t){BI.AbstractValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(n){var i=n;return BI.isNotNull(this.items)&&BI.some(this.items,function(e,t){if(t.value===n||t.value+""===n)return i=t.text,!0}),i},_getItemsByTimes:function(e,t){for(var n=[],i=(t-1)*this._const.perPage;e[i]&&i<t*this._const.perPage;i++)n.push(e[i]);return n},_hasNextByTimes:function(e,t){return t*this._const.perPage<e.length},_itemsCreator:function(t,a){var o=this,e=this.options;function n(i){var n,e=(t.keywords||[]).slice(),r=i;BI.isNotEmptyArray(e)&&(r=[],BI.each(e,function(e,t){var n=BI.Func.getSearchResult(i,t);r=r.concat(n.match).concat(n.find)}),r=BI.uniq(r)),t.selectedValues&&(n=BI.makeObject(t.selectedValues,!0),r=BI.filter(r,function(e,t){return!n[t.value]})),t.type!==BI.MultiSelectCombo.REQ_GET_ALL_DATA?t.type!==BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?a({items:o._getItemsByTimes(r,t.times),hasNext:o._hasNextByTimes(r,t.times)}):a({count:r.length}):a({items:r})}e.cache&&this.items?n(this.items):e.itemsCreator({},function(e){n(o.items=e)})}})},function(e,t){BI.ValueChooserInsertCombo=BI.inherit(BI.AbstractValueChooser,{_defaultConfig:function(){return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.ValueChooserInsertCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;BI.isNotNull(t.items)&&(this.items=t.items),this.combo=BI.createWidget({type:"bi.multi_select_insert_combo",element:this,allowEdit:t.allowEdit,text:t.text,value:t.value,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:t.width,height:t.height,listeners:[{eventName:BI.MultiSelectCombo.EVENT_FOCUS,action:function(){e.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS)}},{eventName:BI.MultiSelectCombo.EVENT_BLUR,action:function(){e.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR)}},{eventName:BI.MultiSelectCombo.EVENT_STOP,action:function(){e.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiSelectCombo.EVENT_CLICK_ITEM,action:function(){e.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectCombo.EVENT_SEARCHING,action:function(){e.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiSelectCombo.EVENT_CONFIRM,action:function(){e.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(e){this.combo.setValue(e)},getValue:function(){var e=this.combo.getValue()||{};return{type:e.type,value:e.value}},populate:function(e){this.items=e,this.combo.populate.apply(this.combo,arguments)}}),BI.ValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.ValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.ValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.value_chooser_insert_combo",BI.ValueChooserInsertCombo)},function(e,t){BI.ValueChooserCombo=BI.inherit(BI.AbstractValueChooser,{_defaultConfig:function(){return BI.extend(BI.ValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.ValueChooserCombo.superclass._init.apply(this,arguments);var e=this,t=this.options;BI.isNotNull(t.items)&&(this.items=t.items),this.combo=BI.createWidget({type:"bi.multi_select_combo",element:this,allowEdit:t.allowEdit,text:t.text,value:t.value,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:t.width,height:t.height,listeners:[{eventName:BI.MultiSelectCombo.EVENT_FOCUS,action:function(){e.fireEvent(BI.ValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiSelectCombo.EVENT_BLUR,action:function(){e.fireEvent(BI.ValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiSelectCombo.EVENT_STOP,action:function(){e.fireEvent(BI.ValueChooserCombo.EVENT_STOP)}},{eventName:BI.MultiSelectCombo.EVENT_CLICK_ITEM,action:function(){e.fireEvent(BI.ValueChooserCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectCombo.EVENT_SEARCHING,action:function(){e.fireEvent(BI.ValueChooserCombo.EVENT_SEARCHING)}},{eventName:BI.MultiSelectCombo.EVENT_CONFIRM,action:function(){e.fireEvent(BI.ValueChooserCombo.EVENT_CONFIRM)}}]})},setValue:function(e){this.combo.setValue(e)},getValue:function(){var e=this.combo.getValue()||{};return{type:e.type,value:e.value}},populate:function(e){this.items=e,this.combo.populate.apply(this.combo,arguments)}}),BI.ValueChooserCombo.EVENT_BLUR="EVENT_BLUR",BI.ValueChooserCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ValueChooserCombo.EVENT_STOP="EVENT_STOP",BI.ValueChooserCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ValueChooserCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.value_chooser_combo",BI.ValueChooserCombo)},function(e,t){BI.ValueChooserPane=BI.inherit(BI.AbstractValueChooser,{_defaultConfig:function(){return BI.extend(BI.ValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-value-chooser-pane",items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.ValueChooserPane.superclass._init.apply(this,arguments);var e=this,t=this.options;this.list=BI.createWidget({type:"bi.multi_select_list",element:this,value:t.value,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this)}),this.list.on(BI.MultiSelectList.EVENT_CHANGE,function(){e.fireEvent(BI.ValueChooserPane.EVENT_CHANGE)}),BI.isNotNull(t.items)&&(this.items=t.items,this.list.populate())},setValue:function(e){this.list.setValue(e)},getValue:function(){var e=this.list.getValue()||{};return{type:e.type,value:e.value}},populate:function(e){e&&(this.items=e),this.list.populate.apply(this.list,arguments)}}),BI.ValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.value_chooser_pane",BI.ValueChooserPane)},function(e,t,n){"use strict";var i,r=(i=n(684))&&i.__esModule?i:{"default":i};BI.extend(BI,r["default"])},function(e,t,n){"use strict";function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function o(t){return typeof t}:function o(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(e)}function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function s(){return t},t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=void 0;var i={Decorators:function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{"default":e};var t=s();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=i?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=e[r])}n["default"]=e,t&&t.set(e,n);return n}(n(685))};t["default"]=i},function(e,t,n){"use strict";function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],a=Object.getOwnPropertyDescriptor(t,r);a&&a.configurable&&e[r]===undefined&&Object.defineProperty(e,r,a)}}(e.prototype.constructor=e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.shortcut=function(){return function(e){BI.shortcut(e.xtype,e)}},t.provider=function(){return function(e){BI.provider(e.xtype,e)}},t.model=function(){return function(e){BI.model(e.xtype,e)}},t.store=function(n){var i=1<arguments.length&&arguments[1]!==undefined?arguments[1]:{};return function(e){return function(e){function t(){return e.apply(this,arguments)||this}return s(t,e),t.prototype._store=function(){var e=i.props?i.props.apply(this):undefined;return BI.Models.getModel(n.xtype,e)},t}(e)}},t.Model=void 0;var i=function(r){function e(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return o(a(e=r.call.apply(r,[this].concat(n))||this),"model",void 0),o(a(e),"store",void 0),o(a(e),"context",void 0),o(a(e),"actions",void 0),o(a(e),"childContext",void 0),o(a(e),"TYPE",void 0),o(a(e),"computed",void 0),e}return s(e,r),e.prototype.state=function(){return{}},e}(Fix.Model);t.Model=i},function(e,t){Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var i=Object(this),r=i.length>>>0;if(0==r)return-1;var a=0|t;if(r<=a)return-1;for(n=Math.max(0<=a?a:r-Math.abs(a),0);n<r;){if(n in i&&i[n]===e)return n;n++}return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(e){"use strict";if(null==this)throw new TypeError;var t,n,i=Object(this),r=i.length>>>0;if(0==r)return-1;for(t=r-1,1<arguments.length&&((t=Number(arguments[1]))!=t?t=0:0!=t&&t!=1/0&&t!=-1/0&&(t=(0<t||-1)*Math.floor(Math.abs(t)))),n=0<=t?Math.min(t,r-1):r-Math.abs(t);0<=n;n--)if(n in i&&i[n]===e)return n;return-1})},function(e,t){var n;_global.console=_global.console||((n={}).log=n.warn=n.debug=n.info=n.error=n.time=n.dir=n.profile=n.clear=n.exception=n.trace=n.assert=function(){},n)},function(e,t){_global.localStorage||(_global.localStorage={items:{},setItem:function(e,t){BI.Cache.addCookie(e,t)},getItem:function(e){return BI.Cache.getCookie(e)},removeItem:function(e){BI.Cache.deleteCookie(e)},key:function(){},clear:function(){this.items={}}})},function(e,t){Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on a non-object");var t,n,i={__ob__:t,$accessors:t,$vbthis:t,$vbsetter:t},r=[];for(n in e)n in i||Object.prototype.hasOwnProperty.call(e,n)&&r.push(n);return r}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),Date.now||(Date.now=function(){return(new Date).valueOf()})},function(e,t){"undefined"!=typeof Set&&Set.toString().match(/native code/)||(Set=function(){this.set={}},Set.prototype.has=function(e){return this.set[e]!==undefined},Set.prototype.add=function(e){this.set[e]=1},Set.prototype.clear=function(){this.set={}})},function(e,t){var o,n;n=window.navigator.userAgent.toLowerCase(),/msie/.test(n)&&(o=Array.prototype.sort,Array.prototype.sort=function(e){if(e&&"function"==typeof e){if(this.length<2)return this;for(var t,n,i=0,r=i+1,a=this.length;i<a;i++)for(r=i+1;r<a;r++)!0==0<("number"==typeof(n=e.call(this,this[i],this[r]))?n:n?1:0)&&(t=this[i],this[i]=this[r],this[r]=t);return this}return o.call(this)})},function(e,t,n){},function(e,t,n){},function(e,t){BI.prepares.push(function(){var e,r=function(){return null==e&&(e=!(!BI.isSupportCss3||!BI.isSupportCss3("flex"))),e};BI.Plugin.registerWidget("bi.horizontal",function(e){var t=BI.isIE(),n=r(),i=t&&BI.getIEVersion()<8;return e.verticalAlign===BI.VerticalAlign.Middle&&e.horizontalAlign===BI.HorizontalAlign.Center||e.verticalAlign===BI.VerticalAlign.Middle&&e.horizontalAlign===BI.HorizontalAlign.Left||e.verticalAlign===BI.VerticalAlign.Top&&e.horizontalAlign===BI.HorizontalAlign.Center?i?e:BI.extend(e,{type:"bi.table_adapt"}):t?e:n?BI.extend(e,{type:"bi.flex_horizontal"}):BI.extend(e,{type:"bi.table_adapt"})}),BI.Plugin.registerWidget("bi.center_adapt",function(e){var t=BI.isIE(),n=r(),i=e.items&&e.items.length<=1;return!t&&n&&i?!0===e.scrollable||!0===e.scrollx||!0===e.scrolly?BI.extend(e,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(e,{type:"bi.flex_center_adapt"}):i?BI.extend(e,{type:"bi.inline_center_adapt"}):e}),BI.Plugin.registerWidget("bi.vertical_adapt",function(e){var t=BI.isIE(),n=r();return!t&&n?!0===e.scrollable||!0===e.scrollx||!0===e.scrolly?BI.extend({},e,{type:"bi.flex_scrollable_vertical_center_adapt"}):BI.extend(e,{type:"bi.flex_vertical_center_adapt"}):BI.extend(e,{type:"bi.inline_vertical_adapt"})}),BI.Plugin.registerWidget("bi.horizontal_adapt",function(e){return e.items&&e.items.length<=1?BI.extend(e,{type:"bi.horizontal_auto"}):e}),BI.Plugin.registerWidget("bi.float_center_adapt",function(e){return!BI.isIE()&&r()?!0===e.scrollable||!0===e.scrollx||!0===e.scrolly?BI.extend({},e,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(e,{type:"bi.flex_center_adapt"}):BI.extend(e,{type:"bi.inline_center_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal",function(e){if(!0===e.scrollable||!0===e.scrolly)return BI.extend({},e,{type:"bi.flex_scrollable_horizontal"})}),BI.Plugin.registerWidget("bi.flex_vertical",function(e){if(!0===e.scrollable||!0===e.scrollx)return BI.extend({},e,{type:"bi.flex_scrollable_vertical"})}),BI.Plugin.registerWidget("bi.flex_horizontal_adapt",function(e){if(!0===e.scrollable||!0===e.scrollx)return BI.extend({},e,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_adapt",function(e){if(!0===e.scrollable||!0===e.scrolly)return BI.extend({},e,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal_center_adapt",function(e){if(!0===e.scrollable||!0===e.scrollx)return BI.extend({},e,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_center_adapt",function(e){if(!0===e.scrollable||!0===e.scrolly)return BI.extend({},e,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_center_adapt",function(e){if(!0===e.scrollable||!0===e.scrolly||!0===e.scrollx)return BI.extend({},e,{type:"bi.flex_scrollable_center_adapt"})}),BI.Plugin.registerWidget("bi.radio",function(e){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(e,{type:"bi.image_radio"}):e}),BI.Plugin.registerWidget("bi.checkbox",function(e){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(e,{type:"bi.image_checkbox"}):e}),BI.Plugin.registerWidget("bi.half_icon_button",function(e){return BI.isIE()&&BI.getIEVersion()<9?e:BI.extend(e,{type:"bi.half_button"})})})},function(e,t){!function(){var t,n,a=_global.document&&_global.document.attachEvent,o=!1;if(_global.document&&!a){var e=(n=_global.requestAnimationFrame||_global.mozRequestAnimationFrame||_global.webkitRequestAnimationFrame||function(e){return _global.setTimeout(e,20)},function(e){return n(e)}),i=(t=_global.cancelAnimationFrame||_global.mozCancelAnimationFrame||_global.webkitCancelAnimationFrame||_global.clearTimeout,function(e){return t(e)}),s=function(e){var t=e.__resizeTriggers__,n=t.firstElementChild,i=t.lastElementChild,r=n.firstElementChild;i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight,r.style.width=n.offsetWidth+1+"px",r.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},l=function(t){var n=this;s(this),this.__resizeRAF__&&i(this.__resizeRAF__),this.__resizeRAF__=e(function(){var e;(e=n).offsetWidth===e.__resizeLast__.width&&e.offsetHeight===e.__resizeLast__.height||(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(e){e.call(n,t)}))})},r=!1,u="",c="animationstart",h="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d="",f=document.createElement("fakeelement");if(f.style.animationName!==undefined&&(r=!0),!1===r)for(var g=0;g<h.length;g++)if(f.style[h[g]+"AnimationName"]!==undefined){d=h[g],u="-"+d.toLowerCase()+"-",c=p[g],r=!0;break}var m="resizeanim",I="@"+u+"keyframes "+m+" { from { opacity: 0; } to { opacity: 0; } } ",B=u+"animation: 1ms "+m+"; "}var _=function(t,e){var n,i,r;a?(t.attachEvent("onresize",e),BI.nextTick(e)):(t.__resizeTriggers__||("static"===getComputedStyle(t).position&&(t.style.position="relative"),o||(n=(I||"")+".resize-triggers { "+(B||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=document.head||document.getElementsByTagName("head")[0],(r=document.createElement("style")).type="text/css",r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i.appendChild(r),o=!0),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),s(t),t.addEventListener("scroll",l,!0),c&&t.__resizeTriggers__.addEventListener(c,function(e){e.animationName===m&&s(t)})),t.__resizeListeners__.push(e))},E=function(e,t){a?e.detachEvent("onresize",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener("scroll",l),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))};BI.ResizeDetector={addResizeListener:function(e,t){return _(e.element[0],t),function(){E(e.element[0],t)}},removeResizeListener:function(e,t){E(e.element[0],t)}}}()},function(e,t){BI.DOM={},BI.extend(BI.DOM,{ready:function(e){BI.Widget._renderEngine.createElement(document).ready(e)}}),BI.extend(BI.DOM,{patchProps:function(e,i){var t=BI.jQuery._data(e[0]).events;BI.each(t,function(n,e){BI.each(e,function(e,t){i.on(n+(t.namespace?"."+t.namespace:""),t)})});var n=e.children(),r=i.children();if(n.length!==r.length)throw new Error("不匹配");BI.each(n,function(e,t){BI.DOM.patchProps(BI.jQuery(t),BI.jQuery(r[e]))}),BI.each(e.data("__widgets"),function(e,t){t.element=i})},hang:function(e){if(!BI.isEmpty(e)){var n=BI.Widget._renderEngine.createFragment();return BI.each(e,function(e,t){t instanceof BI.Widget&&(t=t.element),t instanceof BI.$&&t[0]&&n.appendChild(t[0])}),n}},isExist:function(e){return 0<BI.Widget._renderEngine.createElement("body").find(e.element).length},preloadImages:function(e,t){var n=0,i=[];function r(){++n>=e.length&&t()}BI.each(e,function(e,t){i[e]=new Image,i[e].src=t,i[e].onload=function(){r()},i[e].onerror=function(){r()}})},getTextSizeWidth:function(e,t){var n=BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo("body");null==t&&(t=12),t+="px",n.css("font-size",t).text(e);var i=n.width();return n.remove(),i},getTextSizeHeight:function(e,t){var n=BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo("body");null==t&&(t=12),t+="px",n.css("font-size",t).text(e);var i=n.height();return n.remove(),i},getScrollWidth:function(){var e;return!BI.isNull(this._scrollWidth)&&0!==this._scrollWidth||(e=BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo("body"),this._scrollWidth=e[0].offsetWidth-e[0].clientWidth,e.destroy()),this._scrollWidth},getImage:function(e,t,n){var i=document.createElement("canvas");BI.Widget._renderEngine.createElement("body").append(i);var r=i.getContext("2d");r.font="12px Georgia";var a=r.measureText(e).width+4;i.width=2*a,i.height=32,r.font="24px Georgia",r.fillStyle=t||"#3685f2",r.textBaseline="middle",r.fillText(e,4,18),BI.Widget._renderEngine.createElement(i).destroy();var o=n||"rgba(54, 133, 242, 0.1)";return{width:a,height:16,src:i.toDataURL("image/png"),style:"background-color: "+o+";vertical-align: middle; margin: 0 1px; width:"+a+"px;height: 16px; max-width:"+a+"px;max-height: 16px; min-width:"+a+"px;min-height: 16px",param:e}}}),BI.extend(BI.DOM,{isColor:function(e){return e&&(this.isRGBColor(e)||this.isHexColor(e))},isRGBColor:function(e){return!!e&&"rgb"===e.substr(0,3)},isHexColor:function(e){return!!e&&("#"===e[0]&&7===e.length)},isDarkColor:function(e){if(!e||!this.isHexColor(e))return!1;var t=this.rgb2json(this.hex2rgb(e));return Math.round(.299*t.r+.587*t.g+.114*t.b)<192},getContrastColor:function(e){return e&&this.isColor(e)?this.isDarkColor(e)?"#ffffff":"#1a1a1a":""},rgb2hex:function(e){if(!e||"rgb"!=e.substr(0,3))return"";var t=e.match(/\d+(\.\d+)?/g),n=BI.parseInt(t[0]),i=BI.parseInt(t[1]),r=BI.parseInt(t[2]);return"#"+this.int2hex(n)+this.int2hex(i)+this.int2hex(r)},rgb2json:function(e){if(!e)return{};if(!this.isRGBColor(e))return{};var t=e.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(t[0]),g:BI.parseInt(t[1]),b:BI.parseInt(t[2])}},rgba2json:function(e){if(!e)return{};var t=e.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(t[0]),g:BI.parseInt(t[1]),b:BI.parseInt(t[2]),a:BI.parseFloat(t[3])}},json2rgb:function(e){return BI.isKey(e.r)&&BI.isKey(e.g)&&BI.isKey(e.b)?"rgb("+e.r+","+e.g+","+e.b+")":""},json2rgba:function(e){return BI.isKey(e.r)&&BI.isKey(e.g)&&BI.isKey(e.b)?"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":""},int2hex:function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return t[e>>>4]+""+t[15&e]},hex2rgb:function(e){if(!e)return"";if(!this.isHexColor(e))return e;var t,n="rgb(";return 7===e.length?t=[BI.parseInt("0x"+e.substring(1,3)),BI.parseInt("0x"+e.substring(3,5)),BI.parseInt("0x"+e.substring(5,7))]:4===e.length&&(t=[BI.parseInt("0x"+e.substring(1,2)),BI.parseInt("0x"+e.substring(2,3)),BI.parseInt("0x"+e.substring(3,4))]),n+=t[0]+",",n+=t[1]+",",n+=t[2]+")"},rgba2rgb:function(e,t){if(BI.isNull(t)&&(t=1),"rgba"!=e.substr(0,4))return"";var n=e.match(/\d+(\.\d+)?/g);if(n.length<4)return"";var i=BI.parseFloat(n[0]),r=BI.parseFloat(n[1]),a=BI.parseFloat(n[2]),o=BI.parseFloat(n[3]);return"rgb("+Math.floor(t*(1-o)*255+i*o)+","+Math.floor(t*(1-o)*255+r*o)+","+Math.floor(t*(1-o)*255+a*o)+")"}}),BI.extend(BI.DOM,{getLeftPosition:function(e,t,n){return{left:e.element.offset().left-t.element.outerWidth()-(n||0)}},getInnerLeftPosition:function(e,t,n){return{left:e.element.offset().left+(n||0)}},getRightPosition:function(e,t,n){var i=e.element;return{left:i.offset().left+i.outerWidth()+(n||0)}},getInnerRightPosition:function(e,t,n){var i=e.element,r=t.element.bounds();return{left:i.offset().left+i.outerWidth()-r.width-(n||0)}},getTopPosition:function(e,t,n){return{top:e.element.offset().top-t.element.outerHeight()-(n||0)}},getBottomPosition:function(e,t,n){var i=e.element;return{top:i.offset().top+i.outerHeight()+(n||0)}},isLeftSpaceEnough:function(e,t,n){return 0<=BI.DOM.getLeftPosition(e,t,n).left},isInnerLeftSpaceEnough:function(e,t,n){var i=t.element.bounds(),r=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getInnerLeftPosition(e,t,n).left+i.width<=r.width},isRightSpaceEnough:function(e,t,n){var i=t.element.bounds(),r=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getRightPosition(e,t,n).left+i.width<=r.width},isInnerRightSpaceEnough:function(e,t,n){return 0<=BI.DOM.getInnerRightPosition(e,t,n).left},isTopSpaceEnough:function(e,t,n){return 0<=BI.DOM.getTopPosition(e,t,n).top},isBottomSpaceEnough:function(e,t,n){var i=t.element.bounds(),r=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getBottomPosition(e,t,n).top+i.height<=r.height},isRightSpaceLarger:function(e){return BI.Widget._renderEngine.createElement("body").bounds().width-e.element.offset().left-e.element.bounds().width>=e.element.offset().left},isBottomSpaceLarger:function(e){return BI.Widget._renderEngine.createElement("body").bounds().height-e.element.offset().top-e.element.bounds().height>=e.element.offset().top},getLeftAlignPosition:function(e,t,n){var i=t.element.bounds(),r=BI.Widget._renderEngine.createElement("body").bounds(),a=e.element.offset().left+n;return a+i.width>r.width&&(a=r.width-i.width),a<0&&(a=0),{left:a}},getLeftAdaptPosition:function(e,t,n){return BI.DOM.isLeftSpaceEnough(e,t,n)?BI.DOM.getLeftPosition(e,t,n):{left:0}},getRightAlignPosition:function(e,t,n){var i=e.element.bounds(),r=t.element.bounds(),a=e.element.offset().left+i.width-r.width-n;return a<0&&(a=0),{left:a}},getRightAdaptPosition:function(e,t,n){return BI.DOM.isRightSpaceEnough(e,t,n)?BI.DOM.getRightPosition(e,t,n):{left:BI.Widget._renderEngine.createElement("body").bounds().width-t.element.bounds().width}},getTopAlignPosition:function(e,t,n,i){var r,a,o=e.element.offset(),s=e.element.bounds(),l=t.element.bounds(),u=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isBottomSpaceEnough(e,t,-1*s.height+n)?r=o.top+n:i?(r=o.top+n,a=u.height-r):(r=u.height-l.height)<n&&(a=u.height-n),r<n&&(r=n),a?{top:r,adaptHeight:a}:{top:r}},getTopAdaptPosition:function(e,t,n,i){var r=t.element.bounds(),a=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isTopSpaceEnough(e,t,n)?BI.DOM.getTopPosition(e,t,n):i?{top:0,adaptHeight:e.element.offset().top-n}:r.height+n>a.height?{top:0,adaptHeight:a.height-n}:{top:0}},getBottomAlignPosition:function(e,t,n,i){var r,a,o=e.element.offset(),s=e.element.bounds(),l=t.element.bounds(),u=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isTopSpaceEnough(e,t,-1*s.height+n)?r=o.top+s.height-l.height-n:i?(r=0,a=o.top+s.height-n):(r=0,l.height+n>u.height&&(a=u.height-n)),r<0&&(r=0),a?{top:r,adaptHeight:a}:{top:r}},getBottomAdaptPosition:function(e,t,n,i){var r=e.element.offset(),a=e.element.bounds(),o=t.element.bounds(),s=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isBottomSpaceEnough(e,t,n)?BI.DOM.getBottomPosition(e,t,n):i?{top:r.top+a.height+n,adaptHeight:s.height-r.top-a.height-n}:o.height+n>s.height?{top:n,adaptHeight:s.height-n}:{top:s.height-o.height-n}},getCenterAdaptPosition:function(e,t){var n=e.element.offset(),i=e.element.bounds(),r=t.element.bounds(),a=BI.Widget._renderEngine.createElement("body").bounds(),o=n.left+i.width/2+r.width/2>a.width?a.width-r.width:n.left+i.width/2-r.width/2;return o<0&&(o=0),{left:o}},getMiddleAdaptPosition:function(e,t){var n=e.element.offset(),i=e.element.bounds(),r=t.element.bounds(),a=BI.Widget._renderEngine.createElement("body").bounds(),o=n.top+i.height/2+r.height/2>a.height?a.height-r.height:n.top+i.height/2-r.height/2;return o<0&&(o=0),{top:o}},getComboPositionByDirections:function(e,t,n,i,r,a){var o;n=n||0,i=i||0;for(var s,l,u,c=[],h=[],p=[],d=!1,f=!1,g=!1,m=a[0],I=0;I<a.length;I++)switch(o=a[I]){case"left":case"right":c.push(o);break;case"top":case"bottom":h.push(o);break;case"innerLeft":case"innerRight":p.push(o)}for(I=0;I<a.length;I++)switch(o=a[I]){case"left":if(!d){var B=f?i:n,_=f?0:i;if(BI.DOM.isLeftSpaceEnough(e,t,B))return s=BI.DOM.getLeftPosition(e,t,B).left,"bottom"===h[0]?(u=BI.DOM.getTopAlignPosition(e,t,_,r)).dir="left,bottom":(u=BI.DOM.getBottomAlignPosition(e,t,_,r)).dir="left,top",f&&(u.change="left"),u.left=s,u}g=!0;break;case"right":if(!d){B=f?i:n,_=f?n:i;if(BI.DOM.isRightSpaceEnough(e,t,B))return s=BI.DOM.getRightPosition(e,t,B).left,"bottom"===h[0]?(u=BI.DOM.getTopAlignPosition(e,t,_,r)).dir="right,bottom":(u=BI.DOM.getBottomAlignPosition(e,t,_,r)).dir="right,top",f&&(u.change="right"),u.left=s,u}g=!0;break;case"top":B=g?i:n,_=g?n:i;if(BI.DOM.isTopSpaceEnough(e,t,_))return l=BI.DOM.getTopPosition(e,t,_).top,"right"===c[0]?(u=BI.DOM.getLeftAlignPosition(e,t,B,r)).dir="top,right":(u=BI.DOM.getRightAlignPosition(e,t,B)).dir="top,left",g&&(u.change="top"),u.top=l,u;r&&(d=!0),f=!0;break;case"bottom":B=g?i:n,_=g?n:i;if(BI.DOM.isBottomSpaceEnough(e,t,_))return l=BI.DOM.getBottomPosition(e,t,_).top,"right"===c[0]?(u=BI.DOM.getLeftAlignPosition(e,t,B,r)).dir="bottom,right":(u=BI.DOM.getRightAlignPosition(e,t,B)).dir="bottom,left",g&&(u.change="bottom"),u.top=l,u;r&&(d=!0),f=!0;break;case"innerLeft":if(!d){B=f?i:n,_=f?0:i;if(BI.DOM.isInnerLeftSpaceEnough(e,t,B))return s=BI.DOM.getInnerLeftPosition(e,t,B).left,"bottom"===h[0]?(u=BI.DOM.getTopAlignPosition(e,t,_,r)).dir="innerLeft,bottom":(u=BI.DOM.getBottomAlignPosition(e,t,_,r)).dir="innerLeft,top",f&&(u.change="innerLeft"),u.left=s,u}g=!0;break;case"innerRight":if(!d){B=f?i:n,_=f?n:i;if(BI.DOM.isInnerRightSpaceEnough(e,t,B))return s=BI.DOM.getInnerRightPosition(e,t,B).left,"bottom"===h[0]?(u=BI.DOM.getTopAlignPosition(e,t,_,r)).dir="innerRight,bottom":(u=BI.DOM.getBottomAlignPosition(e,t,_,r)).dir="innerRight,top",f&&(u.change="innerRight"),u.left=s,u}}switch(a[0]){case"left":case"right":return(m=BI.DOM.isRightSpaceLarger(e)?(s=BI.DOM.getRightAdaptPosition(e,t,n).left,"right"):(s=BI.DOM.getLeftAdaptPosition(e,t,n).left,"left"),"bottom"===h[0])?((u=BI.DOM.getTopAlignPosition(e,t,i,r)).left=s,u.dir=m+",bottom",u):((u=BI.DOM.getBottomAlignPosition(e,t,i,r)).left=s,u.dir=m+",top",u);default:return(m=BI.DOM.isBottomSpaceLarger(e)?(u=BI.DOM.getBottomAdaptPosition(e,t,i,r),"bottom"):(u=BI.DOM.getTopAdaptPosition(e,t,i,r),"top"),"right"===c[0])?(s=BI.DOM.getLeftAlignPosition(e,t,n,r).left,u.left=s,u.dir=m+",right",u):(s=BI.DOM.getRightAlignPosition(e,t,n).left,u.left=s,u.dir=m+",left",u)}},getComboPosition:function(e,t,n,i,r,a,o){n=n||0,i=i||0;var s=BI.Widget._renderEngine.createElement("body").bounds().height-i,l=Math.min(t.attr("maxHeight")||s,s);t.resetHeight&&t.resetHeight(l);var u,c=BI.DOM.getComboPositionByDirections(e,t,n,i,r,a||["bottom","top","right","left"]);switch(o){case"center":c.change?(u=BI.DOM.getMiddleAdaptPosition(e,t),c.top=u.top):(u=BI.DOM.getCenterAdaptPosition(e,t),c.left=u.left);break;case"middle":c.change?(u=BI.DOM.getCenterAdaptPosition(e,t),c.left=u.left):(u=BI.DOM.getMiddleAdaptPosition(e,t),c.top=u.top)}return!0===r&&t.resetHeight&&t.resetHeight(Math.min(s-c.top,l)),c}})},function(e,t){BI.EventListener={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:BI.emptyFn}},registerDefault:function(){}}},function(e,t){_.extend(BI,{isIE:function(){return!!_global.navigator&&(null==this.__isIE&&(this.__isIE=/(msie|trident)/i.test(navigator.userAgent.toLowerCase())),this.__isIE)},getIEVersion:function(){if(!_global.navigator)return 0;if(null!=this.__IEVersion)return this.__IEVersion;var e=0,t=navigator.userAgent.toLowerCase(),n=t.match(/(?:msie\s([\w.]+))/),i=t.match(/(?:trident.*rv:([\w.]+))/),e=n&&i&&n[1]&&i[1]?Math.max(+n[1],+i[1]):n&&n[1]?+n[1]:i&&i[1]?+i[1]:0;return this.__IEVersion=e},isIE9Below:function(){return!!BI.isIE()&&this.getIEVersion()<9},isEdge:function(){return!!_global.navigator&&/edge/i.test(navigator.userAgent.toLowerCase())},isChrome:function(){return!!_global.navigator&&/chrome/i.test(navigator.userAgent.toLowerCase())},isFireFox:function(){return!!_global.navigator&&/firefox/i.test(navigator.userAgent.toLowerCase())},isOpera:function(){return!!_global.navigator&&/opera/i.test(navigator.userAgent.toLowerCase())},isSafari:function(){return!!_global.navigator&&(/safari/i.test(navigator.userAgent.toLowerCase())&&!/chrome/i.test(navigator.userAgent.toLowerCase()))},isKhtml:function(){return!!_global.navigator&&/Konqueror|Safari|KHTML/i.test(navigator.userAgent)},isMac:function(){return!!_global.navigator&&/macintosh|mac os x/i.test(navigator.userAgent)},isWindows:function(){return!!_global.navigator&&/windows|win32/i.test(navigator.userAgent)},isSupportCss3:function(e){if(!_global.document)return!1;for(var t,n=["webkit","Moz","ms","o"],i=[],r=document.documentElement.style,a=function(e){return BI.isString(e)?e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()}):""},o=0;o<n.length;o++)i.push(a(n[o]+"-"+e));for(i.push(a(e)),o=0,t=i.length;o<t;o++)if(i[o]in r)return!0;return!1}})},function(Jt,Kt,Qt){var Ut;!function(g,v){var r,n,I=typeof v,m=g.document,e=g.location,t=g.jQuery,i=g.$,a={},h=[],o="1.12.4",B=h.concat,s=h.push,p=h.slice,l=h.indexOf,u=a.toString,_=a.hasOwnProperty,c=o.trim,de=function(e,t){return new de.fn.init(e,t,n)},d=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,f=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,E=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,b=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,y=/^[\],:{}\s]*$/,C=/(?:^|:|,)(?:\s*\[)+/g,N=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,V=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,S=/^-ms-/,x=/-([\da-z])/gi,w=function(e,t){return t.toUpperCase()},A=function(e){!m.addEventListener&&"load"!==e.type&&"complete"!==m.readyState||(L(),de.ready())},L=function(){m.addEventListener?(m.removeEventListener("DOMContentLoaded",A,!1),g.removeEventListener("load",A,!1)):(m.detachEvent("onreadystatechange",A),g.detachEvent("onload",A))};function k(e){var t=e.length,n=de.type(e);return!de.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||"function"!==n&&(0===t||"number"==typeof t&&0<t&&t-1 in e)))}de.fn=de.prototype={jquery:o,constructor:de,init:function(e,t,n){var i,r;if(!e)return this;if("string"!=typeof e)return e.nodeType?(this.context=this[0]=e,this.length=1,this):de.isFunction(e)?n.ready(e):(e.selector!==v&&(this.selector=e.selector,this.context=e.context),de.makeArray(e,this));if(!(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:E.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof de?t[0]:t,de.merge(this,de.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:m,!0)),b.test(i[1])&&de.isPlainObject(t))for(i in t)de.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}if((r=m.getElementById(i[2]))&&r.parentNode){if(r.id!==i[2])return n.find(e);this.length=1,this[0]=r}return this.context=m,this.selector=e,this},selector:"",length:0,size:function(){return this.length},toArray:function(){return p.call(this)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=de.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return de.each(this,e,t)},ready:function(e){return de.ready.promise().done(e),this},slice:function(){return this.pushStack(p.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},map:function(n){return this.pushStack(de.map(this,function(e,t){return n.call(e,t,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:s,sort:[].sort,splice:[].splice},de.fn.init.prototype=de.fn,de.extend=de.fn.extend=function(){var e,t,n,i,r,a,o=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[1]||{},s=2),"object"==typeof o||de.isFunction(o)||(o={}),l===s&&(o=this,--s);s<l;s++)if(null!=(r=arguments[s]))for(i in r)e=o[i],o!==(n=r[i])&&(u&&n&&(de.isPlainObject(n)||(t=de.isArray(n)))?(a=t?(t=!1,e&&de.isArray(e)?e:[]):e&&de.isPlainObject(e)?e:{},o[i]=de.extend(u,a,n)):n!==v&&(o[i]=n));return o},de.extend({noConflict:function(e){return g.$===de&&(g.$=i),e&&g.jQuery===de&&(g.jQuery=t),de},isReady:!1,readyWait:1,holdReady:function(e){e?de.readyWait++:de.ready(!0)},ready:function(e){if(!0===e?!--de.readyWait:!de.isReady){if(!m.body)return setTimeout(de.ready);(de.isReady=!0)!==e&&0<--de.readyWait||(r.resolveWith(m,[de]),de.fn.trigger&&de(m).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===de.type(e)},isArray:Array.isArray||function(e){return"array"===de.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?a[u.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==de.type(e)||e.nodeType||de.isWindow(e))return!1;try{if(e.constructor&&!_.call(e,"constructor")&&!_.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var t;for(t in e);return t===v||_.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||m;var i=b.exec(e),r=!n&&[];return i?[t.createElement(i[1])]:(i=de.buildFragment([e],t,r),r&&de(r).remove(),de.merge([],i.childNodes))},parseJSON:function(e){return g.JSON&&g.JSON.parse?g.JSON.parse(e):null===e?e:"string"==typeof e&&(e=de.trim(e))&&y.test(e.replace(N,"@").replace(V,"]").replace(C,""))?new Function("return "+e)():void de.error("Invalid JSON: "+e)},parseXML:function(e){var t;if(!e||"string"!=typeof e)return null;try{g.DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e))}catch(n){t=v}return t&&t.documentElement&&!t.getElementsByTagName("parsererror").length||de.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){e&&de.trim(e)&&(g.execScript||function(e){g.eval.call(g,e)})(e)},camelCase:function(e){return e.replace(S,"ms-").replace(x,w)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var i=0,r=e.length,a=k(e);if(n){if(a)for(;i<r&&!1!==t.apply(e[i],n);i++);else for(i in e)if(!1===t.apply(e[i],n))break}else if(a)for(;i<r&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},trim:c&&!c.call("\ufeff ")?function(e){return null==e?"":c.call(e)}:function(e){return null==e?"":(e+"").replace(f,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(k(Object(e))?de.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){var i;if(t){if(l)return l.call(t,e,n);for(i=t.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){var n=t.length,i=e.length,r=0;if("number"==typeof n)for(;r<n;r++)e[i++]=t[r];else for(;t[r]!==v;)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){var i=[],r=0,a=e.length;for(n=!!n;r<a;r++)n!==!!t(e[r],r)&&i.push(e[r]);return i},map:function(e,t,n){var i,r=0,a=e.length,o=[];if(k(e))for(;r<a;r++)null!=(i=t(e[r],r,n))&&(o[o.length]=i);else for(r in e)null!=(i=t(e[r],r,n))&&(o[o.length]=i);return B.apply([],o)},guid:1,proxy:function(e,t){var n,i,r;return"string"==typeof t&&(r=e[t],t=e,e=r),de.isFunction(e)?(n=p.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(p.call(arguments)))}).guid=e.guid=e.guid||de.guid++,i):v},access:function(e,t,n,i,r,a,o){var s=0,l=e.length,u=null==n;if("object"===de.type(n))for(s in r=!0,n)de.access(e,t,s,n[s],!0,a,o);else if(i!==v&&(r=!0,de.isFunction(i)||(o=!0),u&&(t=o?(t.call(e,i),null):(u=t,function(e,t,n){return u.call(de(e),n)})),t))for(;s<l;s++)t(e[s],n,o?i:i.call(e[s],s,t(e[s],n)));return r?e:u?t.call(e):l?t(e[0],n):a},now:function(){return(new Date).getTime()}}),de.ready.promise=function(e){if(!r)if(r=de.Deferred(),"complete"===m.readyState)setTimeout(de.ready);else if(m.addEventListener)m.addEventListener("DOMContentLoaded",A,!1),g.addEventListener("load",A,!1);else{m.attachEvent("onreadystatechange",A),g.attachEvent("onload",A);var t=!1;try{t=null==g.frameElement&&m.documentElement}catch(n){}t&&t.doScroll&&!function i(){if(!de.isReady){try{t.doScroll("left")}catch(n){return setTimeout(i,50)}L(),de.ready()}}()}return r.promise(e)},de.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){a["[object "+t+"]"]=t.toLowerCase()}),n=de(m);var D={};de.Callbacks=function(r){var e,n;r="string"==typeof r?D[r]||(n=D[e=r]={},de.each(e.match(T)||[],function(e,t){n[t]=!0}),n):de.extend({},r);var a,t,i,o,s,l,u=[],c=!r.once&&[],h=function(e){for(t=r.memory&&e,i=!0,s=l||0,l=0,o=u.length,a=!0;u&&s<o;s++)if(!1===u[s].apply(e[0],e[1])&&r.stopOnFalse){t=!1;break}a=!1,u&&(c?c.length&&h(c.shift()):t?u=[]:p.disable())},p={add:function(){var e;return u&&(e=u.length,function i(e){de.each(e,function(e,t){var n=de.type(t);"function"===n?r.unique&&p.has(t)||u.push(t):t&&t.length&&"string"!==n&&i(t)})}(arguments),a?o=u.length:t&&(l=e,h(t))),this},remove:function(){return u&&de.each(arguments,function(e,t){for(var n;-1<(n=de.inArray(t,u,n));)u.splice(n,1),a&&(n<=o&&o--,n<=s&&s--)}),this},has:function(e){return e?-1<de.inArray(e,u):!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=c=t=v,this},disabled:function(){return!u},lock:function(){return c=v,t||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=[e,(t=t||[]).slice?t.slice():t],!u||i&&!c||(a?c.push(t):h(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},de.extend({Deferred:function(e){var o=[["resolve","done",de.Callbacks("once memory"),"resolved"],["reject","fail",de.Callbacks("once memory"),"rejected"],["notify","progress",de.Callbacks("memory")]],r="pending",s={state:function(){return r},always:function(){return l.done(arguments).fail(arguments),this},then:function(){var a=arguments;return de.Deferred(function(r){de.each(o,function(e,t){var n=t[0],i=de.isFunction(a[e])&&a[e];l[t[1]](function(){var e=i&&i.apply(this,arguments);e&&de.isFunction(e.promise)?e.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[n+"With"](this===s?r.promise():this,i?[e]:arguments)})}),a=null}).promise()},promise:function(e){return null!=e?de.extend(e,s):s}},l={};return s.pipe=s.then,de.each(o,function(e,t){var n=t[2],i=t[3];s[t[1]]=n.add,i&&n.add(function(){r=i},o[1^e][2].disable,o[2][2].lock),l[t[0]]=function(){return l[t[0]+"With"](this===l?s:this,arguments),this},l[t[0]+"With"]=n.fireWith}),s.promise(l),e&&e.call(l,l),l},when:function(e){var r,t,n,i=0,a=p.call(arguments),o=a.length,s=1!==o||e&&de.isFunction(e.promise)?o:0,l=1===s?e:de.Deferred(),u=function(t,n,i){return function(e){n[t]=this,i[t]=1<arguments.length?p.call(arguments):e,i===r?l.notifyWith(n,i):--s||l.resolveWith(n,i)}};if(1<o)for(r=new Array(o),t=new Array(o),n=new Array(o);i<o;i++)a[i]&&de.isFunction(a[i].promise)?a[i].promise().done(u(i,n,a)).fail(l.reject).progress(u(i,t,r)):--s;return s||l.resolveWith(n,a),l.promise()}}),de.support=function(){var a,e,t,n,i,r,o,s,l,u,c=m.createElement("div");if(c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",e=c.getElementsByTagName("*"),t=c.getElementsByTagName("a")[0],!e||!t||!e.length)return{};o=(i=m.createElement("select")).appendChild(m.createElement("option")),n=c.getElementsByTagName("input")[0],t.style.cssText="top:1px;float:left;opacity:.5",a={getSetAttribute:"t"!==c.className,leadingWhitespace:3===c.firstChild.nodeType,tbody:!c.getElementsByTagName("tbody").length,htmlSerialize:!!c.getElementsByTagName("link").length,style:/top/.test(t.getAttribute("style")),hrefNormalized:"/a"===t.getAttribute("href"),opacity:/^0.5/.test(t.style.opacity),cssFloat:!!t.style.cssFloat,checkOn:!!n.value,optSelected:o.selected,enctype:!!m.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==m.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===m.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},n.checked=!0,a.noCloneChecked=n.cloneNode(!0).checked,i.disabled=!0,a.optDisabled=!o.disabled;try{delete c.test}catch(h){a.deleteExpando=!1}for(u in(n=m.createElement("input")).setAttribute("value",""),a.input=""===n.getAttribute("value"),n.value="t",n.setAttribute("type","radio"),a.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),(r=m.createDocumentFragment()).appendChild(n),a.appendChecked=n.checked,a.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,c.attachEvent&&(c.attachEvent("onclick",function(){a.noCloneEvent=!1}),c.cloneNode(!0).click()),{submit:!0,change:!0,focusin:!0})c.setAttribute(s="on"+u,"t"),a[u+"Bubbles"]=s in g||!1===c.attributes[s].expando;return c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",a.clearCloneStyle="content-box"===c.style.backgroundClip,de(function(){var e,t,n,i="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",r=m.getElementsByTagName("body")[0];r&&((e=m.createElement("div")).style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",r.appendChild(e).appendChild(c),c.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(n=c.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",l=0===n[0].offsetHeight,n[0].style.display="",n[1].style.display="none",a.reliableHiddenOffsets=l&&0===n[0].offsetHeight,c.innerHTML="",c.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",a.boxSizing=4===c.offsetWidth,a.doesNotIncludeMarginInBodyOffset=1!==r.offsetTop,g.getComputedStyle&&(a.pixelPosition="1%"!==(g.getComputedStyle(c,null)||{}).top,a.boxSizingReliable="4px"===(g.getComputedStyle(c,null)||{width:"4px"}).width,(t=c.appendChild(m.createElement("div"))).style.cssText=c.style.cssText=i,t.style.marginRight=t.style.width="0",c.style.width="1px",a.reliableMarginRight=!parseFloat((g.getComputedStyle(t,null)||{}).marginRight)),typeof c.style.zoom!==I&&(c.innerHTML="",c.style.cssText=i+"width:1px;padding:1px;display:inline;zoom:1",a.inlineBlockNeedsLayout=3===c.offsetWidth,c.style.display="block",c.innerHTML="<div></div>",c.firstChild.style.width="5px",a.shrinkWrapBlocks=3!==c.offsetWidth,a.inlineBlockNeedsLayout&&(r.style.zoom=1)),r.removeChild(e),e=c=n=t=null)}),e=i=r=t=n=null,a}();var M=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,t,n,i){if(de.acceptData(e)){var r,a,o=de.expando,s="string"==typeof t,l=e.nodeType,u=l?de.cache:e,c=l?e[o]:e[o]&&o;if(c&&u[c]&&(i||u[c].data)||!s||n!==v)return c||(l?e[o]=c=h.pop()||de.guid++:c=o),u[c]||(u[c]={},l||(u[c].toJSON=de.noop)),"object"!=typeof t&&"function"!=typeof t||(i?u[c]=de.extend(u[c],t):u[c].data=de.extend(u[c].data,t)),r=u[c],i||(r.data||(r.data={}),r=r.data),n!==v&&(r[de.camelCase(t)]=n),s?null==(a=r[t])&&(a=r[de.camelCase(t)]):a=r,a}}function H(e,t,n){if(de.acceptData(e)){var i,r,a,o=e.nodeType,s=o?de.cache:e,l=o?e[de.expando]:de.expando;if(s[l]){if(t&&(a=n?s[l]:s[l].data)){for((i=0,r=(t=de.isArray(t)?t.concat(de.map(t,de.camelCase)):t in a||(t=de.camelCase(t))in a?[t]:t.split(" ")).length);i<r;i++)delete a[t[i]];if(!(n?F:de.isEmptyObject)(a))return}(n||(delete s[l].data,F(s[l])))&&(o?de.cleanData([e],!0):de.support.deleteExpando||s!=s.window?delete s[l]:s[l]=null)}}}function O(e,t,n){if(n===v&&1===e.nodeType){var i="data-"+t.replace(P,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:M.test(n)?de.parseJSON(n):n)}catch(r){}de.data(e,t,n)}else n=v}return n}function F(e){var t;for(t in e)if(("data"!==t||!de.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}de.extend({cache:{},expando:"jQuery"+(o+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return!!(e=e.nodeType?de.cache[e[de.expando]]:e[de.expando])&&!F(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return H(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return H(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&de.noData[e.nodeName.toLowerCase()];return!t||!0!==t&&e.getAttribute("classid")===t}}),de.fn.extend({data:function(t,e){var n,i,r=this[0],a=0,o=null;if(t!==v)return"object"==typeof t?this.each(function(){de.data(this,t)}):de.access(this,function(e){return e===v?r?O(r,t,de.data(r,t)):null:void this.each(function(){de.data(this,t,e)})},null,e,1<arguments.length,null,!0);if(this.length&&(o=de.data(r),1===r.nodeType&&!de._data(r,"parsedAttrs"))){for(n=r.attributes;a<n.length;a++)(i=n[a].name).indexOf("data-")||(i=de.camelCase(i.slice(5)),O(r,i,o[i]));de._data(r,"parsedAttrs",!0)}return o},removeData:function(e){return this.each(function(){de.removeData(this,e)})}}),de.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=de._data(e,t),n&&(!i||de.isArray(n)?i=de._data(e,t,de.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=de.queue(e,t),i=n.length,r=n.shift(),a=de._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),(a.cur=r)&&("fx"===t&&n.unshift("inprogress"),delete a.stop,r.call(e,function(){de.dequeue(e,t)},a)),!i&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return de._data(e,n)||de._data(e,n,{empty:de.Callbacks("once memory").add(function(){de._removeData(e,t+"queue"),de._removeData(e,n)})})}}),de.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?de.queue(this[0],t):n===v?this:this.each(function(){var e=de.queue(this,t,n);de._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&de.dequeue(this,t)})},dequeue:function(e){return this.each(function(){de.dequeue(this,e)})},delay:function(i,e){return i=de.fx&&de.fx.speeds[i]||i,e=e||"fx",this.queue(e,function(e,t){var n=setTimeout(e,i);t.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=de.Deferred(),a=this,o=this.length,s=function(){--i||r.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=v),e=e||"fx";o--;)(n=de._data(a[o],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(s));return s(),r.promise(t)}});var Y,W,G=/[\t\r\n]/g,j=/\r/g,Z=/^(?:input|select|textarea|button|object)$/i,X=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,K=/^(?:checked|selected)$/i,Q=de.support.getSetAttribute,U=de.support.input;de.fn.extend({attr:function(e,t){return de.access(this,de.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){de.removeAttr(this,e)})},prop:function(e,t){return de.access(this,de.prop,e,t,1<arguments.length)},removeProp:function(t){return t=de.propFix[t]||t,this.each(function(){try{this[t]=v,delete this[t]}catch(e){}})},addClass:function(t){var e,n,i,r,a,o=0,s=this.length,l="string"==typeof t&&t;if(de.isFunction(t))return this.each(function(e){de(this).addClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(T)||[];o<s;o++)if(i=1===(n=this[o]).nodeType&&(n.className?(" "+n.className+" ").replace(G," "):" ")){for(a=0;r=e[a++];)i.indexOf(" "+r+" ")<0&&(i+=r+" ");n.className=de.trim(i)}return this},removeClass:function(t){var e,n,i,r,a,o=0,s=this.length,l=0===arguments.length||"string"==typeof t&&t;if(de.isFunction(t))return this.each(function(e){de(this).removeClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(T)||[];o<s;o++)if(i=1===(n=this[o]).nodeType&&(n.className?(" "+n.className+" ").replace(G," "):"")){for(a=0;r=e[a++];)for(;0<=i.indexOf(" "+r+" ");)i=i.replace(" "+r+" "," ");n.className=t?de.trim(i):""}return this},toggleClass:function(a,o){var s=typeof a,l="boolean"==typeof o;return de.isFunction(a)?this.each(function(e){de(this).toggleClass(a.call(this,e,this.className,o),o)}):this.each(function(){if("string"==s)for(var e,t=0,n=de(this),i=o,r=a.match(T)||[];e=r[t++];)i=l?i:!n.hasClass(e),n[i?"addClass":"removeClass"](e);else s!==I&&"boolean"!=s||(this.className&&de._data(this,"__className__",this.className),this.className=!this.className&&!1!==a&&de._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&0<=(" "+this[n].className+" ").replace(G," ").indexOf(t))return!0;return!1},val:function(i){var e,r,a,t=this[0];return arguments.length?(a=de.isFunction(i),this.each(function(e){var t,n=de(this);1===this.nodeType&&(null==(t=a?i.call(this,e,n.val()):i)?t="":"number"==typeof t?t+="":de.isArray(t)&&(t=de.map(t,function(e){return null==e?"":e+""})),(r=de.valHooks[this.type]||de.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&r.set(this,t,"value")!==v||(this.value=t))})):t?(r=de.valHooks[t.type]||de.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&(e=r.get(t,"value"))!==v?e:"string"==typeof(e=t.value)?e.replace(j,""):null==e?"":e:void 0}}),de.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,i=e.options,r=e.selectedIndex,a="select-one"===e.type||r<0,o=a?null:[],s=a?r+1:i.length,l=r<0?s:a?r:0;l<s;l++)if(((n=i[l]).selected||l===r)&&(de.support.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!de.nodeName(n.parentNode,"optgroup"))){if(t=de(n).val(),a)return t;o.push(t)}return o},set:function(e,t){var n=de.makeArray(t);return de(e).find("option").each(function(){this.selected=0<=de.inArray(de(this).val(),n)}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,t,n){var i,r,a,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===I?de.prop(e,t,n):((r=1!==o||!de.isXMLDoc(e))&&(t=t.toLowerCase(),i=de.attrHooks[t]||(J.test(t)?W:Y)),n===v?i&&r&&"get"in i&&null!==(a=i.get(e,t))?a:(typeof e.getAttribute!==I&&(a=e.getAttribute(t)),null==a?v:a):null!==n?i&&r&&"set"in i&&(a=i.set(e,n,t))!==v?a:(e.setAttribute(t,n+""),n):void de.removeAttr(e,t))},removeAttr:function(e,t){var n,i,r=0,a=t&&t.match(T);if(a&&1===e.nodeType)for(;n=a[r++];)i=de.propFix[n]||n,J.test(n)?!Q&&K.test(n)?e[de.camelCase("default-"+n)]=e[i]=!1:e[i]=!1:de.attr(e,n,""),e.removeAttribute(Q?n:i)},attrHooks:{type:{set:function(e,t){if(!de.support.radioValue&&"radio"===t&&de.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,t,n){var i,r,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return(1!==a||!de.isXMLDoc(e))&&(t=de.propFix[t]||t,r=de.propHooks[t]),n!==v?r&&"set"in r&&(i=r.set(e,n,t))!==v?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=e.getAttributeNode("tabindex");return t&&t.specified?parseInt(t.value,10):Z.test(e.nodeName)||X.test(e.nodeName)&&e.href?0:v}}}}),W={get:function(e,t){var n=de.prop(e,t),i="boolean"==typeof n&&e.getAttribute(t),r="boolean"==typeof n?U&&Q?null!=i:K.test(t)?e[de.camelCase("default-"+t)]:!!i:e.getAttributeNode(t);return r&&!1!==r.value?t.toLowerCase():v},set:function(e,t,n){return!1===t?de.removeAttr(e,n):U&&Q||!K.test(n)?e.setAttribute(!Q&&de.propFix[n]||n,n):e[de.camelCase("default-"+n)]=e[n]=!0,n}},U&&Q||(de.attrHooks.value={get:function(e,t){var n=e.getAttributeNode(t);return de.nodeName(e,"input")?e.defaultValue:n&&n.specified?n.value:v},set:function(e,t,n){if(!de.nodeName(e,"input"))return Y&&Y.set(e,t,n);e.defaultValue=t}}),Q||(Y=de.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&("id"===t||"name"===t||"coords"===t?""!==n.value:n.specified)?n.value:v},set:function(e,t,n){var i=e.getAttributeNode(n);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n)?t:v}},de.attrHooks.contenteditable={get:Y.get,set:function(e,t,n){Y.set(e,""!==t&&t,n)}},de.each(["width","height"],function(e,n){de.attrHooks[n]=de.extend(de.attrHooks[n],{set:function(e,t){if(""===t)return e.setAttribute(n,"auto"),t}})})),de.support.hrefNormalized||(de.each(["href","src","width","height"],function(e,n){de.attrHooks[n]=de.extend(de.attrHooks[n],{get:function(e){var t=e.getAttribute(n,2);return null==t?v:t}})}),de.each(["href","src"],function(e,t){de.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),de.support.style||(de.attrHooks.style={get:function(e){return e.style.cssText||v},set:function(e,t){return e.style.cssText=t+""}}),de.support.optSelected||(de.propHooks.selected=de.extend(de.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),de.support.enctype||(de.propFix.enctype="encoding"),de.support.checkOn||de.each(["radio","checkbox"],function(){de.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),de.each(["radio","checkbox"],function(){de.valHooks[this]=de.extend(de.valHooks[this],{set:function(e,t){if(de.isArray(t))return e.checked=0<=de.inArray(de(e).val(),t)}})});var z=/^(?:input|select|textarea)$/i,q=/^key/,$=/^(?:mouse|contextmenu)|click/,ee=/^(?:focusinfocus|focusoutblur)$/,te=/^([^.]*)(?:\.(.+)|)$/;function ne(){return!0}function ie(){return!1}de.event={global:{},add:function(e,t,n,i,r){var a,o,s,l,u,c,h,p,d,f,g,m=de._data(e);if(m){for(n.handler&&(n=(l=n).handler,r=l.selector),n.guid||(n.guid=de.guid++),(o=m.events)||(o=m.events={}),(c=m.handle)||((c=m.handle=function(e){return typeof de===I||e&&de.event.triggered===e.type?v:de.event.dispatch.apply(c.elem,arguments)}).elem=e),s=(t=(t||"").match(T)||[""]).length;s--;)d=g=(a=te.exec(t[s])||[])[1],f=(a[2]||"").split(".").sort(),u=de.event.special[d]||{},d=(r?u.delegateType:u.bindType)||d,u=de.event.special[d]||{},h=de.extend({type:d,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&de.expr.match.needsContext.test(r),namespace:f.join(".")},l),(p=o[d])||((p=o[d]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,i,f,c)||(e.addEventListener?e.addEventListener(d,c,!1):e.attachEvent&&e.attachEvent("on"+d,c))),u.add&&(u.add.call(e,h),h.handler.guid||(h.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,h):p.push(h),de.event.global[d]=!0;e=null}},remove:function(e,t,n,i,r){var a,o,s,l,u,c,h,p,d,f,g,m=de.hasData(e)&&de._data(e);if(m&&(c=m.events)){for(u=(t=(t||"").match(T)||[""]).length;u--;)if(d=g=(s=te.exec(t[u])||[])[1],f=(s[2]||"").split(".").sort(),d){for(h=de.event.special[d]||{},p=c[d=(i?h.delegateType:h.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=a=p.length;a--;)o=p[a],!r&&g!==o.origType||n&&n.guid!==o.guid||s&&!s.test(o.namespace)||i&&i!==o.selector&&("**"!==i||!o.selector)||(p.splice(a,1),o.selector&&p.delegateCount--,h.remove&&h.remove.call(e,o));l&&!p.length&&(h.teardown&&!1!==h.teardown.call(e,f,m.handle)||de.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)de.event.remove(e,d+t[u],n,i,!0);de.isEmptyObject(c)&&(delete m.handle,de._removeData(e,"events"))}},trigger:function(e,t,n,i){var r,a,o,s,l,u,c=[n||m],h=_.call(e,"type")?e.type:e,p=_.call(e,"namespace")?e.namespace.split("."):[],d=l=n=n||m;if(3!==n.nodeType&&8!==n.nodeType&&!ee.test(h+de.event.triggered)&&(0<=h.indexOf(".")&&(h=(p=h.split(".")).shift(),p.sort()),a=h.indexOf(":")<0&&"on"+h,(e=e[de.expando]?e:new de.Event(h,"object"==typeof e&&e)).isTrigger=!0,e.namespace=p.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=v,e.target||(e.target=n),t=null==t?[e]:de.makeArray(t,[e]),s=de.event.special[h]||{},i||!s.trigger||!1!==s.trigger.apply(n,t))){if(!i&&!s.noBubble&&!de.isWindow(n)){for(o=s.delegateType||h,ee.test(o+h)||(d=d.parentNode);d;d=d.parentNode)c.push(d),l=d;l===(n.ownerDocument||m)&&c.push(l.defaultView||l.parentWindow||g)}for(u=0;(d=c[u++])&&!e.isPropagationStopped();)e.type=1<u?o:s.bindType||h,(r=(de._data(d,"events")||{})[e.type]&&de._data(d,"handle"))&&r.apply(d,t),(r=a&&d[a])&&de.acceptData(d)&&r.apply&&!1===r.apply(d,t)&&e.preventDefault();if(e.type=h,!i&&!e.isDefaultPrevented()&&(!s._default||!1===s._default.apply(n.ownerDocument,t))&&("click"!==h||!de.nodeName(n,"a"))&&de.acceptData(n)&&a&&n[h]&&!de.isWindow(n)){(l=n[a])&&(n[a]=null),de.event.triggered=h;try{n[h]()}catch(f){}de.event.triggered=v,l&&(n[a]=l)}return e.result}},dispatch:function(e){e=de.event.fix(e);var t,n,i,r,a,o,s,l=p.call(arguments),u=(de._data(this,"events")||{})[e.type]||[],c=de.event.special[e.type]||{};if((l[0]=e).delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(o=de.event.handlers.call(this,e,u),t=0;(r=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=r.elem,a=0;(i=r.handlers[a++])&&!e.isImmediatePropagationStopped();){e.namespace_re&&!e.namespace_re.test(i.namespace)||(e.handleObj=i,e.data=i.data,(s=(de.event.special[i.origType]||{}).handle||i.handler).apply&&(n=s.apply(r.elem,l)),n!==v&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,r,a,o=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(r=[],a=0;a<s;a++)r[n=(i=t[a]).selector+" "]===v&&(r[n]=i.needsContext?0<=de(n,this).index(l):de.find(n,this,null,[l]).length),r[n]&&r.push(i);r.length&&o.push({elem:l,handlers:r})}return s<t.length&&o.push({elem:this,handlers:t.slice(s)}),o},fix:function(e){if(e[de.expando])return e;var t,n,i,r=e.type,a=e,o=this.fixHooks[r];for(o||(this.fixHooks[r]=o=$.test(r)?this.mouseHooks:q.test(r)?this.keyHooks:{}),i=o.props?this.props.concat(o.props):this.props,e=new de.Event(a),t=i.length;t--;)e[n=i[t]]=a[n];return e.target||(e.target=a.srcElement||m),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,r,a=t.button,o=t.fromElement;return null==e.pageX&&null!=t.clientX&&(r=(i=e.target.ownerDocument||m).documentElement,n=i.body,e.pageX=t.clientX+(r&&r.scrollLeft||n&&n.scrollLeft||0)-(r&&r.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||n&&n.scrollTop||0)-(r&&r.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),e.which||a===v||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){if(de.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1}},focus:{trigger:function(){if(this!==m.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===m.activeElement&&this.blur)return this.blur(),!1},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==v&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,i){var r=de.extend(new de.Event,n,{type:e,isSimulated:!0,originalEvent:{}});i?de.event.trigger(r,null,t):de.event.dispatch.call(t,r),r.isDefaultPrevented()&&n.preventDefault()}},de.removeEvent=m.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var i="on"+t;e.detachEvent&&(typeof e[i]===I&&(e[i]=null),e.detachEvent(i,n))},de.Event=function(e,t){if(!(this instanceof de.Event))return new de.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||!1===e.returnValue||e.getPreventDefault&&e.getPreventDefault()?ne:ie):this.type=e,t&&de.extend(this,t),this.timeStamp=e&&e.timeStamp||de.now(),this[de.expando]=!0},de.Event.prototype={isDefaultPrevented:ie,isPropagationStopped:ie,isImmediatePropagationStopped:ie,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ne,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ne,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ne,this.stopPropagation()}},de.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,r){de.event.special[e]={delegateType:r,bindType:r,handle:function(e){var t,n=e.relatedTarget,i=e.handleObj;return n&&(n===this||de.contains(this,n))||(e.type=i.origType,t=i.handler.apply(this,arguments),e.type=r),t}}}),de.support.submitBubbles||(de.event.special.submit={setup:function(){if(de.nodeName(this,"form"))return!1;de.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=de.nodeName(t,"input")||de.nodeName(t,"button")?t.form:v;n&&!de._data(n,"submitBubbles")&&(de.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),de._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&de.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(de.nodeName(this,"form"))return!1;de.event.remove(this,"._submit")}}),de.support.changeBubbles||(de.event.special.change={setup:function(){if(z.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(de.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),de.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),de.event.simulate("change",this,e,!0)})),!1;de.event.add(this,"beforeactivate._change",function(e){var t=e.target;z.test(t.nodeName)&&!de._data(t,"changeBubbles")&&(de.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||de.event.simulate("change",this.parentNode,e,!0)}),de._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return de.event.remove(this,"._change"),!z.test(this.nodeName)}}),de.support.focusinBubbles||de.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,i=function(e){de.event.simulate(t,e.target,de.event.fix(e),!0)};de.event.special[t]={setup:function(){0==n++&&m.addEventListener(e,i,!0)},teardown:function(){0==--n&&m.removeEventListener(e,i,!0)}}}),de.fn.extend({on:function(e,t,n,i,r){var a,o;if("object"==typeof e){for(a in"string"!=typeof t&&(n=n||t,t=v),e)this.on(a,t,n,e[a],r);return this}if(null==n&&null==i?(i=t,n=t=v):null==i&&("string"==typeof t?(i=n,n=v):(i=n,n=t,t=v)),!1===i)i=ie;else if(!i)return this;return 1===r&&(o=i,(i=function(e){return de().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=de.guid++)),this.each(function(){de.event.add(this,e,i,n,t)})},one:function(e,t,n,i){return this.on(e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,de(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"!=typeof e)return!1!==t&&"function"!=typeof t||(n=t,t=v),!1===n&&(n=ie),this.each(function(){de.event.remove(this,e,n,t)});for(r in e)this.off(r,t,e[r]);return this},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){de.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return de.event.trigger(e,t,n,!0)}}),function(n){var e,b,y,a,t,g,u,v,m,T,i,I,B,r,o,_,s,C="sizzle"+-new Date,E=n.document,N={},V=0,h=0,l=$(),c=$(),p=$(),d="undefined",f=[],S=f.pop,x=f.push,w=f.slice,A=f.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},L="[\\x20\\t\\r\\n\\f]",k="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",D=k.replace("w","w#"),M="\\["+L+"*("+k+")"+L+"*(?:([*^$|!~]?=)"+L+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+D+")|)|)"+L+"*\\]",P=":("+k+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+M.replace(3,8)+")*)|.*)\\)|)",R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),H=new RegExp("^"+L+"*,"+L+"*"),O=new RegExp("^"+L+"*([\\x20\\t\\r\\n\\f>+~])"+L+"*"),F=new RegExp(P),Y=new RegExp("^"+D+"$"),W={ID:new RegExp("^#("+k+")"),CLASS:new RegExp("^\\.("+k+")"),NAME:new RegExp("^\\[name=['\"]?("+k+")['\"]?\\]"),TAG:new RegExp("^("+k.replace("w","w*")+")"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},G=/[\x20\t\r\n\f]*[+~]/,j=/^[^{]+\{\s*\[native code/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/'|\\/g,Q=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,U=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,z=function(e,t){var n="0x"+t-65536;return n!=n?t:n<0?String.fromCharCode(65536+n):String.fromCharCode(n>>10|55296,1023&n|56320)};try{w.call(E.documentElement.childNodes,0)[0].nodeType}catch(pe){w=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}function q(e){return j.test(e+"")}function $(){var n,i=[];return n=function(e,t){return i.push(e+=" ")>y.cacheLength&&delete n[i.shift()],n[e]=t}}function ee(e){return e[C]=!0,e}function te(e){var t=T.createElement("div");try{return e(t)}catch(pe){return!1}finally{t=null}}function ne(e,t,n,i){var r,a,o,s,l,u,c,h,p,d;if((t?t.ownerDocument||t:E)!==T&&m(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=(t=t||T).nodeType)&&9!==s)return[];if(!I&&!i){if(r=Z.exec(e))if(o=r[1]){if(9===s){if(!(a=t.getElementById(o))||!a.parentNode)return n;if(a.id===o)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(o))&&_(t,a)&&a.id===o)return n.push(a),n}else{if(r[2])return x.apply(n,w.call(t.getElementsByTagName(e),0)),n;if((o=r[3])&&N.getByClassName&&t.getElementsByClassName)return x.apply(n,w.call(t.getElementsByClassName(o),0)),n}if(N.qsa&&!B.test(e)){if(c=!0,h=C,p=t,d=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(u=ae(e),(c=t.getAttribute("id"))?h=c.replace(K,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=u.length;l--;)u[l]=h+oe(u[l]);p=G.test(e)&&t.parentNode||t,d=u.join(",")}if(d)try{return x.apply(n,w.call(p.querySelectorAll(d),0)),n}catch(f){}finally{c||t.removeAttribute("id")}}}return function(e,t,n,i){var r,a,o,s,l,u=ae(e);if(!i&&1===u.length){if(2<(a=u[0]=u[0].slice(0)).length&&"ID"===(o=a[0]).type&&9===t.nodeType&&!I&&y.relative[a[1].type]){if(!(t=y.find.ID(o.matches[0].replace(U,z),t)[0]))return n;e=e.slice(a.shift().value.length)}for(r=W.needsContext.test(e)?0:a.length;r--&&(o=a[r],!y.relative[s=o.type]);)if((l=y.find[s])&&(i=l(o.matches[0].replace(U,z),G.test(a[0].type)&&t.parentNode||t))){if(a.splice(r,1),!(e=i.length&&oe(a)))return x.apply(n,w.call(i,0)),n;break}}return g(e,u)(i,t,I,n,G.test(e)),n}(e.replace(R,"$1"),t,n,i)}function ie(e,t){var n=t&&e,i=n&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function re(o){return ee(function(a){return a=+a,ee(function(e,t){for(var n,i=o([],e.length,a),r=i.length;r--;)e[n=i[r]]&&(e[n]=!(t[n]=e[n]))})})}for(e in t=ne.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},m=ne.setDocument=function(e){var l=e?e.ownerDocument||e:E;return l!==T&&9===l.nodeType&&l.documentElement&&(i=(T=l).documentElement,I=t(l),N.tagNameNoComments=te(function(e){return e.appendChild(l.createComment("")),!e.getElementsByTagName("*").length}),N.attributes=te(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!=t&&"string"!=t}),N.getByClassName=te(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!(!e.getElementsByClassName||!e.getElementsByClassName("e").length)&&(e.lastChild.className="e",2===e.getElementsByClassName("e").length)}),N.getByName=te(function(e){e.id=C+0,e.innerHTML="<a name='"+C+"'></a><div name='"+C+"'></div>",i.insertBefore(e,i.firstChild);var t=l.getElementsByName&&l.getElementsByName(C).length===2+l.getElementsByName(C+0).length;return N.getIdNotName=!l.getElementById(C),i.removeChild(e),t}),y.attrHandle=te(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!=d&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},N.getIdNotName?(y.find.ID=function(e,t){if(typeof t.getElementById!=d&&!I){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},y.filter.ID=function(e){var t=e.replace(U,z);return function(e){return e.getAttribute("id")===t}}):(y.find.ID=function(e,t){if(typeof t.getElementById!=d&&!I){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!=d&&n.getAttributeNode("id").value===e?[n]:void 0:[]}},y.filter.ID=function(e){var n=e.replace(U,z);return function(e){var t=typeof e.getAttributeNode!=d&&e.getAttributeNode("id");return t&&t.value===n}}),y.find.TAG=N.tagNameNoComments?function(e,t){if(typeof t.getElementsByTagName!=d)return t.getElementsByTagName(e)}:function(e,t){var n,i=[],r=0,a=t.getElementsByTagName(e);if("*"!==e)return a;for(;n=a[r++];)1===n.nodeType&&i.push(n);return i},y.find.NAME=N.getByName&&function(e,t){if(typeof t.getElementsByName!=d)return t.getElementsByName(name)},y.find.CLASS=N.getByClassName&&function(e,t){if(typeof t.getElementsByClassName!=d&&!I)return t.getElementsByClassName(e)},r=[],B=[":focus"],(N.qsa=q(l.querySelectorAll))&&(te(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||B.push("\\["+L+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||B.push(":checked")}),te(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&B.push("[*^$]="+L+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||B.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),B.push(",.*:")})),(N.matchesSelector=q(o=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector))&&te(function(e){N.disconnectedMatch=o.call(e,"div"),o.call(e,"[s!='']:x"),r.push("!=",P)}),B=new RegExp(B.join("|")),r=new RegExp(r.join("|")),_=q(i.contains)||i.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},s=i.compareDocumentPosition?function(e,t){var n;return e===t?(u=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===l||_(E,e)?-1:t===l||_(E,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,r=e.parentNode,a=t.parentNode,o=[e],s=[t];if(e===t)return u=!0,0;if(!r||!a)return e===l?-1:t===l?1:r?-1:a?1:0;if(r===a)return ie(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;o[i]===s[i];)i++;return i?ie(o[i],s[i]):o[i]===E?-1:s[i]===E?1:0},u=!1,[0,0].sort(s),N.detectDuplicates=u),T},ne.matches=function(e,t){return ne(e,null,null,t)},ne.matchesSelector=function(e,t){if((e.ownerDocument||e)!==T&&m(e),t=t.replace(Q,"='$1']"),N.matchesSelector&&!I&&(!r||!r.test(t))&&!B.test(t))try{var n=o.call(e,t);if(n||N.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(pe){}return 0<ne(t,T,null,[e]).length},ne.contains=function(e,t){return(e.ownerDocument||e)!==T&&m(e),_(e,t)},ne.attr=function(e,t){var n;return(e.ownerDocument||e)!==T&&m(e),I||(t=t.toLowerCase()),(n=y.attrHandle[t])?n(e):I||N.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&!0===e[t]?t:n&&n.specified?n.value:null},ne.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ne.uniqueSort=function(e){var t,n=[],i=1,r=0;if(u=!N.detectDuplicates,e.sort(s),u){for(;t=e[i];i++)t===e[i-1]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},a=ne.getText=function(e){var t,n="",i=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[i];i++)n+=a(t);return n},y=ne.selectors={cacheLength:50,createPseudo:ee,match:W,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(U,z),e[3]=(e[4]||e[5]||"").replace(U,z),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ne.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ne.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return W.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&F.test(n)&&(t=ae(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(U,z).toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(e){var t=l[e+" "];return t||(t=new RegExp("(^|"+L+")"+e+"("+L+"|$)"))&&l(e,function(e){return t.test(e.className||typeof e.getAttribute!=d&&e.getAttribute("class")||"")})},ATTR:function(n,i,r){return function(e){var t=ne.attr(e,n);return null==t?"!="===i:!i||(t+="","="===i?t===r:"!="===i?t!==r:"^="===i?r&&0===t.indexOf(r):"*="===i?r&&-1<t.indexOf(r):"$="===i?r&&t.slice(-r.length)===r:"~="===i?-1<(" "+t+" ").indexOf(r):"|="===i&&(t===r||t.slice(0,r.length+1)===r+"-"))}},CHILD:function(d,e,t,f,g){var m="nth"!==d.slice(0,3),I="last"!==d.slice(-4),B="of-type"===e;return 1===f&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var i,r,a,o,s,l,u=m!=I?"nextSibling":"previousSibling",c=e.parentNode,h=B&&e.nodeName.toLowerCase(),p=!n&&!B;if(c){if(m){for(;u;){for(a=e;a=a[u];)if(B?a.nodeName.toLowerCase()===h:1===a.nodeType)return!1;l=u="only"===d&&!l&&"nextSibling"}return!0}if(l=[I?c.firstChild:c.lastChild],I&&p){for(s=(i=(r=c[C]||(c[C]={}))[d]||[])[0]===V&&i[1],o=i[0]===V&&i[2],a=s&&c.childNodes[s];a=++s&&a&&a[u]||(o=s=0)||l.pop();)if(1===a.nodeType&&++o&&a===e){r[d]=[V,s,o];break}}else if(p&&(i=(e[C]||(e[C]={}))[d])&&i[0]===V)o=i[1];else for(;(a=++s&&a&&a[u]||(o=s=0)||l.pop())&&((B?a.nodeName.toLowerCase()!==h:1!==a.nodeType)||!++o||(p&&((a[C]||(a[C]={}))[d]=[V,o]),a!==e)););return(o-=g)===f||o%f==0&&0<=o/f}}},PSEUDO:function(e,a){var t,o=y.pseudos[e]||y.setFilters[e.toLowerCase()]||ne.error("unsupported pseudo: "+e);return o[C]?o(a):1<o.length?(t=[e,e,"",a],y.setFilters.hasOwnProperty(e.toLowerCase())?ee(function(e,t){for(var n,i=o(e,a),r=i.length;r--;)e[n=A.call(e,i[r])]=!(t[n]=i[r])}):function(e){return o(e,0,t)}):o}},pseudos:{not:ee(function(e){var i=[],r=[],s=g(e.replace(R,"$1"));return s[C]?ee(function(e,t,n,i){for(var r,a=s(e,null,i,[]),o=e.length;o--;)(r=a[o])&&(e[o]=!(t[o]=r))}):function(e,t,n){return i[0]=e,s(i,null,n,r),!r.pop()}}),has:ee(function(t){return function(e){return 0<ne(t,e).length}}),contains:ee(function(t){return function(e){return-1<(e.textContent||e.innerText||a(e)).indexOf(t)}}),lang:ee(function(n){return Y.test(n||"")||ne.error("unsupported lang: "+n),n=n.replace(U,z).toLowerCase(),function(e){var t;do{if(t=I?e.getAttribute("xml:lang")||e.getAttribute("lang"):e.lang)return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===i},focus:function(e){return e===T.activeElement&&(!T.hasFocus||T.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if("@"<e.nodeName||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!y.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:re(function(){return[0]}),last:re(function(e,t){return[t-1]}),eq:re(function(e,t,n){return[n<0?n+t:n]}),even:re(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:re(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:re(function(e,t,n){for(var i=n<0?n+t:n;0<=--i;)e.push(i);return e}),gt:re(function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e})}},{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})y.pseudos[e]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(e);for(e in{submit:!0,reset:!0})y.pseudos[e]=function(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}(e);function ae(e,t){var n,i,r,a,o,s,l,u=c[e+" "];if(u)return t?0:u.slice(0);for(o=e,s=[],l=y.preFilter;o;){for(a in n&&!(i=H.exec(o))||(i&&(o=o.slice(i[0].length)||o),s.push(r=[])),n=!1,(i=O.exec(o))&&(n=i.shift(),r.push({value:n,type:i[0].replace(R," ")}),o=o.slice(n.length)),y.filter)!(i=W[a].exec(o))||l[a]&&!(i=l[a](i))||(n=i.shift(),r.push({value:n,type:a,matches:i}),o=o.slice(n.length));if(!n)break}return t?o.length:o?ne.error(e):c(e,s).slice(0)}function oe(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function se(s,e,t){var l=e.dir,u=t&&"parentNode"===l,c=h++;return e.first?function(e,t,n){for(;e=e[l];)if(1===e.nodeType||u)return s(e,t,n)}:function(e,t,n){var i,r,a,o=V+" "+c;if(n){for(;e=e[l];)if((1===e.nodeType||u)&&s(e,t,n))return!0}else for(;e=e[l];)if(1===e.nodeType||u)if((r=(a=e[C]||(e[C]={}))[l])&&r[0]===o){if(!0===(i=r[1])||i===b)return!0===i}else if((r=a[l]=[o])[1]=s(e,t,n)||b,!0===r[1])return!0}}function le(r){return 1<r.length?function(e,t,n){for(var i=r.length;i--;)if(!r[i](e,t,n))return!1;return!0}:r[0]}function ue(e,t,n,i,r){for(var a,o=[],s=0,l=e.length,u=null!=t;s<l;s++)(a=e[s])&&(n&&!n(a,i,r)||(o.push(a),u&&t.push(s)));return o}function ce(d,f,g,m,I,e){return m&&!m[C]&&(m=ce(m)),I&&!I[C]&&(I=ce(I,e)),ee(function(e,t,n,i){var r,a,o,s=[],l=[],u=t.length,c=e||function(e,t,n){for(var i=0,r=t.length;i<r;i++)ne(e,t[i],n);return n}(f||"*",n.nodeType?[n]:n,[]),h=!d||!e&&f?c:ue(c,s,d,n,i),p=g?I||(e?d:u||m)?[]:t:h;if(g&&g(h,p,n,i),m)for(r=ue(p,l),m(r,[],n,i),a=r.length;a--;)(o=r[a])&&(p[l[a]]=!(h[l[a]]=o));if(e){if(I||d){if(I){for(r=[],a=p.length;a--;)(o=p[a])&&r.push(h[a]=o);I(null,p=[],r,i)}for(a=p.length;a--;)(o=p[a])&&-1<(r=I?A.call(e,o):s[a])&&(e[r]=!(t[r]=o))}}else p=ue(p===t?p.splice(u,p.length):p),I?I(null,t,p,i):x.apply(t,p)})}function he(){}g=ne.compile=function(e,t){var n,m,I,B,_,E,i,r=[],a=[],o=p[e+" "];if(!o){for(n=(t=t||ae(e)).length;n--;)(o=function h(e){for(var i,t,n,r=e.length,a=y.relative[e[0].type],o=a||y.relative[" "],s=a?1:0,l=se(function(e){return e===i},o,!0),u=se(function(e){return-1<A.call(i,e)},o,!0),c=[function(e,t,n){return!a&&(n||t!==v)||((i=t).nodeType?l:u)(e,t,n)}];s<r;s++)if(t=y.relative[e[s].type])c=[se(le(c),t)];else{if((t=y.filter[e[s].type].apply(null,e[s].matches))[C]){for(n=++s;n<r&&!y.relative[e[n].type];n++);return ce(1<s&&le(c),1<s&&oe(e.slice(0,s-1)).replace(R,"$1"),t,s<n&&h(e.slice(s,n)),n<r&&h(e=e.slice(n)),n<r&&oe(e))}c.push(t)}return le(c)}(t[n]))[C]?r.push(o):a.push(o);o=p(e,(m=a,_=(B=0)<(I=r).length,E=0<m.length,i=function(e,t,n,i,r){var a,o,s,l=[],u=0,c="0",h=e&&[],p=null!=r,d=v,f=e||E&&y.find.TAG("*",r&&t.parentNode||t),g=V+=null==d?1:Math.random()||.1;for(p&&(v=t!==T&&t,b=B);null!=(a=f[c]);c++){if(E&&a){for(o=0;s=m[o++];)if(s(a,t,n)){i.push(a);break}p&&(V=g,b=++B)}_&&((a=!s&&a)&&u--,e&&h.push(a))}if(u+=c,_&&c!==u){for(o=0;s=I[o++];)s(h,l,t,n);if(e){if(0<u)for(;c--;)h[c]||l[c]||(l[c]=S.call(i));l=ue(l)}x.apply(i,l),p&&!e&&0<l.length&&1<u+I.length&&ne.uniqueSort(i)}return p&&(V=g,v=d),h},_?ee(i):i))}return o},y.pseudos.nth=y.pseudos.eq,y.filters=he.prototype=y.pseudos,y.setFilters=new he,m(),ne.attr=de.attr,de.find=ne,de.expr=ne.selectors,de.expr[":"]=de.expr.pseudos,de.unique=ne.uniqueSort,de.text=ne.getText,de.isXMLDoc=ne.isXML,de.contains=ne.contains}(g);var re=/Until$/,ae=/^(?:parents|prev(?:Until|All))/,oe=/^.[^:#\[\.,]*$/,se=de.expr.match.needsContext,le={children:!0,contents:!0,next:!0,prev:!0};function ue(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function ce(e,n,i){if(n=n||0,de.isFunction(n))return de.grep(e,function(e,t){return!!n.call(e,t,e)===i});if(n.nodeType)return de.grep(e,function(e){return e===n===i});if("string"==typeof n){var t=de.grep(e,function(e){return 1===e.nodeType});if(oe.test(n))return de.filter(n,t,!i);n=de.filter(n,t)}return de.grep(e,function(e){return 0<=de.inArray(e,n)===i})}function he(e){var t=pe.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}de.fn.extend({find:function(e){var t,n,i,r=this.length;if("string"!=typeof e)return(i=this).pushStack(de(e).filter(function(){for(t=0;t<r;t++)if(de.contains(i[t],this))return!0}));for(n=[],t=0;t<r;t++)de.find(e,this[t],n);return(n=this.pushStack(1<r?de.unique(n):n)).selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=de(e,this),i=n.length;return this.filter(function(){for(t=0;t<i;t++)if(de.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ce(this,e,!1))},filter:function(e){return this.pushStack(ce(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?se.test(e)?0<=de(e,this.context).index(this[0]):0<de.filter(e,this).length:0<this.filter(e).length)},closest:function(e,t){for(var n,i=0,r=this.length,a=[],o=se.test(e)||"string"!=typeof e?de(e,t||this.context):0;i<r;i++)for(n=this[i];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(o?-1<o.index(n):de.find.matchesSelector(n,e)){a.push(n);break}n=n.parentNode}return this.pushStack(1<a.length?de.unique(a):a)},index:function(e){return e?"string"==typeof e?de.inArray(this[0],de(e)):de.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?de(e,t):de.makeArray(e&&e.nodeType?[e]:e),i=de.merge(this.get(),n);return this.pushStack(de.unique(i))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),de.fn.andSelf=de.fn.addBack,de.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return de.dir(e,"parentNode")},parentsUntil:function(e,t,n){return de.dir(e,"parentNode",n)},next:function(e){return ue(e,"nextSibling")},prev:function(e){return ue(e,"previousSibling")},nextAll:function(e){return de.dir(e,"nextSibling")},prevAll:function(e){return de.dir(e,"previousSibling")},nextUntil:function(e,t,n){return de.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return de.dir(e,"previousSibling",n)},siblings:function(e){return de.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return de.sibling(e.firstChild)},contents:function(e){return de.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:de.merge([],e.childNodes)}},function(i,r){de.fn[i]=function(e,t){var n=de.map(this,r,e);return re.test(i)||(t=e),t&&"string"==typeof t&&(n=de.filter(t,n)),n=1<this.length&&!le[i]?de.unique(n):n,1<this.length&&ae.test(i)&&(n=n.reverse()),this.pushStack(n)}}),de.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?de.find.matchesSelector(t[0],e)?[t[0]]:[]:de.find.matches(e,t)},dir:function(e,t,n){for(var i=[],r=e[t];r&&9!==r.nodeType&&(n===v||1!==r.nodeType||!de(r).is(n));)1===r.nodeType&&i.push(r),r=r[t];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var pe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fe=/ jQuery\d+="(?:null|\d+)"/g,ge=new RegExp("<(?:"+pe+")[\\s/>]","i"),me=/^\s+/,Ie=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Be=/<([\w:]+)/,_e=/<tbody/i,Ee=/<|&#?\w+;/,be=/<(?:script|style|link)/i,ye=/^(?:checkbox|radio)$/i,ve=/checked\s*(?:[^=]|=\s*.checked.)/i,Te=/^$|\/(?:java|ecma)script/i,Ce=/^true\/(.*)/,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ve={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:de.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Se=he(m).appendChild(m.createElement("div"));function xe(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function we(e){var t=Ce.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Ae(e,t){for(var n,i=0;null!=(n=e[i]);i++)de._data(n,"globalEval",!t||de._data(t[i],"globalEval"))}function Le(e,t){if(1===t.nodeType&&de.hasData(e)){var n,i,r,a=de._data(e),o=de._data(t,a),s=a.events;if(s)for(n in delete o.handle,o.events={},s)for(i=0,r=s[n].length;i<r;i++)de.event.add(t,n,s[n][i]);o.data&&(o.data=de.extend({},o.data))}}function ke(e,t){var n,i,r=0,a=typeof e.getElementsByTagName!==I?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==I?e.querySelectorAll(t||"*"):v;if(!a)for(a=[],n=e.childNodes||e;null!=(i=n[r]);r++)!t||de.nodeName(i,t)?a.push(i):de.merge(a,ke(i,t));return t===v||t&&de.nodeName(e,t)?de.merge([e],a):a}function De(e){ye.test(e.type)&&(e.defaultChecked=e.checked)}Ve.optgroup=Ve.option,Ve.tbody=Ve.tfoot=Ve.colgroup=Ve.caption=Ve.thead,Ve.th=Ve.td,de.fn.extend({text:function(e){return de.access(this,function(e){return e===v?de.text(this):this.empty().append((this[0]&&this[0].ownerDocument||m).createTextNode(e))},null,e,arguments.length)},wrapAll:function(t){return de.isFunction(t)?this.each(function(e){de(this).wrapAll(t.call(this,e))}):(this[0]&&(e=de(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)),this);var e},wrapInner:function(n){return de.isFunction(n)?this.each(function(e){de(this).wrapInner(n.call(this,e))}):this.each(function(){var e=de(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=de.isFunction(t);return this.each(function(e){de(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(){return this.parent().each(function(){de.nodeName(this,"body")||de(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,i=0;null!=(n=this[i]);i++)(!e||0<de.filter(e,[n]).length)&&(t||1!==n.nodeType||de.cleanData(ke(n)),n.parentNode&&(t&&de.contains(n.ownerDocument,n)&&Ae(ke(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&de.cleanData(ke(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&de.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return de.clone(this,e,t)})},html:function(e){return de.access(this,function(e){var t=this[0]||{},n=0,i=this.length;if(e===v)return 1===t.nodeType?t.innerHTML.replace(fe,""):v;if("string"==typeof e&&!be.test(e)&&(de.support.htmlSerialize||!ge.test(e))&&(de.support.leadingWhitespace||!me.test(e))&&!Ve[(Be.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ie,"<$1></$2>");try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(de.cleanData(ke(t,!1)),t.innerHTML=e);t=0}catch(r){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return de.isFunction(e)||"string"==typeof e||(e=de(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(de(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(n,i,r){n=B.apply([],n);var e,t,a,o,s,l,u,c,h=0,p=this.length,d=this,f=p-1,g=n[0],m=de.isFunction(g);if(m||!(p<=1||"string"!=typeof g||de.support.checkClone)&&ve.test(g))return this.each(function(e){var t=d.eq(e);m&&(n[0]=g.call(this,e,i?t.html():v)),t.domManip(n,i,r)});if(p&&(e=(l=de.buildFragment(n,this[0].ownerDocument,!1,this)).firstChild,1===l.childNodes.length&&(l=e),e)){for(i=i&&de.nodeName(e,"tr"),a=(o=de.map(ke(l,"script"),xe)).length;h<p;h++)t=l,h!==f&&(t=de.clone(t,!0,!0),a&&de.merge(o,ke(t,"script"))),r.call(i&&de.nodeName(this[h],"table")?(u=this[h],c="tbody",u.getElementsByTagName(c)[0]||u.appendChild(u.ownerDocument.createElement(c))):this[h],t,h);if(a)for(s=o[o.length-1].ownerDocument,de.map(o,we),h=0;h<a;h++)t=o[h],Te.test(t.type||"")&&!de._data(t,"globalEval")&&de.contains(s,t)&&(t.src?de.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):de.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Ne,"")));l=e=null}return this}}),de.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,o){de.fn[e]=function(e){for(var t,n=0,i=[],r=de(e),a=r.length-1;n<=a;n++)t=n===a?this:this.clone(!0),de(r[n])[o](t),s.apply(i,t.get());return this.pushStack(i)}}),de.extend({clone:function(e,t,n){var i,r,a,o,s,l=de.contains(e.ownerDocument,e);if(de.support.html5Clone||de.isXMLDoc(e)||!ge.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(Se.innerHTML=e.outerHTML,Se.removeChild(a=Se.firstChild)),!(de.support.noCloneEvent&&de.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||de.isXMLDoc(e)))for(i=ke(a),s=ke(e),o=0;null!=(r=s[o]);++o)i[o]&&function(e,t){var n,i,r;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!de.support.noCloneEvent&&t[de.expando]){for(i in(r=de._data(t)).events)de.removeEvent(t,i,r.handle);t.removeAttribute(de.expando)}"script"===n&&t.text!==e.text?(xe(t).text=e.text,we(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),de.support.html5Clone&&e.innerHTML&&!de.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&ye.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}(r,i[o]);if(t)if(n)for(s=s||ke(e),i=i||ke(a),o=0;null!=(r=s[o]);o++)Le(r,i[o]);else Le(e,a);return 0<(i=ke(a,"script")).length&&Ae(i,!l&&ke(e,"script")),i=s=r=null,a},buildFragment:function(e,t,n,i){for(var r,a,o,s,l,u,c,h=e.length,p=he(t),d=[],f=0;f<h;f++)if((a=e[f])||0===a)if("object"===de.type(a))de.merge(d,a.nodeType?[a]:a);else if(Ee.test(a)){for(s=s||p.appendChild(t.createElement("div")),l=(Be.exec(a)||["",""])[1].toLowerCase(),c=Ve[l]||Ve._default,s.innerHTML=c[1]+a.replace(Ie,"<$1></$2>")+c[2],r=c[0];r--;)s=s.lastChild;if(!de.support.leadingWhitespace&&me.test(a)&&d.push(t.createTextNode(me.exec(a)[0])),!de.support.tbody)for(r=(a="table"!==l||_e.test(a)?"<table>"!==c[1]||_e.test(a)?0:s:s.firstChild)&&a.childNodes.length;r--;)de.nodeName(u=a.childNodes[r],"tbody")&&!u.childNodes.length&&a.removeChild(u);for(de.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=p.lastChild}else d.push(t.createTextNode(a));for(s&&p.removeChild(s),de.support.appendChecked||de.grep(ke(d,"input"),De),f=0;a=d[f++];)if((!i||-1===de.inArray(a,i))&&(o=de.contains(a.ownerDocument,a),s=ke(p.appendChild(a),"script"),o&&Ae(s),n))for(r=0;a=s[r++];)Te.test(a.type||"")&&n.push(a);return s=null,p},cleanData:function(e,t){for(var n,i,r,a,o=0,s=de.expando,l=de.cache,u=de.support.deleteExpando,c=de.event.special;null!=(n=e[o]);o++)if((t||de.acceptData(n))&&(a=(r=n[s])&&l[r])){if(a.events)for(i in a.events)c[i]?de.event.remove(n,i):de.removeEvent(n,i,a.handle);l[r]&&(delete l[r],u?delete n[s]:typeof n.removeAttribute!==I?n.removeAttribute(s):n[s]=null,h.push(r))}}});var Me,Pe,Re,He=/alpha\([^)]*\)/i,Oe=/opacity\s*=\s*([^)]*)/,Fe=/^(top|right|bottom|left)$/,Ye=/^(none|table(?!-c[ea]).+)/,We=/^margin/,Ge=new RegExp("^("+d+")(.*)$","i"),je=new RegExp("^("+d+")(?!px)[a-z%]+$","i"),Ze=new RegExp("^([+-])=("+d+")","i"),Xe={BODY:"block"},Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:0,fontWeight:400},Qe=["Top","Right","Bottom","Left"],Ue=["Webkit","O","Moz","ms"];function ze(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,r=Ue.length;r--;)if((t=Ue[r]+n)in e)return t;return i}function qe(e,t){return e=t||e,"none"===de.css(e,"display")||!de.contains(e.ownerDocument,e)}function $e(e,t){for(var n,i,r,a=[],o=0,s=e.length;o<s;o++)(i=e[o]).style&&(a[o]=de._data(i,"olddisplay"),n=i.style.display,t?(a[o]||"none"!==n||(i.style.display=""),""===i.style.display&&qe(i)&&(a[o]=de._data(i,"olddisplay",it(i.nodeName)))):a[o]||(r=qe(i),(n&&"none"!==n||!r)&&de._data(i,"olddisplay",r?n:de.css(i,"display"))));for(o=0;o<s;o++)(i=e[o]).style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?a[o]||"":"none"));return e}function et(e,t,n){var i=Ge.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function tt(e,t,n,i,r){for(var a=n===(i?"border":"content")?4:"width"===t?1:0,o=0;a<4;a+=2)"margin"===n&&(o+=de.css(e,n+Qe[a],!0,r)),i?("content"===n&&(o-=de.css(e,"padding"+Qe[a],!0,r)),"margin"!==n&&(o-=de.css(e,"border"+Qe[a]+"Width",!0,r))):(o+=de.css(e,"padding"+Qe[a],!0,r),"padding"!==n&&(o+=de.css(e,"border"+Qe[a]+"Width",!0,r)));return o}function nt(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,a=Pe(e),o=de.support.boxSizing&&"border-box"===de.css(e,"boxSizing",!1,a);if(r<=0||null==r){if(((r=Re(e,t,a))<0||null==r)&&(r=e.style[t]),je.test(r))return r;i=o&&(de.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+tt(e,t,n||(o?"border":"content"),i,a)+"px"}function it(e){var t=m,n=Xe[e];return n||("none"!==(n=rt(e,t))&&n||((t=((Me=(Me||de("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement))[0].contentWindow||Me[0].contentDocument).document).write("<!doctype html><html><body>"),t.close(),n=rt(e,t),Me.detach()),Xe[e]=n),n}function rt(e,t){var n=de(t.createElement(e)).appendTo(t.body),i=de.css(n[0],"display");return n.remove(),i}de.fn.extend({css:function(e,t){return de.access(this,function(e,t,n){var i,r,a={},o=0;if(de.isArray(t)){for(r=Pe(e),i=t.length;o<i;o++)a[t[o]]=de.css(e,t[o],!1,r);return a}return n!==v?de.style(e,t,n):de.css(e,t)},e,t,1<arguments.length)},show:function(){return $e(this,!0)},hide:function(){return $e(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:qe(this))?de(this).show():de(this).hide()})}}),de.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Re(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":de.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,a,o,s=de.camelCase(t),l=e.style;if(t=de.cssProps[s]||(de.cssProps[s]=ze(l,s)),o=de.cssHooks[t]||de.cssHooks[s],n===v)return o&&"get"in o&&(r=o.get(e,!1,i))!==v?r:l[t];if("string"===(a=typeof n)&&(r=Ze.exec(n))&&(n=(r[1]+1)*r[2]+parseFloat(de.css(e,t)),a="number"),!(null==n||"number"===a&&isNaN(n)||("number"!==a||de.cssNumber[s]||(n+="px"),de.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),o&&"set"in o&&(n=o.set(e,n,i))===v)))try{l[t]=n}catch(u){}}},css:function(e,t,n,i){var r,a,o,s=de.camelCase(t);return t=de.cssProps[s]||(de.cssProps[s]=ze(e.style,s)),(o=de.cssHooks[t]||de.cssHooks[s])&&"get"in o&&(a=o.get(e,!0,n)),a===v&&(a=Re(e,t,i)),"normal"===a&&t in Ke&&(a=Ke[t]),""===n||n?(r=parseFloat(a),!0===n||de.isNumeric(r)?r||0:a):a},swap:function(e,t,n,i){var r,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];for(a in r=n.apply(e,i||[]),t)e.style[a]=o[a];return r}}),g.getComputedStyle?(Pe=function(e){return g.getComputedStyle(e,null)},Re=function(e,t,n){var i,r,a,o=n||Pe(e),s=o?o.getPropertyValue(t)||o[t]:v,l=e.style;return o&&(""!==s||de.contains(e.ownerDocument,e)||(s=de.style(e,t)),je.test(s)&&We.test(t)&&(i=l.width,r=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=o.width,l.width=i,l.minWidth=r,l.maxWidth=a)),s}):m.documentElement.currentStyle&&(Pe=function(e){return e.currentStyle},Re=function(e,t,n){var i,r,a,o=n||Pe(e),s=o?o[t]:v,l=e.style;return null==s&&l&&l[t]&&(s=l[t]),je.test(s)&&!Fe.test(t)&&(i=l.left,(a=(r=e.runtimeStyle)&&r.left)&&(r.left=e.currentStyle.left),l.left="fontSize"===t?"1em":s,s=l.pixelLeft+"px",l.left=i,a&&(r.left=a)),""===s?"auto":s}),de.each(["height","width"],function(e,r){de.cssHooks[r]={get:function(e,t,n){if(t)return 0===e.offsetWidth&&Ye.test(de.css(e,"display"))?de.swap(e,Je,function(){return nt(e,r,n)}):nt(e,r,n)},set:function(e,t,n){var i=n&&Pe(e);return et(0,t,n?tt(e,r,n,de.support.boxSizing&&"border-box"===de.css(e,"boxSizing",!1,i),i):0)}}}),de.support.opacity||(de.cssHooks.opacity={get:function(e,t){return Oe.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,r=de.isNumeric(t)?"alpha(opacity="+100*t+")":"",a=i&&i.filter||n.filter||"";((n.zoom=1)<=t||""===t)&&""===de.trim(a.replace(He,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=He.test(a)?a.replace(He,r):a+" "+r)}}),de(function(){de.support.reliableMarginRight||(de.cssHooks.marginRight={get:function(e,t){if(t)return de.swap(e,{display:"inline-block"},Re,[e,"marginRight"])}}),!de.support.pixelPosition&&de.fn.position&&de.each(["top","left"],function(e,n){de.cssHooks[n]={get:function(e,t){if(t)return t=Re(e,n),je.test(t)?de(e).position()[n]+"px":t}}})}),de.expr&&de.expr.filters&&(de.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!de.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||de.css(e,"display"))},de.expr.filters.visible=function(e){return!de.expr.filters.hidden(e)}),de.each({margin:"",padding:"",border:"Width"},function(r,a){de.cssHooks[r+a]={expand:function(e){for(var t=0,n={},i="string"==typeof e?e.split(" "):[e];t<4;t++)n[r+Qe[t]+a]=i[t]||i[t-2]||i[0];return n}},We.test(r)||(de.cssHooks[r+a].set=et)});var at=/%20/g,ot=/\[\]$/,st=/\r?\n/g,lt=/^(?:submit|button|image|reset|file)$/i,ut=/^(?:input|select|textarea|keygen)/i;de.fn.extend({serialize:function(){return de.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=de.prop(this,"elements");return e?de.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!de(this).is(":disabled")&&ut.test(this.nodeName)&&!lt.test(e)&&(this.checked||!ye.test(e))}).map(function(e,t){var n=de(this).val();return null==n?null:de.isArray(n)?de.map(n,function(e){return{name:t.name,value:e.replace(st,"\r\n")}}):{name:t.name,value:n.replace(st,"\r\n")}}).get()}}),de.param=function(e,t){var n,i=[],r=function(e,t){t=de.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===v&&(t=de.ajaxSettings&&de.ajaxSettings.traditional),de.isArray(e)||e.jquery&&!de.isPlainObject(e))de.each(e,function(){r(this.name,this.value)});else for(n in e)!function a(n,e,i,r){var t;if(de.isArray(e))de.each(e,function(e,t){i||ot.test(n)?r(n,t):a(n+"["+("object"==typeof t?e:"")+"]",t,i,r)});else if(i||"object"!==de.type(e))r(n,e);else for(t in e)a(n+"["+t+"]",e[t],i,r)}(n,e[n],t,r);return i.join("&").replace(at,"+")},de.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,n){de.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),de.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var ct,ht,pt=de.now(),dt=/\?/,ft=/#.*$/,gt=/([?&])_=[^&]*/,mt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,It=/^(?:GET|HEAD)$/,Bt=/^\/\//,_t=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Et=de.fn.load,bt={},yt={},vt="*/".concat("*");try{ht=e.href}catch(Xt){(ht=m.createElement("a")).href="",ht=ht.href}function Tt(a){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,i=0,r=e.toLowerCase().match(T)||[];if(de.isFunction(t))for(;n=r[i++];)"+"===n[0]?(n=n.slice(1)||"*",(a[n]=a[n]||[]).unshift(t)):(a[n]=a[n]||[]).push(t)}}function Ct(t,r,a,o){var s={},l=t===yt;function u(e){var i;return s[e]=!0,de.each(t[e]||[],function(e,t){var n=t(r,a,o);return"string"!=typeof n||l||s[n]?l?!(i=n):void 0:(r.dataTypes.unshift(n),u(n),!1)}),i}return u(r.dataTypes[0])||!s["*"]&&u("*")}function Nt(e,t){var n,i,r=de.ajaxSettings.flatOptions||{};for(i in t)t[i]!==v&&((r[i]?e:n=n||{})[i]=t[i]);return n&&de.extend(!0,e,n),e}ct=_t.exec(ht.toLowerCase())||[],de.fn.load=function(e,t,n){if("string"!=typeof e&&Et)return Et.apply(this,arguments);var i,r,a,o=this,s=e.indexOf(" ");return 0<=s&&(i=e.slice(s,e.length),e=e.slice(0,s)),de.isFunction(t)?(n=t,t=v):t&&"object"==typeof t&&(a="POST"),0<o.length&&de.ajax({url:e,type:a,dataType:"html",data:t}).done(function(e){r=arguments,o.html(i?de("<div>").append(de.parseHTML(e)).find(i):e)}).complete(n&&function(e,t){o.each(n,r||[e.responseText,t,e])}),this},de.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){de.fn[t]=function(e){return this.on(t,e)}}),de.each(["get","post"],function(e,r){de[r]=function(e,t,n,i){return de.isFunction(t)&&(i=i||n,n=t,t=v),de.ajax({url:e,type:r,dataType:i,data:t,success:n})}}),de.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ht,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ct[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":g.String,"text html":!0,"text json":de.parseJSON,"text xml":de.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Nt(Nt(e,de.ajaxSettings),t):Nt(de.ajaxSettings,e)},ajaxPrefilter:Tt(bt),ajaxTransport:Tt(yt),ajax:function(e,t){"object"==typeof e&&(t=e,e=v),t=t||{};var n,i,c,h,p,d,f,r,g=de.ajaxSetup({},t),m=g.context||g,I=g.context&&(m.nodeType||m.jquery)?de(m):de.event,B=de.Deferred(),_=de.Callbacks("once memory"),E=g.statusCode||{},a={},o={},b=0,s="canceled",y={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!r)for(r={};t=mt.exec(h);)r[t[1].toLowerCase()]=t[2];t=r[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?h:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=o[n]=o[n]||e,a[e]=t),this},overrideMimeType:function(e){return b||(g.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)E[t]=[E[t],e[t]];else y.always(e[y.status]);return this},abort:function(e){var t=e||s;return f&&f.abort(t),l(0,t),this}};if(B.promise(y).complete=_.add,y.success=y.done,y.error=y.fail,g.url=((e||g.url||ht)+"").replace(ft,"").replace(Bt,ct[1]+"//"),g.type=t.method||t.type||g.method||g.type,g.dataTypes=de.trim(g.dataType||"*").toLowerCase().match(T)||[""],null==g.crossDomain&&(n=_t.exec(g.url.toLowerCase()),g.crossDomain=!(!n||n[1]===ct[1]&&n[2]===ct[2]&&(n[3]||("http:"===n[1]?80:443))==(ct[3]||("http:"===ct[1]?80:443)))),g.data&&g.processData&&"string"!=typeof g.data&&(g.data=de.param(g.data,g.traditional)),Ct(bt,g,t,y),2===b)return y;for(i in(d=g.global)&&0==de.active++&&de.event.trigger("ajaxStart"),g.type=g.type.toUpperCase(),g.hasContent=!It.test(g.type),c=g.url,g.hasContent||(g.data&&(c=g.url+=(dt.test(c)?"&":"?")+g.data,delete g.data),!1===g.cache&&(g.url=gt.test(c)?c.replace(gt,"$1_="+pt++):c+(dt.test(c)?"&":"?")+"_="+pt++)),g.ifModified&&(de.lastModified[c]&&y.setRequestHeader("If-Modified-Since",de.lastModified[c]),de.etag[c]&&y.setRequestHeader("If-None-Match",de.etag[c])),(g.data&&g.hasContent&&!1!==g.contentType||t.contentType)&&y.setRequestHeader("Content-Type",g.contentType),y.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+vt+"; q=0.01":""):g.accepts["*"]),g.headers)y.setRequestHeader(i,g.headers[i]);if(g.beforeSend&&(!1===g.beforeSend.call(m,y,g)||2===b))return y.abort();for(i in s="abort",{success:1,error:1,complete:1})y[i](g[i]);if(f=Ct(yt,g,t,y)){y.readyState=1,d&&I.trigger("ajaxSend",[y,g]),g.async&&0<g.timeout&&(p=setTimeout(function(){y.abort("timeout")},g.timeout));try{b=1,f.send(a,l)}catch(Xt){if(!(b<2))throw Xt;l(-1,Xt)}}else l(-1,"No Transport");function l(e,t,n,i){var r,a,o,s,l,u=t;2!==b&&(b=2,p&&clearTimeout(p),f=v,h=i||"",y.readyState=0<e?4:0,n&&(s=function(e,t,n){var i,r,a,o,s=e.contents,l=e.dataTypes,u=e.responseFields;for(o in u)o in n&&(t[u[o]]=n[o]);for(;"*"===l[0];)l.shift(),r===v&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){l.unshift(o);break}if(l[0]in n)a=l[0];else{for(o in n){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}i=i||o}a=a||i}if(a)return a!==l[0]&&l.unshift(a),n[a]}(g,y,n)),200<=e&&e<300||304===e?(g.ifModified&&((l=y.getResponseHeader("Last-Modified"))&&(de.lastModified[c]=l),(l=y.getResponseHeader("etag"))&&(de.etag[c]=l)),204===e?(r=!0,u="nocontent"):304===e?(r=!0,u="notmodified"):(u=(r=function(e,t){var n,i,r,a,o={},s=0,l=e.dataTypes.slice(),u=l[0];e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(l[1])for(r in e.converters)o[r.toLowerCase()]=e.converters[r];for(;i=l[++s];)if("*"!==i){if("*"!==u&&u!==i){if(!(r=o[u+" "+i]||o["* "+i]))for(n in o)if((a=n.split(" "))[1]===i&&(r=o[u+" "+a[0]]||o["* "+a[0]])){!0===r?r=o[n]:!0!==o[n]&&(i=a[0],l.splice(s--,0,i));break}if(!0!==r)if(r&&e["throws"])t=r(t);else try{t=r(t)}catch(Xt){return{state:"parsererror",error:r?Xt:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}(g,s)).state,a=r.data,r=!(o=r.error))):(o=u,!e&&u||(u="error",e<0&&(e=0))),y.status=e,y.statusText=(t||u)+"",r?B.resolveWith(m,[a,u,y]):B.rejectWith(m,[y,u,o]),y.statusCode(E),E=v,d&&I.trigger(r?"ajaxSuccess":"ajaxError",[y,g,r?a:o]),_.fireWith(m,[y,u]),d&&(I.trigger("ajaxComplete",[y,g]),--de.active||de.event.trigger("ajaxStop")))}return y},getScript:function(e,t){return de.get(e,v,t,"script")},getJSON:function(e,t,n){return de.get(e,t,n,"json")}}),de.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return de.globalEval(e),e}}}),de.ajaxPrefilter("script",function(e){e.cache===v&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),de.ajaxTransport("script",function(t){if(t.crossDomain){var i,r=m.head||de("head")[0]||m.documentElement;return{send:function(e,n){(i=m.createElement("script")).async=!0,t.scriptCharset&&(i.charset=t.scriptCharset),i.src=t.url,i.onload=i.onreadystatechange=function(e,t){!t&&i.readyState&&!/loaded|complete/.test(i.readyState)||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),i=null,t||n(200,"success"))},r.insertBefore(i,r.firstChild)},abort:function(){i&&i.onload(v,!0)}}}});var Vt=[],St=/(=)\?(?=&|$)|\?\?/;de.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vt.pop()||de.expando+"_"+pt++;return this[e]=!0,e}}),de.ajaxPrefilter("json jsonp",function(e,t,n){var i,r,a,o=!1!==e.jsonp&&(St.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&St.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=de.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(St,"$1"+i):!1!==e.jsonp&&(e.url+=(dt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||de.error(i+" was not called"),a[0]},e.dataTypes[0]="json",r=g[i],g[i]=function(){a=arguments},n.always(function(){g[i]=r,e[i]&&(e.jsonpCallback=t.jsonpCallback,Vt.push(i)),a&&de.isFunction(r)&&r(a[0]),a=r=v}),"script"});var xt,wt,At=0,Lt=g.ActiveXObject&&function(){var e;for(e in xt)xt[e](v,!0)};function kt(){try{return new g.XMLHttpRequest}catch(Xt){}}de.ajaxSettings.xhr=g.ActiveXObject?function(){return!this.isLocal&&kt()||function(){try{return new g.ActiveXObject("Microsoft.XMLHTTP")}catch(Xt){}}()}:kt,wt=de.ajaxSettings.xhr(),de.support.cors=!!wt&&"withCredentials"in wt,(wt=de.support.ajax=!!wt)&&de.ajaxTransport(function(c){var h;if(!c.crossDomain||de.support.cors)return{send:function(e,s){var l,t,u=c.xhr();if(c.username?u.open(c.type,c.url,c.async,c.username,c.password):u.open(c.type,c.url,c.async),c.xhrFields)for(t in c.xhrFields)u[t]=c.xhrFields[t];c.mimeType&&u.overrideMimeType&&u.overrideMimeType(c.mimeType),c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(t in e)u.setRequestHeader(t,e[t])}catch(n){}u.send(c.hasContent&&c.data||null),h=function(e,t){var n,i,r,a;try{if(h&&(t||4===u.readyState))if(h=v,l&&(u.onreadystatechange=de.noop,Lt&&delete xt[l]),t)4!==u.readyState&&u.abort();else{a={},n=u.status,i=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(a.text=u.responseText);try{r=u.statusText}catch(Xt){r=""}n||!c.isLocal||c.crossDomain?1223===n&&(n=204):n=a.text?200:404}}catch(o){t||s(-1,o)}a&&s(n,r,a,i)},c.async?4===u.readyState?setTimeout(h):(l=++At,Lt&&(xt||(xt={},de(g).unload(Lt)),xt[l]=h),u.onreadystatechange=h):h()},abort:function(){h&&h(v,!0)}}});var Dt,Mt,Pt=/^(?:toggle|show|hide)$/,Rt=new RegExp("^(?:([+-])=|)("+d+")([a-z%]*)$","i"),Ht=/queueHooks$/,Ot=[function(t,e,n){var i,r,a,o,s,l,u,c,h,p=this,d=t.style,f={},g=[],m=t.nodeType&&qe(t);n.queue||(null==(c=de._queueHooks(t,"fx")).unqueued&&(c.unqueued=0,h=c.empty.fire,c.empty.fire=function(){c.unqueued||h()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,de.queue(t,"fx").length||c.empty.fire()})}));1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===de.css(t,"display")&&"none"===de.css(t,"float")&&(de.support.inlineBlockNeedsLayout&&"inline"!==it(t.nodeName)?d.zoom=1:d.display="inline-block"));n.overflow&&(d.overflow="hidden",de.support.shrinkWrapBlocks||p.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in e)if(o=e[r],Pt.exec(o)){if(delete e[r],l=l||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){"hidden"in(s=de._data(t,"fxshow")||de._data(t,"fxshow",{}))&&(m=s.hidden),l&&(s.hidden=!m),m?de(t).show():p.done(function(){de(t).hide()}),p.done(function(){var e;for(e in de._removeData(t,"fxshow"),f)de.style(t,e,f[e])});for(r=0;r<a;r++)i=g[r],u=p.createTween(i,m?s[i]:0),f[i]=s[i]||de.style(t,i),i in s||(s[i]=u.start,m&&(u.end=u.start,u.start="width"===i||"height"===i?1:0))}}],Ft={"*":[function(e,t){var n,i,r=this.createTween(e,t),a=Rt.exec(t),o=r.cur(),s=+o||0,l=1,u=20;if(a){if(n=+a[2],"px"!==(i=a[3]||(de.cssNumber[e]?"":"px"))&&s)for(s=de.css(r.elem,e,!0)||n||1;s/=l=l||".5",de.style(r.elem,e,s+i),l!==(l=r.cur()/o)&&1!==l&&--u;);r.unit=i,r.start=s,r.end=a[1]?s+(a[1]+1)*n:n}return r}]};function Yt(){return setTimeout(function(){Dt=v}),Dt=de.now()}function Wt(a,e,t){var n,o,s,i,r=0,l=Ot.length,u=de.Deferred().always(function(){delete c.elem}),c=function(){if(o)return!1;for(var e=Dt||Yt(),t=Math.max(0,h.startTime+h.duration-e),n=1-(t/h.duration||0),i=0,r=h.tweens.length;i<r;i++)h.tweens[i].run(n);return u.notifyWith(a,[h,n,t]),n<1&&r?t:(u.resolveWith(a,[h]),!1)},h=u.promise({elem:a,props:de.extend({},e),opts:de.extend(!0,{specialEasing:{}},t),originalProperties:e,originalOptions:t,startTime:Dt||Yt(),duration:t.duration,tweens:[],createTween:function(e,t){var n=de.Tween(a,h.opts,e,t,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(n),n},stop:function(e){var t=0,n=e?h.tweens.length:0;if(o)return this;for(o=!0;t<n;t++)h.tweens[t].run(1);return e?u.resolveWith(a,[h,e]):u.rejectWith(a,[h,e]),this}}),p=h.props;for(!function(e,t){var n,i,r,a,o;for(r in e)if(i=de.camelCase(r),a=t[i],n=e[r],de.isArray(n)&&(a=n[1],n=e[r]=n[0]),r!==i&&(e[i]=n,delete e[r]),(o=de.cssHooks[i])&&"expand"in o)for(r in n=o.expand(n),delete e[i],n)r in e||(e[r]=n[r],t[r]=a);else t[i]=a}(p,h.opts.specialEasing);r<l;r++)if(n=Ot[r].call(h,a,p,h.opts))return n;return s=h,i=p,de.each(i,function(e,t){for(var n=(Ft[e]||[]).concat(Ft["*"]),i=0,r=n.length;i<r;i++)if(n[i].call(s,e,t))return}),de.isFunction(h.opts.start)&&h.opts.start.call(a,h),de.fx.timer(de.extend(c,{elem:a,anim:h,queue:h.opts.queue})),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always)}function Gt(e,t,n,i,r){return new Gt.prototype.init(e,t,n,i,r)}function jt(e,t){var n,i={height:e},r=0;for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Qe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function Zt(e){return de.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}de.Animation=de.extend(Wt,{tweener:function(e,t){for(var n,i=0,r=(e=de.isFunction(e)?(t=e,["*"]):e.split(" ")).length;i<r;i++)n=e[i],Ft[n]=Ft[n]||[],Ft[n].unshift(t)},prefilter:function(e,t){t?Ot.unshift(e):Ot.push(e)}}),(de.Tween=Gt).prototype={constructor:Gt,init:function(e,t,n,i,r,a){this.elem=e,this.prop=n,this.easing=r||"swing",this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=a||(de.cssNumber[n]?"":"px")},cur:function(){var e=Gt.propHooks[this.prop];return e&&e.get?e.get(this):Gt.propHooks._default.get(this)},run:function(e){var t,n=Gt.propHooks[this.prop];return this.options.duration?this.pos=t=de.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Gt.propHooks._default.set(this),this}},Gt.prototype.init.prototype=Gt.prototype,Gt.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=de.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){de.fx.step[e.prop]?de.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[de.cssProps[e.prop]]||de.cssHooks[e.prop])?de.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Gt.propHooks.scrollTop=Gt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},de.each(["toggle","show","hide"],function(e,i){var r=de.fn[i];de.fn[i]=function(e,t,n){return null==e||"boolean"==typeof e?r.apply(this,arguments):this.animate(jt(i,!0),e,t,n)}}),de.fn.extend({fadeTo:function(e,t,n,i){return this.filter(qe).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(t,e,n,i){var r=de.isEmptyObject(t),a=de.speed(e,n,i),o=function(){var e=Wt(this,de.extend({},t),a);o.finish=function(){e.stop(!0)},(r||de._data(this,"finish"))&&e.stop(!0)};return o.finish=o,r||!1===a.queue?this.each(o):this.queue(a.queue,o)},stop:function(r,e,a){var o=function(e){var t=e.stop;delete e.stop,t(a)};return"string"!=typeof r&&(a=e,e=r,r=v),e&&!1!==r&&this.queue(r||"fx",[]),this.each(function(){var e=!0,t=null!=r&&r+"queueHooks",n=de.timers,i=de._data(this);if(t)i[t]&&i[t].stop&&o(i[t]);else for(t in i)i[t]&&i[t].stop&&Ht.test(t)&&o(i[t]);for(t=n.length;t--;)n[t].elem!==this||null!=r&&n[t].queue!==r||(n[t].anim.stop(a),e=!1,n.splice(t,1));!e&&a||de.dequeue(this,r)})},finish:function(o){return!1!==o&&(o=o||"fx"),this.each(function(){var e,t=de._data(this),n=t[o+"queue"],i=t[o+"queueHooks"],r=de.timers,a=n?n.length:0;for(t.finish=!0,de.queue(this,o,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),e=r.length;e--;)r[e].elem===this&&r[e].queue===o&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<a;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),de.each({slideDown:jt("show"),slideUp:jt("hide"),slideToggle:jt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,i){de.fn[e]=function(e,t,n){return this.animate(i,e,t,n)}}),de.speed=function(e,t,n){var i=e&&"object"==typeof e?de.extend({},e):{complete:n||!n&&t||de.isFunction(e)&&e,duration:e,easing:n&&t||t&&!de.isFunction(t)&&t};return i.duration=de.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in de.fx.speeds?de.fx.speeds[i.duration]:de.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){de.isFunction(i.old)&&i.old.call(this),i.queue&&de.dequeue(this,i.queue)},i},de.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},de.timers=[],de.fx=Gt.prototype.init,de.fx.tick=function(){var e,t=de.timers,n=0;for(Dt=de.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||de.fx.stop(),Dt=v},de.fx.timer=function(e){e()&&de.timers.push(e)&&de.fx.start()},de.fx.interval=13,de.fx.start=function(){Mt=Mt||setInterval(de.fx.tick,de.fx.interval)},de.fx.stop=function(){clearInterval(Mt),Mt=null},de.fx.speeds={slow:600,fast:200,_default:400},de.fx.step={},de.expr&&de.expr.filters&&(de.expr.filters.animated=function(t){return de.grep(de.timers,function(e){return t===e.elem}).length}),de.fn.offset=function(t){if(arguments.length)return t===v?this:this.each(function(e){de.offset.setOffset(this,t,e)});var e,n,i={top:0,left:0},r=this[0],a=r&&r.ownerDocument;return a?(e=a.documentElement,de.contains(e,r)?(typeof r.getBoundingClientRect!==I&&(i=r.getBoundingClientRect()),n=Zt(a),{top:i.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):i):void 0},de.offset={setOffset:function(e,t,n){var i=de.css(e,"position");"static"===i&&(e.style.position="relative");var r,a,o=de(e),s=o.offset(),l=de.css(e,"top"),u=de.css(e,"left"),c={},h=("absolute"===i||"fixed"===i)&&-1<de.inArray("auto",[l,u])?(a=(r=o.position()).top,r.left):(a=parseFloat(l)||0,parseFloat(u)||0);de.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(c.top=t.top-s.top+a),null!=t.left&&(c.left=t.left-s.left+h),"using"in t?t.using.call(e,c):o.css(c)}},de.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===de.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),de.nodeName(e[0],"html")||(n=e.offset()),n.top+=de.css(e[0],"borderTopWidth",!0),n.left+=de.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-de.css(i,"marginTop",!0),left:t.left-n.left-de.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||m.documentElement;e&&!de.nodeName(e,"html")&&"static"===de.css(e,"position");)e=e.offsetParent;return e||m.documentElement})}}),de.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,r){var a=/Y/.test(r);de.fn[t]=function(e){return de.access(this,function(e,t,n){var i=Zt(e);if(n===v)return i?r in i?i[r]:i.document.documentElement[t]:e[t];i?i.scrollTo(a?de(i).scrollLeft():n,a?n:de(i).scrollTop()):e[t]=n},t,e,arguments.length,null)}}),de.each({Height:"height",Width:"width"},function(a,o){de.each({padding:"inner"+a,content:o,"":"outer"+a},function(i,e){de.fn[e]=function(e,t){var n=arguments.length&&(i||"boolean"!=typeof e),r=i||(!0===e||!0===t?"margin":"border");return de.access(this,function(e,t,n){var i;return de.isWindow(e)?e.document.documentElement["client"+a]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+a],i["scroll"+a],e.body["offset"+a],i["offset"+a],i["client"+a])):n===v?de.css(e,t,r):de.style(e,t,n,r)},o,n?e:v,n,null)}})}),BI.jQuery=BI.$=de,g.$=g.$||de,g.jQuery=g.jQuery||de,Qt(700).jQuery&&((Ut=function(){return de}.apply(Kt,[]))===v||(Jt.exports=Ut))}(window)},function(t,e){(function(e){t.exports=e}).call(this,{})},function(e,t){BI.$.extend(BI.$.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}})},function(e,t){var n;BI.jQuery&&((n=BI.jQuery).fn.insets||(n.fn.insets=function(){var e=this.padding(),t=this.border();return{top:e.top,bottom:e.bottom+t.bottom+t.top,left:e.left,right:e.right+t.right+t.left}}),n.fn.bounds||(n.fn.bounds=function(e){var t={hasIgnoredBounds:!0};return e?(isNaN(e.x)||(t.left=e.x),isNaN(e.y)||(t.top=e.y),null!=e.width&&(t.width=e.width-(this.outerWidth(!0)-this.width()),t.width=0<=t.width?t.width:e.width),null!=e.height&&(t.height=e.height-(this.outerHeight(!0)-this.height()),t.height=0<=t.height?t.height:e.height),this.css(t),this):{x:(t=this.position()).left,y:t.top,width:this.outerWidth(),height:this.outerHeight()}}),BI.extend(BI.jQuery.fn,{destroy:function(){this.remove(),!0===BI.isIE()&&(this[0].outerHTML="")},__textKeywordMarked__:function(e,n,t){if(!BI.isKey(n)||100<(e+"").length)return this.html(BI.htmlEncode(e));n+="",n=BI.toUpperCase(n);var i=(e||"")+"";for(t=(t||BI.makeFirstPY(e,{splitChar:""}))+"",t=BI.toUpperCase(t),this.empty();0<t.length&&0<i.length;){var r=BI.toUpperCase(i).indexOf(n),a=t.indexOf(n);if(0<=a&&(a=(a-Math.floor(a/(i.length+1)))%i.length),0<=r&&(r<a||-1===a))this.append(BI.htmlEncode(i.substr(0,r))),this.append(BI.$("<span>").addClass("bi-keyword-red-mark").html(BI.htmlEncode(i.substr(r,n.length)))),i=i.substr(r+n.length),BI.isNotEmptyString(t)&&(t=BI.map(t.split(""),function(e,t){return t.slice(r+n.length)}).join(""));else{if(!(0<=a)){this.append(BI.htmlEncode(i));break}this.append(BI.htmlEncode(i.substr(0,a))),this.append(BI.$("<span>").addClass("bi-keyword-red-mark").html(BI.htmlEncode(i.substr(a,n.length)))),BI.isNotEmptyString(t)&&(t=BI.map(t.split(""),function(e,t){return t.slice(a+n.length)}).join("")),i=i.substr(a+n.length)}}return this},getDomHeight:function(e){var t=BI.$(this).clone();t.appendTo(BI.$(e||"body"));var n=t.height();return t.remove(),n},hasVerticalScroll:function(){return 0<this.height()&&this[0].clientWidth<this[0].offsetWidth},hasHorizonScroll:function(){return 0<this.width()&&this[0].clientHeight<this[0].offsetHeight},getStyle:function(e){var t=this[0],n=void 0;if(_global.getComputedStyle&&(n=_global.getComputedStyle(t,null)))return n.getPropertyValue(BI.hyphenate(e));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(t,null))return n.getPropertyValue(BI.hyphenate(e));if("display"===e)return"none"}return t.currentStyle?"float"===e?t.currentStyle.cssFloat||t.currentStyle.styleFloat:t.currentStyle[BI.camelize(e)]:t.style&&t.style[BI.camelize(e)]},__isMouseInBounds__:function(e){var t=this.get(0).getBoundingClientRect?this.get(0).getBoundingClientRect():this.offset(),n=t.width||this.outerWidth(),i=t.height||this.outerHeight();return!(e.pageX<Math.floor(t.left)||e.pageX>t.left+n||e.pageY<Math.floor(t.top)||e.pageY>t.top+i)},__hasZIndexMask__:function(e){return e&&null!=this.zIndexMask[e]},__buildZIndexMask__:function(e,t){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var n=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:t});return n.element.css({"z-index":e}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:n,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(n),e&&(this.zIndexMask[e]=n),n.element},__releaseZIndexMask__:function(e){if(e&&this.zIndexMask[e])return BI.remove(this.indexMask,this.zIndexMask[e]),void this.zIndexMask[e].destroy();this.indexMask=this.indexMask||[];var t=this.indexMask.pop();t&&t.destroy()}}))},function(e,t){var r;_.extend(BI,{$import:(r={},function(n,e,t){var i;!function(n,i){var e=BI.$("head script, body script");BI.$.each(e,function(e,t){-1!=t.src.indexOf(n)&&(r[n]=!0)});var t=BI.$("head link");BI.$.each(t,function(e,t){-1!=t.href.indexOf(n)&&i&&(r[n]=!1,BI.$(t).remove())})}(n,t),!0!==r[n]&&("css"===e?((i=document.createElement("link")).rel="stylesheet",i.type="text/css",i.href=n,document.getElementsByTagName("head")[0].appendChild(i),r[n]=!0):BI.$.ajax({url:n,dataType:"script",async:!1,cache:!0,complete:function(e,t){"success"==t&&(r[n]=!0)}}))})})},function(e,t){!function(){var e={on:function(e,t,n){return h(this,"on",e,[t,n])&&t&&(this._events||(this._events={}),(this._events[e]||(this._events[e]=[])).push({callback:t,context:n,ctx:n||this})),this},once:function(e,t,n){if(!h(this,"once",e,[t,n])||!t)return this;var i=this,r=_.once(function(){i.off(e,r),t.apply(this,arguments)});return r._callback=t,this.on(e,r,n)},off:function(e,t,n){if(!this._events||!h(this,"off",e,[t,n]))return this;if(!e&&!t&&!n)return this._events=void 0,this;for(var i=e?[e]:_.keys(this._events),r=0,a=i.length;r<a;r++){e=i[r];var o=this._events[e];if(o)if(t||n){for(var s=[],l=0,u=o.length;l<u;l++){var c=o[l];(t&&t!==c.callback&&t!==c.callback._callback||n&&n!==c.context)&&s.push(c)}s.length?this._events[e]=s:delete this._events[e]}else delete this._events[e]}return this},un:function(){this.off.apply(this,arguments)},trigger:function(e){if(!this._events)return this;var t=slice.call(arguments,1);if(!h(this,"trigger",e,t))return this;var n=this._events[e],i=this._events.all;return n&&r(n,t),i&&r(i,arguments),this},fireEvent:function(){this.trigger.apply(this,arguments)},listenTo:function(e,t,n){var i=this._listeningTo||(this._listeningTo={});return n||"object"!=typeof t||(n=this),(i[e._listenId||(e._listenId=_.uniqueId("l"))]=e).on(t,n,this),this},listenToOnce:function(e,t,n){if("object"==typeof t){for(var i in t)this.listenToOnce(e,i,t[i]);return this}if(l.test(t)){for(var r=t.split(l),a=0,o=r.length;a<o;a++)this.listenToOnce(e,r[a],n);return this}if(!n)return this;var s=_.once(function(){this.stopListening(e,t,s),n.apply(this,arguments)});return s._callback=n,this.listenTo(e,t,s)},stopListening:function(e,t,n){var i=this._listeningTo;if(!i)return this;var r=!t&&!n;for(var a in n||"object"!=typeof t||(n=this),e&&((i={})[e._listenId]=e),i)(e=i[a]).off(t,n,this),(r||_.isEmpty(e._events))&&delete this._listeningTo[a];return this}},l=/\s+/,h=function(e,t,n,i){if(!n)return!0;if("object"==typeof n){for(var r in n)e[t].apply(e,[r,n[r]].concat(i));return!1}if(l.test(n)){for(var a=n.split(l),o=0,s=a.length;o<s;o++)e[t].apply(e,[a[o]].concat(i));return!1}return!0},r=function(e,t){var n,i=-1,r=e.length,a=t[0],o=t[1],s=t[2];switch(t.length){case 0:for(;++i<r;)(n=e[i]).callback.call(n.ctx);return;case 1:for(;++i<r;)(n=e[i]).callback.call(n.ctx,a);return;case 2:for(;++i<r;)(n=e[i]).callback.call(n.ctx,a,o);return;case 3:for(;++i<r;)(n=e[i]).callback.call(n.ctx,a,o,s);return;default:for(;++i<r;)(n=e[i]).callback.apply(n.ctx,t);return}},t=BI.Router=function(e){(e=e||{}).routes&&(this.routes=e.routes),this._bindRoutes(),this._init.apply(this,arguments)},n=/\((.*?)\)/g,i=/(\(\?)?:\w+/g,a=/\*\w+/g,o=/[\-{}\[\]+?.,\\\^$|#\s]/g;_.extend(t.prototype,e,{_init:function(){},route:function(n,i,r){_.isRegExp(n)||(n=this._routeToRegExp(n)),_.isFunction(i)&&(r=i,i=""),r=r||this[i];var a=this;return BI.history.route(n,function(e){var t=a._extractParameters(n,e);!1!==a.execute(r,t,i)&&(a.trigger.apply(a,["route:"+i].concat(t)),a.trigger("route",i,t),BI.history.trigger("route",a,i,t))}),this},execute:function(e,t,n){e&&e.apply(this,t)},navigate:function(e,t){return BI.history.navigate(e,t),this},_bindRoutes:function(){if(this.routes){this.routes=_.result(this,"routes");for(var e,t=_.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(o,"\\$&").replace(n,"(?:$1)?").replace(i,function(e,t){return t?e:"([^/?]+)"}).replace(a,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var n=e.exec(t).slice(1);return _.map(n,function(e,t){return t===n.length-1?e||null:e?decodeURIComponent(e):null})}});var s=function(){this.handlers=[],this.checkUrl=_.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=_global.location,this.history=_global.history)},u=/^[#\/]|\s+$/g,c=/^\/+|\/+$/g,p=/#.*$/;s.started=!1,_.extend(s.prototype,e,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=decodeURI(this.location.pathname+this.getSearch()),t=this.root.slice(0,-1);return e.indexOf(t)||(e=e.slice(t.length)),"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._hasPushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(u,"")},start:function(e){if(s.started)throw new Error("BI.history has already been started");if(s.started=!0,this.options=_.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState),this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(c,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}var n,i;this._hasHashChange||!this._wantsHashChange||this._wantsPushState&&this._hasPushState||((n=document.createElement("iframe")).src="javascript:0",n.style.display="none",n.tabIndex=-1,i=document.body,this.iframe=i.insertBefore(n,i.firstChild).contentWindow,this.iframe.document.open().close(),this.iframe.location.hash="#"+this.fragment);var r=_global.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._hasPushState?r("popstate",this.checkUrl,!1):this._wantsHashChange&&this._hasHashChange&&!this.iframe?r("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=_global.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._hasPushState?e("popstate",this.checkUrl,!1):this._wantsHashChange&&this._hasHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe.frameElement),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),s.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},unRoute:function(t){var e=_.findIndex(this.handlers,function(e){return e.route.test(t)});-1<e&&this.handlers.splice(e,1)},checkUrl:function(e){var t=this.getFragment();try{t=decodeURIComponent(t)}catch(e){}if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(t){return t=this.fragment=this.getFragment(t),_.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0})},navigate:function(e,t){if(!s.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+e;if(e=decodeURI(e.replace(p,"")),this.fragment!==e){if(this.fragment=e,this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe)&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){var i;n?(i=e.href.replace(/(javascript:|#).*$/,""),e.replace(i+"#"+t)):e.hash="#"+t}}),BI.history=new s}()},function(e,t){!function(p){var e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],d=Array.prototype.slice,f,g;if(p.event.fixHooks){for(var n=e.length;n;){p.event.fixHooks[e[--n]]=p.event.mouseHooks}}var m=p.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener){for(var e=t.length;e;){this.addEventListener(t[--e],i,false)}}else{this.onmousewheel=i}},teardown:function(){if(this.removeEventListener){for(var e=t.length;e;){this.removeEventListener(t[--e],i,false)}}else{this.onmousewheel=null}},settings:{adjustOldDeltas:true,normalizeOffset:true}};function i(e){var t=e||_global.event,n=d.call(arguments,1),i=0,r=0,a=0,o=0,s=0,l=0;e=p.event.fix(t);e.type="mousewheel";if("detail"in t){a=t.detail*-1}if("wheelDelta"in t){a=t.wheelDelta}if("wheelDeltaY"in t){a=t.wheelDeltaY}if("wheelDeltaX"in t){r=t.wheelDeltaX*-1}if("axis"in t&&t.axis===t.HORIZONTAL_AXIS){r=a*-1;a=0}i=a===0?r:a;if("deltaY"in t){a=t.deltaY*-1;i=a}if("deltaX"in t){r=t.deltaX;if(a===0){i=r*-1}}if(a===0&&r===0){return}if(t.deltaMode===1){var u=40;i*=u;a*=u;r*=u}else if(t.deltaMode===2){var c=800;i*=c;a*=c;r*=c}o=Math.max(Math.abs(a),Math.abs(r));if(!g||o<g){g=o;if(B(t,o)){g/=40}}if(B(t,o)){i/=40;r/=40;a/=40}i=Math[i>=1?"floor":"ceil"](i/g);r=Math[r>=1?"floor":"ceil"](r/g);a=Math[a>=1?"floor":"ceil"](a/g);if(m.settings.normalizeOffset&&this.getBoundingClientRect){var h=this.getBoundingClientRect();s=e.clientX-h.left;l=e.clientY-h.top}e.deltaX=r;e.deltaY=a;e.deltaFactor=g;e.offsetX=s;e.offsetY=l;e.deltaMode=0;n.unshift(e,i,r,a);if(f){clearTimeout(f)}f=setTimeout(I,200);return(p.event.dispatch||p.event.handle).apply(this,n)}function I(){g=null}function B(e,t){return m.settings.adjustOldDeltas&&e.type==="mousewheel"&&t%120===0}p.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(BI.jQuery)},function(e,t){BI.TreeView=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-tree",paras:{selectedValues:{}},itemsCreator:BI.emptyFn})},_init:function(){BI.TreeView.superclass._init.apply(this,arguments);var e=this.options;this._stop=!1,this._createTree(),this.tip=BI.createWidget({type:"bi.loading_bar",invisible:!0,handler:BI.bind(this._loadMore,this)}),BI.createWidget({type:"bi.vertical",scrollable:!0,scrolly:!1,element:this,items:[this.tip]}),BI.isNotNull(e.value)&&this.setSelectedValue(e.value),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")},_createTree:function(){this.id="bi-tree"+BI.UUID(),this.nodes&&this.nodes.destroy(),this.tree&&this.tree.destroy(),this.tree=BI.createWidget({type:"bi.layout",element:"<ul id='"+this.id+"' class='ztree'></ul>"}),BI.createWidget({type:"bi.default",element:this.element,items:[this.tree]})},_selectTreeNode:function(e,t){this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,t,this),this.fireEvent(BI.TreeView.EVENT_CHANGE,t,this)},_configSetting:function(){var e=this.options.paras,o=this,t={async:{enable:!0,url:function(e,t){var n=o._getParentValues(t);return t.times=t.times||1,"&id="+t.id+"&times="+t.times+++"&parentValues= "+_global.encodeURIComponent(BI.jsonEncode(n))+"&checkState="+_global.encodeURIComponent(BI.jsonEncode(t.getCheckStatus()))},autoParam:["id","name"],otherParam:BI.cjkEncodeDO(e)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeExpand:function(e,t){if(t.isAjaxing)return BI.Msg.toast("Please Wait。","warning"),!1;t.children||(t.times=1,l(t,"refresh"));return!0},onAsyncSuccess:function(e,t,n,i){if(n.halfCheck=!1,!i||0===i.length||/^<html>[\s,\S]*<\/html>$/gi.test(i)||o._stop)return;var r=o.nodes,a=n.count||0;n.children.length>a?(n.count=n.children.length,BI.delay(function(){l(n)},s)):(r.updateNode(n),r.selectNode(n.children[0]))},onAsyncError:function(e,t,n,i,r,a){o.nodes;BI.Msg.toast("Error!","warning")},beforeCheck:function(e,t){var n=t.getCheckStatus();{var i;!(t.halfCheck=!1)===t.checked&&(function r(e){BI.each(e,function(e,t){!0===t.halfCheck&&(t.halfCheck=!1,r(t.children))})}(t.children),i=o.nodes.getSelectedNodes(),BI.$.each(i,function(e,t){t.halfCheck=!1}))}!0===n.half&&!0===n.checked&&(t.checked=!1)},onCheck:function(e,t,n){o._selectTreeNode(t,n)},onExpand:function(e,t,n){n.halfCheck=!1},onCollapse:function(e,t,n){},onClick:function(e,t,n){var i=n.checked,r=n.getCheckStatus();!0===r.half&&!0===r.checked&&(i=!1);o.nodes.checkNode(n,!i,!0,!0)}}},s=100;function l(e,t){var n=o.nodes;"refresh"==t&&n.updateNode(e),n.reAsyncChildNodes(e,t,!0)}return t},_getParentValues:function(e){if(!e.getParentNode())return[];var t=e.getParentNode();return this._getParentValues(t).concat([this._getNodeValue(t)])},_getNodeValue:function(e){return null==e.value?BI.replaceAll(e.text.replace(/<[^>]+>/g,""),"&nbsp;"," "):e.value},_getHalfSelectedValues:function(n,e){var t,i,r,a,o,s=this,l=e.getCheckStatus();!1===l.checked&&!1===l.half||(BI.isNotEmptyArray(e.children)&&!0===l.half?(t=e.children,BI.each(t,function(e,t){s._getHalfSelectedValues(n,t)})):(r=(i=e.parentValues||s._getParentValues(e)).concat(this._getNodeValue(e)),BI.isNotEmptyArray(e.children)||!1===l.half?this._buildTree(n,r):(a=BI.deepClone(this.options.paras.selectedValues),o=this._getTree(a,r),this._addTreeNode(n,i,this._getNodeValue(e),o))))},_getTree:function(e,t){var n=e;return BI.any(t,function(e,t){return null==n[t]||void(n=n[t])}),n},_addTreeNode:function(e,t,n,i){var r=e;BI.each(t,function(e,t){null==r[t]&&(r[t]={}),r=r[t]}),r[n]=i},_buildTree:function(e,t){var n=e;BI.each(t,function(e,t){null==n[t]&&(n[t]={}),n=n[t]})},_getSelectedValues:function(){var e,r=this,a={},t=this.nodes.getNodes();return e=t,BI.each(e,function(e,t){var n,i=t.getCheckStatus();!0!==i.checked&&!0!==i.half||(!0===i.half?r._getHalfSelectedValues(a,t):(n=(t.parentValues||r._getParentValues(t)).concat([r._getNodeValue(t)]),r._buildTree(a,n)))}),a},_dealWidthNodes:function(e){var n=this.options,t=BI.Tree.arrayFormat(e);return BI.each(t,function(e,t){t.title=t.title||t.text||t.value,t.isParent=t.isParent||t.parent,BI.isKey(n.paras.keyword)?t.text=BI.$("<div>").__textKeywordMarked__(t.text,n.paras.keyword,t.py).html():t.text=BI.htmlEncode(t.text+"")}),e},_loadMore:function(){var i=this,e=this.options;this.tip.setLoading();var t=BI.extend({},e.paras,{times:++this.times});e.itemsCreator(t,function(e){var t,n;!0!==i._stop&&(t=!!e.hasNext,n=e.items||[],t?i.tip.setLoaded():i.tip.setEnd(),0<n.length&&i.nodes.addNodes(null,i._dealWidthNodes(n)))})},_initTree:function(r){var a=this,e=this.options;a.fireEvent(BI.Events.INIT),this.times=1;var o=this.tree;o.empty(),this.loading(),this.tip.setVisible(!1);var s=BI.extend({},e.paras,{times:1});e.itemsCreator(s,function(e){var t,n,i;!0!==a._stop&&(t=!!e.hasNext,0<(n=e.items||[]).length&&(i=a._dealWidthNodes(n),!0!==a._stop&&(a.nodes=BI.$.fn.zTree.init(o.element,r,i))),a.setTipVisible(n.length<=0),a.loaded(),t?a.tip.setLoaded():a.tip.invisible(),1===s.times&&a.fireEvent(BI.Events.AFTERINIT))})},initTree:function(e,t){t=t||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=BI.$.fn.zTree.init(this.tree.element,t,e)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(e){delete this.options.keyword,BI.extend(this.options.paras,e);var t=this._configSetting();this._createTree(),this.start(),this._initTree(t)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){return 0<this.nodes.getCheckedNodes(!0).length},checkAll:function(e){this.nodes&&(BI.each(this.nodes.getNodes(),function(e,t){t.halfCheck=!1,function n(e){BI.each(e,function(e,t){t.halfCheck=!1,n(t.children)})}(t.children)}),this.nodes.checkAllNodes(e))},expandAll:function(e){this.nodes&&this.nodes.expandAll(e)},setValue:function(e,t){this.checkAll(!1),this.updateValue(e,t),this.refresh()},setSelectedValue:function(e){this.options.paras.selectedValues=BI.deepClone(e||{})},updateValue:function(e,i){var r;this.nodes&&(i=i||"value",r=this.nodes,BI.each(e,function(e,n){var t=r.getNodesByParam(i,e,null);BI.each(t,function(e,t){BI.extend(t,{checked:!0},n),r.updateNode(t)})}))},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&this.nodes.destroy()}}),BI.extend(BI.TreeView,{REQ_TYPE_INIT_DATA:1,REQ_TYPE_ADJUST_DATA:2,REQ_TYPE_SELECT_DATA:3,REQ_TYPE_GET_SELECTED_DATA:4}),BI.TreeView.EVENT_CHANGE="EVENT_CHANGE",BI.TreeView.EVENT_INIT=BI.Events.INIT,BI.TreeView.EVENT_AFTERINIT=BI.Events.AFTERINIT,BI.shortcut("bi.tree_view",BI.TreeView)},function(e,t){BI.AsyncTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.AsyncTree.superclass._init.apply(this,arguments);var t=this;this.service=new BI.TreeRenderPageService({subNodeListGetter:function(e){return BI.$("#"+t.id+" #"+e+"_ul")}})},_configSetting:function(){var e=this.options.paras,i=this;return{async:{enable:!1,otherParam:BI.cjkEncodeDO(e)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeCheck:function(e,t){var n=t.getCheckStatus();{var i;!(t.halfCheck=!1)===t.checked&&(function r(e){BI.each(e,function(e,t){t.halfCheck=!1,r(t.children)})}(t.children),i=BI.$.fn.zTree.getZTreeObj(e).getSelectedNodes(),BI.each(i,function(e,t){t.halfCheck=!1}))}!0===n.half&&!0===n.checked&&(t.checked=!1)},onCheck:function(e,t,n){i._selectTreeNode(t,n)},beforeExpand:function(e,t){i._beforeExpandNode(e,t)},onExpand:function(e,t,n){n.halfCheck=!1},onCollapse:function(e,t,n){n.halfCheck=!1},onClick:function(e,t,n){var i=BI.$.fn.zTree.getZTreeObj(t),r=n.checked,a=n.getCheckStatus();!0===a.half&&!0===a.checked&&(r=!1);i.checkNode(n,!r,!0,!0)}}}},_selectTreeNode:function(e,t){this.options;var n=BI.deepClone(t.parentValues||this._getParentValues(t)),i=this._getNodeValue(t);if(!0===t.checked)this._addTreeNode(this.options.paras.selectedValues,n,i,{});else{var r=t,a=this._getTree(this.options.paras.selectedValues,n);for(BI.isNotNull(a[i])&&delete a[i];null!=r&&BI.isEmpty(a);)n=n.slice(0,n.length-1),null!=(r=r.getParentNode())&&delete(a=this._getTree(this.options.paras.selectedValues,n))[i=this._getNodeValue(r)];this.options.paras.selectedValues=this._getJoinValue()}BI.AsyncTree.superclass._selectTreeNode.apply(this,arguments)},_beforeExpandNode:function(e,r){var a=this,i=this.options,o=function(e){var t,n,i=e.items||[];0<i.length&&(t=a._dealWidthNodes(i),n=!!e.hasNext,a.nodes.addNodes(r,t),n?a.service.pushNodeList(r.tId,s):a.service.removeNodeList(r.tId))};function s(e){e=e||{};var t=r.parentValues||a._getParentValues(r),n=BI.extend({},i.paras,{id:r.id,times:e.times,parentValues:t.concat(a._getNodeValue(r)),checkState:r.getCheckStatus()},e);i.itemsCreator(n,o)}var t=r.getCheckStatus();r.children||setTimeout(function(){s({times:1,checkState:t})},17)},_join:function(e,t){var a=this,o={};function s(n,i,r){BI.each(i,function(e,t){BI.isNull(r[e])||BI.isEmpty(r[e])?a._addTreeNode(o,n,e,t):s(n.concat([e]),i[e],r[e])})}return s([],e,t),s([],t,e),o},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.AsyncTree.superclass.hasChecked.apply(this,arguments)},_getJoinValue:function(){if(!this.nodes)return{};var e=this._getSelectedValues();return BI.isEmpty(e)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?e:this._join(e,this.options.paras.selectedValues)},getValue:function(){return this._getJoinValue()},stroke:function(e){delete this.options.keyword,this.service.clear(),BI.extend(this.options.paras,e);var t=this._configSetting();this._initTree(t)}}),BI.shortcut("bi.async_tree",BI.AsyncTree)},function(e,t){BI.PartTree=BI.inherit(BI.AsyncTree,{_defaultConfig:function(){return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.PartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var i=this,r=this.options,e=BI.extend({},r.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),r.itemsCreator(e,function(e){var t=!!e.hasNext,n=e.items||[];r.paras.lastSearchValue=e.lastSearchValue,!0!==i._stop&&(t?i.tip.setLoaded():i.tip.setEnd(),0<n.length&&i.nodes.addNodes(null,i._dealWidthNodes(n)))})},_selectTreeNode:function(e,t){var n=this,i=this.options,r=BI.deepClone(t.parentValues||n._getParentValues(t)),a=this._getNodeValue(t);if(!0===t.checked)this.options.paras.selectedValues=this._getUnionValue(),i.itemsCreator(BI.extend({},i.paras,{type:BI.TreeView.REQ_TYPE_ADJUST_DATA,curSelectedValue:a,parentValues:r}),function(e){n.options.paras.selectedValues=e,BI.AsyncTree.superclass._selectTreeNode.apply(n,arguments)});else{for(var o=this.options.paras.selectedValues,s=r.concat(a),l=0,u=s.length;l<u;l++){if(null==(o=o[s[l]]))return;if(BI.isEmpty(o))break}i.itemsCreator(BI.extend({},i.paras,{type:BI.TreeView.REQ_TYPE_SELECT_DATA,notSelectedValue:a,parentValues:r}),function(e){n.options.paras.selectedValues=e,BI.AsyncTree.superclass._selectTreeNode.apply(n,arguments)})}},_getSelectedValues:function(){var a=this,o={};return function s(e){BI.each(e,function(e,t){var n=t.getCheckStatus();if(!1===n.checked)return!0;var i=t.parentValues||a._getParentValues(t),r=i.concat([a._getNodeValue(t)]);if(a._buildTree(o,r),BI.isNotEmptyArray(t.children))return s(t.children),!0;!0===n.half&&a._getHalfSelectedValues(o,t)})}(this.nodes.getNodes()),o},_initTree:function(i,r){var a=this,o=this.options;this.times=1;var s=this.tree;s.empty(),a.tip.setVisible(!1),this.loading();var e=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:this.times}),t=function(e){var t,n;!0!==a._stop&&r==o.paras.keyword&&(t=!!e.hasNext,n=e.items||[],o.paras.lastSearchValue=e.lastSearchValue,function(e){if(!0===a._stop)return;a.nodes=BI.$.fn.zTree.init(s.element,i,e)}(0<n.length?a._dealWidthNodes(n):[]),a.setTipVisible(n.length<=0),a.loaded(),t?a.tip.setLoaded():a.tip.invisible(),a.fireEvent(BI.Events.AFTERINIT))};BI.delay(function(){o.itemsCreator(e,t)},100)},getValue:function(){return BI.deepClone(this.options.paras.selectedValues||{})},_getUnionValue:function(){if(!this.nodes)return{};var e=this._getSelectedValues();return BI.isEmpty(e)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?e:this._union(e,this.options.paras.selectedValues)},_union:function(e,t){var a=this,o={};function s(n,i,r){BI.each(i,function(e,t){BI.isNull(r[e])?a._addTreeNode(o,n,e,t):BI.isEmpty(r[e])?a._addTreeNode(o,n,e,{}):s(n.concat([e]),i[e],r[e])})}return s([],e,t),s([],t,e),o},stroke:function(e){var t=this.options;delete t.paras.keyword,BI.extend(t.paras,e),delete t.paras.lastSearchValue;var n=this._configSetting();this._initTree(n,t.paras.keyword)}}),BI.shortcut("bi.part_tree",BI.PartTree)},function(e,t){BI.ListTreeView=BI.inherit(BI.TreeView,{_constants:{SPLIT:"<|>"},_defaultConfig:function(){return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this,arguments),{value:{}})},_init:function(){BI.ListTreeView.superclass._init.apply(this,arguments);var e=this.options;BI.isNotNull(e.value)&&this.setSelectedValue(e.value)},_configSetting:function(){this.options.paras;var a=this;return{async:{enable:!1},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:function(e,t,n){a._selectTreeNode(t,n)},onClick:function(e,t,n){var i=BI.$.fn.zTree.getZTreeObj(t),r=n.checked;a._checkValue(n,!r),i.checkNode(n,!r,!0,!0)}}}},_selectTreeNode:function(e,t){this._checkValue(t,t.checked),BI.ListTreeView.superclass._selectTreeNode.apply(this,arguments)},_transArrayToMap:function(e){var i=this,r={};return BI.each(e,function(e,t){var n=t.join(i._constants.SPLIT);r[n]=!0}),r},_transMapToArray:function(e){var n=this,i=[];return BI.each(e,function(e){var t=e.split(n._constants.SPLIT);i.push(t)}),i},_checkValue:function(e,t){var n=BI.concat(this._getParentValues(e),this._getNodeValue(e)).join(this._constants.SPLIT);t?this.storeValue[n]=!0:delete this.storeValue[n]},setSelectedValue:function(e){this.options.paras.selectedValues=e||[],this.storeValue=this._transArrayToMap(e)},getValue:function(){return this._transMapToArray(this.storeValue)}}),BI.shortcut("bi.list_tree_view",BI.ListTreeView)},function(e,t){BI.ListAsyncTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListAsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListAsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){var e=this.options.paras,a=this;return{async:{enable:!1,otherParam:BI.cjkEncodeDO(e)},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:function(e,t,n){a._selectTreeNode(t,n)},beforeExpand:function(e,t){a._beforeExpandNode(e,t)},beforeCheck:function(e,t){t.half=!1},onClick:function(e,t,n){var i=BI.$.fn.zTree.getZTreeObj(t),r=n.checked;a._checkValue(n,!r),i.checkNode(n,!r,!0,!0)}}}},_beforeExpandNode:function(e,r){var a=this,o=this.options,t=r.parentValues||a._getParentValues(r),s=BI.extend({},o.paras,{id:r.id,times:1,parentValues:t.concat(this._getNodeValue(r))}),l=function(e){var t,n,i=e.items||[];0<i.length&&(t=a._dealWidthNodes(i),n=!!e.hasNext,a.nodes.addNodes(r,t),!0===n&&BI.delay(function(){u++,s.times=u,o.itemsCreator(s,l)},100))},u=1;r.children||setTimeout(function(){o.itemsCreator(s,l)},17)},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.ListAsyncTree.superclass.hasChecked.apply(this,arguments)},stroke:function(e){delete this.options.keyword,BI.extend(this.options.paras,e);var t=this._configSetting();this._initTree(t)}}),BI.shortcut("bi.list_async_tree",BI.ListAsyncTree)},function(e,t){BI.ListPartTree=BI.inherit(BI.ListAsyncTree,{_defaultConfig:function(){return BI.extend(BI.ListPartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListPartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var i=this,r=this.options,e=BI.extend({},r.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),r.itemsCreator(e,function(e){var t=!!e.hasNext,n=e.items||[];r.paras.lastSearchValue=e.lastSearchValue,!0!==i._stop&&(t?i.tip.setLoaded():i.tip.setEnd(),0<n.length&&i.nodes.addNodes(null,i._dealWidthNodes(n)))})},_initTree:function(i,r){var a=this,o=this.options;this.times=1;var s=this.tree;s.empty(),a.tip.setVisible(!1),this.loading();var e=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:this.times}),t=function(e){var t,n;!0!==a._stop&&r==o.paras.keyword&&(t=!!e.hasNext,n=e.items||[],o.paras.lastSearchValue=e.lastSearchValue,function(e){if(!0===a._stop)return;a.nodes=BI.$.fn.zTree.init(s.element,i,e)}(0<n.length?a._dealWidthNodes(n):[]),a.setTipVisible(n.length<=0),a.loaded(),t?a.tip.setLoaded():a.tip.invisible(),a.fireEvent(BI.Events.AFTERINIT))};BI.delay(function(){o.itemsCreator(e,t)},100)},stroke:function(e){var t=this.options;delete t.paras.keyword,BI.extend(t.paras,e),delete t.paras.lastSearchValue;var n=this._configSetting();this._initTree(n,t.paras.keyword)}}),BI.shortcut("bi.list_part_tree",BI.ListPartTree)},function(module,exports){!function(document){var F=(XHc=function(e){return this[e]},function(e){var t=e.files||[e];return t.item||(t.item=XHc),t}),XHc,event={add:document.addEventListener?function(e,t,n){return e.addEventListener(t,n,!1),this}:function(e,t,n){return e.attachEvent("on"+t,n),this},del:document.removeEventListener?function(e,t,n){return e.removeEventListener(t,n,!1),this}:function(e,t,n){return e.detachEvent("on"+t,n),this},stop:function(e){return e?(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1):self.event&&(event.returnValue=!(event.cancelBubble=!0)),!1}},sendFile=function(toString){var multipart=function(e,t,n){return"--".concat(e,CRLF,'Content-Disposition: form-data; name="',t,'"; filename="',_global.encodeURIComponent(n.fileName),'"',CRLF,"Content-Type: application/octet-stream",CRLF,CRLF,n.getAsBinary(),CRLF,"--",e,"--",CRLF)},isFunction=function(e){return"[object Function]"===toString.call(e)},split="onabort.onerror.onloadstart.onprogress".split("."),length=split.length,CRLF="\r\n",xhr=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),sendFile,sendFile=xhr.upload||xhr.sendAsBinary?function(n,e,t,i){if(!(-1<e&&e<n.file.fileSize)){for(var r,a=new XMLHttpRequest,o=a.upload||{addEventListener:function(e,t){this["on"+e]=t}},s=0;s<length;s++)o.addEventListener(split[s].substring(2),function(t){return function(e){isFunction(n[t])&&n[t](e,a)}}(split[s]),!1);o.addEventListener("load",function(e){!1===n.onreadystatechange?isFunction(n.onload)&&n.onload(e,a):setTimeout(function(){4===a.readyState?isFunction(n.onload)&&n.onload(e,a):setTimeout(arguments.callee,15)},15)},!1),a.open("post",n.url+"&filename="+_global.encodeURIComponent(n.file.fileName),!0),a.upload?(a.onreadystatechange=function(){switch(a.readyState){case 4:var e=BI.jsonDecode(a.responseText);-1!=n.file.type.indexOf("image")&&(e.attach_type="image"),e.filename=n.file.fileName,1==n.maxlength?n.attach_array[0]=e:n.attach_array.push(e)}},isFunction(o.onloadstart)&&o.onloadstart()):((r={loaded:0,total:n.file.fileSize||n.file.size,simulation:!0}).interval=setInterval(function(){r.loaded+=256,r.total<=r.loaded&&(r.loaded=r.total),o.onprogress(r)},100),a.onabort=function(){o.onabort({})},a.onerror=function(){o.onerror({})},a.onreadystatechange=function(){switch(a.readyState){case 2:case 3:r.total<=r.loaded&&(r.loaded=r.total),o.onprogress(r);break;case 4:var e;clearInterval(r.interval),r.interval=0,r.loaded=r.total,o.onprogress(r),199<a.status&&a.status<400?(o.onload({}),(e=BI.jsonDecode(a.responseText)).filename=n.file.fileName,-1!=n.file.type.indexOf("image")&&(e.attach_type="image"),n.attach_array.push(e)):o.onerror({})}},o.onloadstart(r));var l,u="AjaxUploadBoundary"+(new Date).getTime();return a.setRequestHeader("Content-Type","multipart/form-data; boundary="+u),n.file.getAsBinary?a[a.sendAsBinary?"sendAsBinary":"send"](multipart(u,n.name,n.file)):(a.setRequestHeader("Content-Type","multipart/form-data"),(l=new FormData).append("FileData",n.file),a.send(l)),n}isFunction(n.onerror)&&n.onerror()}:function(handler,maxSize,width,height){var url=handler.url.concat(-1===handler.url.indexOf("?")?"?":"&","AjaxUploadFrame=true"),rpe={loaded:1,total:100,simulation:!0,interval:setInterval(function(){rpe.loaded<rpe.total&&++rpe.loaded,isFunction(handler.onprogress)&&handler.onprogress(rpe,{})},100)},onload=function(){iframe.onreadystatechange=iframe.onload=iframe.onerror=null,form.parentNode.removeChild(form),form=null,clearInterval(rpe.interval);try{var e=(iframe.contentWindow.document||iframe.contentWindow.contentDocument).body.innerHTML,t=BI.jsonDecode(e);-1!=handler.file.type.indexOf("image")&&(t.attach_type="image");try{t.filename=_global.decodeURIComponent(handler.file.fileName)}catch(n){t.filename=handler.file.fileName}1==handler.maxlength?handler.attach_array[0]=t:handler.attach_array.push(t)}catch(n){isFunction(handler.onerror)&&handler.onerror(rpe,event||_global.event)}isFunction(handler.onload)&&handler.onload(rpe,{responseText:e})},target=["AjaxUpload",(new Date).getTime(),String(Math.random()).substring(2)].join("_");try{var form=document.createElement('<form enctype="multipart/form-data"></form>'),iframe=handler.iframe||(handler.iframe=document.createElement('<iframe id="'+target+'" name="'+target+'" src="'+url+'"></iframe>'))}catch(e){var form=document.createElement("form"),iframe=handler.iframe||(handler.iframe=document.createElement("iframe"));form.setAttribute("enctype","multipart/form-data"),iframe.setAttribute("name",iframe.id=target),iframe.setAttribute("src",url)}with(iframe.style.position="absolute",iframe.style.left=iframe.style.top="-10000px",iframe.onload=onload,iframe.onerror=function(e){isFunction(handler.onerror)&&handler.onerror(rpe,e||_global.event)},iframe.onreadystatechange=function(){/loaded|complete/i.test(iframe.readyState)?onload():isFunction(handler.onloadprogress)&&(rpe.loaded<rpe.total&&++rpe.loaded,handler.onloadprogress(rpe,{readyState:{loading:2,interactive:3,loaded:4,complete:4}[iframe.readyState]||1}))},form.setAttribute("action",handler.url+"&filename="+_global.encodeURIComponent(handler.file.fileName)),form.setAttribute("target",iframe.id),form.setAttribute("method","post"),form.appendChild(handler.file),form.style.display="none",isFunction(handler.onloadstart)&&handler.onloadstart(rpe,{}),document.body||document.documentElement)appendChild(iframe),appendChild(form),form.submit();return handler},xhr=null;return sendFile}(Object.prototype.toString),sendFiles=function(i,r,a,o){var s=i.files.length,l=i.onload,u=i.onloadstart;for(i.current=0,i.total=0,i.sent=0;i.current<s;)i.total+=i.files[i.current].fileSize||i.files[i.current].size,i.current++;return i.current=0,s&&-1!==i.files[0].fileSize?(i.file=i.files[i.current],sendFile(i,r,a,o).onload=function(e,t){i.onloadstart=null,i.sent+=i.files[i.current].fileSize||i.files[i.current].size,++i.current<s?(i.file=i.files[i.current],sendFile(i,r,a,o).onload=arguments.callee):l&&(i.onloadstart=u,i.onload=l,i.onload(e,t))}):s&&(i.total=100*s,i.file=i.files[i.current],sendFile(i,r,a,o).onload=function(e,t){var n=arguments.callee;i.onloadstart=null,i.sent+=100,++i.current<s?(/\b(chrome|safari)\b/i.test(navigator.userAgent)&&(i.iframe.parentNode.removeChild(i.iframe),i.iframe=null),setTimeout(function(){i.file=i.files[i.current],sendFile(i,r,a,o).onload=n},15)):l&&setTimeout(function(){i.iframe.parentNode.removeChild(i.iframe),i.iframe=null,i.onloadstart=u,i.onload=l,i.onload(e,t)},15)}),i};BI.File=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.File.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-file display-block",tagName:"input",attributes:{type:"file"},name:"",url:"",multiple:!0,accept:"",maxSize:-1})},_init:function(){var e=this.options;BI.File.superclass._init.apply(this,arguments),!0===e.multiple&&this.element.attr("multiple","multiple"),this.element.attr("name",e.name||this.getName()),this.element.attr("title",e.title||"")},created:function(){var i=this,e=this.options,r=this.wrap=this._wrap(this.element[0],e.maxSize);r.onloadstart=function(e,t){i.fireEvent(BI.File.EVENT_UPLOADSTART,arguments)},r.onprogress=function(e,t){-1!==this.file.fileSize&&e.simulation,i.fireEvent(BI.File.EVENT_PROGRESS,{file:this.file,total:e.total,loaded:e.loaded,simulation:e.simulation})},r.onerror=function(){i.fireEvent(BI.File.EVENT_ERROR)},r.onload=function(e,t){var n=this;setTimeout(function(){return n.clean(),n.hide(),t.status<200||399<t.status?(BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"),{level:"error"}),void i.fireEvent(BI.File.EVENT_ERROR)):void(BI.some(r.attach_array,function(e,t){if(t.errorCode)return BI.Msg.toast(t.errorMsg,{level:"error"}),i.fireEvent(BI.File.EVENT_ERROR,t),!0})||i.fireEvent(BI.File.EVENT_UPLOADED))},1e3)},r.url=e.url,r.fileType=e.accept,r.attach_array=[],r.attach_names=[],r.attachNum=0},_events:function(l){var u=this;return event.add(l.dom.input,"change",function(){event.del(l.dom.input,"change",arguments.callee);for(var e=l.dom.input.cloneNode(!0),t=0,n=F(l.dom.input);t<n.length;t++){var i=n.item(t),r=i.value||i.name,a=i.fileName||(i.fileName=r.split("\\").pop()),o=-1!==a.indexOf(".")?a.split(".").pop().toLowerCase():"unknown",s=i.fileSize||i.size;l.fileType&&-1===l.fileType.indexOf("*."+o)?(BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"),{level:"error"}),u.fireEvent(BI.File.EVENT_ERROR,{errorType:0,file:i})):-1!==l.maxSize&&s&&l.maxSize<s?(BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"),{level:"error"}),u.fireEvent(BI.File.EVENT_ERROR,{errorType:1,file:i})):l.files.unshift(i)}0<l.files.length&&u.fireEvent(BI.File.EVENT_CHANGE,{files:l.files}),e.value="",l.dom.input.parentNode.replaceChild(e,l.dom.input),l.dom.input=e,event.add(l.dom.input,"change",arguments.callee)}),l},_wrap:function(){var e=this.options,t=this.element[0];return!0===e.multiple&&this.element.attr("multiple","multiple"),t.value="",this._events({dom:{input:t,disabled:!1},name:t.name,maxSize:e.maxSize?e.maxSize>>0:-1,files:[],clean:function(){this.files=[]},upload:function(e){if(e)for(var t in e)this[t]=e[t];return sendFiles(this,this.maxSize),this},hide:function(){this.dom.disabled&&(this.dom.disabled=!1,this.dom.input.removeAttribute("disabled"))},show:function(e,t,n,i){this.dom.disabled||(this.dom.disabled=!0,this.dom.input.setAttribute("disabled","disabled"))}})},select:function(){this.wrap&&BI.Widget._renderEngine.createElement(this.wrap.dom.input).click()},upload:function(e){this.wrap&&this.wrap.upload(e)},getValue:function(){return this.wrap?this.wrap.attach_array:[]},reset:function(){this.wrap&&(this.wrap.attach_array=[],this.wrap.attach_names=[],this.wrap.attachNum=0)},_setEnable:function(e){BI.File.superclass._setEnable.apply(this,arguments),!0===e?this.element.attr("disabled","disabled"):this.element.removeAttr("disabled")}}),BI.File.EVENT_CHANGE="EVENT_CHANGE",BI.File.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.File.EVENT_ERROR="EVENT_ERROR",BI.File.EVENT_PROGRESS="EVENT_PROGRESS",BI.File.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.file",BI.File)}(_global.document||{})},function(module,exports){!function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(e){var t=data.getRoot(e);t||(t={},data.setRoot(e,t)),t[e.data.key.children]=[],t.expandTriggerFlag=!1,t.curSelectedList=[],t.noSelection=!0,t.createdNodes=[],t.zId=0,t._ver=(new Date).getTime()},_initCache=function(e){var t=data.getCache(e);t||(t={},data.setCache(e,t)),t.nodes=[],t.doms=[]},_bindEvent=function(o){var e=o.treeObj,t=consts.event;e.bind(t.NODECREATED,function(e,t,n){tools.apply(o.callback.onNodeCreated,[e,t,n])}),e.bind(t.CLICK,function(e,t,n,i,r){tools.apply(o.callback.onClick,[t,n,i,r])}),e.bind(t.EXPAND,function(e,t,n){tools.apply(o.callback.onExpand,[e,t,n])}),e.bind(t.COLLAPSE,function(e,t,n){tools.apply(o.callback.onCollapse,[e,t,n])}),e.bind(t.ASYNC_SUCCESS,function(e,t,n,i){tools.apply(o.callback.onAsyncSuccess,[e,t,n,i])}),e.bind(t.ASYNC_ERROR,function(e,t,n,i,r,a){tools.apply(o.callback.onAsyncError,[e,t,n,i,r,a])}),e.bind(t.REMOVE,function(e,t,n){tools.apply(o.callback.onRemove,[e,t,n])}),e.bind(t.SELECTED,function(e,t,n,i){tools.apply(o.callback.onSelected,[t,n,i])}),e.bind(t.UNSELECTED,function(e,t,n,i){tools.apply(o.callback.onUnSelected,[t,n,i])})},_unbindEvent=function(e){var t=e.treeObj,n=consts.event;t.unbind(n.NODECREATED).unbind(n.CLICK).unbind(n.EXPAND).unbind(n.COLLAPSE).unbind(n.ASYNC_SUCCESS).unbind(n.ASYNC_ERROR).unbind(n.REMOVE).unbind(n.SELECTED).unbind(n.UNSELECTED)},_eventProxy=function(e){var t=e.target,n=data.getSetting(e.data.treeId),i="",r=null,a="",o="",s=null,l=null,u=null;if(tools.eqs(e.type,"mousedown")?o="mousedown":tools.eqs(e.type,"mouseup")?o="mouseup":tools.eqs(e.type,"contextmenu")?o="contextmenu":tools.eqs(e.type,"click")?tools.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+consts.id.SWITCH)?(i=tools.getNodeMainDom(t).id,a="switchNode"):(u=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(i=tools.getNodeMainDom(u).id,a="clickNode"):tools.eqs(e.type,"dblclick")&&(o="dblclick",(u=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(i=tools.getNodeMainDom(u).id,a="switchNode")),0<o.length&&0==i.length&&(u=tools.getMDom(n,t,[{tagName:"a",attrName:"treeNode"+consts.id.A}]))&&(i=tools.getNodeMainDom(u).id),0<i.length)switch(r=data.getNodeCache(n,i),a){case"switchNode":r.isParent&&(tools.eqs(e.type,"click")||tools.eqs(e.type,"dblclick")&&tools.apply(n.view.dblClickExpand,[n.treeId,r],n.view.dblClickExpand))?s=handler.onSwitchNode:a="";break;case"clickNode":s=handler.onClickNode}switch(o){case"mousedown":l=handler.onZTreeMousedown;break;case"mouseup":l=handler.onZTreeMouseup;break;case"dblclick":l=handler.onZTreeDblclick;break;case"contextmenu":l=handler.onZTreeContextmenu}return{stop:!1,node:r,nodeEventType:a,nodeEventCallback:s,treeEventType:o,treeEventCallback:l}},_initNode=function(e,t,n,i,r,a,o){var s,l;n&&(s=data.getRoot(e),l=e.data.key.children,n.level=t,n.tId=e.treeId+"_"+ ++s.zId,n.parentTId=i?i.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open,n[l]&&0<n[l].length?(n.isParent=!0,n.zAsync=!0):(n.isParent="string"==typeof n.isParent?tools.eqs(n.isParent,"true"):!!n.isParent,n.open=!(!n.isParent||e.async.enable)&&n.open,n.zAsync=!n.isParent),n.isFirstNode=r,n.isLastNode=a,n.getParentNode=function(){return data.getNodeCache(e,n.parentTId)},n.getPreNode=function(){return data.getPreNode(e,n)},n.getNextNode=function(){return data.getNextNode(e,n)},n.isAjaxing=!1,data.fixPIdKeyValue(e,n))},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(e,t){data.getCache(e).nodes[data.getNodeCacheId(t.tId)]=t},getNodeCacheId:function(e){return e.substring(e.lastIndexOf("_")+1)},addAfterA:function(e){_init.afterA.push(e)},addBeforeA:function(e){_init.beforeA.push(e)},addInnerAfterA:function(e){_init.innerAfterA.push(e)},addInnerBeforeA:function(e){_init.innerBeforeA.push(e)},addInitBind:function(e){_init.bind.push(e)},addInitUnBind:function(e){_init.unbind.push(e)},addInitCache:function(e){_init.caches.push(e)},addInitNode:function(e){_init.nodes.push(e)},addInitProxy:function(e,t){t?_init.proxys.splice(0,0,e):_init.proxys.push(e)},addInitRoot:function(e){_init.roots.push(e)},addNodesData:function(e,t,n){var i=e.data.key.children;t[i]||(t[i]=[]),0<t[i].length&&(t[i][t[i].length-1].isLastNode=!1,view.setNodeLineIcos(e,t[i][t[i].length-1])),t.isParent=!0,t[i]=t[i].concat(n)},addSelectedNode:function(e,t){var n=data.getRoot(e);data.isSelectedNode(e,t)||n.curSelectedList.push(t)},addCreatedNode:function(e,t){(e.callback.onNodeCreated||e.view.addDiyDom)&&data.getRoot(e).createdNodes.push(t)},addZTreeTools:function(e){_init.zTreeTools.push(e)},exSetting:function(e){$.extend(!0,_setting,e)},fixPIdKeyValue:function(e,t){e.data.simpleData.enable&&(t[e.data.simpleData.pIdKey]=t.parentTId?t.getParentNode()[e.data.simpleData.idKey]:e.data.simpleData.rootPId)},getAfterA:function(e,t,n){for(var i=0,r=_init.afterA.length;i<r;i++)_init.afterA[i].apply(this,arguments)},getBeforeA:function(e,t,n){for(var i=0,r=_init.beforeA.length;i<r;i++)_init.beforeA[i].apply(this,arguments)},getInnerAfterA:function(e,t,n){for(var i=0,r=_init.innerAfterA.length;i<r;i++)_init.innerAfterA[i].apply(this,arguments)},getInnerBeforeA:function(e,t,n){for(var i=0,r=_init.innerBeforeA.length;i<r;i++)_init.innerBeforeA[i].apply(this,arguments)},getCache:function(e){return caches[e.treeId]},getNextNode:function(e,t){if(!t)return null;for(var n=e.data.key.children,i=t.parentTId?t.getParentNode():data.getRoot(e),r=0,a=i[n].length-1;r<=a;r++)if(i[n][r]===t)return r==a?null:i[n][r+1];return null},getNodeByParam:function(e,t,n,i){if(!t||!n)return null;for(var r=e.data.key.children,a=0,o=t.length;a<o;a++){if(t[a][n]==i)return t[a];var s=data.getNodeByParam(e,t[a][r],n,i);if(s)return s}return null},getNodeCache:function(e,t){if(!t)return null;var n=caches[e.treeId].nodes[data.getNodeCacheId(t)];return n||null},getNodeName:function(e,t){return""+t[e.data.key.name]},getNodeTitle:function(e,t){return""+t[""===e.data.key.title?e.data.key.name:e.data.key.title]},getNodes:function(e){return data.getRoot(e)[e.data.key.children]},getNodesByParam:function(e,t,n,i){if(!t||!n)return[];for(var r=e.data.key.children,a=[],o=0,s=t.length;o<s;o++)t[o][n]==i&&a.push(t[o]),a=a.concat(data.getNodesByParam(e,t[o][r],n,i));return a},getNodesByParamFuzzy:function(e,t,n,i){if(!t||!n)return[];var r=e.data.key.children,a=[];i=i.toLowerCase();for(var o=0,s=t.length;o<s;o++)"string"==typeof t[o][n]&&-1<t[o][n].toLowerCase().indexOf(i)&&a.push(t[o]),a=a.concat(data.getNodesByParamFuzzy(e,t[o][r],n,i));return a},getNodesByFilter:function(e,t,n,i,r){if(!t)return i?null:[];for(var a=e.data.key.children,o=i?null:[],s=0,l=t.length;s<l;s++){if(tools.apply(n,[t[s],r],!1)){if(i)return t[s];o.push(t[s])}var u=data.getNodesByFilter(e,t[s][a],n,i,r);if(i&&u)return u;o=i?u:o.concat(u)}return o},getPreNode:function(e,t){if(!t)return null;for(var n=e.data.key.children,i=t.parentTId?t.getParentNode():data.getRoot(e),r=0,a=i[n].length;r<a;r++)if(i[n][r]===t)return 0==r?null:i[n][r-1];return null},getRoot:function(e){return e?roots[e.treeId]:null},getRoots:function(){return roots},getSetting:function(e){return settings[e]},getSettings:function(){return settings},getZTreeTools:function(e){var t=this.getRoot(this.getSetting(e));return t?t.treeTools:null},initCache:function(e){for(var t=0,n=_init.caches.length;t<n;t++)_init.caches[t].apply(this,arguments)},initNode:function(e,t,n,i,r,a){for(var o=0,s=_init.nodes.length;o<s;o++)_init.nodes[o].apply(this,arguments)},initRoot:function(e){for(var t=0,n=_init.roots.length;t<n;t++)_init.roots[t].apply(this,arguments)},isSelectedNode:function(e,t){for(var n=data.getRoot(e),i=0,r=n.curSelectedList.length;i<r;i++)if(t===n.curSelectedList[i])return!0;return!1},removeNodeCache:function(e,t){var n=e.data.key.children;if(t[n])for(var i=0,r=t[n].length;i<r;i++)arguments.callee(e,t[n][i]);data.getCache(e).nodes[data.getNodeCacheId(t.tId)]=null},removeSelectedNode:function(e,t){for(var n=data.getRoot(e),i=0,r=n.curSelectedList.length;i<r;i++)t!==n.curSelectedList[i]&&data.getNodeCache(e,n.curSelectedList[i].tId)||(n.curSelectedList.splice(i,1),i--,r--)},setCache:function(e,t){caches[e.treeId]=t},setRoot:function(e,t){roots[e.treeId]=t},setZTreeTools:function(e,t){for(var n=0,i=_init.zTreeTools.length;n<i;n++)_init.zTreeTools[n].apply(this,arguments)},transformToArrayFormat:function(e,t){if(!t)return[];var n=e.data.key.children,i=[];if(tools.isArray(t))for(var r=0,a=t.length;r<a;r++)i.push(t[r]),t[r][n]&&(i=i.concat(data.transformToArrayFormat(e,t[r][n])));else i.push(t),t[n]&&(i=i.concat(data.transformToArrayFormat(e,t[n])));return i},transformTozTreeFormat:function(e,t){var n=e.data.simpleData.idKey,i=e.data.simpleData.pIdKey,r=e.data.key.children;if(!n||""==n||!t)return[];if(tools.isArray(t)){for(var a=[],o={},s=0,l=t.length;s<l;s++)o[t[s][n]]=t[s];for(s=0,l=t.length;s<l;s++)o[t[s][i]]&&t[s][n]!=t[s][i]?(o[t[s][i]][r]||(o[t[s][i]][r]=[]),o[t[s][i]][r].push(t[s])):a.push(t[s]);return a}return[t]}},event={bindEvent:function(e){for(var t=0,n=_init.bind.length;t<n;t++)_init.bind[t].apply(this,arguments)},unbindEvent:function(e){for(var t=0,n=_init.unbind.length;t<n;t++)_init.unbind[t].apply(this,arguments)},bindTree:function(e){var t={treeId:e.treeId},n=e.treeObj;e.view.txtSelectedEnable||n.bind("selectstart",function(e){var t=e.originalEvent.srcElement.nodeName.toLowerCase();return"input"===t||"textarea"===t}).css({"-moz-user-select":"-moz-none"}),n.bind("click",t,event.proxy),n.bind("dblclick",t,event.proxy),n.bind("mouseover",t,event.proxy),n.bind("mouseout",t,event.proxy),n.bind("mousedown",t,event.proxy),n.bind("mouseup",t,event.proxy),n.bind("contextmenu",t,event.proxy)},unbindTree:function(e){e.treeObj.unbind("click",event.proxy).unbind("dblclick",event.proxy).unbind("mouseover",event.proxy).unbind("mouseout",event.proxy).unbind("mousedown",event.proxy).unbind("mouseup",event.proxy).unbind("contextmenu",event.proxy)},doProxy:function(e){for(var t=[],n=0,i=_init.proxys.length;n<i;n++){var r=_init.proxys[n].apply(this,arguments);if(t.push(r),r.stop)break}return t},proxy:function(e){var t=data.getSetting(e.data.treeId);if(!tools.uCanDo(t,e))return!0;for(var n=event.doProxy(e),i=!0,r=0,a=n.length;r<a;r++){var o=n[r];o.nodeEventCallback&&(i=o.nodeEventCallback.apply(o,[e,o.node])&&i),o.treeEventCallback&&(i=o.treeEventCallback.apply(o,[e,o.node])&&i)}return i}},handler={onSwitchNode:function(e,t){var n=data.getSetting(e.data.treeId);if(t.open){if(0==tools.apply(n.callback.beforeCollapse,[n.treeId,t],!0))return!0;data.getRoot(n).expandTriggerFlag=!0,view.switchNode(n,t)}else{if(0==tools.apply(n.callback.beforeExpand,[n.treeId,t],!0))return!0;data.getRoot(n).expandTriggerFlag=!0,view.switchNode(n,t)}return!0},onClickNode:function(e,t){var n=data.getSetting(e.data.treeId),i=n.view.autoCancelSelected&&(e.ctrlKey||e.metaKey)&&data.isSelectedNode(n,t)?0:n.view.autoCancelSelected&&(e.ctrlKey||e.metaKey)&&n.view.selectedMulti?2:1;return 0==tools.apply(n.callback.beforeClick,[n.treeId,t,i],!0)||(0==i?view.cancelPreSelectedNode(n,t):view.selectNode(n,t,2==i),n.treeObj.trigger(consts.event.CLICK,[e,n.treeId,t,i])),!0},onZTreeMousedown:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeMouseDown,[n.treeId,t],!0)&&tools.apply(n.callback.onMouseDown,[e,n.treeId,t]),!0},onZTreeMouseup:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeMouseUp,[n.treeId,t],!0)&&tools.apply(n.callback.onMouseUp,[e,n.treeId,t]),!0},onZTreeDblclick:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeDblClick,[n.treeId,t],!0)&&tools.apply(n.callback.onDblClick,[e,n.treeId,t]),!0},onZTreeContextmenu:function(e,t){var n=data.getSetting(e.data.treeId);return tools.apply(n.callback.beforeRightClick,[n.treeId,t],!0)&&tools.apply(n.callback.onRightClick,[e,n.treeId,t]),"function"!=typeof n.callback.onRightClick}},tools={apply:function(e,t,n){return"function"==typeof e?e.apply(zt,t||[]):n},canAsync:function(e,t){var n=e.data.key.children;return e.async.enable&&t&&t.isParent&&!(t.zAsync||t[n]&&0<t[n].length)},clone:function(e){if(null===e)return null;var t=tools.isArray(e)?[]:{};for(var n in e)t[n]=e[n]instanceof Date?new Date(e[n].getTime()):"object"==typeof e[n]?arguments.callee(e[n]):e[n];return t},eqs:function(e,t){return e.toLowerCase()===t.toLowerCase()},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},$:function(e,t,n){return t&&"string"!=typeof t&&(n=t,t=""),"string"==typeof e?$(e,n?n.treeObj.get(0).ownerDocument:null):$("#"+e.tId+t,n?n.treeObj:null)},getMDom:function(e,t,n){if(!t)return null;for(;t&&t.id!==e.treeId;){for(var i=0,r=n.length;t.tagName&&i<r;i++)if(tools.eqs(t.tagName,n[i].tagName)&&null!==t.getAttribute(n[i].attrName))return t;t=t.parentNode}return null},getNodeMainDom:function(e){return $(e).parent("li").get(0)||$(e).parentsUntil("li").parent().get(0)},isChildOrSelf:function(e,t){return 0<$(e).closest("#"+t).length},uCanDo:function(e,t){return!0}},view={addNodes:function(e,t,n,i){var r,a,o;e.data.keep.leaf&&t&&!t.isParent||(tools.isArray(n)||(n=[n]),e.data.simpleData.enable&&(n=data.transformTozTreeFormat(e,n)),t?(r=$$(t,consts.id.SWITCH,e),a=$$(t,consts.id.ICON,e),o=$$(t,consts.id.UL,e),t.open||(view.replaceSwitchClass(t,r,consts.folder.CLOSE),view.replaceIcoClass(t,a,consts.folder.CLOSE),t.open=!1,o.css({display:"none"})),data.addNodesData(e,t,n),view.createNodes(e,t.level+1,n,t),i||view.expandCollapseParentNode(e,t,!0)):(data.addNodesData(e,data.getRoot(e),n),view.createNodes(e,0,n,null)))},appendNodes:function(e,t,n,i,r,a){if(!n)return[];for(var o=[],s=e.data.key.children,l=0,u=n.length;l<u;l++){var c,h,p=n[l];r&&(c=(i||data.getRoot(e))[s].length==n.length&&0==l,h=l==n.length-1,data.initNode(e,t,p,i,c,h,a),data.addNodeCache(e,p));var d=[];p[s]&&0<p[s].length&&(d=view.appendNodes(e,t+1,p[s],p,r,a&&p.open)),a&&(view.makeDOMNodeMainBefore(o,e,p),view.makeDOMNodeLine(o,e,p),data.getBeforeA(e,p,o),view.makeDOMNodeNameBefore(o,e,p),data.getInnerBeforeA(e,p,o),view.makeDOMNodeIcon(o,e,p),data.getInnerAfterA(e,p,o),view.makeDOMNodeNameAfter(o,e,p),data.getAfterA(e,p,o),p.isParent&&p.open&&view.makeUlHtml(e,p,o,d.join("")),view.makeDOMNodeMainAfter(o,e,p),data.addCreatedNode(e,p))}return o},appendParentULDom:function(e,t){var n=[],i=$$(t,e);!i.get(0)&&t.parentTId&&(view.appendParentULDom(e,t.getParentNode()),i=$$(t,e));var r=$$(t,consts.id.UL,e);r.get(0)&&r.remove();var a=e.data.key.children,o=view.appendNodes(e,t.level+1,t[a],t,!1,!0);view.makeUlHtml(e,t,n,o.join("")),i.append(n.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l,icoObj;if(node&&!node.isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;node&&(node.isAjaxing=!0,icoObj=$$(node,consts.id.ICON,setting),icoObj.attr({style:"","class":consts.className.BUTTON+" "+consts.className.ICO_LOADING}));for(var tmpParam={},i=0,l=setting.async.autoParam.length;node&&i<l;i++){var pKey=setting.async.autoParam[i].split("="),spKey=pKey;1<pKey.length&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}if(tools.isArray(setting.async.otherParam))for(i=0,l=setting.async.otherParam.length;i<l;i+=2)tmpParam[setting.async.otherParam[i]]=setting.async.otherParam[i+1];else for(var p in setting.async.otherParam)tmpParam[p]=setting.async.otherParam[p];var _tmpV=data.getRoot(setting)._ver;return $.ajax({contentType:setting.async.contentType,cache:!1,type:setting.async.type,url:tools.apply(setting.async.url,[setting.treeId,node],setting.async.url),data:tmpParam,dataType:setting.async.dataType,success:function(msg){if(_tmpV==data.getRoot(setting)._ver){var newNodes=[];try{newNodes=msg&&0!=msg.length?"string"==typeof msg?eval("("+msg+")"):msg:[]}catch(err){newNodes=msg}node&&(node.isAjaxing=null,node.zAsync=!0),view.setNodeLineIcos(setting,node),newNodes&&""!==newNodes?(newNodes=tools.apply(setting.async.dataFilter,[setting.treeId,node,newNodes],newNodes),view.addNodes(setting,node,newNodes?tools.clone(newNodes):[],!!isSilent)):view.addNodes(setting,node,[],!!isSilent),setting.treeObj.trigger(consts.event.ASYNC_SUCCESS,[setting.treeId,node,msg]),tools.apply(callback)}},error:function(e,t,n){_tmpV==data.getRoot(setting)._ver&&(node&&(node.isAjaxing=null),view.setNodeLineIcos(setting,node),setting.treeObj.trigger(consts.event.ASYNC_ERROR,[setting.treeId,node,e,t,n]))}}),!0},cancelPreSelectedNode:function(e,t,n){for(var i,r=data.getRoot(e).curSelectedList,a=r.length-1;0<=a;a--)if(t===(i=r[a])||!t&&(!n||n!==i)){if($$(i,consts.id.A,e).removeClass(consts.node.CURSELECTED),t){data.removeSelectedNode(e,t),e.treeObj.trigger(consts.event.UNSELECTED,[event,e.treeId,i]);break}r.splice(a,1),e.treeObj.trigger(consts.event.UNSELECTED,[event,e.treeId,i])}},createNodeCallback:function(e){if(e.callback.onNodeCreated||e.view.addDiyDom)for(var t=data.getRoot(e);0<t.createdNodes.length;){var n=t.createdNodes.shift();tools.apply(e.view.addDiyDom,[e.treeId,n]),e.callback.onNodeCreated&&e.treeObj.trigger(consts.event.NODECREATED,[e.treeId,n])}},createNodes:function(e,t,n,i){var r,a,o,s,l;n&&0!=n.length&&(r=data.getRoot(e),a=e.data.key.children,o=!i||i.open||!!$$(i[a][0],e).get(0),r.createdNodes=[],s=view.appendNodes(e,t,n,i,!0,o),i?(l=$$(i,consts.id.UL,e)).get(0)&&l.append(s.join("")):e.treeObj.append(s.join("")),view.createNodeCallback(e))},destroy:function(e){e&&(data.initCache(e),data.initRoot(e),event.unbindTree(e),event.unbindEvent(e),e.treeObj.empty(),delete settings[e.treeId])},expandCollapseNode:function(e,t,n,i,r){var a,o,s,l,u=data.getRoot(e),c=e.data.key.children;t?(u.expandTriggerFlag&&(a=r,r=function(){a&&a(),t.open?e.treeObj.trigger(consts.event.EXPAND,[e.treeId,t]):e.treeObj.trigger(consts.event.COLLAPSE,[e.treeId,t])},u.expandTriggerFlag=!1),!t.open&&t.isParent&&(!$$(t,consts.id.UL,e).get(0)||t[c]&&0<t[c].length&&!$$(t[c][0],e).get(0))&&(view.appendParentULDom(e,t),view.createNodeCallback(e)),t.open!=n?(o=$$(t,consts.id.UL,e),s=$$(t,consts.id.SWITCH,e),l=$$(t,consts.id.ICON,e),t.isParent?(t.open=!t.open,t.iconOpen&&t.iconClose&&l.attr("style",view.makeNodeIcoStyle(e,t)),t.open?(view.replaceSwitchClass(t,s,consts.folder.OPEN),view.replaceIcoClass(t,l,consts.folder.OPEN),0!=i&&""!=e.view.expandSpeed&&t[c]&&0<t[c].length?o.slideDown(e.view.expandSpeed,r):(o.show(),tools.apply(r,[]))):(view.replaceSwitchClass(t,s,consts.folder.CLOSE),view.replaceIcoClass(t,l,consts.folder.CLOSE),0!=i&&""!=e.view.expandSpeed&&t[c]&&0<t[c].length?o.slideUp(e.view.expandSpeed,r):(o.hide(),tools.apply(r,[])))):tools.apply(r,[])):tools.apply(r,[])):tools.apply(r,[])},expandCollapseParentNode:function(e,t,n,i,r){t&&(t.parentTId?(view.expandCollapseNode(e,t,n,i),t.parentTId&&view.expandCollapseParentNode(e,t.getParentNode(),n,i,r)):view.expandCollapseNode(e,t,n,i,r))},expandCollapseSonNode:function(e,t,n,i,r){var a=data.getRoot(e),o=e.data.key.children,s=t?t[o]:a[o],l=!t&&i,u=data.getRoot(e).expandTriggerFlag;if(data.getRoot(e).expandTriggerFlag=!1,s)for(var c=0,h=s.length;c<h;c++)s[c]&&view.expandCollapseSonNode(e,s[c],n,l);data.getRoot(e).expandTriggerFlag=u,view.expandCollapseNode(e,t,n,i,r)},isSelectedNode:function(e,t){if(!t)return!1;for(var n=data.getRoot(e).curSelectedList,i=n.length-1;0<=i;i--)if(t===n[i])return!0;return!1},makeDOMNodeIcon:function(e,t,n){var i=data.getNodeName(t,n),r=t.view.nameIsHTML?i:i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");e.push("<span id='",n.tId,consts.id.ICON,"' title='' treeNode",consts.id.ICON," class='",view.makeNodeIcoClass(t,n),"' style='",view.makeNodeIcoStyle(t,n),"'></span><span id='",n.tId,consts.id.SPAN,"'>",r,"</span>")},makeDOMNodeLine:function(e,t,n){e.push("<span id='",n.tId,consts.id.SWITCH,"' title='' class='",view.makeNodeLineClass(t,n),"' treeNode",consts.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(e,t,n){e.push("</li>")},makeDOMNodeMainBefore:function(e,t,n){e.push("<li id='",n.tId,"' class='",consts.className.LEVEL,n.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(e,t,n){e.push("</a>")},makeDOMNodeNameBefore:function(e,t,n){var i=data.getNodeTitle(t,n),r=view.makeNodeUrl(t,n),a=view.makeNodeFontCss(t,n),o=[];for(var s in a)o.push(s,":",a[s],";");e.push("<a id='",n.tId,consts.id.A,"' class='",consts.className.LEVEL,n.level,"' treeNode",consts.id.A,' onclick="',n.click||"",'" ',null!=r&&0<r.length?"href='"+r+"'":""," target='",view.makeNodeTarget(n),"' style='",o.join(""),"'"),tools.apply(t.view.showTitle,[t.treeId,n],t.view.showTitle)&&i&&e.push("title='",i.replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"'"),e.push(">")},makeNodeFontCss:function(e,t){var n=tools.apply(e.view.fontCss,[e.treeId,t],e.view.fontCss);return n&&"function"!=typeof n?n:{}},makeNodeIcoClass:function(e,t){var n=["ico"];return t.isAjaxing||(n[0]=(t.iconSkin?t.iconSkin+"_":"")+n[0],t.isParent?n.push(t.open?consts.folder.OPEN:consts.folder.CLOSE):n.push(consts.folder.DOCU)),consts.className.BUTTON+" "+n.join("_")},makeNodeIcoStyle:function(e,t){var n,i=[];return t.isAjaxing||((n=t.isParent&&t.iconOpen&&t.iconClose?t.open?t.iconOpen:t.iconClose:t.icon)&&i.push("background:url(",n,") 0 0 no-repeat;"),0!=e.view.showIcon&&tools.apply(e.view.showIcon,[e.treeId,t],!0)||i.push("width:0px;height:0px;")),i.join("")},makeNodeLineClass:function(e,t){var n=[];return e.view.showLine?0==t.level&&t.isFirstNode&&t.isLastNode?n.push(consts.line.ROOT):0==t.level&&t.isFirstNode?n.push(consts.line.ROOTS):t.isLastNode?n.push(consts.line.BOTTOM):n.push(consts.line.CENTER):n.push(consts.line.NOLINE),t.isParent?n.push(t.open?consts.folder.OPEN:consts.folder.CLOSE):n.push(consts.folder.DOCU),view.makeNodeLineClassEx(t)+n.join("_")},makeNodeLineClassEx:function(e){return consts.className.BUTTON+" "+consts.className.LEVEL+e.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(e){return e.target||"_blank"},makeNodeUrl:function(e,t){var n=e.data.key.url;return t[n]?t[n]:null},makeUlHtml:function(e,t,n,i){n.push("<ul id='",t.tId,consts.id.UL,"' class='",consts.className.LEVEL,t.level," ",view.makeUlLineClass(e,t),"' style='display:",t.open?"block":"none","'>"),n.push(i),n.push("</ul>")},makeUlLineClass:function(e,t){return e.view.showLine&&!t.isLastNode?consts.line.LINE:""},removeChildNodes:function(e,t){if(t){var n=e.data.key.children,i=t[n];if(i){for(var r,a,o=0,s=i.length;o<s;o++)data.removeNodeCache(e,i[o]);data.removeSelectedNode(e),delete t[n],e.data.keep.parent?$$(t,consts.id.UL,e).empty():(t.isParent=!1,t.open=!1,r=$$(t,consts.id.SWITCH,e),a=$$(t,consts.id.ICON,e),view.replaceSwitchClass(t,r,consts.folder.DOCU),view.replaceIcoClass(t,a,consts.folder.DOCU),$$(t,consts.id.UL,e).remove())}}},setFirstNode:function(e,t){var n=e.data.key.children;0<t[n].length&&(t[n][0].isFirstNode=!0)},setLastNode:function(e,t){var n=e.data.key.children,i=t[n].length;0<i&&(t[n][i-1].isLastNode=!0)},removeNode:function(e,t){var n=data.getRoot(e),i=e.data.key.children,r=t.parentTId?t.getParentNode():n;if(t.isFirstNode=!1,t.isLastNode=!1,t.getPreNode=function(){return null},t.getNextNode=function(){return null},data.getNodeCache(e,t.tId)){$$(t,e).remove(),data.removeNodeCache(e,t),data.removeSelectedNode(e,t);for(var a=0,o=r[i].length;a<o;a++)if(r[i][a].tId==t.tId){r[i].splice(a,1);break}view.setFirstNode(e,r),view.setLastNode(e,r);var s,l,u,c,h,p=r[i].length;e.data.keep.parent||0!=p?e.view.showLine&&0<p&&(s=r[i][p-1],u=$$(s,consts.id.UL,e),c=$$(s,consts.id.SWITCH,e),h=$$(s,consts.id.ICON,e),r==n?1==r[i].length?view.replaceSwitchClass(s,c,consts.line.ROOT):(l=$$(r[i][0],consts.id.SWITCH,e),view.replaceSwitchClass(r[i][0],l,consts.line.ROOTS),view.replaceSwitchClass(s,c,consts.line.BOTTOM)):view.replaceSwitchClass(s,c,consts.line.BOTTOM),u.removeClass(consts.line.LINE)):(r.isParent=!1,r.open=!1,u=$$(r,consts.id.UL,e),c=$$(r,consts.id.SWITCH,e),h=$$(r,consts.id.ICON,e),view.replaceSwitchClass(r,c,consts.folder.DOCU),view.replaceIcoClass(r,h,consts.folder.DOCU),u.css("display","none"))}},replaceIcoClass:function(e,t,n){if(t&&!e.isAjaxing){var i=t.attr("class");if(i!=undefined){var r=i.split("_");switch(n){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:r[r.length-1]=n}t.attr("class",r.join("_"))}}},replaceSwitchClass:function(e,t,n){if(t){var i=t.attr("class");if(i!=undefined){var r=i.split("_");switch(n){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:r[0]=view.makeNodeLineClassEx(e)+n;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:r[1]=n}t.attr("class",r.join("_")),n!==consts.folder.DOCU?t.removeAttr("disabled"):t.attr("disabled","disabled")}}},selectNode:function(e,t,n){n||view.cancelPreSelectedNode(e,null,t),$$(t,consts.id.A,e).addClass(consts.node.CURSELECTED),data.addSelectedNode(e,t),e.treeObj.trigger(consts.event.SELECTED,[event,e.treeId,t])},setNodeFontCss:function(e,t){var n=$$(t,consts.id.A,e),i=view.makeNodeFontCss(e,t);i&&n.css(i)},setNodeLineIcos:function(e,t){var n,i,r,a;t&&(n=$$(t,consts.id.SWITCH,e),i=$$(t,consts.id.UL,e),r=$$(t,consts.id.ICON,e),0==(a=view.makeUlLineClass(e,t)).length?i.removeClass(consts.line.LINE):i.addClass(a),n.attr("class",view.makeNodeLineClass(e,t)),t.isParent?n.removeAttr("disabled"):n.attr("disabled","disabled"),r.removeAttr("style"),r.attr("style",view.makeNodeIcoStyle(e,t)),r.attr("class",view.makeNodeIcoClass(e,t)))},setNodeName:function(e,t){var n=data.getNodeTitle(e,t),i=$$(t,consts.id.SPAN,e);i.empty(),e.view.nameIsHTML?i.html(data.getNodeName(e,t)):i.text(data.getNodeName(e,t)),tools.apply(e.view.showTitle,[e.treeId,t],e.view.showTitle)&&$$(t,consts.id.A,e).attr("title",n||"")},setNodeTarget:function(e,t){$$(t,consts.id.A,e).attr("target",view.makeNodeTarget(t))},setNodeUrl:function(e,t){var n=$$(t,consts.id.A,e),i=view.makeNodeUrl(e,t);null==i||0==i.length?n.removeAttr("href"):n.attr("href",i)},switchNode:function(e,t){if(t.open||!tools.canAsync(e,t))view.expandCollapseNode(e,t,!t.open);else if(e.async.enable){if(!view.asyncNode(e,t))return void view.expandCollapseNode(e,t,!t.open)}else t&&view.expandCollapseNode(e,t,!t.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(e){var t=data.getZTreeTools(e);return t||null},destroy:function(e){if(e&&0<e.length)view.destroy(data.getSetting(e));else for(var t in settings)view.destroy(settings[t])},init:function(e,t,n){var s=tools.clone(_setting);$.extend(!0,s,t),s.treeId=e.attr("id"),s.treeObj=e,s.treeObj.empty(),settings[s.treeId]=s,"undefined"==typeof document.body.style.maxHeight&&(s.view.expandSpeed=""),data.initRoot(s);var i=data.getRoot(s),r=s.data.key.children;n=n?tools.clone(tools.isArray(n)?n:[n]):[],s.data.simpleData.enable?i[r]=data.transformTozTreeFormat(s,n):i[r]=n,data.initCache(s),event.unbindTree(s),event.bindTree(s),event.unbindEvent(s),event.bindEvent(s);var a={setting:s,addNodes:function(e,t,n){if(!t)return null;if((e=e||null)&&!e.isParent&&s.data.keep.leaf)return null;var i=tools.clone(tools.isArray(t)?t:[t]);function r(){view.addNodes(s,e,i,1==n)}return tools.canAsync(s,e)?view.asyncNode(s,e,n,r):r(),i},cancelSelectedNode:function(e){view.cancelPreSelectedNode(s,e)},destroy:function(){view.destroy(s)},expandAll:function(e){return e=!!e,view.expandCollapseSonNode(s,null,e,!0),e},expandNode:function(t,e,n,i,r){if(!t||!t.isParent)return null;if(!0!==e&&!1!==e&&(e=!t.open),(r=!!r)&&e&&0==tools.apply(s.callback.beforeExpand,[s.treeId,t],!0))return null;if(r&&!e&&0==tools.apply(s.callback.beforeCollapse,[s.treeId,t],!0))return null;if(e&&t.parentTId&&view.expandCollapseParentNode(s,t.getParentNode(),e,!1),e===t.open&&!n)return null;if(data.getRoot(s).expandTriggerFlag=r,!tools.canAsync(s,t)&&n)view.expandCollapseSonNode(s,t,e,!0,function(){if(!1!==i)try{$$(t,s).focus().blur()}catch(e){}});else if(t.open=!e,view.switchNode(this.setting,t),!1!==i)try{$$(t,s).focus().blur()}catch(a){}return e},getNodes:function(){return data.getNodes(s)},getNodeByParam:function(e,t,n){return e?data.getNodeByParam(s,n?n[s.data.key.children]:data.getNodes(s),e,t):null},getNodeByTId:function(e){return data.getNodeCache(s,e)},getNodesByParam:function(e,t,n){return e?data.getNodesByParam(s,n?n[s.data.key.children]:data.getNodes(s),e,t):null},getNodesByParamFuzzy:function(e,t,n){return e?data.getNodesByParamFuzzy(s,n?n[s.data.key.children]:data.getNodes(s),e,t):null},getNodesByFilter:function(e,t,n,i){return t=!!t,e&&"function"==typeof e?data.getNodesByFilter(s,n?n[s.data.key.children]:data.getNodes(s),e,t,i):t?null:[]},getNodeIndex:function(e){if(!e)return null;for(var t=s.data.key.children,n=e.parentTId?e.getParentNode():data.getRoot(s),i=0,r=n[t].length;i<r;i++)if(n[t][i]==e)return i;return-1},getSelectedNodes:function(){for(var e=[],t=data.getRoot(s).curSelectedList,n=0,i=t.length;n<i;n++)e.push(t[n]);return e},isSelectedNode:function(e){return data.isSelectedNode(s,e)},reAsyncChildNodes:function(e,t,n){if(this.setting.async.enable){var i=!e;if(i&&(e=data.getRoot(s)),"refresh"==t){for(var r=this.setting.data.key.children,a=0,o=e[r]?e[r].length:0;a<o;a++)data.removeNodeCache(s,e[r][a]);data.removeSelectedNode(s),e[r]=[],i?this.setting.treeObj.empty():$$(e,consts.id.UL,s).empty()}view.asyncNode(this.setting,i?null:e,!!n)}},refresh:function(){this.setting.treeObj.empty();var e=data.getRoot(s),t=e[s.data.key.children];data.initRoot(s),e[s.data.key.children]=t,data.initCache(s),view.createNodes(s,0,e[s.data.key.children])},removeChildNodes:function(e){if(!e)return null;var t=e[s.data.key.children];return view.removeChildNodes(s,e),t||null},removeNode:function(e,t){e&&((t=!!t)&&0==tools.apply(s.callback.beforeRemove,[s.treeId,e],!0)||(view.removeNode(s,e),t&&this.setting.treeObj.trigger(consts.event.REMOVE,[s.treeId,e])))},selectNode:function(t,e){if(t&&tools.uCanDo(s)){if(e=s.view.selectedMulti&&e,t.parentTId)view.expandCollapseParentNode(s,t.getParentNode(),!0,!1,function(){try{$$(t,s).focus().blur()}catch(e){}});else try{$$(t,s).focus().blur()}catch(n){}view.selectNode(s,t,e)}},transformTozTreeNodes:function(e){return data.transformTozTreeFormat(s,e)},transformToArray:function(e){return data.transformToArrayFormat(s,e)},updateNode:function(e,t){e&&$$(e,s).get(0)&&tools.uCanDo(s)&&(view.setNodeName(s,e),view.setNodeTarget(s,e),view.setNodeUrl(s,e),view.setNodeLineIcos(s,e),view.setNodeFontCss(s,e))}};return i.treeTools=a,data.setZTreeTools(s,a),i[r]&&0<i[r].length?view.createNodes(s,0,i[r]):s.async.enable&&s.async.url&&""!==s.async.url&&view.asyncNode(s),a}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(BI.jQuery)},function(e,t){!function(e){var t={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},n={check:{enable:!1,autoCheckTrigger:!1,chkStyle:t.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:t.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},s={onCheckNode:function(e,t){if(!0===t.chkDisabled)return!1;var n=d.getSetting(e.data.treeId),i=n.data.key.checked;if(0==l.apply(n.callback.beforeCheck,[n.treeId,t],!0))return!0;t[i]=!t[i],p.checkNodeRelation(n,t);var r=f(t,h.id.CHECK,n);return p.setChkClass(n,r,t),p.repairParentChkClassWithSelf(n,t),n.treeObj.trigger(h.event.CHECK,[e,n.treeId,t]),!0},onMouseoverCheck:function(e,t){if(!0===t.chkDisabled)return!1;var n=d.getSetting(e.data.treeId),i=f(t,h.id.CHECK,n);return t.check_Focus=!0,p.setChkClass(n,i,t),!0},onMouseoutCheck:function(e,t){if(!0===t.chkDisabled)return!1;var n=d.getSetting(e.data.treeId),i=f(t,h.id.CHECK,n);return t.check_Focus=!1,p.setChkClass(n,i,t),!0}},i={tools:{},view:{checkNodeRelation:function(e,t){var n,i=e.data.key.children,r=e.data.key.checked,a=h.radio;if(e.check.chkStyle==a.STYLE){var o=d.getRadioCheckedList(e);if(t[r])if(e.check.radioType==a.TYPE_ALL){for(l=o.length-1;0<=l;l--)(n=o[l])[r]&&n!=t&&(n[r]=!1,o.splice(l,1),p.setChkClass(e,f(n,h.id.CHECK,e),n),n.parentTId!=t.parentTId&&p.repairParentChkClassWithSelf(e,n));o.push(t)}else for(var s=t.parentTId?t.getParentNode():d.getRoot(e),l=0,u=s[i].length;l<u;l++)(n=s[i][l])[r]&&n!=t&&(n[r]=!1,p.setChkClass(e,f(n,h.id.CHECK,e),n));else if(e.check.radioType==a.TYPE_ALL)for(l=0,u=o.length;l<u;l++)if(t==o[l]){o.splice(l,1);break}}else t[r]&&(!t[i]||0==t[i].length||-1<e.check.chkboxType.Y.indexOf("s"))&&p.setSonNodeCheckBox(e,t,!0),t[r]||t[i]&&0!=t[i].length&&!(-1<e.check.chkboxType.N.indexOf("s"))||p.setSonNodeCheckBox(e,t,!1),t[r]&&-1<e.check.chkboxType.Y.indexOf("p")&&p.setParentNodeCheckBox(e,t,!0),!t[r]&&-1<e.check.chkboxType.N.indexOf("p")&&p.setParentNodeCheckBox(e,t,!1)},makeChkClass:function(e,t){var n=e.data.key.checked,i=h.checkbox,r=h.radio,a=e.check.chkboxType,o=""===a.Y&&""===a.N;fullStyle="",fullStyle=!0===t.chkDisabled?i.DISABLED:t.halfCheck?i.PART:e.check.chkStyle==r.STYLE?t.check_Child_State<1?i.FULL:i.PART:t[n]?2===t.check_Child_State||-1===t.check_Child_State||o?i.FULL:i.PART:t.check_Child_State<1||o?i.FULL:i.PART;var s=e.check.chkStyle+"_"+(t[n]?i.TRUE:i.FALSE)+"_"+fullStyle,s=t.check_Focus&&!0!==t.chkDisabled?s+"_"+i.FOCUS:s;return h.className.BUTTON+" "+i.DEFAULT+" "+s},repairAllChk:function(e,t){if(e.check.enable&&e.check.chkStyle===h.checkbox.STYLE)for(var n=e.data.key.checked,i=e.data.key.children,r=d.getRoot(e),a=0,o=r[i].length;a<o;a++){var s=r[i][a];!0!==s.nocheck&&!0!==s.chkDisabled&&(s[n]=t),p.setSonNodeCheckBox(e,s,t)}},repairChkClass:function(e,t){var n;t&&(d.makeChkFlag(e,t),!0!==t.nocheck&&(n=f(t,h.id.CHECK,e),p.setChkClass(e,n,t)))},repairParentChkClass:function(e,t){var n;t&&t.parentTId&&(n=t.getParentNode(),p.repairChkClass(e,n),p.repairParentChkClass(e,n))},repairParentChkClassWithSelf:function(e,t){var n;t&&(t[n=e.data.key.children]&&0<t[n].length?p.repairParentChkClass(e,t[n][0]):p.repairParentChkClass(e,t))},repairSonChkDisabled:function(e,t,n,i){if(t){var r=e.data.key.children;if(t.chkDisabled!=n&&(t.chkDisabled=n),p.repairChkClass(e,t),t[r]&&i)for(var a=0,o=t[r].length;a<o;a++){var s=t[r][a];p.repairSonChkDisabled(e,s,n,i)}}},repairParentChkDisabled:function(e,t,n,i){t&&(t.chkDisabled!=n&&i&&(t.chkDisabled=n),p.repairChkClass(e,t),p.repairParentChkDisabled(e,t.getParentNode(),n,i))},setChkClass:function(e,t,n){t&&(!0===n.nocheck?t.hide():t.show(),t.attr("class",p.makeChkClass(e,n)))},setParentNodeCheckBox:function(e,t,n,i){var r=e.data.key.children,a=e.data.key.checked,o=f(t,h.id.CHECK,e);if(i=i||t,d.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled&&(t[a]=n,p.setChkClass(e,o,t),e.check.autoCheckTrigger&&t!=i&&e.treeObj.trigger(h.event.CHECK,[null,e.treeId,t])),t.parentTId){var s=!0;if(!n)for(var l=t.getParentNode()[r],u=0,c=l.length;u<c;u++)if(!0!==l[u].nocheck&&!0!==l[u].chkDisabled&&l[u][a]||(!0===l[u].nocheck||!0===l[u].chkDisabled)&&0<l[u].check_Child_State){s=!1;break}s&&p.setParentNodeCheckBox(e,t.getParentNode(),n,i)}},setSonNodeCheckBox:function(e,t,n,i){if(t){var r=e.data.key.children,a=e.data.key.checked,o=f(t,h.id.CHECK,e);i=i||t;var s=!1;if(t[r])for(var l=0,u=t[r].length;l<u&&!0!==t.chkDisabled;l++){var c=t[r][l];p.setSonNodeCheckBox(e,c,n,i),!0===c.chkDisabled&&(s=!0)}t!=d.getRoot(e)&&!0!==t.chkDisabled&&(s&&!0!==t.nocheck&&d.makeChkFlag(e,t),!0!==t.nocheck&&!0!==t.chkDisabled?(t[a]=n,s||(t.check_Child_State=t[r]&&0<t[r].length?n?2:0:-1)):t.check_Child_State=-1,p.setChkClass(e,o,t),e.check.autoCheckTrigger&&t!=i&&!0!==t.nocheck&&!0!==t.chkDisabled&&e.treeObj.trigger(h.event.CHECK,[null,e.treeId,t]))}}},event:{},data:{getRadioCheckedList:function(e){for(var t=d.getRoot(e).radioCheckedList,n=0,i=t.length;n<i;n++)d.getNodeCache(e,t[n].tId)||(t.splice(n,1),n--,i--);return t},getCheckStatus:function(e,t){if(!e.check.enable||t.nocheck||t.chkDisabled)return null;var n=e.data.key.checked;return{checked:t[n],half:t.halfCheck?t.halfCheck:e.check.chkStyle==h.radio.STYLE?2===t.check_Child_State:t[n]?-1<t.check_Child_State&&t.check_Child_State<2:0<t.check_Child_State}},getTreeCheckedNodes:function(e,t,n,i){if(!t)return[];var r=e.data.key.children,a=e.data.key.checked,o=n&&e.check.chkStyle==h.radio.STYLE&&e.check.radioType==h.radio.TYPE_ALL;i=i||[];for(var s=0,l=t.length;s<l&&(!0===t[s].nocheck||!0===t[s].chkDisabled||t[s][a]!=n||(i.push(t[s]),!o))&&(d.getTreeCheckedNodes(e,t[s][r],n,i),!(o&&0<i.length));s++);return i},getTreeChangeCheckedNodes:function(e,t,n){if(!t)return[];var i=e.data.key.children,r=e.data.key.checked;n=n||[];for(var a=0,o=t.length;a<o;a++)!0!==t[a].nocheck&&!0!==t[a].chkDisabled&&t[a][r]!=t[a].checkedOld&&n.push(t[a]),d.getTreeChangeCheckedNodes(e,t[a][i],n);return n},makeChkFlag:function(e,t){if(t){var n=e.data.key.children,i=e.data.key.checked,r=-1;if(t[n])for(var a=0,o=t[n].length;a<o;a++){var s=t[n][a],l=-1;if(e.check.chkStyle==h.radio.STYLE){if(2==(l=!0===s.nocheck||!0===s.chkDisabled?s.check_Child_State:!0===s.halfCheck||s[i]||0<s.check_Child_State?2:0)){r=2;break}0==l&&(r=0)}else if(e.check.chkStyle==h.checkbox.STYLE){if(1===(l=!0===s.nocheck||!0===s.chkDisabled?s.check_Child_State:!0===s.halfCheck?1:s[i]?-1===s.check_Child_State||2===s.check_Child_State?2:1:0<s.check_Child_State?1:0)){r=1;break}if(2===l&&-1<r&&0<a&&l!==r){r=1;break}if(2===r&&-1<l&&l<2){r=1;break}-1<l&&(r=l)}}t.check_Child_State=r}}}};e.extend(!0,e.fn.zTree.consts,t),e.extend(!0,e.fn.zTree._z,i);var r=e.fn.zTree,l=r._z.tools,h=r.consts,p=r._z.view,d=r._z.data,f=(r._z.event,l.$);d.exSetting(n),d.addInitBind(function(r){var e=r.treeObj,t=h.event;e.bind(t.CHECK,function(e,t,n,i){e.srcEvent=t,l.apply(r.callback.onCheck,[e,n,i])})}),d.addInitUnBind(function(e){var t=e.treeObj,n=h.event;t.unbind(n.CHECK)}),d.addInitCache(function(e){}),d.addInitNode(function(e,t,n,i,r,a,o){var s;n&&(s=e.data.key.checked,"string"==typeof n[s]&&(n[s]=l.eqs(n[s],"true")),n[s]=!!n[s],n.checkedOld=n[s],"string"==typeof n.nocheck&&(n.nocheck=l.eqs(n.nocheck,"true")),n.nocheck=!!n.nocheck||e.check.nocheckInherit&&i&&!!i.nocheck,"string"==typeof n.chkDisabled&&(n.chkDisabled=l.eqs(n.chkDisabled,"true")),n.chkDisabled=!!n.chkDisabled||e.check.chkDisabledInherit&&i&&!!i.chkDisabled,"string"==typeof n.halfCheck&&(n.halfCheck=l.eqs(n.halfCheck,"true")),n.halfCheck=!!n.halfCheck,n.check_Child_State=-1,n.check_Focus=!1,n.getCheckStatus=function(){return d.getCheckStatus(e,n)},e.check.chkStyle==h.radio.STYLE&&e.check.radioType==h.radio.TYPE_ALL&&n[s]&&d.getRoot(e).radioCheckedList.push(n))}),d.addInitProxy(function(e){var t=e.target,n=d.getSetting(e.data.treeId),i="",r=null,a="",o=null;if(l.eqs(e.type,"mouseover")?n.check.enable&&l.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+h.id.CHECK)&&(i=l.getNodeMainDom(t).id,a="mouseoverCheck"):l.eqs(e.type,"mouseout")?n.check.enable&&l.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+h.id.CHECK)&&(i=l.getNodeMainDom(t).id,a="mouseoutCheck"):l.eqs(e.type,"click")&&n.check.enable&&l.eqs(t.tagName,"span")&&null!==t.getAttribute("treeNode"+h.id.CHECK)&&(i=l.getNodeMainDom(t).id,a="checkNode"),0<i.length)switch(r=d.getNodeCache(n,i),a){case"checkNode":o=s.onCheckNode;break;case"mouseoverCheck":o=s.onMouseoverCheck;break;case"mouseoutCheck":o=s.onMouseoutCheck}return{stop:"checkNode"===a,node:r,nodeEventType:a,nodeEventCallback:o,treeEventType:"",treeEventCallback:null}},!0),d.addInitRoot(function(e){d.getRoot(e).radioCheckedList=[]}),d.addBeforeA(function(e,t,n){e.data.key.checked;e.check.enable&&(d.makeChkFlag(e,t),n.push("<span ID='",t.tId,h.id.CHECK,"' class='",p.makeChkClass(e,t),"' treeNode",h.id.CHECK,!0===t.nocheck?" style='display:none;'":"","></span>"))}),d.addZTreeTools(function(e,i){i.checkNode=function(e,t,n,i){var r,a=this.setting.data.key.checked;!0!==e.chkDisabled&&(!0!==t&&!1!==t&&(t=!e[a]),i=!!i,e[a]===t&&!n||i&&0==l.apply(this.setting.callback.beforeCheck,[this.setting.treeId,e],!0)||l.uCanDo(this.setting)&&this.setting.check.enable&&!0!==e.nocheck&&(e[a]=t,r=f(e,h.id.CHECK,this.setting),!n&&this.setting.check.chkStyle!==h.radio.STYLE||p.checkNodeRelation(this.setting,e),p.setChkClass(this.setting,r,e),p.repairParentChkClassWithSelf(this.setting,e),i&&this.setting.treeObj.trigger(h.event.CHECK,[null,this.setting.treeId,e])))},i.checkAllNodes=function(e){p.repairAllChk(this.setting,!!e)},i.getCheckedNodes=function(e){var t=this.setting.data.key.children;return e=!1!==e,d.getTreeCheckedNodes(this.setting,d.getRoot(this.setting)[t],e)},i.getChangeCheckedNodes=function(){var e=this.setting.data.key.children;return d.getTreeChangeCheckedNodes(this.setting,d.getRoot(this.setting)[e])},i.setChkDisabled=function(e,t,n,i){t=!!t,n=!!n,i=!!i,p.repairSonChkDisabled(this.setting,e,t,i),p.repairParentChkDisabled(this.setting,e.getParentNode(),t,n)};var r=i.updateNode;i.updateNode=function(e,t){var n;r&&r.apply(i,arguments),e&&this.setting.check.enable&&f(e,this.setting).get(0)&&l.uCanDo(this.setting)&&(n=f(e,h.id.CHECK,this.setting),1!=t&&this.setting.check.chkStyle!==h.radio.STYLE||p.checkNodeRelation(this.setting,e),p.setChkClass(this.setting,n,e),p.repairParentChkClassWithSelf(this.setting,e))}});var a=p.createNodes;p.createNodes=function(e,t,n,i){a&&a.apply(p,arguments),n&&p.repairParentChkClassWithSelf(e,i)};var o=p.removeNode;p.removeNode=function(e,t){var n=t.getParentNode();o&&o.apply(p,arguments),t&&n&&(p.repairChkClass(e,n),p.repairParentChkClass(e,n))};var u=p.appendNodes;p.appendNodes=function(e,t,n,i,r,a){var o="";return u&&(o=u.apply(p,arguments)),i&&d.makeChkFlag(e,i),o}}(BI.jQuery)},function(e,t){BI.TreeRenderScrollService=BI.inherit(BI.OB,{_init:function(){this.nodeLists={},this.id=this.options.id,this.hasBinded=!1,this.container=this.options.container},_getNodeListBounds:function(e){var t=this.options.subNodeListGetter(e)[0];return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}},_getTreeContainerBounds:function(){var e=this.container[0];return BI.isNotNull(e)?{top:e.offsetTop+e.scrollTop,left:e.offsetLeft+e.scrollLeft,width:e.offsetWidth,height:e.offsetHeight}:{}},_canNodePopulate:function(e){if(this.nodeLists[e].locked)return!1;var t=this._getNodeListBounds(e),n=this._getTreeContainerBounds(e);return t.top+t.height<n.top+n.height},_isNodeInVisible:function(e){var t=this.options.subNodeListGetter(e);return 0===t.length||"none"===t.css("display")},pushNodeList:function(e,t){var n=this;BI.has(this.nodeLists,e)?this.nodeLists[e].locked=!1:this.nodeLists[e]={populate:BI.debounce(t,0),options:{times:1},locked:!1},this.hasBinded||(this.hasBinded=!0,this.container&&this.container.on("scroll",BI.debounce(function(){n.refreshAllNodes()},30)))},refreshAllNodes:function(){var t=this;BI.each(this.nodeLists,function(e){t._isNodeInVisible(e)||t.refreshNodes(e)})},refreshNodes:function(e){var t;this._canNodePopulate(e)&&((t=this.nodeLists[e]).options.times++,t.locked=!0,t.populate({times:t.options.times}))},removeNodeList:function(e){delete this.nodeLists[e],0===BI.size(this.nodeLists)&&this.clear()},clear:function(){var t=this;BI.each(this.nodeLists,function(e){t.removeNodeList(e)}),this.nodeLists={},this.container.off("scroll"),this.hasBinded=!1}})},function(e,t){BI.TreeRenderPageService=BI.inherit(BI.OB,{_init:function(){this.nodeLists={}},_getLoadingBar:function(e){var t=this,n=BI.createWidget({type:"bi.loading_bar",height:25,handler:function(){t.refreshNodes(e)}});return n.setLoaded(),n},pushNodeList:function(e,t){var n=this.options,i=this._getLoadingBar(e);BI.has(this.nodeLists,e)?(this.nodeLists[e].loadWidget.destroy(),this.nodeLists[e].loadWidget=i):this.nodeLists[e]={populate:BI.debounce(t,0),options:{times:1},loadWidget:i},BI.createWidget({type:"bi.vertical",element:n.subNodeListGetter(e),items:[i]})},refreshNodes:function(e){var t=this.nodeLists[e];t.options.times++,t.loadWidget.setLoading(),t.populate({times:t.options.times})},removeNodeList:function(e){this.nodeLists[e]&&this.nodeLists[e].loadWidget.destroy(),this.nodeLists[e]&&(this.nodeLists[e].loadWidget=null),delete this.nodeLists[e],0===BI.size(this.nodeLists)&&this.clear()},clear:function(){var t=this;BI.each(this.nodeLists,function(e){t.removeNodeList(e)}),this.nodeLists={}}})},function(e,t){BI.CustomColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-color-chooser",width:227,height:245})},_init:function(){BI.CustomColorChooser.superclass._init.apply(this,arguments);var e=this,t=this.options;this.editor=BI.createWidget(t.editor,{type:"bi.simple_color_picker_editor"}),this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){e.setValue(this.getValue())}),this.farbtastic=BI.createWidget({type:"bi.farbtastic"}),this.farbtastic.on(BI.Farbtastic.EVENT_CHANGE,function(){e.setValue(this.getValue())}),BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.absolute",items:[{el:this.editor,left:0,top:0,right:0}],height:30},{type:"bi.absolute",items:[{el:this.farbtastic,left:15,right:15,top:7}],height:215}]})},setValue:function(e){this.editor.setValue(e),this.farbtastic.setValue(e)},getValue:function(){return this.editor.getValue()}}),BI.CustomColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_color_chooser",BI.CustomColorChooser)},function(e,t){BI.ColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser",value:"",height:24})},_init:function(){BI.ColorChooser.superclass._init.apply(this,arguments);var t=this,e=this.options;e.value=e.value||"",this.combo=BI.createWidget({type:"bi.combo",element:this,container:e.container,adjustLength:1,isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,el:BI.extend({type:e.width<=24?"bi.color_chooser_trigger":"bi.long_color_chooser_trigger",ref:function(e){t.trigger=e},width:e.width-2,height:e.height-2},e.el),popup:{el:BI.extend({type:"bi.color_chooser_popup",ref:function(e){t.colorPicker=e},listeners:[{eventName:BI.ColorChooserPopup.EVENT_VALUE_CHANGE,action:function(){n(),t._isRGBColor(t.colorPicker.getValue())||t.combo.hideView()}},{eventName:BI.ColorChooserPopup.EVENT_CHANGE,action:function(){n(),t.combo.hideView()}}]},e.popup),value:e.value,width:230},value:e.value});var n=function(){var e=t.colorPicker.getValue();t.trigger.setValue(e)};this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){t.fireEvent(BI.ColorChooser.EVENT_CHANGE,arguments)})},_isRGBColor:function(e){return BI.isNotEmptyString(e)&&"transparent"!==e},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(e){this.combo.setValue(e||"")},getValue:function(){return this.combo.getValue()}}),BI.ColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser",BI.ColorChooser)},function(e,t){BI.ColorChooserPopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-color-chooser-popup",width:230,height:145,simple:!1},render:function(){var t=this,e=this.options;this.colorEditor=BI.createWidget(e.editor,{type:e.simple?"bi.simple_color_picker_editor":"bi.color_picker_editor",value:e.value,cls:"bi-header-background bi-border-bottom",height:30}),this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){t.setValue(this.getValue()),t._dealStoreColors(),t.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,arguments)}),this.storeColors=BI.createWidget({type:"bi.color_picker",cls:"bi-border-bottom bi-border-right",items:[this._digestStoreColors(this._getStoreColors())],width:210,height:24,value:e.value}),this.storeColors.on(BI.ColorPicker.EVENT_CHANGE,function(){t.setValue(this.getValue()[0]),t._dealStoreColors(),t.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.colorPicker=BI.createWidget({type:"bi.color_picker",width:210,height:50,value:e.value}),this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE,function(){t.setValue(this.getValue()[0]),t._dealStoreColors(),t.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.customColorChooser=BI.createWidget({type:"bi.custom_color_chooser",editor:e.editor});var n=BI.createWidget({type:"bi.popup_panel",buttons:[BI.i18nText("BI-Basic_Cancel"),BI.i18nText("BI-Basic_Save")],title:BI.i18nText("BI-Custom_Color"),el:this.customColorChooser,stopPropagation:!1,bgap:-1,rgap:1,lgap:1,minWidth:227});return this.more=BI.createWidget({type:"bi.combo",cls:"bi-border-top",container:null,direction:"right,top",isNeedAdjustHeight:!1,el:{type:"bi.text_item",cls:"color-chooser-popup-more bi-list-item",textAlign:"center",height:24,textLgap:10,text:BI.i18nText("BI-Basic_More")+"..."},popup:n}),this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){t.customColorChooser.setValue(t.getValue())}),n.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON,function(e){switch(e){case 0:t.more.hideView();break;case 1:t.setValue(t.customColorChooser.getValue()),t._dealStoreColors(),t.more.hideView(),t.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}}),{type:"bi.absolute",items:[{el:{type:"bi.vtape",items:[this.colorEditor,{el:{type:"bi.absolute",items:[{el:this.storeColors,left:10,right:10,top:5}]},height:29},{el:{type:"bi.absolute",items:[{el:this.colorPicker,left:10,right:10,top:5,bottom:5}]},height:60},{el:this.more,height:24}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"disable-mask",invisible:!e.disabled,ref:function(){t.mask=this}},left:0,right:0,top:0,bottom:0}]}},mounted:function(){var e=this.options;BI.isNotNull(e.value)&&this.setValue(e.value)},_setEnable:function(e){BI.ColorChooserPopup.superclass._setEnable.apply(this,arguments),this.mask.setVisible(!e)},_dealStoreColors:function(){var e=this.getValue(),t=this._getStoreColors(),n=new BI.Queue(8);n.fromArray(t),n.remove(e),n.unshift(e);var i=n.toArray();BI.Cache.setItem("colors",BI.array2String(i)),this.setStoreColors(i)},_digestStoreColors:function(e){var t=BI.map(e,function(e,t){return{value:t}});return BI.count(e.length,8,function(e){t.push({value:"",disabled:!0})}),t},_getStoreColors:function(){var n=this,i=this.options,e=BI.string2Array(BI.Cache.getItem("colors")||"");return BI.filter(e,function(e,t){return!i.simple||n._isRGBColor(t)})},_isRGBColor:function(e){return BI.isNotEmptyString(e)&&"transparent"!==e},setStoreColors:function(e){BI.isArray(e)&&(this.storeColors.populate([this._digestStoreColors(e)]),this.storeColors.setValue(this.getValue()))},setValue:function(e){this.colorEditor.setValue(e),this.colorPicker.setValue(e),this.storeColors.setValue(e)},getValue:function(){return this.colorEditor.getValue()}}),BI.ColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.ColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_popup",BI.ColorChooserPopup)},function(e,t){BI.SimpleColorChooserPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooserPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser-popup"})},_init:function(){BI.SimpleColorChooserPopup.superclass._init.apply(this,arguments);var e=this,t=this.options;this.popup=BI.createWidget({type:"bi.color_chooser_popup",value:t.value,element:this,simple:!0}),this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE,function(){e.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE,arguments)}),this.popup.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,function(){e.fireEvent(BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE,arguments)})},setStoreColors:function(e){this.popup.setStoreColors(e)},setValue:function(e){this.popup.setValue(e)},getValue:function(){return this.popup.getValue()}}),BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.SimpleColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser_popup",BI.SimpleColorChooserPopup)},function(e,t){BI.SimpleColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-color-chooser",value:"#ffffff"})},_init:function(){BI.SimpleColorChooser.superclass._init.apply(this,arguments);var e=this,t=this.options;this.combo=BI.createWidget({type:"bi.color_chooser",element:this,container:t.container,value:t.value,width:t.width,height:t.height,popup:{type:"bi.simple_color_chooser_popup"}}),this.combo.on(BI.ColorChooser.EVENT_CHANGE,function(){e.fireEvent(BI.SimpleColorChooser.EVENT_CHANGE,arguments)})},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(e){this.combo.setValue(e)},getValue:function(){return this.combo.getValue()}}),BI.SimpleColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser",BI.SimpleColorChooser)},function(e,t){BI.ColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var e=BI.ColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.ColorChooserTrigger.superclass._init.apply(this,arguments),this.colorContainer=BI.createWidget({type:"bi.layout",cls:"color-chooser-trigger-content"+(BI.isIE9Below&&BI.isIE9Below()?" hack":"")});var e=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:e,right:-1,bottom:1}]}),BI.isNotNull(this.options.value)&&this.setValue(this.options.value)},setValue:function(e){BI.ColorChooserTrigger.superclass.setValue.apply(this,arguments),""===e?this.colorContainer.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===e?this.colorContainer.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorContainer.element.css({"background-color":e}).removeClass("auto-color-background").removeClass("trans-color-background")}}),BI.ColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_trigger",BI.ColorChooserTrigger)},function(e,t){BI.LongColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var e=BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.LongColorChooserTrigger.superclass._init.apply(this,arguments);var t=this;this.options;this.colorContainer=BI.createWidget({type:"bi.htape",cls:"color-chooser-trigger-content",items:[{type:"bi.icon_change_button",ref:function(e){t.changeIcon=e},disableSelected:!0,iconCls:"auto-color-icon",width:24,iconWidth:16,iconHeight:16},{el:{type:"bi.label",ref:function(e){t.label=e},textAlign:"left",hgap:5,height:18,text:BI.i18nText("BI-Basic_Auto")}}]});var e=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:e,right:3,bottom:3}]}),this.options.value&&this.setValue(this.options.value)},setValue:function(e){BI.LongColorChooserTrigger.superclass.setValue.apply(this,arguments),""===e?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("auto-color-icon"),this.label.setText(BI.i18nText("BI-Basic_Auto"))):"transparent"===e?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("trans-color-icon"),this.label.setText(BI.i18nText("BI-Transparent_Color"))):(this.colorContainer.element.css({"background-color":e}),this.changeIcon.setVisible(!1),this.label.setVisible(!1))}}),BI.LongColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.long_color_chooser_trigger",BI.LongColorChooserTrigger)},function(e,t){BI.ColorPickerButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var e=BI.ColorPickerButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-color-picker-button bi-background bi-border-top bi-border-left"})},_init:function(){BI.ColorPickerButton.superclass._init.apply(this,arguments);var e,t=this,n=this.options;n.value&&(this.element.css("background-color",n.value),e=this.getName(),this.element.hover(function(){t._createMask(),t.isEnabled()&&BI.Maskers.show(e)},function(){t.isSelected()||BI.Maskers.hide(e)}))},_createMask:function(){var e=this.options,t=this.getName();this.isEnabled()&&!BI.Maskers.has(t)&&BI.Maskers.make(t,this,{offset:{left:-1,top:-1,right:-1,bottom:-1}}).element.addClass("color-picker-button-mask").css("background-color",e.value)},setSelected:function(e){BI.ColorPickerButton.superclass.setSelected.apply(this,arguments),e&&this._createMask(),BI.Maskers[e?"show":"hide"](this.getName())}}),BI.ColorPickerButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_button",BI.ColorPickerButton)},function(e,t){BI.ColorPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorPicker.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker",items:null})},_items:[[{value:"#ffffff"},{value:"#f2f2f2"},{value:"#e5e5e5"},{value:"#d9d9d9"},{value:"#cccccc"},{value:"#bfbfbf"},{value:"#b2b2b2"},{value:"#a6a6a6"},{value:"#999999"},{value:"#8c8c8c"},{value:"#808080"},{value:"#737373"},{value:"#666666"},{value:"#4d4d4d"},{value:"#333333"},{value:"#000000"}],[{value:"#d8b5a6"},{value:"#ff9e9a"},{value:"#ffc17d"},{value:"#f5e56b"},{value:"#d8e698"},{value:"#e0ebaf"},{value:"#c3d825"},{value:"#bbe2e7"},{value:"#85d3cd"},{value:"#bde1e6"},{value:"#a0d8ef"},{value:"#89c3eb"},{value:"#bbc8e6"},{value:"#bbbcde"},{value:"#d6b4cc"},{value:"#fbc0d3"}],[{value:"#bb9581"},{value:"#f37d79"},{value:"#fba74f"},{value:"#ffdb4f"},{value:"#c7dc68"},{value:"#b0ca71"},{value:"#99ab4e"},{value:"#84b9cb"},{value:"#00a3af"},{value:"#2ca9e1"},{value:"#0095d9"},{value:"#4c6cb3"},{value:"#8491c3"},{value:"#a59aca"},{value:"#cc7eb1"},{value:"#e89bb4"}],[{value:"#9d775f"},{value:"#dd4b4b"},{value:"#ef8b07"},{value:"#fcc800"},{value:"#aacf53"},{value:"#82ae46"},{value:"#69821b"},{value:"#59b9c6"},{value:"#2a83a2"},{value:"#007bbb"},{value:"#19448e"},{value:"#274a78"},{value:"#4a488e"},{value:"#7058a3"},{value:"#884898"},{value:"#d47596"}]],_init:function(){BI.ColorPicker.superclass._init.apply(this,arguments);var e=this,t=this.options;this.colors=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(t.items||this._items,{type:"bi.color_picker_button",once:!1}),layouts:[{type:"bi.grid"}],value:t.value}),this.colors.on(BI.ButtonGroup.EVENT_CHANGE,function(){e.fireEvent(BI.ColorPicker.EVENT_CHANGE,arguments)})},populate:function(e){var t=[].slice.call(arguments);t[0]=BI.createItems(e,{type:"bi.color_picker_button",once:!1}),this.colors.populate.apply(this.colors,t)},setValue:function(e){this.colors.setValue(e)},getValue:function(){return this.colors.getValue()}}),BI.ColorPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker",BI.ColorPicker)},function(e,t){BI.ColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.ColorPickerEditor.superclass._init.apply(this,arguments);var n=this,e=(this.options,this.constants);this.storeValue={},this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var t=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),i=function(e){return BI.isNumeric(e)&&0<=(0|e)&&(0|e)<=255},r=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:i,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:e.REB_WIDTH,height:20});BI.each(r,function(e,t){t.on(BI.TextEditor.EVENT_CHANGE,function(){n._checkEditors(),i(n.storeValue.r)&&i(n.storeValue.g)&&i(n.storeValue.b)&&(n.colorShow.element.css("background-color",n.getValue()),n.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=r[0],this.G=r[1],this.B=r[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(n.lastColor=n.getValue(),n.setValue("")):n.setValue(n.lastColor||"#ffffff"),(n.R.isValid()&&n.G.isValid()&&n.B.isValid()||n._isEmptyRGB())&&(n.colorShow.element.css("background-color",n.getValue()),n.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(n.lastColor=n.getValue(),n.setValue("transparent")):("transparent"===n.lastColor&&(n.lastColor=""),n.setValue(n.lastColor||"#ffffff")),(n.R.isValid()&&n.G.isValid()&&n.B.isValid()||n._isEmptyRGB())&&(n.colorShow.element.css("background-color",n.getValue()),n.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical_adapt",items:[{el:this.colorShow,width:16},{el:t[0],width:20},{el:this.R,width:e.REB_WIDTH},{el:t[1],width:20},{el:this.G,width:e.REB_WIDTH},{el:t[2],width:20},{el:this.B,width:e.REB_WIDTH},{el:this.transparent,width:16,lgap:5},{el:this.none,width:16,lgap:5}]},left:10,right:10,top:0,bottom:0}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(e){""===e?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-normal-background"):"transparent"===e?this.colorShow.element.css("background-color","").removeClass("auto-color-normal-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":e}).removeClass("auto-color-normal-background").removeClass("trans-color-background")},_setEnable:function(e){BI.ColorPickerEditor.superclass._setEnable.apply(this,arguments),!0===e?this.element.removeClass("base-disabled disabled"):!1===e&&this.element.addClass("base-disabled disabled")},setValue:function(e){if("transparent"===e)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});e?this.none.setSelected(!1):(e="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(e);var t=BI.DOM.rgb2json(BI.DOM.hex2rgb(e));this.storeValue={r:BI.isNull(t.r)?"":t.r,g:BI.isNull(t.r)?"":t.g,b:BI.isNull(t.r)?"":t.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this._isEmptyRGB()&&this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor)},function(e,t){BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var n=this,e=(this.options,this.constants);this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var t=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),i=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:function(e){return BI.isNumeric(e)&&0<=(0|e)&&(0|e)<=255},errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:e.REB_WIDTH,height:20});BI.each(i,function(e,t){t.on(BI.TextEditor.EVENT_CHANGE,function(){n._checkEditors(),n.R.isValid()&&n.G.isValid()&&n.B.isValid()&&(n.colorShow.element.css("background-color",n.getValue()),n.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=i[0],this.G=i[1],this.B=i[2],BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.colorShow,width:16,lgap:20,rgap:15},{el:t[0],width:20},{el:this.R,width:e.REB_WIDTH},{el:t[1],width:20},{el:this.G,width:e.REB_WIDTH},{el:t[2],width:20},{el:this.B,width:e.REB_WIDTH}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0)},setValue:function(e){this.colorShow.element.css({"background-color":e});var t=BI.DOM.rgb2json(BI.DOM.hex2rgb(e));this.R.setValue(BI.isNull(t.r)?"":t.r),this.G.setValue(BI.isNull(t.g)?"":t.g),this.B.setValue(BI.isNull(t.b)?"":t.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor)},function(e,t){BI.Farbtastic=BI.inherit(BI.BasicButton,{constants:{RADIUS:84,SQUARE:100,WIDTH:194},props:{baseCls:"bi-farbtastic",width:195,height:195,stopPropagation:!0,value:"#000000"},render:function(){var t=this;return{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"",ref:function(e){t.colorWrapper=e}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"wheel",ref:function(e){t.wheel=e}},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"overlay",ref:function(e){t.overlay=e}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"marker",ref:function(e){t.hMarker=e},scrollable:!1,width:17,height:17}},{el:{type:"bi.layout",cls:"marker",ref:function(e){t.slMarker=e},scrollable:!1,width:17,height:17}}]}},mounted:function(){var e=this.options;BI.isKey(e.value)&&this.setValue(e.value)},_unpack:function(e){return 7===e.length?[parseInt("0x"+e.substring(1,3))/255,parseInt("0x"+e.substring(3,5))/255,parseInt("0x"+e.substring(5,7))/255]:4===e.length?[parseInt("0x"+e.substring(1,2))/15,parseInt("0x"+e.substring(2,3))/15,parseInt("0x"+e.substring(3,4))/15]:void 0},_pack:function(e){var t=Math.round(255*e[0]),n=Math.round(255*e[1]),i=Math.round(255*e[2]);return"#"+(t<16?"0":"")+t.toString(16)+(n<16?"0":"")+n.toString(16)+(i<16?"0":"")+i.toString(16)},_setColor:function(e){var t=this._unpack(e);this.value!==e&&t&&(this.value=e,this.rgb=t,this.hsl=this._RGBToHSL(this.rgb),this._updateDisplay())},_setHSL:function(e){return this.hsl=e,this.rgb=this._HSLToRGB(e),this.value=this._pack(this.rgb),this._updateDisplay(),this},_HSLToRGB:function(e){var t=e[0],n=e[1],i=e[2],r=i<=.5?i*(n+1):i+n-i*n,a=2*i-r;return[this._hueToRGB(a,r,t+.33333),this._hueToRGB(a,r,t),this._hueToRGB(a,r,t-.33333)]},_hueToRGB:function(e,t,n){return 6*(n=n<0?n+1:1<n?n-1:n)<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(.66666-n)*6:e},_RGBToHSL:function(e){var t=e[0],n=e[1],i=e[2],r=Math.min(t,Math.min(n,i)),a=Math.max(t,Math.max(n,i)),o=a-r,s=(r+a)/2,l=0;return 0<o&&(a==t&&a!=n&&(l+=(n-i)/o),a==n&&a!=i&&(l+=2+(i-t)/o),a==i&&a!=t&&(l+=4+(t-n)/o),l/=6),[l,0<s&&s<1?o/(s<.5?2*s:2-2*s):0,s]},_updateDisplay:function(){var e=6.28*this.hsl[0];this.hMarker.element.css({left:Math.round(Math.sin(e)*this.constants.RADIUS+this.constants.WIDTH/2)+"px",top:Math.round(-Math.cos(e)*this.constants.RADIUS+this.constants.WIDTH/2)+"px"}),this.slMarker.element.css({left:Math.round(this.constants.SQUARE*(.5-this.hsl[1])+this.constants.WIDTH/2)+"px",top:Math.round(this.constants.SQUARE*(.5-this.hsl[2])+this.constants.WIDTH/2)+"px"}),this.colorWrapper.element.css("backgroundColor",this._pack(this._HSLToRGB([this.hsl[0],1,.5]))),this.fireEvent(BI.Farbtastic.EVENT_CHANGE,this.getValue(),this)},_absolutePosition:function(e){var t,n={x:e.offsetLeft,y:e.offsetTop};return e.offsetParent&&(t=this._absolutePosition(e.offsetParent),n.x+=t.x,n.y+=t.y),n},_widgetCoords:function(e){var t=e.target||e.srcElement,n=this.wheel.element[0];if("undefined"!=typeof e.offsetX){for(var i={x:e.offsetX,y:e.offsetY},r=t;r;)r.mouseX=i.x,r.mouseY=i.y,i.x+=r.offsetLeft,i.y+=r.offsetTop,r=r.offsetParent;for(var r=n,a={x:0,y:0};r;){if("undefined"!=typeof r.mouseX){o=r.mouseX-a.x,s=r.mouseY-a.y;break}a.x+=r.offsetLeft,a.y+=r.offsetTop,r=r.offsetParent}for(r=t;r;)r.mouseX=undefined,r.mouseY=undefined,r=r.offsetParent}else var i=this._absolutePosition(n),o=(e.pageX||0)-i.x,s=(e.pageY||0)-i.y;return{x:o-this.constants.WIDTH/2,y:s-this.constants.WIDTH/2}},_doMouseMove:function(e){var t,n,i,r=this._widgetCoords(e);this.circleDrag?((t=Math.atan2(r.x,-r.y)/6.28)<0&&(t+=1),this._setHSL([t,this.hsl[1],this.hsl[2]])):(n=Math.max(0,Math.min(1,.5-r.x/this.constants.SQUARE)),i=Math.max(0,Math.min(1,.5-r.y/this.constants.SQUARE)),this._setHSL([this.hsl[0],n,i]))},doClick:function(e){var t=this._widgetCoords(e);return this.circleDrag=2*Math.max(Math.abs(t.x),Math.abs(t.y))>this.constants.SQUARE,this._doMouseMove(e),!1},setValue:function(e){this._setColor(e)},getValue:function(){return this.value}}),BI.Farbtastic.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic)},function(e,t){BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){return{view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:function(e,t){return!1}}}},_dealWidthNodes:function(e){e=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(e,function(e,t){t.isParent=t.isParent||t.parent,null==t.text&&0<t.count&&(t.text=t.value+"("+BI.i18nText("BI-Basic_Altogether")+t.count+BI.i18nText("BI-Basic_Count")+")")}),e},initTree:function(e,t){t=t||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,t,e)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree)},function(e,t){BI.ListDisplayTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-list-display-tree"})},_init:function(){BI.ListDisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){return{view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1,fontCss:function(e,t){return t.isLeaf?{}:{color:"#999999"}}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:function(e,t){return!1}}}},_dealWidthNodes:function(e){e=BI.ListDisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(e,function(e,t){t.isParent=t.isParent||t.parent,null==t.text&&0<t.count&&(t.text=t.value+"("+BI.i18nText("BI-Basic_Altogether")+t.count+BI.i18nText("BI-Basic_Count")+")")}),e},initTree:function(e,t){t=t||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,t,e)},destroy:function(){BI.ListDisplayTree.superclass.destroy.apply(this,arguments)}}),BI.ListDisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_display_tree",BI.ListDisplayTree)},function(e,t){BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var i=this,r=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(e,t){var n=function(e){t({items:e}),i.structure.initTree(BI.Tree.transformToTreeFormat(e))};BI.isNotNull(r.items)?n(r.items):r.itemsCreator(e,n)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){i.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(r.items)&&this.populate(),BI.isNotNull(r.value)&&this.setValue(r.value)},populate:function(e,t){e&&(this.options.items=e),this.tree.stroke({keyword:t})},_digest:function(e){e=e||[];var r=this,a={},o=[];return BI.each(e,function(e,t){var n=r.structure.search(t,"value");if(n){var i=n;for((i=i.getParent())&&(a[i.value]||(a[i.value]=0),a[i.value]++);i&&i.getChildrenLength()<=a[i.value];)o.push(i.value),(i=i.getParent())&&(a[i.value]||(a[i.value]=0),a[i.value]++)}}),BI.makeObject(e.concat(o))},setValue:function(e){this.tree.setValue(this._digest(e))},_getValue:function(){var n=[],e=this.tree.getValue(),i=function(e){BI.each(e,function(e,t){BI.isEmpty(t)?n.push(e):i(t)})};return i(e),n},empty:function(){this.tree.empty()},getValue:function(){var i=this,r=[],e=this._getValue();return BI.each(e,function(e,t){var n=i.structure.search(t,"value");n&&i.structure._traverse(n,function(e){e.isLeaf()&&r.push(e.value)})}),r}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView)},function(e,t,n){},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var i,r,a,o,s,l,u,c,h=n(1006),p=n(45),d=n(67),f=n(99),g=n(98),m=n(949),I=n(942),B=p.WeakMap;u=h?(i=new B,r=i.get,a=i.has,o=i.set,s=function(e,t){return o.call(i,e,t),t},l=function(e){return r.call(i,e)||{}},function(e){return a.call(i,e)}):(I[c=m("state")]=!0,s=function(e,t){return f(e,c,t),t},l=function(e){return g(e,c)?e[c]:{}},function(e){return g(e,c)}),e.exports={set:s,get:l,has:u,enforce:function(e){return u(e)?l(e):s(e,{})},getterFor:function(n){return function(e){var t;if(!d(e)||(t=l(e)).type!==n)throw TypeError("Incompatible receiver, "+n+" required");return t}}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,function(e,t){BI.i18n={"BI-Multi_Date_Quarter_End":"季度末","BI-Multi_Date_Month_Begin":"月初","BI-Multi_Date_YMD":"年月日","BI-Custom_Color":"自定义颜色","BI-Numerical_Interval_Input_Data":"请输入数值","BI-Please_Input_Natural_Number":"请输入非负整数","BI-No_More_Data":"无更多数据","BI-Basic_Altogether":"共","BI-Basic_Sunday":"星期日","BI-Widget_Background_Colour":"组件背景","BI-Color_Picker_Error_Text":"请输入0~255的正整数","BI-Multi_Date_Month":"月","BI-No_Selected_Item":"没有可选项","BI-Multi_Date_Year_Begin":"年初","BI-Quarter_1":"第1季度","BI-Quarter_2":"第2季度","BI-Quarter_3":"第3季度","BI-Quarter_4":"第4季度","BI-Multi_Date_Year_Next":"年后","BI-Multi_Date_Month_Prev":"个月前","BI-Month_Trigger_Error_Text":"请输入1~12的正整数","BI-Less_And_Equal":"小于等于","BI-Year_Trigger_Invalid_Text":"请输入有效时间","BI-Multi_Date_Week_Next":"周后","BI-Font_Size":"字号","BI-Basic_Total":"共","BI-Already_Selected":"已选择","BI-Formula_Insert":"插入","BI-Select_All":"全选","BI-Basic_Tuesday":"星期二","BI-Multi_Date_Month_End":"月末","BI-Load_More":"点击加载更多数据","BI-Basic_September":"九月","BI-Current_Is_Last_Page":"当前已是最后一页","BI-Basic_Auto":"自动","BI-Basic_Count":"个","BI-Basic_Value":"值","BI-Basic_Unrestricted":"无限制","BI-Quarter_Trigger_Error_Text":"请输入1~4的正整数","BI-Basic_More":"更多","BI-Basic_Wednesday":"星期三","BI-Basic_Bold":"加粗","BI-Basic_Simple_Saturday":"六","BI-Multi_Date_Month_Next":"个月后","BI-Basic_March":"三月","BI-Current_Is_First_Page":"当前已是第一页","BI-Basic_Thursday":"星期四","BI-Basic_Prompt":"提示","BI-Multi_Date_Today":"今天","BI-Multi_Date_Quarter_Prev":"个季度前","BI-Row_Header":"行表头","BI-Date_Trigger_Error_Text":"日期格式示例:2015-3-11","BI-Basic_Cancel":"取消","BI-Basic_January":"一月","BI-Basic_June":"六月","BI-Basic_July":"七月","BI-Basic_April":"四月","BI-Multi_Date_Quarter_Begin":"季度初","BI-Multi_Date_Week":"周","BI-Click_Blank_To_Select":'点击"空格键"选中完全匹配项',"BI-Basic_August":"八月","BI-Word_Align_Left":"文字居左","BI-Basic_November":"十一月","BI-Font_Colour":"字体颜色","BI-Multi_Date_Day_Prev":"天前","BI-Select_Part":"部分选择","BI-Multi_Date_Day_Next":"天后","BI-Less_Than":"小于","BI-Basic_February":"二月","BI-Multi_Date_Year":"年","BI-Number_Index":"序号","BI-Multi_Date_Week_Prev":"周前","BI-Next_Page":"下一页","BI-Right_Page":"向右翻页","BI-Numerical_Interval_Signal_Value":"前后值相等,请将操作符改为“≤”","BI-Basic_December":"十二月","BI-Basic_Saturday":"星期六","BI-Basic_Simple_Wednesday":"三","BI-Multi_Date_Quarter_Next":"个季度后","BI-Basic_October":"十月","BI-Basic_Simple_Friday":"五","BI-Basic_Save":"保存","BI-Numerical_Interval_Number_Value":"请保证前面的数值小于/等于后面的数值","BI-Previous_Page":"上一页","BI-No_Select":"搜索结果为空","BI-Basic_Clears":"清空","BI-Created_By_Me":"我创建的","BI-Basic_Simple_Tuesday":"二","BI-Word_Align_Right":"文字居右","BI-Summary_Values":"汇总","BI-Basic_Clear":"清除","BI-Upload_File_Size_Error":"文件大小不支持","BI-Up_Page":"向上翻页","BI-Basic_Simple_Sunday":"日","BI-Multi_Date_Relative_Current_Time":"相对当前时间","BI-Selected_Data":"已选数据:","BI-Multi_Date_Quarter":"季度","BI-Check_Selected":"查看已选","BI-Basic_Search":"搜索","BI-Basic_May":"五月","BI-Continue_Select":"继续选择","BI-Please_Input_Positive_Integer":"请输入正整数","BI-Upload_File_Type_Error":"文件类型不支持","BI-Upload_File_Error":"文件上传失败","BI-Basic_Friday":"星期五","BI-Down_Page":"向下翻页","BI-Basic_Monday":"星期一","BI-Left_Page":"向左翻页","BI-Transparent_Color":"透明","BI-Basic_Simple_Monday":"一","BI-Multi_Date_Year_End":"年末","BI-Time_Interval_Error_Text":"请保证开始时间早于/等于结束时间","BI-Basic_Time":"时间","BI-Basic_OK":"确定","BI-Basic_Sure":"确定","BI-Basic_Simple_Thursday":"四","BI-Multi_Date_Year_Prev":"年前","BI-Tiao_Data":"条数据","BI-Basic_Italic":"斜体","BI-Basic_Dynamic_Title":"动态时间","BI-Basic_Year":"年","BI-Basic_Single_Quarter":"季","BI-Basic_Month":"月","BI-Basic_Week":"周","BI-Basic_Day":"天","BI-Basic_Work_Day":"工作日","BI-Basic_Front":"前","BI-Basic_Behind":"后","BI-Basic_Empty":"空","BI-Basic_Month_End":"月末","BI-Basic_Month_Begin":"月初","BI-Basic_Year_End":"年末","BI-Basic_Year_Begin":"年初","BI-Basic_Quarter_End":"季末","BI-Basic_Quarter_Begin":"季初","BI-Basic_Week_End":"周末","BI-Basic_Week_Begin":"周初","BI-Basic_Current_Day":"当天","BI-Basic_Begin_Start":"初","BI-Basic_End_Stop":"末","BI-Basic_Current_Year":"今年","BI-Basic_Year_Fen":"年份","BI-Basic_Current_Month":"本月","BI-Basic_Current_Quarter":"本季度","BI-Basic_Year_Month":"年月","BI-Basic_Year_Quarter":"年季度","BI-Basic_Input_Can_Not_Null":"输入框不能为空","BI-Basic_Date_Time_Error_Text":"日期格式示例:2015-3-11 00:00:00","BI-Basic_Input_From_To_Number":"请输入{R1}的数值","BI-Basic_Or":"或","BI-Basic_And":"且","BI-Conf_Add_Formula":"添加公式","BI-Conf_Add_Condition":"添加条件","BI-Conf_Formula_And":"且公式条件","BI-Conf_Formula_Or":"或公式条件","BI-Conf_Condition_And":"且条件","BI-Conf_Condition_Or":"或条件","BI-Microsoft_YaHei":"微软雅黑","BI-Apple_Light":"苹方-light","BI-Font_Family":"字体","BI-Basic_Please_Input_Content":"请输入内容","BI-Word_Align_Center":"文字居中","BI-Basic_Please_Enter_Number_Between":"请输入{R1}-{R2}的值","BI-More_Than":"大于","BI-More_And_Equal":"大于等于","BI-Please_Enter_SQL":"请输入SQL","BI-Basic_Click_To_Add_Text":'+点击新增"{R1}"',"BI-Basic_Please_Select":"请选择","BI-Basic_Font_Color":"文字颜色","BI-Basic_Background_Color":"背景色","BI-Basic_Underline":"下划线","BI-Basic_Param_Month":"{R1}月","BI-Basic_Param_Day":"{R1}日","BI-Basic_Param_Quarter":"{R1}季度","BI-Basic_Param_Week_Count":"第{R1}周","BI-Basic_Param_Hour":"{R1}时","BI-Basic_Param_Minute":"{R1}分","BI-Basic_Param_Second":"{R1}秒","BI-Basic_Param_Year":"{R1}年","BI-Basic_Date_Day":"日","BI-Basic_Hour_Sin":"时","BI-Basic_Seconds":"秒","BI-Basic_Minute":"分","BI-Basic_Wan":"万","BI-Basic_Million":"百万","BI-Basic_Billion":"亿","BI-Basic_Quarter":"季度","BI-Basic_No_Select":"不选","BI-Basic_Now":"此刻"}},function(e,t,n){var i=n(958),r=n(948);e.exports=function(e){return i(r(e))}},function(e,t){e.exports=!1},function(e,t,n){var i=n(192),r=n(45),a=function(e){return"function"==typeof e?e:undefined};e.exports=function(e,t){return arguments.length<2?a(i[e])||a(r[e]):i[e]&&i[e][t]||r[e]&&r[e][t]}},function(e,t,n){var i=n(68),r=n(1013),a=n(963),o=n(942),s=n(976),l=n(960),u=n(949)("IE_PROTO"),c="prototype",h=function(){},p=function(){var e,t=l("iframe"),n=a.length;for(t.style.display="none",s.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),p=e.F;n--;)delete p[c][a[n]];return p()};e.exports=Object.create||function(e,t){var n;return null!==e?(h[c]=i(e),n=new h,h[c]=null,n[u]=e):n=p(),t===undefined?n:r(n,t)},o[u]=!0},function(e,t,n){var i=n(948);e.exports=function(e){return Object(i(e))}},function(e,t,n){var d=n(68),f=n(1047),g=n(951),m=n(944),I=n(1048),B=n(1049),_=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,n,i,r){var a,o,s,l,u,c,h,p=m(t,n,i?2:1);if(r)a=e;else{if("function"!=typeof(o=I(e)))throw TypeError("Target is not iterable");if(f(o)){for(s=0,l=g(e.length);s<l;s++)if((u=i?p(d(h=e[s])[0],h[1]):p(e[s]))&&u instanceof _)return u;return new _(!1)}a=o.call(e)}for(c=a.next;!(h=c.call(a)).done;)if("object"==typeof(u=B(a,p,h.value,i))&&u&&u instanceof _)return u;return new _(!1)}).stop=function(e){return new _(!0,e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(746),r=n(1005);(e.exports=function(e,t){return r[e]||(r[e]=t!==undefined?t:{})})("versions",[]).push({version:"3.3.2",mode:i?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports={}},function(e,t,n){var i=n(100).f,r=n(98),a=n(50)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,a)&&i(e,a,{configurable:!0,value:t})}},function(e,t,n){var a=n(735);e.exports=function(i,r,e){if(a(i),r===undefined)return i;switch(e){case 0:return function(){return i.call(r)};case 1:return function(e){return i.call(r,e)};case 2:return function(e,t){return i.call(r,e,t)};case 3:return function(e,t,n){return i.call(r,e,t,n)}}return function(){return i.apply(r,arguments)}}},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(735),i=function(e){var n,i;this.promise=new e(function(e,t){if(n!==undefined||i!==undefined)throw TypeError("Bad Promise constructor");n=e,i=t}),this.resolve=r(n),this.reject=r(i)};e.exports.f=function(e){return new i(e)}},function(e,t,n){var i=n(69),r=n(957),a=n(940),o=n(745),s=n(959),l=n(98),u=n(972),c=Object.getOwnPropertyDescriptor;t.f=i?c:function(e,t){if(e=o(e),t=s(t,!0),u)try{return c(e,t)}catch(n){}if(l(e,t))return a(!r.f.call(e,t),e[t])}},function(e,t){e.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var i=n(941),r=n(950),a=i("keys");e.exports=function(e){return a[e]||(a[e]=r(e))}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol("+String(e===undefined?"":e)+")_"+(++n+i).toString(36)}},function(e,t,n){var i=n(952),r=Math.min;e.exports=function(e){return 0<e?r(i(e),9007199254740991):0}},function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?i:n)(e)}},function(e,t,n){var i=n(98),r=n(749),a=n(949),o=n(981),s=a("IE_PROTO"),l=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=r(e),i(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},function(e,t,n){var i=n(45),r=n(944),a=Function.call;e.exports=function(e,t,n){return r(a,i[e].prototype[t],n)}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},,function(e,t,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!i.call({1:2},1);t.f=a?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},function(e,t,n){var i=n(65),r=n(733),a="".split;e.exports=i(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==r(e)?a.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(67);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var i=n(45),r=n(67),a=i.document,o=r(a)&&r(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},function(e,t,n){var i=n(45),r=n(99);e.exports=function(e,t){try{r(i,e,t)}catch(n){i[e]=t}return t}},function(e,t,n){var i=n(974),r=n(963).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var i=n(65),r=/#|\.prototype\./,a=function(e,t){var n=s[o(e)];return n==u||n!=l&&("function"==typeof t?i(t):!!t)},o=a.normalize=function(e){return String(e).replace(r,".").toLowerCase()},s=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},function(e,t,n){var i=n(974),r=n(963);e.exports=Object.keys||function(e){return i(e,r)}},function(e,t,n){"use strict";var I=n(51),B=n(1041),_=n(953),E=n(968),b=n(943),y=n(99),v=n(267),i=n(50),T=n(746),C=n(945),r=n(987),N=r.IteratorPrototype,V=r.BUGGY_SAFARI_ITERATORS,S=i("iterator"),x="values",w=function(){return this};e.exports=function(e,t,n,i,r,a,o){B(n,t,i);var s,l,u,c=function(e){if(e===r&&g)return g;if(!V&&e in d)return d[e];switch(e){case"keys":case x:case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",p=!1,d=e.prototype,f=d[S]||d["@@iterator"]||r&&d[r],g=!V&&f||c(r),m="Array"==t&&d.entries||f;if(m&&(s=_(m.call(new e)),N!==Object.prototype&&s.next&&(T||_(s)===N||(E?E(s,N):"function"!=typeof s[S]&&y(s,S,w)),b(s,h,!0,!0),T&&(C[h]=w))),r==x&&f&&f.name!==x&&(p=!0,g=function(){return f.call(this)}),T&&!o||d[S]===g||y(d,S,g),C[t]=g,r)if(l={values:c(x),keys:a?g:c("keys"),entries:c("entries")},o)for(u in l)!V&&!p&&u in d||v(d,u,l[u]);else I({target:t,proto:!0,forced:V||p},l);return l}},function(e,t,n){var r=n(68),a=n(1042);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n,i=!1,e={};try{(n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),i=e instanceof Array}catch(t){}return function(e,t){return r(e),a(t),i?n.call(e,t):e.__proto__=t,e}}():undefined)},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var i=n(747);e.exports=i("navigator","userAgent")||""},function(e,t){},function(e,t,n){var i=n(69),r=n(65),a=n(960);e.exports=!i&&!r(function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(941);e.exports=i("native-function-to-string",Function.toString)},function(e,t,n){var o=n(98),s=n(745),l=n(975).indexOf,u=n(942);e.exports=function(e,t){var n,i=s(e),r=0,a=[];for(n in i)!o(u,n)&&o(i,n)&&a.push(n);for(;t.length>r;)o(i,n=t[r++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){var l=n(745),u=n(951),c=n(1009),i=function(s){return function(e,t,n){var i,r=l(e),a=u(r.length),o=c(n,a);if(s&&t!=t){for(;o<a;)if((i=r[o++])!=i)return!0}else for(;o<a;o++)if((s||o in r)&&r[o]===t)return s||o||0;return!s&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var i=n(747);e.exports=i("document","documentElement")},function(e,t,n){var i=n(65);e.exports=!!Object.getOwnPropertySymbols&&!i(function(){return!String(Symbol())})},function(e,t,n){var i=n(733);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){t.f=n(50)},function(e,t,n){var E=n(944),b=n(958),y=n(749),v=n(951),T=n(1023),C=[].push,i=function(d){var f=1==d,g=2==d,m=3==d,I=4==d,B=6==d,_=5==d||B;return function(e,t,n,i){for(var r,a,o=y(e),s=b(o),l=E(t,n,3),u=v(s.length),c=0,h=i||T,p=f?h(e,u):g?h(e,0):undefined;c<u;c++)if((_||c in s)&&(a=l(r=s[c],c,o),d))if(f)p[c]=a;else if(a)switch(d){case 3:return!0;case 5:return r;case 6:return c;case 2:C.call(p,r)}else if(I)return!1;return B?-1:m||I?I:p}};e.exports={forEach:i(0),map:i(1),filter:i(2),some:i(3),every:i(4),find:i(5),findIndex:i(6)}},function(e,t,n){var i=n(65);e.exports=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,n){"use strict";var i=n(65);e.exports=function(e,t){var n=[][e];return!n||!i(function(){n.call(null,t||function(){throw 1},1)})}},function(e,t,n){var i=n(267),r=n(1040),a=Object.prototype;r!==a.toString&&i(a,"toString",r,{unsafe:!0})},function(e,t,n){var r=n(733),a=n(50)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,i;return e===undefined?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Object(e),a))?n:o?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i}},function(e,t,n){"use strict";var r=n(986).charAt,i=n(734),a=n(967),o="String Iterator",s=i.set,l=i.getterFor(o);a(String,"String",function(e){s(this,{type:o,string:String(e),index:0})},function(){var e,t=l(this),n=t.string,i=t.index;return i>=n.length?{value:undefined,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})})},function(e,t,n){var l=n(952),u=n(948),i=function(s){return function(e,t){var n,i,r=String(u(e)),a=l(t),o=r.length;return a<0||o<=a?s?"":undefined:(n=r.charCodeAt(a))<55296||56319<n||a+1===o||(i=r.charCodeAt(a+1))<56320||57343<i?s?r.charAt(a):n:s?r.slice(a,a+2):i-56320+(n-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,n){"use strict";var i,r,a,o=n(953),s=n(99),l=n(98),u=n(50),c=n(746),h=u("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(r=o(o(a)))!==Object.prototype&&(i=r):p=!0),i==undefined&&(i={}),c||l(i,h)||s(i,h,function(){return this}),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:p}},function(e,t,n){var i=n(45),r=n(1043),a=n(1044),o=n(99),s=n(50),l=s("iterator"),u=s("toStringTag"),c=a.values;for(var h in r){var p=i[h],d=p&&p.prototype;if(d){if(d[l]!==c)try{o(d,l,c)}catch(g){d[l]=c}if(d[u]||o(d,u,h),r[h])for(var f in a)if(d[f]!==a[f])try{o(d,f,a[f])}catch(g){d[f]=a[f]}}}},function(e,t,n){var i=n(45);e.exports=i.Promise},function(e,t,n){var r=n(267);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var i=n(747),r=n(100),a=n(50),o=n(69),s=a("species");e.exports=function(e){var t=i(e),n=r.f;o&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(50)("iterator"),a=!1;try{var i=0,o={next:function(){return{done:!!i++}},"return":function(){a=!0}};o[r]=function(){return this},Array.from(o,function(){throw 2})}catch(s){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(s){}return n}},function(e,t,n){var r=n(68),a=n(735),o=n(50)("species");e.exports=function(e,t){var n,i=r(e).constructor;return i===undefined||(n=r(i)[o])==undefined?t:a(n)}},function(e,t,n){var i,r,a,o=n(45),s=n(65),l=n(733),u=n(944),c=n(976),h=n(960),p=n(970),d=o.location,f=o.setImmediate,g=o.clearImmediate,m=o.process,I=o.MessageChannel,B=o.Dispatch,_=0,E={},b="onreadystatechange",y=function(e){var t;E.hasOwnProperty(e)&&(t=E[e],delete E[e],t())},v=function(e){return function(){y(e)}},T=function(e){y(e.data)},C=function(e){o.postMessage(e+"",d.protocol+"//"+d.host)};f&&g||(f=function(e){for(var t=[],n=1;n<arguments.length;)t.push(arguments[n++]);return E[++_]=function(){("function"==typeof e?e:Function(e)).apply(undefined,t)},i(_),_},g=function(e){delete E[e]},"process"==l(m)?i=function(e){m.nextTick(v(e))}:B&&B.now?i=function(e){B.now(v(e))}:I&&!/(iphone|ipod|ipad).*applewebkit/i.test(p)?(a=(r=new I).port2,r.port1.onmessage=T,i=u(a.postMessage,a,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(C)?i=b in h("script")?function(e){c.appendChild(h("script"))[b]=function(){c.removeChild(this),y(e)}}:function(e){setTimeout(v(e),0)}:(i=C,o.addEventListener("message",T,!1))),e.exports={set:f,clear:g}},function(e,t,n){var i=n(68),r=n(67),a=n(946);e.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var i=n(51),u=n(735),r=n(946),a=n(955),c=n(750);i({target:"Promise",stat:!0},{allSettled:function(e){var s=this,t=r.f(s),l=t.resolve,n=t.reject,i=a(function(){var i=u(s.resolve),r=[],a=0,o=1;c(e,function(e){var t=a++,n=!1;r.push(undefined),o++,i.call(s,e).then(function(e){n||(n=!0,r[t]={status:"fulfilled",value:e},--o||l(r))},function(e){n||(n=!0,r[t]={status:"rejected",reason:e},--o||l(r))})}),--o||l(r)});return i.error&&n(i.value),t.promise}})},function(e,t,n){"use strict";var i,r,a=n(1061),o=RegExp.prototype.exec,s=String.prototype.replace,l=o,u=(i=/a/,r=/b*/g,o.call(i,"a"),o.call(r,"a"),0!==i.lastIndex||0!==r.lastIndex),c=/()??/.exec("")[1]!==undefined;(u||c)&&(l=function(e){var t,n,i,r;return c&&(n=new RegExp("^"+this.source+"$(?!\\s)",a.call(this))),u&&(t=this.lastIndex),i=o.call(this,e),u&&i&&(this.lastIndex=this.global?i.index+i[0].length:t),c&&i&&1<i.length&&s.call(i[0],n,function(){for(r=1;r<arguments.length-2;r++)arguments[r]===undefined&&(i[r]=undefined)}),i}),e.exports=l},function(e,t,n){var i=n(942),r=n(67),a=n(98),o=n(100).f,s=n(950),l=n(1067),u=s("meta"),c=0,h=Object.isExtensible||function(){return!0},p=function(e){o(e,u,{value:{objectID:"O"+ ++c,weakData:{}}})},d=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,u)){if(!h(e))return"F";if(!t)return"E";p(e)}return e[u].objectID},getWeakData:function(e,t){if(!a(e,u)){if(!h(e))return!0;if(!t)return!1;p(e)}return e[u].weakData},onFreeze:function(e){return l&&d.REQUIRED&&h(e)&&!a(e,u)&&p(e),e}};i[u]=!0},function(e,t){e.exports=_},,,function(e,t,n){e.exports=n(1003)},function(e,t,n){n(1004);var i=n(192).Object,r=e.exports=function r(e,t,n){return i.defineProperty(e,t,n)};i.defineProperty.sham&&(r.sham=!0)},function(e,t,n){var i=n(51),r=n(69);i({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperty:n(100).f})},function(e,t,n){var i=n(45),r=n(961),a="__core-js_shared__",o=i[a]||r(a,{});e.exports=o},function(e,t,n){var i=n(45),r=n(973),a=i.WeakMap;e.exports="function"==typeof a&&/native code/.test(r.call(a))},function(e,t,n){var s=n(98),l=n(1008),u=n(947),c=n(100);e.exports=function(e,t){for(var n=l(t),i=c.f,r=u.f,a=0;a<n.length;a++){var o=n[a];s(e,o)||i(e,o,r(t,o))}}},function(e,t,n){var i=n(747),r=n(962),a=n(964),o=n(68);e.exports=i("Reflect","ownKeys")||function(e){var t=r.f(o(e)),n=a.f;return n?t.concat(n(e)):t}},function(e,t,n){var i=n(952),r=Math.max,a=Math.min;e.exports=function(e,t){var n=i(e);return n<0?r(n+t,0):a(n,t)}},function(e,t,n){e.exports=n(1011)},function(e,t,n){n(1012);var i=n(192).Object;e.exports=function(e,t){return i.create(e,t)}},function(e,t,n){n(51)({target:"Object",stat:!0,sham:!n(69)},{create:n(748)})},function(e,t,n){var i=n(69),o=n(100),s=n(68),l=n(966);e.exports=i?Object.defineProperties:function(e,t){s(e);for(var n,i=l(t),r=i.length,a=0;a<r;)o.f(e,n=i[a++],t[n]);return e}},function(e,t,n){e.exports=n(1015)},function(e,t,n){n(1016);var i=n(192);e.exports=i.Object.assign},function(e,t,n){var i=n(51),r=n(1017);i({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},function(e,t,n){"use strict";var p=n(69),i=n(65),d=n(966),f=n(964),g=n(957),m=n(749),I=n(958),r=Object.assign;e.exports=!r||i(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=r({},e)[n]||d(r({},t)).join("")!=i})?function(e,t){for(var n=m(e),i=arguments.length,r=1,a=f.f,o=g.f;r<i;)for(var s,l=I(arguments[r++]),u=a?d(l).concat(a(l)):d(l),c=u.length,h=0;h<c;)s=u[h++],p&&!o.call(l,s)||(n[s]=l[s]);return n}:r},function(e,t,n){e.exports=n(1019)},function(e,t,n){n(1020);var i=n(192);e.exports=i.Object.getOwnPropertySymbols},function(e,t,n){"use strict";var i=n(51),r=n(45),a=n(746),o=n(69),s=n(977),l=n(65),u=n(98),c=n(978),h=n(67),p=n(68),d=n(749),f=n(745),g=n(959),m=n(940),I=n(748),B=n(966),_=n(962),E=n(1021),b=n(964),y=n(947),v=n(100),T=n(957),C=n(99),N=n(267),V=n(941),S=n(949),x=n(942),w=n(950),A=n(50),L=n(979),k=n(1022),D=n(943),M=n(734),P=n(980).forEach,R=S("hidden"),H="Symbol",O="prototype",F=A("toPrimitive"),Y=M.set,W=M.getterFor(H),G=Object[O],j=r.Symbol,Z=r.JSON,X=Z&&Z.stringify,J=y.f,K=v.f,Q=E.f,U=T.f,z=V("symbols"),q=V("op-symbols"),$=V("string-to-symbol-registry"),ee=V("symbol-to-string-registry"),te=V("wks"),ne=r.QObject,ie=!ne||!ne[O]||!ne[O].findChild,re=o&&l(function(){return 7!=I(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=J(G,t);i&&delete G[t],K(e,t,n),i&&e!==G&&K(G,t,i)}:K,ae=function(e,t){var n=z[e]=I(j[O]);return Y(n,{type:H,tag:e,description:t}),o||(n.description=t),n},oe=s&&"symbol"==typeof j.iterator?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof j},se=function(e,t,n){e===G&&se(q,t,n),p(e);var i=g(t,!0);return p(n),u(z,i)?(n.enumerable?(u(e,R)&&e[R][i]&&(e[R][i]=!1),n=I(n,{enumerable:m(0,!1)})):(u(e,R)||K(e,R,m(1,{})),e[R][i]=!0),re(e,i,n)):K(e,i,n)},le=function(t,e){p(t);var n=f(e),i=B(n).concat(pe(n));return P(i,function(e){o&&!ue.call(n,e)||se(t,e,n[e])}),t},ue=function(e){var t=g(e,!0),n=U.call(this,t);return!(this===G&&u(z,t)&&!u(q,t))&&(!(n||!u(this,t)||!u(z,t)||u(this,R)&&this[R][t])||n)},ce=function(e,t){var n=f(e),i=g(t,!0);if(n!==G||!u(z,i)||u(q,i)){var r=J(n,i);return!r||!u(z,i)||u(n,R)&&n[R][i]||(r.enumerable=!0),r}},he=function(e){var t=Q(f(e)),n=[];return P(t,function(e){u(z,e)||u(x,e)||n.push(e)}),n},pe=function(e){var t=e===G,n=Q(t?q:f(e)),i=[];return P(n,function(e){!u(z,e)||t&&!u(G,e)||i.push(z[e])}),i};s||(N((j=function Symbol(){if(this instanceof j)throw TypeError("Symbol is not a constructor");var t=arguments.length&&arguments[0]!==undefined?String(arguments[0]):undefined,n=w(t),i=function(e){this===G&&i.call(q,e),u(this,R)&&u(this[R],n)&&(this[R][n]=!1),re(this,n,m(1,e))};return o&&ie&&re(G,n,{configurable:!0,set:i}),ae(n,t)})[O],"toString",function(){return W(this).tag}),T.f=ue,v.f=se,y.f=ce,_.f=E.f=he,b.f=pe,o&&(K(j[O],"description",{configurable:!0,get:function(){return W(this).description}}),a||N(G,"propertyIsEnumerable",ue,{unsafe:!0})),L.f=function(e){return ae(A(e),e)}),i({global:!0,wrap:!0,forced:!s,sham:!s},{Symbol:j}),P(B(te),function(e){k(e)}),i({target:H,stat:!0,forced:!s},{"for":function(e){var t=String(e);if(u($,t))return $[t];var n=j(t);return $[t]=n,ee[n]=t,n},keyFor:function(e){if(!oe(e))throw TypeError(e+" is not a symbol");if(u(ee,e))return ee[e]},useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),i({target:"Object",stat:!0,forced:!s,sham:!o},{create:function(e,t){return t===undefined?I(e):le(I(e),t)},defineProperty:se,defineProperties:le,getOwnPropertyDescriptor:ce}),i({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:he,getOwnPropertySymbols:pe}),i({target:"Object",stat:!0,forced:l(function(){b.f(1)})},{getOwnPropertySymbols:function(e){return b.f(d(e))}}),Z&&i({target:"JSON",stat:!0,forced:!s||l(function(){var e=j();return"[null]"!=X([e])||"{}"!=X({a:e})||"{}"!=X(Object(e))})},{stringify:function(e){for(var t,n,i=[e],r=1;r<arguments.length;)i.push(arguments[r++]);if(n=t=i[1],(h(t)||e!==undefined)&&!oe(e))return c(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!oe(t))return t}),i[1]=t,X.apply(Z,i)}}),j[O][F]||C(j[O],F,j[O].valueOf),D(j,H),x[R]=!0},function(e,t,n){var i=n(745),r=n(962).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?function(e){try{return r(e)}catch(t){return o.slice()}}(e):r(i(e))}},function(e,t,n){var i=n(192),r=n(98),a=n(979),o=n(100).f;e.exports=function(e){var t=i.Symbol||(i.Symbol={});r(t,e)||o(t,e,{value:a.f(e)})}},function(e,t,n){var i=n(67),r=n(978),a=n(50)("species");e.exports=function(e,t){var n;return r(e)&&("function"==typeof(n=e.constructor)&&(n===Array||r(n.prototype))||i(n)&&null===(n=n[a]))&&(n=undefined),new(n===undefined?Array:n)(0===t?0:t)}},function(e,t,n){e.exports=n(1025)},function(e,t,n){n(1026);var i=n(192);e.exports=i.Object.getPrototypeOf},function(e,t,n){var i=n(51),r=n(65),a=n(749),o=n(953),s=n(981);i({target:"Object",stat:!0,forced:r(function(){o(1)}),sham:!s},{getPrototypeOf:function(e){return o(a(e))}})},function(e,t,n){e.exports=n(1028)},function(e,t,n){n(1029);var i=n(954);e.exports=i("Array","forEach")},function(e,t,n){"use strict";var i=n(51),r=n(1030);i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},function(e,t,n){"use strict";var i=n(980).forEach,r=n(982);e.exports=r("forEach")?function(e){return i(this,e,1<arguments.length?arguments[1]:undefined)}:[].forEach},function(e,t,n){e.exports=n(1032)},function(e,t,n){n(1033);var i=n(954);e.exports=i("Array","indexOf")},function(e,t,n){"use strict";var i=n(51),r=n(975).indexOf,a=n(982),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0,l=a("indexOf");i({target:"Array",proto:!0,forced:s||l},{indexOf:function(e){return s?o.apply(this,arguments)||0:r(this,e,1<arguments.length?arguments[1]:undefined)}})},function(e,t,n){e.exports=n(1035)},function(e,t,n){n(1036);var i=n(954);e.exports=i("Function","bind")},function(e,t,n){n(51)({target:"Function",proto:!0},{bind:n(1037)})},function(e,t,n){"use strict";var a=n(735),o=n(67),s=[].slice,l={};e.exports=Function.bind||function(t){var n=a(this),i=s.call(arguments,1),r=function(){var e=i.concat(s.call(arguments));return this instanceof r?function(e,t,n){if(!(t in l)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";l[t]=Function("C,a","return new C("+i.join(",")+")")}return l[t](e,n)}(n,e.length,e):n.apply(t,e)};return o(n.prototype)&&(r.prototype=n.prototype),r}},function(e,t,n){e.exports=n(1039),n(1053),n(1054),n(1055),n(1056)},function(e,t,n){n(983),n(985),n(988),n(1046),n(996),n(1052);var i=n(192);e.exports=i.Promise},function(e,t,n){"use strict";var i=n(984),r={};r[n(50)("toStringTag")]="z",e.exports="[object z]"!==String(r)?function(){return"[object "+i(this)+"]"}:r.toString},function(e,t,n){"use strict";var r=n(987).IteratorPrototype,a=n(748),o=n(940),s=n(943),l=n(945),u=function(){return this};e.exports=function(e,t,n){var i=t+" Iterator";return e.prototype=a(r,{next:o(1,n)}),s(e,i,!1,!0),l[i]=u,e}},function(e,t,n){var i=n(67);e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){"use strict";var i=n(745),r=n(1045),a=n(945),o=n(734),s=n(967),l="Array Iterator",u=o.set,c=o.getterFor(l);e.exports=s(Array,"Array",function(e,t){u(this,{type:l,target:i(e),index:0,kind:t})},function(){var e=c(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=undefined,{value:undefined,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var i=n(50),r=n(748),a=n(99),o=i("unscopables"),s=Array.prototype;s[o]==undefined&&a(s,o,r(null)),e.exports=function(e){s[o][e]=!0}},function(e,t,n){"use strict";var r,i,a,o,s=n(51),l=n(746),u=n(45),c=n(192),h=n(989),p=n(267),d=n(990),f=n(943),g=n(991),m=n(67),I=n(735),B=n(969),_=n(733),E=n(750),b=n(992),y=n(993),v=n(994).set,T=n(1050),C=n(995),N=n(1051),V=n(946),S=n(955),x=n(970),w=n(734),A=n(965),L=n(50)("species"),k="Promise",D=w.get,M=w.set,P=w.getterFor(k),R=h,H=u.TypeError,O=u.document,F=u.process,Y=u.fetch,W=F&&F.versions,G=W&&W.v8||"",j=V.f,Z=j,X="process"==_(F),J=!!(O&&O.createEvent&&u.dispatchEvent),K="unhandledrejection",Q=A(k,function(){var e=R.resolve(1),t=function(){},n=(e.constructor={})[L]=function(e){e(t,t)};return!((X||"function"==typeof PromiseRejectionEvent)&&(!l||e["finally"])&&e.then(t)instanceof n&&0!==G.indexOf("6.6")&&-1===x.indexOf("Chrome/66"))}),U=Q||!b(function(e){R.all(e)["catch"](function(){})}),z=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},q=function(p,d,f){var g;d.notified||(d.notified=!0,g=d.reactions,T(function(){for(var e=d.value,t=1==d.state,n=0;g.length>n;){var i,r,a,o=g[n++],s=t?o.ok:o.fail,l=o.resolve,u=o.reject,c=o.domain;try{s?(t||(2===d.rejection&&ne(p,d),d.rejection=1),!0===s?i=e:(c&&c.enter(),i=s(e),c&&(c.exit(),a=!0)),i===o.promise?u(H("Promise-chain cycle")):(r=z(i))?r.call(i,l,u):l(i)):u(e)}catch(h){c&&!a&&c.exit(),u(h)}}d.reactions=[],d.notified=!1,f&&!d.rejection&&ee(p,d)}))},$=function(e,t,n){var i,r;J?((i=O.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),u.dispatchEvent(i)):i={promise:t,reason:n},(r=u["on"+e])?r(i):e===K&&N("Unhandled promise rejection",n)},ee=function(n,i){v.call(u,function(){var e,t=i.value;if(te(i)&&(e=S(function(){X?F.emit("unhandledRejection",t,n):$(K,n,t)}),i.rejection=X||te(i)?2:1,e.error))throw e.value})},te=function(e){return 1!==e.rejection&&!e.parent},ne=function(e,t){v.call(u,function(){X?F.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)})},ie=function(t,n,i,r){return function(e){t(n,i,e,r)}},re=function(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=2,q(e,t,!0))},ae=function(n,i,r,e){if(!i.done){i.done=!0,e&&(i=e);try{if(n===r)throw H("Promise can't be resolved itself");var a=z(r);a?T(function(){var e={done:!1};try{a.call(r,ie(ae,n,e,i),ie(re,n,e,i))}catch(t){re(n,e,t,i)}}):(i.value=r,i.state=1,q(n,i,!1))}catch(t){re(n,{done:!1},t,i)}}};Q&&(R=function Promise(t){B(this,R,k),I(t),r.call(this);var n=D(this);try{t(ie(ae,this,n),ie(re,this,n))}catch(i){re(this,n,i)}},(r=function Promise(t){M(this,{type:k,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:undefined})}).prototype=d(R.prototype,{then:function(e,t){var n=P(this),i=j(y(this,R));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=X?F.domain:undefined,n.parent=!0,n.reactions.push(i),0!=n.state&&q(this,n,!1),i.promise},"catch":function(e){return this.then(undefined,e)}}),i=function(){var e=new r,t=D(e);this.promise=e,this.resolve=ie(ae,e,t),this.reject=ie(re,e,t)},V.f=j=function(e){return e===R||e===a?new i:Z(e)},l||"function"!=typeof h||(o=h.prototype.then,p(h.prototype,"then",function(e,t){var n=this;return new R(function(e,t){o.call(n,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof Y&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return C(R,Y.apply(u,arguments))}}))),s({global:!0,wrap:!0,forced:Q},{Promise:R}),f(R,k,!1,!0),g(k),a=c[k],s({target:k,stat:!0,forced:Q},{reject:function(e){var t=j(this);return t.reject.call(undefined,e),t.promise}}),s({target:k,stat:!0,forced:l||Q},{resolve:function(e){return C(l&&this===a?R:this,e)}}),s({target:k,stat:!0,forced:U},{all:function(e){var s=this,t=j(s),l=t.resolve,u=t.reject,n=S(function(){var i=I(s.resolve),r=[],a=0,o=1;E(e,function(e){var t=a++,n=!1;r.push(undefined),o++,i.call(s,e).then(function(e){n||(n=!0,r[t]=e,--o||l(r))},u)}),--o||l(r)});return n.error&&u(n.value),t.promise},race:function(e){var n=this,i=j(n),r=i.reject,t=S(function(){var t=I(n.resolve);E(e,function(e){t.call(n,e).then(i.resolve,r)})});return t.error&&r(t.value),i.promise}})},function(e,t,n){var i=n(50),r=n(945),a=i("iterator"),o=Array.prototype;e.exports=function(e){return e!==undefined&&(r.Array===e||o[a]===e)}},function(e,t,n){var i=n(984),r=n(945),a=n(50)("iterator");e.exports=function(e){if(e!=undefined)return e[a]||e["@@iterator"]||r[i(e)]}},function(e,t,n){var o=n(68);e.exports=function(e,t,n,i){try{return i?t(o(n)[0],n[1]):t(n)}catch(a){var r=e["return"];throw r!==undefined&&o(r.call(e)),a}}},function(e,t,n){var i,r,a,o,s,l,u,c,h=n(45),p=n(947).f,d=n(733),f=n(994).set,g=n(970),m=h.MutationObserver||h.WebKitMutationObserver,I=h.process,B=h.Promise,_="process"==d(I),E=p(h,"queueMicrotask"),b=E&&E.value;b||(i=function(){var e,t;for(_&&(e=I.domain)&&e.exit();r;){t=r.fn,r=r.next;try{t()}catch(n){throw r?o():a=undefined,n}}a=undefined,e&&e.enter()},o=_?function(){I.nextTick(i)}:m&&!/(iphone|ipod|ipad).*applewebkit/i.test(g)?(s=!0,l=document.createTextNode(""),new m(i).observe(l,{characterData:!0}),function(){l.data=s=!s}):B&&B.resolve?(u=B.resolve(undefined),c=u.then,function(){c.call(u,i)}):function(){f.call(h,i)}),e.exports=b||function(e){var t={fn:e,next:undefined};a&&(a.next=t),r||(r=t,o()),a=t}},function(e,t,n){var i=n(45);e.exports=function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){"use strict";var i=n(51),r=n(746),a=n(989),o=n(747),s=n(993),l=n(995),u=n(267);i({target:"Promise",proto:!0,real:!0},{"finally":function(t){var n=s(this,o("Promise")),e="function"==typeof t;return this.then(e?function(e){return l(n,t()).then(function(){return e})}:t,e?function(e){return l(n,t()).then(function(){throw e})}:t)}}),r||"function"!=typeof a||a.prototype["finally"]||u(a.prototype,"finally",o("Promise").prototype["finally"])},function(e,t,n){"use strict";var i=n(51),r=n(69),a=n(953),o=n(968),s=n(748),l=n(100),u=n(940),c=n(750),h=n(99),p=n(68),d=n(734),f=d.set,g=d.getterFor("AggregateError"),m=function(e,t){var n=this;if(!(n instanceof m))return new m(e,t);o&&(n=o(new Error(t),a(n)));var i=[];return c(e,i.push,i),r?f(n,{errors:i,type:"AggregateError"}):n.errors=i,t!==undefined&&h(n,"message",String(t)),n};m.prototype=s(Error.prototype,{constructor:u(5,m),message:u(5,""),name:u(5,"AggregateError"),toString:u(5,function(){var e=(e=p(this).name)===undefined?"AggregateError":String(e),t=this.message;return e+": "+(t=t===undefined?"":String(t))})}),r&&l.f(m.prototype,"errors",{get:function(){return g(this).errors},configurable:!0}),i({global:!0},{AggregateError:m})},function(e,t,n){n(996)},function(e,t,n){"use strict";var i=n(51),r=n(946),a=n(955);i({target:"Promise",stat:!0},{"try":function(e){var t=r.f(this),n=a(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},function(e,t,n){"use strict";var i=n(51),h=n(735),p=n(747),r=n(946),a=n(955),d=n(750),f="No one promise resolved";i({target:"Promise",stat:!0},{any:function(e){var l=this,t=r.f(l),u=t.resolve,c=t.reject,n=a(function(){var i=h(l.resolve),r=[],a=0,o=1,s=!1;d(e,function(e){var t=a++,n=!1;r.push(undefined),o++,i.call(l,e).then(function(e){n||s||(s=!0,u(e))},function(e){n||s||(n=!0,r[t]=e,--o||c(new(p("AggregateError"))(r,f)))})}),--o||c(new(p("AggregateError"))(r,f))});return n.error&&c(n.value),t.promise}})},function(e,t,n){e.exports=n(1058)},function(e,t,n){n(1059);var i=n(954);e.exports=i("String","replace")},function(e,t,n){"use strict";var i=n(1060),v=n(68),T=n(749),C=n(951),N=n(952),a=n(948),V=n(1062),S=n(1063),x=Math.max,w=Math.min,A=Math.floor,L=/\$([$&'`]|\d\d?|<[^>]*>)/g,k=/\$([$&'`]|\d\d?)/g;i("replace",2,function(r,b,y){return[function(e,t){var n=a(this),i=e==undefined?undefined:e[r];return i!==undefined?i.call(e,n,t):b.call(String(n),e,t)},function(e,t){var n=y(b,e,this,t);if(n.done)return n.value;var i=v(e),r=String(this),a="function"==typeof t;a||(t=String(t));var o,s=i.global;s&&(o=i.unicode,i.lastIndex=0);for(var l=[];;){var u=S(i,r);if(null===u)break;if(l.push(u),!s)break;""===String(u[0])&&(i.lastIndex=V(r,C(i.lastIndex),o))}for(var c,h="",p=0,d=0;d<l.length;d++){u=l[d];for(var f=String(u[0]),g=x(w(N(u.index),r.length),0),m=[],I=1;I<u.length;I++)m.push((c=u[I])===undefined?c:String(c));var B,_=u.groups,E=a?(B=[f].concat(m,g,r),_!==undefined&&B.push(_),String(t.apply(undefined,B))):function(a,o,s,l,u,e){var c=s+a.length,h=l.length,t=k;u!==undefined&&(u=T(u),t=L);return b.call(e,t,function(e,t){var n;switch(t.charAt(0)){case"$":return"$";case"&":return a;case"`":return o.slice(0,s);case"'":return o.slice(c);case"<":n=u[t.slice(1,-1)];break;default:var i=+t;if(0==i)return e;if(h<i){var r=A(i/10);return 0===r?e:r<=h?l[r-1]===undefined?t.charAt(1):l[r-1]+t.charAt(1):e}n=l[i-1]}return n===undefined?"":n})}(f,r,g,m,_,t);p<=g&&(h+=r.slice(p,g)+E,p=g+f.length)}return h+r.slice(p)}]})},function(e,t,n){"use strict";var h=n(99),p=n(267),d=n(65),f=n(50),g=n(997),m=f("species"),I=!d(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),B=!d(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});e.exports=function(n,e,t,i){var a,r,o,s,l=f(n),u=!d(function(){var e={};return e[l]=function(){return 7},7!=""[n](e)}),c=u&&!d(function(){var e=!1,t=/a/;return t.exec=function(){return e=!0,null},"split"===n&&(t.constructor={},t.constructor[m]=function(){return t}),t[l](""),!e});u&&c&&("replace"!==n||I)&&("split"!==n||B)||(a=/./[l],o=(r=t(l,""[n],function(e,t,n,i,r){return t.exec===g?u&&!r?{done:!0,value:a.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}))[0],s=r[1],p(String.prototype,n,o),p(RegExp.prototype,l,2==e?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)}),i&&h(RegExp.prototype[l],"sham",!0))}},function(e,t,n){"use strict";var i=n(68);e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var i=n(986).charAt;e.exports=function(e,t,n){return t+(n?i(e,t).length:1)}},function(e,t,n){var r=n(733),a=n(997);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return a.call(e,t)}},function(e,t,n){n(1065),n(983),n(985),n(988);var i=n(192);e.exports=i.Map},function(e,t,n){"use strict";var i=n(1066),r=n(1069);e.exports=i("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:undefined)}},r,!0)},function(e,t,n){"use strict";var m=n(51),I=n(45),B=n(965),_=n(267),E=n(998),b=n(750),y=n(969),v=n(67),T=n(65),C=n(992),N=n(943),V=n(1068);e.exports=function(i,e,t,r,a){var n,o,s,l,u,c=I[i],h=c&&c.prototype,p=c,d=r?"set":"add",f={},g=function(e){var n=h[e];_(h,e,"add"==e?function(e){return n.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(a&&!v(e))&&n.call(this,0===e?0:e)}:"get"==e?function(e){return a&&!v(e)?undefined:n.call(this,0===e?0:e)}:"has"==e?function(e){return!(a&&!v(e))&&n.call(this,0===e?0:e)}:function(e,t){return n.call(this,0===e?0:e,t),this})};return B(i,"function"!=typeof c||!(a||h.forEach&&!T(function(){(new c).entries().next()})))?(p=t.getConstructor(e,i,r,d),E.REQUIRED=!0):B(i,!0)&&(o=(n=new p)[d](a?{}:-0,1)!=n,s=T(function(){n.has(1)}),l=C(function(e){new c(e)}),u=!a&&T(function(){for(var e=new c,t=5;t--;)e[d](t,t);return!e.has(-0)}),l||(((p=e(function(e,t){y(e,p,i);var n=V(new c,e,p);return t!=undefined&&b(t,n[d],n,r),n})).prototype=h).constructor=p),(s||u)&&(g("delete"),g("has"),r&&g("get")),(u||o)&&g(d),a&&h.clear&&delete h.clear),f[i]=p,m({global:!0,forced:p!=c},f),N(p,i),a||t.setStrong(p,i,r),p}},function(e,t,n){var i=n(65);e.exports=!i(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(e,t,n){var a=n(67),o=n(968);e.exports=function(e,t,n){var i,r;return o&&"function"==typeof(i=t.constructor)&&i!==n&&a(r=i.prototype)&&r!==n.prototype&&o(e,r),e}},function(e,t,n){"use strict";var u=n(100).f,c=n(748),h=n(990),p=n(944),d=n(969),f=n(750),o=n(967),s=n(991),g=n(69),m=n(998).fastKey,i=n(734),I=i.set,B=i.getterFor;e.exports={getConstructor:function(e,n,i,r){var a=e(function(e,t){d(e,a,n),I(e,{type:n,index:c(null),first:undefined,last:undefined,size:0}),g||(e.size=0),t!=undefined&&f(t,e[r],e,i)}),s=B(n),o=function(e,t,n){var i,r,a=s(e),o=l(e,t);return o?o.value=n:(a.last=o={index:r=m(t,!0),key:t,value:n,previous:i=a.last,next:undefined,removed:!1},a.first||(a.first=o),i&&(i.next=o),g?a.size++:e.size++,"F"!==r&&(a.index[r]=o)),e},l=function(e,t){var n,i=s(e),r=m(t);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==t)return n};return h(a.prototype,{clear:function(){for(var e=s(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=undefined),delete t[n.index],n=n.next;e.first=e.last=undefined,g?e.size=0:this.size=0},"delete":function(e){var t,n,i=s(this),r=l(this,e);return r&&(t=r.next,n=r.previous,delete i.index[r.index],r.removed=!0,n&&(n.next=t),t&&(t.previous=n),i.first==r&&(i.first=t),i.last==r&&(i.last=n),g?i.size--:this.size--),!!r},forEach:function(e){for(var t,n=s(this),i=p(e,1<arguments.length?arguments[1]:undefined,3);t=t?t.next:n.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),h(a.prototype,i?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),g&&u(a.prototype,"size",{get:function(){return s(this).size}}),a},setStrong:function(e,t,n){var i=t+" Iterator",r=B(t),a=B(i);o(e,t,function(e,t){I(this,{type:i,target:e,state:r(e),kind:t,last:undefined})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=undefined,{value:undefined,done:!0})},n?"entries":"values",!n,!0),s(t)}}},function(t,e,n){(function(e){t.exports=e.Fix=n(1071)}).call(this,n(13))},function(e,t,n){(function(Z){function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(e,d){"use strict";d="default"in d?d["default"]:d;var t=void 0,f={$accessors:t,$vbthis:t,$vbsetter:t,$vm:t},p=["$accessors","$vbthis","$vbsetter","$vm"],i=[];function s(e,t,n){}function n(e){return"function"==typeof e&&/native code/.test(e.toString())}d.each(["slice","splice"],function(e){i[e]=Array.prototype[e]}),Array.prototype.splice=function(){this.__ref__=l();for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.splice.apply(this,t)};var r=/\d\.\d{4}/;function l(e){var t=0<arguments.length&&e!==undefined?e:"bi";return String(Math.random()+Math.random()).replace(r,t)}"undefined"!=typeof navigator&&/(msie|trident)/i.test(navigator.userAgent.toLowerCase())&&function(){if("undefined"==typeof navigator)return;var e=navigator.userAgent.toLowerCase(),t=e.match(/(?:msie\s([\w.]+))/),n=e.match(/(?:trident.*rv:([\w.]+))/);t&&n&&t[1]&&n[1]?Math.max(+t[1],+n[1]):t&&t[1]?t[1]:n&&n[1]&&n[1]}();var a=Object.prototype.toString;function g(e){return"[object Object]"===a.call(e)}var o=/[^\w.$]/;function u(e){var t=void 0;if(d.isArray(e)){t=[];for(var n=0,i=e.length;n<i;n++)t[n]=u(e[n])}else if(e&&g(e))for(var r in t={},e)-1===p.indexOf(r)&&(t[r]=u(e[r]));else t=e;return t}function c(e){if(null===e)return null;if(Array.isArray(e)){var t=[].concat(e);return e.__ref__!==undefined&&(t.__ref__=e.__ref__),t}return u(e)}var h,m,I,B,E,b,y=(E=!(B=[]),b=void 0,b=void 0!==Z&&n(Z)?function b(){Z(v)}:"undefined"==typeof MessageChannel||!n(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString()?"undefined"!=typeof Promise&&n(Promise)?(h=Promise.resolve(),function b(){h.then(v)}):function b(){setTimeout(v,0)}:(m=new MessageChannel,I=m.port2,m.port1.onmessage=v,function b(){I.postMessage(1)}),function(t,n){var i=void 0;if(B.push(function(){if(t)try{t.call(n)}catch(e){console.error(e)}else i&&i(n)}),E||(E=!0,b()),!t&&"undefined"!=typeof Promise)return new Promise(function(e,t){i=e})});function v(){E=!1;for(var e=B.slice(0),t=B.length=0;t<e.length;t++)e[t]()}function T(e,t,n){"object"==typeof t&&(n=t,t=e,e=function(){return t.apply(this,arguments)});var i=function i(){},r=t.prototype;return i.prototype=r,e.prototype=new i,e.superclass=r,d.extend(e.prototype,n,{superclass:t}),e}Object.prototype.toString,function gzd(t,n,i,r){t instanceof d&&t._wrapped,n instanceof d&&n._wrapped;var a=fzd.call(t);if(a!==fzd.call(n))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return dzd.valueOf.call(t)===dzd.valueOf.call(n)}var o="[object Array]"===a;if(!o){if("object"!=typeof t||"object"!=typeof n)return!1;var s=t.constructor,l=n.constructor;if(s!==l&&!(d.isFunction(s)&&s instanceof s&&d.isFunction(l)&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}0;for(var u=(i||[]).length;u--;)if(i[u]===t)return r[u]===n;if(i.push(t),r.push(n),o){if(t.length!==n.length)return!1;for(;u--;)if(!hzd(t[u],n[u],i,r))return!1}else{var c,h=d.keys(t),u=h.length;if(d.keys(n).length!==u)return!1;for(;u--;){if(h[u],-1!==p.indexOf(c))return!0;if(-1===Object.keys(n).indexOf(c)||!hzd(t[c],n[c],i,r))return!1}}return i.pop(),r.pop(),!0},function hzd(t,n,i,r){if(t===n)return 0!==t||1/t==1/n;if(null==t||null==n)return!1;if(t!=t)return n!=n;var a=typeof t;return("function"==a||"object"==a||"object"==typeof n)&&("function"==a||gzd(t,n,i,r))};function C(e,t){if(e===t)return 1;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return;var n,i,r=void 0,a=void 0;if(Array.isArray(e)){if((r=e.length)!==t.length)return;for(a=r;0!=a--;)if(!C(e[a],t[a]))return;return 1}if(e.constructor===RegExp)return 1;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((r=(i=Object.keys(e)).length)!==Object.keys(t).length)return;for(a=r;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return;for(a=r;0!=a--;)if(n=i[a],-1===p.indexOf(n)&&!C(e[n],t[n]))return;return 1}return"function"==typeof e||e!=e&&t!=t}var N={};var V=void 0,S={"||":V,"&&":V,"(":V,")":V};function x(r,e,a){var s=3<arguments.length&&arguments[3]!==undefined?arguments[3]:{},l=r;!l.$watch&&l.$vm&&(l=l.$vm),g(a)&&(a=(s=a).handler),"string"==typeof a&&(a=l[a]),(s=s||{}).user=!0;var o=void 0;if(d.isFunction(e)||!(o=e.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g))||1===o.length&&!/\*/.test(e))return l.$watch(e,a,s),[];var u=o.slice(),c=!1,h=!1,p=function p(e,t,n,i){!0!==c&&(u[e]=!0,function(e){for(var t="",n=0,i=e.length;n<i;n++)d.isBoolean(e[n])||d.has(S,e[n])?t+=e[n]:t+="false";return new Function("return "+t)()}(u)&&(c=!0,a.call(r,t,n,i)),s&&s.sync?(h=c=!1,u=o.slice()):h||(h=!0,y(function(){h=c=!1,u=o.slice()})))};return d.each(o,function(e,i){if(!d.has(S,e))if(/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(e)||"**"===e){var t=/\*\*$/.test(e);e=t?e.replace(".**",""):e.replace(".*","");var n=t?e:function(){var n={};return d.each(l.model,function(e,t){t in f||(n[t]=e)}),n};l.$watch(n,function(e,t,n){p(i,e,t,d.extend({index:i},n))},d.extend(s,{deep:t}))}else{if(/\*\*$|\*$/.test(e))throw new Error("not support");var a,o;/\*/.test(e)?(a=e.split("."),o=function o(){for(var t={root:l.model},r=function r(e,n){var i={};"*"===a[n]?d.each(t,function(e,n){d.each(e,function(e,t){n+t in f||(i[n+t]=e)})}):d.each(t,function(e,t){t+a[n]in f||(i[t+a[n]]=e[a[n]])}),t=i},e=0,n=a.length;e<n;e++)r(n,e);return t},l.$watch(o,function(e,t,n){p(i,e,t,d.extend({index:i},n))},s)):l.$watch(e,function(e,t,n){p(i,e,t,d.extend({index:i},n))},s)}}),[]}var w={},A={},L=function L(){},k=(D.prototype.getInstance=function(){return this},D);function D(e){var t=e.get,n=e.last,i=e.listener,r=e.sync,a=(e.deep,e.id);return X(this,D),this.id=a,this.get=t,this.last=c(n),this.listener=i||L,this.sync=r||!1,{id:this.id,get:this.get,last:this.last,listener:this.listener}}function M(e,t,n,i){var r=3<arguments.length&&i!==undefined?i:{};g(n)&&(n=(r=n).handler),"string"==typeof n&&(n=e[n]);var a=d.isFunction(t)?d.bind(t,e):d.bind(function(){return function(e){if(!o.test(e)){var n=e.split(".");return function(e){for(var t=0;t<n.length;t++){if(!e)return;e=e[n[t]]}return e}}}("model."+t)(e)},e);return new k({get:a,listener:d.bind(n,e),last:a(),sync:r.sync,deep:r.deep,id:r.id})}function P(t,n){return function(){var e=t.apply(n,[].concat(Array.prototype.slice.call(arguments)));return n.$digest(),e}}function R(i,e){var t=1<arguments.length&&e!==undefined?e:[];d.each(t.reverse(),function(e){var t=N[e];for(var n in t)"function"==typeof t[n]&&(d.has(i,n)||(i[n]=P(t[n],i)))})}function H(r,e){var i=r._contextWatchers={};d.each(e,function(t){var n=function(i){for(var e=r._parent;e;){if(e.childContext&&-1<e.childContext.indexOf(i))return e.$watch(i,function(e,t,n){r._contextWatchers[i]&&(r.model[i]=e,r._contextWatchers[i].last=c(e),r.$digest())},{id:r._modelHashId+"-"+i}),{p:e,value:e.model[i]};e=e._parent}}(t);n&&(r.model[t]=n.p?n.p.model[t]:undefined,i[t]=new k({id:n.p._modelHashId+"-"+t,get:function(){return r.model[t]},last:r.model[t],listener:d.bind(function(e){n.p.model[t]=e,n.p.$digest()},n.p)}))})}function O(e){for(var t=!0,n=!0,i=!0,r=10;t&&0<r;r--)t=function(i){var r=!1;return d.each(i._stateWatchers,function(e,t){var n=e.get();C(n,e.last)||(i.model[t]=n,r=!0,e.last=c(n))}),r}(e);for(var a=10;n&&0<a;a--)n=function(a){var o=!1;return d.each(a._contextWatchers,function(e,t){var n,i=e.get(),r=e.last;C(i,r)||(n={id:e.id,cb:d.bind(e.listener,a,i,r,a)},a.contextListeners.push(n),a.model[t]=i,o=!0,e.last=c(i))}),o}(e);for(var o=10;i&&0<o;o--)i=function(r){var a=!1,o=[],s=[];return d.each(r._computedOrder,function(e){var t=r._computedWatchers[e];try{var n=t.get();C(n,t.last)?s.push(e):(r.model[e]=n,a=!0,o.push(e),t.last=c(n))}catch(i){a=!0,o.push(e)}}),r._computedOrder=[].concat(s,o),a}(e)}var F,Y=(F={},function(e,t){var n=e.id,i=e.cb;n&&F[n]||(y(function(){i(),F[n]=!1},t),F[n]=!0)});var W=(G.prototype._constructor=function(e){this.alive=!0,this.options=e||{},this.model={$vm:this},this._modelHashId=l("model"),this.syncListeners=[],this.asyncListeners=[],this.contextListeners=[],this._parent=G.target;var t=d.isFunction(this.state)?this.state():this.state,n=this.computed,i=this.context,r=(this.childContext,this.watch),a=this.actions,o=this.mixins;i&&H(this,i),R(this,o),this.init(),function(n,i){var r=n._stateWatchers={};for(var e in i)n.model[e]=i[e];var a=function a(e){var t=i[e];r[e]=new k({id:n._modelHashId+"-"+e,get:function(){return n.model[e]},last:t,listener:n.options.defaultCallback||L})};for(var t in i)a(t)}(this,t),function(e,t){var n=e._computedWatchers={},i=e._computedOrder=[];for(var r in t){var a=t[r],o=e;i.push(r),n[r]=new k({id:e._modelHashId+"-"+r,get:d.bind(a,o),last:undefined,listener:L})}}(this,n),O(this),function(e,t){for(var n in e._watchers||(e._watchers=[]),t){var i=t[n];if(d.isArray(i))for(var r=0;r<i.length;r++)x(e,n,i[r]);else x(e,n,i)}}(this,r),function(e,t){for(var n in t)e[n]=null==t[n]?s:P(t[n],e)}(this,a),this.created&&this.created(),w[this._modelHashId]=this},G.prototype._init=function(){},G.prototype.init=function(){this._init()},G.prototype.destroy=function(){this.alive=!1,w[this._modelHashId]=null,this._watchers&&(this._watchers=[]),this._computedWatchers&&(this._computedWatchers=[]),this._stateWatchers&&(this._stateWatchers=[]),this._contextWatchers&&(this._contextWatchers=[]),this.destroyed&&this.destroyed()},G.prototype.$watch=function(e,t,n){var i=M(this,e,t,n);this._watchers.push(i)},G.prototype.$digest=function(){O(this),function(r){var a=[].concat(r.syncListeners||[]),o=[].concat(r.asyncListeners||[]),e=[].concat(r.contextListeners||[]);r.asyncListeners=[],r.syncListeners=[];var t=[].concat(r._watchers);d.each(t,function(e){var t,n,i;e&&(C(t=e.get(),n=e.last)||(i={id:e.id,cb:d.bind(e.listener,r,t,n,r)},!0===e.sync?a.push(i):o.push(i),e.last=c(t)))}),d.each(a,function(e){e.cb()}),0===e.length&&0===o.length||y(function(){d.each(BI.uniqBy(e.reverse(),"id").reverse(),function(e){e.cb()}),d.each(o,function(e){e.cb()})})}(this),this.options.define||d.each(A,function(e){e&&e.$digest&&e.$digest()})},G.prototype.getModelID=function(){return this._modelHashId},G);function G(){X(this,G)}function j(){return w}e.version="2.0",e.$$skipArray=f,e.mixin=function(e,t){N[e]=_.cloneDeep(t)},e.toJSON=u,e.nextListener=Y,e.Model=W,e.getAllModelInstances=j,e.refreshAll=function(){d.each(w,function(e){e&&e.$digest&&e.$digest()})},e.define=function(e){var t=new(T(W,{state:function(){return e}}));return t._constructor({define:!0}),(A[t.getModelID()]=t).model},e.inherit=T,e.watch=x,e.__esModule=!0})(t,(n(999),n(999)))}).call(this,n(52).setImmediate)},function(e,t){!function(){function a(e,t,n,i){return BI.isPlainObject(n)&&(n=(i=n).handler),i=i||{},Fix.watch(e.model,t,_.bind(n,e),BI.extend(i,{store:e.store}))}var n=null,t=[];function r(e){n&&t.push(n),Fix.Model.target=n=e}function o(){Fix.Model.target=n=t.pop()}var i=null,s=[];function l(e){i&&s.push(i),Fix.Model.context=i=e}function u(){Fix.Model.context=i=s.pop()}var c=Fix.watch;Fix.watch=function(e,t,n,i){return BI.isPlainObject(n)&&(n=(i=n).handler),"string"==typeof n&&(n=e[n]),c.call(this,e,t,function(){i&&i.store&&r(i.store);var e=n.apply(this,arguments);return i&&i.store&&o(),e},i)};var h=BI.createWidget;function p(){var e,t=!1;return _global.Fix&&this._store&&((e=function(e){if(null!=n)return n;for(var t=e=e||i;t&&!(t instanceof Fix.Model||t.store||t.__cacheStore);)t=t._parent||t.options&&t.options.element;return t?t instanceof Fix.Model?e.__cacheStore=t:(e.__cacheStore=t.store||t.__cacheStore,t.__cacheStore||t.store):void 0}(this.options.context||this.options.element))&&(r(e),t=!0),this.store=this._store(),this.store&&(this.store._widget=this),t&&o(),t=!1,r(this.store),this.store instanceof Fix.Model?this.model=this.store.model:this.model=this.store,t=!0),t}BI.createWidget=function(e,t,n){var i=!1;BI.isWidget(t)?(l(t),i=!0):null!=n&&(l(n),i=!0);var r=h.apply(this,arguments);return i&&u(),r},_.each(["populate","addItems","prependItems"],function(e){var t=BI.Loader.prototype[e];BI.Loader.prototype[e]=function(){l(this);var e=t.apply(this,arguments);return u(),e}}),BI.Widget.prototype._initRender=function(){this.beforeInit?(this.__asking=!0,this.beforeInit(BI.bind(function(){this.model&&this.model.$vm&&this.model.$vm.$digest(),this._render()},this)),!0===this.__asking&&(this.__async=!0)):this._render()};var d=BI.Widget.prototype._init;BI.Widget.prototype._init=function(){var e=p.call(this);d.apply(this,arguments),e&&o()};var f=BI.Widget.prototype._render;BI.Widget.prototype._render=function(){var e=!1;_global.Fix&&this._store&&(e=!0,r(this.store),function(e,t){for(var n in e._watchers||(e._watchers=[]),t){var i=t[n];if(BI.isArray(i))for(var r=0;r<i.length;r++)e._watchers.push(a(e,n,i[r]));else e._watchers.push(a(e,n,i))}}(this,this.watch)),f.apply(this,arguments),e&&o()};var e=BI.Widget.prototype.__d;BI.Widget.prototype.__d=function(){e.apply(this,arguments),this.store&&BI.isFunction(this.store.destroy)&&this.store.destroy(),BI.each(this._watchers,function(e,t){t=BI.isArray(t)?t:[t],BI.each(t,function(e,t){t()})}),this._watchers&&(this._watchers=[]),this.store&&(this.store._parent&&(this.store._parent=null),this.store._widget&&(this.store._widget=null),this.store=null),delete this.__cacheStore},_.each(["_mount"],function(e){var n=BI.Widget.prototype[e];n&&(BI.Widget.prototype[e]=function(){this.store&&r(this.store);try{var e=n.apply(this,arguments)}catch(t){console.error(t)}return this.store&&o(),e})});var g,m,I,B=function(){BI.nextTick(function(){Fix&&Fix.refreshAll&&Fix.refreshAll()})};$(document).ajaxComplete(B),BI.history&&(g=BI.history.navigate,BI.history.navigate=function(){g.apply(this,arguments),BI.defer(function(){B()},200)},m=window.history.back,window.history.back=function(){m.apply(this,arguments),BI.defer(function(){B()},200)}),BI.Router&&(I=BI.Router.prototype.execute,BI.Router.prototype.execute=function(){I.apply(this,arguments),B()}),_.each(["each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","keys","allKeys","values","pairs","invert","mapObject","findKey","pick","omit","tap"],function(e){var i=BI[e];BI[e]=function(e,n,t){return"function"==typeof n?i(e,function(e,t){if(!(e in Fix.$$skipArray))return n.apply(this,arguments)},t):i.apply(this,arguments)}}),BI.isEmpty=function(e){return BI.isPlainObject(e)&&e.__ob__?0===BI.keys(e).length:_.isEmpty(e)},BI.keys=function(e){for(var t=_.keys(e),n=[],i=0;i<t.length;i++)t[i]in Fix.$$skipArray||n.push(t[i]);return n},BI.values=function(e){for(var t=BI.keys(obj),n=t.length,i=[],r=0;r<n;r++)i[r]=obj[t[r]];return i},BI.extend=function(){var e=Array.prototype.slice.call(arguments);if(e.length<1)return{};for(var n=e[0],t=1;t<e.length;)BI.each(e[t],function(e,t){n[e]=t}),t++;return n},BI.size=function(e){return BI.isPlainObject(e)&&e.__ob__?BI.keys(e).length:_.size(e)},BI.isEmptyObject=function(e){return 0===BI.size(e)},BI.deepClone=function(e){return Fix.toJSON(e)},Fix.set=function(e,t,n){try{e&&(e[t]=n)}catch(i){}finally{return _.cloneDeep(e)}},Fix.del=function(e,t){try{delete e[t]}catch(n){}finally{return _.cloneDeep(e)}},BI.watch=Fix.watch}()},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){n(101),n(686),n(687),n(688),n(689),n(690),n(691),n(1002),n(1010),n(1014),n(1018),n(1024),n(1027),n(1031),n(1034),n(1038),n(1057),n(1064),n(692),n(693),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(208),n(209),n(102),n(105),n(107),n(301),n(302),n(108),n(109),n(110),n(111),n(112),n(113),n(303),n(304),n(114),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(305),n(306),n(307),n(308),n(309),n(122),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(123),n(321),n(124),n(125),n(126),n(127),n(128),n(129),n(322),n(323),n(324),n(325),n(694),n(695),n(696),n(697),n(698),n(699),n(701),n(702),n(703),n(326),n(130),n(327),n(328),n(329),n(330),n(331),n(332),n(333),n(334),n(335),n(336),n(337),n(338),n(339),n(340),n(341),n(342),n(343),n(344),n(345),n(346),n(347),n(348),n(349),n(350),n(351),n(352),n(353),n(354),n(355),n(356),n(357),n(358),n(359),n(360),n(361),n(362),n(363),n(364),n(365),n(366),n(367),n(368),n(369),n(131),n(132),n(133),n(1070),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(220),n(221),n(222),n(223),n(224),n(225),n(226),n(227),n(228),n(229),n(230),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(248),n(249),n(250),n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(705),n(370),n(371),n(372),n(373),n(374),n(375),n(376),n(377),n(706),n(707),n(708),n(709),n(710),n(711),n(378),n(379),n(380),n(381),n(382),n(383),n(384),n(385),n(386),n(387),n(388),n(389),n(390),n(391),n(392),n(393),n(394),n(395),n(396),n(397),n(398),n(399),n(400),n(401),n(402),n(403),n(404),n(405),n(406),n(407),n(408),n(409),n(410),n(411),n(412),n(413),n(414),n(415),n(416),n(417),n(418),n(419),n(420),n(421),n(422),n(423),n(712),n(424),n(425),n(426),n(427),n(428),n(429),n(430),n(431),n(432),n(433),n(434),n(435),n(436),n(713),n(714),n(715),n(716),n(437),n(438),n(439),n(440),n(441),n(442),n(443),n(444),n(445),n(446),n(447),n(448),n(449),n(450),n(451),n(452),n(453),n(454),n(455),n(456),n(457),n(458),n(459),n(460),n(461),n(462),n(463),n(464),n(465),n(466),n(467),n(717),n(718),n(719),n(720),n(721),n(722),n(723),n(724),n(725),n(726),n(727),n(728),n(468),n(469),n(470),n(471),n(472),n(473),n(474),n(475),n(476),n(477),n(478),n(479),n(480),n(481),n(482),n(483),n(484),n(485),n(486),n(487),n(488),n(489),n(490),n(491),n(492),n(493),n(494),n(495),n(496),n(497),n(498),n(499),n(500),n(501),n(502),n(503),n(504),n(505),n(506),n(729),n(730),n(731),n(507),n(508),n(509),n(510),n(511),n(512),n(513),n(514),n(134),n(135),n(136),n(137),n(138),n(139),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(515),n(516),n(517),n(518),n(519),n(520),n(521),n(522),n(523),n(524),n(525),n(526),n(527),n(528),n(529),n(530),n(531),n(532),n(533),n(534),n(535),n(536),n(537),n(538),n(539),n(540),n(541),n(542),n(543),n(544),n(545),n(546),n(547),n(548),n(549),n(550),n(551),n(552),n(553),n(554),n(555),n(556),n(557),n(558),n(559),n(560),n(561),n(562),n(563),n(564),n(565),n(566),n(567),n(568),n(569),n(570),n(571),n(572),n(573),n(574),n(575),n(576),n(577),n(578),n(579),n(580),n(581),n(582),n(583),n(584),n(585),n(586),n(587),n(588),n(589),n(590),n(591),n(592),n(593),n(594),n(595),n(596),n(597),n(598),n(599),n(600),n(601),n(602),n(603),n(604),n(605),n(606),n(607),n(608),n(609),n(610),n(611),n(612),n(613),n(614),n(615),n(616),n(617),n(618),n(619),n(620),n(621),n(622),n(623),n(624),n(625),n(626),n(627),n(628),n(629),n(630),n(631),n(632),n(633),n(634),n(635),n(636),n(637),n(638),n(639),n(640),n(641),n(642),n(643),n(644),n(645),n(646),n(647),n(648),n(649),n(650),n(651),n(652),n(653),n(654),n(655),n(656),n(657),n(658),n(659),n(660),n(661),n(662),n(663),n(664),n(665),n(666),n(667),n(668),n(669),n(670),n(671),n(672),n(673),n(674),n(675),n(676),n(677),n(678),n(679),n(680),n(681),n(682),n(738),n(739),n(732),n(740),n(741),n(742),n(1072),n(704),n(971),n(744),e.exports=n(683)}]);