/**
 * @license
 * Webix UI v.8.0.0
 * This software is covered by Webix Trial License.
 * Usage without proper license is prohibited.
 * (c) XB Software Ltd.
 */

!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.webix={})}(this,function(H){"use strict";function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return function s(t){if(Array.isArray(t)){for(var i=0,e=new Array(t.length);i<t.length;i++)e[i]=t[i];return e}}(t)||function i(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function e(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i=window,e=1,s={},n=!1;function f(t){i.setImmediate?i.setImmediate(t):i.importScripts||!i.addEventListener?setTimeout(t):(s[++e]=t,i.postMessage(e,"*"))}function b(t){if("function"!=typeof t&&t!=undefined)throw TypeError();if("object"!=M(this)||this&&this.then)throw TypeError();var i,e,n=this,h=0,r=0,s=[];(n.promise=n).resolve=function(t){return i=n.fn,e=n.er,h||(r=t,h=1,f(u)),n},n.reject=function(t){return i=n.fn,e=n.er,h||(r=t,h=2,f(u)),n},n.i=1,n.then=function(t,i){if(1!=this.i)throw TypeError();var e=new b;return e.fn=t,e.er=i,3==h?e.resolve(r):4==h?e.reject(r):s.push(e),e},n["finally"]=function(i){var e,t=function(t){return e=t,i()},s=function(){var t=new b;return 4==h?t.reject(e):t.resolve(e)};return n.then(t,t).then(s,s)},n["catch"]=function(t){return n.then(null,t)},n.fail=function(t){return n.then(null,t)};var o=function(t){h=t||4;for(var i=0;i<s.length;i++){var e=s[i];3==h&&e.resolve(r)||e.reject(r)}};try{"function"==typeof t&&t(n.resolve,n.reject)}catch(c){n.reject(c)}return n;function a(t,i,e,s){if(2==h)return s();if("object"!=M(r)&&"function"!=typeof r||"function"!=typeof t)s();else try{var n=0;t.call(r,function(t){n++||(r=t,i())},function(t){n++||(r=t,e())})}catch(c){r=c,e()}}function u(){var t;try{t=r&&r.then}catch(c){return r=c,h=2,u()}a(t,function(){h=1,u()},function(){h=2,u()},function(){try{1==h&&"function"==typeof i?r=i(r):2==h&&"function"==typeof e&&(r=e(r),h=1)}catch(c){return r=c,o()}r==n?(r=TypeError(),o()):a(t,function(){o(3)},o,function(){o(1==h&&3)})})}}!i.setImmediate&&i.addEventListener&&i.addEventListener("message",function(t){if(t.source==i)if(n)f(s[t.data]);else{n=!0;try{s[t.data]()}catch(t){}delete s[t.data],n=!1}}),b.resolve=function(i){if(1!=this.i)throw TypeError();return i instanceof b?i:new b(function(t){t(i)})},b.reject=function(e){if(1!=this.i)throw TypeError();return new b(function(t,i){i(e)})},b.all=function(e){if(1!=this.i)throw TypeError();if(!(e instanceof Array))return b.reject(TypeError());var s=new b;return function n(t,i){return i?s.resolve(i):t?s.reject(t):(0==e.reduce(function(t,i){return i&&i.then?t+1:t},0)&&s.resolve(e),void e.map(function(t,i){t&&t.then&&t.then(function(t){return e[i]=t,n(),t},n)}))}(),s},b.race=function(e){if(1!=this.i)throw TypeError();if(!(e instanceof Array))return b.reject(TypeError());if(0==e.length)return new b;var s=new b;return function n(t,i){return i?s.resolve(i):t?s.reject(t):(0==e.reduce(function(t,i){return i&&i.then?t+1:t},0)&&s.resolve(e),void e.map(function(t){t&&t.then&&t.then(function(t){n(null,t)},n)}))}(),s},b.i=1,b.defer=function(){return new b(null)};var h={};function t(t,i){h[t]=i}function d(t){return h[t]}var r={};function l(t){var i=l.h;return i.prototype=t,new i}function _(t){var i,e=!!(window.Map&&window.Set&&window.WeakMap&&window.WeakSet);for(var s in 1<arguments.length?(i=arguments[0],t=arguments[1]):i=$(t)?[]:{},t){var n=t[s];!n||"object"!=M(n)||n instanceof RegExp?i[s]=n:D(n)?i[s]=new Date(n):e&&(n instanceof Map||n instanceof Set||n instanceof WeakMap||n instanceof WeakSet)?i[s]=n:(i[s]=$(n)?[]:{},_(i[s],n))}return i}function S(t,i){return function(){return t.apply(i,arguments)}}function p(t){window.execScript?window.execScript(t):window.eval(t)}function R(t){return void 0===t}function k(i,e,s,t){return window.setTimeout(function(){if(!e||!e.$destructed){var t=i.apply(
e,s||[]);return i=e=s=null,t}},t||1)}function a(t){var i=!0;return function(){i&&(i=!1,t.apply(this,arguments))}}l.h=function(){},H.extend=function(t,i,e){if(t.$protoWait)return x.insertAt.call(t.$protoWait,i,1),t;for(var s in i)s in t&&!e||(t[s]=i[s]);return i.defaults&&H.extend(t.defaults,i.defaults),i.$init&&i.$init.call(t),t};var u=(new Date).valueOf();function V(){return++u}function C(t){return"string"==typeof t?document.getElementById(t):t}function v(t,i){if("string"!=typeof t)return t;var e=t.replace("()","");return i&&i[e]?i[e]:window[e]||window.eval(t)}function $(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function D(t){return t instanceof Date}function m(t){return H.extend(t||[],x,!0)}var x={removeAt:function(t,i){0<=t&&this.splice(t,i||1)},remove:function(t){this.removeAt(this.find(t))},insertAt:function(t,i){i||0===i?this.splice(i,0,t):this.push(t)},find:function(t){for(var i=0;i<this.length;i++)if(t==this[i])return i;return-1},each:function(t,i){for(var e=0;e<this.length;e++)t.call(i||this,this[e])},map:function(t,i){for(var e=0;e<this.length;e++)this[e]=t.call(i||this,this[e]);return this},filter:function(t,i){for(var e=0;e<this.length;e++)t.call(i||this,this[e])||(this.splice(e,1),e--);return this}},I={parseFormat:"%Y-%m-%d %H:%i:%s",parseTimeFormat:"%H:%i:%s"};function c(t){var i,e=Date.prototype.toJSON;return Date.prototype.toJSON=function(){return I.parseFormatStr(this)},i=t instanceof Date?t.toJSON():JSON.stringify(t),Date.prototype.toJSON=e,i}var g={$init:function(){this.o||(this.o={},this.u={},this.l={})},blockEvent:function(){this.o._=!0},unblockEvent:function(){this.o._=!1},mapEvent:function(t){H.extend(this.l,t,!0)},on_setter:function(t){if(t)for(var i in t){var e=v(t[i],this.$scope),s=i.indexOf("->");-1!==s?this[i.substr(0,s)].attachEvent(i.substr(s+2),S(e,this)):this.attachEvent(i,e)}},callEvent:function(t,i){var e=this.m||this;if(this.o._)return!0;t=t.toLowerCase();var s=this.o[t.toLowerCase()],n=!0;if(s)for(var h=0;h<s.length;h++)!1===s[h].apply(e,i||[])&&(n=!1);if(this.l[t]){var r=this.l[t];r.$eventSource=this,r.callEvent(t,i)||(n=!1),r.$eventSource=null}return n},attachEvent:function(t,i,e){t=t.toLowerCase(),e=e||V(),i=v(i,this.$scope);var s=this.o[t]||m();return arguments[3]?s.unshift(i):s.push(i),this.o[t]=s,this.u[e]={f:i,t:t},e},detachEvent:function(t){if(this.u[t]){var i=this.u[t].t,e=this.u[t].f;this.o[i].remove(e),delete this.u[t]}else{var s=(t+"").toLowerCase();this.o[s]&&(this.o[s]=m())}},hasEvent:function(t){t=t.toLowerCase();var i=this.o[t];if(i&&i.length)return!0;var e=this.l[t];return!!e&&e.hasEvent(t)}},w={};H.extend(w,g,!0);var y=function(t,i){return w.callEvent(t,i)},A=function(t,i,e,s){return w.attachEvent(t,i,e,s)},F=function(t){return w.detachEvent(t)},T={w:function(t){return t&&t.documentElement?t.getElementsByTagName("parsererror").length?null:t:null},toObject:function(t,i){var e=i?i.rawxml?i.rawxml():i:null;return this.w(e)?e:(e="string"==typeof t?this.fromString(t.replace(/^[\s]+/,"")):t,this.w(e)?e:null)},getRecords:function(t){return this.xpath(t,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(t){return this.tagToObject(t,{})},getOptions:function(){return!1},getInfo:function(t){var i=this.xpath(t,this.config);return i=i.length?this.assignTypes(this.tagToObject(i[0],{})):null,{size:t.documentElement.getAttribute("total_count")||0,from:t.documentElement.getAttribute("pos"),parent:t.documentElement.getAttribute("parent")||0,config:i}},xpath:function(t,i){if(window.XPathResult){var e=t;-1==t.nodeName.indexOf("document")&&(t=t.ownerDocument);for(var s=[],n=t.evaluate(i,e,null,XPathResult.ANY_TYPE,null),h=n.iterateNext();h;)s.push(h),h=n.iterateNext();return s}var r=!0;try{"undefined"==typeof t.selectNodes&&(r=!1)}catch(a){}if(r)return t.selectNodes(i);var o=i.split("/").pop();return t.getElementsByTagName(o)},assignTypes:function(t){for(var i in t){var e=t[i];if("object"==M(e))this.assignTypes(e);else if("string"==typeof e){if(""===e)continue
;"true"==e?t[i]=!0:"false"==e?t[i]=!1:e==1*e&&(t[i]=1*t[i])}}return t},tagToObject:function(t,i){var e=0;if(1==t.nodeType&&t.getAttribute("stack")){i=[];for(var s=t.childNodes,n=0;n<s.length;n++)1==s[n].nodeType&&i.push(this.tagToObject(s[n],{}))}else{i=i||{};var h=t.attributes;if(h&&h.length)for(var r=0;r<h.length;r++)i[h[r].name]=h[r].value,e=1;for(var o=t.childNodes,a=0;a<o.length;a++)if(1==o[a].nodeType){var u=o[a].tagName;i[u]?("function"!=typeof i[u].push&&(i[u]=[i[u]]),i[u].push(this.tagToObject(o[a],{}))):i[u]=this.tagToObject(o[a],{}),e=2}if(!e)return this.nodeValue(t);e<2&&(i.value=i.value||this.nodeValue(t))}return i},nodeValue:function(t){return t.firstChild?t.firstChild.wholeText||t.firstChild.data:""},fromString:function(t){try{if(window.DOMParser)return(new DOMParser).parseFromString(t,"text/xml");if(window.ActiveXObject){var i=new ActiveXObject("Microsoft.xmlDOM");return i.loadXML(t),i}}catch(e){return null}}},z={toObject:function(t){if(!t)return null;if("string"==typeof t)try{if(this.parseDates){var e=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1-3})?Z/;t=JSON.parse(t,function(t,i){return"string"==typeof i&&e.test(i)?new Date(i):i})}else t=JSON.parse(t)}catch(i){return null}return t},getRecords:function(t){return t&&t.data&&(t=t.data),t&&!$(t)?[t]:t},getDetails:function(t){return"string"==typeof t?{id:t||V(),value:t}:t},getOptions:function(t){return t.collections},getInfo:function(t){return{size:t.total_count||0,from:t.pos,parent:t.parent||0,config:t.config}},child:"data",parseDates:!1};function B(t,i,e){return 0!==arguments.length?(new B).get(t,i,e):this&&this.getXHR?this:new B}B.count=0,B.prototype={master:null,getXHR:function(){return new XMLHttpRequest},stringify:function(t){return c(t)},S:function(t,i,s,e){var n;i&&($(i)||"function"==typeof(i.success||i.error||i))&&(n=s,s=i,i=null);var h=b.defer(),r=this.getXHR(),o=this.k||{};if(!y("onBeforeAjax",[e,t,i,r,o,null,h]))return h.reject(r);var a=!1;if("GET"!==e){var u=!1;for(var c in o)"content-type"==c.toString().toLowerCase()&&(u=!0,"application/json"==o[c]&&(a=!0));u||window.FormData&&i instanceof window.FormData||(o["Content-Type"]="application/x-www-form-urlencoded")}if("object"==M(i)&&!(window.FormData&&i instanceof window.FormData))if(a)i=this.stringify(i);else{var f=[];for(var l in i){var d=i[l];null!==d&&d!==undefined||(d=""),"object"===M(d)&&(d=this.stringify(d)),f.push(l+"="+encodeURIComponent(d))}i=f.join("&")}i&&"GET"===e&&(t=t+(-1!=t.indexOf("?")?"&":"?")+i,i=null),r.open(e,t,!this.$);var v=this.D;for(var _ in v&&(r.responseType=v),o)r.setRequestHeader(_,o[_]);var p=this;return this.master=this.master||n,r.onreadystatechange=function(){if(!r.readyState||4==r.readyState){B.count++;var t,i,e=400<=r.status||0===r.status;i="blob"==r.responseType||"arraybuffer"==r.responseType?(t="",r.response):(t=r.responseText||"",p.I(r)),e?(y("onAjaxError",[r]),h.reject(r)):h.resolve(i),s&&B.$callback(p.master||window,s,t,i,r,e)}},this.F&&(r.timeout=this.F),this.$?r.send(i||null):setTimeout(function(){r.send(i||null)},0),this.master&&!this.$&&h.then(function(t){return p.master=null,s=p=n=null,t}),this.$?r:h},I:function(i){return{xml:function(){try{return T.tagToObject(T.toObject(i.responseText,this))}catch(t){i.responseText,t.toString()}},rawxml:function(){return window.XPathResult?i.responseXML:T.fromString(i.responseText)},text:function(){return i.responseText},json:function(){return z.toObject(i.responseText,!1)}}},get:function(t,i,e){return this.S(t,i,e,"GET")},post:function(t,i,e){return this.S(t,i,e,"POST")},put:function(t,i,e){return this.S(t,i,e,"PUT")},del:function(t,i,e){return this.S(t,i,e,"DELETE")},patch:function(t,i,e){return this.S(t,i,e,"PATCH")},sync:function(){return this.$=!0,this},timeout:function(t){return this.F=t,this},response:function(t){return this.D=t,this},headers:function(t){return this.k=H.extend(this.k||{},t),this},bind:function(t){return this.master=t,this}},B.$callback=function(t,i,e,s,n,h){if(!t.$destructed&&(h&&y("onAjaxError",[n]),i)){var r=i.success||i;h&&(r=i.error),r&&r.call&&r.call(t,e,s,n)}};var E={$proxy:!0,
load:function(){var i=this.source.split("@"),e=i[0].split(".").pop();return B().response("arraybuffer").get(i[0]).then(function(t){return{data:t,options:{ext:e,dataurl:i[1]}}})}},P={$proxy:!0,load:function(){},save:function(t,i,e){k(function(){window.console.log("[DP] "+i.id+" -> "+i.operation,i.data);var t={id:i.data.id,newid:i.data.id,status:i.data.operation};e.processResult(t,t)})}},j={$proxy:!0,load:function(){return B(this.source)},save:function(t,i){return j.T.call(this,i,B())},T:function(t,i){var e=this.source,s="",n=e.indexOf("?");-1!==n&&(s=e.substr(n),e=e.substr(0,n)),e+="/"==e.charAt(e.length-1)?"":"/";var h=t.operation,r=t.data;return"insert"==h&&delete r.id,"update"==h?i.put(e+r.id+s,r):"delete"==h?i.del(e+r.id+s,r):i.post(e+s,r)}},N={$proxy:!0,load:function(){return B(this.source)},save:function(t,i){var e=B().headers({"Content-Type":"application/json"});return j.T.call(this,i,e)}},L={$proxy:!0,load:function(t,i){return i=H.extend(i||{},this.params||{},!0),B().post(this.source,i)}};var O={$proxy:!0,save:function(t){return this.load(t)},load:function(t){var i={query:this.source};return 1===arguments.length&&(i.variables=t),B().headers({"Content-type":"application/json"}).post(this.url,i).then(function(t){return function n(t){if(!t||"object"===!M(t)||Array.isArray(t))return t;var i="",e=0;for(var s in t){if(2==++e)return t;i=s}return t[i]}(t.json().data)})}};function W(t,i,e){var s=_(W[t]);return s.source=i,e&&H.extend(s,e,!0),s.init&&s.init(),s}W.$parse=function(t){if("string"!=typeof t||-1==t.indexOf("->"))return t;var i=t.split("->");return W(i[0],i[1])},W.binary=E,W.debug=P,W.json=N,W.post=L,W.rest=j,W.GraphQL=O;var U={toObject:function(t){return"string"==typeof t?JSON.parse(t):t},getRecords:function(t){return t&&t.data&&(t=t.data),t},getDetails:function(t){for(var i={},e=0;e<t.length;e++)i["data"+e]=t[e];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},getOptions:function(){return!1},getInfo:function(){return{size:0}},idColumn:null},Y={toObject:function(t){if("string"!=typeof t)return t;var i=null;return-1==t.indexOf("<")&&(i=C(t)),i||((i=document.createElement("DIV")).innerHTML=t),i.firstChild},getRecords:function(t){return t.getElementsByTagName(this.tag)},getDetails:function(t){return T.tagToObject(t)},getOptions:function(){return!1},getInfo:function(){return{size:0}},tag:"LI"},q={cdn:"//cdn.webix.com/",codebase:"",zIndexBase:100,scrollSize:17};q.strict=!!window.webix_strict,q.https="https:"===document.location.protocol;var G=navigator.userAgent;if(q.isMac=-1!=G.indexOf("Mac"),-1==G.indexOf("Mobile")&&-1==G.indexOf("Windows Phone")||(q.mobile=!0),(q.mobile||-1!=G.indexOf("iPad")||-1!=G.indexOf("Android"))&&(q.touch=!0),!q.touch&&"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints&&(q.touch=!0),-1!=G.indexOf("Opera"))q.isOpera=!0;else{if(q.isIE=!!document.all||-1!==G.indexOf("Trident"),q.isIE)8==parseFloat(navigator.appVersion.split("MSIE")[1])&&(q.isIE8=!0);q.isEdge=-1!=G.indexOf("Edge"),q.isFF=-1!=G.indexOf("Firefox"),q.isWebKit=-1!=G.indexOf("KHTML"),q.isSafari=q.isWebKit&&q.isMac&&-1==G.indexOf("Chrome"),(q.isIE||q.isEdge||q.isFF)&&(q.maxHTMLElementSize=1e7),q.isSafari&&(q.maxHTMLElementSize=1e8)}-1!=G.toLowerCase().indexOf("android")&&(q.isAndroid=!0,-1!=G.toLowerCase().indexOf("trident")&&(q.isAndroid=!1,q.isIEMobile=!0)),q.transform=!1,q.transition=!1;for(var X=-1,J=["","webkit","Moz","O","ms"],K=document.createElement("DIV"),Z=0;Z<J.length;Z++){var Q=J[Z]?J[Z]+"Transform":"transform";if("undefined"!=typeof K.style[Q]){X=Z;break}}if(-1<X){q.cssPrefix=["","-webkit-","-Moz-","-o-","-ms-"][X];var tt=q.jsPrefix=J[X];q.transform=tt?tt+"Transform":"transform",q.transition=tt?tt+"Transition":"transition",q.transitionDuration=tt?tt+"TransitionDuration":"transitionDuration",K.style[q.transform]="translate3d(0,0,0)",q.translate=K.style[q.transform]?"translate3d":"translate",q.transitionEnd="-Moz-"==q.cssPrefix?"transitionend":tt?tt+"TransitionEnd":"transitionend"}q.pointerevents=!q.isIE||null!==new RegExp("Trident/.*rv:11").exec(G),q.passiveEventListeners=!1;try{
var it=Object.defineProperty({},"passive",{get:function(){q.passiveEventListeners=!0}});window.addEventListener("testPassive",null,it),window.removeEventListener("testPassive",null,it)}catch(Ro){}q.svg=document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),q.svganimation=document.implementation.hasFeature("https://www.w3.org/TR/SVG11/feature#SVG-animation","1.1");var et=0,st={},nt={};function ht(){et||(et=document.onselectstart),document.onselectstart=wt}function rt(){0!==et&&(document.onselectstart=et||null),et=0}function ot(t){for(var i=0;t=t.previousSibling;)i++;return i}function at(t,i){var e="";for(var s in i=i||"",t)e+=s+":"+t[s]+";";var n=nt[e+i];return n||(ut("."+(n="s"+V())+(i||"")+"{"+e+"}"),nt[e+i]=n),n}function ut(t,i){var e=i?st[i]:st["default"];e||((e=document.createElement("style")).setAttribute("type","text/css"),e.setAttribute("media","screen,print"),document.getElementsByTagName("head")[0].appendChild(e),i?st[i]=e:st["default"]=e),e.styleSheet?e.styleSheet.cssText+=t:e.appendChild(document.createTextNode(t))}function ct(t){var i=st[t||"default"];i&&(i.innerHTML="")}function ft(t,i,e){i=i||{};var s=document.createElement(t);for(var n in i)s.setAttribute(n,i[n]);return i.style&&(s.style.cssText=i.style),i["class"]&&(s.className=i["class"]),e&&(s.innerHTML=e),s}function lt(t){return(t=C(t))?R(t.value)?t.innerHTML:t.value:""}function dt(t){if(t instanceof Array)for(var i=0;i<t.length;i++)dt(t[i]);else t&&t.parentNode&&t.parentNode.removeChild(t)}function vt(t,i,e){t&&(i&&i.parentNode?i.parentNode.insertBefore(t,i):e.appendChild(t))}function _t(t,i){var e;for(e=t.tagName?t:(t=t||event).target;e;){if(e.getAttribute){var s=e.getAttribute(i);if(s)return s}e=e.parentNode}return null}function pt(t){if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),e=document.body,s=document.documentElement,n=window.pageYOffset||s.scrollTop||e.scrollTop,h=window.pageXOffset||s.scrollLeft||e.scrollLeft,r=s.clientTop||e.clientTop||0,o=s.clientLeft||e.clientLeft||0,a=i.top+n-r,u=i.left+h-o;return{y:Math.round(a),x:Math.round(u),width:t.offsetWidth,height:t.offsetHeight}}for(var c=0,f=0;t;)c+=parseInt(t.offsetTop,10),f+=parseInt(t.offsetLeft,10),t=t.offsetParent;return{y:c,x:f,width:t.offsetHeight,height:t.offsetWidth}}function bt(t){return R((t=t||event).offsetX)?{x:t.layerX,y:t.layerY}:{x:t.offsetX,y:t.offsetY}}function mt(t){if((t=t||event).touches&&t.touches[0]&&(t=t.touches[0]),t.pageX||t.pageY)return{x:t.pageX,y:t.pageY};var i=q.isIE&&"BackCompat"!=document.compatMode?document.documentElement:document.body;return{x:t.clientX+i.scrollLeft-i.clientLeft,y:t.clientY+i.scrollTop-i.clientTop}}function gt(t){return t&&t.preventDefault&&t.preventDefault(),t&&(t.returnValue=!1),wt(t)}function wt(t){return(t=t||event).stopPropagation&&t.stopPropagation(),!(t.cancelBubble=!0)}function xt(t,i,e){if(document.createEventObject){var s=document.createEventObject();t.fireEvent&&t.fireEvent("on"+e,s)}else{var n=document.createEvent(i);n.initEvent(e,!0,!0),t.dispatchEvent&&t.dispatchEvent(n)}}function yt(t,i,e){e&&-1!==t.className.indexOf(i)||(t.className+=" "+i)}function Mt(t,i){t.className=t.className.replace(RegExp(" "+i,"g"),"")}function St(t,i,e){var s=ft("DIV",{"class":"webix_view webix_measure_size "+(i||"")},"");s.style.cssText="height:auto;visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;"+(e?"width:"+e+"px;":"width:auto;white-space:nowrap;"),document.body.appendChild(s);for(var n="object"!==M(t)?[t]:t,h=0,r=0,o=0;o<n.length;o++)s.innerHTML=n[o],h=Math.max(h,s.offsetWidth+1),r=Math.max(r,s.offsetHeight+1);return dt(s),{width:h,height:r}}function kt(t,i){var e=!1;if("object"==M(t)){if(window.navigator.msSaveBlob)return window.navigator.msSaveBlob(t,i);t=window.URL.createObjectURL(t),e=!0}var s=document.createElement("a");s.href=t,s.download=i,document.body.appendChild(s),s.click(),k(function(){e&&window.URL.revokeObjectURL(t),document.body.removeChild(s),s.remove()})}function Ct(t){if(!t)return"";var i=t.className||"";return i.baseVal&&(i=i.baseVal),i.indexOf||(i=""),
i}function $t(t,i,e){if(i=i||0,e=e||i,t.focus(),t.setSelectionRange)t.setSelectionRange(i,e);else{var s=t.createTextRange();s.collapse(!0),s.moveEnd("character",e),s.moveStart("character",i),s.select()}}function Dt(t){if("selectionStart"in t)return{start:t.selectionStart||0,end:t.selectionEnd||0};t.focus();var i=document.selection.createRange().getBookmark(),e=t.createTextRange();e.moveToBookmark(i);var s=e.text.length;e.collapse(!0),e.moveStart("character",-t.value.length);var n=e.text.length;return{start:n,end:n+s}}function It(t,i){document.getElementsByTagName("head").item(0).appendChild(ft("meta",{name:t,content:i}))}var At={toObject:function(t){(t=C(t)).tagName.toLowerCase();var i=t.rows;return dt(t),i},getRecords:function(t){for(var i=[],e=t[0]&&t[0].V?1:0;e<t.length;e++)i.push(t[e]);return i},getDetails:function(t){var i=t.getElementsByTagName("td");t={};for(var e=0;e<i.length;e++)t["data"+e]=i[e].innerHTML;return t},getInfo:function(){return{size:0}},getOptions:function(){},getConfig:function(t){var i=[],e=t[0].getElementsByTagName("th");e.length&&(t[0].V=!0);for(var s=0;s<e.length;s++){var n={id:"data"+s,header:this.B(e[s].innerHTML)},h=this.H(e[s]);n=H.extend(n,h),i.push(n)}return i},B:function(t){var i=t.indexOf("json://");return-1!=i&&(t=JSON.parse(t.substr(i+7))),t},H:function(t){for(var i=t.attributes,e={},s=0;s<i.length;s++)e[i[s].nodeName]=this.B(i[s].nodeValue);return e.width=parseInt(e.width,10),e}},Ft={};function Tt(e,t,i){var s=b.defer();if(t&&!0!==t&&(s=s.then(function(){t.call(i||this)})),Tt.disabled)return s.resolve(),s;if("string"!=typeof e){var n=e.length||0;if(n){var h=function(){n?(n--,Tt(e[e.length-n-1]).then(h,function(){return s.reject()})):s.resolve()};h()}else{for(var r in e)n++;var o=function(){0===--n&&s.resolve()};for(var a in e)Tt(a).then(o,function(){return s.reject()})}return s}if(!0!==Ft[e]){var u=e;if(!0===t)return p(B().sync().get(u).responseText),Ft[e]=!0,s.resolve();if(Ft[e])return Ft[e].push(s),s;Ft[e]=[s];var c=function(){var t=Ft[e];Ft[e]=!1;for(var i=0;i<t.length;i++)t[i].reject()},f=function(){var t=Ft[e];Ft[e]=!0;for(var i=0;i<t.length;i++)t[i].resolve()},l=e.split("?");if(".css"==l[0].substr(l[0].length-4)){var d=ft("LINK",{type:"text/css",rel:"stylesheet",href:u});d.onload=f,d.onerror=c,document.getElementsByTagName("head")[0].appendChild(d)}else{var v=document.createElement("script");v.onload=f,v.onerror=c,document.getElementsByTagName("head")[0].appendChild(v),v.src=u}}else s.resolve();return s}var Vt=H.extend({toObject:function(t){if(t.excel)return t;var i=t.options||{};i.dataurl&&H.extend(i,this.R(i.dataurl)),t=t.data||t;var e=b.defer();if(t.name){i.ext=t.name.split(".").pop();var s=new FileReader;s.onload=S(function(t){e.resolve(this.parseData(t.target.result,i))},this),s.readAsArrayBuffer(t)}else e.resolve(this.parseData(t,i));return e},parseData:function(t,e){t=new Uint8Array(t);for(var s=[],i=0;i!=t.length;++i)s[i]=String.fromCharCode(t[i]);var n=(e.ext||e).toLowerCase();return"xls"!=n&&(n="xlsx"),Tt(q.cdn+"/extras/xlsx.core.styles.min.js").then(S(function(){var t="xls"==n?XLS.read(s.join(""),{type:"binary",cellStyles:!0,cellDates:!0}):XLSX.read(s.join(""),{type:"binary",cellStyles:!0,cellDates:!0}),i={sheets:t.Sheets,names:t.SheetNames,options:e,ranges:t.Workbook&&t.Workbook.Names||[]};return H.extend(this.getSheet(i,e),i)},this))},getSheet:function(t,i){var e=i.name||t.names[0];return t=this.sheetToArray(t.sheets[e],i),i.rows&&i.rows.length&&(t.data=t.data.splice(i.rows[0],Math.min(i.rows[1],t.data.length)-i.rows[0])),t},sheetToArray:function(t,i){var e=[],s=[],n=[],h=[],r=[],o={n:"number",d:"date",s:"string",b:"boolean"};if(t&&t["!ref"]){var a,u,c,f=XLS.utils.decode_range(t["!ref"]),l=f.s.c,d=f.s.r+(i.rows?i.rows[0]:0);for(a=f.s.r;a<=f.e.r;a++){var v=[];for(u=f.s.c;u<=f.e.c;u++)if(c=t[XLS.utils.encode_cell({r:a,c:u})]){var _="";_=i.math&&c.f?"="==c.f.charAt(0)?c.f:"="+c.f:"d"==c.t&&D(c.v)?I.dateFormatStr(c.v):c.v,v.push(_),c.s&&n.push([a-d,u-l,c.s]),c.t&&r.push([a-d,u-l,o[c.t]])}else v.push("");e.push(v)}if(t["!merges"])for(var p=t["!merges"],
b=0;b<p.length;b++){var m=p[b].s,g=p[b].e;(!i.rows||0<=m.r-d&&g.r-d<=i.rows[1])&&s.push([m.r-d,m.c-l,g.c-m.c+1,g.r-m.r+1])}if(t["!cols"])for(var w=t["!cols"],x=0;x<w.length;x++)w[x]&&h.push(["column",x-l,Math.round(w[x].wch/(8.43/70))]);if(t["!rows"])for(var y=t["!rows"],M=0;M<y.length;M++)y[M]&&h.push(["row",M-d,y[M].hpx])}return{data:e,spans:s,styles:n,sizes:h,types:r,excel:!0}},R:function(t){var i=t.split("["),e={};if(e.name=i[0],i[1]){var s=i[1].split(/[^0-9]+/g);s[0]=1*s[0]||0,s[1]=1*s[1]||9999999,e.rows=s}return e}},U),zt={json:z,jsarray:U,xml:T,csv:{toObject:function(t){return t},getRecords:function(t){return t.split(this.row)},getDetails:function(t){t=this.stringToArray(t);for(var i={},e=0;e<t.length;e++)i["data"+e]=t[e];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},getOptions:function(){return!1},getInfo:function(){return{size:0}},stringToArray:function(t){t=t.split(this.cell);for(var i=0;i<t.length;i++)t[i]=t[i].replace(/^[ \t\n\r]*("|)/g,"").replace(/("|)[ \t\n\r]*$/g,"");return t},idColumn:null,row:"\n",cell:","},html:Y,htmltable:At,excel:Vt},Bt={},Ht={$init:function(t){this.data={},this.waitData=b.defer(),t&&(this.P.datatype=t.datatype||"json"),this.$ready.push(this.j)},j:function(){this.N=!0,this.P.url&&this.url_setter(this.P.url),this.P.data&&this.data_setter(this.P.data)},url_setter:function(t){return t=W.$parse(t),this.N&&this.load(t,this.P.datatype),t},data_setter:function(t){return this.N?(this.parse(t,this.P.datatype),!0):t},load:function(t,i){var e,s=this,n=arguments[2]||null;"string"==typeof i&&(e=i,i=arguments[2]);var h=this.O(t,e,n);if(h&&h.then)return h.then(function(t){return s.W(t),i&&B.$callback(s,i,"",t,-1),t},function(t){return s.U(t)})},O:function(t,i,e){var s,n=this;if(!i&&this.data.driver||(this.data.driver=zt[i||"json"]),!this.callEvent("onBeforeLoad",[]))return b.reject();(s=(t=W.$parse(t)).$proxy&&t.load?t.load(this,e):"function"==typeof t?t.call(this,e):B().bind(this).get(t))&&!s.then&&(s=b.resolve(s));var h=this.Y;return s&&s.then?s.then(function(t){return n.$destructed||h&&n.Y!==h?b.reject(Bt):t}):s},parse:function(t,i){if(t&&"function"==typeof t.then){var e=this.Y;return t.then(S(function(t){if(this.$destructed||e&&this.Y!==e)return b.reject();this.parse(t,i)},this))}if(t&&t.sync&&this.sync)this.q(t);else{if(!this.callEvent("onBeforeLoad",[]))return b.reject();!i&&this.data.driver||(this.data.driver=zt[i||"json"]),this.W(t)}return b.resolve()},q:function(t){this.data&&this.data.attachEvent&&this.data.attachEvent("onSyncApply",S(function(){this.G&&this.G()},this)),this.sync(t)},X:function(t){var i,e,s=this.data.driver;i=(e=s.getRecords(t)[0])?s.getDetails(e):{},this.setValues?this.setValues(i):this.data=i},J:function(t){t?this.$onLoad&&this.$onLoad(t,this.data.driver)||(this.data&&this.data.X?this.data.X(t):this.X(t)):this.U(t),this.G&&this.G(),this.callEvent("onAfterLoad",[]),this.waitData.resolve()},W:function(t){var i=this;t&&"function"==typeof t.text&&!t.name&&(t=t.text()),(t=this.data.driver.toObject(t))&&t.then?t.then(function(t){return i.J(t)}):this.J(t)},U:function(t){return t!==Bt&&(this.$destructed||(this.callEvent("onAfterLoad",[]),this.callEvent("onLoadError",arguments)),y("onLoadError",[t,this])),b.reject(t)},K:function(t){if(!this.P.dataFeed||this.Z||!t)return!0;var i=this.P.dataFeed;return"function"==typeof i?i.call(this,t.id||t,t):(i=i+(-1==i.indexOf("?")?"?":"&")+"action=get&id="+encodeURIComponent(t.id||t),this.callEvent("onBeforeLoad",[])&&B(i,function(t,i,e){this.Z=!0;var s=zt.json,n=s.toObject(t,i);n?this.setValues(s.getDetails(s.getRecords(n)[0])):this.U(e),this.Z=!1,this.callEvent("onAfterLoad",[])},this),!1)}},Rt={collapseNames:function(t,i,e,s){if(e=e||{},i=i||"",s=s||function(){return!0},!t||"object"!=M(t))return null;for(var n in t){var h=t[n],r=i+n;h&&"object"==M(h)&&!D(h)&&!$(h)&&s(r)?Rt.collapseNames(h,r+".",e,s):e[r]=h}return e},expandNames:function(t){var i,e,s,n,h,r={};for(h in t){for(e=(s=h.split(".")).length-1,n=r,i=0;i<e;i++)n[s[i]]||(n[s[i]]={}),n=n[s[i]];n[s[e]]=t[h]}return r}},Et={},Pt={},jt=new RegExp("(\\r\\n|\\n)","g"),
Nt=new RegExp('(\\")',"g"),Lt=new RegExp("(\\\\)","g"),Ot={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Wt=/[&<>"'`]/g,Ut=function(t){return Ot[t]||"&amp;"};function Yt(e){if("function"==typeof e)return e;if(Et[e])return Et[e];if(-1!=(e=(e||"").toString()).indexOf("->")){var t=e.split("->");switch(t[0]){case"html":e=lt(t[1]);break;case"http":e=(new B).sync().get(t[1],{uid:V()}).responseText}}if(e=(e||"").toString(),q.strict){if(!Pt[e]){Pt[e]=[];var h=[];if(e.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,function(t,i,e,s,n){h.push({pos:n,str:t,fn:function(t){return t[i]?e:s}})}),e.replace(/\{common\.([^}(]*)\}/g,function(t,e,i){h.push({pos:i,str:t,fn:function(t,i){return i[e]||""}})}),e.replace(/\{common\.([^}(]*)\(\)\}/g,function(t,e,i){h.push({pos:i,str:t,fn:function(t,i){return i[e]?i[e].apply(this,arguments):""}})}),e.replace(/\{obj\.([^:}]*)\}/g,function(t,i,e){h.push({pos:e,str:t,fn:function(t){return t[i]}})}),e.replace("{obj}",function(t,i){h.push({pos:i,str:t,fn:function(t){return t}})}),e.replace(/#([^#'";, ]+)#/gi,function(t,i,e){"!"==i.charAt(0)?(i=i.substr(1),h.push({pos:e,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=Rt.collapseNames(t)),Yt.escape(t[i])}})):h.push({pos:e,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=Rt.collapseNames(t)),t[i]}})}),h.sort(function(t,i){return t.pos>i.pos?1:-1}),h.length){for(var i=0,s=function(t,i,e){Pt[t].push(function(){return t.slice(i,e)})},n=0;n<h.length;n++){var r=h[n].pos;s(e,i,r),Pt[e].push(h[n].fn),i=r+h[n].str.length}s(e,i,e.length)}else Pt[e].push(function(){return e})}return function(){for(var t="",i=0;i<Pt[e].length;i++)t+=Pt[e][i].apply(this,arguments);return t}}var o=!1;e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(Lt,"\\\\")).replace(jt,"\\n")).replace(Nt,'\\"')).replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"')).replace(/\{common\.([^}(]*)\}/g,"\"+(common.$1||'')+\"")).replace(/\{common\.([^}(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"')).replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"')).replace("{obj}",'"+obj+"')).replace(/#([^#'";, ]+)#/gi,function(t,i){return"!"==i.charAt(0)?(o=!0,'"+template.escape(obj.'+i.substr(1)+')+"'):'"+(obj.'+i+')+"'});try{if(o){var a=Function("obj","common","marks","value","template",'return "'+e+'";');Et[e]=function(t,i,e,s){return a(t,i,e,s,Yt)}}else Et[e]=Function("obj","common",'return "'+e+'";')}catch(Ro){}return Et[e]}Yt.escape=function(t){return t===undefined||null===t?"":(t.toString()||"").replace(Wt,Ut)},Yt.empty=function(){return""};var qt={Q:function(t){return t.$empty?"":this.P.template(t,this)},render:function(){var t=this.P;return!!this.isVisible(t.id)&&(this.callEvent&&!this.callEvent("onBeforeRender",[this.data])||(this.data&&!t.content&&(this.tt.innerHTML="",this.tt.innerHTML=this.Q(this.data)),this.callEvent&&this.callEvent("onAfterRender",[])),!0)},sync:function(i){this.it=!1,"DataStore"!=i.name&&(i.data&&"DataStore"==i.data.name?i=i.data:this.it=!0),this.it?i.bind("change",S(function(t){t.id==this.data.id&&(this.data=t.attributes,this.refresh())},this)):i.attachEvent("onStoreUpdated",S(function(t){t&&t!=this.data.id||(this.data=i.pull[t],this.refresh())},this))},template_setter:Yt},Gt={et:function(t){var i,e,s=this.P.dragscroll;"string"!=typeof s&&(s=this.P.layout||"xy"),e=-1!==s.indexOf("x"),i=-1!==s.indexOf("y");var n=pt(this.st||this.$view),h=Math.max((this.P.rowHeight||(this.type&&!isNaN(parseFloat(this.type.height))?this.type.height:0))+5,40),r=!1;i&&this.nt(t,n,h)&&(r=!0),e&&this.ht(t,n,h)&&(r=!0),r&&(this.rt=k(this.et,this,[t],100))},ot:function(t){var i=this.P.dragscroll;if("string"!=typeof i||-1!==i.indexOf("x")){var e=pt(this.k||this.$view),s=Math.max(this.P.headerRowHeight||0,40);this.ht(t,e,s)&&(this.rt=k(this.ot,this,[t],100))}},nt:function(t,i,e){var s=i.y,n=s+i.height,h=this.getScrollState(),r=this.P;if(r.topSplit){var o=this.at(this.getIdByIndex(r.topSplit-1),this.columnId(0));s+=o.top+o.height}return t.y<s+e?this.ut(h.x,h.y-2*e,t,"y"):t.y>n-e&&this.ut(h.x,h.y+2*e,t,"y")},ht:function(t,i,e){var s=i.x,n=s+i.width,
h=this.getScrollState();return t.x<s+e?this.ut(h.x-2*e,h.y,t,"x"):t.x>n-e&&this.ut(h.x+2*e,h.y,t,"x")},ut:function(t,i,e,s){return!!this.callEvent("onBeforeAutoScroll",[e])&&(this.scrollTo(t,i),this.callEvent("onAfterAutoScroll",[]),this.getScrollState()[s]===("x"===s?t:i))}},Xt={};function Jt(){for(var t in Xt)Qt(t)}function Kt(t,i,e,s){(s=s||{}).inner=!0,Zt(t,i,e,s)}function Zt(t,i,e,s){s=s||{},t=C(t);var n=s.id||V();s.bind&&(e=S(e,s.bind));var h=[t,i,e,s.capture];s.inner||(Xt[n]=h);var r=!!s.capture;return!R(s.passive)&&q.passiveEventListeners&&(r={passive:s.passive,capture:r}),t.addEventListener?t.addEventListener(i,e,r):t.attachEvent&&t.attachEvent("on"+i,h[2]=function(){return e.apply(t,arguments)}),n}function Qt(t){if(t){Xt[t];var i=Xt[t];i[0].removeEventListener?i[0].removeEventListener(i[1],i[2],!!i[3]):i[0].detachEvent&&i[0].detachEvent("on"+i[1],i[2]),delete Xt[t]}}function ti(t,i){if(t.$protoWait)return t.ct||(t.ct=[]),void t.ct.push(i);"function"==typeof t&&(t=t.prototype),t.types||(t.types={"default":t.type},t.type.name="default");var e=i.name,s=t.type;for(var n in e&&(s=t.types[e]=l(i.baseType?t.types[i.baseType]:t.type)),i)0===n.indexOf("template")?s[n]=Yt(i[n]):s[n]=i[n];return e}var ii={codebase:"./",cdn:"//cdn.webix.com",top_views:[],ft:null,lt:null,dt:null,vt:null,_t:null,pt:null,bt:null,mt:null,gt:0,wt:null,xt:null,yt:[],destructors:[],Mt:null,St:0,kt:m(),Ct:null},ei={};function si(t,i,e){var s;ii.gt++;var n=ii.ft;ii.ft=t.$scope||n;try{s=function l(t,i,e){var s,n=$(t),h=C(t.container||i||document.body);h.P&&(e=function f(t,i,e){var s=[t];if(i)s=t.getChildViews();else if(t.$t)s=[t.$t];else{if("number"==typeof e)return e;if(e)return hi(s=[oi(e)]),s[0].config.id}return hi(s),e}(h,n,e));var r=!1,o=h==document.body;t.P||h&&n?(s=t,r=!0):(h&&o&&(t.$topView=!0),t.Dt||(t.Dt={}),i&&i.getParentView&&(ii.bt=e||0===e?i:i.getParentView()),s=ri(t));!o||s.setPosition||s.$apiOnly||d("_fixHeight")();if(s.P&&s.P.It&&!h.$view)s.P.At=h;else if(!s.$apiOnly)if(h.appendChild)ni(h,s,t);else if(h.destructor){var a=h;if(e||0===e||$(s)||(h=(e=h).getParentView()),h&&h.Ft){if(r&&s.getParentView){var u=s.getParentView();u&&u.Tt&&u.Tt(s),s.bt=h,s.$scope=h.$scope}h.Ft(s,e)}else{var c=a.$view.parentNode;a.destructor(),ni(c,s,t)}}else t.container;return s}(t,i,e)}finally{ii.gt--,ii.ft=n}return s}function ni(t,i,e){t.appendChild(i.Vt),i.getParentView()||(((!i.setPosition||i.P.fullscreen)&&t==document.body||i.P.position)&&ii.top_views.push(i.zt),e.skipResize||i.adjust())}function hi(t){for(var i=t.length-1;0<=i;i--){var e=t[i];delete ei[e.config.id],e.config.id="x"+V(),(ei[e.config.id]=e).getChildViews&&hi(e.getChildViews()),e.Bt&&hi(e.Bt)}}function ri(t){if(t.view){var i=t.view;return new si[i](t)}if(t.rows||t.cols){for(var e=t.rows||t.cols,s=!1,n=0;n<e.length;n++)!e[n].body||e[n].view||e[n].align||(s=!0);return s?new si.headerlayout(t):new si.layout(t)}return t.cells?new si.multiview(t):t.template||t.content?new si.template(t):t.align&&t.body?new si.align(t):new si.spacer(t)}function oi(t){if(!t)return null;if(ei[t])return ei[t];var i=t;if("object"==M(t)){if(t.P)return t;i=t.target||t}return ei[_t({target:C(i)},"view_id")]}si.views=ei,si.Ht=ri,"undefined"==typeof window.$$&&(window.$$=oi),H.protoUI=function(){var h=arguments[0].name,r=function(t){if(!r)return si[h].prototype;var i=r.$protoWait;if(i){for(var e=[i[0]],s=1;s<i.length;s++)e[s]=i[s],e[s].$protoWait&&(e[s]=e[s].call(-1,e[s].name)),e[s].prototype&&e[s].prototype.name&&(si[e[s].prototype.name]=e[s]);if(si[h]=H.proto.apply(-1,e),r.ct)for(var n=0;n<r.ct.length;n++)ti(si[h],r.ct[n]);r=i=null}return-1!=this?new si[h](t):si[h]};return r.$protoWait=Array.prototype.slice.call(arguments,0),si[h]=r},H.proto=function(){for(var t=arguments,i=t[0],e=!!i.$init,s=[],n=t.length-1;0<n;n--){if(t[n],"function"==typeof t[n]&&(t[n]=t[n].prototype),t[n].$init&&s.push(t[n].$init),t[n].defaults){var h=t[n].defaults;for(var r in i.defaults||(i.defaults={}),h)R(i.defaults[r])&&(i.defaults[r]=h[r])}if(t[n].type&&i.type)for(var o in t[n].type)i.type[o]||(i.type[o]=t[n].type[o]);for(var a in t[n]
)i[a]||!1===i[a]||(i[a]=t[n][a])}e&&s.push(i.$init),i.$init=function(){for(var t=0;t<s.length;t++)s[t].apply(this,arguments)},i.$skin&&i.$skin();var u=function(t){this.$ready=[],this.$init,this.$init(t),this.Rt&&this.Rt(t,this.defaults);for(var i=0;i<this.$ready.length;i++)this.$ready[i].call(this)};return u.prototype=i,i=t=null,u},A("onClick",function(t){var i=oi(t);if(i&&i.touchable){d("UIManager").applyChanges(i),i.getNode(t);var e=t.target;if(i.config.disabled)return;var s="";if(e.className&&0===e.className.toString().indexOf("webix_view"))return;for(i&&d("UIManager").Et(i);e&&e.parentNode;){if(e.getAttribute){if(e.getAttribute("view_id"))break;if(s=e.className){s=s.toString().split(" ");for(var n=0;n<s.length;n++){if(i.on_click[s[n]])if(!1===i.on_click[s[n]].call(i,t,i.P.id,e))return}}}e=e.parentNode}if(i.P.click){var h=v(i.P.click,i.$scope);h&&h.call&&h.call(i,i.P.id,t)}var r=i.P.popup;r&&!i.P.readonly&&("object"!=M(r)||r.name||(r=i.P.popup=si(r).P.id,i.Bt.push(oi(r))),(r=oi(r)).isVisible()||(r.P.master=i.P.id,r.show(i.getInputNode()||i.getNode(),null,!0))),i.callEvent("onItemClick",[i.P.id,t])}});var ai={Pt:m(["dummy"]),jt:0,overflow:!1,delay:400,addTooltip:function(t,i){var e,s,n=this;(t=C(t))instanceof Element?(e=t,"string"==typeof i?e.setAttribute("webix_tooltip",i):s=i):(e=t.$view,s=t),s=s||this;var h=this.Pt.find(s);-1===h&&(h=this.Pt.length,this.Pt.push(s)),e.webix_tooltip=h,this.jt++,this.Nt||(this.Nt=new si.tooltip({}),this.Nt.Lt="webix_tooltip webix_global_tooltip",this.Ot=Zt(document,"mousemove",this.Wt,{bind:this}),this.Ut=Zt(document,"mouseleave",this.Yt,{bind:this}),this.qt=A("onDragMode",function(){return n.Yt()}),this.Gt=A("onClick",function(){return n.Yt()}))},getTooltip:function(){return this.Nt},Wt:function(t){for(var i={},e=t.target;e instanceof Element&&"HTML"!=e.tagName;){if(!i.first||!i.overflow){var s=e.getAttribute("webix_tooltip");i.first=i.first||s,s&&e.scrollWidth>e.clientWidth&&(i.overflow=s)}if(this.Pt[e.webix_tooltip])return this.Xt&&this.Xt!=e?(this.$tooltipOut(this.Xt,e,t),void(this.Xt=null)):(this.Xt||(this.Xt=this.$tooltipIn(e,t)),this.$tooltipMove(e,t,i));e=e.parentElement}this.Xt&&(this.Xt=this.$tooltipOut(this.Xt,null,t))},Yt:function(){clearTimeout(this.Jt),this.Nt.hide()},getMaster:function(t){return this.Pt[t.webix_tooltip]},removeTooltip:function(t){var i,e=(i=(t=C(t))instanceof Element?t:t.$view).webix_tooltip;e&&(this.Xt==i&&(this.Yt(),this.Xt=null),delete i.webix_tooltip,this.jt--,this.Pt[e]=null),!this.jt&&this.Nt&&(this.Ot=Qt(this.Ot),this.Ut=Qt(this.Ut),this.qt=F(this.qt),this.Gt=F(this.Gt),this.Nt.destructor(),this.Nt=this.Xt=null,this.Pt=m(["dummy"]))},$tooltipIn:function(t,i){var e=this.Pt[t.webix_tooltip];return e.$tooltipIn&&e!=this?e.$tooltipIn(t,i):(this.Nt.define({dx:20,dy:0,template:"",css:""}),t)},$tooltipOut:function(t,i,e){var s=this.Pt[t.webix_tooltip];return s.$tooltipOut&&s!=this?s.$tooltipOut(t,i,e):(this.Yt(),null)},$tooltipMove:function(t,i,e){var s=this.Pt[t.webix_tooltip];if(s.$tooltipMove&&s!=this)return s.$tooltipMove(t,i,e);var n=R(s.overflow)?this.overflow:s.overflow,h=R(s.delay)?this.delay:s.delay,r=n?e.overflow:e.first;0<h&&this.Yt(),this.Jt=k(this.Nt.show,this.Nt,[r||{},mt(i)],h)}};function ui(t){return"$"+t+(ci[t]=(ci[t]||0)+1)}var ci={},fi=!1;function li(t,i){fi=!0;var e=t();return e&&e.then?e=e.then(function(t){return(fi=!1)!==i&&di(),t}):(fi=!1)!==i&&di(),e}function di(){if(d("UIManager").applyChanges(),y("onClick",[]),ii.Kt=!0,!fi)for(var t=ii.top_views.length-1;0<=t;t--)ii.top_views[t].obj&&ii.top_views[t].obj.resize();ii.Kt=!1}function vi(t,i,e,s){if(t)for(var n=s?[t]:t.getChildViews(),h=0;h<n.length;h++)!1!==i.call(e,n[h])&&vi(n[h],i,e)}function _i(t){return R(t)?q.zIndexBase++:(q.zIndexBase=Math.max(q.zIndexBase,t+1),t)}function pi(t){bi?t.call():mi.push(t)}Zt(window,"resize",function(){q.touch&&ii.mt&&new Date-ii.mt<1e3||di()});var bi=!1,mi=[],gi=document.getElementsByTagName("SCRIPT");gi.length,gi.length&&((gi=(gi[gi.length-1].getAttribute("src")||"").split("/")).splice(gi.length-1,1),q.codebase=gi.slice(0,gi.length).join("/")+"/"
);var wi=function(){q.isIE&&(document.body.className+=" webix_ie"),y("onReady",[])},xi=function(){bi=!0,window.webix_ready&&$(webix_ready)&&(mi=webix_ready.concat(mi));for(var t=0;t<mi.length;t++)mi[t].call();mi=[]};A("onReady",function(t){t?xi():k(xi)}),"complete"==document.readyState?wi():Zt(window,"load",wi),pi(function(){Zt(document.body,"click",function(t){y("onClick",[t||window.event])})});var yi={set:function(t,i){i=i||{},this.Ht&&this.exit(),oi(t)?t=oi(t):("string"==typeof t&&(t=document.getElementById(t)),t instanceof Element&&(t={$view:t,$html:!0})),this.Ht=t,this.Zt=this.Qt();var e=t.config;t.setPosition?(e.fullscreen=!0,t.resize()):(this.ti=si({view:"window",head:this.ii(i),fullscreen:!0,borderless:!0,body:{rows:[]}}),e&&(this.ei={width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,height:e.height,minHeight:e.minHeight,maxHeight:e.maxHeight}),t.getParentView&&t.getParentView()?(this.si=t.getParentView(),this.si.index&&(this.Zt.index=this.si.index(t),this.Zt.active=!!this.si.getActiveId&&this.si.getActiveId()==e.id)):(this.si=t.$view.parentNode,this.Zt.node=ft("div"),this.si.replaceChild(this.Zt.node,t.$view)),this.ti.getBody().addView(t.$html?{view:"template",content:t.$view,css:"webix_fullscreen_html"}:t),this.ti.show(),this.ni(t))},exit:function(){if(this.Ht){var t=this.Ht.config;this.Qt(!0),this.Ht.setPosition?(t.fullscreen=!1,this.Ht.resize()):(this.si instanceof Element?(this.Ht.bt=null,this.Ht.hi&&this.Ht.hi(this.Ht.config),this.si.replaceChild(this.Ht.$view,this.Zt.node)):R(this.Zt.index)?(this.Ht.bt=this.si,this.si.Ft(this.Ht)):(this.si.addView(this.Ht,this.Zt.index),this.Zt.active&&this.Ht.show(!1,!1)),this.ni(this.Ht,this.ei),this.Ht.$html||(this.ti.getBody().ri=[]),this.ti.close()),this.oi()}},oi:function(){delete this.si,delete this.Ht,delete this.ei,delete this.Zt,delete this.ti},Qt:function(i){var e=this,t=this.Ht,s={};if(t.setPosition)i?t.setPosition(this.Zt.left,this.Zt.top):(s.left=t.config.left,s.top=t.config.top,t.setPosition(0,0));else{var n=t.$view.style;["position","top","bottom","left","right"].forEach(function(t){n[t]=i?e.Zt[t]:(s[t]=n[t],"position"==t?"relative":0)})}return s},ni:function(t,i){t.$html||(i=i||{height:0,minHeight:0,maxHeight:0,width:0,minWidth:0,maxWidth:0},t.define(i),t.resize())},ii:function(t){var i=this;return!1===t.head||"object"==M(t.head)?t.head:{cols:[{template:t.head||"",type:"header",borderless:!0},{view:"icon",icon:"wxi-close",click:function(){i.exit()}}]}}},Mi={Ht:null,ai:{},mt:0,ci:0,fi:0,li:{esc:"escape",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pgdown:"pagedown",pgup:"pageup",space:" ",multiply:"*",add:"+",subtract:"-",decimal:".",divide:"/",pausebreak:"pause","5numlocked":"clear"},di:{input:1,button:1,textarea:1,select:1},vi:function(){Zt(document,"keydown",this._i,{bind:this}),Zt(document.body,"click",this.pi,{capture:!0,bind:this}),Zt(document.body,"mousedown",function(){this.fi=new Date},{bind:this}),Zt(document.body,"focus",this.bi,{capture:!0,bind:this}),ii.destructors.push({obj:this})},destructor:function(){Mi.Ht=null},getFocus:function(){return this.Ht},Et:function(t){this.mi=this.mi||t.P.id},setFocus:function(t,i,e){return(t=oi(t))&&!t.$view&&(t=null),this.mt=ii.mt=new Date,this.Ht===t||(this.Ht&&this.Ht.callEvent&&this.Ht.callEvent("onBlur",[this.Ht]),t&&t.callEvent&&(t.callEvent("onFocus",[t,this.Ht]),e&&t.callEvent("onTabFocus",[t,this.Ht])),y("onFocusChange",[t,this.Ht]),this.Ht&&this.Ht.blur&&!i&&this.Ht.blur(),(this.Ht=t)&&t.focus&&!i&&t.focus()),!0},applyChanges:function(t){var i=this.getFocus();i&&i!=t&&i.gi&&i.gi(t)},hasFocus:function(t){return t===this.Ht},wi:function(t){var i=_t(t,"view_id")||this.mi;return i=oi(i),this.mi=null,ii.mt=new Date,i==this.Ht||(i?this.canFocus(i)?this.Ht&&this.Ht.getFormView()==i&&this.Ht.focus?this.Ht.focus():this.setFocus(i):i.$view.contains(t.target)&&t.target.blur():this.setFocus(null)),!0},pi:function(t){return new Date-this.mt<100?(this.mi=null,!1):this.wi(t)},bi:function(t){return!!this.di[t.target.nodeName.toLowerCase()]&&this.wi(t)},xi:function(t){return!ii.St||((
t.queryView(function(t){return!t.getParentView()},"parent")||t).$view.style.zIndex||0)>=ii.St},canFocus:function(t){return t.isVisible()&&t.isEnabled()&&!t.config.disabled&&this.xi(t)&&!t.queryView({disabled:!0},"parent")},yi:function(t){var i=this.getFocus();if(t&&!this.Mi(t,i))return!1;this.Si("getPrev",t)||(this.Ht=null)},Mi:function(t,i){if(!t)return!1;if(!i)return!1;for(;i;){if(i===t)return!0;i=i.getParentView()}return!1},ki:function(){this&&this.callEvent&&this.callEvent("onTimedKeyPress",[])},_i:function(t){var i=t.which||t.keyCode;95<i&&i<106&&(i-=48);var e=this.getFocus();if(e&&e.callEvent&&(!1===e.callEvent("onKeyPress",[i,t])&&gt(t),e.hasEvent("onTimedKeyPress")&&(clearTimeout(e.Ci),e.Ci=k(this.ki,e,[],e.P.keyPressTimeout||250))),!1===this.$i(t))return gt(t),!1},Si:function(t,i){var e=i||this.getFocus();if(e){t=t||"getNext";for(var s=e,n=V();;){if((e=this[t](e))&&this.canFocus(e))return this.setFocus(e);if(e===s||e.$fmarker==n)return i&&document.activeElement.blur(),null;e.$fmarker=n}}},Di:function(t,i){var e=!i.shiftKey;if(Mi.ci=new Date,t&&t.Ii&&!t.Ii(e,i))return!1;if(t&&t.Ai){if(t.editNext)return t.editNext(e);if(t.editStop)return t.editStop(),!0}else k(function(){if((t=oi(document.activeElement))&&!Mi.canFocus(t))return Mi.Si(e?"getNext":"getPrev",t);Mi.setFocus(t,!0,!0)})},getTop:function(t){for(var i,e=oi(t);e&&(i=e.getParentView());)e=i;return e},getNext:function(t,i){var e=t.getChildViews();if(e.length&&!i)for(var s=0;s<e.length;s++)if(this.canFocus(e[s]))return e[s];var n=t.getParentView();if(!n)return t;var h=n.getChildViews();if(h.length)for(var r=x.find.call(h,t)+1;r<h.length;){if(this.canFocus(h[r]))return h[r];r++}return this.getNext(n,!0)},getPrev:function(t,i){var e=t.getChildViews();if(e.length&&i)for(var s=e.length-1;0<=s;s--)if(this.canFocus(e[s]))return this.getPrev(e[s],!0);if(i&&this.canFocus(t))return t;var n=t.getParentView();if(!n)return this.canFocus(t)?this.getPrev(t,!0):t;var h=n.getChildViews();if(h)for(var r=x.find.call(h,t)-1;0<=r;){if(this.canFocus(h[r]))return this.getPrev(h[r],!0);r--}return this.getPrev(n,!0)},addHotKey:function(t,i,e){var s=this.Fi(t);return e||(e=null),this.ai[s]||(this.ai[s]=[]),this.ai[s].push({handler:i,view:e}),t},removeHotKey:function(t,i,e){var s=this.Fi(t);if(i||e){var n=this.ai[s];if(n){for(var h=n.length-1;0<=h;h--)e&&n[h].view!==e||i&&n[h].handler!==i||n.splice(h,1);n.length||delete this.ai[s]}}else delete this.ai[s]},Ti:function(t,i,e,s,n){return(t||"").toLowerCase()+"_"+["",i?"1":"0",e?"1":"0",s?"1":"0",n?"1":"0"].join("")},$i:function(t){var i=t.which||t.keyCode,e=!t.ctrlKey&&!t.altKey&&!t.metaKey&&9!=i&&27!=i&&13!=i,s=this.Ti(t.key,t.ctrlKey,t.shiftKey,t.altKey,t.metaKey),n=this.getFocus();return this.ai[s]?this.Vi(this.ai[s],n,t):!e||!this.ai.any_0000||this.Vi(this.ai.any_0000,n,t)},Vi:function(t,i,e){for(var s=0;s<t.length;s++){var n=t[s];if(null===n.view||i===n.view||"string"==typeof n.view&&i&&i.name===n.view){var h=n.handler(i,e);if(!!h===h)return h}}return!0},Fi:function(t){var i,e,s,n,h=this.li,r=t.toLowerCase().split(/[ +\-_]/);i=e=s=n=0;for(var o="",a=0;a<r.length;a++)"ctrl"===r[a]?i=1:"shift"===r[a]?e=1:"alt"===r[a]?s=1:"command"===r[a]?n=1:o=h[r[a]]||r[a];return this.Ti(o,i,e,s,n)},getState:function(t,i){i=i||!1;var e={id:(t=oi(t)).config.id,width:t.config.width,height:t.config.height,gravity:t.config.gravity};if(R(t.config.collapsed)||(e.collapsed=t.config.collapsed),"tabs"!==t.name&&"tabbar"!==t.name||(e.activeCell=t.getValue()),i&&(e=[e],t.ri))for(var s=0;s<t.ri.length;s++)e=e.concat(this.getState(t.ri[s],i));return e},setState:function(t){$(t)||(t=[t]);for(var i=0;i<t.length;i++){var e=t[i],s=oi(e.id);s&&(R(e.collapsed)||s.define("collapsed",e.collapsed),R(e.activeCell)||s.setValue(e.activeCell),s.define("width",e.width),s.define("height",e.height),s.define("gravity",e.gravity))}var n=oi(t[0].id);n&&n.resize()}};pi(function(){Mi.vi(),Mi.addHotKey("enter",function(t,i){if(t&&t.callEvent&&t.callEvent("onEnter",[i]),t&&t.editStop&&t.Ai)return t.editStop(),!0;if(t&&t.touchable){var e=t.getFormView();e&&!t.zi&&e.callEvent("onSubmit",
[t,i])}}),Mi.addHotKey("esc",function(t){if(t){if(t.editCancel&&t.Ai)return t.editCancel(),!0;var i=t.getTopParentView();i&&i.setPosition&&(yi.ti==i&&yi.exit(),i.Bi())}}),Mi.addHotKey("shift+tab",Mi.Di),Mi.addHotKey("tab",Mi.Di)}),t("UIManager",Mi);var Si={$init:function(){this.P=this.config={}},define:function(t,i){return"object"==M(t)?this.Hi(t):this.Ri(t,i)},Ri:function(t,i){var e=this[t+"_setter"];return this.P[t]=e?e.call(this,i,t):i},Hi:function(t){if(t)for(var i in t)this.Ri(i,t[i])},Rt:function(t,i){var e={};i&&(e=H.extend(e,i)),"object"!=M(t)||t.tagName||H.extend(e,t,!0),this.Hi(e)},Ei:function(t,i){for(var e in i)switch(M(t[e])){case"object":t[e]=this.Ei(t[e]||{},i[e]);break;case"undefined":t[e]=i[e]}return t}},ki={$init:function(){var t=this.zt=this.zt||{obj:this};ii.destructors.push(t)},destructor:function(){var t=this.P;if(this.Pi&&this.editCancel(),this.callEvent&&this.callEvent("onDestruct",[]),this.destructor=function(){},this.zt.obj=null,this.getChildViews){var i=this.getChildViews();if(i)for(var e=0;e<i.length;e++)i[e].destructor();if(this.Bt)for(var s=0;s<this.Bt.length;s++)this.Bt[s].destructor()}if(delete si.views[t.id],t.$id){var n=this.getTopParentView();n&&n.ji&&n.ji(t.$id)}this.Ni=null,this.Li=null,this.Oi=null,this.Wi&&(this.Wi.innerHTML="",this.Wi.Ni=null),this.Vt&&this.Vt.parentNode&&this.Vt.parentNode.removeChild(this.Vt),this.data&&this.data.destructor&&this.data.destructor(),this.unbind&&this.unbind(),this.data=null,this.bt=null,this.Vt=this.$view=this.Wi=this.tt=null,this.o=this.u=this.l={},Mi.Ht==this&&(Mi.Ht=null);var h=t.url;h&&h.$proxy&&h.release&&h.release(),this.$scope=null,this.$destructed=!0}};Zt(window,"unload",function(){y("unload",[]),ii.xt=!0;for(var t=0;t<ii.destructors.length;t++){var i=ii.destructors[t].obj;i&&i.destructor()}ii.destructors=[],ii.kt=m(),Jt()});var Ci={$init:function(){this.Ui=null,this.attachEvent("onSelectChange",function(){var t=this.getSelectedId();this.setCursor(t?t.id||t:null)}),this.attachEvent("onAfterCursorChange",this.Yi),this.attachEvent("onAfterDelete",function(t){t==this.getCursor()&&this.setCursor(null)}),this.data.attachEvent("onStoreUpdated",S(function(t,i,e){t&&t==this.getCursor()&&"paint"!=e&&"delete"!=e&&this.Yi()},this)),this.data.attachEvent("onClearAll",S(function(){this.Ui=null},this)),this.data.attachEvent("onIdChange",S(function(t,i){this.Ui==t&&(this.Ui=i,this.Yi())},this))},refreshCursor:function(){this.Ui&&this.callEvent("onAfterCursorChange",[this.Ui])},setCursor:function(t){t==this.Ui||null!==t&&!this.getItem(t)||(this.callEvent("onBeforeCursorChange",[this.Ui]),this.Ui=t,this.callEvent("onAfterCursorChange",[t]))},getCursor:function(){return this.Ui},qi:function(t,i,e){if("$level"==i&&this.data.getBranch)return(t.data||t).importData(this.data.getBranch(this.getCursor()));var s=this.getItem(this.getCursor())||this.P.defaultData||null;"$data"==i?("function"==typeof e?e.call(t,s,this):t.data.importData(s?s[e]:[]),t.callEvent("onBindApply",[s,i,this])):(e&&(s=e(s)),this.Gi(t,i,s))}},$i={$init:function(){this.attachEvent("onChange",this.Yi)},qi:function(t,i,e){i=i||"value";var s=this.getValue()||"";if(e&&(s=e(s)),t.setValue)t.setValue(s);else if(t.filter)t.data.silent(function(){this.filter(i,s)});else{var n={};n[i]=s,t.K(s)&&t.setValues(n)}t.callEvent("onBindApply",[s,i,this])}},Di={$init:function(){this.attachEvent("onChange",this.Yi)},qi:function(t,i,e){var s=this.getValues()||null;e&&(s=e(s)),this.Gi(t,i,s)}},Ii={$init:function(){this.Xi={},this.Ji={},this.Ki={},this.Zi(this)},saveBatch:function(t){this.Qi=!0,t.call(this),this.Qi=!1,this.Yi()},setBindData:function(t,i){if(i&&(this.Ki[i]=!0),this.setValue)this.setValue(t);else if(this.setValues)this.setValues(t);else{var e=this.getCursor();e?this.updateItem(e,t):this.add(t)}this.callEvent("onBindUpdate",[t,i]),this.save&&this.save(),i&&(this.Ki[i]=!1)},getBindData:function(t,i){if(this.Ji[t])return!1;var e=oi(t);e.isVisible(e.P.id)&&(this.Ji[t]=!0,this.qi(e,this.Xi[t][0],this.Xi[t][1]),i&&e.filter&&e.refresh())},addBind:function(t,i,e){this.Xi[t]=[i,e]},removeBind:function(t){
delete this.Xi[t],delete this.Ji[t],delete this.Ki[t]},Zi:function(t){t.filter?H.extend(this,Ci):t.setValue?H.extend(this,$i):H.extend(this,Di)},Yi:function(){if(!this.Qi)for(var t in this.Xi)this.Ki[t]||(this.Ji[t]=!1,this.getBindData(t,!0))},Gi:function(t,i,e){t.setValue?t.setValue(e&&i?e[i]:e):t.filter?t.data.silent(function(){this.filter(i,e)}):!e&&t.clear?t.clear():t.K(e)&&t.setValues(l(e)),t.callEvent("onBindApply",[e,i,this])}},Ai={bind:function(t,i,e){this.attachEvent||H.extend(this,g),"string"==typeof t&&(t=oi(t)),t.te&&t.te(),this.te&&this.te(),t.getBindData||H.extend(t,Ii),this.ie(),t.addBind(this.P.id,i,e),this.ee=t.P.id,this.se=this.P.id,this.ne=this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return t.getBindData(this.se)}),this.refresh&&this.isVisible(this.se)&&this.refresh()},unbind:function(){if(this.ee){var t=oi(this.ee);t&&t.removeBind(this.se),this.detachEvent(this.ne),this.ee=this.ne=null}},ie:function(){var t=this.P;if(this.filter){var i=t.id;this.data.he=S(function(){oi(this.ee).Ji[i]=!1},this)}var e=this.render;this.render=function(){if(!this.re){this.re=!0;var t=this.callEvent("onBindRequest");return this.re=!1,e.apply(this,!1===t?arguments:[])}},(this.getValue||this.getValues)&&(this.save=function(t){var i=oi(this.ee);if(t)i.setBindData(t);else{if(this.validate&&!this.validate())return!1;var e=this.getValue?this.getValue:this.getValues();i.setBindData(e,this.P.id),this.setDirty&&this.setDirty(!1)}}),this.ie=function(){}}},Fi=window.webix_view||{},Ti={name:"baseview",$init:function(t){t.id||(t.id=ui(this.name)),this.bt=ii.bt,ii.bt=null,this.$scope=t.$scope||(this.bt?this.bt.$scope:ii.ft),this.Vt||(this.Wi=this.Vt=ft("DIV",{"class":"webix_view"}),this.$view=this.Vt)},$skin:!1,defaults:{width:0,height:0,gravity:1},getNode:function(){return this.Vt},$setNode:function(t){this.Vt=this.tt=this.$view=t},getParentView:function(){return this.bt||null},getTopParentView:function(){var t=this.getParentView();return t?t.getTopParentView():this},getFormView:function(){var t=this.getParentView();return!t||t.oe?t:t.getFormView()},getChildViews:function(){return[]},queryView:function(s,t){var i;if("string"==typeof s&&(s={view:s}),i="object"===M(s)?function(t){var i=t.config;for(var e in s)if(i[e]!=s[e])return!1;return!0}:s,"self"===t&&i(this))return this;var e="all"===t&&[],n="parent"===t?this.ae:this.ue,h=this.ce(i,n,e);return"all"===t?e:h},ue:function(t){return t.getChildViews()},ae:function(t){var i=t.getParentView();return i?[i]:[]},ce:function(t,i,e){for(var s=i(this),n=0;n<s.length;n++){if(t(s[n])){if(!e)return s[n];e.push(s[n])}var h=s[n].ce(t,i,e);if(h&&!e)return h}return null},isVisible:function(t){if(this.P.hidden)return t&&(this.fe||(this.fe=[],this.le={}),this.le[t]||(this.le[t]=!0,this.fe.push(t))),!1;var i=this.getParentView();return!i||i.isVisible(t,this.P.id)},isEnabled:function(){if(this.de)return!1;var t=this.getParentView();return!t||t.isEnabled()},disable:function(){dt(this.de),this.P.disabled=!0,this.de=ft("div",{"class":"webix_disabled"}),this.Vt.appendChild(this.de),this.Vt.setAttribute("aria-disabled","true"),yt(this.Vt,"webix_disabled_view",!0),Mi.yi(this)},enable:function(){this.P.disabled=!1,this.de&&(dt(this.de),Mt(this.Vt,"webix_disabled_view"),this.Vt.removeAttribute("aria-disabled"),this.de=null)},disabled_setter:function(t){return t?this.disable():this.enable(),t},container_setter:function(t){return C(t),!0},css_setter:function(t){return"object"==M(t)&&(t=at(t)),this.Vt.className+=" "+t,t},id_setter:function(t){if(ii.lt&&(ii.lt!=this||this.ve)){var i=this.config.$id=t;t=ui(((this.ve||ii.lt)._e[t]=this).name),(this.ve||ii.lt).pe[t]=i}return si.views[t],(si.views[t]=this).Vt.setAttribute("view_id",t),t},$setSize:function(t,i){var e=this.be;return(!e||e[0]!=t||e[1]!=i)&&(this.be=[t,i],this.$width=this.me=t-(this.ge?q.scrollSize:0),this.$height=this.we=i-(this.xe?q.scrollSize:0),this.P.flex||(this.Vt.style.width=t+"px",this.Vt.style.height=i+"px"),!0)},$getSize:function(t,i){var e=this.P,s=[1*(e.width||e.minWidth||0),1*(e.width||e.maxWidth||1e5),1*(
e.height||e.minHeight||0),1*(e.height||e.maxHeight||1e5),e.gravity];return(isNaN(s[0])||isNaN(s[1])||isNaN(s[2])||isNaN(s[3]))&&(this.P.id,e.width=e.height=e.maxWidth=e.maxHeight=e.minWidth=e.minHeight=0,s=[0,0,1e5,1e5,1]),s[0]+=t,s[1]+=t,s[2]+=i,s[3]+=i,s},show:function(t,i){var e=this.getParentView(),s=!arguments[2];e?(!i&&!1!==i&&this.P.animate&&e.P.animate&&(i=H.extend(e.P.animate?H.extend({},e.P.animate):{},this.P.animate,!0)),(s?e.ye:e.Bi)&&(s?e.ye:e.Bi).call(e,this,i),s&&this.Me(),t&&s&&e.show(!e.$$&&t)):this.P.hidden?s&&(C(this.P.At||document.body).appendChild(this.Vt),this.P.hidden=!1,this.adjust(),this.callEvent&&(this.callEvent("onViewShow",[]),this.Se&&vi(this,this.Se)),this.Me()):s||(this.P.hidden=this.P.It=!0,this.Vt&&(this.P.At=this.Vt.parentNode,dt(this.Vt)))},Me:function(){if(this.fe){for(var t=0;t<this.fe.length;t++){var i=oi(this.fe[t]);i&&i.render()}this.fe=[],this.le={}}},ke:function(t,i){var e=i.target,s=e.getAttribute("role");13!==t&&32!==t||"button"!=s&&"tab"!=s||this.P.disabled||(xt(e,"MouseEvents","click"),gt(i))},hidden_setter:function(t){return t&&this.hide(),this.P.hidden},hide:function(){this.show(null,null,!0),Mi.yi(this)},adjust:function(){if(!this.Vt.parentNode)return!1;var t=this.Vt.parentNode.clientWidth||0,i=this.Vt.parentNode.clientHeight||0,e=this.$getSize(0,0),s=this.Vt.parentNode==document.body&&!this.setPosition;e[0]>t&&(t=e[0]),e[2]>i&&(i=e[2]),(!s||this.P.width)&&t>e[1]&&(t=e[1]),(!s||this.P.height)&&i>e[3]&&(i=e[3]),this.$setSize(t,i),ii.vt&&(ii.vt=!1,this.adjust())},resize:function(){if(!(ii.dt||ii.pt||ii._t)){var t=this.getParentView();t?t.resizeChildren?t.resizeChildren():t.resize():(this.adjust(),y("onResize",[]))}}},Vi={api:Ti,view:H.protoUI(Ti,Si,ki,Ai,Fi)},zi={name:"view",$init:function(t){this.hi(t)},hi:function(t){var i=R(t.borderless);i&&!this.setPosition&&t.$topView&&(i=!(t.borderless=!0)),i&&this.defaults.borderless||t.borderless?t.Dt={top:!0,left:!0,bottom:!0,right:!0}:(t.Dt||(t.Dt={}),this.Wi.style.borderWidth="1px")},$getSize:function(t,i){var e=this.P.Dt;return e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1)),Vi.api.$getSize.call(this,t,i)},$setSize:function(t,i){var e=this.P.Dt;return e&&(t-=(e.left?0:1)+(e.right?0:1),i-=(e.top?0:1)+(e.bottom?0:1)),Vi.api.$setSize.call(this,t,i)}},Bi=H.protoUI(zi,Vi.view),Hi={api:zi,view:Bi};Bi.call(-1);var Ri=H.proto({template_setter:function(t){this.type.template=Yt(t)},Q:function(t){var i=this.type;return(i.templateStart?i.templateStart(t,i):"")+i.template(t,i)+(i.templateEnd?i.templateEnd(t,i):"")},customize:function(t){ti(this,t)}},qt),Ei={name:"tooltip",defaults:{dy:0,dx:20},$init:function(t){"string"==typeof t&&(t={template:t}),this.$view=this.Vt=this.Wi=this.tt=ft("DIV",{role:"alert","aria-atomic":"true"}),this.Vt.className=this.Lt,vt(this.Wi,document.body.firstChild,document.body)},adjust:function(){},isVisible:function(){return this.Ce},$e:function(t){this.callEvent("onBeforeRender",[t])&&(this.tt.innerHTML="",this.tt.innerHTML=t,this.callEvent("onAfterRender",[]))},Lt:"webix_tooltip",css_setter:function(t){return"object"===M(t)&&(t=at(t)),this.Vt.className=this.Lt+" "+t,t},show:function(t,i){if(!this.De)if(this.Ce=!0,"string"==typeof t?this.$e(t):(this.data=H.extend({},t),this.render()),this.tt.firstChild){var e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),s=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=e-i.x,h=s-i.y;this.Wi.style.display="block",n-this.P.dx>this.Wi.offsetWidth?n=i.x:(n=i.x-2*this.P.dx-this.Wi.offsetWidth)<0&&(n=0),h-this.P.dy>this.Wi.offsetHeight?h=i.y:(h=i.y-2*this.P.dy-this.Wi.offsetHeight)<0&&(h=0),this.Wi.style.left=n+this.P.dx+"px",this.Wi.style.top=h+this.P.dy+"px"}else this.hide()},hide:function(){this.Ce&&(this.data=null,this.Wi.style.display="none",this.Ce=!1)},disable:function(){this.De=!0},enable:function(){this.De=!1},type:{template:Yt("{obj.value}"),templateStart:Yt.empty,templateEnd:Yt.empty}},Pi=(H.protoUI(Ei,Ri,Si,g,Hi.view),{tooltip_setter:function(t){if(t)return"function"!=typeof t&&"string"!=typeof t||(t={template:t}
),"object"!==M(t)&&(t={}),t.overflow&&R(t.template)&&(t.template=""),this.Ie(),t},Ie:function(){ai.addTooltip(this),this.attachEvent("onDestruct",function(){ai.removeTooltip(this)}),this.attachEvent("onAfterScroll",function(){ai.jt&&ai.Yt()}),this.Ie=function(){}},$tooltipIn:function(t){var i=ai.Nt,e=H.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.P.tooltip,!0);return i.define(e),t},$tooltipOut:function(){return ai.Yt(),null},$tooltipMove:function(t,i,e){var s=this.P.tooltip,n=R(s.overflow)?ai.overflow:s.overflow,h=R(s.delay)?ai.delay:s.delay,r=n?e.overflow:e.first;0<h&&ai.Yt(),ai.Jt=k(this.Ae,this,[t,i,r],h)},Ae:function(t,i,e){var s=e||this.Fe(t,i);s&&this.isVisible()&&ai.Nt.show(s,mt(i))},Fe:function(t,i){if(this.locate&&this.getItem){var e=this.locate(i);return e?this.getItem(e):null}return this.P}}),ji=H.proto({$init:function(t){this.Te=[],this.Ve=R(t.series)?t.name:t.series,this.ze=C(t.container||t);var i=t.width*(window.devicePixelRatio||1),e=t.height*(window.devicePixelRatio||1),s=t.style||"";s+=";width:"+t.width+"px;height:"+t.height+"px;",this.Be(t.name,s,i,e,t.title)},Be:function(t,i,e,s,n){return this.He=ft("canvas",{title:n,width:e,height:s,canvas_id:t,style:i||""}),this.ze.appendChild(this.He),this.He},getCanvas:function(t){var i=(this.He||this.Be(this.Wi)).getContext(t||"2d");return this.Re||(this.Re=!0,i.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)),i},Ee:function(t,i){this.He&&(this.He.setAttribute("width",t*(window.devicePixelRatio||1)),this.He.setAttribute("height",i*(window.devicePixelRatio||1)),this.He.style.width=t+"px",this.He.style.height=i+"px",this.Re=!1)},renderText:function(t,i,e,s,n){if(e){n&&(n=Math.max(n,0)),i&&(i=Math.max(i,0));var h=ft("DIV",{"class":"webix_canvas_text"+(s?" "+s:""),style:"left:"+t+"px; top:"+i+"px;","aria-hidden":"true"},e);return this.ze.appendChild(h),this.Te.push(h),n&&(h.style.width=n+"px"),h}},renderTextAt:function(t,i,e,s,n,h,r){var o=this.renderText.call(this,e,s,n,h,r);return o&&(t&&(o.style.top="middle"==t?parseInt(s-o.offsetHeight/2,10)+"px":s-o.offsetHeight+"px"),i&&(o.style.left="left"==i?e-o.offsetWidth+"px":parseInt(e-o.offsetWidth/2,10)+"px")),o},clearCanvas:function(t){var i=[];if(dt(this.Te),this.Te=[],!t&&this.ze.Ni){for(i=this.Pe();i.length;)i[0].parentNode.removeChild(i[0]),i.splice(0,1);i=null,this.ze.Ni.getElementsByTagName("AREA").length||(this.ze.Ni.parentNode.removeChild(this.ze.Ni),this.ze.Ni=null)}this.getCanvas().clearRect(0,0,this.He.offsetWidth||Math.floor(this.He.width/(window.devicePixelRatio||1)),this.He.offsetHeight||Math.floor(this.He.height/(window.devicePixelRatio||1)))},toggleCanvas:function(){this.je("none"==this.He.style.display)},showCanvas:function(){this.je(!0)},hideCanvas:function(){this.je(!1)},je:function(t){var i,e;for(e=0;e<this.Te.length;e++)this.Te[e].style.display=t?"":"none";if(this.ze.Ni)for(i=this.Pe(),e=0;e<i.length;e++)t?i[e].removeAttribute("disabled"):i[e].setAttribute("disabled","true");this.He.style.display=t?"":"none"},Pe:function(){var t,i,e=[];for(t=this.ze.Ni.getElementsByTagName("AREA"),i=0;i<t.length;i++)t[i].getAttribute("userdata")==this.Ve&&e.push(t[i]);return e}}),Ni=function(t,i){var e=i;if($(t))for(var s=0;s<t.length;s++){if($(i)&&(e=i[s]),"slide"==e.type){if("out"==e.subtype&&0===s)continue;if("in"==e.subtype&&1==s)continue}if("flip"!=e.type)Ni(t[s],e);else{var n=l(e);0===s&&(n.type="flipback"),1==s&&(n.callback=null),Ni(t[s],n)}}else{var h=C(t);h.Ne?Ni.end(h,e):Ni.start(h,e)}};Ni.end=function(t,i){t.style[q.transitionDuration]="1ms",t.Ne=null,ii.Ct&&window.clearTimeout(ii.Ct),ii.Ct=k(Ni,this,[t,i],10)},Ni.isSupported=function(){return q.transform&&q.transition&&!q.isOpera},Ni.formLine=function(t,i,e){var s=e.direction;i.parentNode&&(i.parentNode.style.position="relative"),i.style.position="absolute",t.style.position="absolute";var n=q.isFF?"top"==s||"left"==s?-1:1:0;return"top"==s||"bottom"==s?(t.style.left="0px",t.style.top=(e.top||n)+("top"==s?1:-1)*i.offsetHeight+"px"):(t.style.top=(e.top||0)+"px",t.style.left=n+("left"==s?1:-1)*i.offsetWidth+"px"),
i.parentNode==t.parentNode&&e.keepViews?t.style.display="":vt(t,i.nextSibling,i.parentNode),"slide"==e.type&&"out"==e.subtype&&(t.style.left="0px",t.style.top=(e.top||0)+"px",i.parentNode.removeChild(i),vt(i,t.nextSibling,t.parentNode)),[t,i]},Ni.breakLine=function(t){arguments[1]?t[1].style.display="none":dt(t[1]),Ni.clear(t[0]),Ni.clear(t[1]),t[0].style.position=""},Ni.clear=function(t){t.style[q.transform]="none",t.style[q.transition]="none",t.style.top=t.style.left=""},Ni.defaults={type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0},Ni.start=function(s,t){"string"==typeof t&&(t={type:t}),t=Si.Ei(t,Ni.defaults);var i,e,n=q.cssPrefix,h=s.Ne=t;switch("slide"==h.type&&h.direction){case"right":h.x=s.offsetWidth;break;case"left":h.x=-s.offsetWidth;break;case"top":h.y=-s.offsetHeight;break;case"bottom":default:h.y=h.y||s.offsetHeight}"flip"!=h.type&&"flipback"!=h.type||(i=[0,0],e="scaleX","vertical"==h.subtype?(i[0]=20,e="scaleY"):i[1]=20,"right"!=h.direction&&"bottom"!=h.direction||(i[0]*=-1,i[1]*=-1));var r=h.duration+"ms "+h.timing+" "+h.delay+"ms",o=n+"TransformStyle: preserve-3d;",a="",u="";switch(h.type){case"fade":a="opacity "+r,o="opacity: 0;";break;case"show":a="opacity "+r,o="opacity: 1;";break;case"flip":r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",u="skew("+i[0]+"deg, "+i[1]+"deg) "+e+"(0.00001)",a="all "+r;break;case"flipback":h.delay+=h.duration/2,r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",s.style[q.transform]="skew("+-1*i[0]+"deg, "+-1*i[1]+"deg) "+e+"(0.00001)",s.style.left="0",u="skew(0deg, 0deg) "+e+"(1)",a="all "+r;break;case"slide":var c=h.x+"px",f=h.y+"px";u=q.translate+"("+c+", "+f+("translate3d"==q.translate?", 0":"")+")",a=n+"transform "+r}k(function(){s.style[q.transition]=a,k(function(){o&&(s.style.cssText+=o),u&&(s.style[q.transform]=u);var i=!1,e=Zt(s,q.transitionEnd,function(t){s.Ne=null,h.callback&&h.callback.call(h.master||window,s,h,t),i=!0,Qt(e)});window.setTimeout(function(){if(!i){var t=h.master||window;s.Ne=null,!t.$destructed&&h.callback&&h.callback.call(t,s,h),i=!0,Qt(e)}},1.3*(1*h.duration+1*h.delay))})})};var Li,Oi;function Wi(t){if(Ui[t],Oi!==t)for(var i in Ui.$active=Li=Ui[t],Ui.$name=Oi=t,si){var e=si[i];e&&e.prototype&&e.prototype.$skin&&e.prototype.$skin(e.prototype)}}var Ui={set:Wi,material:{topLayout:"space",barHeight:44,tabbarHeight:42,sidebarTitleHeight:44,rowHeight:36,toolbarHeight:44,listItemHeight:36,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:36,labelTopHeight:22,propertyItemHeight:28,timelineItemHeight:70,unitHeaderHeight:36,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:2},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:2,form:17,accordion:0},tabMargin:0,tabOffset:0,tabBottomOffset:0,tabTopOffset:0,tabBorder:!0,customCheckbox:!0,customRadio:!0,sidebarMarkAll:!0,popupNoPoint:!0,borderlessPopup:!0,popupPadding:0,dataPadding:12,calendarWeekHeaderHeight:18,padding:0,accordionType:"accordion",optionHeight:32,organogramLineColor:"#CCD7E6",timelineColor:"#1CA1C1",backColor:"#ffffff",colorPadding:4},mini:{topLayout:"space",barHeight:36,tabbarHeight:34,sidebarTitleHeight:36,rowHeight:28,toolbarHeight:36,listItemHeight:28,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,propertyItemHeight:24,unitHeaderHeight:28,timelineItemHeight:50,inputSpacing:4,borderWidth:1,sliderHandleWidth:12,sliderPadding:10,sliderBorder:1,vSliderPadding:13,vSliderHeight:100,switchHeight:20,switchWidth:40,layoutMargin:{space:5,wide:5,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:2},layoutPadding:{space:5,wide:0,clean:0,head:0,line:0,toolbar:2,form:12,accordion:0},tabMargin:0,tabOffset:0,tabBottomOffset:0,tabTopOffset:0,tabBorder:!0,customCheckbox:!0,customRadio:!0,sidebarMarkAll:!0,popupNoPoint:!0,borderlessPopup:!0,popupPadding:0,dataPadding:12,calendarWeekHeaderHeight:18,padding:0,accordionType:"accordion",optionHeight:24,
organogramLineColor:"#CCD7E6",timelineColor:"#1CA1C1",backColor:"#ffffff",colorPadding:4},flat:{topLayout:"space",barHeight:46,tabbarHeight:46,rowHeight:34,toolbarHeight:46,sidebarTitleHeight:45,listItemHeight:34,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:34,labelTopHeight:22,unitHeaderHeight:20,propertyItemHeight:28,timelineItemHeight:70,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:10},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:3,form:17,accordion:0},tabMargin:4,tabOffset:0,tabBottomOffset:6,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,dataPadding:10,calendarWeekHeaderHeight:24,padding:0,accordionType:"accordion",optionHeight:32,timelineColor:"#3498db",backColor:"#ffffff",colorPadding:4},compact:{topLayout:"space",barHeight:34,tabbarHeight:34,sidebarTitleHeight:34,rowHeight:24,toolbarHeight:34,listItemHeight:28,unitHeaderHeight:20,propertyItemHeight:24,timelineItemHeight:50,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,inputSpacing:4,borderWidth:1,sliderHandleWidth:12,sliderPadding:10,sliderBorder:1,vSliderPadding:13,vSliderHeight:100,switchHeight:20,switchWidth:40,layoutMargin:{space:5,wide:5,clean:0,head:4,line:-1,toolbar:4,form:4,accordion:5},layoutPadding:{space:5,wide:0,clean:0,head:0,line:0,toolbar:1,form:12,accordion:0},tabMargin:3,tabOffset:0,tabBottomOffset:3,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,dataPadding:10,calendarWeekHeaderHeight:24,padding:0,accordionType:"accordion",optionHeight:23,timelineColor:"#3498db",backColor:"#ffffff",colorPadding:4},contrast:{topLayout:"space",barHeight:46,tabbarHeight:46,rowHeight:34,toolbarHeight:46,sidebarTitleHeight:45,listItemHeight:34,unitHeaderHeight:20,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:34,labelTopHeight:22,propertyItemHeight:28,timelineItemHeight:70,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:8,form:8,accordion:10},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:3,form:17,accordion:0},tabMargin:4,tabOffset:0,tabBottomOffset:6,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,dataPadding:10,calendarWeekHeaderHeight:24,padding:0,accordionType:"accordion",optionHeight:32,timelineColor:"#b300b3",backColor:"#393939",colorPadding:4}};Wi(window.webix_skin||"material");var Yi={config:{longTouchDelay:1e3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500,ellastic:!0},limit:function(t){Yi.Le=!1!==t},disable:function(){Yi.De=!0},enable:function(){Yi.De=!1},$init:function(){Yi.$init=function(){},Zt(document.body,Gi.down,Yi.Oe,{passive:!1}),Zt(document.body,Gi.move,Yi.We,{passive:!1}),Zt(document.body,Gi.up,Yi.Ue),Zt(document.body,"dragstart",function(t){if(!Yi.De&&!Yi.Le)return gt(t)}),Yi.Ye(),Yi.qe=[null,null],Yi.$active=!0},Ye:function(){Yi.Ge=Yi.Xe=Yi.Je=Yi.Ke=null,Yi.Ze=Yi.Qe=Yi.ts=Yi.es=null,Yi.ss={ns:0,hs:0,rs:0},Yi.os&&(Mt(Yi.os,"webix_touch"),Yi.os=null),window.clearTimeout(Yi.us),Yi.cs=!0,Yi.fs=!0,Yi.ls=!0,Yi.ds||Yi.vs()},Ue:function(t){if(Yi.Ge){if(Yi.Ze){var i=Yi._s(Yi.Qe),e=i.e,s=i.f,n=Yi.config.finish,h=Yi.ps(t,!0),r=oi(Yi.Qe),o=r&&r.$scroll?r.$scroll.gravity:Yi.config.gravity;if(h.rs){var a=e+o*h.ns/h.rs,u=s+o*h.hs/h.rs,c=Yi.qe[0]?Yi.bs(a,!1,!1,Yi.ts.dx,Yi.ts.px):e,f=Yi.qe[1]?Yi.bs(u,!1,!1,Yi.ts.dy,Yi.ts.py):s,l=Math.max(Math.abs(c-e),Math.abs(f-s));l<150&&(n=n*l/150),c==e&&f==s||(n=Math.round(n*Math.max((c-e)/(a-e),(f-s)/(u-s))));var d={e:c,f:f};(r=oi(Yi.Qe))&&r.adjustScroll&&r.adjustScroll(d),n=Math.max(100,n),e!=d.e||s!=d.f?(Yi.ms(Yi.Qe,d.e,d.f,n+"ms"),Yi.gs&&Yi.gs.ws(d.e,d.f,n+"ms"),Yi.xs(d.e,d.f,n+"ms")):Yi.vs()}else Yi.vs()}else Yi.es||(Yi.ls&&!Yi.fs?Yi.ys("onSwipeX"):Yi.fs&&!Yi.ls&&Yi.ys("onSwipeY"));Yi.ys("onTouchEnd"),Yi.Ye()}},We:function(t){if(
Yi.Ke&&Yi.Ge){var i=Yi.ps(t);if(Yi.ys("onTouchMove"),Yi.Ze)Yi.Ms(i);else if(Yi.fs=Yi.Ss(i.ks,"x",Yi.fs),Yi.ls=Yi.Ss(i.Cs,"y",Yi.ls),Yi.Ze){var e=Yi.$s("onBeforeScroll",!0);if(e){var s={};e.callEvent("onBeforeScroll",[s]),s.update&&(Yi.config.speed=s.speed,Yi.config.scale=s.scale)}Yi.Ds(i)}else if(q.isMac){var n=oi(Yi.Ge);if(n&&n.$hasYScroll&&n.$hasYScroll())return gt(t)}return Yi.Ze?gt(t):void 0}},Ms:function(){if(Yi.Qe){var t=Yi._s(Yi.Qe),i=Yi.Je||Yi.Ge,e=oi(Yi.Qe),s=e&&e.$scroll?e.$scroll.ellastic:Yi.config.ellastic;Yi.qe[0]&&(t.e=Yi.bs(t.e-i.x+Yi.Xe.x,s,t.e,Yi.ts.dx,Yi.ts.px)),Yi.qe[1]&&(t.f=Yi.bs(t.f-i.y+Yi.Xe.y,s,t.f,Yi.ts.dy,Yi.ts.py)),Yi.ms(Yi.Qe,t.e,t.f,"0ms"),Yi.gs&&Yi.gs.ws(t.e,t.f,"0ms"),Yi.xs(t.e,t.f,"0ms")}},xs:function(t,i,e){var s=Yi.ts.px/Yi.ts.dx*-t,n=Yi.ts.py/Yi.ts.dy*-i;Yi.qe[0]&&Yi.ms(Yi.qe[0],s,0,e),Yi.qe[1]&&Yi.ms(Yi.qe[1],0,n,e)},scrollTo:function(t,i,e,s){Yi.ms(t,i,e,s)},ms:function(t,i,e,s){if(s){if(Yi.ds=!0,t){var n=Yi.config.translate||q.translate;t.style[q.transform]=n+"("+Math.round(i)+"px, "+Math.round(e)+"px"+("translate3d"==n?", 0":"")+")",t.style[q.transitionDuration]=s}}else t.style[q.transform]=""},_s:function(t){var i,e=window.getComputedStyle(t)[q.transform];if("none"==e)i={e:0,f:0};else if(window.WebKitCSSMatrix)i=new WebKitCSSMatrix(e);else if(window.MSCSSMatrix)i=new MSCSSMatrix(e);else{var s=e.replace(/(matrix\()(.*)(\))/gi,"$2");s=(s=s.replace(/\s/gi,"")).split(","),i={};for(var n=["a","b","c","d","e","f"],h=0;h<n.length;h++)i[n[h]]=parseInt(s[h],10)}return Yi.gs&&Yi.gs.Is(i),i},bs:function(t,i,e,s,n){if(t===e)return t;var h=Math.abs(t-e);if(0<t)return i?e+h/(t-e)*Math.sqrt(h):0;var r=s-n;return r+t<0?i?e-Math.sqrt(-(t-e)):-r:t},As:function(t){if(!t.scroll_enabled){t.scroll_enabled=!0,t.parentNode.style.position="relative";var i=q.cssPrefix;t.style.cssText+=i+"transition: "+i+"transform; "+i+"user-select:none; "+i+"transform-style:flat;",t.addEventListener(q.transitionEnd,Yi.vs,!1)}},Ds:function(){-1!=Yi.Ze.indexOf("x")&&(Yi.qe[0]=Yi.Fs("x",Yi.ts.dx,Yi.ts.px,"width")),-1!=Yi.Ze.indexOf("y")&&(Yi.qe[1]=Yi.Fs("y",Yi.ts.dy,Yi.ts.py,"height")),Yi.As(Yi.Qe),window.setTimeout(function(){Yi.Ms(),Yi.ts&&!Yi.ts.hidden&&(Yi.qe[0]&&(Yi.qe[0].style.visibility="visible"),Yi.qe[1]&&(Yi.qe[1].style.visibility="visible"))},0)},Fs:function(t,i,e,s){if(i-e<2){var n=Yi._s(Yi.Qe),h="y"==t?n.e:0,r="y"==t?0:n.f;return Yi.gs||Yi.ms(Yi.Qe,h,r,"0ms"),Yi.Ze=Yi.Ze.replace(t,""),""}var o=ft("DIV",{"class":"webix_scroll_"+t},"");return o.style.visibility="hidden",o.style[s]=Math.max(e*e/i-7,10)+"px",Yi.ts.left&&("x"===t?o.style.left=Yi.ts.left+"px":o.style.right=-Yi.ts.left+"px"),Yi.Qe.parentNode.appendChild(o),o},Ss:function(t,i,e){return t>Yi.config.deltaStep?(Yi.cs&&(Yi.Ts(i),Yi.Vs(i),-1==(Yi.Ze||"").indexOf(i)&&(Yi.Ze="")),!1):e},vs:function(){var t,i,e;(e=oi(Yi.Qe||this))&&(Yi.Qe?t=Yi._s(Yi.Qe):e.getScrollState&&(t={e:-(i=e.getScrollState()).x,f:-i.y}),y("onAfterScroll",[t]),e.callEvent&&e.callEvent("onAfterScroll",[t])),Yi.Ze||(dt(Yi.qe),Yi.qe=[null,null]),Yi.ds=!1},Ts:function(){window.clearTimeout(Yi.us),Yi.cs=!1},zs:function(t){if(!Yi.qe[0]&&!Yi.qe[1])return!0;Yi.Bs(t,Yi.qe[0]?"x":"y")},Oe:function(t){var i=t.target;if(!Yi.De){Yi.es=null,Yi.Ke=Yi.Ge=Gi.context(t);var e=oi(t);!Yi.Le||Yi.Hs()||e&&e.$touchCapture||(Yi.Ke=null),Yi.ys("onTouchStart"),Yi.zs(t)&&(Yi.us=window.setTimeout(Yi.Rs,Yi.config.longTouchDelay)),!e||!e.touchable||i.className&&0===i.className.indexOf("webix_view")||(Yi.os=e.getNode(t),yt(Yi.os,"webix_touch"))}},Rs:function(){Yi.Ge&&(Yi.es=!0,Yi.ys("onLongTouch"),y("onClick",[Yi.Ge]))},Bs:function(t,i){Yi.Vs(i);var e=Yi.qe[0]||Yi.qe[1];if(e){var s=Yi.$s("onBeforeScroll",!0);s&&s.callEvent("onBeforeScroll",[Yi.Ge,Yi.Xe])}!e||Yi.Qe&&e.parentNode==Yi.Qe.parentNode||(Yi.Ye(),Yi.vs(),Yi.Ge=Gi.context(t)),Yi.We(t)},ps:function(t){return Yi.Je=Yi.Xe,Yi.Xe=Gi.context(t),Yi.ss.ks=Math.abs(Yi.Ge.x-Yi.Xe.x),Yi.ss.Cs=Math.abs(Yi.Ge.y-Yi.Xe.y),Yi.Je&&(Yi.Xe.time-Yi.Je.time<Yi.config.scrollDelay?(Yi.ss.ns=Yi.ss.ns/1.3+Yi.Xe.x-Yi.Je.x,Yi.ss.hs=Yi.ss.hs/1.3+Yi.Xe.y-Yi.Je.y):Yi.ss.hs=Yi.ss.ns=0,
Yi.ss.rs=Yi.ss.rs/1.3+(Yi.Xe.time-Yi.Je.time)),Yi.ss},Es:function(t){Yi.ts={dx:t.offsetWidth,dy:t.offsetHeight,px:t.parentNode.offsetWidth,py:t.parentNode.offsetHeight}},Hs:function(t){var i=Yi.Ge.target;if(!q.touch&&!q.transition&&!q.transform)return null;for(;i&&"BODY"!=i.tagName;){if(i.getAttribute){var e=i.getAttribute("touch_scroll");if(e&&(!t||-1!=e.indexOf(t)))return[i,e]}i=i.parentNode}return null},Vs:function(t){var i=this.Hs(t);return i&&(Yi.Ze=i[1],Yi.Qe=i[0],Yi.Es(i[0])),i},ys:function(t){y(t,[Yi.Ge,Yi.Xe]);var i=Yi.$s(t);i&&i.callEvent(t,[Yi.Ge,Yi.Xe])},$s:function(t,i){var e=oi(i?Yi.Qe:Yi.Ge);if(!e)return null;for(;e;){if(e.hasEvent&&e.hasEvent(t))return e;e=e.getParentView()}return null},Ps:function(t){if(t.touches[0])return{target:t.target,x:t.touches[0].pageX,y:t.touches[0].pageY,time:new Date};var i=Yi.Xe;return i.time=new Date,i},js:function(t){return{target:t.target,x:t.pageX,y:t.pageY,time:new Date}}};function qi(t){t.down="touchstart",t.move="touchmove",t.up="touchend",t.context=Yi.Ps}pi(function Eo(){if(q.touch)Yi.$init(),-1==document.body.className.indexOf("webix_full_screen")&&Yi.limit(!0),q.isSafari&&ut(".webix_view{ -webkit-overflow-scrolling: touch; }"),window.MSCSSMatrix&&ut(".webix_view{ -ms-touch-action: none; }");else var s=Zt(document.body,"touchstart",function(t){if(t.touches.length&&4<t.touches[0].radiusX)for(var i in q.touch=!0,qi(Gi),Eo(),si.views){var e=si.views[i];e&&e.$touch&&e.$touch()}Qt(s)},{capture:!0})});var Gi=q.mouse={down:"mousedown",up:"mouseup",move:"mousemove",context:Yi.js};window.navigator.pointerEnabled?(Gi.down="pointerdown",Gi.move="pointermove",Gi.up="pointerup"):window.navigator.msPointerEnabled?(Gi.down="MSPointerDown",Gi.move="MSPointerMove",Gi.up="MSPointerUp"):q.touch&&qi(Gi);var Xi={Ns:m(["dummy"]),addDrop:function(t,i,e){(t=C(t)).webix_drop=this.Ls(i),e&&(t.webix_master=!0)},Ls:function(t){t=t||Xi;var i=this.Ns.find(t);return i<0&&(i=this.Ns.length,this.Ns.push(t),t.attachEvent&&t.attachEvent("onDestruct",function(){return Xi.unlink(t)})),i},unlink:function(t){var i=this.Ns.find(t);-1<i&&(Xi.Os&&Xi.Os.webix_drag==i&&Xi.Ws(),Xi.Xt&&Xi.Xt.webix_drop==i&&(Xi.Xt=null),this.Ns[i]=null)},Us:function(t){var i=Xi,e=this.Ys();if(e&&e.qs){if(!i.Oi&&!i.createDrag(t))return;t.longtouch_drag=!0;var s=i.Gs;i.Oi.style.left=t.x+i.left+(s.x_offset||0)+"px",i.Oi.style.top=t.y+i.top+(s.y_offset||0)+"px"}},addDrag:function(t,i){(t=C(t)).webix_drag=this.Ls(i),Kt(t,q.mouse.down,this.Xs,{bind:t}),Kt(t,"dragstart",gt)},Xs:function(t){if(Xi.Os){if(Xi.Js==t)return;Xi.Ks(t),Xi.destroyDrag(t)}Xi.Os=this;var i=q.mouse.context(t);Xi.Zs=i,Xi.Js=t;var e=q.touch?{passive:!1}:null;Xi.Qs=Zt(document.body,q.mouse.move,Xi.tn,e),Xi["in"]=Zt(document,q.mouse.up,Xi.Ks),yt(document.body,"webix_noselect",1)},Ks:function(t){Xi.en(),Xi.sn=!t.cancelable},tn:function(t){if(Xi.sn=!t.cancelable,q.touch&&Xi.sn)return Xi.en(),Xi.destroyDrag(t);var i=q.mouse.context(t),e=Xi.Ys();if(!(e&&q.touch&&e.qs&&!Yi.es||Math.abs(i.x-Xi.Zs.x)<5&&Math.abs(i.y-Xi.Zs.y)<5)){if(!Xi.Oi&&!Xi.createDrag(Xi.Js))return Xi.en();Xi.en(!0),Xi.sendSignal("start");var s=q.touch?{passive:!1}:null;Xi.Qs=Zt(document.body,q.mouse.move,Xi.nn,s),Xi["in"]=Zt(document,q.mouse.up,Xi.Ws),Xi.nn(t)}},Ws:function(t){Xi.en(),Xi.Js=null,Xi.Xt&&t&&(Xi.$drop(Xi.Os,Xi.Xt,t),Xi.$dragOut(Xi.Os,Xi.Xt,null,t)),Xi.destroyDrag(t),Xi.sendSignal("stop")},en:function(t){this.Qs=Qt(this.Qs),this["in"]=Qt(this["in"]),t||Mt(document.body,"webix_noselect")},nn:function(s){var t=Xi,i=mt(s),e=t.$dragPos(i,s),n=t.Gs;t.Oi.style.top=i.y+t.top+(e||!n.y_offset?0:n.y_offset)+"px",t.Oi.style.left=i.x+t.left+(e||!n.x_offset?0:n.x_offset)+"px";var h=s;if(t.hn)t.hn=!1;else{if(q.touch){var r=q.mouse.context(s),o=document.elementFromPoint(r.x,r.y);h=new Proxy(s,{get:function(t,i){if("target"===i)return o;var e=t[i];return"function"==typeof e?e.bind(s):e}})}t.rn(h.target,h)}return gt(s)},rn:function(t,i){for(;t&&"BODY"!=t.tagName;){if(t.webix_drop)return this.Xt&&(this.Xt!=t||t.webix_master)&&this.$dragOut(this.Os,this.Xt,t,i),!this.Xt||this.Xt!=t||t.webix_master?(this.Xt=null,
this.an=this.$dragIn(Xi.Os,t,i),void(this.an&&(this.Xt=t))):void 0;t=t.parentNode}this.Xt&&(this.Xt=this.an=this.$dragOut(this.Os,this.Xt,null,i))},sendSignal:function(t){Xi.active="start"==t,y("onDragMode",[t])},getMaster:function(t){return this.Ns[t.webix_drag||t.webix_drop]},getContext:function(){return this.Gs},getNode:function(){return this.Oi},createDrag:function(t){var i=Xi,e=i.Os;i.Gs={};var s,n=this.Ns[e.webix_drag];if(n.$dragCreate){if(!(s=n.$dragCreate(e,t)))return!1;this.un(t),s.style.position="absolute"}else{var h=i.$drag(e,t);if(i.un(t),!h)return!1;(s=document.createElement("DIV")).innerHTML=h,s.className="webix_drag_zone",document.body.appendChild(s);var r=i.Gs;r.html&&q.pointerevents&&(r.x_offset=-Math.round(.5*s.offsetWidth),r.y_offset=-Math.round(.75*s.offsetHeight))}return s.style.zIndex=Math.max(s.style.zIndex,_i()),Xi.cn=Zt(s,q.mouse.move,Xi.ln),Xi.Gs.from||(Xi.Gs={source:e,from:e}),Xi.Oi=s,!0},ln:function(){Xi.hn=!0},destroyDrag:function(t){var i=Xi.Os,e=this.Ns[i.webix_drag];e&&e.$dragDestroy?(Xi.cn=Qt(Xi.cn),Xi.Oi&&e.$dragDestroy(i,Xi.Oi,t)):dt(Xi.Oi),e&&e.rt&&(e.rt=window.clearTimeout(e.rt)),Xi.dn&&dt(Xi.dn),Xi.an=Xi.Os=Xi.Xt=Xi.Oi=Xi.dn=null,Xi.Gs=null},Ys:function(){return Xi.Ns[Xi.Os.webix_drag]},top:0,left:0,un:function(t){var i=Xi,e=i.Zs,s=i.Gs;if("undefined"!=typeof s.x_offset&&"undefined"!=typeof s.y_offset)return null;if(s.x_offset=s.y_offset=0,q.pointerevents){var n=Xi.Ys();if(n.qs&&n!==this){var h=n.qs(e,t);h&&(s.x_offset=h.x-e.x,s.y_offset=h.y-e.y)}}},$dragPos:function(t,i){var e=this.Ns[Xi.Os.webix_drag];if(e.$dragPos&&e!=this)return e.$dragPos(t,i,Xi.Oi),!0},$dragIn:function(t,i,e){var s=this.Ns[i.webix_drop];return s.$dragIn&&s!=this?s.$dragIn(t,i,e):(i.className=i.className+" webix_drop_zone",i)},$dragOut:function(t,i,e,s){var n=this.Ns[i.webix_drop];return n.$dragOut&&n!=this?n.$dragOut(t,i,e,s):(i.className=i.className.replace("webix_drop_zone",""),null)},$drop:function(t,i,e){var s=this.Ns[i.webix_drop];if(Xi.Gs.from=Xi.getMaster(t),s.$drop&&s!=this)return s.$drop(t,i,e);i.appendChild(t)},$drag:function(t,i){var e=this.Ns[t.webix_drag];return e.$drag&&e!=this?e.$drag(t,i):"<div style='"+t.style.cssText+"'>"+t.innerHTML+"</div>"}};A("onLongTouch",function(t){Xi.Os&&!Xi.sn&&Xi.Us(t)});var Ji={move_setter:function(t){return t&&(H.extend(this,Ki,!0),Xi.addDrag(this.vn?this.vn:this.$view,this),delete this.move_setter),t}},Ki={$dragCreate:function(t,i){if(this.config.move){var e=pt(t),s=mt(i);return Xi.top=e.y-s.y,Xi.left=e.x-s.x,C(this.Vt)}},$dragDestroy:function(t,i){this.P&&(this.P.top=parseInt(i.style.top,10),this.P.left=parseInt(i.style.left,10)),Xi.top=Xi.left=0,this.callEvent("onViewMoveEnd",[])},$dragPos:function(t,i){this.callEvent("onViewMove",[t,i])}},Zi={_n:function(t){if(t){if(!this.pn){this.pn=ft("div",{"class":"webix_modal"});var i=_i(this.P.zIndex);this.bn=ii.St,ii.St=i,this.pn.style.zIndex=i-1,this.Vt.style.zIndex=i,document.body.appendChild(this.pn),document.body.style.overflow="hidden",Kt(this.pn,"click",S(this.mn,this))}}else this.pn&&(dt(this.pn),this.pn=null,ii.St=this.bn,ii.St||(document.body.style.overflow=""));return t}},Qi={resize_setter:function(t){return t&&!this.gn&&this.wn(),t},wn:function(){if(!this.xn){var t=this.Vt;t.firstChild&&((t=t.firstChild).style.position="relative"),this.xn=ft("DIV",{"class":"webix_resize_handle",webix_disable_drag:"true"}),t.appendChild(this.xn),Kt(this.xn,q.mouse.down,this.yn,{bind:this})}},Mn:function(t,i){if(!this.Sn){this.Sn=ft("div",{"class":"webix_resize_frame"},""),document.body.appendChild(this.Sn);var e=pt(this.Vt);this.Sn.style.left=e.x+"px",this.Sn.style.top=e.y+"px",this.Sn.style.zIndex=_i()}this.Sn.style.width=t+"px",this.Sn.style.height=i+"px"},yn:function(){this.config.resize&&(yt(document.body,"webix_noselect webix_resize_cursor"),this.kn=pt(this.Vt),this.Cn=Zt(document.body,q.mouse.move,this.$n,{bind:this}),this.Dn=Zt(document.body,q.mouse.up,this.In,{bind:this}))},$n:function(t){if(!1!==this.kn){var i=mt(t),e={x:i.x-this.kn.x,y:i.y-this.kn.y};if(this.$resizeMove)this.$resizeMove(e);else{var s=this.config,
n=s.minWidth||100,h=s.minHeight||100;e.x<n?e.x=n:e.x>s.maxWidth&&(e.x=s.maxWidth),e.y<h?e.y=h:e.y>s.maxHeight&&(e.y=s.maxHeight)}this.An=e,this.Mn(e.x,e.y)}},In:function(){this.Sn&&(this.Sn=dt(this.Sn)),Mt(document.body,"webix_resize_cursor"),Mt(document.body,"webix_noselect"),Qt(this.Cn),Qt(this.Dn),this.An&&(this.$resizeEnd?this.$resizeEnd(this.An):(this.config.width=this.An.x,this.config.height=this.An.y,this.resize())),this.kn=this.An=!1,this.callEvent("onViewResize",[])}},te={name:"window",$init:function(t){this.Vt.innerHTML="<div class='webix_win_content'><div class='webix_win_head'></div><div class='webix_win_body'></div></div>",this.Wi=this.Vt.firstChild,this.vn=this.Wi.childNodes[0],this.tt=this.Fn=this.Wi.childNodes[1],this.Vt.className+=" webix_window",this.Vt.setAttribute("role","dialog"),this.Vt.setAttribute("tabindex","0"),this.Tn=this.$t=null,t.Dt={top:!1,left:!1,right:!1,bottom:!1},t.id||(t.id=V()),Kt(this.Wi,"click",this.mn,{bind:this}),Kt(this.Wi,"click",function(){!this.P.zIndex&&this.P.toFront&&(this.Vt.style.zIndex=_i())},{bind:this,capture:!0}),t.modal&&(this.Vn=!0),t.headHeight&&(this.P.headHeight=t.headHeight),t.close&&(this.P.close=t.close),this.attachEvent("onViewMoveEnd",function(){this.P.position&&delete this.P.position})},mn:function(t){var i=ii.kt,e=i.find(this);-1==e&&(e=i.length-1),t.click_view=e},getChildViews:function(){return this.Tn?[this.Tn,this.$t]:[this.$t]},zIndex_setter:function(t){return this.Vt.style.zIndex=t},Tt:function(){this.body_setter()},Ft:function(t,i){var e=(i=i||this.$t)==this.$t;i.destructor(),e?this.$t=t:this.Tn=t,(e?this.Fn:this.vn).appendChild(t.Vt);var s=t.Vt.style,n={top:!0,left:!0,right:!0,bottom:!0},h="0px";!1===t.config.borderless&&(n=l(this.P.Dt),h="1px"),t.P.Dt=n,s.borderTopWidth=s.borderBottomWidth=s.borderLeftWidth=s.borderRightWidth=h,this.resize(!0)},show:function(t,i,e){if(!0===t){if(!this.P.hidden)return;t=null}if(!this.callEvent("onBeforeShow",arguments))return!1;var s,n,h;if(this.P.hidden=!1,this.Vt.style.zIndex=_i(this.P.zIndex),(this.P.modal||this.Vn)&&(this._n(!0),this.Vn=null),(i=i||{}).pos||(i.pos=this.P.relative),t){"object"!=M(t)||t.tagName?s=pt(t=C(t)):t.target?(s=mt(t),n=20,h=5):s=t;var r=Math.max(window.innerWidth||0,document.body.offsetWidth),o=Math.max(window.innerHeight||0,document.body.offsetHeight);n=n||t.offsetWidth||0,h=h||t.offsetHeight||0;var a=this.be,u=s.x,c=s.y,f=0,l=0,d=0,v=0,_=this.P.autofit;if(_){var p="node"===_,b=6,m=6,g=6;this.P.point||(b=m=g=0),e="top",u=c=0,d=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,r-s.x-n<a[0]&&"right"==i.pos&&!p&&(i.pos="left"),l="right"==i.pos?(u=s.x+b+n,m=-h,e="left",f=Math.round(s.y+h/2),u-g):"left"==i.pos?(u=s.x-b-a[0]-1,m=-h,e="right",f=Math.round(s.y+h/2),u+a[0]+1):(u=s.x<d?d:r+d-s.x>a[0]?s.x:r+d-b-a[0],l=Math.round(s.x+n/2),Math.min(l,u+a[0]-3*g)),v=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,(!a[1]||o+v-h-s.y-m>a[1]||p)&&"top"!=i.pos?(c=h+s.y+m-(this.P.point?4:0),f||(e="top",f=c-g)):(c=s.y-m-a[1])<0?(c=0,"top"==e&&(e=!1)):f||(e="bottom",f=--c+a[1]+1)}var w=i.x||0,x=i.y||0,y=this.zn();this.$view.style.position=y?"fixed":"absolute",y&&(c-=v,f-=v),this.setPosition(u+w,c+x),this.Bn&&(e&&this.P.point?this.Bn(e,l+w,f+x,y):this.Hn())}else this.Qt(this.P.left,this.P.top);this.Vt.style.display="block",this.Rn=1,k(function(){this.Rn=0},this,[],q.touch?400:100),this.Me(),this.config.autofocus&&(this.En=Mi.getFocus(),Mi.setFocus(this)),-1==ii.kt.find(this)&&ii.kt.push(this),this.callEvent("onShow",[])},Bi:function(t){if(!this.P.hidden&&!this.P.modal&&this.P.escHide&&!this.Rn&&!(t&&t.showpopup&&(t.showpopup==this.P.id||this.getTopMenu&&this.getTopMenu().P.id==t.showpopup)||t&&q.touch&&t.longtouch_drag||ii.St&&this.Vt.style.zIndex<=ii.St)){if(t){var i=t.click_view;if(i||0===i||(i=-1),ii.kt.find(this)<=i)return}this.Pn()}},hidden_setter:function(t){return t?this.hide():this.show(),!!t},hide:function(){var t=this.Pn();this.jn(t)},Pn:function(){if(!this.$destructed&&!this.P.hidden){if(this.P.modal&&this._n(!1),this.Nn(),
this.P.autofocus){var t=document.activeElement;t&&this.Vt&&(this.Vt.contains(t)||t===document.body)&&(Mi.setFocus(this.En),this.En=null)}var i=ii.kt.find(this);return-1<i&&ii.kt.removeAt(i),i}},Nn:function(){"top"==this.P.position?Ni(this.Vt,{type:"slide",x:0,y:-(this.we+20),duration:300,callback:this.Ln,master:this}):this.Ln()},jn:function(t){if(-1<t)for(var i=ii.kt,e=i.length-1;t<=e;e--)i[e].Hn&&i[e].Pn()},destructor:function(){this.hide(),ki.destructor.apply(this,[])},Ln:function(){this.$destructed||(this.Vt.style.display="none",this.P.hidden=!0,this.callEvent("onHide",[]))},close:function(){this.destructor()},On:function(t){"undefined"==typeof t.borderless&&(t.borderless=!0)},body_setter:function(t){return"object"!=M(t)&&(t={template:t}),this.On(t),(ii.bt=this).$t=si.Ht(t),this.Fn.appendChild(this.$t.Vt),t},head_setter:function(t){var i=this;if(!1===t)return t;var e=this.P.headHeight,s="string"==typeof t,n={height:e,padding:0,css:"webix_win_title",type:"header",borderless:!0};s&&(this.Vt.setAttribute("aria-label",t),t={template:t}),("template"==t.view||!t.view&&t.template)&&H.extend(t,n),s&&this.config.close?t={padding:{left:Li.inputHeight+2,right:2},cols:[t,{height:e,view:"icon",icon:"wxi-close",click:function(){i.hide()}}]}:H.extend(t,{borderless:!0}),(ii.bt=this).Tn=si.Ht(t);var h=this.Tn.Vt.querySelector(".webix_win_title>div");return h&&(h.style.lineHeight=e+"px"),this.vn.appendChild(this.Tn.Vt),t},getBody:function(){return this.$t},getHead:function(){return this.Tn},adjust:function(){return this.resize()},resizeChildren:function(){this.$t&&this.resize()},resize:function(){Vi.api.adjust.call(this),y("onResize",[]),this.isVisible()&&this.Qt(this.P.left,this.P.top)},zn:function(){if(this.P.master){var t=oi(this.P.master).getTopParentView().$view;return t&&"fixed"===t.style.position}return!1},Qt:function(t,i){if(this.P.position||this.zn()){this.$view.style.position="fixed";var e=this.me,s=this.we;if(e<=0||s<=0)return;var n=window.innerWidth||document.documentElement.offsetWidth,h=window.innerHeight||document.documentElement.offsetHeight,r=Math.round((n-e)/2),o=Math.round((h-s)/2);if("function"==typeof this.P.position){var a={left:r,top:o,width:e,height:s,maxWidth:n,maxHeight:h};this.P.position.call(this,a),a.width==e&&a.height==s||this.$setSize(a.width,a.height),this.setPosition(a.left,a.top)}else"top"==this.P.position&&(o=Ni.isSupported()?-1*s:10),this.P.position||(r=this.P.left||r,o=this.P.top||o),this.setPosition(r,o);"top"==this.P.position&&Ni(this.Vt,{type:"slide",x:0,y:s-2*(this.P.padding||0),duration:300,callback:this.Wn,master:this})}else this.setPosition(t,i)},Wn:function(t){Ni.clear(t),this.P.top=-2*(this.P.padding||0),this.setPosition(this.P.left,this.P.top)},setPosition:function(t,i){this.Vt.style.top=i+"px",this.Vt.style.left=t+"px",this.P.left=t,this.P.top=i},$getSize:function(t,i){var e=this.P.Dt;e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1)),this.P.head&&(i+=1);var s=this.$t.$getSize(0,0),n=0;if(this.Tn){var h=this.Tn.$getSize(0,0);h[3]==h[2]&&(this.P.headHeight=h[3]),i+=this.P.headHeight,n=h[0]}if(this.P.fullscreen){var r=window.innerWidth||document.body.clientWidth,o=window.innerHeight||document.body.clientHeight;return[r,r,o,o]}var a=Hi.api.$getSize.call(this,0,0);return n&&1e5<s[1]&&(s[0]=Math.max(n,s[0])),a[1]=Math.min(a[1],(1e5<=s[1]&&1e5<=a[1]?Math.max(s[0],a[0]):s[1])+t),a[3]=Math.min(a[3],(1e5<=s[3]&&1e5<=a[3]?Math.max(s[2],a[2]):s[3])+i),a[0]=Math.min(Math.max(a[0],s[0]+t),a[1]),a[2]=Math.min(Math.max(a[2],s[2]+i),a[3]),a},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i),t=this.me,i=this.we,!1===this.P.head?(this.vn.style.display="none",this.$t.$setSize(t,i)):(this.Tn.$setSize(t,this.P.headHeight),this.$t.$setSize(t,i-this.P.headHeight))},$skin:function(){this.defaults.headHeight=Li.barHeight},defaults:{top:0,left:0,autofit:!0,relative:"bottom",body:"",head:"",hidden:!0,autofocus:!0,minWidth:300,minHeight:200,escHide:!0}};A("onLongTouch",function(t){if(t&&t.target){var i=oi(t.target);if(i){i=i.queryView(function(t){return!t.getParentView()},"parent")||i
;var e=ii.kt.find(i);-1!==e&&(t.click_view=e)}}});var ie={api:te,view:H.protoUI(te,Hi.view,Ji,Zi,g,Qi)},ee={defaults:{padding:"4",hidden:!0},body_setter:function(t){return t=ie.api.body_setter.call(this,t),this.$t.Vt.style.borderWidth="0px",t},attachTo:function(t){var i;i=t.on_context?t.attachEvent("onAfterContextMenu",S(this.Un,this)):Zt(t,"contextmenu",this.Yn,{bind:this}),this.attachEvent("onDestruct",function(){t.callEvent?t.detachEvent(i):Qt(i),t=null})},getContext:function(){return this.qn},setContext:function(t){this.qn=t},Yn:function(t){return this.qn=C(t||ie.event),this.Gn(t)},Un:function(t,i){return this.qn={obj:oi(i),id:t},this.Gn(i)},Gn:function(t){var i=this.show(t,null,!0);if(!1===i)return i;var e=oi(t);if(e){var s=e.queryView(function(t){return!t.getParentView()},"parent")||e;s.mn&&s.mn(t)}return y("onClick",[t]),gt(t)},Xn:!0,master_setter:function(t){return this.attachTo(t),null}},se={qn:null,Jn:null,Kn:0,init:function(){return null!==this.qn||(ii.destructors.push({obj:this}),this.qn=document.createElement("textarea"),this.qn.className="webix_clipbuffer",this.qn.setAttribute("webixignore",1),this.qn.setAttribute("spellcheck","false"),this.qn.setAttribute("autocapitalize","off"),this.qn.setAttribute("autocorrect","off"),this.qn.setAttribute("autocomplete","off"),document.body.appendChild(this.qn),Zt(document.body,"keydown",S(function(t){var i=t.keyCode,e=!(!t.ctrlKey&&!t.metaKey);86===i&&e&&(this.qn.value="",k(this.Zn,this,[t],100))},this))),this.qn},destructor:function(){this.qn=null},set:function(t){this.init(),t=""===t?"\n":t,this.qn.value=t,this.focus()},focus:function(){this.Qn()||(this.init(),this.qn.focus(),this.qn.select())},Qn:function(){var t="";return"undefined"!=typeof window.getSelection?t=window.getSelection().toString():"undefined"!=typeof document.selection&&"Text"==document.selection.type&&(t=document.selection.createRange().text),!!t},Zn:function(t){if(t.target===this.qn){var i=this.qn.value,e=Mi.getFocus();!e||e.getEditor&&e.getEditor()||(e.callEvent("onPaste",[i]),this.qn.select())}}},ne={clipboard_setter:function(t){return q.touch||(!0!==t&&1!==t||(t="modify"),this.attachEvent("onAfterSelect",function(t){if(!this.getEditor||!this.getEditor()){var i=this.getItem(t),e=this.type.templateCopy(i);se.set(e,this),se.focus(),Mi.setFocus(this)}}),this.attachEvent("onPaste",function(t){R(this.Zn[this.P.clipboard])||this.Zn[this.P.clipboard].call(this,t)}),this.attachEvent("onFocus",function(){se.focus()}),this.attachEvent("onItemClick",function(t){this.th&&-1===this.th.find(t)||(se.focus(),Mi.setFocus(this))})),t},Zn:{insert:function(t){this.add({value:t})},modify:function(t){for(var i=this.getSelectedId(!0),e=0;e<i.length;e++)this.getItem(i[e]).value=t,this.refresh(i[e])},custom:function(){}},templateCopy_setter:function(t){this.type.templateCopy=Yt(t)},type:{templateCopy:function(t){return this.template(t)}}},he={$customPrint:function(t,i){if(this.ih(t,i))return!0;var e=this.eh(t),s=this.sh(e,t);if(i)return s;var n=ft("div",{"class":"webix_ui_print"});n.appendChild(s),vt(n,t.docFooter,document.body),window.print(),dt(n)},ih:function(t,i){if(!i&&("y"==this.config.layout||t.scroll||this.config.prerender||this.config.autoheight))return!0;"x"==this.config.layout&&H.extend(t||{},{xCount:this.count(),nobreaks:!0},!0)},nh:function(t){var i=t.size["portrait"==t.mode?"width":"height"];return Math.min(i*q.printPPI-2*q.printMargin)},eh:function(t,i,e){var s,n,h="page"==t.fit?Infinity:this.nh(t),r=t.xCount||this.rh().hh,o=[],a=[],u=0;e=e||0,i=i||[];for(var c=0;c<this.data.order.length;){var f=this.data.pull[this.data.order[c]];if(n=c-parseInt(c/r)*r,f&&e<=n){if(h<(u+=this.type.width)&&e<n){s=a.length+e,o.push(a),c+=r-a.length,a=[],u=0;continue}var l=this.type.template(f,this.type),d=this.oh,v={display:"table-cell",height:this.type.height+"px",width:this.type.width+"px"};a.push({txt:l,className:d+" "+(f.$css||""),style:v}),(c+1)%r==0&&(o.push(a),a=[],u=0)}c++}return i.push(o),s&&this.eh(t,i,s),i},sh:function(n,h){var r=ft("div");return n.forEach(S(function(t,i){var e=ft("table",{
"class":"webix_table_print "+this.$view.className,style:"border-collapse:collapse"});if(t.forEach(function(t){var s=ft("tr");t.forEach(function(i){var e=ft("td");(i.txt&&(e.innerHTML=i.txt),i.className&&(e.className=i.className),i.style)&&Object.keys(i.style).forEach(function(t){i.style[t]&&(e.style[t]=i.style[t])});i.span&&(1<i.span.colspan&&(e.colSpan=i.span.colspan),1<i.span.rowspan&&(e.rowSpan=i.span.rowspan)),s.appendChild(e)}),e.appendChild(s)}),r.appendChild(e),!h.nobreaks&&i+1<n.length){var s=ft("DIV",{"class":"webix_print_pagebreak"});r.appendChild(s)}},this)),r}},re={scrollStep:40,init:function(){this.ah(),this.scrollStep=Li.rowHeight,q.$customScroll=!0,q.scrollSize=0,ii.destructors.push({obj:{destructor:function(){this.uh=null}}}),A("onReconstruct",re.ch),A("onResize",re.ch),A("onClick",re.ch)},resize:function(){this.ch()},fh:function(t){t.st.lh=t.P.id,t.attachEvent("onAfterRender",function(){var t=re.dh(this),i=Math.max(t.dy-t.py,0),e=Math.max(t.dx-t.px,0);this.vh&&this._h>i?this.vh.scrollTo(i):this.ph&&this.bh>e&&this.ph.scrollTo(e),re.uh==this.st&&re.ch()}),Kt(t.st,"mouseover",re.mh),Kt(t.st,"mouseout",re.gh)},enable:function(t,i){if(re.ah(),t.mapCells)return this.fh(t);var e=t;t.tt&&(e=t.tt.parentNode),e.wh=i||"xy",Kt(e,"mouseover",re.mh),Kt(e,"mouseout",re.gh),Kt(e,"mousewheel",re.xh,{passive:!1}),Kt(e,"DOMMouseScroll",re.xh,{passive:!1}),this.yh(t)},ch:function(){var t=re.uh;if(t&&t.Mh){var i=oi(t),e=i?i.queryView(function(t){var i=re.Sh(t);return i&&i.Mh},"all").map(function(t){return re.Sh(t)}):[];e.push(t),e.forEach(function(t){re.kh.call(t),re.mh.call(t)})}},Sh:function(t){return t.st||t.tt&&t.tt.parentNode||t.$view},ah:function(){Zt(document.body,"mousemove",function(t){re.Ch&&re.$h(re.Ch,re.Ch.Dh,mt(t))}),re.ah=function(){}},mh:function(){if(re.uh=this,clearTimeout(this.Ih),!this.Mh&&!re.Ch){var t=oi(this);if(!t||t.isEnabled()){var i;if(this.lh){if(!(t=oi(this.lh)))return;i=re.dh(t)}else(i={dx:this.scrollWidth,dy:this.scrollHeight,px:this.clientWidth,py:this.clientHeight}).xe=i.dx>i.px&&-1!=this.wh.indexOf("x"),i.ge=i.dy>i.py&&-1!=this.wh.indexOf("y");(this.Mh=i).xe&&(i.Ah=re.Fs(this,"x",i.dx,i.px,"width","height"),i.Fh=i.px-i.Ah.offsetWidth-4,i.Th=i.dx-i.px,re.trackBar&&(i.Vh=re.zh(this,"x"))),i.ge&&(i.Bh=re.Fs(this,"y",i.dy,i.py,"height","width"),i.Hh=i.py-i.Bh.offsetHeight-4,i.Rh=i.dy-i.py,re.trackBar&&(i.Eh=re.zh(this,"y"))),re.Ph(this)}}},zh:function(t,i){var e=ft("DIV",{webixignore:"1","class":"webix_c_scroll_bar_"+i},"");return t.appendChild(e),e},$h:function(t,i,e){var s=t.Mh,n=t.lh;if(n&&(n=oi(n)),s.Ah==t.jh){var h=(e.x-i.x)*s.Th/s.Fh;n?n.ph.scrollTo(n.bh+h):re.Nh(t,"scrollLeft",h)}if(s.Bh==t.jh){var r=(e.y-i.y)*s.Rh/s.Hh;n?n.vh.scrollTo(n._h+r):re.Nh(t,"scrollTop",r)}t.Dh=e,re.Ph(t)},dh:function(t){var i={};return t.ph&&t.P.scrollX&&(i.dx=t.ph.getSize(),i.px=t.ph.Lh||1,i.xe=1<i.dx-i.px),t.vh&&t.P.scrollY&&(i.dy=t.vh.getSize(),i.py=t.vh.Lh||1,i.ge=1<i.dy-i.py),i},gh:function(){clearTimeout(this.Ih),this.Ih=k(re.kh,this,[],200)},Oh:function(t){t&&(dt(t),t.Wh&&(Qt(t.Wh),Qt(t.Uh),Qt(t.Yh)))},kh:function(){if(this.Mh){if(this.jh)return void(this.qh=!0);var t=this.Mh;re.Oh(t.Ah),re.Oh(t.Bh),t.Vh&&dt(t.Vh),t.Eh&&dt(t.Eh),this.Mh=null}},xh:function(t){var i=this.Mh,e=t.wheelDelta/-40,s=!1;if(!e&&t.detail&&R(t.wheelDelta)&&(e=t.detail),i){t.scrolledBy||(t.scrolledBy=i.ge?"y":"x");var n=t.wheelDeltaX&&Math.abs(t.wheelDeltaX)>Math.abs(t.wheelDeltaY);if(i.Ah&&("y"!==t.scrolledBy&&(t.wheelDeltaX||e)||n)){var h=t.wheelDeltaX/-40||e;s=re.Nh(this,"scrollLeft",h*re.scrollStep)}else!n&&e&&i.Bh&&(s=re.Nh(this,"scrollTop",e*re.scrollStep))}if(re.Ph(this),!1!==s)return gt(t)},Nh:function(t,i,e){var s=t.Mh,n="scrollLeft"==i?s.dx-s.px:s.dy-s.py,h=t[i];return n<h+e&&(e=n-h),!(!e||h+e<0&&0===h)&&(q.isIE&&re.Ph(t,i,e+h),t[i]+=e,!0)},Fs:function(t,i,e,s,n){var h=ft("DIV",{webixignore:"1","class":"webix_c_scroll_"+i},"<div></div>");return h.style[n]=Math.max(s*s/e-7,40)+"px",h.style["height"==n?"top":"left"]="0px",t.style.position="relative",t.appendChild(h),t.Wh=Zt(h,"mousedown",re.Gh(t)),t.Uh=Zt(document.body,
"mouseup",S(re.Xh,t)),t.Yh=Zt(document.body,"mouseleave",S(re.Xh,t)),h},Gh:function(i){return function(t){yt(document.body,"webix_noselect",1),this.className+=" webix_scroll_active",(re.Ch=i).jh=this,i.Dh=mt(t)}},Xh:function(){this.jh&&(Mt(document.body,"webix_noselect"),this.jh.className=this.jh.className.toString().replace(" webix_scroll_active",""),this.jh=!1,re.Ch=0,this.qh&&(re.kh.call(this),this.qh=!1))},Ph:function(t,i,e){var s=t.Mh;if(s&&(s.Ah||s.Bh)){var n=t.lh,h="scrollLeft"==i?e:t.scrollLeft,r=n?oi(n).bh:h,o=n?0:r,a="scrollTop"==i?e:t.scrollTop,u=n?oi(n)._h:a,c=n?0:u;s.Ah&&(s.Ah.style.bottom=1-c+"px",s.Ah.style.left=Math.round(s.Fh*r/(s.dx-s.px))+o+1+"px",s.Vh&&(s.Vh.style.bottom=1-c+"px",s.Vh.style.left=o+"px")),s.Bh&&(s.Bh.style.right=0-o+"px",s.Bh.style.top=Math.round(s.Hh*u/(s.dy-s.py))+c+1+"px",s.Eh&&(s.Eh.style.right=0-o+"px",s.Eh.style.top=c+"px"))}},yh:function(t){var i=this;t.attachEvent&&(t.attachEvent("onViewShow",function(){return i.Jh(t)}),t.attachEvent("onAfterAutoScroll",function(){return i.Jh(t)})),t.data&&t.data.attachEvent&&t.data.attachEvent("onStoreUpdated",function(){return i.Jh(t)})},Jh:function(t){var i=re.uh;i&&t.$view.contains(i)?re.ch():re.kh.call(t.$view)}},oe={addCss:function(t,i,e){if(!this.addRowCss&&!e&&!this.hasCss(t,i)){var s=this.getItemNode(t);s&&(s.className+=" "+i,e=!0)}return this.data.addMark(t,i,1,1,e)},removeCss:function(t,i,e){if(!this.addRowCss&&!e&&this.hasCss(t,i)){var s=this.getItemNode(t);s&&(s.className=s.className.replace(i,"").replace("  "," "),e=!0)}return this.data.removeMark(t,i,1,e)},hasCss:function(t,i){return this.data.getMark(t,i)},clearCss:function(t,i){return this.data.clearMark(t,1,i)}},ae={copy:function(t,i,e,s){var n=(s=s||{}).newId||t;e=e||this;var h=this.getItem(t);return e&&(h=e.Kh(h)),e.data.add(e.Kh(h,n),i,s.parent||0)},Zh:function(t,i,e){if(i&&t){var s=this.getIndexById(t);return s+(e==this&&e.getIndexById(i)<s?0:1)}},move:function(t,i,e,s){var n=(s=s||{}).newId||t;if((e=e||this).data,e.data){if($(t)){3<t.length&&(this.$blockRender=e.$blockRender=!0);for(var h=0;h<t.length;h++){var r=this.move(t[h],i,e,s);i=e.Zh(r,t[h+1],this)}return this.$blockRender=e.$blockRender=!1,void(3<t.length&&(this.refresh(),e!=this&&e.refresh()))}var o=t,a=this.getItem(t);return e&&e!=this?(o=e.data.add(e.Kh(a,n),i,s.parent||0),this.data.remove(t)):(i<0&&(i=this.data.order.length-1),this.data.move(this.getIndexById(t),i),this.data.callEvent("onDataMove",[t,i,null,this.data.order[i+1]])),o}},moveUp:function(t,i){var e=this.getIndexById(t)-(i||1);return this.move(t,e<0?0:e)},moveDown:function(t,i){return this.moveUp(t,-1*(i||1))},moveTop:function(t){return this.move(t,0)},moveBottom:function(t){return this.move(t,this.data.count()-1)},Kh:function(t,i){var e=H.extend({},t);return e.id=!i||this.data.pull[i]?V():i,e.$template=null,this.P.externalData&&(e=this.P.externalData.call(this,e,i,t)),e}},ue={isEmail:function(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test((t||"").toString())},isNumber:function(t){return parseFloat(t)==t},isChecked:function(t){return!!t||"0"===t},isNotEmpty:function(t){return 0===t||t}},ce={$init:function(){this.yt&&this.attachEvent("onChange",this.clearValidation)},clearValidation:function(){if(this.elements)for(var t in this.elements)this.Qh(t)},validate:function(t,i){this.callEvent,this.callEvent("onBeforeValidate",[]);var e=this.ir={},s=!0,n=this.P.rules,h=this.isVisible&&!this.isVisible(),r=t&&t.hidden,o=t&&t.disabled,a={},u={};for(var c in this.elements){var f=this.elements[c].config.name;(h||this.elements[c].isVisible()||r)&&(this.elements[c].isEnabled()||o)?a[f]=this.elements[c]:u[f]=!0}if((n||a)&&!i&&this.getValues&&(i=this.getValues()),n){n.$obj&&(s=this.sr(n.$obj,i,i,"")&&s);var l=n.$all,d=i;if(this.P.complexData&&(d=Rt.collapseNames(i,"",{},function(t){return!n[t]})),l)for(var v in i)if(!u[v]){var _=this.sr(l,d[v],i,v);_||(e[v]=!0),s=_&&s}for(var p in n)if(!u[p]&&0!==p.indexOf("$")&&!e[p]){n[p];var b=this.sr(n[p],d[p],i,p);b||(e[p]=!0),s=b&&s}}if(a)for(var m in a)if(!e[m]){var g=a[m];if(g.validate){var w=g.validate();s=w&&s,w||(e[m]=!0)
}else{var x=g.P;if(x){var y=x.validate;if(!y&&x.required&&(y=n.isNotEmpty),y){var M=this.sr(y,i[m],i,m);M||(e[m]=!0),s=M&&s}}}}return this.callEvent("onAfterValidation",[s,this.ir]),s},sr:function(t,i,e,s){return"string"==typeof t&&(t=ue[t]),t.call(this,i,e,s)?(this.callEvent("onValidationSuccess",[s,e])&&this.Qh&&this.Qh(s),!0):(this.callEvent("onValidationError",[s,e])&&this.nr&&this.nr(s),!1)}},fe={};function le(t,i){if("object"==M(t)&&t.P&&(t=t.P.id),fe[t]||i)return fe[t];"string"!=typeof t&&"number"!=typeof t||(t={master:oi(t)});var e=new de(t),s=e.P.master.P.id;return fe[s]=e,oi(s).attachEvent("onDestruct",function(){fe[this.P.id]=null,delete fe[this.P.id]}),e}t("dp",le),le.$$=function(t){return fe[t]};var de=H.proto({defaults:{autoupdate:!0,updateFromResponse:!1,mode:"post",operationName:"webix_operation",trackMove:!1},$init:function(){this.reset(),this.hr=!1,this.name="DataProcessor",this.$ready.push(this.rr)},reset:function(){this.or=[]},url_setter:function(t){var i="";if("string"==typeof t){var e=t.split("->");1<e.length&&(t=e[1],i=e[0])}else t&&t.mode&&(i=t.mode,t=t.url);return i?W(i,t):t},master_setter:function(t){var i=t;return"DataStore"!=t.name&&(i=t.data),this.P.store=i,t},ar:function(t){var i=this.ur;this.ur=[],t();var e=Promise.all(this.ur);return(this.ur=i)&&i.push(e),e},rr:function(){var t=this.P.store;t&&(t.attachEvent("onStoreUpdated",S(this.cr,this)),t.attachEvent("onDataMove",S(this.fr,this)))},ignore:function(t,i){var e=this.hr;this.hr=!0,t.call(i||this),this.hr=e},off:function(){this.hr=!0},on:function(){this.hr=!1},lr:function(t){var i={};for(var e in t)0!==e.indexOf("$")&&(i[e]=t[e]);return i},save:function(t,i,e){return i=i||"update",this.dr(t,e,i,!0)},dr:function(t,i,e,s){if("object"==M(t)&&(t=t.toString()),t&&!0!==this.hr&&e&&"paint"!=e){var n=this.P.store;n&&(i=i||this.P.store.getItem(t),n.vr&&(i=n.vr(i)));var h={id:t,data:this.lr(i),operation:e};if(R(i.$parent)||(h.data.parent=i.$parent),"delete"!=h.operation){var r=this.P.master;r&&r.data&&r.data.getMark&&r.data.getMark(t,"webix_invalid")&&(h._r=!0),this.validate(null,h.data)||(h._r=!0)}return this.pr(h)&&this.or.push(h),this.P.autoupdate||s?this.mr(t):void 0}},fr:function(t,i,e,s){if(this.P.trackMove){var n=_(this.P.store.getItem(t));n.webix_move_index=i,n.webix_move_id=s,n.webix_move_parent=e,this.dr(t,n,"order")}},cr:function(t,i,e){switch(e){case"save":case"update":e="update";break;case"add":e="insert";break;case"delete":e="delete";break;default:return!0}return this.dr(t,i,e)},pr:function(t){for(var i=0;i<this.or.length;i++){var e=this.or[i];if(e.id==t.id&&!e.gr)return"delete"==t.operation&&("insert"==e.operation?this.or.splice(i,1):e.operation="delete"),e.data=t.data,e._r=t._r,!1}return!0},send:function(){return this.mr()},mr:function(t){if(this.P.url){for(var i,e=this.or,s=[],n=this.P.url,h=0;h<e.length;h++){var r=e[h];if(!r.gr&&!r._r){var o=r.id;if(this.P.autoupdate||!t||t==o){var a=r.operation,u=W.$parse("object"!=M(n)||n.$proxy?n:n[a]),c=u&&(u.$proxy||"function"==typeof u);if(u){var f=this.P.store;if(f&&f.wr&&f.wr(r.data),this.callEvent("onBefore"+a,[o,r])){if(r.gr=!0,!this.callEvent("onBeforeDataSend",[r]))return;r.data=this.xr(r.data);var l=void 0;u.$proxy?(u.save&&(l=u.save(this.config.master,r,this)),s.push(r)):("insert"==a&&delete r.data.id,l=c?u.call(this.config.master,r.id,r.operation,r.data):(r.data[this.P.operationName]=a,this.S(u,r.data,this.P.mode))),l&&(l=this.yr(l,{id:r.id,status:r.operation}),t&&o===t&&(i=l)),this.callEvent("onAfterDataSend",[r])}}}}}if(n.$proxy&&n.saveAll&&s.length){var d=n.saveAll(this.config.master,s,this);d&&(d=this.yr(d,null),i||(i=d))}return i}},yr:function(t,e){var s=this;if(t)return t.then||(t=b.resolve(t)),t=t.then(function(t){var i;if(t&&"function"==typeof t.json&&(t=t.json()),!(i=null===e?s.Mr(t):s.Mr(e,"",t,-1)))throw i;return i},function(t){throw s.Sr(e,"",null,t),t}),this.ur&&this.ur.push(t),t},xr:function(t){var i={};for(var e in t)0!==e.indexOf("$")&&(i[e]=t[e]);return i},S:function(t,i,e){return B()[e](t,i)},attachProgress:function(t,i,e){this.attachEvent("onBeforeDataSend",t),
this.attachEvent("onAfterSync",i),this.attachEvent("onAfterSaveError",e),this.attachEvent("onLoadError",e)},Sr:function(t,i,e,s){t?this.kr(!0,t.id,!1,t.status,!1,{text:i,data:e,loader:s}):(this.callEvent("onLoadError",arguments),y("onLoadError",[i,e,s,this]))},kr:function(t,i,e,s,n,h){var r=this.P.master,o=this.getItemState(i);if(o.gr=!1,!t){this.setItemState(i,!1);var a=this.P.store;return a&&a.exists(i)&&(e&&i!=e&&a.changeId(i,e),n&&"delete"!=s&&this.P.updateFromResponse&&this.ignore(function(){a.updateItem(e||i,n)})),this.P.undoOnError&&r.P.undo&&r.removeUndo(e||i),this.callEvent("onAfterSave",[n,i,h]),this.callEvent("onAfter"+s,[n,i,h]),n||{}}this.callEvent("onBeforeSaveError",[i,s,n,h])&&(o._r=!0,this.P.undoOnError&&r.P.undo&&(this.ignore(function(){r.undo(i)}),this.setItemState(i,!1)),this.callEvent("onAfterSaveError",[i,s,n,h]))},processResult:function(t,i,e){var s=i&&("error"==i.status||"invalid"==i.status),n=!!i&&(i.newid||i.id);return this.kr(s,t.id,n,t.status,i,e)},Mr:function(t,i,e,s){var n,h=this;if(this.callEvent("onBeforeSync",[t,i,e,s]),$(t))n=[],t.forEach(function(t){n.push(h.processResult(t,t,{}))});else if(-1===s)n=this.processResult(t,e,{});else{var r,o=this.P.url;if(o.$proxy&&o.result)n=o.result(t,this.P.master,this,i,e,s)||{};else i&&(r=e.json(),i&&null==r&&(r={status:"error"})),n=this.processResult(t,r,{text:i,data:e,loader:s})}return this.callEvent("onAfterSync",[t,i,e,s]),n},escape:function(t){return this.P.escape?this.P.escape(t):encodeURIComponent(t)},getState:function(){if(!this.or.length)return!1;for(var t=this.or.length-1;0<=t;t--)if(this.or[t].gr)return"saving";return!0},getItemState:function(t){var i=this.Cr(t);return this.or[i]||null},setItemState:function(t,i){if(i)this.dr(t,null,"update");else{var e=this.Cr(t);-1<e&&this.or.splice(e,1)}},Cr:function(t){for(var i=-1,e=0;e<this.or.length;e++)if(this.or[e].id==t){i=e;break}return i}},Si,g,ce);function ve(){this.name="DataStore",H.extend(this,g),this.setDriver("json"),this.pull={},this.order=m(),this.Dr={}}ve.prototype={setDriver:function(t){zt[t],this.driver=zt[t]},X:function(t){this.callEvent("onParse",[this.driver,t]),this.Ir&&this.filter();var i=this.driver.getInfo(t);i.config&&this.callEvent("onServerConfig",[i.config]);var e=this.driver.getOptions(t);e&&this.callEvent("onServerOptions",[e]);var s=this.driver.getRecords(t);this.Ar(i,s),this.Fr&&this.Tr&&!this.Vr&&this.Tr(this.Fr),this.zr&&(this.blockEvent(),this.sort(this.zr),this.unblockEvent()),this.callEvent("onStoreLoad",[this.driver,t]),this.refresh()},Ar:function(t,i){var e=t.from,s=!0,n=!1;if(!e&&0!==e&&this.order[0]){if(this.Br){n={};for(var h=0;h<this.order.length;h++)n[this.order[h]]=!0}s=!1,e=this.order.length}else e=1*(e||0);for(var r=0,o=0;o<i.length;o++){var a=this.driver.getDetails(i[o]),u=this.id(a);this.pull[u]?s&&this.order[r+e]&&r++:(this.order[r+e]=u,r++),this.pull[u]?(H.extend(this.pull[u],a,!0),this.Hr&&this.Hr(this.pull[u]),n&&delete n[u]):(this.pull[u]=a,this.Rr&&this.Rr(a))}if(n){for(var c in this.blockEvent(),n)this.remove(c);this.unblockEvent()}var f=1*t.size;f&&(this.order[f-1]||(this.order[f-1]=undefined),f<this.order.length&&(this.order=this.order.slice(0,f)))},id:function(t){return t.id||(t.id=V())},changeId:function(t,i){t!=i&&(this.pull[t]&&(this.pull[i]=this.pull[t]),this.pull[i].id=i,this.order[this.order.find(t)]=i,this.Ir&&(this.Ir[this.Ir.find(t)]=i),this.Dr[t]&&(this.Dr[i]=this.Dr[t],delete this.Dr[t]),this.callEvent("onIdChange",[t,i]),this.Er&&this.Er(t,i),delete this.pull[t])},getItem:function(t){return this.pull[t]},updateItem:function(t,i,e){"object"===M(t)&&(t=t.toString());var s=this.getItem(t),n=null,h=this.hasEvent("onDataUpdate");!i||!i.id||i.id,R(i)||s===i||(h&&(n=_(s)),t=s.id,H.extend(s,i,!0),s.id=t),this.Hr&&this.Hr(s),this.callEvent("onStoreUpdated",[t,s,e||"update"]),h&&this.callEvent("onDataUpdate",[t,s,n])},refresh:function(t){this.Pr||(t?this.exists(t)&&this.callEvent("onStoreUpdated",[t,this.pull[t],"paint"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(t,i){this.Pr=!0,t.call(i||this),this.Pr=!1},
getRange:function(t,i){if(t=t?this.getIndexById(t):this.$min||this.startOffset||0,i?i=this.getIndexById(i):(i=0===this.$max?0:Math.min(this.$max?this.$max-1:this.endOffset||Infinity,this.count()-1))<0&&(i=0),i<t){var e=i;i=t,t=e}return this.getIndexRange(t,i)},getIndexRange:function(t,i){i=Math.min(0===i?0:i||Infinity,this.count()-1);for(var e=m(),s=t||0;s<=i;s++)e.push(this.getItem(this.order[s]));return e},count:function(){return this.order.length},exists:function(t){return!!this.pull[t]},move:function(t,i){if(t!=i){var e=this.getIdByIndex(t),s=this.getItem(e);this.Ir&&this.jr(this.Ir,0,0,this.getIdByIndex(t),this.getIdByIndex(i)),this.jr(this.order,t,i),this.callEvent("onStoreUpdated",[e,s,"move"])}},jr:function(t,i,e,s,n){if(s||n){i=e=-1;for(var h=0;h<t.length;h++)t[h]==s&&i<0&&(i=h),t[h]==n&&e<0&&(e=h)}var r=t[i];t.removeAt(i),t.insertAt(r,Math.min(t.length,e))},scheme:function(t){for(var i in this.Nr={},this.wr=t.$save,this.Rr=t.$init||t.$change,this.Hr=t.$update||t.$change,this.vr=t.$serialize,this.Fr=t.$group,this.zr=t.$sort,this.Lr=t.$export,t)"$"!=i.substr(0,1)&&(this.Nr[i]=t[i])},importData:function(t,i){var e=t?t.data||t:[];if(this.Ir=null,"function"==typeof e.serialize){if(this.order=m([].concat(e.order)),this.Or){this.Or=!1;var s=this.pull;for(var n in this.pull={},e.pull){var h=s[n];this.pull[n]=_(e.pull[n]),h&&h.open&&(this.pull[n].open=!0)}}else for(var r in this.pull={},e.pull)this.pull[r]=e.pull[r];e.branch&&this.branch&&(this.branch=_(e.branch),this.Wr=null)}else{var o,a;if(this.order=m(),this.pull={},$(t))for(var u=0;u<t.length;u++)"object"==M(a=o=t[u])?a.id=a.id||V():a={id:o,value:o},this.order.push(a.id),this.Rr&&this.Rr(a),this.pull[a.id]=a;else for(var c in e)this.order.push(c),this.pull[c]={id:c,value:e[c]}}if(this.Ur&&!e.branch){this.branch={0:[]},this.Yr||this.qr("data");for(var f=0;f<this.order.length;f++){var l=this.order[f];this.Ur(this.pull[l],0,0,!1)}}this.callEvent("onStoreLoad",[]),i||this.callEvent("onStoreUpdated",[])},sync:function(s,n,h){this.unsync();var t=M(s);if("string"==t&&(s=oi(s)),"function"!=t&&"object"!=t&&(h=n,n=null),"DataStore"!=s.name&&"TreeStore"!=s.name){if(!s.data||"DataStore"!==s.data.name&&"TreeStore"!==s.data.name)return this.Gr=s,y("onSyncUnknown",[this,s,n]);s=s.data}var i=S(function(t,i,e){this.Xr||(n&&this.branch&&(this.Or=!0),this.importData(s,!0),n&&this.silent(n),this.he&&this.he(),t&&i&&e||this.count()||(this.Dr={}),"delete"==e&&this.Dr[t]&&delete this.Dr[t],this.callEvent("onSyncApply",[]),h?h=!1:this.refresh())},this);this.Jr=[s.attachEvent("onStoreUpdated",i),s.attachEvent("onIdChange",S(function(t,i){this.changeId(t,i),this.refresh(i)},this))],this.Gr=s,this.Kr=this.attachEvent("onStoreUpdated",function(t,i,e){"update"!=e&&"save"!=e||(this.Xr=1,s.updateItem(t,i),this.Xr=0)}),i()},unsync:function(){if(this.Gr){var t=this.Gr;if("DataStore"==t.name||"TreeStore"==t.name||t.data&&"DataStore"==t.data.name&&"TreeStore"==t.data.name){for(var i=0;i<this.Jr.length;i++)t.detachEvent(this.Jr[i]);this.detachEvent(this.Kr)}else y("onUnSyncUnknown",[this,t]);this.Gr=null}},destructor:function(){this.unsync(),this.pull=this.order=this.Dr=null,this.o=this.u={}},add:function(t,i){if(this.Nr)for(var e in this.Nr)R(t[e])&&(t[e]=this.Nr[e]);this.Rr&&this.Rr(t);var s=this.id(t),n=arguments[2]||this.order,h=n.length;if((R(i)||i<0)&&(i=h),h<i&&(i=Math.min(n.length,i)),!1===this.callEvent("onBeforeAdd",[s,t,i]))return!1;if(this.exists(s),this.pull[s]=t,n.insertAt(s,i),this.Ir){var r=this.Ir.length;this.order.length&&(r=Math.min(i||0,r)),this.Ir.insertAt(s,r)}return this.callEvent("onStoreUpdated",[s,t,"add"]),this.callEvent("onAfterAdd",[s,i]),t.id},remove:function(t){if($(t))for(var i=0;i<t.length;i++)this.remove(t[i]);else{if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.exists(t);var e=this.getItem(t);this.order.remove(t),this.Ir&&this.Ir.remove(t),delete this.pull[t],this.Dr[t]&&delete this.Dr[t],this.callEvent("onStoreUpdated",[t,e,"delete"]),this.callEvent("onAfterDelete",[t])}},clearAll:function(t){this.pull={},this.Dr={},this.order=m(),this.Ir=null,t||(
this.url=null),this.callEvent("onClearAll",[t]),this.refresh()},getIdByIndex:function(t){return this.order[t]},getIndexById:function(t){return this.pull[t]?this.order.find(t):-1},getNextId:function(t,i){return this.order[this.getIndexById(t)+(i||1)]},getFirstId:function(){return this.order[0]},getLastId:function(){return this.order[this.order.length-1]},getPrevId:function(t,i){return this.order[this.getIndexById(t)-(i||1)]},sort:function(t,i,e){var s,n=this,h=t;if(s=$(h)?[h=h.map(function(t){return n.Zr(t)})]:[(h=this.Zr(t,i,e)).by,h.dir,h.as,h],this.callEvent("onBeforeSort",s)){var r=this.sorting.create(h);this.order=this.Qr(r,this.order),this.Ir&&this.Ir.length!=this.order.length&&(this.Ir=this.Qr(r,this.Ir)),this.refresh(),this.callEvent("onAfterSort",s)}},Zr:function(t,i,e){var s=t;return"function"==typeof t?s={as:t,dir:i}:"string"==typeof t&&(s={by:t,dir:i,as:e}),"string"==typeof s.by&&(s.by=s.by.replace(/#/g,"")),s},Qr:function(t,i){if(this.order.length){for(var e=i.splice(0,this.$freeze),s=m(),n=i.length-1;0<=n;n--)s[n]=this.pull[i[n]];return s.sort(t),m(e.concat(s.map(function(t){return this.id(t)},this)))}return i},io:function(t){this.Ir&&!t&&(this.order=this.Ir,delete this.Ir)},eo:function(t,i,e){for(var s=m(),n=this.$freeze||0,h=0;h<this.order.length;h++){var r=this.order[h];(h<n||t(this.getItem(r),i))&&s.push(r)}e&&this.Ir||(this.Ir=this.order),this.order=s},find:function(t,i){var e=[];for(var s in this.pull){var n=this.pull[s],h=!0;if("object"==M(t)){for(var r in t)if(n[r]!=t[r]){h=!1;break}}else t(n)||(h=!1);if(h&&e.push(n),i&&e.length)return e[0]}return i?null:e},filter:function(e,i,t){if((e||this.Ir||this.Wr)&&this.callEvent("onBeforeFilter",[e,i])&&(this.io(t),this.order.length)){if(e){var s=e;i=i||"","string"==typeof e&&(e=e.replace(/#/g,""),s="function"==typeof i?function(t){return i(t[e])}:(i=i.toString().toLowerCase(),function(t,i){return-1!=(t[e]||"").toString().toLowerCase().indexOf(i)})),this.eo(s,i,t,this.so)}this.refresh(),this.callEvent("onAfterFilter",[])}},no:function(){for(var t=[],i=this.order.length-1;0<=i;i--)t[i]=this.pull[this.order[i]];return t},each:function(t,i,e){var s=this.order;e&&(s=this.Ir||s);for(var n=0;n<s.length;n++)s[n]&&t.call(i||this,this.getItem(s[n]),n)},ho:function(t,i){return function(){return t[i].apply(t,arguments)}},provideApi:function(t,i){i&&this.mapEvent({onbeforesort:t,onaftersort:t,onbeforeadd:t,onafteradd:t,onbeforedelete:t,onafterdelete:t,ondataupdate:t});for(var e=["sort","add","remove","exists","getIdByIndex","getIndexById","getItem","updateItem","refresh","count","filter","find","getNextId","getPrevId","clearAll","getFirstId","getLastId","serialize","sync"],s=0;s<e.length;s++)t[e[s]]=this.ho(this,e[s])},addMark:function(t,i,e,s,n){var h=this.Dr[t]||{};if(!(this.Dr[t]=h)[i]){if(h[i]=s||!0,e){var r=h.$css||"";h.$css=r+" "+i}n||this.refresh(t)}return h[i]},removeMark:function(t,i,e,s){var n=this.Dr[t];if(n){if(n[i]&&delete n[i],e){var h=n.$css;h&&(n.$css=h.replace(i,"").replace("  "," "))}s||this.refresh(t)}},getMark:function(t,i){var e=this.Dr[t];return!!e&&e[i]},clearMark:function(t,i,e){for(var s in this.Dr){var n=this.Dr[s];n[t]&&(delete n[t],i&&n.$css&&(n.$css=n.$css.replace(t,"").replace("  "," ")),e||this.refresh(s))}},serialize:function(t){var i=this.order;t&&this.Ir&&(i=this.Ir);for(var e=[],s=0;s<i.length;s++){var n=this.pull[i[s]];this.vr&&!1===(n=this.vr(n))||e.push(n)}return e},sorting:{create:function(t){return $(t)?this.ro(t):this.oo(t.dir,this.ao(t.by,t.as))},as:{server:function(){return!1},date:function(t,i){return t-=0,i-=0,isNaN(i)?1:isNaN(t)?-1:i<t?1:t<i?-1:0},"int":function(t,i){return t*=1,i*=1,isNaN(i)?1:isNaN(t)?-1:i<t?1:t<i?-1:0},string_strict:function(t,i){return i?t?(t=t.toString(),(i=i.toString())<t?1:t<i?-1:0):-1:1},string:function(t,i){return i?t?(t=t.toString().toLowerCase(),(i=i.toString().toLowerCase())<t?1:t<i?-1:0):-1:1},raw:function(t,i){return i<t?1:t<i?-1:0}},ro:function(n){var i=this;return n=n.map(function(t){return i.oo(t.dir,i.ao(t.by,t.as))}),function(t,i){for(var e,s=0;!(e=n[s](t,i))&&n[++s];);return e}},
ao:function(e,s){return e?("function"!=typeof s&&(s=this.as[s||"string"]),function(t,i){return s(t[e],i[e])}):s},oo:function(t,e){return"asc"!=t&&t?function(t,i){return-1*e(t,i)}:e}}};var _e=H.proto({$init:function(t){t=t||"",this.uo={},this.Y=1,this.data=new ve,this.data.attachEvent("onClearAll",S(this.co,this)),this.data.attachEvent("onServerConfig",S(this.fo,this)),this.attachEvent("onDestruct",this.co),this.data.feed=this.lo,this.data.owner=t.id},lo:function(t,i,e,s){return this["do"]?(s=b.defer(),this["do"]=[t,i,e,s],s):(this["do"]=!0,this.uo.from=t,this.uo.count=i,this.vo.call(this,t,i,e,!1,!1,s))},vo:function(t,i,e,s,n,h){var r=this,o=null;if(s=s||this.data.url,t<0&&(t=0),n||(n={start:t,count:i}),this.count()&&(n["continue"]="true"),this.getState&&(o=this.getState()),s&&"string"!=typeof s)return o&&(o.sort&&(n.sort=o.sort),o.filter&&(n.filter=o.filter)),this.load(s,0,n).then(function(t){return r._o(t,e,h)},function(){return r.po()});s+=-1==s.indexOf("?")?"?":"&";var a=[];for(var u in n)a.push(u+"="+n[u]);if(o){if(o.sort)for(var c=$(o.sort)?o.sort:[o.sort],f=0;f<c.length;f++)a.push("sort["+c[f].id+"]="+encodeURIComponent(c[f].dir));if(o.filter)for(var l in o.filter){var d=o.filter[l];"object"==M(d)&&(d=B().stringify(d)),a.push("filter["+l+"]="+encodeURIComponent(d))}}return s+=a.join("&"),this.uo.url!==s?(this.uo.url=s,this.load(s).then(function(t){return r._o(t,e,h)},function(){return r.po()})):(this["do"]=!1,b.reject())},_o:function(t,i,e){var s=this;return k(function(){return s.po()},"","",100),i&&B.$callback(this,i,t),e&&e.resolve(t),t},po:function(){var t=this["do"];this["do"]=!1,"object"==M(t)&&this.data.feed.apply(this,t)},load:function(t){t=W.$parse(t);var i=Ht.load.apply(this,arguments);return this.data.url||(this.data.url=t),i},loadNext:function(t,i,e,s,n){var h=this.P;if(!h.datathrottle||n)return i||0===i||(i=this.count()),t||(t=h.datafetch||this.count()),this.data.url=this.data.url||s,this.callEvent("onDataRequest",[i,t,e,s])&&this.data.url?this.data.feed.call(this,i,t,e):b.reject();this.bo&&window.clearTimeout(this.bo);var r=b.defer();return this.bo=k(function(){r.resolve(this.loadNext(t,i,e,s,!0))},this,0,h.datathrottle),r},mo:function(t,i){var e=this.uo;return!!(this["do"]&&e.url&&e.from<=i&&e.count+e.from>=t+i)},removeMissed_setter:function(t){return this.data.Br=t},go:function(){var t=this.P.save;!0===t&&(t=this.P.save=this.P.url);var i={master:this};t&&t.url?H.extend(i,t):i.url=t,le(i)},save_setter:function(t){return t&&this.$ready.push(this.go),t},waitSave:function(t){var i=this;return le(this).ar(function(){t.call(i)}).then(function(t){return 1==t.length?t[0]:t})},scheme_setter:function(t){this.data.scheme(t)},dataFeed_setter:function(t){return t=W.$parse(t),this.data.attachEvent("onBeforeFilter",S(function(t,i){var e,s=this;if("function"==typeof t)return!0;if(this.P.dataFeed&&(t||i)){t=t||"id",i&&"object"==M(i)&&(i=i.id);var n=this.P.dataFeed;if("string"==typeof n){var h="filter["+t+"]="+encodeURIComponent(i);e=this.O(n+(n.indexOf("?")<0?"?":"&")+h,this.P.datatype)}else{var r={};r[t]=i,"function"==typeof n?e=n.call(this,i,r):n.$proxy&&n.load&&(e=n.load(this,{filter:r}))}return e&&(e.then||(e=b.resolve(e)),e.then(function(t){s.clearAll(),s.W(t),s.data.callEvent("onAfterFilter",[])},function(t){return s.U(t)})),!1}},this)),t},G:function(){if(this.P.ready&&!this.wo){var t=v(this.P.ready,this.$scope);t&&k(t,this,arguments),this.callEvent&&k(this.callEvent,this,["onReady",[]]),this.wo=!0}},co:function(t){this.Y++,t||(this["do"]=!1,this.uo={},this.waitData=b.defer())},fo:function(t){this.Hi(t)}},Ht),pe={getState:function(){for(var i=this,t=this.config.columns.length,e=this.config.columns,s={ids:[],size:[],select:this.getSelectedId(!0),scroll:this.getScrollState()},n=0;n<t;n++){var h=e[n];s.ids.push(h.id),s.size.push(h.fillspace||h.adjust?-1:h.width)}if(s.order=[].concat(this.xo.length?this.xo:s.ids),this.yo.length){var r=this.yo.map(function(t){return{id:t,dir:i.Mo[t].dir}});s.sort=1==r.length?r[0]:r}if(this.So&&this.ko){var o={},a=0;for(var u in this.So)if(!this.Co[u]){var c=this.So[u]
;c[1].value=o[u]=c[2].getValue(c[0]),a=1}a&&(s.filter=o)}for(var f in s.hidden=[],this.Co)s.hidden.push(f);return s},setState:function(t){var i=this.config.columns;if(t){if(this.markSorting(),this.yo=[],this.Mo={},this.blockEvent(),t.order&&t.order.length&&(this.xo=[].concat(t.order),this.$o=[this.P.leftSplit,t.order.length-this.P.rightSplit]),t.hidden){for(var e={},s=0;s<t.hidden.length;s++)e[t.hidden[s]]=!0,this.xo.length||this.hideColumn(t.hidden[s]);if(this.xo.length)for(var n=0;n<this.xo.length;n++){var h=this.xo[n];!!e[h]==!this.Co[h]&&this.hideColumn(h,{},!1,!!e[h])}}if(t.ids){for(var r=!1,o=0;o<i.length;o++)i[o].id!=t.ids[o]&&(r=!0);if(r){for(var a=0;a<t.ids.length;a++)i[a]=this.getColumnConfig(t.ids[a])||i[a];this.refreshColumns()}}if(t.size)for(var u=Math.min(t.size.length,i.length),c=0;c<u;c++){var f=i[c];f&&0<t.size[c]&&f.width!=t.size[c]&&(delete f.fillspace,delete f.adjust,this.Do(c,t.size[c],!0))}this.unblockEvent();var l=!(this.P.leftSplit||this.P.rightSplit);if(this.Io(l),this.callEvent("onStructureUpdate",[]),t.sort){var d=t.sort,v=!0;$(d)||(v=!(d=[d]));for(var _=0;_<d.length;_++){var p=this.getColumnConfig(d[_].id);p&&this.Ao(p.id,d[_].dir,p.sort,v)}}if(t.filter){var b=this.filterByAll;for(var m in this.filterByAll=function(){},t.filter){var g=t.filter[m];if(g&&this.So[m]){var w=this.So[m];w[2].setValue(w[0],g);var x=w[1].contentId;x&&(this.Fo[x].value=g)}}for(var y in this.So)if(!t.filter[y]){var M=this.So[y];M[2].setValue(M[0],"")}this.filterByAll=b,this.filterByAll()}if(t.select&&this.select){var S=t.select;this.unselect();for(var k=0;k<S.length;k++)S[k].row&&!this.exists(S[k].row)||this.To(S[k],!0)}t.scroll&&this.scrollTo(t.scroll.x,t.scroll.y)}}},be={Vo:function(t,i,e){i||Xi.addDrop(t.Wi,t,!0),e||Xi.addDrag(t.Wi,t),this.attachEvent("onDragOut",function(t,i){this.$dragMark(t,i)}),this.attachEvent("onBeforeAutoScroll",function(){var t=Xi.getContext();return!(!Xi.Os||!t||t.to!==this&&!this.zo)})},drag_setter:function(t){return t&&(H.extend(this,Gt,!0),"order"!=t&&"move"!=t||H.extend(this,d("DragOrder"),!0),"inner"!=t&&"order"!=t||(this.Bo=!0),this.Vo(this,"source"==t,"target"==t),delete this.drag_setter),t},$dragIn:function(t,i,e){var s=this.locate(e)||null,n=Xi.Gs;if((this.Bo||n.from.Bo)&&n.from!==this)return!1;var h=Xi.getMaster(i),r=this.getItemNode(s,e)||this.tt;if(r==Xi.an)return r;n.target=s,n.to=h,this.rt&&(this.rt=window.clearTimeout(this.rt));var o=this.addRowCss&&q.touch&&!this.P.prerender;return!1===this.P.dragscroll||o||(this.rt=k(function(t,i){this.Ho(i),this.et(t,i)},this,[mt(e),s],250)),this.$dropAllow(n,e)&&this.callEvent("onBeforeDragIn",[n,e])?(this.$dragMark(n,e),r):(n.to=n.target=null,this.rt&&(this.rt=window.clearTimeout(this.rt)),null)},$dropAllow:function(){return!0},Ho:function(){},Ro:function(t){return t&&"object"===M(t)?t.toString():t},$dragOut:function(t,i,e,s){var n=(this.Vt.contains(e)?this.locate(s):null)||null,h=Xi.Gs;return(h.target||"").toString()==(n||"").toString()||(this.rt&&(this.rt=window.clearTimeout(this.rt)),h.target=h.to=null,this.callEvent("onDragOut",[h,s])),null},$drop:function(t,i,e){var s=Xi.Gs;(s.to=this).Eo(t,i,s),this.$dragMark({},e),s.from&&s.from!=s.to&&s.from.callEvent&&!s.from.callEvent("onBeforeDropOut",[s,e])||this.callEvent("onBeforeDrop",[s,e])&&(this.Po(s,e),this.callEvent("onAfterDrop",[s,e]))},Eo:function(t,i,e){var s=this.Ro(e.target);this.getBranchIndex?e.index=s?(e.parent=this.getParentId(s),this.getBranchIndex(s)):-1:e.index=s?this.getIndexById(s):this.count()},Po:function(t){if(t.from,t.from&&t.from.move){var i={parent:t.parent,mode:t.pos};t.from.move(t.source,t.index,t.to,i)}},qs:function(t,i){if(this.getItemNode){var e=this.locate(i,!0),s=e?this.getItemNode(e):null;return s?pt(s):s}},$drag:function(t,i){var e=this.locate(i,!0);if(e){var s=[e];if(this.getSelectedId){var n=this.getSelectedId(!0,!0);if(n&&1<n.length&&-1!=x.find.call(n,e)){var h={};s=[];for(var r=0;r<n.length;r++)h[n[r]]=!0;for(var o=0;o<this.data.order.length;o++){var a=this.data.order[o];h[a]&&s.push(a)}}}var u=Xi.Gs={source:s,start:e};if((u.from=this).callEvent(
"onBeforeDrag",[u,i]))return q.touch&&"touch"==this.jo&&k(function(){Yi.Ge=null}),u.html||this.$dragHTML(this.getItem(e),i,u)}return null},$dragHTML:function(t,i,e){var s=this.Q(t);return $(e.source)&&1<e.source.length&&(s=this.No(s,e.source.length)),s},No:function(t,i){var e="<div class='webix_drag_multiple'></div>";return 2<i&&(e="<div class='webix_drag_multiple_last'></div>"+e),e+(t="<div class='webix_drag_main'>"+t+"</div>")+"<span class='webix_badge'>"+i+"</span>"},$dragMark:function(t){var i=null;return t.target&&(i=this.Ro(t.target)),this.Lo&&this.Lo!=i&&(this.Oo([this.Lo],"webix_drag_over",!0),this.Lo=null),!this.Lo&&i?(this.Lo=i,this.Wo([i],"webix_drag_over",!0),i):!!t.to},Wo:function(t,i){for(var e=0;e<t.length;e++)this.addCss(t[e],i)},Oo:function(t,i){for(var e=0;e<t.length;e++)this.removeCss(t[e],i)},$dropHTML:function(){return""},Uo:function(t,i){var e=this.getItemNode(t);e?e.parentNode.insertBefore(Xi.dn[0],e):i.children[0].appendChild(Xi.dn[0])}},me={$drag:function(t,i){var e=be.$drag.apply(this,arguments);if(!e)return e;var s=Xi.Gs;return this.Yo&&this.Yo(s),this.Bo&&this.getBranchIndex&&(this.qo=this.Go?20*(this.getItem(s.start).$level+1)+8:0),$(s.source)&&(Xi.un(i),this.Wo(s.source,"webix_invisible")),e},$dragIn:function(t,i,e){var s=be.$dragIn.apply(this,arguments);if(!s)return s;Xi.dn||(Xi.dn=this.Xo());var n=Xi.Gs,h="$webix-last";if(n.target&&(h=this.Ro(n.target)),"$webix-last"!=h&&"$webix-drop"!=h){var r={direction:this.P.layout||this.Jo||"y",x:"width",y:"height"},o=pt(s);2*(mt(e)[r.direction]-o[r.direction])>o[r[r.direction]]&&(h=this.getNextId(h)||"$webix-last")}return h==this.Ko||"$webix-drop"==h||(this.Ko=h,this.Uo(h,i)),s},$dragPos:function(t){if(!this.Bo){var i=Xi.Gs;return t.y+=i.y_offset,void(t.x+=i.x_offset)}var e=pt(this.$view);if("x"==this.P.layout)if(e.x-=12,t.y=e.y-8,t.x=t.x-18,t.x<e.x)t.x=e.x;else{var s=e.x+e.width;t.x>s&&(t.x=s)}else if(e.y+=(this.Zo||0)-12,t.x=e.x+8+(this.qo||0),t.y=t.y-18,t.y<e.y)t.y=e.y;else{var n=e.y+e.height-(this.Zo||0);t.y>n&&(t.y=n)}},$dragOut:function(t,i,e){return i!=e&&(dt(Xi.dn),this.Ko=Xi.dn=null),be.$dragOut.apply(this,arguments)},Eo:function(t,i,e){var s="$webix-last"==this.Ko?null:this.Ko;this.getBranchIndex?s?(e.parent=this.getParentId(s),e.index=this.getBranchIndex(s),t==i&&this.getParentId(e.start)==e.parent&&this.getBranchIndex(e.start)<e.index&&(e.index-=1)):e.index=-1:(e.index=s?this.getIndexById(s):this.count(),e.index-=t==i&&this.getIndexById(e.start)<e.index?1:0)},$dragDestroy:function(){var t=Xi.Gs;$(t.source)&&this.Oo(t.source,"webix_invisible"),dt(Xi.Oi)},Xo:function(){var t=document.createElement("div");return t.className="webix_drop_area",t.style.width=this.type.width+"px",t.style.height=this.type.height+"px",t.innerHTML=this.$dropHTML(),t.setAttribute(this.Qo,"$webix-drop"),[t]},$dragMark:function(){return!1}};t("DragOrder",me);var ge={$init:function(){this.ta=H.extend([],x,!0),this.ia=-1},undo_setter:function(t){return t&&(this.ea(),this.ea=function(){}),t},ea:function(){var n=this;this.attachEvent("onBeforeDrop",function(t){if(t.from==t.to){var i=n.sa=_(this.getItem(t.start));this.data.branch?i.$index=this.getBranchIndex(i.id):i.$index=this.getIndexById(i.id)}}),this.data.attachEvent("onDataMove",function(t){if(n.sa&&n.sa.id==t){var i=n.sa;n.sa=null,n.na(t,i,"move")}}),this.data.attachEvent("onBeforeDelete",function(t){if(this.getItem(t)){var i=n.ha=_(this.getItem(t));this.branch?(i.$index=this.getBranchIndex(t),this.branch[t]&&(i.$branch=_(this.serialize(t)))):i.$index=this.getIndexById(t)}}),this.data.attachEvent("onDataUpdate",function(t,i,e){n.na(t+"",e,"update")}),this.data.attachEvent("onStoreUpdated",function(t,i,e){var s=null;t&&("add"==e?s=_(i):"delete"==e&&(s=n.ha),s&&n.na(t,s,e))}),this.data.attachEvent("onIdChange",function(t,i){"object"==M(t)&&(t=t.row);for(var e=0;e<n.ta.length;e++)n.ta[e].id==t&&(n.ta[e].id=i)})},na:function(t,i,e){!this.ra&&this.P.undo&&(this.ta.push({id:t,action:e,data:i}),20==this.ta.length&&this.ta.splice(0,1),this.oa||(this.ia=this.ta.length-1))},ignoreUndo:function(t,i){this.ra=!0,t.call(i||this),
this.ra=!1},removeUndo:function(t){for(var i=this.ta.length-1;0<=i;i--)this.ta[i].id==t&&("id"==this.ta[i].action&&(t=this.ta[i].data),this.ta.removeAt(i));this.ia=this.ta.length-1},undo:function(e){if(e)this.ignoreUndo(function(){var t,i;for(i=this.ta.length-1;!t&&0<=i;i--)this.ta[i].id==e&&(t=this.ta[i]);t&&(this.aa(t),this.ta.removeAt(i+1),this.ia=this.ta.length-1)});else{var t=this.ta[this.ia];t&&(this.ignoreUndo(function(){this.aa(t),this.ta.removeAt(this.ia)}),this.ia--)}},aa:function(t){if("delete"==t.action){var i=null,e=t.data.$parent;t.data.$branch&&(i={parent:t.id,data:_(t.data.$branch)},delete t.data.$branch,e&&!this.data.branch[e]&&(e=0)),this.add(t.data,t.data.$index,e),i&&this.parse(i)}else"add"==t.action?this.remove(t.id):"update"==t.action?this.updateItem(t.id,t.data):"move"==t.action&&(t.data.$parent?this.getItem(t.data.$parent)&&this.move(t.id,t.data.$index,null,{parent:t.data.$parent}):this.move(t.id,t.data.$index))}};function we(t){t&&t.setMasterValue&&!t.ua&&(t.ua=!0,t.attachEvent("onValueSuggest",function(){k(function(){y("onEditEnd",[])})}))}function xe(t){return"string"==typeof t?t:t.linkInput?t.P.id:("object"==M(t)?($(t)&&(t={data:t}),t.view=t.view||"suggest"):!0===t&&(t={view:"suggest"}),si(t).config.id)}function ye(t){return((t.header&&t.header[0]?t.header[0].text:t.editValue||t.label)||"").toString().replace(/<[^>]*>/g,"")}var Me={text:{focus:function(){this.getInputNode(this.node).focus(),this.getInputNode(this.node).select()},getValue:function(){return this.getInputNode(this.node).value},setValue:function(t){var i=this.getInputNode(this.node);i.value=t,we(function n(t,i){var e=t.config.suggest;if(e){var s=oi(t.config.suggest=xe(e));return s&&i&&s.linkInput(i),s}}(this,i))},getInputNode:function(){return this.node.firstChild},render:function(){return ft("div",{"class":"webix_dt_editor"},"<input type='text' aria-label='"+ye(this.config)+"'>")}},"inline-checkbox":{render:function(){return{}},getValue:function(){return this.node.checked},setValue:function(){},focus:function(){this.node.focus()},getInputNode:function(){},$inline:!0},"inline-text":{render:function(){return{}},getValue:function(){return this.node.value},setValue:function(){},focus:function(){try{this.node.select(),this.node.focus()}catch(Ro){}},getInputNode:function(){},$inline:!0},checkbox:{focus:function(){this.getInputNode().focus()},getValue:function(){return this.getInputNode().checked},setValue:function(t){this.getInputNode().checked=!!t},getInputNode:function(){return this.node.firstChild.firstChild},render:function(){return ft("div",{"class":"webix_dt_editor"},"<div><input type='checkbox' aria-label='"+ye(this.config)+"'></div>")}},select:{focus:function(){this.getInputNode().focus()},getValue:function(){return this.getInputNode().value},setValue:function(t){this.getInputNode().value=t},getInputNode:function(){return this.node.firstChild},render:function(){var i="",t=this.config.options||this.config.collection;if(t.data&&t.data.each)t.data.each(function(t){i+="<option value='"+t.id+"'>"+t.value+"</option>"});else if($(t))for(var e=0;e<t.length;e++){var s=t[e],n=R(s.id),h=n?s:s.id,r=n?s:s.value;i+="<option value='"+h+"'>"+r+"</option>"}else for(var o in t)i+="<option value='"+o+"'>"+t[o]+"</option>";return ft("div",{"class":"webix_dt_editor"},"<select aria-label='"+ye(this.config)+"'>"+i+"</select>")}},popup:{focus:function(){this.getInputNode().focus()},destroy:function(){this.getPopup().hide()},getValue:function(){return this.getInputNode().getValue()||""},setValue:function(t){this.getPopup().show(this.node),this.getInputNode().setValue(t)},getInputNode:function(){return this.getPopup().getChildViews()[0]},getPopup:function(){return this.config.$popup||(this.config.$popup=this.createPopup()),oi(this.config.$popup)},createPopup:function(){var t,i=this.config.popup||this.config.suggest;if(i)return(t="object"!=M(i)||i.name?oi(i):(i.view=i.view||"suggest",si(_(i)))).ca||(t.linkInput?t.linkInput(document.body):this.linkInput&&this.linkInput(document.body),t.ca=!0),we(t),t;var e=Me.$popup[this.popupType]
;return"string"==typeof e||e.name||(e=Me.$popup[this.popupType]=si(e),this.popupInit(e),e.linkInput||this.linkInput(document.body)),e.P.id},linkInput:function(t){Kt(C(t),"keydown",S(function(t){if(this.config.$popup){var i,e=t.which||t.keyCode,s=this.getInputNode();if(s.isVisible())if(s.moveSelection&&e<41&&32<e)33==e&&(i="pgup"),34==e&&(i="pgdown"),35==e&&(i="bottom"),36==e&&(i="top"),37==e&&(i="left"),38==e&&(i="up"),39==e&&(i="right"),40==e&&(i="down"),s.moveSelection(i);else 13!==e||"TEXTAREA"===t.target.nodeName&&t.shiftKey||y("onEditEnd",[])}},this))},popupInit:function(){},popupType:"text",render:function(){return{}},$inline:!0}};Me.color=H.extend({focus:function(){},popupType:"color",popupInit:function(t){t.getChildViews()[0].attachEvent("onItemClick",function(t){y("onEditEnd",[t])})}},Me.popup),Me.date=H.extend({focus:function(){},popupType:"date",setValue:function(t){this.fa=this.config.stringResult||t&&"string"==typeof t,Me.popup.setValue.call(this,t)},getValue:function(){return this.getInputNode().getValue(this.fa?I.parseFormatStr:"")||""},popupInit:function(t){t.getChildViews()[0].attachEvent("onDateSelect",function(t){y("onEditEnd",[t])})}},Me.popup),Me.combo=H.extend({la:function(t){var i,e;return this.config.popup?e=(i=this.config.popup).config.id:t?i=oi(e=xe(t)):e=this.da(t),we(i),e},da:function(){var t=Me.combo;return t.va=t.va||this.la(!0)},render:function(){var t=ft("div",{"class":"webix_dt_editor"},"<input type='text' role='combobox' aria-label='"+ye(this.config)+"'>"),i=this.config.suggest=this.la(this.config.suggest);return i&&(oi(i).linkInput(t.firstChild,!0),Kt(t.firstChild,"click",S(this.showPopup,this))),t},getPopup:function(){return oi(this.config.suggest)},showPopup:function(){var t=this.getPopup(),i=t.getList(),e=this.getInputNode(),s=this._a;t.show(e),e.setAttribute("aria-expanded","true"),s?(i.exists(s),i.exists(s)&&(i.select(s),i.showItem(s))):(i.unselect(),i.showItem(i.getFirstId())),t.pa=e},afterRender:function(){this.showPopup()},setValue:function(t){if(this._a=t,this.config.suggest){var i=oi(this.config.suggest),e=this.config.collection||this.config.options;e&&i.getList().data.importData(e),this.getInputNode(this.node).value=i.getItemText(t)}},getValue:function(){var t=this.getInputNode().value;if(this.config.suggest){var i=oi(this.config.suggest),e=i.getList();(t||e.getSelectedId&&e.getSelectedId())&&(t=i.getSuggestion(t))}return t}},Me.text),Me.richselect=H.extend({focus:function(){},getValue:function(){return this.getPopup().getValue()},setValue:function(t){var i=this.config.collection||this.config.options;this.getInputNode(),i&&this.getPopup().getList().data.importData(i),this.getPopup().show(this.node),this.getPopup().setValue(t)},getInputNode:function(){return this.getPopup().getList()},popupInit:function(t){t.ba=function(){},t.linkInput(document.body),we(t)},popupType:"richselect"},Me.popup),Me.password=H.extend({render:function(){return ft("div",{"class":"webix_dt_editor"},"<input type='password' aria-label='"+ye(this.config)+"'>")}},Me.text),Me.$popup={text:{view:"popup",width:250,height:150,body:{view:"textarea"}},color:{view:"popup",body:{view:"colorboard"}},date:{view:"popup",width:250,height:250,padding:0,body:{view:"calendar",icons:!0,borderless:!0}},richselect:{view:"suggest",body:{view:"list",select:!0}},multiselect:{view:"multisuggest",suggest:{button:!0}}};var Se={defaults:{editaction:"click"},$init:function(t){this.ma={},this.Ai=0,this.wt=0,this.Wi.style.position="relative",t&&(t.onDblClick=t.onDblClick||{}),this.attachEvent("onAfterRender",this.ga),this.P.editable&&this.wa(),H.extend(this,ge)},xa:function(t){try{if("number"==typeof t.selectionStart)t.selectionStart=t.selectionEnd=t.value.length;else if("undefined"!=typeof t.createTextRange){var i=t.createTextRange();i.collapse(!1),i.select()}}catch(Ro){}},ga:function(){var t=this.getEditor();if(t&&t.$inline&&!t.getPopup){var i=this.ya(t);if(i&&i!=t.node){var e=t.node.value;(t.node=i).value=e,i.focus(),this.xa(i)}else this.editStop()}},editable_setter:function(t){return t&&this.wa(),t},wa:function(){var t=A(
"onEditEnd",S(function(){this.Ai&&this.editStop()},this)),i=A("onClick",S(function(t){this.Ai&&200<new Date-this.wt&&(this.Pi&&!this.Pi.popupType&&t&&this.Pi.node&&this.Pi.node.contains(t.target)||this.editStop())},this));this.attachEvent("onDestruct",function(){F(t),F(i)}),this.data.attachEvent&&this.data.attachEvent("onIdChange",S(function(t,i){this.Ma(t,i)},this)),this.attachEvent("onItemClick",function(t){this.P.editable&&"click"==this.P.editaction&&this.edit(t)}),this.attachEvent("onItemDblClick",function(t){this.P.editable&&"dblclick"==this.P.editaction&&this.edit(t)}),this.Sa=S(function(){this.wt=new Date},this),this.wa=function(){},this.ka&&this.ka()},Ca:function(){k(function(){var t=this.getEditor();if(t&&t.config.liveEdit){var i={value:t.getValue(),old:t.value};if(i.value==i.old)return;t.value=i.value,this.$a(t,i.value,!1),this.callEvent("onLiveEdit",[i,t])}},this)},Da:function(t){var i=this.P.form;"string"!=typeof i&&(this.P.form=i=si(i).config.id);var e=(i=oi(i)).setValues?i:i.getChildViews()[0];e.setValues(this.getItem(t.row||t)),i.config.master=this.config.id,i.show(this.getItemNode(t));var s=e.getChildViews()[0];s.focus&&s.focus()},edit:function(t,i,e){if(this.P.editable&&this.callEvent("onBeforeEditStart",[t])){if(this.P.form)return this.Da(t);var s=this.Ia(t);if(s){if(this.getEditor(t))return;i||this.editStop(),Me[s];var n=H.extend({},Me[s]),h=this.Aa(t,n,e);n.config.liveEdit&&(this.Fa=this.attachEvent("onKeyPress",this.Ca));var r=n.getPopup?n.getPopup(h).Vt:h;return r&&Kt(r,"click",this.Sa),h&&Kt(h,"change",this.Ta,{bind:{view:this,id:t}}),!1!==e&&n.focus(),this.$fixEditor&&this.$fixEditor(n),this.wt=ii.edit_open_time=new Date,Mi.setFocus(this,!0),this.callEvent("onAfterEditStart",[t]),n}return null}},getEditor:function(t){return t?this.ma[t]:this.Pi},Ma:function(t,i){var e=this.ma[t];e&&((this.ma[i]=e).id=i,delete this.ma[t])},Ta:function(){this.view.hasEvent("onEditorChange")&&this.view.callEvent("onEditorChange",[this.id,this.view.getEditorValue(this.id)])},Va:function(){return this.P},Aa:function(t,i,e){i.config=this.Va(t);var s=i.render();i.$inline&&(s=this.ya(t)),i.node=s;var n=this.getItem(t),h=n[this.P.editValue||"value"];return R(h)&&(h=""),i.setValue(h,n),i.value=h,this.za(t,i),!1!==e&&this.showItem(t),i.$inline||this.Ba(t,s,!0),i.afterRender&&i.afterRender(),s},Ha:function(t){return this.getItemNode(t)},ya:function(t){var i=this.Ha(t);return i&&(i=i.getElementsByTagName("input")[0]||i),i},Ia:function(){return this.P.editor},za:function(t,i){i.id=t,this.ma[t]=this.Pi=i,this.Ai++},Ra:function(t){this.Pi==t&&(this.Pi=0),t.destroy&&t.destroy(),delete t.popup,delete t.node,delete this.ma[t.id],this.Ai--},focusEditor:function(){var t=this.getEditor.apply(this,arguments);t&&t.focus&&t.focus()},editCancel:function(){this.editStop(null,null,!0)},gi:function(t){if(t){var i=this.getEditor();if(i&&i.getPopup&&i.getPopup()==t.getTopParentView())return}this.editStop()},editStop:function(t){if(!this.Ea){this.Ea=1;var i=arguments[2],e=1;return t?e=this.Pa(this.ma[t],i):this.ja(function(t){e*=this.Pa(t,i)}),this.Ea=0,e}},at:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Wi}},Ba:function(t,i,e){if(i.style){var s=this.at(t,null,!0);return i.style.top=s.top+"px",i.style.left=s.left+"px",i.style.width=s.width-1+"px",i.style.height=s.height-1+"px",i.top=s.top,e&&s.parent.appendChild(i),s}},ja:function(t){for(var i in this.ma)t.call(this,this.ma[i])},Pa:function(t,i){if(t&&!ii.xt){var e={value:this.Na(t),old:t.value};if(this.callEvent("onBeforeEditStop",[e,t,i])){if(!i){var s=e.old;if("string"==typeof e.value&&(s+=""),s!=e.value||t.config.liveEdit){var n=this.$a(t,e.value,!0);this.updateItem(t.row||t.id,n)}}t.$inline?t.node=null:dt(t.node);var h=t.config.suggest;return h&&"string"==typeof h&&oi(h).hide(),this.Ra(t),this.Fa&&this.detachEvent(this.Fa),this.callEvent("onAfterEditStop",[e,t,i]),1}return 0}},validateEditor:function(t){var i=!0;if(this.P.rules){var e=this.getEditor(t),s=e.column||this.P.editValue||"value",
n=this.P.rules[s],h=this.P.rules.$all;if(n||h){var r=this.data.getItem(e.row||e.id),o=e.getValue(),a=e.getInputNode();n&&(i=n.call(this,o,r,s)),h&&(i=h.call(this,o,r,s)&&i),i?Mt(a,"webix_invalid"):yt(a,"webix_invalid"),y("onLiveValidation",[e,i,r,o])}}return i},getEditorValue:function(t){var i;if(i=0===arguments.length?this.Pi:this.getEditor(t))return i.getValue()},getEditState:function(){return this.Pi||!1},editNext:function(t,i){if(t=!1!==t,1==this.Ai||i){var e=this.La(this.Pi||i,function(t){return!!this.Ia(t)},t);if(this.editStop())return e&&(this.edit(e),this.Oa(e)),!1}},Oa:function(){},La:function(t,i,e){var s=this.getIndexById(t.id),n=this.data.order;if(e){for(var h=s+1;h<n.length;h++)if(i.call(this,n[h]))return n[h]}else for(var r=s-1;0<=r;r--)if(i.call(this,n[r]))return n[r];return null},Na:function(t){return t.getValue()},$a:function(t,i,e){var s=e?{}:this.getItem(t.id);return s[this.P.editValue||"value"]=i,s}},ke={$init:function(){this.$view.className+=" webix_flexlayout"},Wa:function(){},Ua:function(){},Ya:function(){},$getSize:function(){var t=0,i=0,e=this.P.gravity;this.ei=[];for(var s=0;s<this.ri.length;s++){var n=this.ri[s].$getSize(0,0);this.ei.push(n),t=Math.max(t,n[0]),i=Math.max(i,n[2])}return t+=this.qa.left+this.qa.right,i+=this.qa.top+this.qa.bottom,this.P.width&&(t=Math.max(t,this.P.width)),this.P.height&&(i=Math.max(i,this.P.height)),[t,1e5,i,1e5,e]},render:function(){this.resize()},Ga:function(){if(this.isVisible(this.P.id)){var t=this.$view.style,i=Math.round(this.Xa/2);t.paddingTop=this.qa.top-i+"px",t.paddingBottom=this.qa.bottom-i+"px",t.paddingLeft=this.qa.left-i+"px",t.paddingRight=this.qa.right-i+"px";for(var e=0;e<this.ri.length;e++)if(!this.ri[e].P.hidden){var s=this.ri[e].$view,n=this.ei[e],h=this.ri[e].P;s&&(s.style.minWidth=n[0]+"px",n[1]<1e5&&n[1]!=n[0]&&(s.style.maxWidth=n[1]+"px"),s.style.flexBasis=h.flexBasis||n[0]+"px",s.style.flexGrow=h.flexGrow||(n[1]!=n[0]?n[4]:0),s.style.height=n[3]!=n[2]?"auto":n[2]+"px",s.style.minHeight=n[2]+"px",n[3]<1e5&&n[3]!=n[2]&&(s.style.maxHeight=n[3]+"px"),s.style.margin=i+"px")}for(var r=[],o=0;o<this.ri.length;o++)if(!this.ri[o].P.hidden){var a=this.ri[o].$view;r[o]=[a.offsetWidth,a.offsetHeight]}for(var u=0;u<this.ri.length;u++)if(!this.ri[u].P.hidden){var c=this.ri[u];if(c.$view){c.P.flex=!0;var f=this.ei[u],l=f[2]==f[3]?f[2]:r[u][1];c.$setSize(r[u][0],l),c.P.flex=!1}}this.$height=this.we=this.$view.scrollHeight,this.$view.style.height=this.we+"px"}}},Ce={sum:function(t,i){i=i||this;for(var e=0,s=0;s<i.length;s++){var n=parseFloat(t(i[s]),10);isNaN(n)||(e+=n)}return e},min:function(t,i){i=i||this;for(var e=Infinity,s=0;s<i.length;s++){var n=parseFloat(t(i[s]),10);isNaN(n)||n<e&&(e=n)}return e===Infinity?0:1*e},max:function(t,i){i=i||this;for(var e=-Infinity,s=0;s<i.length;s++){var n=parseFloat(t(i[s]),10);isNaN(n)||e<n&&(e=n)}return e===-Infinity?0:1*e},count:function(t,i){for(var e=0,s=0;s<i.length;s++){var n=t(i[s]);null!=n&&e++}return e},any:function(t,i){return t(i[0])},string:function(t){return t.$name}},$e={$init:function(){var t=this;this.attachEvent("onClearAll",function(){return t.Vr=null}),this.attachEvent("onSyncApply",function(){return t.Vr=null})},ungroup:function(t){if(this.getBranchIndex){if(!this.Ja(t))return}else{if(!this.Vr)return;this.order=this.Vr,this.pull=this.Ka}this.callEvent("onStoreUpdated",[])},Ja:function(t){for(var i=this,e=t||0,s="0"==e?1:this.getItem(e).$level+1,n=!1,h=this.branch[e],r=[],o=0;o<h.length;o++){var a=h[o];if(this.pull[a].$group){n=!0;var u=this.branch[a];u&&(this.branch[a]=u.filter(function(t){if(!i.pull[t].$footer)return t;i.Za(t)})),r=r.concat(this.branch[a]||[]),this.Za(a)}else r.push(a)}return!!n&&(this.branch[e]=r,this.Qa(this.branch[e],e,s),void 0===t&&this.Ja(),!0)},Za:function(t){delete this.pull[t],delete this.branch[t]},Tr:function(t){this.blockEvent(),this.group(t),this.unblockEvent()},tu:function(i){if("function"==typeof i)return i;var t=function(t){return t[i]};return t.$name=i,t},group:function(e,t){var i;if("string"==typeof e?(i=e,e={by:this.tu(e),map:{}}):"function"==typeof e?e={by:e,
map:{}}:"string"==typeof e.by&&(i=e.by,e.by=this.tu(e.by)),e.map=e.map||{},i&&!e.map[i]&&(e.map[i]=[i]),e.missing=e.missing===undefined||e.missing,this.getBranchIndex)return this.iu(e,t);this.Vr||(this.Vr=this.order,this.Ka=this.pull);var s={},n=[],h=[],r=e.missing;this.each(function(t){var i=e.by(t);if(!i&&0!==i){if(!1===r)return;if(!0===r)return void h.push(t);i=r}s[i]||(n.push({id:i,value:i,$group:!0,$row:e.row}),s[i]=m()),s[i].push(t)});for(var o=0;o<n.length;o++){var a=n[o];this.eu(e.map,a,s[n[o].id]),this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[a.id,a.value,s[n[o].id]])}this.order=m(),this.pull={},this.su(n),this.su(h),this.callEvent("onStoreUpdated",[])},su:function(t){for(var i=0;i<t.length;i++){var e=this.id(t[i]);this.pull[e]&&(e=t[i].id=V()),this.pull[e]=t[i],this.order.push(e),this.Rr&&this.Rr(t[i])}},eu:function(t,i,e){for(var s in t){var n=t[s][1]||"any",h=this.tu(t[s][0]);"function"!=typeof n&&(Ce[n],n=Ce[n]),i[s]=n.call(this,h,e)}},iu:function(t,i){var e=0;i?e=this.getItem(i).$level:i=0;for(var s=[],n=[],h=[],r=this.branch[i],o={},a=0;a<r.length;a++){var u=this.getItem(r[a]),c=t.by(u);if(!c&&0!==c){if(!1===t.missing)continue;if(!0===t.missing){h.push(u.id);continue}c=t.missing}var f=o[c];if(!f){var l=V(),d=this.pull[l]={id:l,value:c,$group:!0,$row:t.row};this.Rr&&this.Rr(d),n.push(d),(f=o[c]=this.branch[l]=[]).nu=[],s.push(l)}f.push(u.id),f.nu.push(u)}this.branch[i]=s.concat(h);for(var v=0;v<n.length;v++){var _=n[v];if(this.eu(t.map,_,this.branch[n[v].id].nu),this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[_.id,_.value,this.branch[_.id].nu]),t.footer){var p="footer$"+_.id,b=this.pull[p]={id:p,$footer:!0,value:_.value,$level:e,$count:0,$parent:_.id,$row:t.footer.row};this.eu(t.footer,b,this.branch[n[v].id].nu),this.branch[_.id].push(b.id),this.callEvent("onGroupFooter",[b.id,b.value,this.branch[_.id].nu])}delete this.branch[_.id].nu}this.Qa(this.branch[i],i,e+1),this.callEvent("onStoreUpdated",[])},Qa:function(t,i,e){i&&(this.getItem(i).$count=t.length);for(var s=0;s<t.length;s++){var n=this.pull[t[s]];n.$level=e,n.$parent=i;var h=this.branch[n.id];h&&this.Qa(h,n.id,e+1)}}},De={$init:function(){H.extend(this.data,$e)},group:function(t,i){i||0===i||(this.$blockRender=!0,this.data.ungroup(),this.$blockRender=!1),this.data.group(t,i)},ungroup:function(t){this.data.ungroup(t)}},Ie={$init:function(){var t=this;this.$ready.push(function(){t.customRadio_setter&&!t.config.customRadio||Kt(t.$view,"keydown",t.hu,{bind:t})})},wi:function(){if(!Mi.canFocus(this))return!1;var t=this.ru();if(t)for(var i=0;i<t.length;i++)if("0"==t[i].getAttribute("tabindex"))return t[i].focus()},ou:function(){var t=this.ru();if(t)for(var i=0;i<t.length;i++)if("0"==t[i].getAttribute("tabindex"))return t[i].blur()},hu:function(t){var i=t.which||t.keyCode;if(34<i&&i<41){var e=this.ru(),s=!1;if(!e.length)return;gt(t);var n=37===i||38===i||35===i?-1:1;if(35===i)s=e.length-1;else if(36===i)s=0;else for(var h=0;h<e.length;h++)if("0"==e[h].getAttribute("tabindex")){s=h+n;break}if(!1!==s){var r=s;do{if(r>=e.length&&(r=0),r<0&&(r=e.length-1),e[r].getAttribute("webix_disabled"))r+=n;else{var o=e[r].getAttribute("button_id");this.setValue(o),e[r].focus(),r="success"}}while("success"!==r&&r!==s)}}},Fe:function(t,i){for(var e,s=i.target;s&&!s.webix_tooltip;){if(e=s.getAttribute("webix_t_id"))return this.getOption(e);s=s.parentNode}return null},optionIndex:function(t){for(var i=this.P.options,e=0;e<i.length;e++)if(i[e].id==t)return e;return-1},getOption:function(t){var i=this.optionIndex(t);return-1!==i?this.P.options[i]:null},addOption:function(t,i,e,s){var n=t;"object"!=M(t)?n={id:t,value:i=i||t}:(t=n.id,s=e,e=i),-1===this.optionIndex(t)&&(x.insertAt.call(this.P.options,n,s),this.refresh(),this.callEvent("onOptionAdd",[t,n])),e&&this.setValue(t)},removeOption:function(t){var i=this.optionIndex(t);if(-1!==i){var e=this.P.options;x.removeAt.call(e,i),this.refresh(),this.P.value==t&&this.au(e,i),this.callEvent("onOptionRemove",[t,this.P.value])}},au:function(t,i){var e=t.length;if(e&&!this.customRadio_setter){for(
var s=i=Math.min(i,e-1);s<e;s++)if(!t[s].hidden)return this.setValue(t[s].id);for(var n=i;0<=n;n--)if(!t[n].hidden)return this.setValue(t[n].id)}this.setValue("")},uu:function(t){var i=this.P.options;if(i.length){for(var e=0;e<i.length;e++)if(!i[e].hidden&&!i[e].disabled)return i[e].id;if(t)return i[0].id}return""},cu:function(t){for(var i=[],e=0;e<t.length;e++)t[e].hidden||i.push(t[e]);return i},fu:function(t,i,e){var s=this.P.options,n=this.optionIndex(t);s[n]&&e!=!!s[n][i]&&((s[n][i]=e)&&"hidden"===i&&this.P.value==t&&this.au(s,n),this.refresh())},hideOption:function(t){this.fu(t,"hidden",!0)},showOption:function(t){this.fu(t,"hidden",!1)},disableOption:function(t){this.fu(t,"disabled",!0)},enableOption:function(t){this.fu(t,"disabled",!1)}},Ae=H.proto({$init:function(t){this.Qo="map_"+V(),this.lu=t,this.du=[],this.vu=[]},addRect:function(t,i,e){this._u(t,"RECT",i,e)},addPoly:function(t,i,e){this._u(t,"POLY",i,e)},_u:function(t,i,e,s){var n="";4==arguments.length&&(n="userdata='"+s+"'"),this.du.push("<area "+this.lu+"='"+t+"' shape='"+i+"' coords='"+e.join()+"' "+n+"></area>"),this.vu.push({index:s,points:e})},addSector:function(t,i,e,s,n,h,r,o){var a=[];a.push(s),a.push(Math.floor(n*r));for(var u=i;u<e;u+=Math.PI/18)a.push(Math.floor(s+h*Math.cos(u))),a.push(Math.floor((n+h*Math.sin(u))*r));return a.push(Math.floor(s+h*Math.cos(e))),a.push(Math.floor((n+h*Math.sin(e))*r)),a.push(s),a.push(Math.floor(n*r)),this.addPoly(t,a,o)},hide:function(t,i,e){if(t.querySelectorAll)for(var s=t.querySelectorAll('area[userdata="'+i+'"]'),n=0;n<s.length;n++){var h=s[n];e?h.getAttribute("coords")&&(h.coordsdis=h.getAttribute("coords"),h.setAttribute("coords",""),h.coords=""):e||h.coordsdis&&(h.setAttribute("coords",h.coordsdis),h.coords=h.coordsdis,h.coordsdis=""),s[n].style.display=e?"none":""}},render:function(t){var i=ft("DIV");i.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;",t.appendChild(i);var e=q.isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";i.innerHTML="<map id='"+this.Qo+"' name='"+this.Qo+"'>"+this.du.join("\n")+"</map><img "+e+" class='webix_map_img' usemap='#"+this.Qo+"'>",t.Ni=i,this.du=[]}}),Fe={$init:function(){this._e={},this.pe={},this.getTopParentView=this.pu=S(function(){return this},this),this.bu(),this.$ready.push(this.mu)},$$:function(t){return this._e[t]},innerId:function(t){return this.pe[t]},bu:function(){this.ve=ii.lt,ii.lt=this},mu:function(){for(var t in this._e){var i=this._e[t];this.callEvent&&i.mapEvent&&!i.l.onitemclick&&i.mapEvent({onitemclick:this}),i.getTopParentView=this.pu}ii.lt=this.ve,this.ve=0},ji:function(t){delete this._e[t]},ui:function(){this.bu();var t=si.apply(this,arguments);return this.mu(),t}},Te={$init:function(){this.getSelectedId&&this.attachEvent("onAfterRender",this.gu),this.moveSelection&&this.attachEvent("onTabFocus",this.wu)},wu:function(){if(this.getSelectedId){var t=this.getSelectedId(!0);t.length&&this.getItemNode(t[0])||this.moveSelection("down")}},gu:function(){var t=this.getSelectedId(!0);if(!t.length||!this.getItemNode(t[0])){var i=this.tt.querySelector("["+this.Qo+"]");i&&i.setAttribute("tabindex","0")}},xu:function(n){return function(t,i){var e=i.target;if(!e.getAttribute("webixignore")){var s=e.tagName;if("INPUT"==s||"TEXTAREA"==s||"SELECT"==s)return!0}if(t&&t.moveSelection&&t.config.navigation&&!t.Ai)return gt(i),t.moveSelection(n,{shift:i.shiftKey,ctrl:i.ctrlKey})}},moveSelection:function(t,i,e){var s=this.P;if(!s.disabled){var n=this.getSelectedId(!0),h=this.count&&("x"==s.layout||1<s.xCount);if(("right"==t||"left"==t)&&this.yu){var r=oi(this.yu);return r.Mu(!0),void("x"===r.config.layout?r.moveSelection(t):Mi.setFocus(r))}if(!n.length&&this.count()){if("down"==t||"right"==t&&h)t="top";else{if(!("up"==t||"left"==t&&h))return;t="bottom"}n=[this.getFirstId()]}if(1==n.length){var o=n=n[0];if("left"==t&&this.close)return this.close(n);if("right"==t&&this.open)return this.open(n);if("top"==t)n=this.getFirstId();else if("bottom"==t)n=this.getLastId();else if(
"up"==t||"left"==t||"pgup"==t){var a=this.getIndexById(n),u="pgup"==t?10:1;n=this.getIdByIndex(Math.max(0,a-u))}else{if("down"!=t&&"right"!=t&&"pgdown"!=t)return;var c=this.getIndexById(n),f="pgdown"==t?10:1;n=this.getIdByIndex(Math.min(this.count()-1,c+f))}var l="up"==t||"left"==t||"pgdown"==t||"bottom"==t?-1:1;if(this.Su&&(n=this.Su(n,o,l)),this.showItem(n),this.select(n),this.getSubMenu&&this.getSubMenu(n)&&this.ku(n,this.getItemNode(n)),!this.config.clipboard&&!1!==e){var d=this.getItemNode(n);d&&d.focus()}}return!1}},navigation_setter:function(t){return t&&!Mi.Cu&&(Mi.Cu=!0,Mi.addHotKey("up",this.xu("up")),Mi.addHotKey("down",this.xu("down")),Mi.addHotKey("right",this.xu("right")),Mi.addHotKey("left",this.xu("left")),Mi.addHotKey("shift+up",this.xu("up")),Mi.addHotKey("shift+down",this.xu("down")),Mi.addHotKey("shift+right",this.xu("right")),Mi.addHotKey("shift+left",this.xu("left")),Mi.addHotKey("ctrl+shift+up",this.xu("up")),Mi.addHotKey("ctrl+shift+down",this.xu("down")),Mi.addHotKey("ctrl+shift+right",this.xu("right")),Mi.addHotKey("ctrl+shift+left",this.xu("left")),Mi.addHotKey("pageup",this.xu("pgup")),Mi.addHotKey("pagedown",this.xu("pgdown")),Mi.addHotKey("home",this.xu("top")),Mi.addHotKey("end",this.xu("bottom"))),t}},Ve={$init:function(){this.$ready.push(this.$u),this.attachEvent("onStructureUpdate",this.$u),this.attachEvent("onStructureLoad",function(){this.Du.length||this.$u()})},$u:function(){var e=this.Du=[],t=this.P;t.columns&&this.Iu(t.columns),this.P.map&&this.Au(t.map),e.length&&(this.data.Rr=function(t){for(var i=0;i<e.length;i++)e[i](t)})},Au:function(t){for(var i in t)this.Du.push(this.Fu(i,t[i]))},Fu:function(e,t,i){var s,n=t.replace(/^(\s|)\((date|number)\)/,"");return s=""===n?function(t){return t[e]}:(-1===n.indexOf("#")&&-1===n.indexOf("{")&&(n="#"+n+"#"),Yt(n)),0===t.indexOf("(date)")?(i&&!i.format&&(i.format=I.dateFormatStr),function(t){var i=(s(t)||"").toString();t[e]=I.parseFormatDate(i)}):0===t.indexOf("(number)")?function(t){t[e]=1*s(t)}:function(t){t[e]=s(t)||""}},Iu:function(t){for(var i=0;i<t.length;i++){var e=t[i].map,s=t[i].id;s||(s=t[i].id="i"+V(),t[i].header||(t[i].header="")),e&&this.Du.push(this.Fu(s,e,t[i])),this.Tu(t[i])}},Vu:function(t){if("string"==typeof t){var i=oi(t);i?t=i:(t=new(d("DataCollection"))({url:t}),this.Bt.push(t)),t.getBody&&(t=i.getBody())}else if("function"==typeof t||t.$proxy)t=new(d("DataCollection"))({url:t}),this.Bt.push(t);else if(!t.loadNext){var e=$(t),s=[];if(e&&"object"!==M(t[0])){for(var n=0;n<t.length;n++)s.push({id:t[n],value:t[n]});t=s}else if(!e){for(var h in t)s.push({id:h,value:t[h]});t=s}t=new(d("DataCollection"))({data:t}),this.Bt.push(t)}return t},Tu:function(t){var i=t.options||t.collection;i&&(i=this.Vu(i),this.zu(i,t)),t.header&&(this.Bu(t.header),this.Bu(t.footer))},Bu:function(n){var h=this;n=n||[];for(var t=function(t){var i=n[t];if(i&&i.options){var e=i.options;e.loadNext||(e=i.options=h.Vu(e));var s=e.data.attachEvent("onStoreUpdated",function(){h.refreshFilter&&h.refreshFilter(i.columnId)});h.attachEvent("onDestruct",function(){e.$destructed||e.data.detachEvent(s)})}},i=0;i<n.length;i++)t(i)},zu:function(t,i){var e=this;if(i){delete i.options,i.collection=t,i.template=i.template||this.Hu(t,i.id,i.optionslist);var s=t.data.attachEvent("onStoreUpdated",function(){e.refresh(),e.refreshFilter&&e.refreshFilter(i.id)});this.attachEvent("onDestruct",function(){t.$destructed||t.data.detachEvent(s)})}},Hu:function(h,r,t){if(r=this.getColumnConfig?r:"value",t){var o="string"==typeof t?t:",";return function(t){var i=t[r];if(!i)return"";for(var e=i.toString().split(o),s=0;s<e.length;s++){var n=h.data.pull[e[s]];e[s]=n&&n.value||""}return e.join(", ")}}return function(t){var i=h.data.pull[t[r]];return i&&(i.value||0===i.value)?i.value:""}}},ze={$init:function(t){t=t||{},this.Ru=0,this.Eu=300,this.Pu=null,this.ju(t.onClick,"on_click"),this.ju(t.onContext,"on_context"),this.ju(t.onDblClick,"on_dblclick"),this.ju(t.onMouseMove,"on_mouse_move"),this.on_click&&(Kt(this.Wi,"click",this.Nu,{bind:this}),q.isIE8&&this.on_dblclick&&Kt(this.Wi,
"dblclick",this.Lu,{bind:this})),this.on_context&&Kt(this.Wi,"contextmenu",this.Ou,{bind:this}),this.on_mouse_move&&this.Wu()},Wu:function(){this.Uu||(this.on_mouse_move=this.on_mouse_move||{},Kt(this.Wi,"mousemove",this.Yu,{bind:this}),Kt(this.Wi,q.isIE?"mouseleave":"mouseout",this.Yu,{bind:this}),this.Uu=1,this.attachEvent("onDestruct",function(){this.qu&&window.clearTimeout(this.qu)}))},ju:function(t,i){if(t){var e=this[i],s=e?H.extend({},e):{};this[i]=H.extend(s,t)}},Nu:function(t){if(!this.isEnabled())return!1;if(Mi.Et(this),this.on_dblclick){var i=(new Date).valueOf();if(i-this.Ru<=this.Eu&&this.locate)if(""+this.locate(t)==""+this.Pu)return this.Ru=0,this.Lu(t);this.Ru=i}return this.Gu(t,this.on_click,"ItemClick")},Lu:function(t){return this.Gu(t,this.on_dblclick,"ItemDblClick")},Ou:function(t){this.Gu(t,this.on_context,"BeforeContextMenu","AfterContextMenu")},Yu:function(t){this.$destructed||(document.createEventObject&&(t=document.createEventObject(event)),this.qu&&window.clearTimeout(this.qu),this.callEvent("onMouseMoving",[t]),this.qu=k(function(t){"mousemove"==t.type?this.Xu(t):this.Ju(t)},this,[t],this.P.mouseEventDelay||500))},Xu:function(t){this.Gu(t,this.on_mouse_move,"MouseMove")||this.Ju(t)},Ju:function(t){this.callEvent("onMouseOut",[t||event])},Gu:function(t,i,e,s){if(!(t=t||event).processed&&this.Vt){t.processed=!0;var n=t.target;if(q.isIE8){var h=this.P.id,r=n.w_view;if(r){if(r!==h)return}else n.w_view=h}for(var o="",a=null,u=!1;n&&n.parentNode&&this.Vt&&n!=this.Vt.parentNode;){if(!u&&n.getAttribute&&(a=n.getAttribute(this.Qo))){if(n.getAttribute("webix_disabled"))return void(this.Pu=null);if(this.Pu=a,this.callEvent){if(!this.callEvent("on"+e,[a,t,n]))return;s&&this.callEvent("on"+s,[a,t,n])}u=!0}if(o=Ct(n)){o=o.toString().split(" ");for(var c=0;c<o.length;c++){if(i[o[c]])if(!1===v(i[o[c]],this.$scope).call(this,t,a||_t(t,this.Qo),n))return u}}n=n.parentNode}return u}}},Be={$init:function(){this.$ready.push(function(){this.attachEvent("onKeyPress",this.ke)})},Ku:function(t,i){if(37===t||39===t){gt(i),this.Zu(37===t?-1:1);var e=this.Qu.querySelector("[tabindex='0']");e&&e.focus()}},tc:function(){dt(this.Qu),this.Qu=ft("DIV",{"class":"webix_nav_panel webix_nav_panel_"+this.P.navigation.type,role:"tablist"},""),this.Vt.appendChild(this.Qu),this.ic(),this.ec(),this.sc()},sc:function(){var i=[];this.Qu&&(i[0]=Zt(this.Qu,"click",S(function(t){for(var i=t.target,e=!1;i!=this.Qu&&!e;){var s=i.getAttribute(this.nc);s&&(e=!0,this.hc(s)),i=i.parentNode}},this))),this.rc&&(i[1]=Zt(this.rc,"click",S(function(){this.Zu(-1)},this))),this.oc&&(i[1]=Zt(this.oc,"click",S(function(){this.Zu(1)},this))),this.attachEvent("onDestruct",function(){for(var t=0;t<i.length;t++)this.detachEvent(i[t]);i=null})},Zu:function(t){if(this.ri){var i=this.ac+t;(i>=this.ri.length||i<0)&&(i=i<0?this.ri.length-1:0),this.setActiveIndex(i)}},hc:function(t){this.ri&&oi(t).show()},ic:function(){var t,i;if((i=this.P.navigation).items){this.nc=i.linkAttr||"bind_id",this.Qu?this.uc():this.tc();var e=this.ri?this.ri:this.data.order;if(1<e.length)for(var s=0;s<e.length;s++){t=ft("DIV",{"class":"webix_nav_item webix_nav_"+(s==this.ac?"active":"inactive"),role:"tab",tabindex:s==this.ac?"0":"-1"});var n=this.ri?this.ri[s].P.id:e[s];n&&t.setAttribute(this.nc,n),this.Qu.appendChild(t)}}},uc:function(){if(this.Qu)for(var t=this.Qu.childNodes,i=t.length-1;0<=i;i--)dt(t[i])},ec:function(){var t=this.P.navigation;t.buttons&&(this.rc&&dt(this.rc),this.rc&&dt(this.oc),this.rc=ft("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_prev "},'<div role="button" tabindex="0" aria-label="'+I.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.Vt.appendChild(this.rc),this.oc=ft("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_next "},'<div role="button" tabindex="0" aria-label="'+I.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.Vt.appendChild(this.oc))}},He={showOverlay:function(t){this.cc?this.cc.innerHTML=t:(this.cc=ft("DIV",{"class":"webix_overlay"},t||""),vt(this.cc,this.Vt.firstChild,this.Vt),
this.Vt.style.position="relative")},hideOverlay:function(){this.cc&&(dt(this.cc),this.cc=null)}},Re={pager_setter:function(s){if("string"==typeof s){var t=oi(s);if(!t)return this.$blockRender=!0,k(function(){var t=oi(s);this.P.pager=this.pager_setter(t);var i=t.P;i.count=this.data.fc(i.level),t.refresh(),this.$blockRender=!1,this.render()},this),null;s=t}return this.attachEvent("onBeforeRender",function n(t){if(this.config.topSplit&&(this.config.topSplit=0),s.config.autosize&&this.getVisibleCount){var i=this.getVisibleCount();isNaN(i)?(s.config.size=1,k(n,this,[!0])):i!=s.config.size&&(s.config.size=i,s.refresh(),!0===t&&this.refresh())}var e=this.P.pager;return-1!=e.page&&(this.data.$min=this.lc(0,e.page*e.size),this.data.$max=this.lc(this.data.$min,e.size),this.data.$pagesize=this.data.$max-this.data.$min,!0)}),s.$view||(s.view="pager",s=si(s)),((this.dc=s).$master=this).data.attachEvent("onStoreUpdated",function(){var t=s.P;t.count=this.fc(t.level),s.refresh()}),this.data.fc=this.fc,s.P},fc:function(i){if(i&&0!==i){var e=0;return this.each(function(t){t.$level==i&&e++}),e}return this.count()},lc:function(t,i){var e=this.P.pager;if(e.level&&0!==e.level){var s=t,n=this.data.order.length;if(i)for(;s<n;){if(this.data.order[s]&&this.data.getItem(this.data.order[s]).$level==e.level){if(0===i)break;i--}s++}return s}return t+i},setPage:function(t){this.dc&&this.dc.select(t)},getPage:function(){return this.dc.P.page},getPager:function(){return this.dc}},Ee={$init:function(){var t=this;R(this.vc)&&this.attachEvent&&(this.attachEvent("onBeforeLoad",function(){return t.showProgress()}),this.attachEvent("onAfterLoad",function(){return t.hideProgress()}),this.vc=null)},showProgress:function(t){var i;if(!this.vc){var e="icon"==(t=H.extend({position:0,delay:2e3,type:"icon",icon:"wxi-sync",hide:!1},t||{},!0)).type?t.icon+" webix_spin":"";if(this.vc=ft("DIV",{"class":"webix_progress_"+t.type,role:"progressbar","aria-valuemin":"0","aria-valuemax":"100",tabindex:"0"},"<div class='webix_progress_state "+e+"'></div>"),this.setPosition||(this.Vt.style.position="relative"),vt(this.vc,this.Vt.firstChild,this.Vt),this.Vt.setAttribute("aria-busy","true"),(!Yi.$active||"native"==this.jo)&&this.getScrollState){var s=this.getScrollState();this.Vt.scrollWidth!=this.$width&&(this.vc.style.left=s.x+"px"),this.Vt.scrollHeight!=this.$height&&("bottom"!=t.type?this.vc.style.top=s.y+"px":this.vc.style.top=s.y+this.$height-this.vc.offsetHeight+"px")}this._c="icon"!=t.type}if(t){if(this._c){var n=t.position||1;if(this.vc.style[q.transitionDuration]===undefined&&t.delay){var h=0,r=0,o=n/t.delay*30,a=this;this.pc&&(window.clearInterval(this.pc),r=this.vc.firstChild.offsetWidth/this.vc.offsetWidth*100),this.pc=window.setInterval(function(){30*h==t.delay?window.clearInterval(a.pc):(a.vc&&a.vc.firstChild&&(a.vc.firstChild.style.width=r+h*o*n*100+"%"),h++)},30)}else t.delay&&(i=this.Vt.firstChild.offsetWidth,this.vc.firstChild.style[q.transitionDuration]=t.delay+"ms"),this.vc.firstChild.style.width=100*n+"%"}return this.bc&&clearTimeout(this.bc),t.hide&&(this.bc=k(this.hideProgress,this,[1],t.delay)),i}},hideProgress:function(t){this.vc&&(t||!this._c?(this.pc&&window.clearInterval(this.pc),dt(this.vc),this.vc=null,this.Vt.removeAttribute("aria-busy")):this.showProgress({position:1.1,delay:300,hide:!0}))}},Pe={$init:function(){this.data,this.Oi=document.createElement("DIV"),this.data.attachEvent("onIdChange",S(this.Er,this)),this.attachEvent("onItemClick",this.mc),this.types||(this.types={"default":this.type},this.type.name="default"),this.type=l(this.type)},customize:function(t){ti(this,t)},item_setter:function(t){return this.type_setter(t)},type_setter:function(t){return this.types[t]?(this.type=l(this.types[t]),this.type.css&&(this.Wi.className+=" "+this.type.css)):this.customize(t),this.type.on_click&&H.extend(this.on_click,this.type.on_click),t},template_setter:function(t){this.type.template=Yt(t)},Q:function(t){var i=this.data.Dr[t.id];return!t.$template||this.type["template"+t.$template],t.$template,this.callEvent("onItemRender",[t]),
this.type.templateStart(t,this.type,i)+(t.$template?this.type["template"+t.$template]:this.type.template)(t,this.type,i)+this.type.templateEnd(t,this.type,i)},gc:function(t){return this.Oi.innerHTML=this.Q(t),this.Oi.firstChild},Er:function(t,i){var e=this.getItemNode(t);e&&(e.setAttribute(this.Qo,i),this.Ni[i]=this.Ni[t],delete this.Ni[t])},mc:function(){if(this.P.click){var t=v(this.P.click,this.$scope);t&&t.call&&t.apply(this,arguments)}},getItemNode:function(t){if(this.Ni)return this.Ni[t];this.Ni={};for(var i=this.tt.childNodes,e=0;e<i.length;e++){var s=i[e].getAttribute(this.Qo);s&&(this.Ni[s]=i[e])}return this.getItemNode(t)},locate:function(t){return _t(t,this.Qo)},showItem:function(t){var i=this.getItemNode(t);if(i&&this.scrollTo){var e=i.offsetLeft,s=e+i.offsetWidth,n=i.offsetTop,h=n+i.offsetHeight,r=this.getScrollState(),o=r.x;(e<o||o+this.me<s)&&(o=e);var a=r.y;(n<a||a+this.we<h)&&(a=n),this.scrollTo(o,a),this.wc&&this.wc(t)}},render:function(t,i,e){if(this.isVisible(this.P.id)&&!this.$blockRender)if(t){var s=this.getItemNode(t);switch(e){case"paint":case"update":if(!s)return;vt(this.Ni[t]=this.gc(i),s),dt(s);break;case"delete":if(!s)return;dt(s),delete this.Ni[t];break;case"add":vt(this.Ni[t]=this.gc(i),this.getItemNode(this.data.getNextId(t)),this.tt);break;case"move":vt(this.getItemNode(t),this.getItemNode(this.data.getNextId(t)),this.tt)}}else this.callEvent("onBeforeRender",[this.data])&&((this.xc||this.tt).innerHTML=this.data.getRange().map(this.Q,this).join(""),this.Ni=null,this.callEvent("onAfterRender",[]))}},je={$init:function(t){if(t&&!t.scroll&&this.yc)return this.tt=this.tt||this.Wi;(this.tt||this.Wi).appendChild(ft("DIV",{"class":"webix_scroll_cont"},"")),this.tt=(this.tt||this.Wi).firstChild,!this.callEvent||q.touch&&"native"!=this.jo||Kt(this.Vt,"scroll",function(){k(function(){this.callEvent("onAfterScroll",[])},this)},{bind:this})},jo:"native",scroll_setter:function(t){if(!t)return!1;var i="auto"===t,e="x"==t?"x":"xy"==t?"xy":i?"xy":"y";if(q.$customScroll)re.enable(this,e);else{var s=this.tt.parentNode.style;i?s.overflowX=s.overflowY="auto":(-1!=e.indexOf("x")&&(this.xe=!0,s.overflowX="scroll"),-1!=e.indexOf("y")&&(this.ge=!0,s.overflowY="scroll"))}return e},Mc:function(t,i){if(!!this.P.scroll!=!!t){if(!q.$customScroll)this.tt.parentNode.style["x"===i?"overflowX":"overflowY"]=t?"auto":"hidden";"x"===i?this.xe=t:this.ge=t,this.P.scroll=!!t&&i}},getScrollState:function(){return{x:this.tt.parentNode.scrollLeft,y:this.tt.parentNode.scrollTop}},scrollTo:function(t,i){this.tt.parentNode.scrollLeft=t,this.tt.parentNode.scrollTop=i}},Ne={$init:function(){this.th=m(),this.data,this.data.attachEvent("onStoreUpdated",S(this.Sc,this)),this.data.attachEvent("onStoreLoad",S(this.kc,this)),this.data.attachEvent("onAfterFilter",S(this.Cc,this)),this.data.attachEvent("onSyncApply",S(this.Dc,this)),this.data.attachEvent("onIdChange",S(this.Ic,this)),this.$ready.push(this.Ac)},Ac:function(){("multiselect"==this.P.select||this.P.multiselect||"area"==this.P.select)&&Kt(this.$view,"mousedown",function(t){(t||window.event).shiftKey&&yt(ii.Mt=this,"webix_noselect",1)})},Ic:function(t,i){for(var e=this.th.length-1;0<=e;e--)this.th[e]==t&&(this.th[e]=i)},Cc:function(){for(var t=this.th.length-1;0<=t;t--)if(this.data.getIndexById(this.th[t])<0){var i=this.th[t];this.removeCss(i,"webix_selected",!0),this.th.splice(t,1),this.callEvent("onSelectChange",[i])}},Sc:function(t,i,e){"delete"==e?this.loadBranch?this.Dc():this.th.remove(t):t||this.data.count()||this.data.Ir||this.data.Wr||(this.th=m())},kc:function(){this.P.select&&this.data.each(function(t){t&&t.$selected&&this.select(t.id)},this)},Dc:function(){for(var t=this.th.length-1;0<=t;t--)this.exists(this.th[t])||this.th.splice(t,1)},Fc:function(t,i,e,s){var n=i?"onBeforeSelect":"onBeforeUnSelect";if(!this.callEvent(n,[t,i]))return!1;s&&(this.Tc=!0,this.unselectAll(),this.Tc=!1),i?this.addCss(t,"webix_selected",!0):this.removeCss(t,"webix_selected",!0),e?e.push(t):(i?this.th.push(t):this.th.remove(t),this.Vc(t));var h=i?"onAfterSelect":"onAfterUnSelect"
;return this.callEvent(h,[t]),!0},select:function(t,i){var e=arguments[2],s=arguments[3];if(!t)return this.selectAll();if($(t))for(var n=0;n<t.length;n++)this.select(t[n],n?1:i,e,s);else{if(this.data.exists(t),s&&this.th.length)return this.selectAll(this.th[this.th.length-1],t);var h=!1;e||i||1==this.th.length&&this.th[0]==t||(h=!0),h||!this.isSelected(t)?this.Fc(t,!0,null,h):e&&this.unselect(t)}},unselect:function(t){if(!t)return this.unselectAll();this.isSelected(t)&&this.Fc(t,!1)},selectAll:function(t,i){var e=[];(t||i?this.data.getRange(t||null,i||null):this.data.getRange()).each(function(t){this.data.getMark(t.id,"webix_selected")||(this.th.push(t.id),this.Fc(t.id,!0,e))},this),this.Vc(e)},unselectAll:function(){var i=[];this.th.each(function(t){this.Fc(t,!1,i)},this),this.th=m(),this.Vc(i)},isSelected:function(t){return-1!=this.th.find(t)},getSelectedId:function(t){switch(this.th.length){case 0:return t?[]:"";case 1:return t?[this.th[0]]:this.th[0];default:return[].concat(this.th)}},getSelectedItem:function(t){var i=this.getSelectedId(!0);if(1<i.length||t){for(var e=i.length-1;0<=e;e--)i[e]=this.getItem(i[e]);return i}if(i.length)return this.getItem(i[0])},zc:function(t){return 100<t.length||t.length>this.data.count/2},Vc:function(t){if("object"!=M(t)&&(t=[t]),t.length){if(this.zc(t))this.data.refresh();else for(var i=0;i<t.length;i++)this.render(t[i],this.data.getItem(t[i]),"update");this.Tc||this.callEvent("onSelectChange",[t])}}};pi(function(){Zt(document.body,"mouseup",function(){ii.Mt&&(Mt(ii.Mt,"webix_noselect"),ii.Mt=null)})});var Le={Bc:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],toHex:function(t,i){t=parseInt(t,10);for(var e="";0<t;)e=this.Bc[t%16]+e,t=Math.floor(t/16);for(;e.length<i;)e="0"+e;return e},rgbToHex:function(t){var i=[];return"string"==typeof t?t.replace(/[\d+.]+/g,function(t){i.push(parseFloat(t))}):$(t)&&(i=t),0===i[3]?"":i.slice(0,3).map(function(t){return Le.toHex(Math.floor(t),2)}).join("")},hexToDec:function(t){return parseInt(t,16)},toRgb:function(t){var i,e,s,n;return s="string"!=typeof t?(i=t[0],e=t[1],t[2]):-1!=t.indexOf("rgb")?(i=(n=t.substr(t.indexOf("(")+1,t.lastIndexOf(")")-t.indexOf("(")-1).split(","))[0],e=n[1],n[2]):("#"==t.substr(0,1)&&(t=t.substr(1)),i=this.hexToDec(t.substr(0,2)),e=this.hexToDec(t.substr(2,2)),this.hexToDec(t.substr(4,2))),((i=parseInt(i,10)||0)<0||255<i)&&(i=0),((e=parseInt(e,10)||0)<0||255<e)&&(e=0),((s=parseInt(s,10)||0)<0||255<s)&&(s=0),[i,e,s]},hsvToRgb:function(t,i,e){var s,n,h,r,o,a,u,c;switch(h=e*(1-i),r=e*(1-(n=t/60-(s=Math.floor(t/60)%6))*i),o=e*(1-(1-n)*i),c=u=a=0,s){case 0:a=e,u=o,c=h;break;case 1:a=r,u=e,c=h;break;case 2:a=h,u=e,c=o;break;case 3:a=h,u=r,c=e;break;case 4:a=o,u=h,c=e;break;case 5:a=e,u=h,c=r}return[a=Math.floor(255*a),u=Math.floor(255*u),c=Math.floor(255*c)]},rgbToHsv:function(t,i,e){var s,n,h,r,o,a,u;return s=t/255,n=i/255,h=e/255,r=Math.min(s,n,h),a=0,(u=o=Math.max(s,n,h))==r?a=0:o==s&&h<=n?a=60*(n-h)/(o-r)+0:o==s&&n<h?a=60*(n-h)/(o-r)+360:o==n?a=60*(h-s)/(o-r)+120:o==h&&(a=60*(s-n)/(o-r)+240),[a,0===o?0:1-r/o,u]}};function Oe(t){var i=" ";if(t)for(var e in t)i+=e+'="'+t[e]+'" ';return i}var We={draw:function(t,i,e,s){return"<svg "+Oe({xmlns:"http://www.w3.org/2000/svg",version:"1.1",height:"100%",width:"100%",viewBox:"0 0 "+i+" "+e,"class":s||""})+">"+t+"</svg>"},styleMap:{lineColor:"stroke",color:"fill"},group:function(t){return"<g>"+t+"</g>"}};We.Hc={M:function(t){return" M "+t.x+" "+t.y},L:function(t){return" L "+t.x+" "+t.y},C:function(t,i,e){return" C "+t.x+" "+t.y+" "+i.x+" "+i.y+" "+e.x+" "+e.y},A:function(t,i,e,s){var n=t.x+Math.cos(s)*i,h=t.y+Math.sin(s)*i;return" A "+i+" "+i+" 0 "+(s-e>=Math.PI?1:0)+" 1 "+n+" "+h}},We.definePath=function(t,i){for(var e="",s=0;s<t.length;s++){t[s][0]&&t[s][0];var n=t[s][0].toUpperCase();this.Hc[n],e+=this.Hc[n].apply(this,t[s].slice(1))}return i&&(e+=" Z"),e},We.Rc=function(t){for(var i=[],e=0;e<t.length;e++)i.push([e?"L":"M",t[e]]);return i},We.setOpacity=function(t,i){var e=Le.toRgb(t);return e.push(i),"rgba("+e.join(",")+")"},We.Ec=function(t){for(var i=[],
e=0;e<t.length;e++){var s=t[e];e||i.push(["M",s[0]]),i.push(["C",s[1],s[2],s[3]])}return i},We.getPath=function(t,i,e){return'<path class="'+i+'" vector-effect="non-scaling-stroke" d="'+t+'" '+(e=Oe(e))+"/>"},We.getSector=function(t,i,e,s,n,h){h=Oe(h);var r=[["M",t],["L",{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}],["A",t,i,e,s],["L",t]];return'<path class="'+n+'" vector-effect="non-scaling-stroke" d="'+We.definePath(r,!0)+'" '+h+"/>"},We.getCurve=function(t,i,e){return e=Oe(e),'<path fill="none" class="'+i+'" vector-effect="non-scaling-stroke" d="'+this.definePath(this.Ec(t))+'" '+e+"/>"},We.getLine=function(t,i,e,s){return this.getPath(this.definePath(this.Rc([t,i]),!0),e,s)},We.getCircle=function(t,i,e,s){return s=Oe(s),'<circle class="'+e+'" cx="'+t.x+'" cy="'+t.y+'" r="'+i+'" '+s+"/>"},We.getRect=function(t,i,e,s,n,h){return'<rect class="'+n+'" rx="0" ry="0" x="'+t+'" y="'+i+'" width="'+e+'" height="'+s+'" '+(h=Oe(h))+"/>"};var Ue={paddingX:6,paddingY:6,radius:2,minHeight:4,eventRadius:8};function Ye(t){this.config=H.extend(_(Ue),t||{},!0)}Ye.prototype.draw=function(t,i,e){var s=this.getPoints(t,i,e),n=this.config,h=We,r=n.color?this.Pc(h,n.color):null,o=h.definePath(this.jc(s)),a=h.group(h.getPath(o,"webix_sparklines_line"+(r?" "+r.line:"")));a+=this.Nc(h,s,n.radius,"webix_sparklines_item"+(r?" "+r.item:""));var u=Math.min(t.length?(i-2*(n.paddingX||0))/t.length:0,n.eventRadius);return a+=this.Lc(h,s,u),h.draw(a,i,e,"webix_sparklines_line_chart"+(n.css?" "+n.css:""))},Ye.prototype.Pc=function(t,i){var e={line:{},item:{}},s=t.styleMap;if(i)for(var n in e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=at(e[n]);return e},Ye.prototype.Nc=function(t,i,e,s,n){for(var h=[],r=0;r<i.length;r++)h.push(t.getCircle(i[r],e,s,n));return t.group(h.join(""))},Ye.prototype.Lc=function(t,i,e){for(var s=[],n=0;n<i.length;n++)s.push(t.getCircle(i[n],e,"webix_sparklines_event_area",{webix_area:n}));return t.group(s.join(""))},Ye.prototype.jc=function(t){var i,e,s=[];for(i=0;i<t.length;i++)e=i?"L":"M",s.push([e,t[i]]);return s},Ye.prototype.getPoints=function(t,i,e){var s=this.config,n=Math.min.apply(null,t);"undefined"!=typeof s.origin&&(n=Math.min(s.origin,n));var h=Math.max.apply(null,t),r=[],o=s.paddingX||0,a=s.paddingY||0;i=(i||100)-2*o;var u=s.minHeight||0;if(e=(e||100)-2*a,t.length)if(1==t.length)r.push({x:i/2+o,y:e/2+o});else{var c=i/(t.length-1),f=s.scale||h-n,l=(e-u)/(f||1);f||(e/=2);for(var d=0;d<t.length;d++)r.push({x:Math.ceil(c*d)+o,y:e-Math.ceil(l*(t[d]-n))+a-u})}return r};var qe={paddingX:3,paddingY:4,radius:1,minHeight:4,eventRadius:8};function Ge(t){this.config=H.extend(_(qe),t||{},!0)}Ge.prototype.draw=function(t,i,e){var s,n,h,r,o,a=this.config,u=Ye.prototype,c=We;return r=this.getPoints(t,i,e),h=c.definePath(u.jc(r),!0),a.color&&(o=this.Pc(c,a.color)),n=c.group(c.getPath(h,"webix_sparklines_area"+(o?" "+o.area:""))),r.splice(r.length-3,3),h=c.definePath(u.jc(r)),n+=c.group(c.getPath(h,"webix_sparklines_line"+(o?" "+o.line:""))),n+=u.Nc(c,r,a.radius,"webix_sparklines_item"+(o?" "+o.item:"")),s=Math.min(t.length?(i-2*(a.paddingX||0))/t.length:0,a.eventRadius),n+=u.Lc(c,r,s),c.draw(n,i,e,"webix_sparklines_area_chart"+(a.css?" "+a.css:""))},Ge.prototype.Pc=function(t,i){var e={area:{},line:{},item:{}},s=t.styleMap;if(i)for(var n in e.area[s.color]=t.setOpacity(i,.2),e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=at(e[n]);return e},Ge.prototype.getPoints=function(t,i,e){var s=Ye.prototype.getPoints.call(this,t,i,e),n=this.config.paddingX||0,h=this.config.paddingY||0;return s.push({x:i-n,y:e-h},{x:n,y:e-h},{x:n,y:s[0].y}),s};var Xe={paddingX:3,paddingY:4,width:20,margin:4,minHeight:4,eventRadius:8,origin:0,itemCss:function(t){return t<(this.config.origin||0)?" webix_sparklines_bar_negative":""}};function Je(t){this.config=H.extend(_(Xe),t||{},!0)}Je.prototype.draw=function(t,i,e){var s,n,h,r,o,a=this.config,u="",c=[],f=this.getPoints(t,i,e),l=We;for(s=0;s<f.length;s++)n="function"==typeof a.itemCss?a.itemCss.call(this,t[s]):a.itemCss||"",a.negativeColor&&t[s]<a.origin?n+=" "+this.Pc(l,a.negativeColor):a.color&&(
n+=" "+this.Pc(l,a.color)),h=f[s],c.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_bar "+n));u+=l.group(c.join("")),r=parseInt(this.Oc(t,i,e),10)+.5,o=a.paddingX||0,u+=l.group(l.getLine({x:o,y:r},{x:i-o,y:r},"webix_sparklines_origin"));var d=this.Wc(t,i,e),v=[];for(s=0;s<d.length;s++)h=d[s],v.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_event_area ",{webix_area:s}));return u+=l.group(v.join("")),l.draw(u,i,e,"webix_sparklines_bar_chart"+(a.css?" "+a.css:""))},Je.prototype.Pc=function(t,i){var e={},s=t.styleMap;return i&&(e[s.color]=i),at(e)},Je.prototype.Oc=function(t,i,e){var s=this.config,n=s.paddingY||0,h=n+(e=(e||100)-2*n);if(!1!==s.origin){var r=Math.min.apply(null,t),o=Math.max.apply(null,t),a=s.origin||-1e-6;if(o<=a)h=n;else if(r<a){h-=e/(o-r)*(a-r)}}return h},Je.prototype.Wc=function(t,i,e){var s=[],n=this.config.paddingX||0,h=this.config.paddingY||0;if(i=(i||100)-2*n,e=(e||100)-2*h,t.length)for(var r=i/t.length,o=0;o<t.length;o++)s.push({x:Math.ceil(r*o)+n,y:h,height:e,width:r});return s},Je.prototype.getPoints=function(t,i,e){var s=this.config,n=Math.min.apply(null,t);s.origin<n&&(n=s.origin);var h=Math.max.apply(null,t),r=[],o=s.paddingX,a=s.paddingY,u=s.margin,c=s.width||20,f=this.Oc(t,i,e);if(i=(i||100)-2*o,e=(e||100)-2*a,t.length){var l=i/t.length,d=s.scale||h-n;u=l-(c=Math.min(l-u,c));var v=0,_=n;!1!==s.origin&&s.origin>n?_=s.origin||0:v=s.minHeight;for(var p=(e-v)/(d||1),b=0;b<t.length;b++){var m=Math.ceil(p*(t[b]-_));r.push({x:Math.ceil(l*b)+o+u/2,y:f-(t[b]>=_?m:0)-v,height:Math.abs(m)+v,width:c})}}return r};var Ke={paddingY:2};function Ze(t){this.config=H.extend(Ke,t||{},!0)}Ze.prototype.Uc=0,Ze.prototype.Yc=["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],Ze.prototype.qc=function(t,i){var e=i.length,s=this.Yc.length;return e<s?(t&&(t=t<s-e?this.Uc+2:this.Uc+1),this.Uc=t):t%=s,this.Yc[t]},Ze.prototype.draw=function(t,i,e){var s,n,h,r,o=this.config,a=o.color||this.qc,u=this.getAngles(t),c=We,f=e/2-(o.paddingY||0),l=i/2,d=e/2;for("function"!=typeof a&&(a=function(){return a}),r="",h=0;h<u.length;h++)(s={})[c.styleMap.color]=a.call(this,h,t,this.Gc),r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_sector",s);for(n=c.group(r),r="",h=0;h<u.length;h++)r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_event_area",{webix_area:h});return n+=c.group(r),c.draw(n,i,e,"webix_sparklines_pie_chart"+(o.css?" "+o.css:""))},Ze.prototype.getAngles=function(t){var i,e,s=-Math.PI/2,n=[],h=this.Xc(t);for(e=0;e<t.length;e++)i=-Math.PI/2+h[e]-1e-4,n.push([s,i]),s=i;return n},Ze.prototype.Jc=function(t){for(var i=0,e=0;e<t.length;e++)i+=1*t[e];return i},Ze.prototype.Xc=function(t){var i,e,s=[],n=0,h=this.Jc(t);for(i=0;i<t.length;i++)e=1*t[i],s[i]=2*Math.PI*(h?(e+n)/h:1/t.length),n+=e;return s};var Qe={paddingX:3,paddingY:6,radius:2,minHeight:4,eventRadius:8};function ts(t){this.config=H.extend(_(Qe),t||{},!0)}ts.prototype.draw=function(t,i,e){var s=this.config,n="",h=Ye.prototype,r=this.getPoints(t,i,e),o=We,a=s.color?this.Pc(o,s.color):null;n+=o.group(o.getCurve(r,"webix_sparklines_line"+(a?" "+a.line:"")));var u=h.getPoints.call(this,t,i,e);n+=h.Nc(o,u,s.radius,"webix_sparklines_item"+(a?" "+a.item:""));var c=Math.min(t.length?(i-2*(s.paddingX||0))/t.length:0,s.eventRadius);return n+=h.Lc(o,u,c),o.draw(n,i,e,"webix_sparklines_line_chart"+(s.css?" "+s.css:""))},ts.prototype.Pc=function(t,i){var e={line:{},item:{}},s=t.styleMap;if(i)for(var n in e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=at(e[n]);return e},ts.prototype.getPoints=function(t,i,e){var s,n,h,r,o=[],a=[],u=[];for(n=Ye.prototype.getPoints.call(this,t,i,e),s=0;s<n.length;s++)a.push(n[s].x),u.push(n[s].y);for(h=this.Kc(a),r=this.Kc(u),s=0;s<n.length-1;s++)o.push([n[s],{x:h[0][s],y:r[0][s]},{x:h[1][s],y:r[1][s]},n[s+1]]);return o},ts.prototype.Kc=function(t){var i,e,s=[],n=[],h=[],r=[],o=[],a=[],u=t.length-1;for(n[s[0]=0]=2,h[0]=1,r[0]=t[0]+2*t[1],i=1;i<u-1;i++)s[i]=1,n[i]=4,h[i]=1,r[i]=4*t[i]+2*t[i+1];for(
s[u-1]=2,n[u-1]=7,h[u-1]=0,r[u-1]=8*t[u-1]+t[u],i=1;i<u;i++)e=s[i]/n[i-1],n[i]=n[i]-e*h[i-1],r[i]=r[i]-e*r[i-1];for(o[u-1]=r[u-1]/n[u-1],i=u-2;0<=i;--i)o[i]=(r[i]-h[i]*o[i+1])/n[i];for(i=0;i<u-1;i++)a[i]=2*t[i+1]-o[i+1];return a[u-1]=.5*(t[u]+o[u-1]),[o,a]};var is={paddingX:3,paddingY:6,radius:1,minHeight:4,eventRadius:8};function es(t){this.config=H.extend(_(is),t||{},!0)}function ss(){}(es.prototype=_(ts.prototype)).draw=function(t,i,e){var s=this.config,n=Ye.prototype,h=We,r=s.color?this.Pc(h,s.color):null,o=this.getPoints(t,i,e),a=o.splice(o.length-3,3),u=h.Rc(a);u[0][0]="L";var c=h.Ec(o).concat(u),f=h.group(h.getPath(h.definePath(c),"webix_sparklines_area"+(r?" "+r.area:""),!0));f+=h.group(h.getPath(h.definePath(h.Ec(o)),"webix_sparklines_line"+(r?" "+r.line:"")));var l=n.getPoints.call(this,t,i,e);f+=n.Nc(h,l,s.radius,"webix_sparklines_item"+(r?" "+r.item:""));var d=Math.min(t.length?(i-2*(s.paddingX||0))/t.length:0,s.eventRadius);return f+=n.Lc(h,l,d),h.draw(f,i,e,"webix_sparklines_splinearea_chart"+(s.css?" "+s.css:""))},es.prototype.Pc=function(t,i){var e={area:{},line:{},item:{}},s=t.styleMap;if(i)for(var n in e.area[s.color]=t.setOpacity(i,.2),e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=at(e[n]);return e},es.prototype.getPoints=function(t,i,e){var s=ts.prototype.getPoints.call(this,t,i,e),n=this.config.paddingX||0,h=this.config.paddingY||0;return s.push({x:i-n,y:e-h},{x:n,y:e-h},{x:n,y:s[0][0].y}),s},ss.types={},ss.getTemplate=function(t){var i=t||{};"string"==typeof t&&(i={type:t}),H.extend(i,{type:"line"});var e=this.types[i.type];return S(this.Zc,new e(i))},ss.Zc=function(t,i,e,s){return s?this.draw(function n(t){for(var i=[],e=t.length-1;0<=e;e--){var s=t[e];i[e]="object"===M(s)?s.value:s}return i}(e),s.width,33):this.draw(t.data||t,i.width,i.height)},A("onDataTable",function(t){t.type.sparklines=ss.getTemplate()}),ss.types.area=Ge,ss.types.bar=Je,ss.types.line=Ye,ss.types.pie=Ze,ss.types.spline=ts,ss.types.splineArea=es;var ns={escape:!0,delimiter:{rows:"\n",cols:"\t"},parse:function(t,i){if(i=i||this.delimiter,!this.escape)return this.Qc(t,i);for(var e=t.replace(/\n$/,"").split(i.rows),s=0;s<e.length-1;)this.tf(e[s],'"')%2==1&&(e[s]+=i.rows+e[s+1],delete e[s+1],s++),s++;var n=[];for(s=0;s<e.length;s++)if("undefined"!=typeof e[s]){for(var h=e[s],r=0,o=[],a=!1,u=0;u<=h.length;u++){if(!a&&h[u]===i.cols||u===h.length){var c=h.substr(r,u-r);c[0]===c[c.length-1]&&'"'===c[0]&&(c=c.substr(1,c.length-2).replace('""','"')),o.push(c),r=u+1}'"'!==h[u]||(a=!a)}n.push(o)}return n},Qc:function(t,i){for(var e=t.split(i.rows),s=0;s<e.length;s++)e[s]=e[s].split(i.cols);return e},tf:function(t,i){return t.split(i).length-1},stringify:function(t,i){if(i=i||this.delimiter,!this.escape){for(var e=0;e<t.length;e++)t[e]=t[e].join(i.cols);return t.join(i.rows)}for(var s=/\n|"|;|,/,n=0;n<t.length;n++){for(var h=0;h<t[n].length;h++){var r=t[n][h];r instanceof Date?t[n][h]=I.parseFormatStr(r):s.test(r)&&(t[n][h]='"'+r.toString().replace(/"/g,'""')+'"')}t[n]=t[n].join(i.cols)}return t=t.join(i.rows)}},hs={clipboard_setter:function(t){return q.touch||(!0!==t&&1!==t||(t="block"),se.init(),this.attachEvent("onSelectChange",this["if"]),this.attachEvent("onItemClick",function(){document.activeElement&&this.$view.contains(document.activeElement)&&(se.focus(),Mi.setFocus(this))}),this.attachEvent("onPaste",this.ef)),t},templateCopy_setter:Yt,"if":function(){if(!this.getEditor||!this.getEditor()){var t=this.sf();se.set(t),Mi.setFocus(this)}},sf:function(){var h=[],r=this.P.templateCopy;return this.mapSelection(function(t,i,e,s){h[s]||(h[s]=[]);var n=r?r(t,i,e):t;return h[s].push(n),t}),1===h.length&&1===h[0].length?h[0][0]:ns.stringify(h,this.P.delimiter)},ef:function(t){if(!R(this.Zn[this.P.clipboard])){var i=ns.parse(t,this.P.delimiter);this.Zn[this.P.clipboard].call(this,i)}},Zn:{block:function(h){var t=this.mapSelection(null);t&&(this.mapCells(t.row,t.column,h.length,null,function(t,i,e,s,n){return h[s]&&h[s].length>n?h[s][n]:t}),this.render())},selection:function(h){this.mapSelection(function(t,i,e,s,n){
return h[s]&&h[s].length>n?h[s][n]:t}),this.render()},repeat:function(h){this.mapSelection(function(t,i,e,s,n){return(i=h[s%h.length])[n%i.length]}),this.render()},custom:function(){}}},rs={open:function(t,i){if(t){var e=this.getItem(t);e.$count&&!e.open&&(this.callEvent("onBeforeOpen",[t])&&(e.open=!0,this.data.callEvent("onStoreUpdated",[t,0,"branch"]),this.callEvent("onAfterOpen",[t])),i&&"0"!=t&&this.open(this.getParentId(t),i))}},close:function(t){if(t){var i=this.getItem(t);i.open&&this.callEvent("onBeforeClose",[t])&&(i.open=!1,this.data.callEvent("onStoreUpdated",[t,0,"branch"]),this.callEvent("onAfterClose",[t]))}},openAll:function(t){this.data.eachSubItem(t||0,function(t,i){i&&(t.open=!0)}),this.data.refresh()},closeAll:function(t){this.data.eachSubItem(t||0,function(t,i){i&&(t.open=!1)}),this.data.refresh()},nf:function(t,i,e){if(this.P.threeState)return this.hf(t,null!==i?i:"");var s,n=this.getItem(t),h=e?e.target:null;s=h&&"checkbox"==h.type?!!h.checked:null!==i?i:!n.checked,n.checked=s,this.callEvent("onItemCheck",[t,n.checked,e])},isBranchOpen:function(t){if("0"==t)return!0;var i=this.getItem(t);return!!i.open&&this.isBranchOpen(i.$parent)},getOpenItems:function(){var t=[];for(var i in this.data.branch)this.exists(i)&&this.getItem(i).open&&t.push(i);return t},getState:function(){return{open:this.getOpenItems(),select:this.getSelectedId(!0)}},rf:function(t,i){var e=this.data.attachEvent("onStoreLoad",function(){t.setState.call(t,i),t.data.detachEvent(e),t=null})},setState:function(t){if(t.open){this.closeAll();for(var i=t.open,e=0;e<i.length;e++){var s=this.getItem(i[e]);if(s&&s.$count&&(s.open=!0,-1==s.$count))return this.rf(this,t),this.refresh(),0}this.refresh()}if(t.select&&this.select){var n=t.select;this.unselect();for(var h=0;h<n.length;h++)this.exists(n[h])&&this.select(n[h],!0)}return 1}},os={webix_tree_open:function(t,i){return this.close(i),!1},webix_tree_close:function(t,i){return this.open(i),!1},webix_tree_checkbox:function(t,i){return this.nf(i,null,t),!1}},as={$init:function(){this.data.attachEvent("onStoreUpdated",S(this.af,this),null,!0),this.vo=this.uf},uf:function(t,i,e,s){var n=0===i?{parent:encodeURIComponent(t)}:null;return _e.prototype.vo.call(this,t,i,e,s,n)},loadBranch:function(t,i,e){return t=t||0,this.data.url=e||this.data.url,this.callEvent("onDataRequest",[t,i,this.data.url])&&this.data.url?this.data.feed.call(this,t,0,i,e):b.reject()},af:function(t,i,e){e&&"add"!=e&&"delete"!=e&&"branch"!=e||this.data.cf(this)}},us={$init:function(){this.data},copy:function(t,i,e,s){return(s=s||{}).copy=!0,this.move(t,i,e,s)},Zh:function(t,i,e){if(i&&t){var s=this.getBranchIndex(t);return s+(e==this&&this.getParentId(t)==this.getParentId(i)&&e.getBranchIndex(i)<s?0:1)}},ff:function(t,i){var e=this.data.branch[t];if(e&&e.length)for(var s=0;s<e.length;s++){if(e[s]==i)return!0;if(this.ff(e[s],i))return!0}return!1},lf:function(t){for(var i=0;i<t.length;i++)for(var e=t[i];this.getParentId(e);)e=this.getParentId(e),-1==x.find.call(t,e)||(t.splice(i,1),i--);return t},move:function(t,i,e,s){i=i||0;var n=(s=s||{}).newId||t,h=s.parent||0;if((e=e||this).data,e.data){if(!$(t)){if(this!=e||s.copy){if(n=e.data.add(e.Kh(this.getItem(t),n),i,h||0),this.data.branch[t]&&e.getBranchIndex){var r=this.data.vr;this.data.vr=function(t){var i=_(t);return delete i.$parent,delete i.$level,delete i.$child,e.data.pull[i.id]&&(i.id=V()),i};var o={data:this.serialize(t,!0),parent:n};this.data.vr=r,e.parse(o)}s.copy||this.data.remove(t)}else{if(t==h||this.ff(t,h))return;var a=this.getItem(t),u=this.data.branch[h];u||(u=this.data.branch[h]=[]);var c=this.data.branch[a.$parent],f=x.find.call(c,t);if(i<0&&(i=u.length),c===u&&i===f)return n;if(x.removeAt.call(c,f),x.insertAt.call(u,t,Math.min(u.length,i)),c.length||delete this.data.branch[a.$parent],a.$parent&&"0"!=a.$parent&&this.getItem(a.$parent).$count--,h&&"0"!=h){var l=e.getItem(h);l.$count++,this.df(a,l.$level+1)}else this.df(a,1);a.$parent=h,e.data.callEvent("onDataMove",[t,i,h,u[i+1]])}return this.refresh(),n}this.lf(t);for(var d=0;d<t.length;d++){var v=this.move(t[d],
i,e,s);i=e.Zh(v,t[d+1],this)}}},df:function(t,i){t.$level=i;var e=this.data.branch[t.id];if(e)for(var s=0;s<e.length;s++)this.df(this.getItem(e[s]),i+1)},Ho:function(t){t&&!t.header&&this.exists(t)&&this.Ro(t)!=Xi.Gs.start&&this.open(t)},$dropAllow:function(t){if(t.from!=t.to)return!0;for(var i=0;i<t.source.length;i++)if(this.ff(t.source,t.target))return!1;return!0},Kh:function(t,i){var e=ae.Kh.call(this,t,i);return delete e.open,e}},cs={$init:function(){this.render},vf:function(t){var i=this.data.Dr[t.id];return this.callEvent("onItemRender",[t]),this.type.templateStart(t,this.type,i)+(t.$template?this.type["template"+t.$template](t,this.type,i):this.type.template(t,this.type,i))+this.type.templateEnd()},_f:function(t){return this.Oi.innerHTML=this.vf(t),this.Oi.firstChild},Q:function(t){!t.$template||this.type["template"+t.$template],t.$template;var i="<div role='presentation' class='webix_tree_branch_"+t.$level+"'>"+this.vf(t);return t.open&&(i+=this.pf(t.id)),i+="</div>"},pf:function(t){var i="",e=this.data.branch[t];if(e){i+="<div role='presentation' class='webix_tree_leaves'>";for(var s=e.length-1,n=0;n<=s;n++){var h=this.getItem(e[n]),r=this.type.bf;0!==r&&(r[h.$level]=n==s),i+=this.Q(h)}i+="</div>"}return i},render:function(t,i,e){if((cs.ze=this).isVisible(this.P.id)&&!this.$blockRender){if(t){var s,n,h=this.getItem(t);if("add"!=e&&!(s=this.getItemNode(t)))return;switch(e){case"branch":var r=s.parentNode;vt(n=this.gc(h),r),dt(r),this.Ni=null;break;case"paint":case"update":vt(n=this.Ni[t]=this._f(h),s),dt(s);break;case"delete":dt(s.parentNode);break;case"add":var o;if(0==h.$parent)o=this.tt.firstChild;else if(this.getItem(h.$parent).open&&(o=this.getItemNode(h.$parent))){if(!o.nextSibling){var a=ft("DIV",{"class":"webix_tree_leaves"},"");o.parentNode.appendChild(a)}o=o.nextSibling}if(o){var u=this.data.getNextSiblingId(t);(u=this.getItemNode(u))&&(u=u.parentNode),n=this.gc(h),this.Ni[t]=n.firstChild,vt(n,u,o)}break;default:return!1}this.callEvent("onPartialRender",[t,i,e])}else this.callEvent("onBeforeRender",[this.data])&&(this.type.bf=[],this.tt.innerHTML=this.pf(0),this.Ni=null,this.callEvent("onAfterRender",[]));return this.type.bf=0,!(cs.ze=null)}},getItemNode:function(t){if(this.Ni)return this.Ni[t];this.Ni={};for(var i=this.tt.getElementsByTagName("DIV"),e=0;e<i.length;e++){var s=i[e].getAttribute(this.Qo);s&&(this.Ni[s]=i[e])}return this.getItemNode(t)},mf:1},fs={gf:function(){if(this.mf){var s=this.render;this.render=function(t,i){var e=s.apply(this,arguments);this.P.threeState&&e&&"checkbox"!=i&&this.wf.apply(this,arguments)},this.gf=function(){}}},threeState_setter:function(t){return t&&this.gf(),t},wf:function(t){var i,e,s,n,h;if(s=[],h=this,t&&!h.data.pull[t]&&(t=0),!t||h.data.pull[t].$count)for((e=this.xf(t)).sort(function(t,i){return h.data.pull[i].$level-h.data.pull[t].$level}),i=0;i<e.length;i++)i&&h.data.pull[e[i]].$parent==h.data.pull[e[i-1]].$parent||(s=s.concat(h.yf(e[i])));else s=s.concat(h.yf(t));for(n={},i=0;i<s.length;i++)n[s[i]]||(n[s[i]]=1,this.Mf(s[i]));h=null},Mf:function(t){var i;this.getItemNode(t)&&(this.render(t,"checkbox","update"),this.getItem(t).indeterminate&&(i=this.getItemNode(t).getElementsByTagName("input")[0])&&(i.indeterminate=this.getItem(t).indeterminate))},yf:function(t){var i,e,s,n,h,r,o;for(n=this.getParentId(t),h=[];n&&"0"!=n;){e=r=0,this.data.eachChild(n,function(t){t.indeterminate?r++:t.checked&&e++}),i=s=o=!1;var a=this.getItem(n);e==a.$count?i=!0:(0<e||0<r)&&(s=!0),(s||s!=a.indeterminate)&&(o=!0),a.indeterminate=s,(i||a.checked!=i)&&(o=!0),a.checked=i,n=o?(h.push(n),this.getParentId(n)):0}return h},getChecked:function(){var i=[],e=this;return this.data.eachSubItem(0,function(t){e.isChecked(t.id)&&i.push(t.id)}),i},hf:function(t,i){var e=this.getItem(t);if(e&&(""===i&&(i=!e.checked),e.checked!=i||e.indeterminate)){e.checked=i,this.Sf(t);var s=this.yf(t);if(this.mf&&s.length<5)for(var n=0;n<s.length;n++)this.Mf(s[n]);else this.refresh();this.callEvent("onItemCheck",[t,i])}},checkItem:function(t){this.nf(t,!0),this.updateItem(t)},uncheckItem:function(t){this.nf(t,
!1),this.updateItem(t)},kf:function(t,i,e){var s=i?"checkItem":"uncheckItem";t?this[s](t):t=0,this.P.threeState?t||this.data.eachChild(0,function(t){this[s](t.id)},this,e):this.data.each(function(t){this[s](t.id)},this,e,t)},checkAll:function(t,i){this.kf(t,!0,i)},uncheckAll:function(t,i){this.kf(t,!1,i)},Sf:function(t){var i,e=this.getItem(t);e.indeterminate=!1,i=e.checked,this.data.eachSubItem(t,function(t){t.indeterminate=!1,t.checked=i}),this.mf&&this.isBranchOpen(e.$parent)&&this.render(t,0,"branch")},isChecked:function(t){return this.getItem(t).checked},xf:function(t){var e=[];return this.data.eachSubItem(t,function(t,i){i||e.push(t.id)}),e}},ls={name:"TreeStore",$init:function(){this.so={showSubItems:!0},this.branch={0:[]},this.attachEvent("onParse",function(t){this.qr(t.child)}),this.attachEvent("onClearAll",S(function(){this.Wr=null},this))},filterMode_setter:function(t){return H.extend(this.so,t,!0)},io:function(t){if(this.Wr&&!t){for(var i in this.branch=this.Wr,this.order=m(_(this.branch[0])),this.branch)"0"!=i&&(this.getItem(i).$count=this.branch[i].length);delete this.Wr}},eo:function(t,i,e,s){e&&this.Wr||(this.Wr=this.branch,this.branch=l(this.branch)),this.branch[0]=this.Cf(t,i,this.branch[0],1,s||{})},Cf:function(t,i,e,s,n){for(var h=[],r=n.level&&n.level!=s,o=0;o<e.length;o++){var a=e[o],u=this.getItem(a),c=!1,f=this.branch[a];if(r)c=!0;else if(t(this.getItem(a),i)){if(h.push(a),!1!==n.openParents)for(var l=this.getParentId(a);l&&"0"!=l;)this.getItem(l).open=1,l=this.getParentId(l);if(n.level||n.showSubItems)continue}else c=!0;if((r||!n.level)&&f){var d=this.branch[a]=this.Cf(t,i,f,s+1,n);u.$count=d.length,c&&d.length&&h.push(a)}}return h},count:function(){if(this.order.length)return this.order.length;var t=0;return this.eachOpen(function(){t++}),t},$f:function(t,i,e,s){if(t[e]){for(var n=t[s]=t[e],h=0;h<n.length;h++)this.getItem(n[h]).$parent=s;delete t[e]}if(t[i]){var r=x.find.call(t[i],e);0<=r&&(t[i][r]=s)}},changeId:function(t,i){if(t!=i){var e=this.getItem(t).$parent;return this.$f(this.branch,e,t,i),this.Wr&&this.$f(this.Wr,e,t,i),ve.prototype.changeId.call(this,t,i)}},clearAll:function(t){this.branch={0:[]},ve.prototype.clearAll.call(this,t)},getPrevSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],e=x.find.call(i,t)-1;return 0<=e?i[e]:null},getNextSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],e=x.find.call(i,t)+1;return e<i.length?i[e]:null},getParentId:function(t){return this.getItem(t).$parent},getFirstChildId:function(t){var i=this.branch[t];return i&&i.length?i[0]:null},isBranch:function(t){return!!this.branch[t]},getBranchIndex:function(t){var i=this.branch[this.pull[t].$parent];return x.find.call(i,t)},qr:function(e){this.Yr="string"==typeof e?function(t){var i=t[e];return i&&delete t[e],i}:e},Ar:function(t,i){for(var e=t.parent||0,s=0;s<i.length;s++){var n=this.driver.getDetails(i[s]),h=this.id(n),r=!!this.pull[h];r?(n=H.extend(this.pull[h],n,!0),this.Hr&&this.Hr(n)):(this.Rr&&this.Rr(n),this.pull[h]=n),this.Ur(n,e,0,r,t.from?1*t.from+s:0)}var o=this.pull[e]||{},a=this.branch[e]||[];o.$count=a.length,delete o.webix_kids,t.size&&t.size!=a.length&&(a[t.size-1]=undefined)},Ur:function(t,i,e,s,n){t.$count=0,t.$parent="0"!=i?i:0,t.$level=e||("0"!=i?this.pull[i].$level+1:1);var h=this.branch[t.$parent];(h||(h=this.branch[t.$parent]=[]),this.Wr&&(this.Wr[t.$parent]=h),s)||(h[n||h.length]=t.id);var r=this.Yr(t);if(t.webix_kids)return t.$count=-1;if(!r)return t.$count=0;$(r)||(r=[r]);for(var o=0;o<r.length;o++){var a=zt.json.getDetails(r[o]),u=this.id(a);(s=!!this.pull[u])?(a=H.extend(this.pull[u],a,!0),this.Hr&&this.Hr(a)):(this.Rr&&this.Rr(a),this.pull[u]=a),this.Ur(a,t.id,t.$level+1,s)}var c=this.branch[t.id];c&&(t.$count=c.length)},cf:function(t){this.order=m(),this.Df(this.order,0,t)},Df:function(t,i,e){for(var s=this.branch[i],n=0;n<s.length;n++){var h=s[n];t.push(h);var r=this.pull[h];r&&r.open&&(-1==r.$count?e.loadBranch(h):r.$count&&this.Df(t,h,e))}},provideApi:function(t,i){for(var e=["getPrevSiblingId","getNextSiblingId","getParentId","getFirstChildId",
"isBranch","getBranchIndex","filterMode_setter"],s=0;s<e.length;s++)t[e[s]]=this.ho(this,e[s]);t.getIndexById||ve.prototype.provideApi.call(this,t,i)},getTopRange:function(){return m([].concat(this.branch[0])).map(function(t){return this.getItem(t)},this)},eachChild:function(t,i,e,s){var n=this.branch;s&&this.Wr&&(n=this.Wr);var h=n[t];if(h)for(var r=0;r<h.length;r++)h[r]&&i.call(e||this,this.getItem(h[r]))},each:function(e,s,n,t){this.eachChild(t||0,function(t){var i=this.branch;e.call(s||this,t),n&&this.Wr&&(i=this.Wr),t&&i[t.id]&&this.each(e,s,n,t.id)},this,n)},eachOpen:function(i,e,t){this.eachChild(t||0,function(t){i.call(e||this,t),this.branch[t.id]&&t.open&&this.eachOpen(i,e,t.id)})},eachSubItem:function(t,i){var e=this.branch[t||0];if(e)for(var s=0;s<e.length;s++){var n=e[s];this.branch[n]?(i.call(this,this.getItem(n),!0),this.eachSubItem(n,i)):i.call(this,this.getItem(n),!1)}},eachLeaf:function(t,i){var e=this.branch[t||0];if(e)for(var s=0;s<e.length;s++){var n=e[s];this.branch[n]?this.eachLeaf(n,i):i.call(this,this.getItem(n),!1)}},Qr:function(t,i){for(var e in this.branch){for(var s=this.branch[e],n=[],h=0;h<s.length;h++)n.push(this.pull[s[h]]);n.sort(t);for(var r=0;r<s.length;r++)n[r]=n[r].id;this.branch[e]=n}return i},add:function(t,i,e){var s=!1,n=this.getItem(e||0);if(n&&(this.branch[n.id]||(s=!0),n.$count++,n.$count||(n.$count=1)),this.branch[e||0]=this.order=m(this.branch[e||0]),t.$count=t.webix_kids?-1:0,t.$level=n?n.$level+1:1,t.$parent=n?n.id:0,this.Wr){var h=this.Wr[e||0];if(h||(h=this.Wr[e]=this.order),this.order!==h){var r=h.length;!i&&this.branch[e||0].length&&(r=0),h=m(h),t.id=t.id||V(),h.insertAt(t.id,r)}}var o=ve.prototype.add.call(this,t,i);return s&&this.refresh(e),o},If:function(t){var i=this.pull[t];if(this.branch[i.id]&&0<this.branch[i.id].length)for(var e=this.branch[t],s=0;s<e.length;s++)this.If(e[s],!0);delete this.branch[t],this.Wr&&delete this.Wr[t],delete this.pull[t],this.Dr[t]&&delete this.Dr[t]},Af:function(t,i,e){var s=t[i];1==s.length&&s[0]==e&&i?delete t[i]:m(s).remove(e)},remove:function(t){if($(t))for(var i=0;i<t.length;i++)this.remove(t[i]);else{this.exists(t);var e=this.pull[t],s=e.$parent||0;if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.If(t),this.callEvent("onAfterDelete",[t]);var n=this.pull[s];this.Af(this.branch,s,t),this.Wr&&this.Af(this.Wr,s,t);var h=0;n&&(n.$count--,n.$count<=0&&(n.$count=0,n.open=0,h=1)),this.callEvent("onStoreUpdated",[t,e,"delete"]),h&&this.refresh(n.id)}},getBranch:function(t){var i=[],e=(this.Wr||this.branch)[t];if(e)for(var s=0;s<e.length;s++)i[s]=this.pull[e[s]];return i},serialize:function(t,i){var e=this.branch;i&&this.Wr&&(e=this.Wr);for(var s=e[t||0],n=[],h=0;h<s.length;h++){var r,o=this.pull[s[h]];if(this.vr){if(!1===(r=this.vr(o)))continue}else r=_(o);e[o.id]&&(r.data=this.serialize(o.id,i)),n.push(r)}return n}},ds={insert:function(t){for(var i=this.getSelectedId(!0,!0),e=0;e<t.length;e++){for(var s={},n=0;n<this.P.columns.length;n++)s[this.P.columns[n].id]=t[e][n]||"";!R(s.id)&&this.exists(s.id)&&(s.id=V()),this.add(s,null,i[0])}}},vs={space:function(t){for(var i="",e=1;e<t.$level;e++)i+="<div class='webix_tree_none'></div>";return i},icon:function(t){return t.$count?t.open?"<div class='webix_tree_open'></div>":"<div class='webix_tree_close'></div>":"<div class='webix_tree_none'></div>"},checkbox:function(t){return t.nocheckbox?"":"<input type='checkbox' class='webix_tree_checkbox' "+(t.checked?"checked":"")+(t.disabled?" disabled":"")+">"},folder:function(t){return t.icon?"<div class='webix_tree_file webix_tree_"+t.icon+"'></div>":t.$count?t.open?"<div class='webix_tree_folder_open'></div>":"<div class='webix_tree_folder'></div>":"<div class='webix_tree_file'></div>"}},_s={$render:function(){if(this.Ff)this.Wi.firstChild.appendChild(this.Ff);else{this.files.attachEvent("onBeforeDelete",this.Tf);var t={type:"file","class":"webix_hidden_upload",tabindex:-1};this.P.accept&&(t.accept=this.P.accept),this.P.multiple&&(t.multiple="true"),this.P.directory&&(t.webkitdirectory="true",t.mozdirectory="true",t.directory="true")
;var i=ft("input",t);this.Ff=this.Wi.firstChild.appendChild(i),Kt(this.Vt,"drop",S(function(t){this.$drop(t),gt(t)},this)),Kt(i,"change",S(function(){if(this.Vf(i.files),q.isIE){var t=document.createElement("form");t.appendChild(this.Ff),t.reset(),this.Wi.firstChild.appendChild(i)}else i.value=""},this)),Kt(this.Vt,"click",S(function(){250<new Date-(this.zf||0)&&this.fileDialog()},this)),Kt(this.Vt,"dragenter",gt),Kt(this.Vt,"dragexit",gt),Kt(this.Vt,"dragover",gt)}},Bf:function(t){return t.isDirectory},Hf:function(e,s,n){if(e.isFile)e.file(function(t){s.addFile(t,null,null,{name:n+"/"+t.name})});else if(e.isDirectory){e.createReader().readEntries(function(t){for(var i=0;i<t.length;i++)s.Hf(t[i],s,(n?n+"/":"")+e.name)})}},$drop:function(t){var i=t.dataTransfer.files,e=t.dataTransfer.items;if(i.length){if(this.callEvent("onBeforeFileDrop",[i,t])){e=e||i;for(var s=0;s<e.length;s++){var n=e[s];n.webkitGetAsEntry&&(n=n.webkitGetAsEntry()).isDirectory?this.Hf(n,this,""):this.addFile(i[s])}}this.callEvent("onAfterFileDrop",[i,t])}},fileDialog:function(t){this.zf=new Date,this.Rf=t;var i=this.Vt.getElementsByTagName("INPUT");i[i.length-1].click()},send:function(i){if("function"==typeof i&&(this.Ef=i,i=0),i){var t=this.files.getItem(i);if("client"!==t.status)return!1;this.P.upload,t.status="transfer";var e=new FormData;e.append(this.config.inputName,t.file,t.name),e.append(this.config.inputName+"_fullpath",t.name);var s={},n=this.P.formData||{};"function"==typeof n&&(n=n.call(this));var h=H.extend(t.formData||{},n),r=new XMLHttpRequest,o=this.Pf(t);if(y("onBeforeAjax",["POST",o,h,r,s,e])){for(var a in h)e.append(a,h[a]);for(var u in(t.xhr=r).upload.addEventListener("progress",S(function(t){this.$updateProgress(i,t.loaded/t.total*100)},this),!1),r.onload=S(function(){r.aborted||this.jf(i)},this),r.open("POST",o,!0),s)r.setRequestHeader(u,s[u]);r.send(e)}return this.$updateProgress(i,0),!0}var c=this.files.data.order,f=!0;if(c.length)for(var l=0;l<c.length;l++)f=!this.send(c[l])&&f;f&&this.Nf()},jf:function(t){var i=this.files.getItem(t);if(i){var e=null;if(i.xhr.status<400){var s=zt[this.P.datatype||"json"];(e=s.toObject(i.xhr.responseText))&&(e=s.getDetails(e))}e&&"error"!=e.status?(!e.status||e.status,this.Lf(t,e)):(i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,e])),delete i.xhr}},stopUpload:function(t){S(this.Tf,this.files)(t)},Tf:function(t){var i=this.getItem(t);"undefined"!=typeof i.xhr&&(i.xhr.aborted=!0,i.xhr.abort(),delete i.xhr,i.status="client")}},ps={Of:function(){this.data.attachEvent("onStoreUpdated",S(function(t,i,e){!t||"add"!=e&&"update"!=e||this.validate(t)},this)),this.data.attachEvent("onClearAll",S(this.clearValidation,this)),this.Of=function(){}},rules_setter:function(t){return t&&this.Of(),t},clearValidation:function(){this.data.clearMark("webix_invalid",!0)},validate:function(t){var i=!0;if(t){this.ir={};var e=this.getItem(t);(i=ce.validate.call(this,null,e))?this.callEvent("onValidationSuccess",[t,e])&&this.Qh(t):this.callEvent("onValidationError",[t,e,this.ir])&&this.nr(t,this.ir)}else for(var s in this.data.pull)i=this.validate(s)&&i;return i},sr:function(t,i,e,s){"string"==typeof t&&(t=ue[t]);var n=t.call(this,i,e,s);return n||(this.ir[s]=!0),n},Qh:function(t){this.data.removeMark(t,"webix_invalid",!0)},nr:function(t){this.data.addMark(t,"webix_invalid",!0)}},bs={$init:function(){this.elements={}},focus:function(t){if(t)this.elements[t],this.wi(this.elements[t]);else for(var i in this.elements)if(!1!==this.wi(this.elements[i]))return!0;return!1},wi:function(t){return!(!t||!t.focus)&&t.focus()},setValues:function(t,i){var e=this;this.P.complexData&&(t=Rt.collapseNames(t,"",{},function(t){return!e.elements[t]})),this.Wf(t,i)},Wf:function(t,i){for(var e in this.Uf=i,this.blockEvent(),i&&this.Yf||(this.Yf={}),t)this.elements[e]||(this.Yf[e]=t[e]);for(var s in this.elements){var n=this.elements[s];n&&(R(t[s])?!i&&n.$allowsClear&&n.setValue(""):n.setValue(t[s]),this.Yf[s]=n.getValue())}this.unblockEvent(),this.callEvent("onValues",[])},isDirty:function(){
return!!this.Uf||!0===this.getDirtyValues(!0)},setDirty:function(t){(this.Uf=t)||(this.Yf=this.qf())},getDirtyValues:function(){var t={};if(this.Yf)for(var i in this.elements){var e=this.elements[i],s=e.getValue(),n=this.Yf[i];if((e.$compareValue?!e.$compareValue(n,s):n!=s)&&(t[i]=s,arguments[0]))return!0}return t},getCleanValues:function(){return this.Yf},getValues:function(t){var i=this.qf(t);return this.P.complexData&&(i=Rt.expandNames(i)),i},qf:function(t){var i,e=null,s=this.Yf?_(this.Yf):{};for(var n in this.elements)e=this.elements[n],i=!0,t&&("object"==M(t)?(!1===t.hidden&&(i=e.isVisible()),i&&!1===t.disabled&&(i=e.isEnabled())):i=t.call(this,e)),i?s[n]=e.getValue():delete s[n];return s},clear:function(){this.Uf=!1;var t={};for(var i in this.elements)this.elements[i].$allowsClear&&(t[i]="");this.Wf(t)},markInvalid:function(t,i){if(!1===i)this.Qh(t);else{if("string"==typeof i){var e=this.elements[t];e&&(e.P.invalidMessage=i)}this.ir&&(this.ir[t]=!0),this.nr(t)}},nr:function(t){var i=this.elements[t];t&&i&&(this.Qh(t,!0),yt(i.Vt,"webix_invalid"),i.P.invalid=!0,"string"==typeof i.P.invalidMessage&&i.setBottomText&&i.setBottomText())},Qh:function(t,i){var e=this.elements[t];t&&e&&e.$view&&e.P.invalid&&(Mt(e.Vt,"webix_invalid"),e.P.invalid=!1,"string"==typeof e.P.invalidMessage&&!i&&e.setBottomText&&e.setBottomText())}},ms={$init:function(){this.render,this.Ni={},Kt(this.Vt,"scroll",S(this.Gf,this)),this.Xf=[]},getItemNode:function(t){return this.Ni[t]},showItem:function(t){var i=this.rh(),e=this.data.getIndexById(t),s=Math.floor(e/i.hh)*i.Cs,n=this.getScrollState();(s<n.y||s+this.P.height>=n.y+this.we)&&this.scrollTo(0,s)},render:function(t,i,e){if(this.isVisible(this.P.id)&&!this.$blockRender)if(t){var s=this.getItemNode(t);switch(e){case"update":if(!s)return;vt(this.Ni[t]=this.gc(i),s),dt(s);break;default:this.Jf()}}else this.callEvent("onBeforeRender",[this.data])&&(this.Ni={},this.Gf(null,!0),this.Kf=!1,this.callEvent("onAfterRender",[]))},Jf:function(){this.Kf||(this.Kf=!0,window.setTimeout(S(function(){this.render()},this),1))},Zf:function(t){q.maxHTMLElementSize&&(t=Math.min(q.maxHTMLElementSize,t));var i=document.createElement("DIV");return i.style.cssText="height:"+t+"px; width:100%; overflow:hidden;",i},Gf:function(t,i){this.Xf=[];var e=this.rh();this.tt.firstChild&&!i||(this.tt.innerHTML="",this.tt.appendChild(this.Zf(e.Qf)),this.Li=[this.tt.firstChild]);for(var s=e.tl;s<=e.il;){for(;this.Li[s]&&this.Li[s].el&&s<=e.il;)s++;if(s>e.il)break;for(var n=s;!this.Li[n];)n--;var h=this.Li[n],r=s*e.hh+(this.data.$min||0);if(r>(this.data.$max||Infinity))break;var o=Math.min(r+e.hh-1,this.data.$max?this.data.$max-1:Infinity),a=this.Zf(e.Cs),u=this.data.getIndexRange(r,o);if(!u.length)break;for(var c={$template:"Loading"},f=0;f<u.length;f++)u[f]||this.Xf.push(r+f),u[f]=this.Q(u[f]||c);a.innerHTML=u.join("");for(var l=0;l<u.length;l++)this.Ni[this.data.getIdByIndex(r+l)]=a.childNodes[l];var d=parseFloat(h.style.height,10),v=(s-n)*e.Cs,_=d-v-e.Cs;if(vt(a,v?h.nextSibling:h,this.tt),(this.Li[s]=a).el=!0,v<=0&&0<_)h.style.height=_+"px",this.Li[s+1]=h;else if(v<0?dt(h):h.style.height=v+"px",0<_)vt(this.Li[s+1]=this.Zf(_),a.nextSibling,this.tt);s++}if(this.Xf.length){var p=this.Xf[0],b=this.Xf.pop()+1;if(p<b){var m=b-p;if(this.mo(m,p))return;m=Math.max(m,this.P.datafetch||this.P.loadahead||0),this.loadNext(m,p)}}},rh:function(){var t=this.getScrollState(),i=Math.max(0,t.y),e=this.me,s=this.we,n=this.type,h=Math.floor(e/n.width)||1,r=Math.floor(i/n.height),o=Math.ceil((s+i)/n.height)-1,a=this.data.$max?this.data.$max-this.data.$min:this.data.count();return{tl:r,il:o,sl:i,Qf:Math.ceil(a/h)*n.height,Cs:n.height,hh:h}},at:function(t){var i=this.getItemNode(t);return i||(this.showItem(t),this.Gf(),i=this.getItemNode(t)),{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Wi}}},gs={$init:function(){this.Ni={},Kt(this.Vt,"scroll",S(function(){this.render(null,null,"paint")},this))},ws:function(t,i,e){this.P.footer&&Yi.ms(this.nl.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,
e])},getItemNode:function(t){return this.Ni&&this.Ni[t]},showItem:function(t){var i=this.data.getIndexById(t);if(-1<i){var e=i*this.type.height,s=e+this.type.height,n=this.getScrollState(),h=pt(this.$view);e<n.y?this.scrollTo(0,e):s>n.y+h.height&&this.scrollTo(0,s-h.height)}},render:function(t,i,e){if(this.isVisible(this.P.id)&&!this.$blockRender){var s=this.xc||this.tt;if(!t||"paint"!=e&&"update"!=e){if("paint"!=e&&(this.Ni={},s.innerHTML=""),this.callEvent("onBeforeRender",[this.data])){var n=this.data.count(),h=this.getScrollState(),r=pt(this.Vt),o=Math.floor(h.y/this.type.height)-2,a=Math.ceil((h.y+r.height)/this.type.height)+2;o=Math.max(0,o),a=Math.min(this.data.count()-1,a);for(var u=[],c=o;c<=a;c++){var f=this.data.order[c];if(this.Ni[f])u.push("<div></div>");else{var l=this.data.getItem(f);if(!l){this.hl({count:a-c+(this.P.loadahead||0),start:c});break}u.push(this.Q(l))}}this.Oi.innerHTML=u.join(""),s.style.position="relative",s.style.height=n*this.type.height+"px";for(var d=this.Oi.childNodes,v=d.length-1;0<=v;v--){var _=d[v],p=_.getAttribute(this.Qo);p&&(_.style.position="absolute",_.style.top=(o+v)*this.type.height+"px",_.style.left=0,_.style.width="100%",s.appendChild(_),this.Ni[p]=_)}this.callEvent("onAfterRender",[])}}else{var b=this.getItemNode(t);if(b){var m=this.Ni[t]=this.gc(i);return m.style.top=b.style.top,m.style.position="absolute",m.style.left=0,m.style.width="100%",vt(m,b),void dt(b)}}}},$setSize:function(){Hi.api.$setSize.apply(this,arguments)&&this.render(null,null,"paint")},hl:function(t){var i=Math.max(t.count,this.P.datafetch||this.P.loadahead||0);this.mo(t.count,t.start)||this.loadNext(i,t.start)}},ws="non-existing view for export";function xs(i,e,t){return!t&&e.format?function(t){return e.format(t[i])}:function(t){return t[i]}}function ys(t,i){var e=i.text;if(i.contentId){var s=t.getHeaderContent(i.contentId);s&&!s.type.$icon&&(e=s.getValue(!0))}return(e||"").toString().replace(/<[^>]*>/gi,"")}function Ms(t,i,e){return e[t]&&e[t][i]?e[t][i]:""}function Ss(t,i){var e,s=[],n=0,h=0,r=t.getColumnConfig,o=i.columns,a=!!i.rawValues,u="TreeStore"==t.data.name,c=i.treeLines;if((!0===c||R(c))&&(c="value"),s.heights={},o){if(!o.length){var f=[];for(var l in o)f.push(H.extend({id:l},H.extend({},o[l])));o=f}}else if(r)o=[].concat(t.rl);else{o=[];var d=t.data.pull[t.data.order[0]];for(var v in d)"id"!==v&&"$"!=v[0]&&o.push({id:v,isTree:u&&v===c})}if(i.ignore)for(var _=o.length-1;0<=_;_--)i.ignore[o[_].id]&&o.splice(_,1);if(i.id&&s.push({id:"id",width:50,header:" ",template:function(t){return t.id}}),i.flatTree){for(var p=i.flatTree.id,b=[].concat(i.flatTree.columns),m=[],g=!!i.flatTree.fill,w=1;w<=b.length;w++)b[w-1].template=function(i){return function(t){return t.$level==i?m[i]=t[p]:g&&i<t.$level?m[i]:""}}(w);for(var x=0,y=o.length-1;0<=y;y--)o[y].id===p&&(x=y);o=[].concat(o.slice(0,x)).concat(b).concat(o.slice(x+1))}for(var M=0;M<o.length;M++){var S=o[M],k=S.id;if(!S.noExport){var C=a&&r;if(r){var $=t.ol[k];!S.template||$&&$.template==S.template||(C=!1),$&&(S=H.extend(H.extend({},S),$))}var D={id:S.id,template:C||!S.template?xs(k,S,a):S.template,width:(S.width||200)*("excel"===i.export_mode?8.43/70:1),header:!1!==S.header?S.header||k:""};u&&k===c&&(D.isTree=e=!0),"excel"===i.export_mode&&H.extend(D,{type:S.exportType||"",format:S.exportFormat||""}),"string"==typeof D.header?D.header=[{text:D.header}]:D.header=[].concat(D.header);for(var I=0;I<D.header.length;I++)D.header[I]=D.header[I]?ys(t,D.header[I]):"";if(n=Math.max(n,D.header.length),t.config.footer){var A=S.footer||"";A="string"==typeof A?[{text:A}]:[].concat(A);for(var F=0;F<A.length;F++)A[F]=A[F]?ys(t,A[F]):"";D.footer=A,h=Math.max(h,D.footer.length)}s.push(D)}}!e&&u&&i.treeLines!=c&&s[0]&&(s[0].isTree=!0);for(var T=0;T<s.length;T++){for(var V=n-s[T].header.length,z=0;z<V;z++)s[T].header.push("");if(t.config.footer){V=h-s[T].footer.length;for(var B=0;B<V;B++)s[T].footer.push("")}}return s}function ks(r,o,a){var t,i,u=!!o.filterHTML,c=/<[^>]*>/gi,f=[],l=o.export_mode;if("excel"!==l&&"csv"!=l||!o.docHeader||(f=[[(o.docHeader.text||o.docHeader
).toString()],[""]],"excel"===l&&o.docHeader.height&&(a.heights[0]=o.docHeader.height)),!1!==o.header&&a.length)for(var e=0;e<a[0].header.length;e++){i=[];for(var s=0;s<a.length;s++)t="",a[s].header[e]&&(t=a[s].header[e],u&&(t=a[s].header[e]=t.replace(c,""))),i.push(t);"excel"!=l||!r.rl||!1===o.heights||r.al[e]===Li.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.al[e]),"pdf"!==l&&(f[f.length]=i)}o.yCorrection=(o.yCorrection||0)-f.length;var d=o.flatTree||o.plainOutput?"":"-";if(r.data.each(function(t){if(!o.filter||o.filter(t)){this.data.Lr&&(t=r.data.Lr(t));for(var i=[],e=0;e<a.length;e++){var s=a[e],n=null;if(o.math&&t["$"+s.id]&&"="==t["$"+s.id].charAt(0)&&!t["$"+s.id].match(/^=(image|sparkline)\(/i)&&(n=t["$"+s.id]),this.ul){var h=this.getSpan(t.id,s.id);h&&h[4]&&h[0]==t.id&&h[1]==s.id&&(n=h[4],u&&"string"==typeof n&&(n=n.replace(c,"")))}n||((n=s.template(t,r.type,t[s.id],s,e))||0===n||(n=""),s.isTree&&d&&(n=" "+Array(t.$level).join(d)+" "+n),u&&"string"==typeof n&&(n=n.replace(c,"")),"string"==typeof n&&"csv"===l&&(n=n.trim()),"string"!=typeof n||"excel"!==l&&"csv"!==l||(n=n.replace(/<br\s*\/?>/gm,"\n"))),i.push(n)}"excel"==l&&r.rl&&!1!==o.heights&&(t.$height&&t.$height!==Li.rowHeight||"all"==o.heights)&&(a.heights[f.length]=t.$height||this.config.rowHeight),f.push(i)}},r),!1!==o.footer)for(var n=a[0].footer?a[0].footer.length:0,h=0;h<n;h++){for(var v=[],_=0;_<a.length;_++){var p=a[_].footer[h];u&&(p=a[_].footer[h]=p.toString().replace(c,"")),v.push(p)}"excel"!=l||!r.rl||!1===o.heights||r.cl[h]===Li.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.cl[h]),"pdf"!==l&&f.push(v)}return"excel"===l&&o.docFooter&&(f=f.concat([[],[(o.docFooter.text||o.docFooter).toString()]]),o.docFooter.height&&(a.heights[f.length-1]=o.docFooter.height)),f}var Cs={},$s=function(t,s){(s=s||{}).export_mode="pdf",s.fl=Cs,s.fontName=s.fontName||"pt-sans.regular",t=$(t)?t:[t];for(var n=[],i=0;i<t.length;i++){t[i].id||(t[i]={id:t[i]});var e=oi(t[i].id);if(e){var h=H.extend(t[i].options||{},s),r=h.display||"table";if("image"==h.display&&delete h.styles,e.$exportView&&(e=e.$exportView(h)),$(e))n=n.concat(e),s.autowidth&&Ts(h,s);else{if(("table"==r||"all"==r)&&e.data&&e.data.pull){var o=Ss(e,h);n.push({scheme:o,exportData:ks(e,h,o),viewOptions:h}),s.autowidth&&Ts(e,s,o)}if("image"==r||"all"==r){var a=h.It?zs(e.$view):e.$view;n.push({node:a,viewOptions:h}),s.autowidth&&Ts(e,s)}}}}return s.dataOnly?n:Tt([q.cdn+"/extras/pdfjs.js",q.cdn+"/extras/html2canvas-1.0.min.js"]).then(function(){if(0==n.length)return b.reject(ws);if(Cs[s.fontName])return s.fl=Cs[s.fontName],Is(n,s).then(function(t){return Ds(t,s)});var e=b.defer();return pdfjs.load(s.fontURL||q.cdn+"/extras/"+s.fontName+".ttf",function(t,i){if(t)throw t;s.fl=Cs[s.fontName]=new pdfjs.TTFFont(i),e.resolve(Is(n,s).then(function(t){return Ds(t,s)}))}),e})};function Ds(t,i){var e=(i.filename||"Data")+".pdf",s=new Blob([t.toString()],{type:"application/pdf"});return!1!==i.download&&kt(s,e),s}function Is(s,n){for(var h=function o(t){var i=t.width||595.296,e=t.height||841.896;t.orientation&&"landscape"===t.orientation&&(e=[i,i=e][0]);return new pdfjs.Document({padding:40,font:t.fl,threshold:256,width:i,height:e})}(n),r=[],t=0;t<s.length;t++)s[t].node?r.push(Fs(s[t].node)):r.push(b.resolve());return b.all(r).then(function(t){for(var i=0;i<r.length;i++){var e=s[i].viewOptions;e.textBefore&&As(h,"before",e.textBefore),t[i]?h.image(t[i],{align:"center"}):Vs(s[i],h),e.textAfter&&As(h,"after",e.textAfter),i!=s.length-1&&h.pageBreak()}return function o(s,n){if(!1!==n.docFooter){var t=s.footer();t.text({color:6710886,textAlign:"center"}).append(I.dataExport.page||"Page").pageNumber().append("  "+(I.dataExport.of||"of")+"  ").pageCount()}var h={text:0,image:1};n.docHeader&&("string"==typeof n.docHeader&&(n.docHeader={text:n.docHeader}),H.extend(n.docHeader,{color:6710886,textAlign:"right",order:0}),h.text=n.docHeader.order);n.docHeaderImage&&("string"==typeof n.docHeaderImage&&(n.docHeaderImage={url:n.docHeaderImage}),H.extend(n.docHeaderImage,{align:"right",order:1}),h.image=n.docHeaderImage.order)
;n.docHeader&&h.image>h.text&&s.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader);{if(n.docHeaderImage){var r=b.defer();return pdfjs.load(n.docHeaderImage.url,function(t,i){if(!t){var e=new pdfjs.Image(i);s.header({paddingBottom:10}).image(e,n.docHeaderImage),n.docHeader&&h.image<h.text&&s.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader)}r.resolve(s.render())}),r}return b.resolve(s.render())}}(h,n)})}function As(t,i,e){"after"==i&&t.text().br(),"string"==typeof e&&(e={text:e}),t.text(e.text,e.options||{}),"before"==i&&t.text().br()}function Fs(t){var i=!document.body.contains(t);return i&&(document.body.appendChild(t),t.style.position="absolute",t.style.left="-9999px"),window.html2canvas(t,{background:"#fff",logging:!1,useCORS:!0}).then(function(t){for(var i=t.toDataURL("image/jpeg"),e=window.atob(i.split("base64,")[1]),s=e.length,n=new Uint8Array(s),h=0;h<s;h++)n[h]=e.charCodeAt(h);return new pdfjs.Image(n.buffer)})["finally"](function(){i&&document.body.removeChild(t)})}function Ts(t,i,e){var s,n=i.orientation&&"landscape"==i.orientation?"height":"width";if(e){s=80;for(var h=0;h<e.length;h++)s+=e[h].width}else s=t.$width?t.$width:t[n];i[n]=Math.max(i[n]||0,s||0)}function Vs(t,i){var e=t.scheme,s=t.exportData,n=t.viewOptions,h=t.styles;n.header=R(n.header)||!0===n.header?{}:n.header,n.footer=R(n.footer)||!0===n.footer?{}:n.footer,n.table=n.table||{};for(var r=!1===n.header?0:e[0].header.length,o=!1!==n.footer&&e[0].footer?e[0].footer.length:0,a=[],u=0;u<e.length;u++)a[u]=e[u].width;var c=H.extend(n.table,{borderWidth:1,height:20,lineHeight:1.1,borderColor:15658734,backgroundColor:16777215,color:6710886,textAlign:"left",paddingRight:10,paddingLeft:10,headerRows:r,widths:a.length?a:["100%"]}),f=i.table(c);if(r)for(var l=H.extend(n.header,{borderRightColor:11587299,borderBottomColor:11587299,color:4868682,backgroundColor:13820911,height:27,lineHeight:1.2}),d=0;d<r;d++)for(var v=f.tr(l),_=0;_<e.length;_++){var p=h?Ms(d,_,h):{};v.td(e[_].header[d].toString(),p)}for(var b=0;b<s.length;b++)for(var m=f.tr({}),g=0;g<s[b].length;g++){var w=h?Ms(b+r,g,h):{};m.td(s[b][g],w)}if(o)for(var x=H.extend(n.footer,{borderRightColor:15658734,borderBottomColor:15658734,backgroundColor:16448250,color:6710886,height:27,lineHeight:1.2}),y=0;y<o;y++)for(var M=r+s.length,S=f.tr(x),k=0;k<e.length;k++){var C=h?Ms(y+M,k,h):{};S.td(e[k].footer[y].toString(),C)}}function zs(t){var i=t.cloneNode(!1);if(t.tagName){var e=window.getComputedStyle(t);i.style.cssText=e.cssText}for(var s=0;s<t.childNodes.length;s++)i.appendChild(zs(t.childNodes[s]));return i}var Bs=function(t,v){(v=v||{}).export_mode="excel",t=$(t)?t:[t];for(var _=[],i=0;i<t.length;i++){t[i].id||(t[i]={id:t[i]});var e=oi(t[i].id),s=H.extend(t[i].options||{},v);if(e&&e.$exportView&&(e=e.$exportView(s)),$(e))_=_.concat(e);else if(e.data&&e.data.pull){var n=Ss(e,s);_.push({scheme:n,exportData:ks(e,s,n),spans:s.spans?Ps(e,s):[],viewOptions:s})}}if(v.dataOnly)return _;var p=b.defer();return Tt(q.cdn+"/extras/xlsx.core.styles.min.js").then(function(){if(!_.length)return p.reject(ws);for(var t={SheetNames:[],Sheets:{},Workbook:{WBProps:{},Names:[]}},i=0;i<_.length;i++){for(var e=_[i].viewOptions,s=_[i].scheme,n=_[i].exportData,h=_[i].spans,r=_[i].ranges||[],o=Es(n,s,h,_[i].styles||[],e),a=(e.name||"Data"+(i+1)).replace(/[*?:[\]\\/]/g,"").replace(/&/g,"&amp;").substring(0,31),u=i;-1!=t.SheetNames.indexOf(a);)a="Data"+ ++u;t.SheetNames.push(a),t.Sheets[a]=o,t.Workbook.Names=t.Workbook.Names.concat(r)}var c=XLSX.write(t,{bookType:"xlsx",bookSST:!1,type:"binary"}),f=(v.filename||"Data")+".xlsx",l=new Blob([function d(t){for(var i=new ArrayBuffer(t.length),e=new Uint8Array(i),s=0;s!=t.length;++s)e[s]=255&t.charCodeAt(s);return i}(c)],{type:"application/xlsx"});return!1!==v.download&&kt(l,f),p.resolve(l),p})};var Hs={number:"n",date:"n",string:"s","boolean":"b"},Rs="_table";function Es(t,i,e,s,n){for(var h,r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},a=0;a!=t.length;++a)for(var u=0;u!=t[a].length;++u){o.s.r>a&&(o.s.r=a),o.s.c>u&&(o.s.c=u),o.e.r<a&&(o.e.r=a),o.e.c<u&&(o.e.c=u);var c={
v:t[a][u]};if(null!==c.v){var f=XLSX.utils.encode_cell({c:u,r:a}),l=c.v.toString(),d="="===l.charAt(0);if(s){var v=Ms(a,u,s);v.format&&(c.z=v.format,delete v.format),v.type&&(c.t=Hs[v.type],delete v.type),c.s=v}if((n.docHeader?2:0)+i[0].header.length<=a&&!d){var _=i[u];_.type&&!c.t&&(c.t=Hs[_.type]||""),_.format&&!c.z&&(c.z=_.format)}c.v instanceof Date?(c.t=c.t||"n",c.z=c.z||XLSX.SSF[Rs][14],c.v=(h=c.v,void 0,(25569+(h.getTime()-60*h.getTimezoneOffset()*1e3)/864e5).toString().substr(0,20))):d?(c.t=c.t||"n",c.f=c.v.substring(1),delete c.v):c.t||("boolean"==typeof c.v?c.t="b":"number"==typeof c.v||parseFloat(c.v)==c.v?(c.v=1*c.v,c.t="n"):(c.v=l,c.t="s")),r[f]=c}}return o.s.c<1e7&&(r["!ref"]=XLSX.utils.encode_range(o)),r["!rows"]=function p(t){for(var i in t)t[i]={hpx:t[i],hpt:.75*t[i]};return t}(i.heights),r["!cols"]=function b(t){for(var i=[],e=0;e<t.length;e++)i.push({wch:t[e].width});return i}(i),e.length&&(r["!merges"]=e),r}function Ps(t,i){var e=t.getColumnConfig,s=t.ul,n=[];if(e){if(!1!==i.header&&(n=js(t,i,"header",n)),s){var h=i.xCorrection||0,r=i.yCorrection||0;for(var o in s){var a=s[o];for(var u in a){var c=t.getColumnIndex(u)-h,f=t.getIndexById(o)-r;if(!(c<0||f<0)){var l=c+a[u][0]-1,d=f+(a[u][1]-1);n.push({s:{c:c,r:f},e:{c:l,r:d}})}}}}!1!==i.footer&&(n=js(t,i,"footer",n))}return n}function js(t,i,e,s){for(var n=t.config.columns,h=(i.docHeader?2:0)+("header"==e?0:(!1!==i.header?t.al.length:0)+t.count()),r=0;r<n.length;r++)for(var o=n[r][e],a=0;a<o.length;a++)o[a]&&(o[a].colspan||o[a].rowspan)&&s.push({s:{c:r,r:a+h},e:{c:r+(o[a].colspan||1)-1,r:a+(o[a].rowspan||1)-1+h}});return s}function Ns(t,i){if(-1!=t.type.indexOf("prompt"))if(!1===i)t.ar.reject();else{var e=t.ll.querySelector(".webix_popup_input"),s=e.querySelector("input");if(t.input.required&&!s.value)return t.input.invalid=!0,void yt(e,"webix_popup_invalid");i=s.value||"",t.ar.resolve(i)}-1!=t.type.indexOf("confirm")&&!1===i?t.ar.reject():t.ar.resolve(i);var n=t.callback;n&&n(i,t.details),Qs.hide(t.id)}function Ls(t){var i=Qs.order.length;if(0<i&&tn.keyboard){var e=(t=t||window.event).which||t.keyCode,s=Qs.pull[Qs.order[i-1]],n=-1!=s.type.indexOf("prompt");return(13==e||32==e&&!n)&&Ns(s,!0),27==e&&Ns(s,!1),n||gt(t),!(t.cancelBubble=!0)}}function Os(t,i){var e,s=i||document.body;if(R(s.modality)){if((e=ft("DIV",{"class":"webix_modal_cover",style:"position:"+(i?"absolute":"fixed")+";"})).onkeydown=Ls,i){var n=window.getComputedStyle(i).position;"fixed"!=n&&"absolute"!=n&&"sticky"!=n&&"relative"!=n&&(s.style.position="relative")}s.appendChild(e),s.modality=1}else t?s.modality++:s.modality--;if(t&&1===s.modality||0===s.modality)if(e)e.style.display="inline-block";else{e=s.querySelectorAll(".webix_modal_cover");for(var h=0;h<e.length;h++)if(e[h].parentNode==s){e[h].style.display=1==s.modality?"inline-block":"none";break}}}function Ws(t,i,e){return"<div role='button' tabindex='0' aria-label='"+t+"' class='webix_popup_button"+(e?" "+e:"")+"' result='"+i+"' ><div>"+t+"</div></div>"}function Us(s,t,i,e){var n=document.createElement("DIV"),h=s.css?" "+s.css:"";n.className="webix_modal_box webix_"+s.type+h,n.setAttribute("webixbox",1),n.setAttribute("role","alertdialog"),n.setAttribute("aria-label",s.title||""),n.setAttribute("tabindex","0");var r="";if(s.width&&(n.style.width=s.width+(ue.isNumber(s.width)?"px":"")),s.height&&(n.style.height=s.height+(ue.isNumber(s.height)?"px":"")),s.title&&(r+='<div class="webix_popup_title">'+s.title+"</div>"),r+='<div class="webix_popup_text'+(e?" webix_popup_label":"")+'"><span>'+(s.content?"":s.text||"")+"</span></div>",r+='<div  class="webix_popup_controls">',e&&(r+=function c(t){return"<div tabindex='0' class='webix_popup_input webix_el_text"+(t.required?" webix_required":"")+"'><input value='"+Yt.escape(t.value||"")+"' placeholder='"+Yt.escape(t.placeholder||"")+"'></input></div>"}(s.input)),i&&(r+=Ws(s.cancel||I.message.cancel,!1)),t&&(r+=Ws(s.ok||I.message.ok,!0,"confirm")),s.buttons&&!t&&!i)for(var o=0;o<s.buttons.length;o++)r+=Ws(s.buttons[o],o);if(r+="</div>",n.innerHTML=r,s.content){var a=s.content
;"string"==typeof a&&(a=document.getElementById(a)),"none"==a.style.display&&(a.style.display=""),n.childNodes[s.title?1:0].appendChild(a)}if(-1!=s.type.indexOf("prompt")){var u=n.querySelector(".webix_popup_input");u.querySelector("input").oninput=function(){s.input.invalid&&(Mt(u,"webix_popup_invalid"),s.input.invalid=!1)}}return n.onclick=function(t){var i=(t=t||window.event).target;if(i.className||(i=i.parentNode),-1!=i.className.indexOf("webix_popup_button")){var e=i.getAttribute("result");Ns(s,e="true"==e||"false"!=e&&e)}t.cancelBubble=!0},s.ll=n}function Ys(t,i,e,s){var n=t.tagName?t:Us(t,i,e,s),h=t.container?t.container.offsetWidth:window.innerWidth||document.documentElement.offsetWidth,r=t.container?t.container.offsetHeight:window.innerHeight||document.documentElement.offsetHeight;t.container&&(n.style.position="absolute"),C((t.container||document.body).appendChild(n)),Os(!0,t.container);var o=t.left||Math.abs(Math.floor((h-n.offsetWidth)/2)),a=t.top||Math.abs(Math.floor((r-n.offsetHeight)/2));return"top"==t.position?n.style.top="-3px":n.style.top=a+"px",n.style.left=o+"px",n.onkeydown=Ls,n.focus(),t.id?Qs.pull[t.id]&&Qs.hide(t.id):t.id=ui("modalbox"),Qs.order.push(t.id),(Qs.pull[t.id]=t).ar=b.defer(),t.ar}function qs(t){return Ys(t,!0)}function Gs(t){return Ys(t,!0,!0)}function Xs(t){return Ys(t)}function Js(t){return Ys(t,!0,!0,!0)}function Ks(t,i,e){return"object"!=M(t)&&("function"==typeof i&&(e=i,i=""),t={text:t,type:i,callback:e}),t}function Zs(){var t=Ks.apply(this,arguments);return t.type=t.type||"confirm",Gs(t)}function Qs(){var t=Ks.apply(this,arguments);return t.type=t.type||"alert",Xs(t)}function tn(t,i,e,s){switch((t=function n(t,i,e,s){return"object"!=M(t)&&(t={text:t,type:i,expire:e,id:s}),t.id=t.id||ui("message"),t.expire=t.expire||en.expire,t}.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return qs(t);case"confirm":return Gs(t);case"modalbox":return Xs(t);case"prompt":return Js(t);default:return function h(t){en.area||(en.area=document.createElement("DIV"),en.area.className="webix_message_area",en.area.style[en.position]="5px",document.body.appendChild(en.area)),en.area.setAttribute("role","alert"),en.area.setAttribute("aria-atomic",!0),en.hide(t.id);var i=document.createElement("DIV");return i.innerHTML="<div>"+t.text+"</div>",i.className="webix_message webix_"+t.type,i.onclick=function(){t&&en.hide(t.id),t=null},"bottom"==en.position&&en.area.firstChild?en.area.insertBefore(i,en.area.firstChild):en.area.appendChild(i),0<t.expire&&(en.timers[t.id]=window.setTimeout(function(){en.hide(t.id)},t.expire)),i.style.height=i.offsetHeight-2+"px",en.pull[t.id]=i,i=null,t.id}(t)}}Zt(document,"keydown",Ls,{capture:!0}),Qs.pull={},Qs.order=[],Qs.hide=function(t){if(t&&Qs.pull[t]){var i=Qs.pull[t].ll;i&&(i.parentNode.removeChild(i),Qs.order.splice(Qs.order.indexOf(t),1),Os(!1,Qs.pull[t].container),delete Qs.pull[t])}},Qs.hideAll=function(){for(var t in Qs.pull)this.hide(t)};var en=tn;en.expire=4e3,en.keyboard=!0,en.position="top",en.pull={},en.timers={},en.hideAll=function(){for(var t in en.pull)en.hide(t)},en.hide=function(t){var i=en.pull[t];i&&i.parentNode&&(window.setTimeout(function(){i.parentNode.removeChild(i),i=null},2e3),i.style.height=0,i.className+=" hidden",en.area.removeAttribute("role"),en.timers[t]&&window.clearTimeout(en.timers[t]),delete en.pull[t])},t("message",tn);window.atob&&new Date>new Date(2020,10,10)&&setTimeout(function(){tn({type:"error",expire:-1,text:atob("VGhpcyBhcHAgdXNlcyBhIHRyaWFsIHZlcnNpb24gb2YgV2ViaXggVUkuIFRoZSB0cmlhbCBwZXJpb2QgaGFzIGV4cGlyZWQuIDxicj4gSWYgeW91ciB3YW50IHRvIGNvbnRpbnVlIHVzaW5nIFdlYml4IFVJLCBwbGVhc2UgdXBncmFkZSB0byBDb21tZXJjaWFsIG9yIEdQTCBlZGl0aW9uLg==")})},Math.floor(5e3*Math.random())+1e3),q.isIE8&&(Object.defineProperty=function(t,i,e){t[i]=e.value});var sn={startOnMonday:!1,toFixed:function(t,i){return t<10&&(t="0"+t),i&&t<100&&(t="0"+t),t},weekStart:function(t){var i=(t=this.copy(t)).getDay();return this.startOnMonday&&(0===i?i=6:i--),this.datePart(this.add(t,-1*i,"day"))},monthStart:function(t){return(t=this.copy(t)
).setDate(1),this.datePart(t)},yearStart:function(t){return(t=this.copy(t)).setMonth(0),this.monthStart(t)},dayStart:function(t){return this.datePart(t,!0)},dateToStr:function(h,e){if("function"==typeof h)return h;if(q.strict)return function(i){if(!i)return"";i.getMonth||(i=I.parseFormatDate(i));var s="",n=0;return h.replace(/%[a-zA-Z]/g,function(e,t){s+=h.slice(n,t);s+=function(t){if("%d"==e)return sn.toFixed(t.getDate());if("%m"==e)return sn.toFixed(t.getMonth()+1);if("%j"==e)return t.getDate();if("%n"==e)return t.getMonth()+1;if("%y"==e)return sn.toFixed(t.getFullYear()%100);if("%Y"==e)return t.getFullYear();if("%D"==e)return I.calendar.dayShort[t.getDay()];if("%l"==e)return I.calendar.dayFull[t.getDay()];if("%M"==e)return I.calendar.monthShort[t.getMonth()];if("%F"==e)return I.calendar.monthFull[t.getMonth()];if("%h"==e)return sn.toFixed((t.getHours()+11)%12+1);if("%g"==e)return(t.getHours()+11)%12+1;if("%G"==e)return t.getHours();if("%H"==e)return sn.toFixed(t.getHours());if("%i"==e)return sn.toFixed(t.getMinutes());if("%a"==e)return 11<t.getHours()?I.pm[0]:I.am[0];if("%A"==e)return 11<t.getHours()?I.pm[1]:I.am[1];if("%s"==e)return sn.toFixed(t.getSeconds());if("%S"==e)return sn.toFixed(t.getMilliseconds(),!0);if("%W"==e)return sn.toFixed(Date.getISOWeek(t));if("%c"!=e)return e;var i=t.getFullYear();return i+="-"+sn.toFixed(t.getMonth()+1),i+="-"+sn.toFixed(t.getDate()),i+="T",i+=sn.toFixed(t.getHours()),i+=":"+sn.toFixed(t.getMinutes()),i+=":"+sn.toFixed(t.getSeconds())}(i),n=t+2}),s+=h.slice(n,h.length)};h=h.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+wDate.toFixed(date.getDate())+"';case"%m":return'"+wDate.toFixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+wDate.toFixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+i18n.calendar.dayShort[date.getDay()]+"';case"%l":return'"+i18n.calendar.dayFull[date.getDay()]+"';case"%M":return'"+i18n.calendar.monthShort[date.getMonth()]+"';case"%F":return'"+i18n.calendar.monthFull[date.getMonth()]+"';case"%h":return'"+wDate.toFixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+wDate.toFixed(date.getHours())+"';case"%i":return'"+wDate.toFixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?i18n.pm[0]:i18n.am[0])+"';case"%A":return'"+(date.getHours()>11?i18n.pm[1]:i18n.am[1])+"';case"%s":return'"+wDate.toFixed(date.getSeconds())+"';case"%S":return'"+wDate.toFixed(date.getMilliseconds(), true)+"';case"%W":return'"+wDate.toFixed(wDate.getISOWeek(date))+"';case"%c":var i='"+date.getFullYear()+"';return i+='-"+wDate.toFixed((date.getMonth()+1))+"',i+='-"+wDate.toFixed(date.getDate())+"',i+="T",i+='"+wDate.toFixed(date.getHours())+"',i+=':"+wDate.toFixed(date.getMinutes())+"',i+=':"+wDate.toFixed(date.getSeconds())+"',!0===e&&(i+="Z"),i;default:return t}}),!0===e&&(h=h.replace(/date\.get/g,"date.getUTC"));var i=new Function("date","i18n","wDate","if (!date) return ''; if (!date.getMonth) date=i18n.parseFormatDate(date);  return \""+h+'";');return function(t){return i(t,I,sn)}},strToDate:function(t,h){if("function"==typeof t)return t;var r,i,e,o=t.match(/%[a-zA-Z]/g),s="var temp=date.split(/[\\s\\./\\-\\:\\,]+/g); if(!temp.join('')){return ''}";if(!I.calendar.monthShort_hash){for(e=I.calendar.monthShort,i=I.calendar.monthShort_hash={},r=0;r<e.length;r++)i[e[r]]=r;for(e=I.calendar.monthFull,i=I.calendar.monthFull_hash={},r=0;r<e.length;r++)i[e[r]]=r}if(q.strict)return function(t){if(!t)return"";if("object"==M(t))return t;var i=t.split(/[\s./\-:,]+/g);if(!i.join(""))return"";var e=[0,0,1,0,0,0,0];for(r=0;r<o.length;r++){var s=o[r];if("%y"==s)e[0]=1*i[r]+(30<i[r]?1900:2e3);else if("%Y"==s)e[0]=1*(i[r]||0),e[0]<30&&(e[0]+=2e3);else if("%n"==s||"%m"==s)e[1]=(i[r]||1)-1;else if("%M"==s)e[1]=I.calendar.monthShort_hash[i[r]]||0;else if("%F"==s)e[1]=I.calendar.monthFull_hash[i[r]]||0;else if("%j"==s||"%d"==s)e[2]=i[r]||1;else if("%g"==s||"%G"==s||"%h"==s||"%H"==s
)e[3]=i[r]||0;else if("%a"==s)e[3]=e[3]%12+((i[r]||"")==I.am[0]?0:12);else if("%A"==s)e[3]=e[3]%12+((i[r]||"")==I.am[1]?0:12);else if("%i"==s)e[4]=i[r]||0;else if("%s"==s)e[5]=i[r]||0;else if("%S"==s)e[6]=i[r]||0;else if("%c"==s){var n=/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(\+.*|)/g.exec(t);e[0]=1*(n[1]||0),e[0]<30&&(e[0]+=2e3),e[1]=(n[2]||1)-1,e[2]=n[3]||1,e[3]=n[4]||0,e[4]=n[5]||0,e[5]=n[6]||0}}return h?new Date(Date.UTC(e[0],e[1],e[2],e[3],e[4],e[5],e[6])):new Date(e[0],e[1],e[2],e[3],e[4],e[5],e[6])};for(r=0;r<o.length;r++)switch(o[r]){case"%j":case"%d":s+="set[2]=temp["+r+"]||1;";break;case"%n":case"%m":s+="set[1]=(temp["+r+"]||1)-1;";break;case"%y":s+="set[0]=temp["+r+"]*1+(temp["+r+"]>30?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":s+="set[3]=temp["+r+"]||0;";break;case"%i":s+="set[4]=temp["+r+"]||0;";break;case"%Y":s+="set[0]=(temp["+r+"]||0)*1; if (set[0]<30) set[0]+=2000;";break;case"%a":s+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[0]?0:12);";break;case"%A":s+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[1]?0:12);";break;case"%s":s+="set[5]=temp["+r+"]||0;";break;case"%S":s+="set[6]=temp["+r+"]||0;";break;case"%M":s+="set[1]=i18n.calendar.monthShort_hash[temp["+r+"]]||0;";break;case"%F":s+="set[1]=i18n.calendar.monthFull_hash[temp["+r+"]]||0;";break;case"%c":s+="var res = date.split('T');",s+="if(res[0]){ var d = res[0].split('-');",s+="set[0]= (d[0]||0)*1; if (set[0]<30) set[0]+=2000;",s+="set[1]= (d[1]||1)-1;",s+="set[2]= d[2]||1;}",s+="if(res[1]){ var t = res[1].split(':');",s+="set[3]= t[0]||0;",s+="set[4]= t[1]||0;",s+="set[5]= parseInt(t[2])||0;}"}var n="set[0],set[1],set[2],set[3],set[4],set[5],set[6]";h&&(n=" Date.UTC("+n+")");var a=new Function("date","i18n","if (!date) return ''; if (typeof date == 'object') return date; var set=[0,0,1,0,0,0,0]; "+s+" return new Date("+n+");");return function(t){return a(t,I)}},getISOWeek:function(t){if(!t)return!1;var i=t.getDay();0===i&&(i=7);var e=new Date(t.valueOf());e.setDate(t.getDate()+(4-i));var s=e.getFullYear(),n=Math.floor((e.getTime()-new Date(s,0,1).getTime())/864e5);return 1+Math.floor(n/7)},getUTCISOWeek:function(t){return this.getISOWeek(t)},dl:function(t,i,e,s){if(e){var n=s(t,i);if(n)for(var h=0<e?1:-1;n;)t.setHours(t.getHours()+h),n=s(t,i),h+=0<e?1:-1}},add:function(t,i,e,s){s&&(t=this.copy(t));var n=sn.copy(t);switch(e){case"day":t.setDate(t.getDate()+i),this.dl(t,n,i,function(t,i){return sn.datePart(i,!0).valueOf()==sn.datePart(t,!0).valueOf()});break;case"week":t.setDate(t.getDate()+7*i),this.dl(t,n,7*i,function(t,i){return sn.datePart(i,!0).valueOf()==sn.datePart(t,!0).valueOf()});break;case"month":t.setMonth(t.getMonth()+i),this.dl(t,n,i,function(t,i){return i.getMonth()==t.getMonth()&&i.getYear()==t.getYear()});break;case"year":t.setYear(t.getFullYear()+i),this.dl(t,n,i,function(t,i){return i.getFullYear()==t.getFullYear()});break;case"hour":t.setHours(t.getHours()+i),this.dl(t,n,i,function(t,i){return i.getHours()==t.getHours()&&Date.datePart(i,!0)==Date.datePart(t,!0)});break;case"minute":t.setMinutes(t.getMinutes()+i);break;default:sn.add[e](t,i,e)}return t},datePart:function(t,i){i&&(t=this.copy(t));var e=this.copy(t);return e.setHours(0),e.getDate()!=t.getDate()?t.setHours(1):t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},timePart:function(t,i){return i&&(t=this.copy(t)),(t.valueOf()/1e3-60*t.getTimezoneOffset())%86400},copy:function(t){return new Date(t.valueOf())},equal:function(t,i){return!(!t||!i)&&t.valueOf()===i.valueOf()},isHoliday:function(t){if(0===(t=t.getDay())||6==t)return"webix_cal_event"}},nn={getConfig:function(t){var i={decimalSize:0,groupSize:999,prefix:"",sufix:""},e=t.split(/[0-9].*[0-9]/g);e[0].length&&(i.prefix=e[0]),e[1].length&&(i.sufix=e[1]),(i.prefix||i.sufix)&&(t=t.substr(i.prefix.length,t.length-i.prefix.length-i.sufix.length));var s=t.indexOf("1");0<s&&(i.prefix=t.substr(0,s),t=t.substr(s));var n=t.indexOf("0");0<n&&(i.decimalSize=t.length-n,i.decimalDelimiter=t[n-1],t=t.substr(0,n-1));var h=t.match(/[^0-9]/);return h&&(i.groupSize=t.length-h.index-1,i.groupDelimiter=t[h.index]),i},
parse:function(t,i){if(!t||"string"!=typeof t)return t;i.prefix&&(t=t.toLowerCase().replace(i.prefix.toLowerCase()||"","")),i.sufix&&(t=t.toLowerCase().replace(i.sufix.toLowerCase()||"",""));var e="";if(i.decimalDelimiter){var s=t.indexOf(i.decimalDelimiter);-1<s&&(e=(e=t.substr(s+1).replace(/[^0-9]/g,"")).substr(0,Math.min(e.length,i.decimalSize)),t=t.substr(0,s))}var n="-"===t[0]?-1:1;return(t=t.replace(/[^0-9]/g,""))||(t="0"),e&&(t+="."+e),parseFloat(t)*n},format:function(t,i){if(""===t||void 0===t)return t;i=i||I;var e=(t=parseFloat(t))<0?"-":"";t=Math.abs(t),i.decimalOptional||(t=t.toFixed(i.decimalSize));var s=t.toString();s=s.split(".");var n="";if(i.groupSize){var h=i.groupSize,r=s[0].length;do{n=(0<(r-=h)?s[0].substr(r,h):s[0].substr(0,h+r))+(n?i.groupDelimiter+n:"")}while(0<r)}else n=s[0];return s=i.decimalSize?e+n+(s[1]?i.decimalDelimiter+s[1]:""):e+n,i.prefix||i.sufix?i.prefix+s+i.sufix:s},numToStr:function(i){return function(t){return nn.format(t,i)}}};var hn=["fullDateFormat","timeFormat","dateFormat","longDateFormat","parseFormat","parseTimeFormat"];I.setLocale=function(t){"string"==typeof t&&(t=I.locales[t]),t&&(t.priceSettings=_(t.priceSettings||t),function r(t,i){for(var e in i)"object"!=M(i[e])||$(i[e])?t[e]=i[e]:(t[e]||(t[e]={}),r(t[e],i[e]))}(I,t),delete I.calendar.monthShort_hash,delete I.calendar.monthFull_hash);for(var i=0;i<hn.length;i++){var e=hn[i],s=I[e+"UTC"];I[e+"Str"]=sn.dateToStr(I[e],s),I[e+"Date"]=sn.strToDate(I[e],s)}var n=Yt(I.price),h=I.priceSettings||I;I.intFormat=nn.numToStr({groupSize:I.groupSize,groupDelimiter:I.groupDelimiter,decimalSize:0}),I.priceFormat=function(t){return n(nn.format(t,h))},I.numberFormat=nn.format},I.locales={"en-US":{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%m/%d/%Y",timeFormat:"%h:%i %A",longDateFormat:"%d %F %Y",fullDateFormat:"%m/%d/%Y %h:%i %A",am:["am","AM"],pm:["pm","PM"],price:"${obj}",priceSettings:{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2},fileSize:["b","Kb","Mb","Gb","Tb","Pb","Eb"],calendar:{monthFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],hours:"Hours",minutes:"Minutes",done:"Done",clear:"Clear",today:"Today"},dataExport:{page:"Page",of:"of"},PDFviewer:{of:"of",automaticZoom:"Automatic Zoom",actualSize:"Actual Size",pageFit:"Page Fit",pageWidth:"Page Width",pageHeight:"Page Height",enterPassword:"Enter password",passwordError:"Wrong password"},aria:{calendar:"Calendar",increaseValue:"Increase value",decreaseValue:"Decrease value",navMonth:["Previous month","Next month"],navYear:["Previous year","Next year"],navDecade:["Previous decade","Next decade"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Hours: %h %A",minuteFormat:"Minutes: %i",removeItem:"Remove item",pages:["First page","Previous page","Next page","Last page"],page:"Page",headermenu:"Header menu",openGroup:"Open column group",closeGroup:"Close column group",closeTab:"Close tab",showTabs:"Show more tabs",resetTreeMap:"Reset tree map",navTreeMap:"Level up",nextTab:"Next tab",prevTab:"Previous tab",multitextSection:"Add section",multitextextraSection:"Remove section",showChart:"Show chart",hideChart:"Hide chart",resizeChart:"Resize chart"},richtext:{underline:"Underline",bold:"Bold",italic:"Italic"},combo:{select:"Select",selectAll:"Select all",unselectAll:"Unselect all"},message:{ok:"OK",cancel:"Cancel"},comments:{send:"Send",confirmMessage:"The comment will be removed. Are you sure?",edit:"Edit",remove:"Remove",placeholder:"Type here..",moreComments:"More comments"},filter:{less:"less",lessOrEqual:"less or equal",greater:"greater",greaterOrEqual:"greater or equal",contains:"contains",notContains:"not contains",equal:"equal",notEqual:"not equal",beginsWith:"begins with",notBeginsWith:"not begins with",
endsWith:"ends with",notEndsWith:"not ends with",between:"between",notBetween:"not between"},timeboard:{seconds:"Seconds"}}},I.setLocale("en-US");var rn={prefix:function(e,s){return e+=".",{put:function(t,i){return s.put(e+t,i)},get:function(t){return s.get(e+t)},remove:function(t){return s.remove(e+t)}}}};rn.local={put:function(t,i){t&&window.JSON&&window.localStorage&&window.localStorage.setItem(t,c(i))},get:function(t){if(t&&window.JSON&&window.localStorage){var i=window.localStorage.getItem(t);return i?zt.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.localStorage&&window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}},rn.session={put:function(t,i){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.setItem(t,c(i))},get:function(t){if(t&&window.JSON&&window.sessionStorage){var i=window.sessionStorage.getItem(t);return i?zt.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.removeItem(t)},clear:function(){window.sessionStorage.clear()}},rn.cookie={put:function(t,i,e,s){t&&window.JSON&&(document.cookie=t+"="+escape(c(i))+(s&&s instanceof Date?";expires="+s.toUTCString():"")+(e?";domain="+e:"")+(q.https?";secure":""))},getRaw:function(t){for(var i=document.cookie.split(";"),e="",s="",n=0;n<i.length;n++){if((e=i[n].split("="))[0].replace(/^\s+|\s+$/g,"")==t)return!0,1<e.length&&(s=unescape(e[1].replace(/^\s+|\s+$/g,""))),s;e=null,""}return null},get:function(t){if(t&&window.JSON){var i=this.getRaw(t);return i?zt.json.toObject(unescape(i)):null}return null},remove:function(t,i){t&&this.getRaw(t)&&(document.cookie=t+"="+(i?";domain="+i:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT")},clear:function(t){for(var i=document.cookie.split(";"),e=0;e<i.length;e++)document.cookie=/^[^=]+/.exec(i[e])[0]+"="+(t?";domain="+t:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}},q.printPPI=96,q.printMargin=.75*q.printPPI;var on={a4:"A4",a3:"A3",letter:"letter"},an={page:!0,data:!0},un={portrait:!0,landscape:!0},cn={A3:{width:11.7,height:16.5},A4:{width:8.27,height:11.7},letter:{width:8.5,height:11}};function fn(t,i){var e=ft("div",{"class":"webix_view webix_print_"+t.toLowerCase(),style:"height:0px;visibility:hidden;"},i["doc"+t]);"Header"===t?vt(e,document.body.firstChild):document.body.appendChild(e),i["doc"+t]=e}var ln={number:{greater:function(t,i){return i<t},less:function(t,i){return t<i},greaterOrEqual:function(t,i){return i<=t},lessOrEqual:function(t,i){return t<=i},equal:function(t,i){return t==i},notEqual:function(t,i){return t!=i},contains:function(t,i){return-1!==t.toString().toLowerCase().indexOf(i.toString().toLowerCase())},notContains:function(t,i){return-1===t.toString().toLowerCase().indexOf(i.toString().toLowerCase())}},text:{equal:function(t,i){return t.toLowerCase()===i.toLowerCase()},notEqual:function(t,i){return t.toLowerCase()!==i.toLowerCase()},contains:function(t,i){return-1!==t.toLowerCase().indexOf(i.toLowerCase())},notContains:function(t,i){return-1===t.toLowerCase().indexOf(i.toLowerCase())},beginsWith:function(t,i){return 0===t.toLowerCase().lastIndexOf(i.toLowerCase(),0)},notBeginsWith:function(t,i){return 0!==t.toLowerCase().lastIndexOf(i.toLowerCase(),0)},endsWith:function(t,i){return-1!==t.toLowerCase().indexOf(i.toLowerCase(),t.length-i.length)},notEndsWith:function(t,i){return-1===t.toLowerCase().indexOf(i.toLowerCase(),t.length-i.length)}},date:{greater:function(t,i){return i<t},less:function(t,i){return t<i},greaterOrEqual:function(t,i){return i<=t},lessOrEqual:function(t,i){return t<=i},equal:function(t,i){return!(!t||!i)&&t.valueOf()===i.valueOf()},notEqual:function(t,i){return!t||!i||t.valueOf()!==i.valueOf()},between:function(t,i){return(!i.start||t>i.start)&&(!i.end||t<i.end)},notBetween:function(t,i){return!i.start||t<=i.start||!i.end||t>=i.end}}},dn={phone:{mask:"+# (###) ###-####",allow:/[0-9]/g},card:{mask:"#### #### #### ####",allow:/[0-9]/g},date:{mask:"####-##-## ##:##",allow:/[0-9]/g}},vn={denySelect:ht,allowSelect:rt,index:ot,createCss:at,addStyle:ut,
removeStyle:ct,create:ft,getValue:lt,remove:dt,insertBefore:vt,locate:_t,offset:pt,posRelative:bt,pos:mt,preventEvent:gt,stopEvent:wt,triggerEvent:xt,addCss:yt,removeCss:Mt,getTextSize:St,download:kt,vl:Ct,setSelectionRange:$t,getSelectionRange:Dt,addMeta:It},_n="__webix_remote_error";function pn(t,i){this._l={},this.pl=[],this.bl=t,this.lu="",i?this.ml(i):this.gl=B(t).then(function(t){return t.text()}).then(S(function(t){return t=t.split("/*api*/")[1],this.ml(JSON.parse(t)),this._l},this))}function bn(t,i){var e=new pn(t,i).wl();for(var s in e)mn[s]=e[s];return e}pn.prototype={ml:function(t){if(t.$key&&(this.lu=t.$key),t.$vars)for(var i in t.$vars)this._l[i]=t.$vars[i];this.X(t,this._l,"")},X:function(t,i,e){for(var s in t)if("$key"!==s&&"$vars"!==s){var n=t[s];if("object"==M(n)){var h=i[s]={};this.X(n,h,e+s+".")}else i[s]=this.xl(this,e+s)}},yl:function(t,i){var e=this.Ml(this,t,i);return this.pl.push(e),this.Sl(),e},Sl:function(){this.kl||(this.kl=setTimeout(S(this.Cl,this),1))},Cl:function(){for(var t=[],h=this.pl,i=0;i<this.pl.length;i++){var e=this.pl[i];e.$sync?(h.splice(i,1),i--):t.push({name:e.$name,args:e.$args})}if(h.length){var s=B(),n=this.$l(t);y("onBeforeRemoteCall",[s,n,{}]);var r=s.post(this.bl,n).then(function(t){for(var i=t.json().data,e=0;e<i.length;e++){var s=i[e],n=i[e]&&i[e][_n];n?(y("onRemoteError",[n]),h[e].reject(n)):h[e].resolve(s)}},function(t){for(var i=0;i<h.length;i++)h[i].reject(t);throw t});y("onAfterRemoteCall",[r])}this.pl=[],this.kl=null},$:function(){var t=null;this.$sync=!0;var i=[{name:this.$name,args:this.$args}];try{var e=B(),s=this.$context.$l(i);y("onBeforeRemoteCall",[e,s,{sync:!0}]);var n=e.sync().post(this.$context.bl,s);y("onAfterRemoteCall",[null]),(t=JSON.parse(n.responseText).data[0])[_n]&&(t=null)}catch(Ro){}return t},Ml:function(t,i,e){var s=b.defer();return s.sync=t.$,s.$name=i,s.$args=e,s.$context=this,s},xl:function(t,i){return function(){return t.yl(i,[].slice.call(arguments))}},wl:function(){return this.gl||this._l},$l:function(t){return{key:this.lu,payload:t}}};var mn=function(t,i){if("object"!==M(t))return bn(t,i);var e=document.getElementsByTagName("script");return i=t,bn(t=e[e.length-1].src,i)};function gn(){var t=!!(window.orientation%180);ii.orientation!==t&&(ii.orientation=t,y("onRotate",[t]))}q.touch&&(ii.orientation=!!((R(window.orientation)?90:window.orientation)%180),Zt(window,"onorientationchange"in window?"orientationchange":"resize",gn));var wn={textWaitDelay:500,summColumn:{getValue:function(t){return t.innerText},setValue:function(){},refresh:function(t,i,e){var s=0;t.mapCells(null,e.columnId,null,1,function(t){t*=1,isNaN(t)||(s+=t)},!0),e.format&&(s=e.format(s)),e.template&&(s=e.template({value:s})),i.innerHTML=s},trackCells:!0,render:function(t,i){return i.template&&(i.template=Yt(i.template)),""}},masterCheckbox:{getValue:function(){},setValue:function(){},getHelper:function(t,i){return{check:function(){i.checked=!1,t.onclick()},uncheck:function(){i.checked=!0,t.onclick()},isChecked:function(){return i.checked}}},refresh:function(e,t,s){t.onclick=function(){this.getElementsByTagName("input")[0].checked=s.checked=!s.checked;var t=e.getColumnConfig(s.columnId),i=s.checked?t.checkValue:t.uncheckValue;e.data.each(function(t){t[s.columnId]=i,e.callEvent("onCheck",[t.id,s.columnId,i]),this.callEvent("onStoreUpdated",[t.id,t,"save"])}),e.refresh()}},render:function(t,i){return"<input type='checkbox' "+(i.checked?"checked='1'":"")+">"}},textFilter:{getInputNode:function(t){return t.querySelector("input")||{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(t,i,e){i.component=t.P.id,t.registerFilter(i,e,this),i.Dl=t.P.id,e.value&&this.getValue(i)!=e.value&&this.setValue(i,e.value),i.onclick=gt,Kt(i,"keydown",this.Il)},render:function(t,i){return this.init&&this.init(i),i.css=(i.css||"")+" webix_ss_filter","<input "+(i.placeholder?'placeholder="'+i.placeholder+'" ':"")+"type='text'>"},Il:function(t){var i=this.Dl;9!=(t.which||t.keyCode)&&(this.Al&&window.clearTimeout(
this.Al),this.Al=window.setTimeout(function(){var t=oi(i);t&&t.filterByAll()},wn.textWaitDelay))}},selectFilter:{getInputNode:function(t){return t.querySelector("select")||{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(t,i,e){e.compare=e.compare||function(t,i){return t==i},i.component=t.P.id,t.registerFilter(i,e,this);var s=wn.Fl(t,e);!1!==e.emptyOption&&s.unshift({id:"",value:e.emptyOption||""});for(var n=document.createElement("select"),h=0;h<s.length;h++){var r=document.createElement("option");r.value=s[h].id,r.text=s[h].value,n.add(r)}i.innerHTML="",i.appendChild(n),e.value&&this.setValue(i,e.value),i.onclick=gt,n.Dl=t.P.id,Kt(n,"change",this.Tl)},render:function(t,i){return this.init&&this.init(i),i.css=(i.css||"")+" webix_ss_filter",""},Tl:function(){oi(this.Dl).filterByAll()}},Fl:function(t,i){var e=i.options;return e?t.Vl.call(e,"id","value"):t.collectValues(i.columnId,i.collect)}};wn.serverFilter=H.extend({$server:!0,Il:function(t){var i=this.Dl,e=t.which||t.keyCode;9==e||33<=e&&e<=40||(this.Al&&window.clearTimeout(this.Al),this.Al=window.setTimeout(function(){oi(i).filterByAll()},wn.textWaitDelay))}},wn.textFilter),wn.serverSelectFilter=H.extend({$server:!0,Tl:function(){oi(this.Dl).filterByAll()}},wn.selectFilter),wn.numberFilter=H.extend({init:function(h){h.prepare=function(t){var e,s=this,i=-1!=t.indexOf("="),n=this.format(t);return""===n?"":(-1!=t.indexOf(">")?e=this.zl:-1!=t.indexOf("<")&&(e=this.Bl),h.compare=e&&i?function(t,i){return s.Hl(t,i)||e(t,i)}:e||this.Hl,n)}},format:function(t){return t.replace(/[^\-.0-9]/g,"")},zl:function(t,i){return i<1*t},Bl:function(t,i){return""!==t&&1*t<i},Hl:function(t,i){return""!==t&&1*t==i}},wn.textFilter),wn.dateFilter=H.extend({format:function(t){if(""===t)return"";var i=new Date;if(-1!=t.indexOf("today"))i=sn.dayStart(i);else if(-1==t.indexOf("now")){var e=t.match(/[0-9]+/g);if(!e||!e.length)return"";i=e.length<3?(e.reverse(),new Date(e[0],(e[1]||1)-1,1)):I.dateFormatDate(t.replace(/^[>< =]+/,""))}return i.valueOf()}},wn.numberFilter);var xn={name:"baselayout",restore:function(t,i,e){var s=this.Rl(_(t),i);if(e)return s;si(s.cols||s.rows,this)},Rl:function(t,i){if(!t.$layout)return i.call(this,t);for(var e=t.cols||t.rows,s=0;s<e.length;s++)e[s]=this.Rl(e[s],i);return t},serialize:function(t){for(var i=[],e=this.getChildViews(),s=0;s<e.length;s++){var n=e[s];if(n.movePortlet){var h=n.getChildViews();i.push(t.call(this,h[h.length-1]))}else n.serialize?i.push(n.serialize(t,!0)):i.push(t.call(this,n))}var r={$layout:!0,type:this.config.type};return this.config.rows?r.rows=i:r.cols=i,r},$init:function(t){this.$ready.push(this.El),this.tt=this.Wi,this.Pl=[],this.jl=[],this.qa={top:0,left:0,right:0,bottom:0},t.$topView&&(t.borderless=!0,t.Dt={top:!0,left:!0,bottom:!0,right:!0}),t.isolate&&H.extend(this,Fe)},rows_setter:function(t){return this.Nl=1,this.Ll=t,!0},cols_setter:function(t){return this.Nl=0,this.$view.style.whiteSpace="nowrap",this.Ll=t,!0},Tt:function(t){var i=x.find.call(this.ri,t);this.Ol&&this.Ol(i),x.removeAt.call(this.ri,i),this.Wl(!0)},Wl:function(t){for(var i=this.Ul=0;i<this.ri.length;i++){var e=this.ri[i];(e.P.hidden||e.$nospace)&&this.Ul++}t&&this.resizeChildren(!0)},Ft:function(t,i){if(R(i)){for(var e=0;e<this.ri.length;e++)this.ri[e].destructor();this.Ll=t,this.El()}else{var s;"number"==typeof i?((i<0||i>this.ri.length)&&(i=this.ri.length),x.insertAt.call(this.ri,t,i),t.P.hidden||this.Yl(t,this.ri[i])):(s=oi(i),i=x.find.call(this.ri,s),t.P.hidden||this.Yl(t,s),s.destructor(),this.ri[i]=t),this.Nl||this.Wa(t)}this.Wl(!0);var n=this.elements?this:this.getFormView();n&&!this.ql&&n.oe(),y("onReconstruct",[this])},Wa:function(t){t.Vt.style.display="inline-block",t.Vt.style.verticalAlign="top"},addView:function(t,i){R(i)&&(i=this.ri.length);var e=this.$$?this:this.getTopParentView();ii.bt=this;var s=e&&e.ui?e.ui(t,this,i):si(t,this,i);return ii.bt=null,s.P.id},removeView:function(t){var i;i="object"!=M(t)?oi(t)||(this.$$?this.$$(t):null):t;var e=x.find.call(
this.ri,i);if(0<=e){this.Ol&&this.Ol(e,i);var s=this.elements?this:this.getFormView();this.ri.splice(e,1),s&&vi(i,function(t){t.name&&delete s.getCleanValues()[t.config.name]},s,!0),i.destructor(),this.Wl(!0),s&&s.oe()}y("onReconstruct",[this])},reconstruct:function(){this.Ul=0,this.Ft(this.Ll)},Bi:function(t,i,e){t.P.hidden||(t.P.hidden=!0,dt(t.Vt),this.Ul++,e||ii.gt||this.resizeChildren(!0))},Se:function(t){t.callEvent&&t.callEvent("onViewShow",[])},resizeChildren:function(){if(!ii.pt&&this.Pl){var t=this.getParentView();if(t)return t.resizeChildren?t.resizeChildren():t.resize();var i,e,s,n,h=this.$getSize(0,0);if(s=i=this.Pl[0]||0,n=e=this.Pl[1]||0,(1e5<=h[1]||1e5<=h[3])&&this.Vt.parentNode&&(s=i=Math.max(h[0],this.P.width||this.Vt.parentNode.offsetWidth||i||0),n=e=Math.max(h[2],this.P.height||this.Vt.parentNode.offsetHeight||e||0)),t)this.Ga(i,e);else{h[0]>i&&(s=h[0]),h[2]>e&&(n=h[2]);var r=this.Vt.parentNode==document.body&&!this.setPosition;!r&&i>h[1]&&(s=h[1]),!r&&e>h[3]&&(n=h[3]),this.$setSize(s,n)}ii.vt&&(ii.vt=!1,this.resizeChildren()),y("onResize",[])}},getChildViews:function(){return this.ri},index:function(t){t.P&&(t=t.P.id);for(var i=0;i<this.ri.length;i++)if(this.ri[i].P.id==t)return i;return-1},Yl:function(t,i){if(i)if(i.P.hidden||t===i){for(var e=this.index(i)+1;this.ri[e]&&this.ri[e].P.hidden;)e++;i=this.ri[e]?this.ri[e].Vt:null}else i=i.Vt;vt(t.Vt,i,this.tt||this.Vt)},ye:function(t,i,e){t.P.hidden&&(this.Yl(t,t),t.P.hidden=!1,this.Ul--,e||(this.resizeChildren(!0),t.refresh&&t.refresh()),t.callEvent&&(t.callEvent("onViewShow",[]),vi(t,this.Se)))},showBatch:function(t,i){var e=void 0!==i;if(i=!1!==i,e)this.P.visibleBatch="";else{if(this.P.visibleBatch==t)return;this.P.visibleBatch=t}for(var s=[],n=0;n<this.ri.length;n++)this.ri[n].P.batch||this.ri[n].P.hidden?this.ri[n].P.batch==t?i?s.push(this.ri[n]):this.Bi(this.ri[n],null,!0):e||this.Bi(this.ri[n],null,!0):s.push(this.ri[n]);for(var h=0;h<s.length;h++)this.ye(s[h],null,!0),s[h].Me();this.resizeChildren(!0)},El:function(t){this.ri=[],this.name;for(var i=0;i<t.length;i++)ii.bt=this,t[i].Dt||(t[i].borderless=!0),this.ri[i]=si.Ht(t[i],this),this.Nl||this.Wa(this.ri[i]),this.P.visibleBatch&&this.P.visibleBatch!=this.ri[i].P.batch&&this.ri[i].P.batch&&(this.ri[i].P.hidden=!0),this.ri[i].P.hidden||(this.tt||this.Wi).appendChild(this.ri[i].Vt);this.Wl(),this.Gl&&this.Gl(t)},Xl:function(t,i){i.top&&(t.borderTopWidth="0px"),i.left&&(t.borderLeftWidth="0px"),i.right&&(t.borderRightWidth="0px"),i.bottom&&(t.borderBottomWidth="0px")},Jl:function(t,i,e){if(this.Nl!=e)for(var s=0;s<this.ri.length;s++)this.ri[s].P[t]=i,this.ri[s].Jl&&this.ri[s].Jl(t,i,e)},$getSize:function(t,i){var e=0,s=1e5,n=1e5,h=0;this.Nl?n=0:s=0;var r=0,o=0,a=0;this.ei=[];for(var u=0;u<this.ri.length;u++)if(!this.ri[u].P.hidden){var c=this.ei[u]=this.ri[u].$getSize(0,0);this.ri[u].$nospace?o++:this.Nl?(c[0]>e&&(e=c[0]),c[1]<s&&(s=c[1]),h+=c[2],n+=c[3],c[2]==c[3]&&-1!=c[2]?(r+=c[2],o++):a+=c[4]):(c[2]>h&&(h=c[2]),c[3]<n&&(n=c[3]),e+=c[0],s+=c[1],c[0]==c[1]&&-1!=c[0]?(r+=c[0],o++):a+=c[4])}n<h&&(n=h),s<e&&(s=e),this.Kl=[r,this.ri.length-o,a],this.Zl=[e+t,h+i];var f=Vi.api.$getSize.call(this,0,0);return 1e5<=f[1]&&(f[1]=0),1e5<=f[3]&&(f[3]=0),f[0]=(f[0]||e)+t,f[1]=Math.max(f[0],(f[1]||s)+t),f[2]=(f[2]||h)+i,f[3]=Math.max(f[2],(f[3]||n)+i),!this.Nl&&this.P.responsive&&(f[0]=0),f},$setSize:function(t,i){this.Pl=[t,i],Vi.api.$setSize.call(this,t,i),this.Ga(t,i)},Ql:function(t,i,e){var s=i=t[i];if(i!=(e=t[e])){var n=this.ed*t[4]/this.sd;if(n<i)s=i,this.sd-=t[4],this.ed-=s;else{if(!(e<n))return-1;s=e,this.sd-=t[4],this.ed-=s}}return s},nd:function(t,i){var e=oi(i);"hide"!==e&&e?(e||(e=si({view:"popup",body:[{}]})),t.hd=t.P.width,t.rd=t.P.height,t.od=e.P.id,t.P.width=0,t.P.height||(t.P.autoheight=!0),si(t,e,this.jl.length)):(t.hide(),t.od="hide"),this.jl.push(t)},ad:function(t){var i=t.od;if(t.od=0,"hide"!==i&&i){t.P.width=t.hd,t.P.height=t.rd,delete t.P.autoheight;for(var e=0;this.ri[e]&&!1===this.ri[e].P.responsiveCell;)e++;si(t,this,e)}else t.show();this.jl.pop()},ud:function(t){if(ii._t=!0,
t+this.qa.left+this.qa.right+this.Xa*(this.ri.length-1)<this.Zl[0])for(var i=this.ri.length-1,e=0;e<i;e++){var s=this.ri[e];if(!s.od){if(!1!==s.P.responsiveCell){this.nd(s,this.P.responsive),y("onResponsiveHide",[s.P.id]),ii.vt=!0;break}i=this.ri.length}}else if(this.jl.length){var n=this.jl[this.jl.length-1],h="hide"==n.od?0:n.hd;n.$getSize(h,0)[0]+this.Zl[0]+this.Xa+20<=t&&(this.ad(n),y("onResponsiveShow",[n.P.id]),ii.vt=!0)}ii._t=!1},Ga:function(t,i){ii.dt=(ii.dt||0)+1,!this.Nl&&this.P.responsive&&this.ud(t,i),this.ed=(this.Nl?i:t)-this.Kl[0],this.sd=this.Kl[2];for(var e=t,s=i,n=[],h=0;h<this.ri.length;h++)if(!this.ri[h].P.hidden&&this.ei[h]){var r=this.ei[h];if(this.Nl){if((s=this.Ql(r,2,3))<0){n.push({oldIndex:h,view:this.ri[h]});continue}}else if((e=this.Ql(r,0,1))<0){n.push({oldIndex:h,view:this.ri[h]});continue}this.ri[h].$setSize(e,s)}for(var o=0;o<n.length;o++){var a=n[o].oldIndex,u=this.ei[a],c=Math.round(this.ed*u[4]/this.sd);this.ed-=c,this.sd-=u[4],this.Nl?s=c:e=c,n[o].view.$setSize(e,s)}ii.dt-=1},cd:function(t,i){var e=this.index(t);return-1==e?null:this.ri[e+i]},fd:function(){return this.ri[0]}},yn={api:xn,view:H.protoUI(xn,g,Vi.view)},Mn={name:"layout",$init:function(){this.Ul=0},defaults:{type:"line"},El:function(){this.ld&&(t=this.ld(t)),this.dd||(this.Vt.className+=" webix_layout_"+(this.P.type||""),this.dd=1),this.P.margin!==undefined&&(this.Xa=this.P.margin),this.P.padding!==undefined&&"object"!==M(this.P.padding)&&(this.qa.left=this.qa.right=this.qa.top=this.qa.bottom=this.P.padding),this.P.paddingX!==undefined&&(this.qa.left=this.qa.right=this.P.paddingX),this.P.paddingY!==undefined&&(this.qa.top=this.qa.bottom=this.P.paddingY),"object"===M(this.P.padding)&&H.extend(this.qa,this.P.padding,!0),(this.qa.left||this.qa.right||this.qa.top||this.qa.bottom)&&(this.qa.defined=!0),this.vd()&&!this.P.borderless&&(this.Wi.style.borderWidth="1px",this._d=!0);var t=this.Ll;this.P.borderless&&(this.P.Dt={top:!0,left:!0,right:!0,bottom:!0}),this.Ua(t),yn.api.El.call(this,t),this.Ya(t)},$getSize:function(t,i){t=t||0,i=i||0;var e=this.Xa*(this.ri.length-this.Ul-1);if(this._d||this.vd()){var s=this.P.Dt;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1))}return this.P.height||(i+=this.qa.top+this.qa.bottom+(this.Nl?e:0)),this.P.width||(t+=this.qa.left+this.qa.right+(this.Nl?0:e)),yn.api.$getSize.call(this,t,i)},$setSize:function(t,i){this.Pl=[t,i],this.vd()||this._d?Hi.api.$setSize.call(this,t,i):Vi.api.$setSize.call(this,t,i),i=this.we,t=this.me,this.P.scroll&&(i=Math.max(i,this.Zl[1]),t=Math.max(t,this.Zl[0])),this.Ga(t,i)},Ga:function(t,i){var e=this.Xa*(this.ri.length-this.Ul-1);return i-=this.qa.top+this.qa.bottom,t-=this.qa.left+this.qa.right,this.Nl?i-=e:t-=e,yn.api.Ga.call(this,t,i)},resizeChildren:function(t){if(t){this.be=null;for(var i=[],e=0;e<this.ri.length;e++){var s=this.ri[e];i[e]=s.P;var n=s.Pl&&!s._d||s.P.borderless?"0px":"1px";s.Vt.style.borderTopWidth=s.Vt.style.borderBottomWidth=s.Vt.style.borderLeftWidth=s.Vt.style.borderRightWidth=n}this.Ua(i);for(var h=0;h<i.length;h++)i[h].borderless&&this.ri[h].hi&&this.ri[h].hi(i[h]);this.Ya(this.ri)}ii._t||yn.api.resizeChildren.call(this)},vd:function(){return this.qa.defined&&0<this.Xa&&!this.pd},Ua:function(t){if(!this.vd()||this.P.borderless&&"space"!=this.P.type){for(var i=0;i<t.length;i++)t[i].Dt=l(this.P.Dt);var e=!1;this.pd&&(e=!0);var s=t.length;if(this.Nl){for(var n=1;n<s-1;n++)t[n].Dt.top=t[n].Dt.bottom=e;if(1<s){for("head"!=this.P.type&&(t[0].Dt.bottom=e);t[s-1].hidden&&1<s;)s--;0<s&&(t[s-1].Dt.top=e)}}else{for(var h=1;h<s-1;h++)t[h].Dt.left=t[h].Dt.right=e;if(1<s){for("head"!=this.P.type&&(t[0].Dt.right=e),t[s-1].Dt.left=e;1<s&&t[s-1].hidden;)s--;0<s&&(t[s-1].Dt.left=e)}}}else for(var r=0;r<t.length;r++)t[r].Dt&&t[r].borderless||(t[r].Dt={top:!1,left:!1,right:!1,bottom:!1})},Ya:function(t){for(var i=0,e=0;e<t.length;e++){var s=this.ri[e],n=s.P.Dt;if(s.P.hidden&&this.ri[e+1]){var h=this.ri[e+1].P.Dt;n.top||(h.top=!1),n.left||(h.left=!1),e==i&&i++}this.Xl(s.Vt.style,s.P.Dt)}for(var r=this.Nl?"marginLeft":"marginTop",
o=this.Nl?"marginTop":"marginLeft",a=this.Nl?this.qa.left:this.qa.top,u=this.Nl?this.qa.top:this.qa.left,c=0;c<t.length;c++)this.ri[c].Vt.style[r]=a+"px";this.ri.length&&(this.ri[i].Vt.style[o]=u+"px");for(var f=i+1;f<t.length;f++)this.ri[f].Vt.style[o]=this.Xa+"px"},type_setter:function(t){return this.Xa="undefined"!=typeof this.bd[t]?this.bd[t]:this.bd.line,this.qa.left=this.qa.right=this.qa.top=this.qa.bottom="undefined"!=typeof this.bd[t]?this.md[t]:this.md.line,this.pd="material"==t||"clean"==t,"material"==t&&(this.P.borderless=!0),t},$skin:function(){this.bd=Li.layoutMargin,this.md=Li.layoutPadding}},Sn=H.protoUI(Mn,yn.view),kn={api:Mn,view:Sn};Sn.call(-1);var Cn={name:"daterange",defaults:{button:!1,icons:!1,calendarCount:2,borderless:!1},$init:function(t){t.calendar=t.calendar||{},t.value=this.$prepareValue(t.value),delete t.calendar.type,this.Vt.className+=" webix_daterange",this.gd=this.wd[t.calendar.type]||0;for(var i=[],e=Li.calendar,s=e&&e.height?e.height:0,n=e&&e.width?e.width:0,h=s||250,r=n||250,o=H.extend({view:"calendar",width:n,height:s},t.calendar||{},!0),a=t.calendarCount=0===this.gd&&t.calendarCount||this.defaults.calendarCount,u=(o.css?o.css+" ":"")+"webix_range_",c=t.value.start||new Date,f=0;f<a;f++){var l=sn.copy(c);l.setDate(1),l=sn.add(l,this.xd[this.gd]*f,"month"),H.extend(o,{events:S(this.yd,this),css:u+(1===a?"":0===f?"0":f+1==a?"N":"1"),monthSelect:0===f||f+1===a,timepicker:0===this.gd&&t.timepicker,borderless:!0,date:l},!0),i.push(_(o))}t.rows=[{type:"clean",cols:i}],(t.button||t.icons)&&t.rows.push(this.Md(t,r*a)),t.height=R(t.height)?h+(t.icons||t.button?30:0):t.height,t.width=R(t.width)?r*a:t.width,t.type="line",this.$ready.push(this.Sd),Kt(this.$view,"keydown",S(function(t){this.ke(t.which||t.keyCode,t)},this))},value_setter:function(t){return this.$prepareValue(t)},getValue:function(){return this.P.value},setValue:function(t,i){t=this.$prepareValue(t);var e=(this.P.value=t).start||t.end||new Date;if(!i){this.kd[0].showCalendar(t.start);for(var s=1;s<this.kd.length;s++)this.kd[s].P.date=e,this.Cd(this.kd[s],1,s)}this.callEvent("onChange",[t]),this.refresh()},refresh:function(){for(var t=0;t<this.kd.length;t++)if(this.kd[t].gd===this.gd){Mt(this.kd[t].$view,"webix_cal_timepicker"),Mt(this.kd[t].$view,"webix_range_timepicker");var i=this.$d(this.kd[t].getVisibleDate());if(i.start||i.end){if(this.kd[t].P.date=i.start||i.end,this.P.timepicker){var e="webix_"+(i.start&&i.end?"range":"cal")+"_timepicker";yt(this.kd[t].$view,e)}}else sn.datePart(this.kd[t].P.date);this.kd[t].refresh()}},addToRange:function(t){var i=this.Dd(this.Id(t));this.setValue(i)},Ad:[{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+I.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date;this.P.timepicker||(t=sn.datePart(t)),this.addToRange(t),this.callEvent("onTodaySet",[this.getValue()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+I.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue(""),this.callEvent("onDateClear",[])}}}],Fd:function(t){if(t){t="object"==M(t)?t:this.Ad;for(var i={css:"webix_cal_footer ",borderless:!0,template:"<div class='webix_cal_icons'>",onClick:{}},e=0;e<t.length;e++){if(t[e].template){var s="function"==typeof t[e].template?t[e].template:Yt(t[e].template);i.template+=s.call(this)}if(t[e].on_click)for(var n in t[e].on_click)i.onClick[n]=S(t[e].on_click[n],this)}return i.template+="</div>",i.width=St(i.template).width+30,i}return{width:0}},Md:function(t,i){var e={view:"button",value:I.calendar.done,minWidth:100,maxWidth:230,align:"center",click:function(){this.getParentView().getParentView().hide()}},s=this.Fd(t.icons),n={css:"webix_range_footer",height:30,cols:[{width:s.width}]};return(t.button||t.icons)&&2*s.width+e.minWidth>i&&(n.cols[0].width=0),n.cols.push(t.button?e:{}),n.cols.push(s),n},wd:{time:-1,month:1,year:2},xd:{0:1,1:12,2:120},$prepareValue:function(t){return t||(t={start:null,end:null}),t.start||t.end||(
t={start:t}),t.end=this.Id(t.end)||null,t.start=this.Id(t.start)||null,(t.end&&t.end<t.start||!t.start)&&(t.end=[t.start,t.start=t.end][0]),t},Id:function(t){return"string"==typeof t&&(t=I.parseFormatDate(t)),isNaN(1*t)?null:t},yd:function(t,i){if(!i){var e=this.P.value,s=e.start?sn.datePart(sn.copy(e.start)):null,n=e.end?sn.datePart(sn.copy(e.end)):null,h=sn.datePart(t),r=sn.add(h,1,"day",!0),o=sn.add(h,-1,"day",!0),a="";return s<=h&&n&&h<=n&&(a="webix_cal_range",sn.equal(o,s)&&(a+=" webix_cal_range_first"),sn.equal(r,n)&&(a+=" webix_cal_range_last")),sn.equal(h,s)&&(a="webix_cal_range_start"),sn.equal(h,n)&&(a="webix_cal_range_end"),a+" "+(sn.isHoliday(t)+" "||"")}},Sd:function(){var t=this.kd=this.getChildViews()[0].getChildViews(),e=this,i=this.config.id;this.Td={};for(var s=0;s<t.length;s++)t[s].config.master=i,t[this.Td[t[s].config.id]=s].attachEvent("onBeforeDateSelect",function(t){return e.Vd(this,t)}),t[s].attachEvent("onBeforeZoom",function(t){return e.zd(this,t)}),0!==s&&s!==t.length-1||(t[s].attachEvent("onAfterMonthChange",S(this.Bd,this)),t[s].attachEvent("onAfterZoom",function(t,i){e.Hd(this,t,i)}));this.P.timepicker&&this.refresh()},zd:function(t,i){var e=this.Rd(t.config.id);if(0<=i&&0<e&&e!==this.kd.length-1)return!1;if(-1===i){var s=this.$d(t.getVisibleDate());s.start&&s.end&&(t.P.date=s[this.Ed])}return!0},Bd:function(t,i){var e=i<t?1:-1,s=i<t?this.kd[this.kd.length-1]:this.kd[0],n=s.jd[s.gd].Pd;this.Nd(e,n,s),this.refresh()},Hd:function(t,i,e){var s=t.jd[t.gd].Pd,n=this.Rd(t.config.id),h=0===n?1:-1;if(this.kd[n+h]){var r=this.kd[n+h].P.date;if(i<e&&0<=i){var o=0;if(1===i){var a=r.getFullYear();(this.gd||-1===h&&11===r.getMonth()||1===h&&0===r.getMonth())&&(a-=h),o=t.P.date.getFullYear()-a}else if(0===i){var u=r.getMonth()-h;12!==u&&-1!=u||(u=-1===u?11:0),o=t.P.date.getMonth()-u}this.Nd(o,s,t),this.refresh()}}},Cd:function(t,i,e){t.blockEvent(),0<=t.gd&&t.Ld(i,e),t.unblockEvent()},Rd:function(t){return this.Td[t]},Nd:function(t,i,e){for(var s=0;s<this.kd.length;s++){var n=this.kd[s];e&&n.config.id===e.config.id||this.Cd(n,t,i)}},$d:function(t){var i=this.P.value,e={};return i.start&&i.start.getYear()===t.getYear()&&i.start.getMonth()===t.getMonth()&&(e.start=i.start),i.end&&i.end.getYear()===t.getYear()&&i.end.getMonth()===t.getMonth()&&(e.end=i.end),e},Od:function(t,i){t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds()),t.setMilliseconds(i.getMilliseconds())},Dd:function(t,i){var e=_(this.P.value);0===this.gd||R(i)?e.start&&!e.end?e.end=t:(e.start=t,e.end=null):e[i?"end":"start"]=t;return e},Vd:function(t,i){if(this.callEvent("onBeforeDateSelect",[i])){var e=this.P.value;if(t.gd<0){var s,n=_(this.$d(i));(s=n.start&&n.end?n[this.Ed]:n.start||n.end)&&this.Od(s,i),t.gd=0,e=H.extend(_(e),n,!0)}else{var h=t.getVisibleDate(),r=this.Rd(t.config.id);if(i.getMonth()!==h.getMonth()&&(0===r||r===this.kd.length-1)){var o=h<i?1:-1;this.Nd(o,1)}e=this.Dd(i,r)}t.gd!==this.gd&&t.showCalendar(i),this.setValue(e,!0),this.callEvent("onAfterDateSelect",[this.getValue()])}return!1}},$n={api:Cn,view:H.protoUI(Cn,kn.view)};wn.excelFilter={getValue:function(t){var i=this.Wd(t);if(i)return i.getValue()},setValue:function(t,i){var e=this.Wd(t);e&&(i=i||{},e.setValue(i),this.Ud(i,t))},$icon:!0,refresh:function(t,i,e){var s=this;if(!t.$destructed){(e.node=i).$webix=e.filter,t.registerFilter(i,e,this);var n=oi(e.filter),h=n.getBody(),r=this.Fl(t,e);h.clearAll(),h.parse(r),e.value?this.setValue(i,e.value):e.compare=function(){return!0},i.onclick=function(t){-1===t.target.className.indexOf("webix_excel_filter")||n.isVisible()||n.show(s.Yd(i,n))}}},render:function(t,n){var i=this;if(!n.filter){n.template&&(n.template=Yt(n.template));var e=si({view:"popup",body:H.extend(n.filterConfig||{},{view:"filter",mode:n.mode,field:"value",template:function(t,i){var e=t.value;return e!==undefined&&null!==e||(e=""),n.format&&(e=n.format(e)),n.template&&(e=n.template(t,i,e)),e}},!0)}),h=e.getBody();h.attachEvent("onChange",function(){var s=h.getFilterFunction();n.compare=function(t,i,e){return s({
value:e[n.columnId]})},t.filterByAll(),n.value&&i.Ud(n.value,n.node)}),t.attachEvent("onScrollX",function(){return e.hide()}),n.originText=n.text||"",n.filter=e.P.id,t.Bt.push(e)}return n.css=(n.css||"")+" webix_ss_excel_filter","<span class='webix_excel_filter webix_icon wxi-filter'></span>"+n.originText},Yd:function(t,i){var e=pt(t);return{x:e.x+e.width-i.$width,y:e.y+e.height}},Ud:function(t,i){t.includes||t.condition&&t.condition.filter?yt(i,"webix_ss_filter_active",!0):Mt(i,"webix_ss_filter_active")},Wd:function(t){var i=oi(t.$webix);return i?i.getBody():null},Fl:function(t,i){return i.options?t.Vl.call(i.options,"id","value"):t.collectValues(i.columnId,i.collect)}},wn.serverExcelFilter=H.extend({$server:!0},wn.excelFilter),wn.richSelectFilter={getInputNode:function(t){return oi(t.$webix)||null},getValue:function(t,i){var e=this.getInputNode(t);return i&&e&&e.getText?e.getText():e?e.getValue():""},setValue:function(t,i){var e=this.getInputNode(t);return e?e.setValue(i):""},compare:function(t,i){return t==i},refresh:function(t,i,e){if(!t.$destructed){var s=oi(e.richselect);if(!s.$view.parentNode)ft("div",{"class":"webix_richfilter"}).appendChild(s.$view);i.$webix=e.richselect,e.compare=e.compare||this.compare,e.prepare=e.prepare||this.prepare,t.registerFilter(i,e,this);var n=wn.Fl(t,e),h=s.getPopup().getList();if(i.appendChild(s.$view.parentNode),h.parse&&(h.clearAll(),h.parse(n),!this.$noEmptyOption&&!1!==e.emptyOption||e.emptyOption)){var r={id:"$webix_empty",value:e.emptyOption||"",$empty:!0};h.add(r,0)}s.render(),e.value&&this.setValue(i,e.value),k(s.resize,s)}},render:function(t,i){if(!i.richselect){var e={container:ft("div",{"class":"webix_richfilter"}),view:this.inputtype,options:[]},s=H.extend(this.inputConfig||{},i.inputConfig||{},!0);H.extend(e,s),i.separator&&(e.separator=i.separator),i.suggest&&(e.suggest=i.suggest);var n=si(e);n.attachEvent("onChange",function(){t.filterByAll()}),i.richselect=n.P.id,t.Bt.push(n)}return i.css=(i.css||"")+" webix_div_filter"," "},inputtype:"richselect"},wn.serverRichSelectFilter=H.extend({$server:!0},wn.richSelectFilter),wn.multiSelectFilter=H.extend({$noEmptyOption:!0,inputtype:"multiselect",prepare:function(t,i){if(!t)return t;for(var e={},s=t.toString().split(i.separator||","),n=0;n<s.length;n++)e[s[n]]=1;return e},compare:function(t,i){return!i||i[t]}},wn.richSelectFilter),wn.serverMultiSelectFilter=H.extend({$server:!0,Tl:function(){oi(this.Dl).filterByAll()}},wn.multiSelectFilter),wn.multiComboFilter=H.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},wn.multiSelectFilter),wn.serverMultiComboFilter=H.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},wn.serverMultiSelectFilter),wn.datepickerFilter=H.extend({prepare:function(t){return t||""},compare:function(t,i){return 1*t==1*i},inputtype:"datepicker"},wn.richSelectFilter),wn.columnGroup={getValue:function(t){return t.innerHTML},setValue:function(){},getHelper:function(t,i){return{open:function(){i.closed=!0,t.onclick()},close:function(){i.closed=!1,t.onclick()},isOpened:function(){return i.closed}}},refresh:function(e,t,s){t.onclick=function(t){wt(t);var i=this.firstChild;s.closed?(s.closed=!1,i.className="webix_tree_open"):(s.closed=!0,i.className="webix_tree_close"),k(function(){e.callEvent("onColumnGroupCollapse",[s.columnId,s.batch,!s.closed]),e.showColumnBatch(s.batch,!s.closed)})},s.firstRun||(s.firstRun=1,s.closed&&e.showColumnBatch(s.batch,!1))},render:function(t,i){return"<div role='button' tabindex='0' aria-label='"+I.aria[i.closed?"openGroup":"closeGroup"]+"' class='"+(i.closed?"webix_tree_close":"webix_tree_open")+"'></div>"+(i.groupText||"")}},wn.dateRangeFilter=H.extend({prepare:function(t){return t.start||t.end?$n.api.$prepareValue(t):""},compare:function(t,i){return(!i.start||t>=i.start)&&(!i.end||t<=i.end)},inputtype:"daterangepicker"},wn.richSelectFilter),wn.serverDateRangeFilter=H.extend({$server:!0},wn.dateRangeFilter),q.scrollSize=q.touch||q.$customScroll?0:17,pi(function(){var t=function s(){var t=ft("div");t.className="webix_skin_mark",
t.style.cssText="position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;min-height:100px;overflow-y:scroll;",document.body.appendChild(t);var i=t.offsetWidth-t.clientWidth,e={200:"flat",210:"compact",230:"contrast",240:"material",250:"mini"}[10*Math.floor(t.offsetHeight/10)];document.body.removeChild(t),e&&Wi(e);return q.$customScroll?0:i}();q.scrollSize=q.touch?0:t});var Dn=!1;t("_fixHeight",function Po(){Dn||(ut("html, body{ height:100%; }"),document.body.className+=" webix_full_screen",Yi.limit(!1),Dn=!0)}),si.animate=function jo(t,i,e){var s=oi(i);if(s){var n=e||{type:"slide",direction:"left"},h=s.Vt.cloneNode(!0),r=si(t,i);r.Vt.parentNode.appendChild(h);var o=Ni.formLine(r.Vt,h,n);return n.callback=function(){Ni.breakLine(o)},Ni(o,n),r}},si.animateView=function No(i,t,e){if(i=oi(i)){e=e||{type:"slide",direction:"left"};for(var s=function(t){var i=t.Vt,e=i.className,s=i.innerHTML;return"<div class='"+e+"' style='width:"+i.offsetWidth+"px;height:"+i.offsetHeight+"px;'>"+s+"</div>"},n=[],h=0;h<i.Vt.childNodes.length;h++){var r=i.Vt.childNodes[h],o=r.currentStyle?r.currentStyle.display:getComputedStyle(r,null).display;n.push(o||"")}var a=s(i);"function"==typeof t&&t.call(this);for(var u=s(i),c=i.Vt.insertBefore(ft("DIV",{"class":"webix_view_animate",style:"width:"+i.Vt.offsetWidth+"px;height:"+i.Vt.offsetHeight+"px;"},u+a),i.Vt.firstChild),f=1;f<i.Vt.childNodes.length;f++)i.Vt.childNodes[f].style.display="none";var l=Ni.formLine(c.childNodes[0],c.childNodes[1],e);return e.callback=function(){if(c){i.Vt.removeChild(c),c=null;for(var t=0;t<i.Vt.childNodes.length;t++)i.Vt.childNodes[t].style.display=n[t]}},Ni(l,e),i}},si.freeze=li,si.resize=di,si.zIndex=_i,si.datafilter=wn,si.fullScreen=function Lo(){if(q.touch){It("apple-mobile-web-app-capable","yes"),It("viewport","initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no"),q.isMac||ut("body.webix_full_screen{ overflow-y: auto; }");var t=function(){var t=window.innerWidth,i=window.innerHeight;i&&(document.body.style.height=i+"px",document.body.style.width=t+"px"),ii.pt=!1,di()},i=function(){ii.pt=!0,k(t,null,[],500)};A("onRotate",i),gn(),k(i)}};I.locales["de-DE"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%n.%Y",timeFormat:"%H:%i",longDateFormat:"%j. %F %Y",fullDateFormat:"%j. %F %Y %H:%i",am:null,pm:null,price:"{obj} €",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthShort:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayFull:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayShort:["So","Mo","Di","Mi","Do","Fr","Sa"],hours:"Stunden",minutes:"Minuten",done:"Fertig",clear:"Entfernen",today:"Heute"},dataExport:{page:"Seite",of:"von"},PDFviewer:{of:"von",automaticZoom:"Automatisch Zoom",actualSize:"Aktuelles Ausmaß",pageFit:"Seite Ausmaß",pageWidth:"Seite Breite",pageHeight:"Seite Höhe",enterPassword:"Passwort eingeben",passwordError:"Falsches passwort"},aria:{calendar:"Kalender",increaseValue:"Wert erhöhen",decreaseValue:"Wert verringern",navMonth:["Vorheriger Monat","Nächsten Monat"],navYear:["Vorheriges Jahr","Nächstes Jahr"],navDecade:["Zurück Jahrzehnt","Als nächstes Jahrzehnt"],dateFormat:"%j. %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Stunden: %H",minuteFormat:"Minuten: %i",removeItem:"Element entfernen",pages:["Erste Seite","Vorherige Seite","Folgeseite","Letzte Seite"],page:"Seite",headermenu:"Titelmenü",openGroup:"Öffnen Spaltengruppe ",closeGroup:"Schließen Spaltengruppe ",closeTab:"Tab schließen",showTabs:"Weitere Tabs",resetTreeMap:"Zurück zur ursprünglichen Ansicht",navTreeMap:"Aufleveln",nextTab:"Weiter tab",prevTab:"Zurück tab",multitextSection:"Element hinzufügen",multitextextraSection:"Element entfernen",showChart:"Chart anzeigen",hideChart:"Chart verstecken",resizeChart:"Chart Größe ändern"},richtext:{underline:"Unterstreichen",bold:"Fettgedruckt",italic:"Kursiv"
},combo:{select:"Auswählen",selectAll:"Alles auswählen",unselectAll:"Alles widerrufen"},message:{ok:"OK",cancel:"Abbrechen"},comments:{send:"Absenden",confirmMessage:"Der Kommentar wird entfernt. Sind Sie sicher?",edit:"Redigieren",remove:"Löschen",placeholder:"Geben Sie hier ein..",moreComments:"Mehr Kommentare"},filter:{less:"weniger",lessOrEqual:"weniger oder gleich",greater:"mehr",greaterOrEqual:"größer oder gleich",contains:"enthält",notContains:"nicht enthält",equal:"gleich",notEqual:"ungleich",beginsWith:"beginnt mit",notBeginsWith:"nicht beginnt mit",endsWith:"endet mit",notEndsWith:"nicht endet mit",between:"zwischen",notBetween:"nicht zwischen"},timeboard:{seconds:"Sekunden"}},I.locales["es-ES"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%n/%Y",timeFormat:"%G:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d %F %Y %G:%i",am:null,pm:null,price:"{obj} €",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayFull:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayShort:["dom","lun","mar","mié","jue","vie","sáb"],hours:"Horas",minutes:"Minutos",done:"Listo",clear:"Reinicio",today:"Hoy"},dataExport:{page:"Página",of:"de"},PDFviewer:{of:"de",automaticZoom:"Zoom automático",actualSize:"Tamaño real",pageFit:"Tamaño de página",pageWidth:"Ancho de página",pageHeight:"Altura de la página",enterPassword:"Introduzca la contraseña",passwordError:"Contraseña incorrecta"},aria:{calendar:"Сalendario",increaseValue:"Aumentar el valor",decreaseValue:"Disminuye el valor",navMonth:["Mes anterior","Próximo mes"],navYear:["Año anterior","Próximo año"],navDecade:["Década anterior","Próxima década"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Horas: %G",minuteFormat:"Minutos: %i",removeItem:"Retire el elemento",pages:["Primera página","Pagina anterior","Siguiente página","Última página"],page:"Página",headermenu:"Menú de títulos",openGroup:"Grupo de columnas abiertas",closeGroup:"Primer grupo de columnas",closeTab:"Cerrar tab",showTabs:"Mostrar más tabs",resetTreeMap:"Volver a la vista original",navTreeMap:"Elevar a mismo nivel",nextTab:"Siguiente tab",prevTab:"Tab anterior",multitextSection:"Añadir elemento",multitextextraSection:"Retire el elemento",showChart:"Espectáculo chart",hideChart:"Esconder chart",resizeChart:"Cambiar el tamaño el chart"},richtext:{underline:"Subrayar",bold:"Negrita",italic:"Itálico"},combo:{select:"Seleccionar",selectAll:"Seleccionar todo",unselectAll:"Deselecciona todo"},message:{ok:"OK",cancel:"Cancelar"},comments:{send:"Enviar",confirmMessage:"El comentario será eliminado. Estás seguro?",edit:"Corregir",remove:"Suprimir",placeholder:"Escriba aquí..",moreComments:"Más comentarios"},filter:{less:"menos",lessOrEqual:"menor o igual",greater:"mayor",greaterOrEqual:"mayor o igual",contains:"contiene",notContains:"not contiene",equal:"igual",notEqual:"no es igual",beginsWith:"comienza con",notBeginsWith:"no comienza con",endsWith:"termina con",notEndsWith:"no termina con",between:"entre",notBetween:"no entre"},timeboard:{seconds:"segundos"}},I.locales["fr-FR"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} €",priceSettings:null,calendar:{monthFull:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aôu","Sep","Oct","Nov","Déc"],dayFull:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],hours:"Heures",minutes:"Minutes",done:"Fini",clear:"Effacer",today:"Aujourd'hui"},dataExport:{page:"Page",of:"sur"},PDFviewer:{of:"sur",automaticZoom:"Zoom automatique",
actualSize:"Taille actuelle",pageFit:"Taille de la page",pageWidth:"Largeur de la page",pageHeight:"Hauteur de page",enterPassword:"Entrez le mot de passe",passwordError:"Mauvais mot de passe"},aria:{calendar:"Сalendrier",increaseValue:"Augmenter la valeur",decreaseValue:"Diminution de la valeur",navMonth:["Le mois précédent","Le mois prochain"],navYear:["Année précédente","L'année prochaine"],navDecade:["Décennie précédente","Suivant décennie"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Heures: %H",minuteFormat:"Minutes: %i",removeItem:"Retirer l'élément",pages:["Première page","Page précédente","Page suivante","Dernière page"],page:"Page",headermenu:"Menu de titre",openGroup:"Ouvrir groupe de colonnes ",closeGroup:"Fermer groupe de colonnes",closeTab:"Fermer tab",showTabs:"Montrer plus tabs",resetTreeMap:"Revenir à la vue originale",navTreeMap:"Niveau supérieur",nextTab:"Prochain tab",prevTab:"Précédent tab",multitextSection:"Ajouter l'élément",multitextextraSection:"Retirer l'élément",showChart:"Montrer chart",hideChart:"Cacher chart",resizeChart:"Redimensionner chart"},richtext:{underline:"Souligner",bold:"Gras",italic:"Italique"},combo:{select:"Sélectionner",selectAll:"Tout sélectionner",unselectAll:"Tout déselectionner"},message:{ok:"OK",cancel:"Annuler"},comments:{send:"Envoyer",confirmMessage:"Le commentaire sera supprimé. Êtes-vous sûr?",edit:"Modifier",remove:"Effacer",placeholder:"Écrivez ici..",moreComments:"Plus de commentaires"},filter:{less:"moins",lessOrEqual:"inférieur ou égal",greater:"plus grand",greaterOrEqual:"supérieur ou égal",contains:"contient",notContains:"ne contient",equal:"égal",notEqual:"pas égal",beginsWith:"commence par",notBeginsWith:"ne commence par",endsWith:"se termine par",notEndsWith:"pas se termine par",between:"entre",notBetween:"pas entre"},timeboard:{seconds:"secondes"}},I.locales["it-IT"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%H:%i",longDateFormat:"%j %F %Y",fullDateFormat:"%j %F %Y %H:%i",am:null,pm:null,price:"€ {obj}",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dayFull:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],dayShort:["dom","lun","mar","mer","gio","ven","sab"],hours:"Orario",minutes:"Minuti",done:"Pronto",clear:"Pulisci",today:"Oggi"},dataExport:{page:"Pagina",of:"di"},PDFviewer:{of:"di",automaticZoom:"Zoom automatico",actualSize:"Dimensione reale",pageFit:"Dimensioni della pagina",pageWidth:"Larghezza della pagina",pageHeight:"Altezza della pagina",enterPassword:"Inserisci la password",passwordError:"Password errata"},aria:{calendar:"Calendario",increaseValue:"Aumenta il valore",decreaseValue:"Riduci il valore",navMonth:["Il mese scorso","Il prossimo mese"],navYear:["L'anno scorso","L'anno prossimo"],navDecade:["Decennio precedente","Prossimo decennio"],dateFormat:"%j %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Orario: %H",minuteFormat:"Minuti: %i",removeItem:"Rimuovere l'elemento",pages:["Prima pagina","Pagina precedente","Pagina successiva","Ultima pagina"],page:"Pagina",headermenu:"Menu del titolo",openGroup:"Aperto gruppo di colonne",closeGroup:"Chiudi gruppo di colonne",closeTab:"Chiudi tab",showTabs:"Mostra più tabs",resetTreeMap:"Tornare alla vista originale",navTreeMap:"Livello superiore",nextTab:"Tab successivo",prevTab:"Tab precedente",multitextSection:"Aggiungi elemento",multitextextraSection:"Rimuovere l'elemento",showChart:"Mostrare grafico",hideChart:"Nascondere grafico",resizeChart:"Ridimensionare grafico"},richtext:{underline:"Sottolineare",bold:"Grassetto",italic:"Corsivo"},combo:{select:"Selezionare",selectAll:"Seleziona tutto",unselectAll:"Deseleziona tutto"},message:{ok:"OK",cancel:"Annullare"},comments:{send:"Inviare",
confirmMessage:"Il commento verrà rimosso. Sei sicuro?",edit:"Correggere",remove:"Elimina",placeholder:"Digitare qui..",moreComments:"Altri commenti"},filter:{less:"meno",lessOrEqual:"minore o uguale",greater:"maggiore",greaterOrEqual:"maggiore o uguale",contains:"contiene",notContains:"non contiene",equal:"uguale",notEqual:"non uguale",beginsWith:"inizia con",notBeginsWith:"non inizia con",endsWith:"finisce con",notEndsWith:"non termina con",between:"tra",notBetween:"non tra"},timeboard:{seconds:"secondi"}},I.locales["ja-JP"]={groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%Y.%m.%d",timeFormat:"%H:%i",longDateFormat:"%Y年%m月%d日",fullDateFormat:"%Y.%m.%d %H:%i",price:"¥{obj}",priceSettings:{groupSize:3,groupDelimiter:",",decimalDelimiter:"",decimalSize:0},calendar:{monthFull:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayFull:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayShort:["日","月","火","水","木","金","土"],hours:"営業時間",minutes:"分",done:"レディー",clear:"削除する",today:"今日"},dataExport:{page:"ページ",of:"から"},PDFviewer:{of:"から",automaticZoom:"自動ズーム",actualSize:"実サイズ",pageFit:"ページサイズ",pageWidth:"ページ幅",pageHeight:"ページの高さ",enterPassword:"パスワードを入力する",passwordError:"間違ったパスワード"},aria:{calendar:"カレンダー",increaseValue:"増加値",decreaseValue:"数字を小さく",navMonth:["前の月","来月"],navYear:["前年","来年"],navDecade:["前の十年","次の10年"],dateFormat:"%Y年%m月%d日",monthFormat:"%Y年%m月",yearFormat:"%Y年",hourFormat:"営業時間: %H",minuteFormat:"分: %i",removeItem:"要素を削除します",pages:["一ページ目","前のページ","次のページ","最後のページ"],page:"ページ",headermenu:"ヘッダメニュー",openGroup:"オープン列グループ",closeGroup:"閉じる列グループ",closeTab:"タブを閉じます",showTabs:"複数のタブを表示します",resetTreeMap:"元の表示に戻ります",navTreeMap:"レベルパック",nextTab:"次のタブ",prevTab:"前のタブ",multitextSection:"要素を追加します。",multitextextraSection:"要素を削除します",showChart:"靴チャート",hideChart:"隠すチャート",resizeChart:"グラフのサイズを変更"},richtext:{underline:"アンダーライン",bold:"大胆な",italic:"イタリック"},combo:{select:"選択する",selectAll:"すべて選択",unselectAll:"すべての選択を解除する"},message:{ok:"OK",cancel:"取り消す"},comments:{send:"送信",confirmMessage:"コメントは削除されます. 本気ですか？",edit:"編集",remove:"削除",placeholder:"ここに入力..",moreComments:"その他のコメント"},filter:{less:"レス",lessOrEqual:"以下",greater:"大きいです",greaterOrEqual:"以上",contains:"含まれています",notContains:"含まれていません",equal:"等しいです",notEqual:"等しくありません",beginsWith:"で始まります",notBeginsWith:"ないで始まります",endsWith:"で終わります",notEndsWith:"で終わりではありません",between:"間に",notBetween:"いない間"},timeboard:{seconds:"秒"}},I.locales["pt-BR"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%G:%i",longDateFormat:"%d de %F de %Y",fullDateFormat:"%d de %F de %Y %G:%i",am:null,pm:null,price:"R$ {obj}",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},fileSize:["b","Kb","Mb","Gb","Tb","Pb","Eb"],calendar:{monthFull:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayFull:["Domingo","Segunda-Feira","Terça-Feira","Quarta-Feira","Quinta-Feira","Sexta-Feira","Sábado"],dayShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],hours:"Horas",minutes:"Minutos",done:"Feito",clear:"Limpar",today:"Hoje"},dataExport:{page:"Página",of:"de"},PDFviewer:{of:"de",automaticZoom:"Zoom automático",actualSize:"Tamanho atual",pageFit:"Tamanho da página",pageWidth:"Largura da página",pageHeight:"Altura da página",enterPassword:"Digite a senha",passwordError:"Senha incorreta"},aria:{calendar:"Calendário",increaseValue:"Aumentar o valor",decreaseValue:"Diminuir o valor",navMonth:["Mês anterior","Próximo mês"],navYear:["Ano anterior","Próximo ano"],navDecade:["Década anterior","Próxima década"],dateFormat:"%d de %F de %Y",monthFormat:"%F de %Y",yearFormat:"%Y",hourFormat:"Horas: %G",minuteFormat:"Minutos: %i",removeItem:"Remover elemento",pages:["Primeira página","Página anterior","Próxima página","Última página"],page:"Página",headermenu:"Menu de títulos",openGroup:"Grupo coluna aberta",
closeGroup:"Fechar grupo de colunas",closeTab:"Fechar tab",showTabs:"Mostre mais tabs",resetTreeMap:"Мoltar à vista original",navTreeMap:"Upar",nextTab:"Próximo tab",prevTab:"Anterior tab",multitextSection:"Adicionar elemento",multitextextraSection:"Remover elemento",showChart:"Exposição chart",hideChart:"Esconder chart",resizeChart:"Redimensionar chart"},richtext:{underline:"Sublinhado",bold:"Negrito",italic:"itálico"},combo:{select:"Selecionar",selectAll:"Selecionar tudo",unselectAll:"Desmarque todos"},message:{ok:"OK",cancel:"Cancelar"},comments:{send:"Enviar",confirmMessage:"Comentário será removido. Você tem certeza?",edit:"Editar",remove:"Excluir",placeholder:"Digite aqui..",moreComments:"Mais comentários"},filter:{less:"menos",lessOrEqual:"menor ou igual",greater:"maior",greaterOrEqual:"maior ou igual",contains:"contém",notContains:"não contém",equal:"igual",notEqual:"não é igual",beginsWith:"começa com",notBeginsWith:"não começa com",endsWith:"termina com",notEndsWith:"não termina com",between:"entre",notBetween:"não entre"},timeboard:{seconds:"segundos"}},I.locales["zh-CN"]={groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%Y/%m/%j",timeFormat:"%G:%i",longDateFormat:"%Y'年'%m'月'%j'日'",fullDateFormat:"%Y'年'%m'月'%j'日' %G:%i",am:["上午","上午"],pm:["下午","下午"],price:"¥{obj}",priceSettings:{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2},calendar:{monthFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayShort:["周日","周一","周二","周三","周四","周五","周六"],hours:"小时",minutes:"分钟",done:"完成",clear:"清除",today:"今天"},dataExport:{page:"页",of:"从"},PDFviewer:{of:"从",automaticZoom:"自动设置页面大小",actualSize:"实际尺寸",pageFit:"页面大小",pageWidth:"页面宽度",pageHeight:"页面高度",enterPassword:"输入密码",passwordError:"密码错误"},aria:{calendar:"日历",increaseValue:"增加值",decreaseValue:"减少值",navMonth:["上个月","下个月"],navYear:["上年","明年"],navDecade:["过去十年","下个十年"],dateFormat:"%Y'年'%m'月'%j'日'",monthFormat:"%Y'年'%m'月",yearFormat:"%Y'年",hourFormat:"小时: %G",minuteFormat:"分钟: %i",removeItem:"删除元素",pages:["第一页","上一页","下一页","最后一页"],page:"页",headermenu:"标题菜单",openGroup:"打开栏目组",closeGroup:"关闭栏目组",closeTab:"关闭标签",showTabs:"显示更多选项卡",resetTreeMap:"回到原来的视图",navTreeMap:"升级",nextTab:"下一个标签",prevTab:"前一个标签",multitextSection:"加元",multitextextraSection:"删除元素",showChart:"显示图表",hideChart:"隐藏图表",resizeChart:"调整图"},richtext:{underline:"强调",bold:"粗體",italic:"斜体"},combo:{select:"选择",selectAll:"全选",unselectAll:"全部取消选择"},message:{ok:"好",cancel:"取消"},comments:{send:"发送",confirmMessage:"评论将被删除. 你确定吗?",edit:"编辑",remove:"去掉",placeholder:"在此输入..",moreComments:"更多评论"},filter:{less:"减",lessOrEqual:"少于或等于",greater:"更大",greaterOrEqual:"大于或等于",contains:"包含",notContains:"不包含",equal:"等于",notEqual:"不平等",beginsWith:"开始于",notBeginsWith:"不开始",endsWith:"结束",notEndsWith:"不是以",between:"之间",notBetween:"不在之间"},timeboard:{seconds:"秒"}},I.locales["ru-RU"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} руб.",priceSettings:null,calendar:{monthFull:["Январь","Февраль","Март","Апрель","Maй","Июнь","Июль","Август","Сентябрь","Oктябрь","Ноябрь","Декабрь"],monthShort:["Янв","Фев","Maр","Aпр","Maй","Июн","Июл","Aвг","Сен","Окт","Ноя","Дек"],dayFull:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],dayShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],hours:"Часы",minutes:"Минуты",done:"Гoтовo",clear:"Очистить",today:"Сегодня"},dataExport:{page:"Страница",of:"из"},PDFviewer:{of:"из",automaticZoom:"Автоматический зум",actualSize:"Настоящий размер",pageFit:"Размер страницы",pageWidth:"Ширина страницы",pageHeight:"Высота страницы",enterPassword:"Введите пароль",passwordError:"Неверный пароль"},aria:{calendar:"Календарь",increaseValue:"Увеличить значение",decreaseValue:"Уменьшить значение",navMonth:["Предыдущий месяц","Следующий месяц"],navYear:["Предыдущий год","Следующий год"],navDecade:[
"Предыдущие десять лет","Следующие десять лет"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Часы: %H",minuteFormat:"Минуты: %i",removeItem:"Удалить элемент",pages:["Первая страница","Предыдущая страница","Следующая страница","Последняя страница"],page:"Страница",headermenu:"Меню шапки таблицы",openGroup:"Развернуть группу столбцов",closeGroup:"Свернуть группу столбцов",closeTab:"Закрыть вкладку",showTabs:"Показать больше вкладок",resetTreeMap:"Вернуться к первоначальному представлению",navTreeMap:"Перейти на уровень выше",nextTab:"Следующая вкладка",prevTab:"Предыдущая вкладка",multitextSection:"Добавить элемент",multitextextraSection:"Удалить элемент",showChart:"Показать чарт",hideChart:"Спрятать чарт",resizeChart:"Изменить размер чарта"},richtext:{underline:"Подчеркивание",bold:"Жирный",italic:"Курсив"},combo:{select:"Выбрать",selectAll:"Выбрать все",unselectAll:"Сброс выбора"},message:{ok:"OK",cancel:"Отмена"},comments:{send:"Отправить",confirmMessage:"Комментарий будет удален. Вы уверены?",edit:"Редактировать",remove:"Удалить",placeholder:"Введите текст..",moreComments:"Больше комментариев"},filter:{less:"меньше",lessOrEqual:"меньше или равно",greater:"больше",greaterOrEqual:"больше или равно",contains:"содержит",notContains:"не содержит",equal:"равно",notEqual:"не равно",beginsWith:"начинается с",notBeginsWith:"не начинается с",endsWith:"заканчиватся",notEndsWith:"не заканчиватся",between:"между",notBetween:"не между"},timeboard:{seconds:"Секунды"}},I.locales["be-BY"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} руб.",priceSettings:{groupSize:3,groupDelimiter:" ",decimalDelimiter:"",decimalSize:0},calendar:{monthFull:["Студзень","Люты","Сакавік","Красавік","Травень","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"],monthShort:["Студз","Лют","Сак","Крас","Трав","Чэр","Ліп","Жнів","Вер","Каст","Ліст","Снеж"],dayFull:["Нядзеля","Панядзелак","Аўторак","Серада","Чацвер","Пятніца","Субота"],dayShort:["Нд","Пн","Аўт","Ср","Чцв","Пт","Сб"],hours:"Гадзіны",minutes:"Хвіліны",done:"Гатова",today:"Cёння",clear:"Ачысціць"},dataExport:{page:"Старонка",of:"з"},PDFviewer:{of:"з",automaticZoom:"Аўтаматычны зум",actualSize:"Сапраўдны памер",pageFit:"Памер старонкі",pageWidth:"Шырыня старонкі",pageHeight:"Вышыня старонкі",enterPassword:"Увядзіце пароль",passwordError:"Няправільны пароль"},aria:{calendar:"Каляндар",increaseValue:"Павялічыць значэнне",decreaseValue:"Паменшыць значэнне",navMonth:["Папярэдні месяц","Наступны месяц"],navYear:["Папярэдні год","Наступны год"],navDecade:["Папярэднія дзесяць год","Наступныя дзесяць год"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Hours: %h",minuteFormat:"Гадзіны: %i",removeItem:"Прыбраць элемент",pages:["Першая старонка","Папярэдняя старонка","Наступная старонка","Апошняя старонка"],page:"Старонка",headermenu:"Меню загалоўка",openGroup:"Адкрыць групу слупкоў",closeGroup:"Закрыць групу слупкоў",closeTab:"Закрыць укладку",showTabs:"Паказаць больш укладак",resetTreeMap:"Вярнуцца да першапачатковага выгляду",navTreeMap:"Падняцца на ўзровень вышэй",nextTab:"Наступная ўкладка",prevTab:"Папярэдняя ўкладка",multitextSection:"Дадаць элемент",multitextextraSection:"Прыбраць элемент",showChart:"Паказаць графік",hideChart:"Схаваць графік",resizeChart:"Змяніць памер графіка"},richtext:{underline:"Падкрэсліванне",bold:"Паўтлусты",italic:"Курсіў"},combo:{select:"Абраць",selectAll:"Абраць усё",unselectAll:"Ачысціць ўсе"},message:{ok:"ОК",cancel:"Адмена"},comments:{send:"Даслаць",confirmMessage:"Каментарый будзе выдалены. Вы ўпэўнены?",edit:"Рэдагаваць",remove:"Выдаліць",placeholder:"Пішыце тут..",moreComments:"Больш каментарыяў"},filter:{less:"менш",lessOrEqual:"менш або роўна",greater:"больш",greaterOrEqual:"больш або роўна",contains:"змяшчае",notContains:"не змяшчае",equal:"роўныя",notEqual:"не роўныя",beginsWith:"пачынаецца з",notBeginsWith:"не пачынаецца з",endsWith:"заканчваецца",
notEndsWith:"не сканчаецца",between:"паміж",notBetween:"не паміж"},timeboard:{seconds:"Секунды"}};H.protoUI({name:"spacer",defaults:{borderless:!0},$init:function(){this.Vt.className+=" webix_spacer"}},Hi.view);var In={name:"template",$init:function(t){var i=this.qd[t.type];i&&(i.css&&t.css&&(this.Vt.className+=" "+i.css),H.extend(t,i),t.borderless&&(delete t.Dt,this.hi(t))),this.tt==this.Vt?(this.tt=ft("DIV"),this.tt.className=" webix_template",this.Vt.appendChild(this.tt)):this.tt.className+=" webix_template",this.attachEvent("onAfterRender",this.Gd)},setValues:function(t,i){this.data=i?H.extend(this.data,t,!0):t,this.render()},getValues:function(){return this.data},$skin:function(){this.qd.header.height=Li.barHeight-2*Li.borderWidth,this.qd.section.height=Li.barHeight},qd:{header:{css:"webix_header"},section:{css:"webix_section",borderless:!0},clean:{css:"webix_clean",borderless:!0}},onClick_setter:function(t){return this.on_click=H.extend(this.on_click||{},t,!0),this.Nu||H.extend(this,ze),t},defaults:{template:Yt.empty},Xd:function(){this.Jd=!1,this.Kd(),this.resize()},Kd:function(){this.Jd||(this.Jd=!0,this.render())},src_setter:function(t){return this.Jd=!0,this.callEvent("onBeforeLoad",[])?(B(t,S(function(t){this.P.template=Yt(t),this.Xd(),this.callEvent("onAfterLoad",[])},this)),t):""},content_setter:function(t){t&&(this.Jd=!0,this.render=function(){},this.tt.appendChild(C(t)),this.Gd())},refresh:function(){this.render()},setHTML:function(t){this.P.template=function(){return t},this.refresh()},setContent:function(t){this.tt.innerHTML="",this.content_setter(t)},$setSize:function(t,i){if(Hi.api.$setSize.call(this,t,i)){if(this.Kd(),this.P.autoheight){var e=this.getTopParentView();clearTimeout(e.Zd),e.Zd=k(this.resize,this)}return!0}},$getSize:function(t,i){return!this.P.autoheight||this.P.type&&"clean"!=this.P.type||(this.P.height=this.Qd()),Hi.api.$getSize.call(this,t,i)},Gd:function(){this.P.autoheight&&(this.be=null,this.resize())},Qd:function(){var t,i=Li.layoutPadding.space;return this.Kd(),this.isVisible()?(this.tt.style.height="auto",t=this.tt.scrollHeight,this.tt.style.height=""):t=St(this.Q(this.data)||this.tt.innerHTML,"webix_template",(this.$width||(this.getParentView()?this.getParentView().$width:0))-i).height,t},yc:!0},An={api:In,view:H.protoUI(In,je,Pi,Ht,qt,g,Hi.view)},Fn={name:"scrollview",defaults:{scroll:"y",scrollSpeed:"300ms"},$init:function(){this.Vt.className+=" webix_scrollview"},body_setter:function(t){t.borderless=!0,(ii.bt=this).$t=si.Ht(t),this.tt.appendChild(this.$t.Vt)},getChildViews:function(){return[this.$t]},getBody:function(){return this.$t},resizeChildren:function(){this.$t&&(this.Zl=this.$t.$getSize(0,0),this.tv(),y("onResize",[]))},tv:function(){var t=Math.max(this.me,this.Zl[0]),i=Math.max(this.we,this.Zl[2]);if(this.$t.$setSize(t,i),q.touch){var e=this.getScrollState(),s=this.$t.we-this.we;s<e.y&&this.scrollTo(null,s)}ii.vt&&(ii.vt=!1,this.Zl=this.$t.$getSize(0,0),this.tv())},$getSize:function(t,i){var e=this.Zl=this.$t.$getSize(0,0),s=Hi.api.$getSize.call(this,t,i),n=this.iv||q.scrollSize;return"x"==this.P.scroll?(s[2]=Math.max(s[2],e[2])+n,s[3]=Math.min(s[3],e[3])+n):"y"==this.P.scroll&&(s[0]=Math.max(s[0],e[0])+n,s[1]=Math.min(s[1],e[1])+n),s},$setSize:function(t,i){var e=q.scrollSize;q.scrollSize=this.iv||e,(Hi.api.$setSize.call(this,t,i)||ii.Kt)&&this.tv(),q.scrollSize=e},scroll_setter:function(t){var i=q.$customScroll;return"string"==typeof t&&0===t.indexOf("native-")&&(this.iv=17,t=t.replace("native-",""),q.$customScroll=!1),t=je.scroll_setter.call(this,t),q.$customScroll=i,t},Ft:function(t){this.$t.destructor(),this.$t=t,this.tt.appendChild(this.$t.Vt),this.resizeChildren()},showView:function(t){var i=oi(t).$view.offsetTop-oi(t).$view.parentNode.offsetTop;this.scrollTo(0,i)}},Tn=(H.protoUI(Fn,je,g,Hi.view),H.protoUI({name:"iframe",$init:function(){this.tt=this.Wi,this.Wi.innerHTML="<iframe style='width:100%; height:100%' frameborder='0' onload='var t = $$(this.parentNode.getAttribute(\"view_id\")); if (t) t.callEvent(\"onAfterLoad\",[]);' src='about:blank'></iframe>"},
load:function(t){this.src_setter(t)},src_setter:function(t){return this.callEvent("onBeforeLoad",[])?this.getIframe().src=t:""},getIframe:function(){return this.Wi.getElementsByTagName("iframe")[0]},getWindow:function(){return this.getIframe().contentWindow}},Hi.view,g),{name:"accordion",defaults:{panelClass:"accordionitem",multi:!1,collapsed:!1},$init:function(){this.Vt.setAttribute("role","tablist"),this.Vt.setAttribute("aria-multiselectable","true")},Ft:function(t){kn.api.Ft.apply(this,arguments),t.collapsed_setter&&t.refresh&&t.refresh()},El:function(){for(var t=this.P.panelClass,i=this.Ll,e=0;e<i.length;e++)!i[e].body&&!i[e].header||i[e].view||i[e].align||(i[e].view=t),R(i[e].collapsed)&&(i[e].collapsed=this.P.collapsed);this.ev=!0,kn.api.El.call(this),this.ev=!1;for(var s=0;s<this.ri.length;s++)this.ri[s].name==t&&this.ri[s].refresh(),this.ri[s].sv=!1;for(var n=!1,h=this.ri.length-1;0<=h&&!n;h--)this.ri[h].P.hidden||(n=this.ri[h].sv=!0)},nv:function(t){if(!1===this.P.multi&&!0!==this.ev)for(var i=0;i<this.ri.length;i++)t!=this.ri[i]&&!this.ri[i].P.collapsed&&this.ri[i].collapse&&this.ri[i].collapse();t.callEvent&&(t.callEvent("onViewShow",[]),vi(t,this.Se))},hv:function(t){if(!0===this.P.multi||this.ev)return!0;for(var i=0;i<this.ri.length;i++)if(t!=this.ri[i]&&!this.ri[i].P.collapsed&&this.ri[i].isVisible()&&!this.ri[i].$nospace)return!0;return!1},$skin:function(){kn.api.$skin.call(this),Li.accordionType&&(this.defaults.type=Li.accordionType)}}),Vn={api:Tn,view:H.protoUI(Tn,kn.view)},zn=(H.protoUI({name:"headerlayout",defaults:{type:"accordion",multi:"mixed",collapsed:!1}},Vn.view),{name:"accordionitem",$init:function(t){this.Vt.innerHTML="<div tabindex='0' webix_ai_id='"+t.id+"'  class='webix_accordionitem_header'><div class='webix_accordionitem_button' ></div><div class='webix_accordionitem_label' ></div></div><div class='webix_accordionitem_body'></div>",this.Wi=this.Vt,this.vn=this.Wi.childNodes[0],t.header||(this.vn.style.display="none"),this.rv=this.Wi.childNodes[0].childNodes[1],this.ov=this.Wi.childNodes[0].childNodes[0],this.Fn=this.Wi.childNodes[1],this.Vt.className+=" webix_accordionitem",this.Tn=this.$t=null,this.ri=!0,this.Fn.setAttribute("role","tabpanel"),this.vn.setAttribute("role","tab"),this.attachEvent("onKeyPress",this.ke)},Tt:function(){this.body_setter()},Ft:function(t){this.$t.destructor(),this.$t=t,this.Fn.appendChild(this.$t.Vt),this.resize()},Qo:"webix_ai_id",getChildViews:function(){return[this.$t]},body_setter:function(t){return"object"!=M(t)&&(t={template:t}),t.Dt={top:!0,left:!0,right:!0,bottom:!0},(ii.bt=this).$t=si.Ht(t),this.Fn.appendChild(this.$t.Vt),t},header_setter:function(t){return t&&(t=Yt(t)),t},headerAlt_setter:function(t){return t&&(t=Yt(t)),t},$getSize:function(t,i){var e=this.$t.$getSize(0,0),s=this.P.Dt;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1));var n=0,h=Vi.api.$getSize.call(this,0,0);h[0]=(h[0]||e[0])+t,1e5<=h[1]&&(h[1]=e[1]),h[1]+=t,h[2]=(h[2]||e[2])+i;var r=h[3]<1e5;return r||(h[3]=e[3]),h[3]+=i,this.getParentView().Nl?this.P.collapsed?h[2]=h[3]=this.av()+i:this.P.header&&(n=this.P.headerHeight):(this.P.collapsed&&(h[0]=h[1]=this.av()+t),this.P.header&&(n=this.P.headerHeight)),r||(h[2]+=n,h[3]+=n),h},on_click:{webix_accordionitem_header:function(t){return this.uv(t),!1},webix_accordionitem_header_v:function(t){return this.uv(t),!1}},uv:function(){this.define("collapsed",!this.P.collapsed)},collapsed_setter:function(t){if(!1!==this.P.header){var i=this.getParentView();if(i){if(t)if(i.hv(this))this.cv();else{var e=0;if(1<i.ri.length)for(var s=0;s<i.ri.length;s++){var n=i.ri[s];if(this!=n&&n.isVisible()&&n.expand){n.expand(),this.cv(),e=1;break}}if(!e)return}else this.fv();(this.P.collapsed=t)||i.nv(this),this.refresh(),ii.gt||this.resize(),i.callEvent("onAfter"+(t?"Collapse":"Expand"),[this.P.id]),this.P.$noresize=t}return t}},collapse:function(){this.define("collapsed",!0),Mi.yi(this)},expand:function(){this.define("collapsed",!1)},ye:function(){this.show()},Bi:function(){this.hide()},fv:function(){this.Fn.style.display="",Mt(this.$view,
"collapsed"),Mt(this.vn,"collapsed"),this.vn.setAttribute("aria-expanded","true")},cv:function(){this.P.headerAlt&&(this.rv.innerHTML=this.P.headerAlt()),this.Fn.style.display="none",yt(this.$view,"collapsed"),yt(this.vn,"collapsed"),this.vn.setAttribute("aria-expanded","false")},refresh:function(){var t=this.P[this.P.collapsed?"headerAlt":"header"]||this.P.header;t&&(this.rv.innerHTML=t(),this.ov.setAttribute("aria-label",t()));var i=this.getParentView().Nl?"vertical":"horizontal";this.Vt.className.indexOf(" "+i)<0&&yt(this.Vt,i),q.transform||yt(this.Vt,"webix_ie",!0)},av:function(){return this.P.collapsed?this.P.headerAltHeight:this.P.headerHeight},$setSize:function(t,i){if(Hi.api.$setSize.call(this,t,i)||this.av()!=this.lv){t=this.me,i=this.we;var e=this.lv=this.av();if(this.P.header)if(this.vn.style.height=e+"px",this.vn.style.width="auto",this.vn.style[q.transform]="",this.vn.style.borderBottomWidth=(this.P.collapsed?0:1)+"px",this.getParentView().Nl||!this.P.collapsed)i-=this.av();else if(this.P.collapsed)if(Ni.isSupported()){this.vn.style.width=i+"px",this.vn.style.height=t+3+"px";var s=Math.floor(i/2-t/2)+(t-this.P.headerAltHeight)/2;this.vn.style[q.transform]="rotate(90deg) translate("+s+"px, "+(s+1)+"px)"}else this.vn.style.width=t+"px",this.vn.style.height=i+3+"px";this.P.collapsed||(this.$t.$setSize(t,i),this.dv=i)}else if(!this.P.collapsed){var n=this.$t;this.dv&&n.$setSize(this.me,this.dv)}},$skin:function(){this.defaults.headerAltHeight=this.defaults.headerHeight=Li.barHeight-2*Li.borderWidth},defaults:{header:!1,headerAlt:!1,body:""}}),Bn=(H.protoUI(zn,ze,g,Hi.view),{name:"resizearea",defaults:{dir:"x"},$init:function(t){var i=t.dir||"x",e=C(t.container),s="x"==i?"width":"height",n=t.margin?t.margin+"px":0;this.vv="x"==i?"left":"top",this.Vt=ft("DIV",{"class":"webix_resize_area webix_dir_"+i}),Kt(this.Vt,q.mouse.down,wt),n&&(n="x"==i?n+" 0 "+n:"0 "+n+" 0 "+n),this._v=ft("DIV",{"class":"webix_resize_handle_"+i,style:n?"padding:"+n:""},"<div class='webix_handle_content'></div>"),this.pv=ft("DIV",{"class":"webix_resize_origin_"+i}),t[s]&&(this.pv.style[s]=t[s]+(t.border?1:0)+"px",this._v.style[s]=t[s]+"px"),t.cursor&&(this._v.style.cursor=this.pv.style.cursor=this.Vt.style.cursor=t.cursor),this.bv=Zt(e,q.mouse.move,this.mv,{bind:this}),this.gv=Zt(document.body,q.mouse.up,this.wv,{bind:this}),this._v.style[this.vv]=this.pv.style[this.vv]=t.start+"px",e.appendChild(this.Vt),e.appendChild(this._v),e.appendChild(this.pv)},wv:function(){this.callEvent("onResizeEnd",[this.xv]),Qt(this.bv),Qt(this.gv),dt(this.Vt),dt(this._v),dt(this.pv),this.Vt=this._v=this.pv=null},mv:function(t){var i=mt(t);this.xv=("x"==this.P.dir?i.x:i.y)+this.P.start-this.P.eventPos,this._v.style[this.vv]=this.xv+"px",this.callEvent("onResize",[this.xv])}}),Hn=(H.protoUI(Bn,g,Si),{name:"resizer",defaults:{width:7,height:7},$init:function(t){this.getParentView(),this.Vt.className+=" webix_resizer";var i=this.getParentView().Xa;Kt(this.Vt,q.mouse.down,this.yv,{bind:this});var e=this.Mv();this.Sv=!1,this.kv=e,this.Cv="x"==e?"width":"height","x"==e?t.height=0:t.width=0,0<i?(this.Vt.className+=" webix_resizer_v"+e,this.Vt.style.marginRight="-"+i+"px","x"==e?t.width=i:t.height=i,this.$nospace=!0):this.Vt.className+=" webix_resizer_"+e,this.Vt.innerHTML="<div class='webix_resizer_content'></div>","y"==e&&0<i&&(this.Vt.style.marginBottom="-"+(t.height||this.defaults.height)+"px"),this.Vt.setAttribute("webix_disable_drag","true"),this.Vt.setAttribute("tabindex","-1"),this.Vt.setAttribute("aria-grabbed","false")},yv:function(t){var i=this,e=this.$v();if(e&&!this.P.disabled){t=t||window.event,this.Sv=!0,this.Dv=mt(t),this.Iv=[],this.Vt.setAttribute("aria-grabbed","true");for(var s=0;s<2;s++)e[s].$view.setAttribute("aria-dropeffect","move");this.Vt.setAttribute("aria-dropeffect","move"),this.Av(t,e[0]);var n=Zt(document.body,q.mouse.up,function(t){return Qt(n),i.Fv(t)})}},Fv:function(){this.Sv=!1,this.Dv=!1},Av:function(t,i){var e,s,n,h,r;t=t||window.event,e=this.kv,this.getParentView().Vt.style.position="relative",n=pt(this.Vt),h=pt(this.getParentView(
).Vt),r=n[e]-h[e],s=pt(i.$view)[e]-pt(this.getParentView().$view)[e],this.Tv=[e,i,r,s],this.Vv=new si.resizearea({container:this.getParentView().Vt,dir:e,eventPos:this.Dv[e],start:r-1,height:this.$height,width:this.$width,border:1,margin:this.getParentView().qa["x"===e?"left":"top"]}),this.Vv.attachEvent("onResizeEnd",S(this.zv,this)),this.Vv.attachEvent("onResize",S(this.Bv,this)),yt(document.body,"webix_noselect",1)},Mv:function(){return this.getParentView().Nl?"y":"x"},Bv:function(){var t,i,e,s,n,h,r,o,a;if(this.Tv)for(t=this.$v(),s=this.Tv[0],e=this.Vv.xv-this.Tv[2],o=this.Hv(t,s,e),a=t[0]["$"+this.Cv]+t[1]["$"+this.Cv],n=0;n<2;n++){i=n?-e:e,h=t[n].$getSize(0,0);var u="y"==s?h[2]:h[0],c="y"==s?h[3]:h[1];if(u===c&&(u=t[n].P["y"==s?"minHeight":"minWidth"]||3,c=t[n].P["y"==s?"maxHeight":"maxWidth"]||1e5),0<i&&c&&c<=o[n]||i<0&&u&&u>=o[n])return this.Iv[n]=0<i?c:u,r=this.Rv(t,s),void(this.Vv._v.style["y"==s?"top":"left"]=this.Tv[3]+r[0]+"px");o[n]<3?this.Vv._v.style["y"==s?"top":"left"]=this.Tv[3]+n*a+1+"px":this.Iv[n]=null}},$v:function(){var t,i,e;for(t=this.getParentView().ri,i=0;i<t.length;i++)if(t[i]==this)return(e=[this.Ev(t,i,1,-1),this.Ev(t,i,1,1)])[0]&&e[1]||(e=null),e},Ev:function(t,i,e,s){var n=t[i+s*e];return n&&n.P.hidden?this.Ev(t,i,e+1,s):n&&n.P.$noresize?null:n},zv:function(t){if(void 0!==t){var i,e,s,n,h=this.getParentView().Nl;if(this.Pv=null,this.Tv){if(e=this.Tv[0],s=t-this.Tv[2],(i=this.$v())[0]&&i[1]){n=this.jv(i,e,s);for(var r=0;r<2;r++){var o=i[r].$getSize(0,0);if(h?o[2]==o[3]:Math.abs(o[1]-o[0])<3)i[r].P[this.Cv]=n[r],i[r].Jl&&i[r].Jl(this.Cv,n[r],h);else{var a=i[r].$view[h?"offsetHeight":"offsetWidth"];i[r].P.gravity=n[r]/a*i[r].P.gravity}}i[0].resize();for(var u=0;u<2;u++)i[u].callEvent&&i[u].callEvent("onViewResize",[]),i[u].$view.removeAttribute("aria-dropeffect");y("onLayoutResize",[i])}this.Tv=!1}this.Tv=!1,this.Sv=!1,this.Iv=null,Mt(document.body,"webix_noselect"),this.Vt.setAttribute("aria-grabbed","false"),this.Vt.removeAttribute("aria-dropeffect")}},Rv:function(t){var i,e,s;return s=t[0]["$"+this.Cv]+t[1]["$"+this.Cv],this.Iv[0]?e=s-(i=this.Iv[0]):this.Iv[1]&&(i=s-(e=this.Iv[1])),[i,e]},Hv:function(t,i,e){for(var s=[],n="height"==this.Cv?"offsetHeight":"offsetWidth",h=0;h<2;h++)s[h]=t[h].$view[n]+(h?-1:1)*e;return s},jv:function(t,i,e){var s,n,h;if(this.Iv[0]||this.Iv[1])n=this.Rv(t,i);else for(n=this.Hv(t,i,e),s=0;s<2;s++)n[s]<0&&(h=n[0]+n[1],n[s]=1,n[1-s]=h-1);return n}}),Rn=(H.protoUI(Hn,ze,ki,Hi.view),{name:"align",defaults:{borderless:!0,left:0,top:0,right:0,bottom:0},$init:function(){this.Vt.className+=" webix_view_align"},Tt:function(){this.body_setter({})},Ft:function(t){this.$t.destructor(),this.$t=t,this.Vt.appendChild(this.$t.Vt),this.resize()},getChildViews:function(){return[this.$t]},body_setter:function(t){return t.Dt={top:!1,left:!1,right:!1,bottom:!1},(ii.bt=this).$t=si.Ht(t),this.Vt.appendChild(this.$t.Vt),t},align_setter:function(t){"string"==typeof t&&(t=t.split(",")),this.Nv=this.Lv=this.Ov="";for(var i=0;i<t.length;i++){var e=t[i];"center"!==e&&"left"!==e&&"right"!==e||(this.Nv=e),"top"!==e&&"bottom"!==e&&"middle"!==e||(this.Lv=e),"absolute"===e&&(this.Nv=this.Lv=this.Ov="precise")}return t},getBody:function(){return this.$t},$setSize:function(t,i){var e,s;Hi.api.$setSize.call(this,t,i),s=this.Ov?(e=t-this.P.left-this.P.right,i-this.P.top-this.P.bottom):(e=this.Zl[0]||t,this.Zl[2]||i),this.$t.$setSize(e,s);var n=this.$t.Vt;"center"==this.Nv?n.style.marginLeft=Math.ceil((t-e)/2)+"px":"right"==this.Nv?n.style.marginLeft=t-e+"px":n.style.marginLeft=(this.Ov?this.P.left:0)+"px","middle"==this.Lv?n.style.marginTop=Math.ceil((i-s)/2)+"px":"bottom"==this.Lv?n.style.marginTop=i-s+"px":n.style.marginTop=(this.Ov?this.P.top:0)+"px"},$getSize:function(t,i){var e=this.Zl=this.$t.$getSize(0,0),s=Vi.api.$getSize.call(this,0,0);return this.Ov&&(t+=this.P.left+this.P.right,i+=this.P.top+this.P.bottom),!this.Nv||this.Ov?(s[0]=e[0]+t,s[1]=e[1]+t):(s[0]=(s[0]||e[0])+i,s[1]+=t),!this.Lv||this.Ov?(s[2]=e[2]+i,s[3]=e[3]+i):(s[2]=(s[2]||e[2])+i,s[3]+=i),s}}),En=(H.protoUI(Rn,Hi.view),{
name:"multiview",defaults:{animate:{}},setValue:function(t){oi(t).show()},getValue:function(){return this.getActiveId()},$init:function(){this.ac=0,this.Nl=1,this.Vt.style.position="relative",this.Vt.className+=" webix_multiview",this.Wv=[]},Uv:function(t,i){var e=oi(t);e.Yv||(e.qv=[],e.Yv={}),e.Yv[i]||(e.Yv[i]=!0,e.qv.push(i))},Gv:function(t){var i=oi(t);if(this.P.keepViews&&(i.Vt.style.display=""),this.Wv[this.Wv.length-2]!=t?(10==this.Wv.length&&this.Wv.splice(0,1),this.Wv.push(t)):this.Wv.splice(this.Wv.length-1,1),i.Yv){for(var e=0;e<i.qv.length;e++){var s=oi(i.qv[e]);s&&s.render()}i.qv=[],i.Yv={}}},addView:function(t,i){var e=!R(i)&&i<=this.ac?1:0,s=yn.api.addView.apply(this,arguments);return 1<this.ri.length&&(this.P.keepViews?oi(s).Vt.style.display="none":dt(oi(s).Vt),this.ac+=e),s},Ft:function(t){if(!t.P.borderless){var i=l(this.P.Dt);t.P.Dt=i;var e=t.Vt.style;e.borderTopWidth=e.borderBottomWidth=e.borderLeftWidth=e.borderRightWidth="1px",this.Xl(e,i)}yn.api.Ft.apply(this,arguments)},Ol:function(t){if(t==this.ac){var i=t?t-1:1;this.ri[i]&&(this.Xv=null,this.ye(this.ri[i],!1))}t<this.ac&&this.ac--},Bi:function(){},El:function(t){t=t||this.Ll;for(var i=0;i<t.length;i++)t[i].Dt=this.P.borderless?{top:1,left:1,right:1,bottom:1}:this.P.Dt||{};yn.api.El.call(this,t);for(var e=1;e<this.ri.length;e++)this.P.keepViews?this.ri[e].Vt.style.display="none":dt(this.ri[e].Vt);for(var s=0;s<t.length;s++){var n=this.ri[s];n.ri&&!n._d||(this.Xl(n.Vt.style,n.P.Dt),n.Vt.setAttribute("role","tabpanel"))}this.Gv(this.getActiveId())},cells_setter:function(t){t&&t.length,this.Ll=t},Jv:function(t,i){var e=(this.P.animate||{}).direction,s="top"==e||"bottom"==e;return t<i?s?"bottom":"right":s?"top":"left"},ye:function(t,i){var e=this,s=arguments,n=this.getParentView();if(n&&n.getTabbar){var h=n.getTabbar();h.blockEvent(),h.setValue(t.P.$id||t.P.id),h.unblockEvent()}if(this.Xv)return this.Xv.then(function(){return e.ye.apply(e,s)});for(var r=-1,o=0;o<this.ri.length;o++)if(this.ri[o]==t){r=o;break}if(!(r<0||r==this.ac)){var a=this.ri[this.ac],u=this.ri[r];if(a.$getSize(0,0),(i||void 0===i)&&Ni.isSupported()&&this.P.animate){var c=H.extend({},this.P.animate);this.P.keepViews&&(c.keepViews=!0),c.direction=this.Jv(r,this.ac),c=Si.Ei(i||{},c);var f=Ni.formLine(u.Vt,a.Vt,c);u.$getSize(0,0),u.$setSize(this.me,this.we);var l=c.callback;c.callback=function(){Ni.breakLine(f,this.P.keepViews),this.Xv=null,c.wait_animation.resolve(),l&&l.call(this),l=c.master=c.callback=null,this.resize()},(c.master=this).ac=r,this.Gv(this.getActiveId()),Ni(f,c),this.Xv=c.wait_animation=b.defer()}else this.P.keepViews?a.Vt.style.display="none":(dt(a.Vt),this.Vt.appendChild(this.ri[o].Vt)),this.ac=r,this.resizeChildren(),this.Gv(this.getActiveId());u.callEvent&&(u.callEvent("onViewShow",[]),vi(u,this.Se)),this.callEvent("onViewChange",[a.P.id,u.P.id])}},$getSize:function(t,i){if(!this.ri.length)return Vi.api.$getSize.call(this,0,0);var e=this.ri[this.ac].$getSize(0,0);if(this.P.fitBiggest)for(var s=0;s<this.ri.length;s++)if(s!=this.ac)for(var n=this.ri[s].$getSize(0,0),h=0;h<4;h++)e[h]=Math.max(e[h],n[h]);var r=Vi.api.$getSize.call(this,0,0);return 1e5<=r[1]&&(r[1]=0),1e5<=r[3]&&(r[3]=0),r[0]=(r[0]||e[0])+t,r[1]=(r[1]||e[1])+t,r[2]=(r[2]||e[2])+i,r[3]=(r[3]||e[3])+i,r},$setSize:function(t,i){this.ri.length&&(this.Pl=[t,i],Vi.api.$setSize.call(this,t,i),this.ri[this.ac].$setSize(t,i))},isVisible:function(t,i){return i&&i!=this.getActiveId()?(t&&this.Uv(i,t),!1):Hi.api.isVisible.call(this,t,this.P.id)},getActiveId:function(){return this.ri.length?this.ri[this.ac].P.id:null},back:function(t){if(t=t||1,this.callEvent("onBeforeBack",[this.getActiveId(),t])){if(this.Wv.length>t){var i=this.Wv[this.Wv.length-t-1];return oi(i).show(),i}return null}return null},Yl:function(t,i){!this.P.keepViews&&i&&i!=this.ri[this.ac]||yn.api.Yl.call(this,t,i)}}),Pn=(H.protoUI(En,yn.view),{name:"tabview",setValue:function(t){this.ri[0].setValue(t)},getValue:function(){return this.ri[0].getValue()},getTabbar:function(){return this.ri[0]},getMultiview:function(){return this.ri[1]},
addView:function(t){var i=this.getMultiview().addView(t.body);return t.id=i,t.value=t.header,delete t.body,delete t.header,this.getTabbar().addOption(t),i},removeView:function(t){var i=this.getTabbar();i.removeOption(t),i.refresh()},$init:function(t){this.$ready.push(this.Kv);var i=t.cells,e=[];i&&i.length;for(var s=i.length-1;0<=s;s--){var n=i[s].body||i[s];n.id||(n.id="view"+V()),e[s]={value:i[s].header,id:n.id,close:i[s].close,width:i[s].width,hidden:!!i[s].hidden},i[s]=n}var h={view:"tabbar",multiview:!0},r={view:"multiview",cells:i,animate:!!t.animate};t.value&&(h.value=t.value),t.tabbar&&H.extend(h,t.tabbar,!0),t.multiview&&H.extend(r,t.multiview,!0),h.options=h.options||e,t.rows=[h,r],delete t.cells,delete t.tabs},Kv:function(){this.getTabbar().attachEvent("onOptionRemove",function(t){var i=oi(t);if(i){var e=i.getParentView();e&&e.removeView(i)}})}}),jn=(H.protoUI(Pn,kn.view),{name:"carousel",defaults:{scrollSpeed:"300ms",type:"clean",navigation:{},animate:!0},$init:function(){this.Vt.className+=" webix_carousel",this.Zv=null,this.tt=null,this.ac=0,this.$ready.unshift(this.Qv),this.$ready.push(this.rr)},addView:function(t,i){var e=this.Zv.addView(t,i);return this.t_(),e},removeView:function(t){this.Zv.removeView(t),this.t_()},Ft:function(t,i){this.Zv.Ft(t,i),this.t_()},t_:function(){this.ri=this.Zv.ri,this.tc(),this.setActiveIndex(Math.min(this.ac,this.ri.length-1))},Qv:function(){var i=this;this.Zv&&this.Zv.destructor&&this.Zv.destructor();var t="";this.config.cols?(t="cols",this.Nl=0):(t="rows",this.Nl=1);var e={borderless:!0,type:"clean"};e[t]=_(this.P[t]);for(var s=["type","margin","marginX","marginY","padding","paddingX","paddingY"],n={},h=0;h<s.length;h++)this.P[s[h]]&&(n[s[h]]=this.P[s[h]]);H.extend(e,n,!0),(ii.bt=this).Zv=si.Ht(e),this.Vt.appendChild(this.Zv.Vt),this.ri=this.Zv.ri,this.Zv.ye=S(jn.ye,this),this.Zv.adjustScroll=S(jn.adjustScroll,this);var r=A("onReconstruct",function(t){t==i.Zv&&i.i_()});this.attachEvent("onDestruct",function(){F(r)}),this.Wi=this.Vt.firstChild},ke:function(t,i){this.P.navigation.items&&"tab"===i.target.getAttribute("role")&&this.Ku(t,i),Vi.api.ke.call(this,t,i)},getChildViews:function(){return[this.Zv]},getLayout:function(){return this.Zv},rr:function(){this.Wi.setAttribute("touch_scroll",this.Nl?"y":"x"),this.Zv.attachEvent("onAfterScroll",S(function(){this.callEvent("onShow",[this.getActiveId()])},this)),vi(this.Zv,function(t){t.Vt.setAttribute("role","tabpanel")})},adjustScroll:function(t){var i,e=this.Nl?this.we:this.me;return this.Nl?(i=Math.round(t.f/e),t.f=i*e):(i=Math.round(t.e/e),t.e=i*e),this.ac=-i,this.P.navigation&&this.ic(),!0},ye:function(t){var i,e,s,n,h,r;for(s=-1,e=this.Zv,i=0;i<e.ri.length;i++)if(e.ri[i]==t){s=i;break}s<0||s==this.ac||(this.ac=s,n=e.Nl?this.we:this.me,h=-(e.Nl?0:s*n),r=-(e.Nl?s*n:0),this.scrollTo(h,r),this.callEvent("onShow",[e.ri[this.ac].P.id]),this.P.navigation&&this.tc())},scrollTo:function(t,i){Yi&&Ni.isSupported()&&this.P.animate?Yi.ms(this.Wi,t,i,this.P.scrollSpeed||"100ms"):(this.Wi.style.marginLeft=t+"px",this.Wi.style.marginTop=i+"px")},navigation_setter:function(t){return this.Ei(t,{type:"corner",buttons:!0,items:!0}),t},showNext:function(){this.ac<this.Zv.ri.length-1&&this.setActiveIndex(this.ac+1)},showPrev:function(){0<this.ac&&this.setActiveIndex(this.ac-1)},setActiveIndex:function(t){this.Zv.ri.length,oi(this.Zv.ri[t].P.id).show()},getActiveIndex:function(){return this.ac},$getSize:function(t,i){var e=this.Zv.$getSize(0,0),s=Hi.api.$getSize.call(this,t,i);return this.Zv.Nl?(s[0]=Math.max(s[0],e[0]),s[1]=Math.min(s[1],e[1])):(s[2]=Math.max(s[2],e[2]),s[3]=Math.min(s[3],e[3])),s},$setSize:function(t,i){var e=this.Zv,s=e.ri.length,n=Hi.api.$setSize.call(this,t,i),h=this.we*(e.Nl?s:1),r=this.me*(e.Nl?1:s);n?(this.Wi.style.height=h+"px",this.Wi.style.width=r+"px",e.$setSize(r,h),this.i_()):e.$setSize(r,h)},i_:function(){var t=this.Zv,i=this.ac||0,e=t.Nl?this.we:this.me,s=-(t.Nl?0:i*e),n=-(t.Nl?i*e:0);this.scrollTo(s,n),this.P.navigation&&this.tc()},getActiveId:function(){var t=this.Zv.ri[this.ac];return t?t.P.id:null},
setActive:function(t){oi(t).show()}}),Nn=(H.protoUI(jn,g,Be,Hi.view),{name:"proxy",body_setter:function(t){return(ii.bt=this).$t=si.Ht(t),this.Vt.appendChild(this.$t.Vt),t},getChildViews:function(){return[this.$t]},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i),this.$t.$setSize(this.$width,this.$height)},$getSize:function(t,i){var e=Hi.api.$getSize.call(this,t,i),s=this.$t.$getSize(t,i);return s[0]=Math.max(e[0],s[0]),s[1]=Math.min(e[1],s[1]),s[2]=Math.max(e[2],s[2]),s[3]=Math.min(e[3],s[3]),s[4]=Math.max(e[4],s[4]),s},Ft:function(t){this.$t.destructor(),this.$t=t,this.Vt.appendChild(t.Vt),this.resize()}}),Ln=(H.protoUI(Nn,Hi.view),{name:"portlet",defaults:{layoutType:"wide",icon:"wxi-drag"},$init:function(t){this.Vt.style.position="relative",t.header&&t.body&&(t.body=[{template:t.header,type:"header"},t.body]),this.$ready.push(this.e_)},s_:function(t){vi(t,function(t){t.n_&&t.n_()})},e_:function(){var t=this.getChildViews();if(1<t.length)Xi.addDrag(t[0].$view,this);else if(this.P.icon){var i=ft("div",{"class":"portlet_drag"},"<span class='webix_icon "+this.P.icon+"'></span>");this.Vt.appendChild(i),Xi.addDrag(i,this)}else Xi.addDrag(this.$view,this)},body_setter:function(t){return this.rows_setter($(t)?t:[t])},markDropArea:function(t,i){if(!t)return dt(this.h_);t=oi(t),this.h_||(this.h_=ft("div",null,"&nbsp;")),t.$view.appendChild(this.h_),this.h_.className="portlet_marker"+i},movePortlet:function(t,i){var e=t.getParentView(),s=this.getParentView(),n=e.index(t),h=s.index(this);if(y("onBeforePortletMove",[s,e,this,t,i])){ii.pt=!0;var r=s!=e?1:0,o=e.Nl;"top"==i||"bottom"==i?(1!==o&&(si(t,e=si({type:t.P.layoutType,rows:[]},e,n+r),0),n=0,r=1),"bottom"==i&&(r+=1)):"left"!=i&&"right"!=i||(0!==o&&(si(t,e=si({type:t.P.layoutType,cols:[]},e,n+r),0),n=0,r=1),"right"==i&&(r+=1)),h<n&&(r-=1),si(this,e,n+r),"replace"==i&&si(t,s,h),this.r_(s),ii.pt=!1,t.resize(),s.resize(),this.s_(s),y("onAfterPortletMove",[s,e,this,t,i])}},r_:function(t){for(var i,e=0;t.getChildViews().length<=e;)t=(i=t).getParentView(),e=1;e&&t.removeView(i)},$drag:function(t){return yt(this.Vt,"portlet_in_drag"),Xi.Gs={source:t,from:t},this.Vt.innerHTML},$dragDestroy:function(t,i){Mt(this.Vt,"portlet_in_drag"),dt(i),this.o_&&(this.movePortlet(this.o_,this.a_),this.markDropArea(),this.o_=null)},qs:function(){return pt(this.$view)},$dragPos:function(t,i,e){e.style.left="-10000px";var s=q.mouse.context(i),n=document.body.scrollTop||document.documentElement.scrollTop||0,h=document.body.scrollLeft||document.documentElement.scrollLeft||0,r=document.elementFromPoint(s.x-h,s.y-n),o=null;r&&(o=oi(r)),this.o_=this.u_(o),this.a_=this.c_(this.o_,i),t.x=t.x-this.me+10,t.y=t.y-20,Xi.hn=!0},c_:function(t,i){var e="",s="";if(i&&t){var n=pt(t.$view),h=mt(i),r=h.x-n.x-n.width/2,o=h.y-n.y-n.height/2;(s=t.P.mode)||(s=Math.abs(r)*(n.height/n.width)>Math.abs(o)?"cols":"rows"),"cols"==s?e=0<=r?"right":"left":"rows"==s&&(e=0<=o?"bottom":"top"),this.markDropArea(t,e)}return this.markDropArea(t,e),e||s},u_:function(t){for(;t;){if(t.movePortlet)return t;t=t.getParentView()}}}),On=(H.protoUI(Ln,kn.view),{name:"abslayout",$init:function(){this.$view.className+=" webix_abslayout",delete this.rows_setter,delete this.cols_setter,this.Ll=[]},cells_setter:function(t){this.Ll=t},El:function(){for(var t=0;t<this.Ll.length;t++)this.Ll[t].Dt={};yn.api.El.call(this,this.Ll)},$getSize:function(){for(var t=Vi.api.$getSize.call(this,0,0),i=null,e=0;e<this.ri.length;e++)this.ri[e].P.relative&&(i=this.ri[e].$getSize(0,0));return i&&(1e5<=t[1]&&(t[1]=0),1e5<=t[3]&&(t[3]=0),t[0]=Math.max(t[0],i[0]),t[1]=Math.max(t[1],i[1]),t[2]=Math.max(t[2],i[2]),t[3]=Math.max(t[3],i[3])),t},$setSize:function(t,i){this.Pl=[t,i],Vi.api.$setSize.call(this,t,i),this.Ga(t,i)},Ga:function(t,i){for(var e=0;e<this.ri.length;e++){var s=this.ri[e],n=s.P,h=s.$getSize(0,0);n.relative?(n.left=n.top=0,s.$setSize(t,i)):s.$setSize(h[0],h[2]);for(var r=s.$view,o=["left","right","top","bottom"],a=0;a<o.length;a++){var u=o[a];u in n&&(r.style[u]=n[u]+"px")}}}}),Wn={api:On,view:H.protoUI(On,yn.view)},Un={name:"gridlayout",defaults:{
autoplace:!0,gridColumns:2,gridRows:2,margin:10,padding:10},gridRows_setter:function(t){return this.f_=t},removeView:function(t){Wn.api.removeView.call(this,t),this.l_(),this.callEvent("onChange",[])},d_:function(t){if(t.dx=t.dx||1,t.dy=t.dy||1,R(t.y)||R(t.x)){for(var i=this.v_(),e=0;e<this.f_;e++)for(var s=0;s<this.P.gridColumns;s++)if(!i[s][e]&&this.__(i,s,e,s+t.dx,e+t.dy))return t.x=s,void(t.y=e);t.x=0,t.y=this.f_}var n=t.x+t.dx-this.P.gridColumns;0<n&&(t.dx-=n)},Ft:function(t,i){if(R(i)){for(var e=0;e<this.ri.length;e++)this.ri[e].destructor();this.Ll=t,this.El()}else this.d_(t.config),this.ri.push(t),this.$view.appendChild(t.Vt),this.p_(t.config,t.config.id);this.l_(!0),this.b_||this.callEvent("onChange",[])},__:function(t,i,e,s,n){for(var h=i;h<s;h++)for(var r=e;r<n;r++)if(!t[h]||t[h][r])return!1;return!0},m_:function(t,i,e){for(var s=0;s<i.dx;s++)for(var n=0;n<i.dy;n++)t[s+i.x][n+i.y]=e},g_:function(t,i,e){for(var s=this.P.gridColumns,n=i.x+i.dx;n+e.dx<=s;n++)if(this.__(t,n,e.y,n+e.dx,e.y+e.dy))return n-e.x;return 0},w_:function(t,i,e){for(var s=i.x-e.dx;0<=s;s--)if(this.__(t,s,e.y,s+e.dx,e.y+e.dy))return e.x-s;return 0},x_:function(t,i,e){for(var s=i.y-e.dy;0<=s;s--)if(this.__(t,e.x,s,e.x+e.dx,s+e.dy))return e.y-s;return 0},v_:function(t){for(var i=[],e=0;e<this.P.gridColumns;e++)i[e]=[];for(var s=0;s<this.ri.length;s++){var n=this.ri[s].config;n.id===t||n.hidden||this.m_(i,n,n.id)}return i},l_:function(t){(this.y_()||t)&&this.M_()},y_:function(){if(!this.P.autoplace)return!1;var t=this.P.gridColumns,i=this.f_,e=this.v_(),s=!1;t:for(var n=i-1;0<=n;n--){for(var h=t-1;0<=h;h--)if(e[h][n])continue t;s=!0;for(var r=0;r<this.ri.length;r++){var o=this.ri[r].config;!o.hidden&&o.y>=n&&(o.y-=1)}}return s},p_:function(t,i){if(t.x-=Math.max(0,t.x+t.dx-this.P.gridColumns),this.P.autoplace){for(var e=[],s=this.v_(i),n=0;n<this.ri.length;n++){var h=this.ri[n].config;h.id===i||h.hidden||h.y<t.y+t.dy&&h.y+h.dy>t.y&&h.x<t.x+t.dx&&h.x+h.dx>t.x&&e.push(h)}for(var r=[],o=0;o<e.length;o++){var a=e[o];this.m_(s,a,0);var u=this.g_(s,t,a);if(u)a.x+=u;else{var c=this.w_(s,t,a);if(c)a.x-=c;else{var f=this.x_(s,t,a);f?a.y-=f:(a.y=t.y+t.dy,r.push(a))}}this.m_(s,a,a.id)}for(var l=0;l<r.length;l++)this.p_(r[l],r[l].id)}else t.y-=Math.max(0,t.y+t.dy-this.P.gridRows)},M_:function(){for(var t=this.P.gridRows,i=0;i<this.ri.length;i++){var e=this.ri[i].config;e.hidden||(t=Math.max(t,e.y+e.dy))}this.f_!=t&&(this.f_=t,this.resize()),this.Ga()},moveView:function(t,i){i=H.extend(oi(t).config,i,!0),this.p_(i,t),this.l_(!0),this.callEvent("onChange",[])},serialize:function(t){for(var i=[],e=0;e<this.ri.length;e++)if(t)i.push(t.call(this,this.ri[e]));else{var s=this.ri[e].config;i.push({id:s.id,name:s.name,x:s.x,y:s.y,dx:s.dx,dy:s.dy})}return i},clearAll:function(){for(var t=0;t<this.ri.length;t++)this.ri[t].destructor();this.ri=[],this.callEvent("onChange",[])},restore:function(t,i){i=i||this.P.factory,t=_(t),this.b_=!0;for(var e={},s=0;s<t.length;s++){var n=t[s],h=oi(n.id);e[h?(H.extend(h.config,n,!0),h.config.id):(h=i.call(this,n),this.addView(h))]=1}for(var r=this.ri.length-1;0<=r;r--)e[this.ri[r].config.id]||(this.ri[r].destructor(),this.ri.splice(r,1));this.M_(),this.b_=!1},$getSize:function(){for(var t=Vi.api.$getSize.call(this,0,0),i=0;i<this.ri.length;i++)this.ri[i].$getSize(0,0);var e=this.P.cellWidth,s=this.P.cellHeight,n=this.S_(0,0,this.P.gridColumns,this.f_);return e&&(t[0]=n.dx+2*n.x),s&&(t[2]=n.dy+2*n.y),t},S_:function(t,i,e,s){var n=this.P.margin,h=this.P.paddingX||this.P.padding,r=this.P.paddingY||this.P.padding,o=this.P.cellWidth;o||(o=(this.$width-2*h+n)/this.P.gridColumns-n);var a=this.P.cellHeight;return a||(a=(this.$height-2*r+n)/this.f_-n),{x:h+(o+n)*t,y:r+(a+n)*i,dx:Math.ceil(o+(o+n)*(e-1)),dy:Math.ceil(a+(a+n)*(s-1))}},Ga:function(){for(var t=0;t<this.ri.length;t++){var i=this.ri[t],e=i.P,s=this.S_(e.x,e.y,e.dx,e.dy);i.$getSize(0,0),i.$setSize(s.dx,s.dy);var n=i.$view;n.style.left=s.x+"px",n.style.top=s.y+"px"}}},Yn={api:Un,view:H.protoUI(Un,Wn.view)},qn={name:"dashboard",$init:function(){Xi.addDrag(this.$view,this),Xi.addDrop(
this.$view,this,!0)},k_:function(t){return!(!t.getAttribute||t.getAttribute("webix_disable_drag")||t.getAttribute("webixignore"))&&(-1!=(t.className||"").toString().indexOf("panel_drag")?t:!(!t.parentNode||t==this.$view)&&this.k_(t.parentNode))},$dragCreate:function(t,i){if(!i.target||!this.k_(i.target))return!1;var e=oi(i);e.$resizeMove||(e=e.queryView(function(t){return!R(t.config.dx)},"parent"));var s=pt(this.$view),n=mt(i),h=Xi.Gs={source:e,from:this,dashboard:{sx:n.x-s.x-parseInt(e.$view.style.left)+this.P.margin/2,sy:n.y-s.y-parseInt(e.$view.style.top)+this.P.margin/2}};return this.callEvent("onBeforeDrag",[h,i])?(this.C_(e.P.dx,e.P.dy),e.$view):void 0},C_:function(t,i){var e=this.D_=ft("div",{"class":"panel_target"}),s=this.S_(0,0,t,i);e.style.width=s.dx+"px",e.style.height=s.dy+"px",this.$view.appendChild(this.D_)},$drop:function(t,i,e){var s=Xi.Gs,n={x:s.dashboard.x,y:s.dashboard.y};if(this.callEvent("onBeforeDrop",[s,e])){if(s.from===this){var h=s.source.config;this.moveView(h.id,n)}else{if(!(s.from&&s.from.callEvent&&s.from.callEvent("onBeforeDropOut",[s,e])))return;n.name=s.source[0],n.dx=s.dashboard.dx,n.dy=s.dashboard.dy,n.id=n.name+":"+V(),(n=this.P.factory.call(this,n))&&this.addView(n)}this.callEvent("onAfterDrop",[s,e])}},$dragDestroy:function(t,i){i.style.zIndex=1,dt(this.D_),this.D_=null,this.M_()},I_:function(t,i,e){var s=this.P.margin,n=this.P.paddingX||this.P.padding,h=this.P.paddingY||this.P.padding,r=this.P.cellWidth;r||(r=(this.$width-2*n+s)/this.P.gridColumns-s);var o=this.P.cellHeight;return o||(o=(this.$height-2*h+s)/this.f_-s),t+=e?s:-n,i+=e?s:-h,t=Math.round(t/(r+s)),i=Math.round(i/(o+s)),{x:t=Math.max(0,Math.min(t,this.P.gridColumns-(e?0:1))),y:i=Math.max(0,Math.min(i,this.f_)),width:r,height:o,margin:s,rx:t*(r+s)+n,ry:i*(o+s)+h}},$dragOut:function(t,i,e,s){var n=Xi.Gs;this.callEvent("onDragOut",[n,s]),this.D_&&n.external&&(dt(this.D_),this.D_=null)},$dragIn:function(t,i,e){var s=Xi.Gs;if(this.callEvent("onBeforeDragIn",[s,e])){if(!this.D_){if(!s.from||!s.from.getItem)return!1;if(!this.P.factory)return!1;s.external=!0;var n=s.from.getItem(s.source);s.dashboard={dx:n.dx,dy:n.dy},this.C_(n.dx,n.dy)}if(s.external){var h=this.D_,r=q.mouse.context(e),o=pt(this.$view),a=this.I_(r.x-o.x,r.y-o.y);H.extend(s.dashboard,a,!0),h.style.left=a.rx+"px",h.style.top=a.ry+"px"}return!0}},$dragPos:function(t,i,e){var s=Xi.Gs;e.style.left="-10000px";var n=q.mouse.context(i),h=pt(this.$view),r=s.dashboard,o=this.I_(n.x-h.x-r.sx,n.y-h.y-r.sy);t.x=n.x-r.sx-h.x,t.y=n.y-r.sy-h.y;var a=this.D_;a.style.left=o.rx+"px",a.style.top=o.ry+"px",H.extend(r,o,!0)}},Gn=(H.protoUI(qn,Yn.view),{name:"panel",$init:function(t){if(t.header&&t.body){var i=t.header;"object"!==M(i)&&(i={template:t.header,type:"header",css:"webix_header"}),t.body=[i,t.body]}yt(this.$view,"panel_drag_view"),this.$ready.push(this.e_)},e_:function(){var t=this.getChildViews(),i=1===t.length?this:t[1];if(this.P.icon){var e=ft("div",{"class":"panel_icon"},"<span class='webix_icon "+this.P.icon+" panel_icon_span'></span>");i!=this&&(i.$view.style.position="relative"),i.$view.appendChild(e)}},body_setter:function(t){return this.rows_setter($(t)?t:[t])},$resizeEnd:function(t){var i=this.getParentView();if(i&&i.I_){var e=i.I_(t.mx,t.my,!0),s=Math.max(e.x,1),n=Math.max(e.y,1);i.moveView(this.P.id,{dx:s,dy:n})}},$resizeMove:function(t){var i=this.getParentView();if(i&&i.I_){t.mx=t.x,t.my=t.y;var e=i.I_(t.x,t.y,!0);t.x=(e.width+e.margin)*e.x-e.margin,t.y=(e.height+e.margin)*e.y-e.margin}}}),Xn=(H.protoUI(Gn,kn.view,Qi),{$init:function(){H.extend(this,ke,!0)},name:"flexlayout"}),Jn=(H.protoUI(Xn,kn.view),{name:"datalayout",$init:function(){this.data.provideApi(this,!0),this.data.attachEvent("onStoreUpdated",S(this.render,this))},El:function(){return this.A_||(this.A_=this.Ll,this.Ll=[{}]),kn.api.El.call(this,this.Ll)},setValue:function(t){this.parse(t)},getValue:function(){for(var t=this.A_.length,i=0;i<this.ri.length;i++){var e=this.data.order[Math.floor(i/t)],s=this.data.getItem(e);this.F_(this.ri[i],s)}return this.data.serialize()},F_:function(t,i){
var e=t.P.name;if(e){var s=null;t.getValues?s=t.getValues():t.getValue?s=t.getValue():t.serialize&&(s=t.serialize()),"$value"==e?H.extend(i,s,!0):i[e]=s}else{var n=t.ri;if(n)for(var h=0;h<n.length;h++)this.F_(n[h],i)}},ql:function(t,i){var e,s=t.P.name;if(s)e="$value"==s?i:i[s],t.setValues?t.setValues(e):t.setValue?t.setValue(e):t.parse&&(t.openAll&&(e=_(e)),t.parse(e));else{var n=t.ri;if(n)for(var h=0;h<n.length;h++)this.ql(n[h],i)}},render:function(t,i,e){var s=this.A_.length;if(t&&"update"===e)for(var n=this.getItem(t),h=this.getIndexById(t),r=0;r<s;r++)this.ql(this.ri[h*s+r],n);else{for(var o=this.Ll=[],a=this.data.order,u=0;u<a.length;u++)if(s)for(var c=0;c<s;c++)o.push(_(this.A_[c]));else o.push(this.getItem(a[u]));if(o.length||o.push({}),this.reconstruct(),s)for(var f=0;f<a.length;f++)for(var l=this.getItem(a[f]),d=0;d<s;d++){var v=this.ri[f*s+d];this.ql(v,l)}}}}),Kn={api:Jn,view:H.protoUI(Jn,_e,kn.view)},Zn={$init:function(){H.extend(this,ke,!0)},name:"flexdatalayout"},Qn=(H.protoUI(Zn,Kn.view),{name:"popup",$init:function(){var i=this;this.P.head=!1,this.$view.className+=" webix_popup";var t=A("onClick",function(t){return i.Bi(t)});this.attachEvent("onDestruct",function(){F(t)}),this.attachEvent("onHide",this.Hn)},$skin:function(){ie.api.$skin.call(this),this.defaults.padding=Li.popupPadding,this.defaults.point=!Li.popupNoPoint,this.defaults.borderless=Li.borderlessPopup},close:function(){dt(this.T_),ie.api.close.call(this)},$getSize:function(t,i){return ie.api.$getSize.call(this,t+2*this.P.padding,i+2*this.P.padding)},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i),t=this.me-2*this.P.padding,i=this.we-2*this.P.padding,this.Wi.style.padding=this.P.padding+"px",this.vn.style.display="none",this.$t.$setSize(t,i)},On:function(t){"undefined"==typeof t.borderless&&(t.borderless=!1)},head_setter:function(){},Bn:function(t,i,e,s){this.Hn(),document.body.appendChild(this.T_=ft("DIV",{"class":"webix_point_"+t},"")),this.T_.style.zIndex=this.Vt.style.zIndex,this.T_.style.position=s?"fixed":"absolute",this.T_.style.top=e+"px",this.T_.style.left=i+"px"},Hn:function(){this.T_=dt(this.T_)}}),th={api:Qn,view:H.protoUI(Qn,ie.view)},ih={name:"toolbar",defaults:{type:"toolbar"},_d:!0,V_:"webix_toolbar",z_:!1,$init:function(t){t.borderless||(this.Wi.style.borderWidth="1px",this.P.Dt={top:!1,left:!1,right:!1,bottom:!1}),this.Wi.className+=" "+this.V_,this.Vt.setAttribute("role","toolbar")},oe:function(){var i=this;i.elements={},vi(this,function(t){if(t.P.name&&t.getValue&&t.setValue&&(i.elements[t.P.name]=t).mapEvent&&t.mapEvent({onbeforetabclick:i,onaftertabclick:i,onitemclick:i,onchange:i}),t.setValues||t.ql)return!1});var t=this.Yf;if(this.setDirty(!1),t){var e=this.Yf;for(var s in i.elements)t[s]&&e[s]!=t[s]&&(e[s]=t[s],this.setDirty(!0))}},Gl:function(){this.oe()},ld:function(t){var i=this.P;return i.elements&&!t&&(this.Ll=t=i.elements,this.Nl=this.z_,delete i.elements),this.P.elementsConfig&&this.B_(this.Ll,i.elementsConfig),t},B_:function(t,i){for(var e=0;e<t.length;e++){var s=t[e];H.extend(s,i);var n,h=i;s.elementsConfig&&(h=H.extend(H.extend({},s.elementsConfig),i)),(n=s.body?[s.body]:s.rows||s.cols||s.cells||s.body)&&this.B_(n,h)}},$getSize:function(t,i){var e=kn.api.$getSize.call(this,t,i),s=this.getParentView(),n=this.Nl?3:1;return s&&this.Nl!=s.Nl&&(e[n]+=1e5),e},render:function(){},refresh:function(){this.render()}},eh={api:ih,view:H.protoUI(ih,je,Ht,bs,kn.view,ce)},sh={name:"form",defaults:{type:"form",autoheight:!0},H_:-1,V_:"webix_form",z_:!0,$init:function(){this.Vt.setAttribute("role","form")},$getSize:function(t,i){this.ge&&!this.P.width&&(t+=q.scrollSize);var e=kn.api.$getSize.call(this,t,i);return!this.P.scroll&&this.P.autoheight||(e[2]=this.P.height||this.P.minHeight||0,e[3]=this.P.height||1e5),e}},nh=(H.protoUI(sh,eh.view),{name:"fieldset",defaults:{borderless:!0,$cssName:"webix_fieldset",paddingX:18,paddingY:30},$init:function(t){t.body=t.body||{};var i=this.defaults.$cssName;this.Vt.className+=" "+i,this.Vt.innerHTML="<fieldset><legend class='"+i+"_label"+(t.required?" webix_required":""
)+"'></legend><div class='"+i+"_body'></div></fieldset>"},label_setter:function(t){return this.Vt.firstChild.childNodes[0].innerHTML=t},getChildViews:function(){return[this.R_]},body_setter:function(t){return(ii.bt=this).R_=si(t,this.Vt.firstChild.childNodes[1]),t},getBody:function(){return this.R_},resizeChildren:function(){if(this.R_){var t=this.$width-this.P.paddingX,i=this.$height-this.P.paddingY,e=this.R_.$getSize(0,0);e[0]>t&&(t=e[0]),e[2]>i&&(i=e[2]),this.R_.$setSize(t,i),this.resize()}},$getSize:function(t,i){t+=this.P.paddingX,i+=this.P.paddingY;var e=this.R_.$getSize(t,i),s=this.E_=Hi.api.$getSize.call(this,t,i);return s[0]<e[0]&&(s[0]=e[0]),s[2]<e[2]&&(s[2]=e[2]),s[1]>e[1]&&(s[1]=e[1]),s[3]>e[3]&&(s[3]=e[3]),s[1]<s[0]&&(s[1]=s[0]),s[3]<s[2]&&(s[3]=s[2]),s},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&(t=Math.min(this.E_[1],t),i=Math.min(this.E_[3],i),this.R_.$setSize(t-this.P.paddingX,i-this.P.paddingY))}}),hh={api:nh,view:H.protoUI(nh,Hi.view)},rh={name:"forminput",defaults:{$cssName:"webix_forminput",labelWidth:80,labelAlign:"left",paddingY:0,paddingX:0},setValue:function(t){this.R_.setValue?this.R_.setValue(t):this.R_.setValues&&this.R_.setValues(t)},focus:function(){return!!this.R_.focus&&this.R_.focus()},getValue:function(){return this.R_.getValue?this.R_.getValue():this.R_.getValues?this.R_.getValues():void 0},getBody:function(){return this.R_},$skin:function(){this.P_=Li.inputPadding,this.j_=Li.inputSpacing,this.N_=Li.labelTopHeight},$init:function(t){if(this.$ready.push(function(){var t=this.Vt.firstChild.childNodes[0],i=this.Vt.firstChild.childNodes[1];if(!this.P.label||!this.P.labelWidth&&"top"!=this.P.labelPosition)return t.style.display="none",i.style.padding="0 "+this.j_/2+"px",this.P.paddingX=this.j_,void(this.P.paddingY=0);"top"==this.P.labelPosition?(t.style.lineHeight=this.N_-this.P_+"px",t.className+=" "+this.defaults.$cssName+"_label_top",i.style.padding="0 "+this.j_/2+"px"):t.style.width=this.P.paddingX-this.j_/2+"px",t.style.textAlign=this.P.labelAlign,this.P.value&&this.setValue(this.P.value)}),"top"!=t.labelPosition){var i=R(t.labelWidth)?this.defaults.labelWidth:t.labelWidth;t.paddingX=i+this.j_}else t.paddingY=this.N_,t.paddingX=this.j_},labelWidth_setter:function(t){return t?Math.max(t,Li.dataPadding):0},setBottomText:function(t){var i=this.P;if(void 0!==t){if(i.bottomLabel==t)return;i.bottomLabel=t}var e=(i.invalid?i.invalidMessage:"")||i.bottomLabel;this.L_&&dt(this.L_),e&&(this.$view.style.position="relative",this.L_=ft("div",{"class":"webix_inp_bottom_label",role:i.invalid?"alert":"","aria-relevant":"all",style:"position:absolute; bottom:0px; padding:2px 0; background: white; left:"+(this.j_/2+(i.label?i.labelWidth:0))+"px; "},e),this.Vt.appendChild(this.L_))}};H.protoUI(rh,hh.view);function oh(t){return t.tagName?t.tagName.toLowerCase():null}function ah(t,i){if(!t.getAttribute)return null;var e=t.getAttribute(i);return e?e.toLowerCase():null}function uh(){var t=oh(this);return ch[t]?ch[t](this):ch.other(this)}var ch={radio:function(t){for(var i=0;i<t.length;i++)if(t[i].checked)return t[i].value;return""},input:function(t){return"checkbox"===ah(t,"type")?t.checked:t.value},textarea:function(t){return t.value},select:function(t){var i=t.selectedIndex;return t.options[i].value},other:function(t){return t.innerHTML}};function fh(t){var i=oh(this);return lh[i]?lh[i](this,t):lh.other(this,t)}var lh={radio:function(t,i){for(var e=0;e<t.length;e++)t[e].checked=t[e].value==i},input:function(t,i){"checkbox"===ah(t,"type")?t.checked=!!i:t.value=i},textarea:function(t,i){t.value=i},select:function(t,i){t.value=i,-1===t.selectedIndex&&(t.value=t.firstElementChild.value)},other:function(t,i){t.innerHTML=i}},dh={name:"htmlform",$init:function(t){this.elements={},this.O_=!1,t.content&&(t.container==t.content||!t.container&&t.content==document.body)&&(this.W_=!0)},content_setter:function(t){if(t=C(t),this.W_)for(;1<t.childNodes.length;)this.Vt.childNodes[0].appendChild(t.childNodes[0]);else this.Vt.childNodes[0].appendChild(t);return this.U_(),!0},render:function(){An.api.render.apply(
this,arguments),this.U_()},U_:function(){var t=this.Vt.querySelectorAll("[name]");this.elements={};for(var i=0;i<t.length;i++){var e=t[i],s=ah(e,"name");if(s){var n="button"===oh(e),h=ah(e,"type"),r=n||"button"===h||"submit"===h;if("radio"===h){var o=this.elements[s]||[];o.tagName="radio",o.push(e),e=o}(this.elements[s]=e).getValue=uh,e.setValue=fh,e.$allowsClear=!r}}return this.elements},nr:function(t,i){this.Qh(t,i);var e=this.Vt.querySelector('[name="'+t+'"]');e&&yt(e,"invalid")},Qh:function(t){var i=this.Vt.querySelector('[name="'+t+'"]');i&&Mt(i,"invalid")},focus:function(t){if(!t&&this.$view.contains(document.activeElement))return!1;bs.focus.apply(this,arguments)}},vh=(H.protoUI(dh,An.view,bs),{name:"property",$init:function(){this.Wi.className+=" webix_property",this.Wi.setAttribute("role","listbox"),this.Bt=[],this.attachEvent("onAfterEditStart",function(t){yt(this.getItemNode(t),"webix_focused")}),this.attachEvent("onAfterEditStop",function(t,i){Mt(this.getItemNode(i.config.id),"webix_focused")})},defaults:{nameWidth:100,editable:!0},on_render:{checkbox:function(t){return"<input type='checkbox' class='webix_property_check' "+(t?"checked":"")+">"},color:function(t){return'<div class="webix_property_col_val"><div class=\'webix_property_col_ind\' style="background-color:'+(t||"#FFFFFF")+';"></div><span>'+t+"</span></div>"}},on_edit:{label:!1},Qo:"webix_f_id",on_click:{webix_property_check:function(t){var i=this.locate(t);return this.getItem(i).value=!this.getItem(i).value,this.callEvent("onCheck",[i,this.getItem(i).value]),!1}},on_dblclick:{},registerType:function(t,i){if(R(i.template)||(this.on_render[t]=i.template),R(i.editor)||(this.on_edit[t]=i.editor),!R(i.click))for(var e in i.click)this.on_click[e]=i.click[e]},elements_setter:function(t){this.Y_={};for(var i=0;i<t.length;i++){var e=t[i];"multiselect"==e.type&&(e.optionslist=!0),e.id=e.id||V(),e.label=e.label||"",e.value=e.value||"",this.Y_[e.id]=i,this.Tu(t[i])}return t},showItem:function(t){Pe.showItem.call(this,t)},locate:function(){return _t(arguments[0],this.Qo)},getItemNode:function(t){return this.tt.childNodes[this.Y_[t]]},getItem:function(t){return this.P.elements[this.Y_[t]]},Ia:function(t){var i=this.getItem(t).type;if("checkbox"==i)return"inline-checkbox";var e=this.on_edit[i];return!1!==e&&(e||i)},Va:function(t){return this.getItem(t)},La:function(t,i,e){var s=this.Y_[t.id],n=this.P.elements;if(e){for(var h=s+1;h<n.length;h++)if(i.call(this,n[h].id))return n[h].id}else for(var r=s-1;0<=r;r--)if(i.call(this,n[r].id))return n[r].id;return null},updateItem:function(t,i){i=i||{};var e=this.getItem(t);e&&H.extend(e,i,!0),this.refresh()},at:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft+this.P.nameWidth,top:i.offsetTop,height:i.firstChild.offsetHeight,width:this.q_,parent:this.Wi}},G_:function(){for(var t=this.P.elements,i=0;i<t.length;i++)t[i].value=""},clear:function(){this.G_(),this.X_={},this.refresh()},setValues:function(t,i){var e=this;for(var s in this.P.complexData&&(t=Rt.collapseNames(t,"",{},function(t){return R(e.Y_[t])})),i||this.G_(),t){var n=this.getItem(s);n&&(n.value=t[s])}this.X_=t,this.refresh()},getValues:function(){for(var t=l(this.X_||{}),i=0;i<this.P.elements.length;i++){var e=this.P.elements[i];"label"!=e.type&&(t[e.id]=e.value)}return this.P.complexData&&(t=Rt.expandNames(t)),t},refresh:function(){this.render()},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&(this.q_=this.me-this.P.nameWidth,this.render())},$getSize:function(t,i){if(this.P.autoheight){var e=this.P.elements.length;this.P.height=Math.max(this.type.height*e,this.P.minHeight||0)}return Hi.api.$getSize.call(this,t,i)},Q:function(){var t=[],i=this.P.elements;if(i)for(var e=0;e<i.length;e++){var s=i[e];s.css&&"object"==M(s.css)&&(s.css=at(s.css));var n='<div webix_f_id="'+s.id+'"'+("label"!==s.type?'role="option" tabindex="0"':"")+' class="webix_property_line '+(s.css||"")+'">';if("label"==s.type)t[e]=n+"<div class='webix_property_label_line'>"+s.label+"</div></div>";else{var h,r=this.on_render[s.type],
o="<div class='webix_property_label' style='width:"+this.P.nameWidth+"px'>"+s.label+"</div><div class='webix_property_value' style='width:"+this.q_+"px'>";h=s.collection||s.options?s.template(s):s.format?s.format(s.value):s.value,r&&(h=r.call(this,s.value,s)),t[e]=n+o+h+"</div></div>"}}return t.join("")},type:{height:24,templateStart:Yt(""),templateEnd:Yt("</div>")},$skin:function(){this.type.height=Li.propertyItemHeight}}),_h=(H.protoUI(vh,Pi,Se,Ve,ze,je,Ri,Ht,g,Hi.view),{name:"calendar",defaults:{date:new Date,navigation:!0,monthSelect:!0,weekHeader:!0,monthHeader:!0,weekNumber:!1,skipEmptyWeeks:!1,calendarHeader:"%F %Y",events:sn.isHoliday,minuteStep:5,timeIcon:"wxi-clock",icons:!1,timepickerHeight:30,headerHeight:30,dayTemplate:function(t){return t.getDate()},width:260,height:250},dayTemplate_setter:Yt,calendarHeader_setter:sn.dateToStr,calendarTime_setter:function(t){return this.J_=t,sn.dateToStr(t)},date_setter:function(t){return this.Id(t)},maxDate_setter:function(t){return this.Id(t)},minDate_setter:function(t){return this.Id(t)},minTime_setter:function(t){return"string"==typeof t&&(t=[(t=I.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},maxTime_setter:function(t){return"string"==typeof t&&(t=[(t=I.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},K_:function(){var t="focus"+(q.isIE?"in":"");q.touch||Kt(this.$view,t,S(function(t){var i=t.target.className,e=-1!==i.indexOf("webix_cal_day")?"webix_cal_day":-1!==i.indexOf("webix_cal_block")?"webix_cal_block":"";if(300<new Date-Mi.ci&&100<new Date-Mi.fi&&e){var s=t.relatedTarget;if(s&&!R(s.className)){var n="webix_cal_day"==e?this.Z_(t.target):this.Q_(t.target);this.hu(n)}}},this),{capture:!q.isIE})},$init:function(){this.Vt.className+=" webix_calendar",this.Vt.setAttribute("role","region"),this.Vt.setAttribute("aria-label",I.aria.calendar),this.tp={},this.ip={},this.gd=0,this.K_(),this.attachEvent("onKeyPress",this.ke)},minuteStep_setter:function(t){return Math.max(Math.min(t,60),this.defaults.minuteStep)},type_setter:function(t){return"time"==t?(this.ep=!0,this.gd=-1):"year"==t&&(this.sp=!0),t},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.render()},$getSize:function(t,i){var e=this.P;if(e.cellHeight&&!e.type){var s=this.np(e.date);e.height=e.cellHeight*s.hp+e.headerHeight+(e.weekHeader?Li.calendarWeekHeaderHeight:0)+(e.timepicker||this.Ad?e.timepickerHeight:0)+2*(this.rp+Li.borderWidth)}return Hi.api.$getSize.call(this,t,i)},moveSelection:function(t,i,e){if(!this.config.master){var s=this.getSelectedDate();this.config.multiselect&&(s=s[0]);var n=sn.copy(s||this.getVisibleDate());this.hu(n,t,e)}},hu:function(t,i,e){var s=this.jd[this.gd].op(t,i,this);if(!1!==e){var n=this.Vt.querySelector("."+s+"[tabindex='0']");n&&n.focus()}},np:function(t,i){if(!this.ap||i){var e=t.getMonth(),s=t.getFullYear(),n=new Date(s,e+1,1),h=sn.weekStart(new Date(s,e,1)),r=Math.round((n.valueOf()-h.valueOf())/864e5),o=this.P.skipEmptyWeeks?Math.ceil(r/7):6;this.ap={cp:e,fp:h,cd:n,hp:o}}return this.ap},$skin:function(){Li.calendar&&(Li.calendar.width&&(this.defaults.width=Li.calendar.width),Li.calendar.height&&(this.defaults.height=Li.calendar.height),Li.calendar.headerHeight&&(this.defaults.headerHeight=Li.calendar.headerHeight),Li.calendar.timepickerHeight&&(this.defaults.timepickerHeight=Li.calendar.timepickerHeight)),this.rp=Li.layoutPadding.form},lp:function(t){for(var i=this.np(t),e=this.P,s=[],n=[],h=Infinity,r=this.me-2*(this.rp+Li.borderWidth),o=this.we-(e.monthHeader?e.headerHeight:0)-(e.weekHeader?Li.calendarWeekHeaderHeight:0)-(e.timepicker||this.Ad?e.timepickerHeight:0)-2*(this.rp+Li.borderWidth),a=e.weekNumber?8:7,u=0;u<a;u++)n[u]=Math.ceil(r/(a-u)),r-=n[u],h=Math.min(h,n[u]);for(var c=i.hp,f=0;f<c;f++)s[f]=Math.ceil(o/(c-f)),o-=s[f],h=Math.min(h,s[f]);return[n,s,h]},icons_setter:function(t){t?"object"==M(t)?this.Ad=t:this.Ad=this.vp:this.Ad=null},Ad:[],vp:[{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+I.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date
;this.P.timepicker||(t=sn.datePart(t)),this.setValue(t),this.callEvent("onTodaySet",[this.getSelectedDate()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+I.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue(""),this.callEvent("onDateClear",[this.getSelectedDate()])}}}],refresh:function(){this.render()},render:function(){this.gd=0,this._p=!1;var t=this.P;if(this.isVisible(t.id)){this.pp=sn.datePart(new Date),this.callEvent("onBeforeRender",[]);var i=this.P.date,e=this.np(i,!0),s=this.lp(i),n=this.rp+"px",h=s[0],r=s[1],o="";if(t.monthHeader&&(o+="<div class='webix_cal_month' style='margin:0 "+n+"'><span aria-live='assertive' aria-atomic='true' class='webix_cal_month_name"+(t.monthSelect&&t.navigation?"' role='button' tabindex='0'":" webix_readonly'")+">"+t.calendarHeader(i)+"</span>",t.navigation&&(o+="<div role='button' tabindex='0' aria-label='"+I.aria.navMonth[0]+"' class='webix_cal_prev_button'></div><div role='button' tabindex='0' aria-label='"+I.aria.navMonth[1]+"' class='webix_cal_next_button'></div>"),o+="</div>"),t.weekHeader&&(o+="<div class='webix_cal_header' style='margin:0 "+n+"' aria-hidden='true'>"+this.bp(h)+"</div>"),o+="<div class='webix_cal_body' style='margin:0 "+n+"'>"+this.mp(h,r,e,s[2])+"</div>",(this.P.timepicker||this.Ad)&&(o+="<div class='webix_cal_footer' style='margin:0 "+n+"'>",this.P.timepicker&&(o+=this.gp(i)),this.Ad&&(o+=this.Fd()),o+="</div>"),this.Wi.innerHTML=o,this.Wi.firstChild.style.marginTop=n,"time"==this.P.type){var a=this.P.date;a&&("string"==typeof a?i=I.parseTimeFormatDate(a):$(a)&&(i.setHours(a[0]),i.setMinutes(a[1]))),this.wp(-1,i)}else"month"==this.P.type?this.wp(1,i):"year"==this.P.type&&this.wp(2,i);this.callEvent("onAfterRender",[])}},Fd:function(t){for(var i="<div class='webix_cal_icons'>",e=this.Ad,s=0;s<e.length;s++){if(e[s].template){var n="function"==typeof e[s].template?e[s].template:n(e[s].template);i+=n.call(this,t)}e[s].on_click&&H.extend(this.on_click,e[s].on_click)}return i+="</div>"},gp:function(t){var i=this.P.calendarTime||I.timeFormatStr,e=this.P.timeIcon,s="";if(this.P.master){var n=_(oi(this.P.master).P.value);for(var h in sn.equal(n.end,t)&&(n.start=n.end),n)s+="<div role='button' tabindex='0' class='webix_range_time_"+h+" webix_cal_time'><span class='webix_icon "+e+"'></span> "+i(n[h])+"</div>"}else s="<div role='button' tabindex='0' class='webix_cal_time"+(this.Ad?" webix_cal_time_icons":"")+"'><span class='webix_icon "+e+"'></span> "+i(t)+"</div>";return s},bp:function(t){var i=this.P,e="",s=0;i.weekNumber&&(s=1,e+="<div class='webix_cal_week_header' style='width: "+t[0]+"px;' >"+(i.calendarWeekHeader||"")+"</div>");for(var n=sn.startOnMonday?1:0,h=0;h<7;h++){var r=(n+h)%7,o=I.calendar.dayShort[r];e+="<div day='"+r+"' style='width: "+t[h+s]+"px;' >"+o+"</div>"}return e},blockDates_setter:function(t){return v(t,this.$scope)},xp:function(t,i){var e="",s=!1;return sn.equal(t,this.pp)&&(e+=" webix_cal_today"),this.yp(t)||(e+=" webix_cal_day_disabled"),t.getMonth()!=i.cp&&(s=!0,e+=" webix_cal_outside"),!s&&this.Mp(t)&&(e+=" webix_cal_select"),this.P.events&&(e+=" "+(this.P.events(t,s)||"")),e+=" webix_cal_day"},mp:function(t,i,e,s){for(var n=this.P,h="",r=sn.datePart(sn.copy(e.fp)),o=n.weekNumber?1:0,a=sn.getISOWeek(sn.add(r,2,"day",!0)),u=0;u<i.length;u++){h+="<div class='webix_cal_row' style='height:"+i[u]+"px;line-height:"+i[u]+"px'>",o&&(!r.getMonth()&&r.getDate()<7&&(a=sn.getISOWeek(sn.add(r,2,"day",!0))),h+="<div class='webix_cal_week_num' aria-hidden='true' style='width:"+t[0]+"px'>"+a+"</div>");for(var c=o;c<t.length;c++){var f=this.xp(r,e),l=this.P.dayTemplate.call(this,r),d=this.Mp(r),v="",_=r.getMonth()!=e.cp;"object"==M(l)?(v=l.aria||v,l=l.text):v=sn.dateToStr(I.aria.dateFormat)(r),h+="<div day='"+c+"' role='gridcell' "+(_?"aria-hidden='true'":"")+" aria-label='"+v+"' tabindex='"+(d&&!_?"0":"-1")+"' aria-selected='"+(d&&!_?"true":"false"
)+"' class='"+f+"' style='text-align:center; width:"+t[c]+"px'><span aria-hidden='true' class='webix_cal_day_inner' style='display:inline-block; "+this.Sp(s,s)+"'>"+l+"</span></div>",(r=sn.add(r,1,"day")).getHours()&&(r=sn.datePart(r))}h+="</div>",a++}return h},Ld:function(t,i){var e=this.P.date;i||(i=this.jd[this.gd].Pd),this.gd||(e=sn.copy(e)).setDate(1);var s=sn.add(e,t*i,"month",!0);this.kp(e,s)},kp:function(t,i){this.callEvent("onBeforeMonthChange",[t,i])&&(this.gd?this.Cp(i):this.showCalendar(i),this.callEvent("onAfterMonthChange",[i,t]))},jd:{"-2":{$p:function(t){var i=this.P,e=i.date,s=!1,n=i.minTime?i.minTime[0]:0,h=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24,r=i.minTime&&e.getHours()==n?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&e.getHours()==h-1?i.maxTime[1]:60;if(this.P.blockTime){var a=sn.copy(e);a.setMinutes(t),s=this.P.blockTime(a)}return t<r||o<=t||s},Dp:function(t,i){t.setMinutes(i)},Ip:function(t,i,e){if(!this.$p.call(e,t.getMinutes()))return t;var s=e.P.minuteStep,n=sn.add(t,"right"==i?s:-s,"minute",!0);return t.getHours()===n.getHours()?this.Ip(n,i,e):void 0}},"-1":{$p:function(t){var i=this.P,e=i.date,s=i.minTime?i.minTime[0]:0,n=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24;if(t<s||n<=t)return!0;if(i.blockTime){var h=sn.copy(e);h.setHours(t);for(var r=i.minTime&&t==s?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&t==n-1?i.maxTime[1]:60,a=r;a<o;a+=i.minuteStep)if(h.setMinutes(a),!i.blockTime(h))return!1;return!0}},Dp:function(t,i){t.setHours(i)},op:function(t,i,e){var s,n,h=e.P.minuteStep;return"bottom"===i||"top"===i?(t.setHours("bottom"===i?23:0),t.setMinutes("bottom"===i?55:0),t.setSeconds(0),t.setMilliseconds(0),s=t):"left"===i||"right"===i?(n="right"===i?h:-h,"left"===i&&t.getMinutes()<h&&(n=60-h),"right"===i&&t.getMinutes()>=60-h&&(n=h-60),n-=t.getMinutes()%h,s=e.jd[-2].Ip(sn.add(t,n,"minute"),i,e)):"up"===i||"down"===i?(n="down"===i?1:-1,"down"===i&&23===t.getHours()&&(n=-23),"up"===i&&0===t.getHours()&&(n=23),s=this.Ip(sn.add(t,n,"hour"),i,e)):!1===i&&(s=this.Ip(t,i,e)),e.selectDate(s,!1),s&&(e.Cp(s),e.selectDate(s,!1)),"webix_cal_block"+("left"===i||"right"===i?"_min":"")},Ip:function(t,i,e){if(!this.$p.call(e,t.getHours()))return t;var s=sn.add(t,"down"==i?1:-1,"hour",!0);return t.getDate()===s.getDate()?this.Ip(s,i,e):void 0}},0:{Pd:1,op:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=sn.add(t,"pgdown"===i?1:-1,"month"):"bottom"===i?s=new Date(t.getFullYear(),t.getMonth()+1,0):"top"===i?s=new Date(t.setDate(1)):"left"===i||"right"===i?s=sn.add(t,"right"===i?1:-1,"day"):"up"!==i&&"down"!==i||(s=sn.add(t,"down"===i?1:-1,"week")),e.yp(s)||(s=e.Ip(t,i)),s&&e.selectDate(s,!0),"webix_cal_day"}},1:{$p:function(t,i){var e=!1,s=i.P.minDate,n=i.P.maxDate,h=i.P.date.getFullYear();if(s){var r=s.getFullYear();e=h<r||h==r&&s.getMonth()>t}if(n&&!e){var o=n.getFullYear();e=o<h||h==o&&n.getMonth()<t}return e},dl:function(t,i){return(t=sn.monthStart(t))<i.P.minDate?t=sn.copy(i.P.minDate):t>i.P.maxDate&&(t=sn.copy(i.P.maxDate)),t},Ap:function(t){return t.getFullYear()},Fp:function(t){return I.calendar.monthShort[t]},Dp:function(t,i){i!=t.getMonth()&&t.setDate(1),t.setMonth(i)},Pd:12,op:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=sn.add(t,"pgdown"===i?1:-1,"year"):"bottom"===i?s=new Date(t.setMonth(11)):"top"===i?s=new Date(t.setMonth(0)):"left"===i||"right"===i?s=sn.add(t,"right"===i?1:-1,"month"):"up"!==i&&"down"!==i||(s=sn.add(t,"down"===i?4:-4,"month")),s=e.dl(s),e.yp(s)||(s=e.Ip(t,i)),s&&(e.Cp(s),e.selectDate(s,!1)),"webix_cal_block"}},2:{$p:function(t,i){t+=i.Tp;var e=i.P.minDate,s=i.P.maxDate;return!!(e&&e.getFullYear()>t||s&&s.getFullYear()<t)},dl:function(t,i){return(t=sn.yearStart(t))<i.P.minDate?t=sn.copy(i.P.minDate):t>i.P.maxDate&&(t=sn.copy(i.P.maxDate)),t},Ap:function(t,i){var e=t.getFullYear();return i.Tp=e=e-e%10-1,e+" - "+(e+10+1)},Fp:function(t,i){return i.Tp+t},Dp:function(t,i,e){t.setFullYear(e.Tp+i)},Pd:120,op:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=sn.add(t,"pgdown"===i?10:-10,"year"):"bottom"===i?s=new Date(t.setYear(e.Tp+10)):"top"===i?s=new Date(
t.setYear(e.Tp)):"left"===i||"right"===i?s=sn.add(t,"right"===i?1:-1,"year"):"up"!==i&&"down"!==i||(s=sn.add(t,"down"===i?4:-4,"year")),s=e.dl(s),e.yp(s)||(s=e.Ip(t,i)),s&&(e.Cp(s),e.selectDate(s,!1)),"webix_cal_block"}}},Vp:function(){var t;if(this.jd[-1].$p.call(this,this.P.date.getHours()))for(t=0;t<24;t++)if(!this.jd[-1].$p.call(this,t)){this.P.date.setHours(t);break}if(this.jd[-2].$p.call(this,this.P.date.getMinutes()))for(t=0;t<60;t+=this.P.minuteStep)if(!this.jd[-2].$p.call(this,t)){this.P.date.setMinutes(t);break}},Cp:function(t){var i,e,s,n,h,r,o,a,u,c,f,l,d="",v=this.rp+"px";if(h=2-((i=this.P).weekHeader?0:1)-(i.monthHeader?0:1),c=this.jd[this.gd],r=this.Wi.childNodes,t&&(i.date=t),a=i.type,this._p||(this.zp=this.Wi.offsetHeight-(i.monthHeader||this.ep?i.headerHeight:0)-2*(this.rp+Li.borderWidth),"year"!=a&&"month"!=a&&(this.zp-=i.timepickerHeight),this.Bp=r[h].offsetWidth,this._p=1),this.ep){s=this.zp/6;var _=6,p=(this.J_||I.timeFormat).match(/%([a,A])/);for(p&&_++,u=parseInt((this.Bp-3)/_,10),l=Math.min(u,s),d+="<div class='webix_time_header' style='margin:0 "+v+"'>"+this.Hp(u,p)+"</div>",d+="<div  class='webix_cal_body' style='height:"+this.zp+"px; margin:0 "+v+";'>",this.Vp(),d+="<div class='webix_hours'>",o=i.date.getHours(),f=sn.copy(i.date),n=0;n<24;n++){if(e="",p&&n%4==0){var b=n?12==n?I.pm[0]:"":I.am[0];d+="<div class='webix_cal_block_empty"+e+"' style='"+this.Sp(u,s)+"clear:both;'>"+b+"</div>"}this.jd[-1].$p.call(this,n)?e+=" webix_cal_day_disabled":o==n&&(e+=" webix_selected"),f.setHours(n),d+="<div aria-label='"+sn.dateToStr(I.aria.hourFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block"+e+"' data-value='"+n+"' style='"+this.Sp(u,s)+(n%4!=0||p?"":"clear:both;")+"'><span style='display:inline-block; "+this.Sp(l,l)+"'>"+sn.toFixed(p?n&&12!=n?n%12:12:n)+"</span></div>"}for(d+="</div>",d+="<div class='webix_minutes'>",o=i.date.getMinutes(),f=sn.copy(i.date),n=0;n<60;n+=i.minuteStep)e="",this.jd[-2].$p.call(this,n)?e=" webix_cal_day_disabled":o==n&&(e=" webix_selected"),f.setMinutes(n),d+="<div aria-label='"+sn.dateToStr(I.aria.minuteFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block webix_cal_block_min"+e+"' data-value='"+n+"' style='"+this.Sp(u,s)+(n/i.minuteStep%2==0?"clear:both;":"")+"'><span style='display:inline-block; "+this.Sp(l,l)+"'>"+sn.toFixed(n)+"</span></div>";d+="</div>",d+="</div>",d+="<div class='webix_time_footer' style='margin:0 "+v+"'>"+this.Rp()+"</div>",this.Wi.innerHTML=d,this.Wi.firstChild.style.marginTop=v}else{if(i.monthHeader){var m=r[0].childNodes,g=I.aria["nav"+(1==this.gd?"Year":"Decade")];m[0].innerHTML=c.Ap(i.date,this),m[0].blur(),i.navigation&&(m[1].setAttribute("aria-label",g[0]),m[2].setAttribute("aria-label",g[1]))}else c.Ap(i.date,this);for(s=Math.floor(this.zp/3),u=Math.floor(this.Bp/4),l=Math.min(s,u),this.yp(i.date)&&(o=1==this.gd?i.date.getMonth():i.date.getFullYear()),n=0;n<12;n++){e=o==(1==this.gd?n:c.Fp(n,this))?" webix_selected":"",c.$p(n,this)&&(e+=" webix_cal_day_disabled");var w=I.aria[(1==this.gd?"month":"year")+"Format"];d+="<div role='gridcell' aria-label='"+sn.dateToStr(w)(i.date)+"' tabindex='"+(-1!==e.indexOf("selected")?"0":"-1")+"' aria-selected='"+(-1!==e.indexOf("selected")?"true":"false")+"' class='webix_cal_block"+e+"' data-value='"+n+"' style='"+this.Sp(u,s)+"'><span style='display:inline-block; "+this.Sp(l,l)+"'>"+c.Fp(n,this)+"</span></div>"}i.weekHeader&&(r[h-1].style.display="none",1===h&&(r[h].style.marginTop=v)),r[h].innerHTML=d,"year"!=a&&"month"!=a?r[h+1]?r[h+1].innerHTML=this.Rp():this.Wi.innerHTML+="<div class='webix_time_footer' style='margin:0 "+v+"'>"+this.Rp()+"</div>":r[h+1]&&(r[h+1].style.display="none"),r[h].style.height=this.zp+"px"}},Sp:function(t,i){return"width:"+t+"px; height:"+i+"px; line-height:"+i+"px;"},Rp:function(){return"<input type='button' style='width:100%' class='webix_cal_done' value='"+I.calendar.done+"'>"},Hp:function(t,i){var e=2*t
;return"<div class='webix_cal_hours' style='width:"+t*(i?5:4)+"px'>"+I.calendar.hours+"</div><div class='webix_cal_minutes' style='width:"+e+"px'>"+I.calendar.minutes+"</div>"},wp:function(t,i){var e=this.gd;this.callEvent("onBeforeZoom",[t,e])&&((this.gd=t)?this.Cp(i):this.showCalendar(i),this.callEvent("onAfterZoom",[t,e]))},dl:function(t){return!this.yp(t)&&this.jd[this.gd].dl&&(t=this.jd[this.gd].dl(t,this)),t},Ep:function(t){var i=this.Q_(t),e=this.gd-(this.sp?0:1);if(i=this.dl(i),this.yp(i)){this.wp(e,i);var s=this.P.type;"month"!=s&&"year"!=s||this.Pp(i)}},Pp:function(t,i){this.callEvent("onBeforeDateSelect",[t])&&(this.selectDate(t,!0,i),this.callEvent("onDateSelect",[t]),this.callEvent("onAfterDateSelect",[t]))},Z_:function(t){var i=ot(t)-(this.P.weekNumber?1:0),e=ot(t.parentNode),s=sn.add(this.np().fp,i+7*e,"day",!0);return this.P.timepicker&&(s.setHours(this.P.date.getHours()),s.setMinutes(this.P.date.getMinutes())),s},Q_:function(t){var i=1*t.getAttribute("data-value"),e=-1!=t.className.indexOf("webix_cal_block_min")?this.gd-1:this.gd,s=this.P.date,n=sn.copy(s);return this.jd[e].Dp(n,i,this),n},on_click:{webix_cal_prev_button:function(){this.Ld(-1)},webix_cal_next_button:function(){this.Ld(1)},webix_cal_day_disabled:function(){return!1},webix_cal_outside:function(){if(!this.P.navigation)return!1},webix_cal_day:function(t,i,e){var s=this.Z_(e),n="touch"===this.P.multiselect||t.ctrlKey||t.metaKey;this.Pp(s,n)},webix_cal_time:function(){if(this.jd[this.gd-1]){this.ep=!0;var t=this.gd-1;this.wp(t)}},webix_range_time_start:function(){oi(this.P.master).Ed="start"},webix_range_time_end:function(){oi(this.P.master).Ed="end"},webix_cal_done:function(){var t=sn.copy(this.P.date);t=this.dl(t),this.Pp(t)},webix_cal_month_name:function(){if(this.P.navigation&&(this.ep=!1,2!=this.gd&&this.P.monthSelect)){var t=Math.max(this.gd,0)+1;this.wp(t)}},webix_cal_block:function(t,i,e){if(this.ep){if(-1!==e.className.indexOf("webix_cal_day_disabled"))return!1;var s=this.Q_(e);this.Cp(s)}else-1==e.className.indexOf("webix_cal_day_disabled")&&this.Ep(e)}},Id:function(t,i){return t?("string"==typeof t&&(t=i?sn.strToDate(i)(t):I.parseFormatDate(t)),t):sn.datePart(new Date)},yp:function(t){var i=this.P.blockDates&&this.P.blockDates.call(this,t),e=this.P.minDate,s=this.P.maxDate;return!i&&!(t<e||s<t)},Ip:function(t,i){var e,s="top"===i||"left"===i||"pgup"===i||"up"===i?-1:1,n=sn.add(t,s,"day",!0);return this.yp(n)?n:(0===this.gd?e=t.getMonth()===n.getMonth():1===this.gd?e=t.getFullYear()===n.getFullYear():2===this.gd&&(e=n.getFullYear()>this.Tp&&n.getFullYear()<this.Tp+10),e?this.Ip(n,i):void 0)},showCalendar:function(t){t=this.Id(t),this.P.date=t,this.render(),this.resize()},Mp:function(t){return t&&this.ip[t.valueOf()]},getSelectedDate:function(){var t=[];for(var i in this.ip)t.push(sn.copy(this.ip[i]));return this.config.multiselect?t:t[0]||null},getVisibleDate:function(){return sn.copy(this.P.date)},setValue:function(t){this.selectDate(t,!0)},getValue:function(t){var i=this.getSelectedDate();return t&&(i=sn.dateToStr(t)(i)),i},selectDate:function(t,i,e){if(t&&e&&this.config.multiselect||(this.ip={}),t){$(t)||(t=[t]);for(var s=0;s<t.length;s++){var n=this.Id(t[s]),h=sn.datePart(sn.copy(n)).valueOf();if(this.ip[h]&&e?delete this.ip[h]:this.ip[h]=n,!this.config.multiselect)break}t.length&&i&&this.showCalendar(t[0])}!1!==i&&this.render(),this.callEvent("onChange",[t])},locate:function(){return null}}),ph=(H.protoUI(_h,Te,ze,Hi.view,g),{name:"colorboard",defaults:{template:function(t){return'<div class="webix_color_item" style="background-color:'.concat(t.val,';"></div>')},palette:null,height:250,width:260,cols:11,rows:10,minLightness:.15,maxLightness:1,navigation:!0,grayScale:!0,type:"material"},$init:function(){Kt(this.Vt,"click",S(function(t){var i=_t(t.target.parentNode,"webix_val");if(i){var e=this.P.value;i=this.setValue(i),this.callEvent("onItemClick",[i,t]),i!=e&&this.callEvent("onSelect",[i])}},this)),this.$view.setAttribute("role","grid"),this.Vt.setAttribute("aria-readonly","true")},jp:function(){return["#F34336","#FF9700",
"#FFEA3B","#4CB050","#009788","#00BCD4","#2196F3","#3F51B5","#673BB7","#9C28B1","#EA1E63"]},wu:function(){this.getValue()||this.moveSelection("up")},Np:function(t){var i=this.P.palette;t=(t||"").toUpperCase();for(var e=0,s=i.length;e<s;e++)for(var n=0,h=i[e].length;n<h;n++)if(i[e][n].toUpperCase()==t)return{row:e,col:n};return null},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.P.value},Lp:function(){return this.Vt.firstChild},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},value_setter:function(t){return this.$prepareValue(t)},setValue:function(t){t=this.$prepareValue(t);var i=this.P.value;return this.P.value=t,this.$setValue(t,i),t},$setValue:function(t,i){if(this.isVisible(this.P.id)){var e,s;i&&(s=this.Np(i)),s||(s={row:0,col:0});var n=this.Op(s);this.Wp(n,!1),(s=this.Np(t))&&(e=this.Op(s))&&this.Wp(e,!0)}},Op:function(t){return this.Vt.lastChild.childNodes[t.row].childNodes[t.col]},Wp:function(t,i){i?(t.setAttribute("tabindex","0"),t.setAttribute("aria-selected","true"),yt(t,"webix_color_selected")):(t.setAttribute("tabindex","-1"),t.removeAttribute("aria-selected"),Mt(t,"webix_color_selected"))},Up:function(t){return Le.toHex(t,2)},Yp:function(t,i,e){return"#"+this.Up(Math.floor(t))+this.Up(Math.floor(i))+this.Up(Math.floor(e))},qp:function(t,i,e){var s,n,h;if(i){var r=e<.5?e*(1+i):e+i-e*i,o=2*e-r;s=this.Gp(o,r,t+1/3),n=this.Gp(o,r,t),h=this.Gp(o,r,t-1/3)}else s=n=h=e;return{r:255*s,g:255*n,b:255*h}},Gp:function(t,i,e){return e<0&&(e+=1),1<e&&(e-=1),e<1/6?t+6*(i-t)*e:e<=.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t},Xp:function(t,i){return{r:t[0]*i+255*(1-i),g:t[1]*i+255*(1-i),b:t[2]*i+255*(1-i)}},Jp:function(t){for(var i=[],e=255,s=e/t,n=0;n<t;n++)e=Math.round(0<e?e:0),i.push(this.Yp(e,e,e)),e-=s;return i[i.length-1]="#000000",i},Kp:function(t){var i=this.jp();t.cols=i.length;var e=[],s=t.rows-1,n=1/t.rows,h=null;if(this.P.grayScale){var r=this.Jp(t.cols);e.push(r.reverse())}e.push(i);for(var o=0,a=t.maxLightness;o<s;o++){a-=n,h=[];for(var u=0;u<t.cols;u++){var c=Le.toRgb(i[u]),f=this.Xp(c,a);h.push(this.Yp(f.r,f.g,f.b))}e.push(h)}this.P.palette=e},Zp:function(t){var i=[],e=t.rows-1,s=1/t.cols,n=(t.maxLightness-t.minLightness)/e,h=null;this.P.grayScale&&i.push(this.Jp(t.cols));for(var r=0,o=t.minLightness;r<e;r++){h=[];for(var a=0,u=0;a<t.cols;a++){var c=this.qp(u,1,o);h.push(this.Yp(c.r,c.g,c.b)),u+=s}i.push(h),o+=n}this.P.palette=i},moveSelection:function(t,i,e){var s,n,h=this.getValue();if(h&&(s=this.Np(h)),s||(s={row:0,col:0}),s){if("up"==t||"down"==t?s.row=s.row+("up"==t?-1:1):"right"==t||"left"==t?s.col=s.col+("right"==t?1:-1):"top"==t?s.row=s.col=0:"bottom"==t&&(s.row=this.Vt.lastChild.querySelectorAll(".webix_color_row").length-1,s.col=this.Vt.lastChild.childNodes[s.row].childNodes.length-1),s.row=Math.max(s.row,0),0<=s.row){var r=this.Vt.lastChild.childNodes[s.row];r&&(n=r.childNodes[s.col])}if(n&&(h=n.getAttribute("webix_val"),this.setValue(h),this.callEvent("onSelect",[this.P.value]),!1!==e)){var o=this.Vt.querySelector("div[tabindex='0']");o&&o.focus()}}},Qp:function(t,i,e){for(var s={width:0,height:0,val:0},n='<div class="webix_color_row" role="row">',h=0;h<t.length;h++)s.width=i[h],s.height=e,s.val=t[h],n+=this.tb(s);return n+="</div>"},tb:function(t){var i=Yt(this.P.template||"");return'<div role="gridcell" tabindex="-1" aria-label="'.concat(t.val,'" style="width:').concat(t.width,"px;height:").concat(t.height,'px;" ',"webix_val",'="').concat(t.val,'">').concat(i(t),"</div>")},render:function(){if(this.isVisible(this.P.id)){var t=this.P.type;this.P.palette||("classic"===t?this.Zp(this.P):this.Kp(this.P));var i=this.P.palette;this.callEvent("onBeforeRender",[]);for(var e="classic"===t?0:Li.colorPadding,s="object"==M(i[0]),n=s?i[0]:i,h=2*e+e*(n.length-1),r=2*e+e*(s?i.length-1:0),o=this.$width-h,a=this.$height-r,u=[],c='<div class="webix_color_palette '.concat("webix_palette_"+t,'" role="rowgroup">'),f=0;f<n.length;f++)u[f]=Math.floor(o/(n.length-f)),o-=u[f];if("object"==M(i[0]))for(
var l=0;l<i.length;l++){var d=Math.floor(a/(i.length-l));a-=d;var v=i[l];c+=this.Qp(v,u,d)}else c+=this.Qp(i,u,a);c+="</div>",this.Vt.innerHTML=c,this.P.value?this.$setValue(this.P.value):this.Vt.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0"),this.callEvent("onAfterRender",[])}},refresh:function(){this.render()}}),bh=(H.protoUI(ph,Te,Hi.view,g),{name:"colorselect",defaults:{width:260,height:250,value:"#751FE0"},$init:function(t){this.ib=this.eb=this.sb=0,this.nb=10,this.hb=16,this.attachEvent("onAfterRender",function(){var n=this;this.rb=this.Vt.querySelector(".webix_color_circle"),this.ob=this.Vt.querySelector(".webix_color_line_circle"),this.ab=this.Vt.querySelector(".webix_color_block"),this.ub=this.Vt.querySelector(".webix_color_line"),this.cb=this.Vt.querySelector(".webix_color_out_text"),this.fb=this.Vt.querySelector(".webix_color_out_block"),this.lb=pt(this.ab),q.touch?this.attachEvent("onTouchStart",function(t,i){var e=t.target.className,s=t.target.parentNode.className;"webix_color_block"==e||"webix_color_block"==s?n.db(i||t):0==e.indexOf("webix_color_line")&&n.db(i||t,!0)}):(Kt(this.ab,"mousedown",function(t){return n.db(t)}),Kt(this.ub,"mousedown",function(t){return n.db(t,!0)})),Kt(this.cb,"change",function(){return n.setValue(n.cb.value)}),t.button&&Kt(this.Vt.querySelector(".webix_button"),"click",function(){n.callEvent("onColorSelect",[n.getValue()])})})},$skin:function(){this.vb="compact"==Oi||"mini"==Oi?24:32},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.P.value},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},value_setter:function(t){return this.$prepareValue(t)},setValue:function(t){t=this.$prepareValue(t);var i=this.P.value;i!=t&&(this.P.value=t,this.$setValue(t),this.callEvent("onChange",[t,i]))},$setValue:function(t){if(this.isVisible(this.P.id)){var i=Le.toRgb(t),e=Le.rgbToHsv.apply(Le,o(i));this.ib=e[0],this.eb=e[1],this.sb=e[2];var s=this.ib*this.lb.width/360;this.ob.style.left=s-this.hb/2+"px";var n=this.eb*(this.lb.width-this.nb),h=Math.abs((this.lb.height-this.nb)*(this.sb-1));this.rb.style.left=n+"px",this.rb.style.top=h+"px",this._b(),this.pb(i,t),this.bb()}},pb:function(t,i){t||(t=Le.hsvToRgb(this.ib,this.eb,this.sb)),i||(i="#"+Le.rgbToHex(t)),this.fb.style.backgroundColor="rgb(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")"),this.cb.value=i.toUpperCase(),this.mb=i},bb:function(){var t=Le.hsvToRgb(this.ib,1,1),i="rgb(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")");this.ob.style.backgroundColor=i,this.ab.style.backgroundColor=i},gb:function(t){if("webix_color_circle"!=t.target.className||q.touch){var i=q.touch?{x:t.x-this.nb/2,y:t.y-this.nb/2}:mt(t),e=i.x-this.lb.x,s=i.y-this.lb.y;e=Math.max(Math.min(e,this.lb.width-this.nb),0),s=Math.max(Math.min(s,this.lb.height-this.nb),0),this.rb.style.left=e+"px",this.rb.style.top=s+"px";var n=(this.lb.width-this.nb)/100,h=(this.lb.height-this.nb)/100,r=Math.ceil(e/n)/100,o=Math.ceil(Math.abs(s/h-100))/100;this.eb=r,this.sb=o,this._b(),this.pb()}},_b:function(){.7<this.sb&&this.eb<.3?this.rb.style.borderColor="#475466":this.rb.style.borderColor="#fff"},wb:function(t,i){if("webix_color_line_circle"!=t.target.className||i){var e=this.hb/2,s=(q.touch?t.x:mt(t).x)-this.lb.x;s=Math.max(Math.min(s,this.lb.width-e),0-e),this.ob.style.left=s+"px";var n=Math.round(360*s/this.lb.width);this.ib=Math.min(Math.max(n,0),360),this.pb(),this.bb()}},db:function(t,e){var s=this;e?this.wb(t):this.gb(t),q.touch?this.xb=[this.attachEvent("onTouchMove",function(t,i){return s.yb(i||t,e)}),this.attachEvent("onTouchEnd",function(){return s.Mb()})]:this.xb=[Zt(document.body,"mousemove",function(t){return s.yb(t,e)}),Zt(window,"mouseup",function(){return s.Mb()})],yt(document.body,"webix_noselect")},yb:function(t,i){i?this.wb(t,!0):this.gb(t)},Mb:function(){this.xb&&(q.touch?(this.detachEvent(this.xb[0]),this.detachEvent(this.xb[1])):(Qt(this.xb[0]),Qt(this.xb[1])),this.xb=null,this.setValue(this.mb)),Mt(document.body,
"webix_noselect")},render:function(){if(this.isVisible(this.P.id)){this.callEvent("onBeforeRender",[]);var t=(this.$width-3*Li.dataPadding)/2,i=this.$height-24-32-this.vb-(this.P.button?this.vb+12:0),e='<div class="webix_color_area">';e+='\n\t\t\t<div class="webix_color_block" style="height:'.concat(i,'px;">\n\t\t\t\t<div class="webix_color_circle" id="circle"></div>\n\t\t\t</div>\n\t\t\t<div class="webix_color_line">\n\t\t\t\t<div class="webix_color_line_circle"></div>\n\t\t\t</div>\n\t\t\t<div class="webix_color_out">\n\t\t\t\t<div style="width:').concat(t,'px" class="webix_color_out_block"></div>\n\t\t\t\t<input type="text" style="width:').concat(t,'px" class="webix_color_out_text"></input>\n\t\t\t</div>\n\t\t'),this.P.button&&(e+="<div class='webix_secondary'><button class=\"webix_button webix_secondary\">".concat(I.combo.select,"</button></div>")),e+="</div>",this.Vt.innerHTML=e,this.callEvent("onAfterRender",[]),this.$setValue(this.P.value,!0)}},refresh:function(){this.render()}}),mh=(H.protoUI(bh,Hi.view,g),{name:"button",touchable:!0,$skin:function(){this.defaults.height=Li.buttonHeight||Li.inputHeight},defaults:{template:function(t,i){var e=i.$renderInput(t,i);return(t.badge||0===t.badge)&&(e=e.replace("</button>","<span class='webix_badge'>"+t.badge+"</span></button>")),"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+e+"</div>"},label:"",value:"",borderless:!0},$renderInput:function(t){return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+" class='webix_button'>"+(t.label||t.value)+"</button>"},$init:function(t){this.Vt.className+=" webix_control webix_el_"+(this.$cssName||this.name),this.Bt=[],this.Sb(t),this.data=this.P,this.tt=this.Vt,this.$ready.push(function(){this.kb(this.config)})},hotkey_setter:function(t){var e=this;this.Cb(t,function(t,i){e.isVisible()&&(xt(e.$view.firstChild,"MouseEvents","click"),gt(i))})},Sb:function(t){t.css&&this.$b(t.css)&&(!this.defaults.css||this.$b(this.defaults.css))||(this.Vt.className+=" webix_secondary")},$b:function(t){if("string"==typeof t){for(var i in{webix_danger:1,webix_transparent:1,webix_primary:1})if(-1!==t.indexOf(i))return!0}return!1},Cb:function(t,i,e){var s=Mi.addHotKey(t,i,e);this.attachEvent("onDestruct",function(){Mi.removeHotKey(s,i,e)})},type_setter:function(t){return this.wd[t]&&(this.$renderInput=Yt(this.wd[t])),t},Db:!1,wd:{image:"<button type='button' class='webix_button webix_img_btn' style='line-height:#cheight#px;'><img class='webix_image' style='max-width:#cheight#px; max-height:#cheight#px;' src = '#image#'>#label#</button>",imageTop:"<button type='button' class='webix_button webix_img_btn_top'><img class='webix_image' style='max-width:#cheight#px; max-height:#cheight#px;' src = '#image#'><div class='webix_img_btn_text'>#label#</div></button>",icon:"<button type='button' class='webix_button webix_img_btn' style='line-height:#cheight#px;'><span class='webix_icon_btn #icon#' style='max-width:#cheight#px;'></span>#label#</button>",iconTop:"<button type='button' class='webix_button webix_img_btn_top' style='width:100%;text-align:center;'><span class='webix_icon #icon#'></span><div class='webix_img_btn_text'>#label#</div></button>"},Ib:function(){for(var t=[],i=["input","select","textarea","button"],e=0;e<i.length;e++)for(var s=this.$view.getElementsByTagName(i[e]),n=0;n<s.length;n++)t.push(s[n]);return t},disable:function(){var t,i,e=this.Lp();if(Vi.api.disable.apply(this,arguments),e&&-1==e.className.indexOf(" webix_disabled_box")){e.className+=" webix_disabled_box";var s=this.Ib();for(t=0;t<s.length;t++)s[t].setAttribute("disabled",!0);if((i=this.getInputNode())&&"div"==i.tagName.toLowerCase()&&(this.Ab=i.getAttribute("tabIndex"),i.removeAttribute("tabIndex")),"top"==this.P.labelPosition){var n=this.tt.firstChild;n&&(n.className+=" webix_disabled_top_label")}}},enable:function(){Vi.api.enable.apply(this,arguments);var t,i=this.Lp();if(i){i.className=i.className.replace(" webix_disabled_box","");for(var e=this.Ib(),s=0;s<e.length;s++)e[s].removeAttribute("disabled");if((t=this.getInputNode())&&!R(
this.Ab)&&t.setAttribute("tabIndex",this.Ab),"top"==this.P.labelPosition){var n=this.tt.firstChild;n&&(n.className=n.className.replace(" webix_disabled_top_label",""))}}},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.render()},setValue:function(t){t=this.$prepareValue(t);var i=this.P.value;this.$compareValue(i,t)?this.Fb&&t!=this.$getValue()&&this.$setValue(t):(this.P.value=t,this.Fb&&this.$setValue(t),this.callEvent("onChange",[t,i]))},$compareValue:function(t,i){return"number"==typeof i&&(i=i.toString()),"number"==typeof t&&(t=t.toString()),t==i},$prepareValue:function(t){return 0===t?"0":(t||"").toString()},value_setter:function(t){return this.$prepareValue(t)},$setValue:function(t){var i=this.getInputNode();i&&!this.wd[this.P.type]&&(t=this.P.label||t,"BUTTON"==i.tagName?i.innerHTML=t:i.value=t)},getValue:function(){var t=this.Fb?this.$getValue():this.P.value;return void 0===t?"":t},$getValue:function(){return this.P.value||""},focus:function(){if(!Mi.canFocus(this))return!1;var t=this.getInputNode();t&&t.focus&&t.focus()},blur:function(){var t=this.getInputNode();t&&t.blur&&t.blur()},getInputNode:function(){return this.tt.getElementsByTagName("input")[0]||this.tt.getElementsByTagName("button")[0]},Lp:function(){for(var t=0;t<this.tt.childNodes.length;t++)if(0<=this.tt.childNodes[t].className.indexOf("webix_el_box"))return this.tt.childNodes[t];return null},Fe:function(t,i){var e=i.target,s=this.Lp();return"top"==this.P.labelPosition&&this.tt.firstChild.contains(e)||s&&s.contains(e)?this.P:null},Tb:Math.sqrt(2),kb:function(t){if((t=t||this.P).autowidth){var i=St(t.value||t.label||"","webixbutton").width+(t.badge||0===t.badge?2*St(t.badge,"webix_badge").width-32:0)+("icon"===t.type?24:0)+("image"===t.type?t.height-Li.inputPadding:0);i=Math.max(t.minWidth||0,i),t.width=Math.min(t.maxWidth||Infinity,i)}},Vb:function(){this.zb=this.P.inputWidth||(2<this.me-this.P.width?this.P.width:0)||this.me,this.Bb=this.P.inputHeight||this.Hb||0},resize:function(){return this.kb(),Hi.api.resize.apply(this,arguments)},render:function(){if(this.Vb(),this.P.awidth=this.zb||this.me,this.P.aheight=this.Bb||this.we,this.P.bheight=this.P.aheight+2,this.P.cheight=this.P.aheight-2*Li.inputPadding,this.P.dheight=this.P.cheight-2,qt.render.call(this)){if(this.Fb=!0,this.Db&&this.Db(),this.P.align){var t=this.tt.firstChild;switch("top"==this.P.labelPosition&&t.nextSibling&&(t=t.nextSibling),this.P.align){case"right":t.style.cssFloat="right";break;case"center":t.style.display="inline-block",t.parentNode.style.textAlign="center";break;case"middle":t.style.marginTop=Math.round((this.we-this.Bb)/2)+"px";break;case"bottom":t.style.marginTop=this.we-this.Bb+"px";break;case"left":t.style.cssFloat="left";break;default:this.P.align}}this.$render&&this.$render(this.data),this.P.disabled&&this.disable(),this.ah&&(this.ah(this.data),this.ah=0)}},refresh:function(){this.render()},on_click:{Rb:function(t){var i=_t(t,"button_id"),e=this.getOption(i);e&&!e.disabled&&this.callEvent("onBeforeTabClick",[i,t])&&(this.setValue(i),this.focus(),this.callEvent("onAfterTabClick",[i,t]))},webix_all_segments:function(t,i){this.on_click.Rb.call(this,t,i)},webix_all_tabs:function(t,i){this.on_click.Rb.call(this,t,i)},webix_inp_counter_next:function(){this.P.readonly||this.next()},webix_inp_counter_prev:function(){this.P.readonly||this.prev()},webix_input_icon:function(){this.getInputNode().focus()},webix_inp_checkbox_border:function(t){this.P.disabled||"DIV"==t.target.tagName||this.P.readonly||this.toggle()},webix_inp_checkbox_label:function(){this.P.readonly||this.toggle()},webix_inp_radio_border:function(t){var i=_t(t,"radio_id"),e=this.getOption(i);e&&!e.disabled&&(this.setValue(i),this.focus())},webix_tab_more_icon:function(t,i,e){var s=this.getPopup();s.isVisible()?s.hide():(s.resize(),s.show(e,null,!0))},webix_tab_close:function(t){var i=_t(t,"button_id"),e=this.getOption(i);return e&&!e.disabled&&this.callEvent("onBeforeTabClose",[i,t])&&this.removeOption(i),!1}},Eb:function(t){this.name,$(t),this.name;for(var i=0;i<t.length;i++)t[i].text,t[i].label,
"string"==typeof t[i]?t[i]={id:t[i],value:t[i]}:(R(t[i].id)&&(t[i].id=t[i].value),R(t[i].value)&&(t[i].value=t[i].id));return t},Pb:function(t){var i=t?t.placeholder:this.P.placeholder;return i?"<span class='webix_placeholder'>"+i+"</span>":""}}),gh={api:mh,view:H.protoUI(mh,Hi.view,Pi,qt,Si,g)},wh={name:"label",defaults:{template:"<div class='webix_el_box' style='width:#awidth#px;height:#aheight#px;line-height:#cheight#px'>#label#</div>"},$skin:function(){gh.api.$skin.call(this),this.defaults.height=Li.inputHeight},focus:function(){return!1},Lp:function(){return this.tt.firstChild},setHTML:function(t){this.P.label=t,this.refresh()},setValue:function(t){this.P.label=t,gh.api.setValue.apply(this,arguments)},$setValue:function(t){this.tt.firstChild.innerHTML=t},$render:function(t){"right"===t.align&&(this.tt.firstChild.style.textAlign="right")},Db:!1,Sb:function(){},kb:function(t){var i="webix_el_box webixlabel"+(this.queryView("toolbar","parent")?" webixtoolbarlabel":"");(t=t||this.P).autowidth&&(t.width=St(t.label,i).width)}},xh=(H.protoUI(wh,gh.view),{9:"tab",38:"up",40:"down",37:"left",39:"right"}),yh={$init:function(t){var i=this.defaults.pattern||t.pattern,e=this.defaults.format||t.format;t.value=R(t.value)?"":t.value,(i||e&&!this.format_setter)&&(this.attachEvent("onKeyPress",function(t,i){i.ctrlKey||i.altKey||this.P.readonly||this.jb||(105<t&&t<112&&(t-=64),xh[t]&&8!==t&&46!==t||(gt(i),this.Nb(i,t)))}),this.attachEvent("onAfterRender",this.Lb),this.getText=function(){return this.getInputNode().value},this.$prepareValue=function(t){return this.Ob(t,!1)},this.Ob=function(t,i){return!1===i?this.Wb(t):this.Ub(t)},e&&("object"===M(e)?this.jb=e:(e=nn.getConfig(e),this.jb={parse:function(t){return nn.parse(t,e)},edit:function(t){return nn.format(t,e)}}))),i&&(this.P.pattern=this.pattern_setter(i),delete t.pattern)},pattern_setter:function(t){var i=dn[t]||t;return"string"==typeof i&&(i={mask:i}),i.allow=i.allow||/[A-Za-z0-9]/g,this.Yb(i),i},qb:function(){this.config.validate=this.config.validate||S(function(){var t=this.getText(),i=t.replace(this.Gb,"");return(t.toString().match(this.Xb)||[]).join("").length==i.length&&t.length==this.P.pattern.mask.length},this)},Lb:function(){var t=q.isIE8?"propertychange":"input";this.jb||Kt(this.getInputNode(),t,function(){var t=(new Date).valueOf();this.$view.offsetWidth;(!this.Jb||100<t-this.Jb)&&(this.Jb=t,this.$setValue(this.getText()))},{bind:this}),Kt(this.getInputNode(),"blur",function(){this.gi()},{bind:this})},Yb:function(t){for(var i=t.mask,e={},s="",n=0,h=0;h<i.length;h++)"#"===i[h]?(e[h]=n,n++):(e[h]=!1,-1===s.indexOf(i[h])&&(s+="\\"+i[h]));this.Xb=t.allow,this.Gb=new RegExp("["+s+"]","g"),this.Kb=e,this.qb()},Nb:function(t,i){var e=this.getInputNode(),s=e.value,n=Dt(e),h="";if(8==i||46==i)n.start==n.end&&(8==i?n.start--:n.end++);else{h=String.fromCharCode(i);var r=t.getModifierState("CapsLock");(!t.shiftKey&&!r||t.shiftKey&&r)&&(h=h.toLowerCase())}s=s.substr(0,n.start)+h+s.substr(n.end),n=this.Zb(h,s.length,n.start,i),this.Qb=i,this.$setValue(s),$t(e,n)},Zb:function(t,i,e,s){if(t&&t.match(this.Xb)||8==s||46==s)e=t?e+1:e,e=this.tm(e,s);else if(i-1==e&&8!==s&&46!==s){var n=this.P.pattern.mask.indexOf("#",e);0<n&&(e+=n)}return e},tm:function(t,i){var e=t-1*(46!==i);return!1===this.Kb[e]?(t+=8==i?-1:1,this.tm(t,i)):!1===this.Kb[t]&&8!==i?this.tm(t+1,i)-1:t},Wb:function(t){return this.jb?this.jb.parse(t):((t=t||0===t?t:"").toString().match(this.Xb)||[]).join("").replace(this.Gb,"")},Ub:function(t){if(this.jb)return this.jb.edit(this.jb.parse(t));var i=this.Wb(t),e=this.P.pattern.mask,s=this.P.pattern.mask,n=this.Kb,h=!1,r=0,o=0,a=0;for(var u in n)if(!1!==n[u]){if(!h){r=1*u;var c=i[o=n[u]]||"",f=i[o+1];e=(c?e.substr(0,r):"")+c+(c&&f?e.substr(r+1):""),f||(h=!0)}a++}var l=this.Qb;if(l&&8!==l||!l&&a-1===o&&e.length<s.length)if(i){var d=r+1;if("#"!==s.charAt(d)&&e.length<s.length){var v=s.indexOf("#",d);v<0&&(v=s.length),e+=s.substr(d,v-d)}}else 46!==l&&(e+=s.substr(0,s.indexOf("#")));return this.Qb=null,e}},Mh={name:"text",$allowsClear:!0,im:function(){this.$allowsClear&&(
this.em||Kt(this.getInputNode(),"change",this.gi,{bind:this}),this.P.suggest&&oi(this.P.suggest).linkInput(this))},gi:function(){var t=this.getValue(),i=this.setValue(t,!0);this.jb&&!1===i&&this.$setValue(t)},$skin:function(){gh.api.$skin.call(this),this.defaults.height=Li.inputHeight,this.defaults.inputPadding=Li.inputPadding,this.j_=Li.inputSpacing,this.N_=Li.labelTopHeight},$init:function(t){"top"==t.labelPosition&&R(t.height)&&this.defaults.height&&(t.height=this.defaults.height+(t.label?this.N_:0)),this.em&&this.attachEvent("onBlur",function(){this.Fb&&this.em()}),this.attachEvent("onAfterRender",this.im)},$renderIcon:function(){var t=this.P;if(t.icon){var i=t.aheight-2*t.inputPadding,e=(i-18)/2-1,s=this.addSection?"role='button' tabindex='0' aria-label='"+I.aria["multitext"+(t.mode||"")+"Section"]+"'":"";return"<span style='height:"+(i-e)+"px;padding-top:"+e+"px;' class='webix_input_icon "+t.icon+"' "+s+"></span>"}return""},relatedView_setter:function(t){return this.attachEvent("onChange",function(){var t=this.getValue(),i=this.P.relatedAction,e=this.P.relatedView,s=oi(e);if(!s){var n=this.getTopParentView();n&&n.$$&&(s=n.$$(e))}"enable"==i?t?s.enable():s.disable():t?s.show():s.hide()}),t},validateEvent_setter:function(t){return"blur"==t&&this.attachEvent("onBlur",this.validate),"key"==t&&this.attachEvent("onTimedKeyPress",this.validate),t},validate:function(){var t=this.P.validate;!t&&this.P.required&&(t=ue.isNotEmpty);var i=this.getFormView(),e=this.P.name,s=this.getValue(),n={};return n[e]=s,!(t&&!i.sr(t,s,n,e))},bottomLabel_setter:function(t){return this.P.bottomPadding||(this.P.bottomPadding=18),t},sm:function(){var t=this.P.invalidMessage;return"function"==typeof t&&t.call(this),t},setBottomText:function(t,i){var e=this.P;if(void 0!==t){if(e.bottomLabel==t)return;e.bottomLabel=t}var s=(e.invalid?e.invalidMessage:"")||e.bottomLabel;s||e.bottomPadding||(e.inputHeight=0),s&&!e.bottomPadding?(this.nm=1,e.bottomPadding=e.bottomPadding||i||18,this.render(),this.adjust(),this.resize()):!s&&this.nm?(e.bottomPadding=this.nm=0,e.height||this.render(),this.adjust(),this.resize()):this.render()},$getSize:function(){var t=Hi.api.$getSize.apply(this,arguments),i=this.config.bottomPadding;return i&&(t[2]+=i,t[3]+=i),t},$setSize:function(t,i){var e=this.P;if(Hi.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==e.labelPosition?(e.inputHeight||(this.Hb=this.we-(e.label?this.N_:0)-(this.config.bottomPadding||0)),e.labelWidth=0):e.bottomPadding&&(e.inputHeight=this.we-this.config.bottomPadding),this.render()}},hm:function(t){var i=(this.zb||0)-(t.label?t.labelWidth:0)-this.j_-(t.iconWidth||0);return i<0?0:i},rm:function(t,i){var e="x"+V(),s=i.hm(t),n=t.inputAlign||"left",h=this.P.aheight-2*Li.inputPadding-2*Li.borderWidth,r=t.text||t.value||this.Pb(t),o="<div class='webix_inp_static' role='combobox' aria-label='"+Yt.escape(t.label)+"' tabindex='0'"+(t.readonly?" aria-readonly='true'":"")+(t.invalid?"aria-invalid='true'":"")+" onclick='' style='line-height:"+h+"px;width: "+s+"px; text-align: "+n+";' >"+r+"</div>";return i.$renderInput(t,o,e)},om:function(t){var i="<"+t+(this.P.placeholder?" placeholder='"+Yt.escape(this.P.placeholder)+"' ":" ");this.P.readonly&&(i+="readonly='true' aria-readonly=''"),this.P.required&&(i+="aria-required='true'"),this.P.invalid&&(i+="aria-invalid='true'");var e=this.P.attributes;if(e)for(var s in e)i+=s+"='"+e[s]+"' ";return i},$renderLabel:function(t,i){var e="";if(t.label){var s="top"==this.P.labelPosition,n="text-align:".concat(t.labelAlign||"left","; line-height:").concat(this.um(s),"px; ");e="<label style='"+(n+=s?"display:block;":t.labelWidth?"width:".concat(t.labelWidth,"px;"):"display:none;")+"' onclick='' for='"+i+"' class='webix_inp_"+(s?"top_":"")+"label "+(t.required?"webix_required":"")+"'>"+(t.label||"")+"</label>"}return e},um:function(t){return t?this.N_-this.P.inputPadding:this.P.aheight-2*this.P.inputPadding},$renderInput:function(t,i,e){var s=t.inputAlign||"left",n="top"==t.labelPosition,h=this.hm(t);e=e||V();var r=this.$renderLabel(t,e),o="";if(i)o+=i;else{var a=Yt.escape(
t.text||this.Ob(t.value));o+=this.om("input")+"id='"+e+"' type='"+(t.type||this.name)+"'"+(t.editable?" role='combobox'":"")+" value='"+a+"' style='width: "+h+"px; text-align: "+s+";'";var u=t.attributes;if(u)for(var c in u)o+=" "+c+"='"+u[c]+"'";o+=" />"}o+=this.$renderIcon?this.$renderIcon(t):"";var f="";f=n?r+"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+o+"</div>":"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+r+o+"</div>";var l=t.awidth-h-2*Li.inputPadding,d=(t.invalid?t.invalidMessage:"")||t.bottomLabel;return d&&(f+="<div class='webix_inp_bottom_label'"+(t.invalid?"role='alert' aria-relevant='all'":"")+" style='width:"+(h||t.awidth)+"px;margin-left:"+Math.max(l,Li.inputPadding)+"px;'>"+d+"</div>"),f},defaults:{template:function(t,i){return i.$renderInput(t)},label:"",labelWidth:80},labelWidth_setter:function(t){return t?Math.max(t,Li.dataPadding):0},type_setter:function(t){return t},Db:!1,Sb:function(){},Ob:function(t){return t},$setValue:function(t){this.getInputNode().value=this.Ob(t)},$getValue:function(){return this.Ob(this.getInputNode().value,!1)},setValueHere:function(t,i,e){if(e&&e.symbol){var s=e.symbol,n=this.getValue(),h=n.substring(e.pos);n=(n=n.substring(0,e.pos)).substring(0,n.lastIndexOf(s)+s.length)+t,this.setValue(n+h),$t(this.getInputNode(),n.length)}else this.setValue(t)},suggest_setter:function(t){if(t){if("string"==typeof t){if(oi(t))return oi(t).P.id;t={body:{url:t,dataFeed:t}}}else t.getItem?t={body:{data:t}}:$(t)?t={body:{data:this.Eb(t)}}:t.body||(t.body={});H.extend(t,{view:"suggest"});var i=si(t);return this.Bt.push(i),i.P.id}return!1}},Sh={api:Mh,view:H.protoUI(Mh,yh,gh.view)},kh=H.proto({name:"DataCollection",isVisible:function(){return!!(this.data.order.length||this.data.Ir||this.P.dataFeed)},$init:function(t){this.data.provideApi(this,!0);var i=t&&t.id?t.id:V();this.P.id=i,(si.views[i]=this).data.attachEvent("onStoreLoad",S(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},ae,Ci,Ii,ps,_e,Ve,g,Ai,ki,Si);t("DataCollection",kh);var Ch={name:"select",defaults:{template:function(i,t){var e="x"+V(),s=t.om("select")+"id='"+e+"' style='width:"+t.hm(i)+"px;'>",n=oi(i.options);if(n&&n.data&&n.data.each)n.data.each(function(t){s+="<option"+(t.id==i.value?" selected='true'":"")+" value='"+t.id+"'>"+t.value+"</option>"});else for(var h=t.Eb(i.options),r=0;r<h.length;r++)s+="<option"+(h[r].id==i.value?" selected='true'":"")+" value='"+h[r].id+"'>"+h[r].value+"</option>";return s+="</select>",t.$renderInput(i,s,e)}},options_setter:function(t){if(t){if("string"!=typeof t)return t;var i=new kh({url:t});return i.data.attachEvent("onStoreLoad",S(this.refresh,this)),i}},getInputNode:function(){return this.tt.getElementsByTagName("select")[0]}},$h=(H.protoUI(Ch,Sh.view),{name:"checkbox",defaults:{checkValue:1,uncheckValue:0,template:function(t,i){var e="x"+V(),s="";t.labelRight&&(s="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||"&nbsp;"));var n=t.checkValue==t.value,h=Math.floor((i.P.aheight-16)/2),r=i.om("input")+"style='margin-top:"+h+"px;"+(t.customCheckbox?"display:none":"")+"' id='"+e+"' type='checkbox' "+(n?"checked='1'":"")+(t.labelRight?" aria-label='"+Yt.escape(t.labelRight)+"'":"")+"/>",o="webix_inp_checkbox_border webix_el_group webix_checkbox_"+(n?"1":"0"),a=t.customCheckbox||"";a&&(a=(a=(a=a.replace(/(aria-checked=')\w*(?=')/,"$1"+(t.value==t.checkValue?"true":"false"))).replace(/(aria-label=')\w*(?=')/,"$1"+Yt.escape(t.labelRight||t.label))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false")));var u="<div style='line-height:"+i.P.cheight+"px' class='"+o+"'>"+r+a+s+"</div>";return i.$renderInput(t,u,e)}},customCheckbox_setter:function(t){return!0===t&&Li.customCheckbox&&(t="<a role='presentation' onclick='javascript:void(0)'><button role='checkbox' aria-checked='false' aria-label='' type='button' aria-invalid='' class='webix_custom_checkbox'></button></a>"),t},blur:function(){var t=this.getInputNode()
;t&&t.blur()},$prepareValue:function(t){return t},im:function(){},$setValue:function(t){var i=t==this.P.checkValue,e=this.$view.getElementsByTagName("input")[0],s=e?e.parentNode:null;if(s&&this.P.customCheckbox){var n=s.getElementsByTagName("BUTTON");n[0]&&n[0].setAttribute("aria-checked",i?"true":"false")}s&&(s.className=s.className.replace(/(webix_checkbox_)\d/,"$1"+(i?1:0))),e.checked=i},toggle:function(){var t=this.getValue()!=this.P.checkValue?this.P.checkValue:this.P.uncheckValue;this.setValue(t)},getValue:function(){return this.P.value==this.P.checkValue?this.P.checkValue:this.P.uncheckValue},getInputNode:function(){return this.$view.getElementsByTagName(this.P.customCheckbox?"button":"input")[0]},$skin:function(){Sh.api.$skin.call(this),this.defaults.customCheckbox=!!Li.customCheckbox}}),Dh={api:$h,view:H.protoUI($h,Sh.view)},Ih={name:"radio",defaults:{template:function(t,i){i.Eb(t.options);for(var e,s,n,h,r,o,a,u,c,f,l,d=i.cu(t.options),v=i.uu(),_=[],p=0;p<d.length;p++)s="x"+V(),e=e||s,p&&(d[p].newline||t.vertical)&&_.push("<div class='webix_line_break'></div>"),l=(n=d[p].id==t.value)||!t.value&&d[p].id===v,h=!!d[p].disabled,r=d[p].value||"",o=t.tooltip?" webix_t_id='"+d[p].id+"'":"",(a=t.customRadio||"")&&(u=(0===p?t.label+" ":"")+r,a=(a=(a=(a=(a=a.replace(/(aria-label=')\w*(?=')/,"$1"+Yt.escape(u))).replace(/(aria-checked=')\w*(?=')/,"$1"+(n?"true":"false"))).replace(/(tabindex=')\w*(?=')/,"$1"+(!h&&l?"0":"-1"))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false"))).replace(/(button_id=')\w*(?=')/,"$1"+d[p].id),h&&(a=a.replace("role='radio'","role='radio' webix_disabled='true'"))),c=i.om("input")+" name='"+(t.name||t.id)+"' type='radio' "+(n?"checked='1'":"")+"tabindex="+(!h&&l?"0":"-1")+" value='"+d[p].id+"' id='"+s+"'"+(h?" disabled='true'":"")+" style='"+(a?"display:none":"")+"' />",f="<div radio_id='"+d[p].id+"' class='webix_inp_radio_border webix_radio_"+(n?"1":"0")+"' role='presentation'>"+c+a+"</div>",r&&(r="<label for='"+s+"' class='webix_label_right'>"+r+"</label>"),_.push("<div class='webix_radio_option"+(h?" webix_disabled":"")+"' role='presentation'"+o+">"+f+r+"</div>");return _="<div class='webix_el_group' role='radiogroup' style='margin-left:"+(t.label?t.labelWidth:0)+"px;'>"+_.join("")+"</div>",i.$renderInput(t,_,e)}},refresh:function(){this.render(),this.be&&this.$getSize(0,0)[2]!=this.be[1]&&this.resize()},$getSize:function(t,i){var e=gh.api.$getSize.call(this,t,i),s=this.cu(this.P.options);if(s){for(var n=this.P.vertical?0:1,h=0;h<s.length;h++)(this.P.vertical||s[h].newline)&&n++;e[3]=e[2]=Math.max(e[2],(this.P.optionHeight||25)*n+2*this.P.inputPadding+("top"==this.P.labelPosition?this.N_:0))}var r=this.config.bottomPadding;return r&&(e[2]+=r,e[3]+=r),e},ru:function(){return this.tt.getElementsByTagName(this.P.customRadio?"button":"input")},$setValue:function(t){for(var i,e,s,n,h,r=this.tt.getElementsByTagName("input"),o=this.uu(),a=0;a<r.length;a++)i=r[a].parentNode.getAttribute("radio_id"),e=this.getOption(i),r[a].checked=i==t,s=e&&!e.disabled&&(r[a].checked||!t&&e.id==o),r[a].setAttribute("tabindex",s?"0":"-1"),(n=r[a]?r[a].parentNode:null)&&(n.className=n.className.replace(/(webix_radio_)\d/,"$1"+(r[a].checked?1:0)),this.P.customRadio&&(h=n.getElementsByTagName("BUTTON"))[0]&&(h[0].setAttribute("aria-checked",r[a].checked?"true":"false"),h[0].setAttribute("tabindex",s?"0":"-1")))},getValue:function(){return this.P.value},focus:function(){return this.wi()},blur:function(){this.ou()},customRadio_setter:function(t){return!0===t&&Li.customRadio&&(t="<a role='presentation' onclick='javascript:void(0)'><button type='button' class='webix_custom_radio' button_id='' role='radio' aria-checked='false' aria-label='' aria-invalid='' tabindex=''></button></a>"),t},$skin:function(){Sh.api.$skin.call(this),this.defaults.customRadio=!!Li.customRadio,Li.optionHeight&&(this.defaults.optionHeight=Li.optionHeight)}},Ah=(H.protoUI(Ih,Sh.view,Ie),{name:"datepicker",cm:!0,$init:function(t){t.multiselect&&(this.P.multiselect=t.multiselect),t.type&&(this.P.type=t.type),this.$ready.push(this.fm)},
defaults:{template:function(t,i){"time"==i.P.type&&(i.P.icon=i.P.timeIcon);var e=t.type;t.type="";var s=t.editable?i.$renderInput(t):i.rm(t,i);return t.type=e,s},stringResult:!1,timepicker:!1,icon:"wxi-calendar",icons:!0,timeIcon:"wxi-clock",separator:", "},em:function(){var t=this.getText();if(this.P.text!=t&&(!R(this.P.text)||t)){var i=this.P.editable?this.getValue():this.getPopup().getValue();this.setValue(i||"")}},$skin:function(){Sh.api.$skin.call(this),this.defaults.inputPadding=Li.inputPadding,this.defaults.point=!Li.popupNoPoint},getPopup:function(){return oi(this.P.popup)},fm:function(){var t=this.P;if(t.suggest)t.popup=t.suggest;else if(!t.popup){var i=this.P.timepicker;t.popup=t.suggest=this.suggest_setter({type:"calendar",point:!1!==this.P.point,padding:0,body:{height:240+(i||this.P.icons?30:0),width:250,multiselect:this.P.multiselect,timepicker:i,type:this.P.type,icons:this.P.icons,timeIcon:this.P.timeIcon}})}this.ah=function(){}},$render:function(t){this.$setValue(t.value)},$prepareValue:function(t){if(this.P.multiselect){"string"==typeof t?t=t.split(this.P.separator):t instanceof Date?t=[t]:t||(t=[]);for(var i=0;i<t.length;i++)t[i]=this.lm(t[i]);return t}return this.lm(t)},lm:function(t){var i=this.P.type,e="time"==i;if(isNaN(parseFloat(t))||(t=""+t),"string"==typeof t&&t){t=("month"!=i&&"year"!=i||!this.dm?e?I.parseTimeFormatDate:I.parseFormatDate:this.dm)(t)}if(t){if(e&&$(t)){var s=new Date;s.setHours(t[0]),s.setMinutes(t[1]),t=s}isNaN(t.getTime())&&(t="")}return t},vm:function(t){var i=this;return this.P.multiselect?[].concat(t).map(function(t){return i._m(t)}).join(this.config.separator):this._m(t)},_m:function(t){var i=this.bm;return i||(i="time"==this.P.type?I.timeFormatStr:this.config.timepicker?I.fullDateFormatStr:I.dateFormatStr),i(t)},mm:function(){var t=this.getInputNode();R(t.value)?t.innerHTML=this.P.text||this.Pb():t.value=this.P.text||""},$compareValue:function(t,i){return!t&&!i||sn.equal(t,i)},$setValue:function(t){this.P.text=t?this.vm(t):"",this.mm()},format_setter:function(t){return t?"function"==typeof t?this.bm=t:(this.bm=sn.dateToStr(t),this.dm=sn.strToDate(t)):this.bm=this.dm=null,t},getInputNode:function(){return this.P.editable?this.tt.getElementsByTagName("input")[0]:this.tt.getElementsByTagName("DIV")[1]},getValue:function(){var i=this;if(this.P.multiselect){var t=this.P.value;if(!t)return[];var e=[].concat(t).map(function(t){return i.gm(t)});return this.P.stringResult?e.join(this.P.separator):e}return this.gm(this.P.value)},gm:function(t){var i=this.P.type,e="time"==i;if(this.Fb){if(this.P.editable){var s=this.dm;s||(s=e?I.timeFormatDate:this.config.timepicker?I.fullDateFormatDate:I.dateFormatDate),t=s(this.getInputNode().value)}}else t=this.$prepareValue(t)||null;if(this.P.stringResult){var n=I.parseFormatStr;return e&&(n=I.parseTimeFormatStr),!this.bm||"month"!=i&&"year"!=i||(n=this.bm),this.P.multiselect?[].concat(t).map(function(t){return t?n(t):""}):t?n(t):""}return t||null},getText:function(){var t=this.getInputNode(),i="";return t&&(i=R(t.value)?t.innerHTML:t.value),i}}),Fh={api:Ah,view:H.protoUI(Ah,Sh.view)},Th={name:"colorpicker",$init:function(){this.$ready.push(this.fm)},defaults:{icon:!0},fm:function(){var t=this.P;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({type:"colorboard"})),this.ah=function(){}},getValue:function(){return this.Fb&&this.P.editable?this.getInputNode().value:this.P.value},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},wm:function(){return this.$view.getElementsByTagName("DIV")[this.P.editable?1:2]},vm:function(t){return t},$compareValue:function(t,i){return t==i},$setValue:function(t){this.wm().style.backgroundColor=t,this.P.text=t;var i=this.getInputNode();i.value==undefined?i.innerHTML=t:i.value=t},$renderIcon:function(){return'<div class="webix_input_icon" style="background-color:'+this.config.value+';"> </div>'}},Vh=(H.protoUI(Th,Fh.view),{name:"richselect",defaults:{template:function(t,i){return i.rm(t,i)},popupWidth:200,icon:"wxi-menu-down"},
em:function(){var t=this.getText();if(this.P.text!=t&&(!R(this.P.text)||t)){var i=this.getPopup(),e=this.getInputNode().value,s=i.getSuggestion(e),n=this.getValue();!s||s==n||""===e&&""!==i.getItemText(s)?""===e?this.setValue(""):this.xm&&this.xm():this.setValue(s)}},suggest_setter:function(t){return this.options_setter(t)},options_setter:function(t){t=this.ym?this.ym(t):t;var i=this.P.popup=this.P.suggest=Sh.api.suggest_setter.call(this,t),e=oi(i).getList();return e&&e.attachEvent("onAfterLoad",S(this.Mm,this)),i},getList:function(){var t=oi(this.P.suggest);return t.getList()},Mm:function(){var t=this.P.value,i=this.P.text;R(t)||this.getPopup().isVisible()||i||!this.getInputNode()||this.$setValue(t)},$skin:function(){Sh.api.$skin.call(this),this.defaults.inputPadding=Li.inputPadding},$render:function(t){this.$setValue(t.value)},getInputNode:function(){return this.tt.getElementsByTagName("DIV")[1]},getPopup:function(){return oi(this.P.popup)},getText:function(){var t=this.P.value,i=this.getInputNode();return i?"undefined"==typeof i.value?i.firstChild&&"webix_placeholder"===i.firstChild.className?"":i.innerHTML:i.value:t?this.getPopup().getItemText(t):""},$prepareValue:function(t){return t&&t.id?t:Sh.api.$prepareValue.call(this,t)},$setValue:function(t){var i=t,e=this.getPopup();if(e&&(i=e.getItemText(t)),t&&t.id){var s=e.getList(),n=s.exists(t.id);n||s.add(t),i=e.getItemText(t.id),s.P.dynamic&&!n&&s.remove(t.id),this.P.value=this.$prepareValue(t.id)}var h=this.getInputNode();R(h.value)?h.innerHTML=i||this.Pb():h.value=i=i.replace(/<[^>]*>/g,""),this.P.text=i},getValue:function(){return this.P.value||""},Sm:function(t){this.focus(),gt(t)}}),zh={api:Vh,view:H.protoUI(Vh,Sh.view)},Bh={name:"combo",getInputNode:function(){return this.tt.getElementsByTagName("input")[0]},xm:function(){var t=this.getValue();this.$setValue(R(t)?"":t)},gi:function(){var t=this.getInputNode(),i="",e=this.getPopup();t.value&&(i=this.P.value,e.getItemText(i)!=this.getText()&&(i=e.getSuggestion()||i)),i!=this.P.value?this.setValue(i,!0):this.$setValue(i)},defaults:{template:function(t,i){return i.$renderInput(t).replace(/(<input)\s*(?=\w)/,"$1 role='combobox'")},icon:"wxi-menu-down"},on_click:{webix_inp_label:function(t){this.Sm(t)},webix_inp_top_label:function(t){this.Sm(t)}}},Hh=(H.protoUI(Bh,zh.view),{name:"counter",defaults:{template:function(t,i){var e=t.value,s="x"+V(),n="<div role='spinbutton' aria-label='"+Yt.escape(t.label)+"' aria-valuemin='"+t.min+"' aria-valuemax='"+t.max+"' aria-valuenow='"+t.value+"' class='webix_el_group' style='width:"+i.hm(t)+"px'>";return n+="<button type='button' class='webix_inp_counter_prev' tabindex='-1' aria-label='"+I.aria.decreaseValue+"'>-</button>",n+=i.om("input")+" id='"+s+"' type='text' class='webix_inp_counter_value' aria-live='assertive' value='"+e+"'></input>",n+="<button type='button' class='webix_inp_counter_next' tabindex='-1' aria-label='"+I.aria.increaseValue+"'>+</button></div>",i.$renderInput(t,n,s)},min:0,max:Infinity,value:0,step:1},$init:function(){Kt(this.$view,"keydown",this.op,{bind:this})},op:function(t){var i=t.which||t.keyCode,e=this.P,s=this.getValue();32<i&&i<41&&(36===i?s=e.min:35===i?s=e.max===Infinity?1e6:e.max:33===i?this.next():34===i?this.prev():s+=37===i||40===i?-1:1,34<i&&s>=e.min&&s<=e.max&&this.setValue(s))},$setValue:function(t){this.getInputNode().value=t},$prepareValue:function(t){t=parseFloat(t);var i=this.P.min,e=this.P.max;return isNaN(t)&&(t=isFinite(i)?i:0),Math.min(Math.max(t,i),e)},getInputNode:function(){return this.tt.getElementsByTagName("input")[0]},getValue:function(){return 1*gh.api.getValue.apply(this,arguments)},next:function(t){t=1*(t||this.P.step),this.shift(t)},prev:function(t){t=-1*(t||this.P.step),this.shift(t)},shift:function(t){var i=Math.round(1e5*(this.getValue()+t))/1e5;this.setValue(i)}}),Rh=(H.protoUI(Hh,Sh.view),{name:"icon",$skin:function(){gh.api.$skin.call(this),this.defaults.height=Li.inputHeight,this.defaults.width=Li.inputHeight},defaults:{template:function(t,i){var e=Math.min(t.awidth,t.aheight),s=Math.round((i.we-t.aheight)/2),
n="<button type='button' style='height:"+e+"px;width:"+e+"px;' class='webix_icon_button'><span class='webix_icon "+t.icon+"'></span></button>";return"<div class='webix_el_box' style='width:"+t.awidth+"px;height:"+t.aheight+"px;line-height:"+t.aheight+"px;margin-top:"+s+"px'>"+n+(t.badge||0===t.badge?"<span class='webix_badge'>"+t.badge+"</span>":"")+"</div>"}},Db:!1,Sb:function(){},$setValue:function(){}}),Eh=(H.protoUI(Rh,gh.view),{name:"search",on_click:{webix_input_icon:function(t){this.getInputNode().focus(),this.callEvent("onSearchIconClick",[t])}},$skin:function(){Sh.api.$skin.call(this),this.defaults.inputPadding=Li.inputPadding},defaults:{type:"text",icon:"wxi-search"}}),Ph=(H.protoUI(Eh,Sh.view),{name:"segmented",$allowsClear:!1,$init:function(){this.attachEvent("onChange",function(t){this.P.multiview&&this.km(t)}),this.attachEvent("onAfterRender",a(function(){this.P.multiview&&this.P.value&&this.km(this.P.value)}))},km:function(t){var i=this.getTopParentView(),e=null;i&&i.$$&&(e=i.$$(t)),e||(e=oi(t)),e&&e.show&&e.show()},defaults:{template:function(t,i){i.Eb(t.options);var e,s,n=i.cu(t.options),h=i.hm(t),r="contrast"==Oi?0:n.length-1,o=t.optionWidth||Math.floor((h-r)/n.length),a="<div style='width:"+h+"px' class='webix_all_segments' role='tablist' aria-label='"+Yt.escape(t.label)+"'>";t.value||(t.value=i.uu(!0));for(var u=0;u<n.length;u++)s=!!n[u].disabled,e=t.tooltip?" webix_t_id='"+n[u].id+"'":"",a+="<button type='button' style='width:"+(n[u].width||o)+"px' role='tab' aria-selected='"+(t.value==n[u].id?"true":"false")+"' tabindex='"+(s||t.value!=n[u].id?"-1":"0")+"' class='webix_segment_"+(u==n.length-1?"N":0<u?1:0)+(t.value==n[u].id?" webix_selected":"")+(s?" webix_disabled":"")+"' "+(s?"webix_disabled='true' ":"")+"button_id='"+n[u].id+"'"+e+">"+n[u].value+"</button>";return i.$renderInput(t,a+"</div>",V())}},ru:function(){return this.$view.getElementsByTagName("BUTTON")},focus:function(){return this.wi()},blur:function(){this.ou()},$setValue:function(t){var i=this.config.tabbarPopup;if(i&&oi(i)&&oi(i).getBody().exists(t))return this.refresh();for(var e,s,n=this.ru(),h=0;h<n.length;h++)e=n[h].getAttribute("button_id"),s=this.getOption(e),n[h].setAttribute("aria-selected",t==e?"true":"false"),n[h].setAttribute("tabindex",s&&!s.disabled&&t==e?"0":"-1"),t==e?yt(n[h],"webix_selected"):Mt(n[h],"webix_selected")},$getValue:function(){return this.P.value||""},getValue:function(){return this.P.value},getInputNode:function(){return null},Db:!1}),jh={api:Ph,view:H.protoUI(Ph,Sh.view,Ie)},Nh={name:"textarea",defaults:{template:function(t,i){var e=t.name||t.id,s="x"+V(),n=i.om("textarea")+"style='width:"+i.hm(t)+"px;'";return n+=" id='"+s+"' name='"+e+"' class='webix_inp_textarea'>"+i.Ob(t.value)+"</textarea>",i.$renderInput(t,n,s)},minHeight:60},$skin:function(){Sh.api.$skin.call(this),this.defaults.height=0},zi:!0,um:function(t){return t?this.N_-this.P.inputPadding:""},getInputNode:function(){return this.tt.getElementsByTagName("textarea")[0]}},Lh=(H.protoUI(Nh,Sh.view),{name:"toggle",$allowsClear:!0,$init:function(){this.attachEvent("onItemClick",function(){this.toggle()})},$renderInput:function(t){return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+" class='webix_button'>"+t.label+"</button>"},$setValue:function(t){var i=this.getInputNode(),e=this.P,s=t&&"0"!=t,n=(s?e.onLabel:e.offLabel)||e.label,h=i.children;if(this.wd[e.type]){var r=h[0];"SPAN"==r.nodeName&&e.onIcon&&e.offIcon&&e.onIcon!=e.offIcon&&(r.className=r.className.replace(s?e.offIcon:e.onIcon,s?e.onIcon:e.offIcon)),"imageTop"==e.type||"iconTop"==e.type?h[1].innerHTML=n:(i.innerHTML=n,i.insertBefore(r,i.firstChild))}else i.innerHTML=n;i.setAttribute("aria-pressed",s?"true":"false"),(s?yt:Mt)(i.parentNode,"webix_pressed")},toggle:function(){this.setValue(!this.getValue())},getValue:function(){var t=this.P.value;return t&&"0"!=t?1:0},defaults:{template:function(t,i){var e=t.value&&"0"!=t.value,s=e?" webix_pressed":"";t.label=(e?t.onLabel:t.offLabel)||t.label,t.icon=(e?t.onIcon:t.offIcon)||t.icon
;var n="<div class='webix_el_box"+s+"' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+i.$renderInput(t,i)+"</div>";return n=n.replace(/(button)\s*(?=\w)/,"$1 aria-pressed='"+(e?"true":"false")+"' "),(t.badge||0===t.badge)&&(n=n.replace(/<\/div>$/,"<span class='webix_badge'>"+t.badge+"</span></div>")),n}},Db:!1}),Oh=(H.protoUI(Lh,gh.view),{name:"multitext",$cssName:"text",defaults:{icon:"wxi-plus-circle",iconWidth:25,separator:", "},getValueHere:function(){return Sh.api.getValue.call(this)},setValueHere:function(t){return Sh.api.$setValue.call(this,t)},getValue:function(){if("extra"==this.config.mode)return this.getValueHere();if(this.Cm)return this.Cm;for(var t=[this.getValueHere(this)],i=0;i<this.$m.length;i++){var e=oi(this.$m[i]).getValueHere();e&&t.push(e)}return t.join(this.config.separator)},$setValue:function(t){if(t=t||"","extra"==this.config.mode)return this.setValueHere(t);var i=(this.Cm=t).split(this.config.separator);if(i.length!=this.$m.length+1){this.removeSection(),this.setValueHere.call(this,i[0]);for(var e=1;e<i.length;e++)this.addSection(i[e]);this.Cm=""}else{this.setValueHere(i[0]);for(var s=0;s<this.$m.length;s++)oi(this.$m[s]).setValueHere(i[s+1]);this.Cm=""}},Dm:function(){var t=this.config.master?oi(this.config.master):this,i=t.getValue(),e=t.P.value;i!==e&&(t.P.value=i,t.callEvent("onChange",[i,e]))},addSection:function(t){var i=this.config,e={labelWidth:i.labelWidth,inputWidth:i.inputWidth,width:i.width,label:i.label?"&nbsp;":"",view:this.name,mode:"extra",value:t||"",icon:"wxi-minus-circle",tooltip:i.tooltip,suggest:i.suggest||null,master:i.id};H.extend(e,i.subConfig||{},!0);var s=this.getParentView().addView(e);return oi(s).attachEvent("onChange",this.Dm),this.$m.push(s),this.callEvent("onSectionAdd",[s,this.$m.length]),s},removeSection:function(t){for(var i=this.config.master?oi(this.config.master):this,e=i.$m.length-1;0<=e;e--){var s=i.$m[e];t&&s!=t||(i.$m.removeAt(e),this.getParentView().removeView(s),i.callEvent("onSectionRemove",[s,e+1]))}},on_click:{webix_input_icon:function(){if("extra"==this.config.mode){var t=this.getParentView();this.removeSection(this.config.id);var i=t.getChildViews();i[i.length-1].focus(),this.Dm()}else oi(this.addSection()).focus();return!1}},$init:function(){this.$m=m([]),this.attachEvent("onKeyPress",this.ke)},$render:function(t){this.$setValue(t.value)}}),Wh=(H.protoUI(Oh,Sh.view),{name:"proto",$init:function(){this.data.provideApi(this,!0),this.tt=this.tt||this.Wi,this.data.attachEvent("onStoreUpdated",S(function(){this.render.apply(this,arguments)},this))},$setSize:function(){Hi.api.$setSize.apply(this,arguments)&&this.render()},Qo:"webix_item",on_mouse_move:{},type:{}}),Uh={api:Wh,view:H.protoUI(Wh,Re,oe,Pi,ps,Pe,_e,Hi.view,g,Si)},Yh={name:"list",Im:"webix_list",oh:"webix_list_item",$init:function(t){yt(this.Vt,this.Im+("x"==(t.layout||this.defaults.layout)?"-x":"")),this.data.provideApi(this,!0),this.Am=S(this.Am,this),this.data.attachEvent("onStoreUpdated",this.Am),this.data.attachEvent("onSyncApply",this.Am),this.Vt.setAttribute("role","listbox")},dynamic_setter:function(t){return t&&H.extend(this,gs,!0),t},$dragHTML:function(t,i,e){var s;return"y"==this.P.layout&&"auto"==this.type.width?(this.type.width=this.me,s=this.Q(t),this.type.width="auto"):s=this.Q(t),$(e.source)&&1<e.source.length&&(s=this.No(s,e.source.length)),s},defaults:{select:!1,scroll:!0,layout:"y",navigation:!0,datafetch:50},Qo:"webix_l_id",on_click:{webix_list_item:function(t,i){this.P.select&&(this.Fm=!0,"multiselect"==this.P.select||this.P.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.P.multiselect,t.shiftKey):this.select(i),this.Fm=!1)}},on_dblclick:{},getVisibleCount:function(){return Math.floor(this.we/this.Tm())},Am:function(){var t=this.P;if(t.autoheight||t.autowidth)return this.resize();"y"==t.layout?t.yCount&&this.Vm(t.yCount):t.xCount&&this.zm(t.xCount)},Vm:function(t){var i=this.data.$pagesize||this.count();this.Mc(t&&t<i,"y"),this.P.autoheight&&i<(t||Infinity)&&(t=i);var e=this.Tm()*t+(this.type.margin||0);return this.getUnits&&(e+=this.getUnits(
).length*this.type.headerHeight),Math.max(e,this.P.minHeight||0)},Tm:function(){return this.type.height+(this.type.margin||0)},zm:function(t){var i=this.data.$pagesize||this.count();return this.Mc(t&&t<i,"x"),this.P.autowidth&&i<(t||Infinity)&&(t=i),this.type.width*t},$getSize:function(t,i){return"y"==this.P.layout?("auto"!=this.type.width&&(this.P.width=this.type.width+(this.ge?q.scrollSize:0)),(this.P.yCount||this.P.autoheight)&&(this.P.height=this.Vm(this.P.yCount)||1)):("auto"!=this.type.height&&(this.P.height=this.Tm()+(this.xe?q.scrollSize:0)),(this.P.xCount||this.P.autowidth)&&(this.P.width=this.zm(this.P.xCount)||1)),Hi.api.$getSize.call(this,t,i)},$setSize:function(){Hi.api.$setSize.apply(this,arguments)},type:{css:"",widthSize:function(t,i){return i.width+(-1<i.width?"px":"")},heightSize:function(t,i){return i.height+(-1<i.height?"px":"")},classname:function(t,i,e){var s="webix_list_item";return i.css&&(s+=" "+i.css),t.disabled&&(s+=" webix_disabled"),t.$css&&("object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css),e&&e.$css&&(s+=" "+e.$css),s},aria:function(t,i,e){return'role="option"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count&&t.$template?'aria-expanded="true"':"")+(t.disabled?' aria-disabled="true" webix_disabled="true"':"")},template:function(t){return(t.icon?"<span class='webix_list_icon webix_icon "+t.icon+"'></span>":"")+t.value+(t.badge||0===t.badge?"<div class='webix_badge'>"+t.badge+"</div>":"")},width:"auto",templateStart:Yt('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>'),templateEnd:Yt("</div>")},$skin:function(){this.type.height=Li.listItemHeight},disableItem:function(t){this.Bm(t,!0)},enableItem:function(t){this.Bm(t,!1)},Bm:function(t,i){var e=this.getItem(t);e&&(e.disabled=i,this.refresh(t))},isItemEnabled:function(t){var i=this.getItem(t);return i&&!i.disabled},Su:function(t,i,e){return this.isItemEnabled(t)?t:(t=this.getNextId(t,e)||null)&&t!=i?this.Su(t,i,e):i}},qh={api:Yh,view:H.protoUI(Yh,he,Te,ae,be,ze,Ne,je,Uh.view,ne)},Gh={name:"multiselect",$cssName:"richselect",defaults:{separator:",",stringResult:!0},ym:function(t){var i=!$(t)&&"object"==M(t)&&!t.name,e={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button};this.P.optionWidth?e.width=this.P.optionWidth:e.fitMaster=!0,i&&H.extend(e,t,!0);var s=si(e),n=s.getList();return"string"==typeof t?n.load(t):i||n.parse(t),s.attachEvent("onShow",function(){s.setValue(oi(s.P.master).config.value)}),s},$compareValue:function(t,i){return t.toString()==i.toString()},$prepareValue:function(t){return"string"==typeof(t=t||[])?t.split(this.P.separator):$(t)?t:[gh.api.$prepareValue.call(this,t)]},$setValue:function(t){if(this.Fb){var i=this.getPopup(),e="";i&&"object"==M(e=i.setValue(t))&&(e=e.join(this.config.separator+" ")),this.P.text=e,this.getInputNode().innerHTML=e||this.Pb()}},getValue:function(){var t=this.P.value||[];return this.P.stringResult?t.join(this.P.separator):t}};Me.multiselect=H.extend({popupType:"multiselect",popupInit:function(t){t.ba=function(){},t.linkInput(document.body)}},Me.richselect),ti(qh.view,{name:"multilist",templateStart:Yt('<div webix_l_id="#!id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>')}),ti(qh.view,{name:"checklist",templateStart:Yt('<div webix_l_id="#!id#" {common.aria()} class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden; white-space:nowrap;">{common.checkbox()}'),checkbox:function(t){var i=t.$checked?"wxi-checkbox-marked":"wxi-checkbox-blank";return"<span role='checkbox' tabindex='-1' aria-checked='"+(t.$checked?"true":"false")+"' class='webix_icon "+i+"'></span>"},aria:function(t){return"role='option' tabindex='-1' "+(t.$checked?"aria-selected='true'":"")},template:Yt("#value#")});H.protoUI(Gh,zh.view);var Xh={name:"multicombo",$cssName:"text",defaults:{
keepText:!1,separator:",",stringResult:!0,icon:!1,iconWidth:0,tagMode:!0,tagTemplate:function(t){return t.length?t.length+" item(s)":""},template:function(t,i){return i.Hm(t,i)}},$init:function(){var t=this;this.$view.className+=" webix_multicombo",this.attachEvent("onBeforeRender",function(){return this.Hb||(this.Hb=Li.inputHeight),!0}),this.attachEvent("onAfterRender",function(){this.be=null}),Kt(this.$view,"scroll",function(){t.$view.scrollTop=0})},on_click:{webix_multicombo_delete:function(t,i,e){var s;return!this.P.readonly&&e&&(s=e.parentNode.getAttribute("optvalue"))&&this.Rm(s),!1},webix_inp_label:function(t){this.Sm(t)},webix_inp_top_label:function(t){this.Sm(t)}},em:function(){var t=this.getInputNode(),i=t.value;i&&this.P.newValues&&100<new Date-(this.getPopup().Em||0)&&(i=i.trim(),this.Pm(i)),this.jm=t.value=this.P.keepText?i:"",this.$setValue()},Rm:function(t){var i=this.P.value||[],e=oi(this.config.suggest);(i=m(_(i))).remove(t),this.setValue(i),e&&e.P.selectAll&&e.getBody().ri[0].setValue(0)},Nm:function(t){var i=oi(this.config.suggest);if(i.getList().getItem(t)){var e=i.getValue();e&&"string"==typeof e&&(e=e.split(i.config.separator)),(e=m(e||[])).find(t)<0&&(e.push(t),i.setValue(e),this.setValue(i.getValue()))}},Pm:function(t){var i,e=oi(this.config.suggest),s=e.getList();if(t=Yt.escape(t.trim())){for(var n in s.data.pull)e.getItemText(n)==t&&(i=n);i||(i=s.add({value:t})),this.Nm(i)}},ym:function(t){var i=!$(t)&&"object"==M(t)&&!t.name,e={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button},s=this;i&&H.extend(e,t,!0),!e.width&&this.P.optionWidth&&H.extend(e,{width:this.P.optionWidth,fitMaster:!1},!0),e.width=e.fitMaster||R(e.fitMaster)?0:e.width;var n=si(e);e.width||(n.$customWidth=function(){this.config.width=s.hm(s.P)}),n.attachEvent("onBeforeShow",function(t,i,e){if(this.P.master&&(this.setValue(oi(this.P.master).config.value),oi(this.P.master).getInputNode().value||this.isVisible()?(this.getList().refresh(),this.Lm=!0):this.getList().filter(),t.tagName&&"input"==t.tagName.toLowerCase()))return th.api.show.apply(this,[t.parentNode,i,e]),!1});var h=n.getList();return"string"==typeof t?h.load(t):i||h.parse(t),n.Om=function(){if(!this.Wm)return!0;this.Wm=!1,this.show(s.Um())},n},Hm:function(t,i){var e,s,n,h,r,o,a,u,c,f,l,d,v="",_="top"==this.P.labelPosition;return e="x"+V(),d=i.hm(t),s=t.inputAlign||"left",r=this.Hb-2*Li.inputPadding-2,h=this.jm||"",u="<ul class='webix_multicombo_listbox' style='line-height:"+r+"px'></ul>",n="width: "+Math.min(d,i.Ym||7)+"px;height:"+r+"px;max-width:"+(d-20)+"px",l=t.readonly?" readonly ":"",o="<div class='webix_inp_static' onclick='' style='line-height:"+r+"px;width: "+d+"px;  text-align: "+s+";height:auto' >"+u+("<input id='"+e+"' role='combobox' aria-multiline='true' aria-label='"+Yt.escape(t.label)+"' tabindex='0' type='text' class='webix_multicombo_input' "+l+" style='"+n+"' value='"+h+"'/>")+"</div>",a=i.$renderLabel(t,e),f=this.P.awidth-d-2*Li.inputPadding,(c=(t.invalid?t.invalidMessage:"")||t.bottomLabel)&&(v="<div class='webix_inp_bottom_label' style='width:"+d+"px;margin-left:"+Math.max(f,Li.inputPadding)+"px;'>"+c+"</div>"),_?a+"<div class='webix_el_box' style='width:"+this.P.awidth+"px; height:auto;'>"+o+v+"</div>":"<div class='webix_el_box' style='width:"+this.P.awidth+"px; height:auto; min-height:"+this.P.aheight+"px;'>"+a+o+v+"</div>"},qm:function(){return this.Lp().getElementsByTagName("UL")[0]},Db:function(){var t=this.getPopup();if(t){var i=t?t.setValue(this.P.value):null;t.Gm&&(this.P.value=t.Gm(this.P.value));var e="",s=this.qm(),n=i&&i.length;if(n){var h=this.Hb-2*Li.inputPadding-8,r=this.P.value||[];if(this.P.tagMode)for(var o=0;o<i.length;o++)e+=this.$renderTag(i[o],h,r[o]);else e+="<li class='webix_multicombo_tag' style='line-height:"+h+"px;'><span>"+this.P.tagTemplate(r)+"</span></li>"}s.innerHTML=e;var a=this.getInputNode();this.P.placeholder&&(n?(a.placeholder="",!a.value&&20<a.offsetWidth&&(a.style.width="20px")):a.value||(a.placeholder=this.P.placeholder,a.style.width=this.hm(this.P
)+"px")),!this.P.tagMode&&s.firstChild&&(a.style.width=this.Xm()+"px")}this.Jm()},$renderTag:function(t,i,e){var s="<span>"+t+"</span><span class='webix_multicombo_delete' role='button' aria-label='"+I.aria.removeItem+"'></span>";return"<li class='webix_multicombo_value' style='line-height:"+i+"px;' optvalue='"+Yt.escape(e)+"'>"+s+"</li>"},Km:function(t){if(t=t||this.getInputNode()){var i=t.value.length;t.selectionStart=i,t.selectionEnd=i,t.focus()}},Jm:function(i){var t="top"==this.P.labelPosition,e=this.Um(),s=Math.max(e.offsetHeight+2*Li.inputPadding,this.Hb);if(t&&(s+=this.N_),(s+=this.P.bottomPadding||0)!=this.$getSize(0,0)[2]){var n=e.offsetHeight+(t?this.N_:0)+2*Li.inputPadding,h=this.getTopParentView();clearTimeout(h.Zd),h.Zd=k(function(){this.config.height!=n&&(this.config.height=n,this.resize()),Mi.getFocus()===this&&(i?this.getInputNode().select():this.Km(this.getInputNode()));var t=this.getPopup();t.isVisible()&&t.show(this.Um())},this)}i&&this.getInputNode().select()},Um:function(){for(var t=this.Lp(),i=t.childNodes,e=0;e<i.length;e++)if(i[e].className&&-1!=i[e].className.indexOf("webix_inp_static"))return i[e];return t},getInputNode:function(){return this.tt.getElementsByTagName("INPUT")[0]},$compareValue:function(t,i){return t.toString()==i.toString()},$prepareValue:function(t){return"string"==typeof(t=t||[])?t.split(this.P.separator):$(t)?t:[gh.api.$prepareValue.call(this,t)]},$setValue:function(){this.Fb&&this.Db()},getValue:function(t){if("object"==M(t)&&t.options)return this.Zm();var i=this.P.value||[];return this.P.stringResult?i.join(this.P.separator):i},getText:function(){var t=this.P.value||[];if(!t.length)return"";for(var i=[],e=0;e<t.length;e++)i.push(this.getPopup().getItemText(t[e]));return i.join(this.P.separator)},Zm:function(){var t,i,e,s=[],n=this.P.value||[];if(!n.length)return n;for(e=this.getPopup(),t=0;t<n.length;t++)(i=e.getList().getItem(n[t])||(e.Qm?e.Qm[n[t]]:null))&&s.push(i);return s},$setSize:function(t,i){var e=this.P;if(Hi.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==e.labelPosition&&(e.labelWidth=0),this.render()}},$render:function(){},tg:function(t){var i=ft("span",{type:"text",style:"visibility:visible; white-space:pre-wrap; position:absolute; top:-9999px;"});i.className="webix_el_text",i.innerHTML='<span class="webix_multicombo_input" style="margin:0;">'.concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"</span>"),document.body.appendChild(i);var e=i.offsetWidth+1;return document.body.removeChild(i),e},Xm:function(){var t=this.qm(),i=t.offsetWidth-(t.firstChild.offsetWidth+1);return i<=25?t.offsetWidth-12:i-15},ig:function(t){for(var i=t.split(this.P.separator),e=this.getPopup(),s="",n=0;n<i.length;n++){var h=i[n].trim();if(h)if(s=h,this.P.newValues)this.Pm(h);else{var r=e.getItemId(h);r&&this.Nm(r)}}return s},im:function(){Kt(this.Lp(),"click",function(t){var i=this.getInputNode();i.contains(t.target)?i.focus():this.Km(i)},{bind:this}),Kt(this.getInputNode(),"focus",function(){-1==this.Lp().className.indexOf("webix_focused")&&(this.Lp().className+=" webix_focused")},{bind:this}),Kt(this.getInputNode(),"blur",function(){this.Lp().className=this.Lp().className.replace(" webix_focused","")},{bind:this}),Kt(this.getInputNode(),"input",function(){var t,i,e=this.getInputNode(),s=!1;if(this.P.tagMode&&-1<e.value.indexOf(this.P.separator)){var n=this.ig(e.value);this.jm=e.value=this.P.keepText?n:"",s=this.P.keepText}var h=this.P.value||[];!this.P.placeholder||e.value||h.length?(i=t=this.tg(e.value),!this.P.tagMode&&this.qm().firstChild&&(i=this.Xm())):i=this.hm(this.P),e.style.width=i+"px",(s||t!=this.Ym)&&(this.Ym=t||i,this.jm=e.value,this.Jm(s))},{bind:this}),Kt(this.getInputNode(),"keydown",function(t){var i=this.getInputNode(),e=this.getPopup();t=t||event;var s=this.qm().lastChild;if(8==t.keyCode&&s&&(!i.value&&100<(new Date).valueOf()-(this.eg||0)?this.Rm(s.getAttribute("optvalue")):this.eg=(new Date).valueOf()),13==t.keyCode||9==t.keyCode){var n=i.value;e.getList().getSelectedId()||(n=this.ig(i.value)),this.jm=i.value=this.P.keepText?n:""
;var h=this.P.value||[];13!=t.keyCode||i.value||h.length||(e.getList().filter(),this.P.placeholder&&(i.style.width=this.hm(this.P)+"px")),this.Jm(13==t.keyCode)}},{bind:this}),oi(this.P.suggest).linkInput(this)}},Jh=(H.protoUI(Xh,zh.view),{name:"slider",$touchCapture:!0,defaults:{min:0,max:100,value:50,step:1,title:!1,moveTitle:!0,template:function(t,i){var e=i.sg="x"+V(),s="",n="<div class='webix_slider_title"+(t.moveTitle?" webix_slider_move":"")+"'"+(!t.moveTitle&&t.vertical?" style='line-height:"+(t.aheight-2*t.inputPadding)+"px;'":"")+">&nbsp;</div>",h="<div class='webix_slider_left'>&nbsp;</div>",r="<div class='webix_slider_right'></div>",o="<div class='webix_slider_handle' webix_disable_drag='true' role='slider' aria-label='"+t.label+(t.title?" "+t.title(t):"")+"' aria-valuemax='"+t.max+"' aria-valuemin='"+t.min+"' aria-valuenow='"+t.value+"' tabindex='0' id='"+e+"'>&nbsp;</div>";return s=t.vertical?"<div class='webix_slider_box'>"+r+h+o+"</div>"+n:n+"<div class='webix_slider_box'>"+h+r+o+"</div>",i.$renderInput(t,s,e)}},type_setter:function(t){this.Vt.className+=" webix_slider_"+t},title_setter:function(t){return"string"==typeof t?Yt(t):t},ng:function(){return this.$view.querySelector(".webix_slider_handle")},Db:function(){var t=this.ng(),i=this.P;if(t){var e=i.vertical?this.we:this.hm(i),s=i.value%i.step?Math.round(i.value/i.step)*i.step:i.value,n=i.max-i.min;s=Math.max(Math.min(s,i.max),i.min),s=i.vertical?n-(s-i.min):s-i.min;var h=Math.ceil((e-2*this.hg)*s/n),r=e-2*this.hg-h,o=i.vertical?"top":"left",a=i.vertical?"height":"width";t.style[o]=this.hg+h-this.rg/2+"px",t.parentNode.style[a]=e+"px",r=Math.min(Math.max(r,2*this.og),e-2*this.hg-2*this.og),h=Math.min(Math.max(h,2*this.og),e-2*this.hg-2*this.og);var u=t.previousSibling;u.style[a]=r+"px",u.previousSibling.style[a]=h+"px",this.ag(t,h,r,o)}},ag:function(t,i,e,s){var n=this.P;if(this.P.title){var h=t.parentNode[n.vertical?"nextSibling":"previousSibling"];if(h.innerHTML=this.P.title(this.P,this),this.P.moveTitle){var r=0;if(n.vertical)r=i+2*this.og-this.rg/2;else{var o=h.clientWidth/2,a=i<o?o-i-2*this.og:0,u=e<o?o-e-2*this.og-this.rg/2:0;r=this.hg+i-o+a-u}h.style[s]=r+"px"}}},ug:function(){this.ng().setAttribute("aria-valuenow",this.P.value)},refresh:function(){var t=this.ng();t&&(this.ug(),this.P.title&&t.setAttribute("aria-label",this.P.label+" "+this.P.title(this.P,this)),this.Db())},$setValue:function(){this.refresh()},$getValue:function(){return this.P.value},$prepareValue:function(t){return t=parseFloat(t),isNaN(t)?0:t},$init:function(t){q.touch?this.attachEvent("onTouchStart",S(this.cg,this)):Kt(this.Vt,"mousedown",S(this.cg,this)),Kt(this.$view,"keydown",S(this.fg,this)),t.vertical&&(t.height=t.height||Li.vSliderHeight,this.Vt.className+=" webix_slider_vertical",this.hg=Li.vSliderPadding)},$skin:function(){Sh.api.$skin.call(this),this.rg=Li.sliderHandleWidth,this.hg=Li.sliderPadding,this.og=Li.sliderBorder},fg:function(t){var i=t.keyCode,e=this.P,s=e.value;if(32<i&&i<41){gt(t);var n=t.target,h=/webix_slider_handle_(\d)/.exec(n.className);if(this.lg=h?parseInt(h[1],10):-1,h&&(s=e.value[this.lg]),s=s<e.min?e.min:s>e.max?e.max:s,36===i)s=e.min;else if(35===i)s=e.max;else{var r=37===i||40===i||34===i?-1:1;(33===i||34===i||1<e.step)&&(r*=e.step),s=1*s+r}if(h){var o=e.value[this.lg?0:1];s=this.lg&&s<=o||!this.lg&&o<=s?o:s}if(s>=e.min&&s<=e.max){if(h){for(var a=[],u=0;u<e.value.length;u++)a[u]=u===this.lg?s:e.value[u];s=a}this.setValue(s),this.lg=-1}}},cg:function(t){if(!this.xb){var i=t.target;this.dg&&this.dg(t);var e=this.P.value;if($(e)&&(e=_(e)),-1!=i.className.indexOf("webix_slider_handle"))return this.vg=e,this._g.apply(this,arguments);-1!=i.className.indexOf("webix_slider")&&(this.vg=e,this.P.value=this.pg.apply(this,arguments),this._g(t))}},_g:function(){q.touch?this.xb=[this.attachEvent("onTouchMove",S(this.yb,this)),this.attachEvent("onTouchEnd",S(this.Mb,this))]:this.xb=[Zt(document.body,"mousemove",S(this.yb,this)),Zt(window,"mouseup",S(this.Mb,this))],yt(document.body,"webix_noselect")},Mb:function(){this.xb&&(q.touch?(this.detachEvent(
this.xb[0]),this.detachEvent(this.xb[1])):(Qt(this.xb[0]),Qt(this.xb[1])),this.xb=null),Mt(document.body,"webix_noselect");var t=this.P.value;$(t)&&(t=_(t)),this.P.value=this.vg,this.setValue(t),this.ng(this.lg).focus(),this.lg=-1},yb:function(){this.P.value=this.pg.apply(this,arguments),this.refresh(),this.callEvent("onSliderDrag",[])},pg:function(t,i){var e=0,s=this.P.vertical?"y":"x";return e=q.touch?i?i[s]:t[s]:mt(t)[s],this.mg(e)},mg:function(t){var i=this.P,e=i.max-i.min,s=i.vertical?"y":"x",n=pt(this.ng().parentNode)[s]+this.hg,h=(i.vertical?this.we:this.hm(i))-2*this.hg,r=h?(t-n)*e/h:0;return i.vertical&&(r=e-r),r=Math.round((r+1*i.min)/i.step)*i.step,Math.max(Math.min(r,i.max),i.min)},im:function(){}}),Kh={api:Jh,view:H.protoUI(Jh,Sh.view)},Zh={name:"rangeslider",$cssName:"slider webix_rangeslider",defaults:{separator:",",value:[20,80],template:function(t,i){var e="x"+V();i.sg=[e+"_0",e+"_1"];var s="role='slider' aria-label='"+t.label+(t.title?" "+t.title(t):"")+"' aria-valuemax='"+t.max+"' aria-valuemin='"+t.min+"' tabindex='0'",n="<div class='webix_slider_handle webix_slider_handle_0' webix_disable_drag='true' id='"+i.sg[0]+"' "+s+" aria-valuenow='"+t.value[0]+"'>&nbsp;</div>";n+="<div class='webix_slider_handle webix_slider_handle_1' webix_disable_drag='true' id='"+i.sg[1]+"' "+s+" aria-valuenow='"+t.value[1]+"'>&nbsp;</div>";var h="<div class='webix_slider_title"+(t.moveTitle?" webix_slider_move":"")+"'"+(!t.moveTitle&&t.vertical?" style='line-height:"+(t.aheight-i.hg-2*t.inputPadding)+"px;'":"")+">&nbsp;</div>";t.moveTitle&&(h="<div class='webix_slider_title_box'>"+(h+h)+"</div>");var r="<div class='webix_slider_right'>&nbsp;</div><div class='webix_slider_left'></div>",o="";return o=t.vertical?"<div class='webix_slider_box'>"+r+n+"</div>"+h:h+"<div class='webix_slider_box'>"+r+n+"</div>",i.$renderInput(t,o,e)}},$prepareValue:function(t){if($(t)||(t=(t||"").toString().split(this.P.separator)),t[0]=parseFloat(t[0]),t[0]=isNaN(t[0])?0:t[0],t.length<2?t[1]=t[0]:(t[1]=parseFloat(t[1]),t[1]=isNaN(t[1])?0:t[1]),t[0]>t[1]){var i=[t[1],t[0]];t[0]=i[0],t[1]=i[1]}return t},ng:function(t){return t=t&&0<=t?t:0,this.$view.querySelector(".webix_slider_handle_"+(t||0))},gg:function(t,i){var e,s,n;return s=(e=this.P).max-e.min,n=e.value[i]%e.step?Math.round(e.value[i]/e.step)*e.step:e.value[i],n=Math.max(Math.min(n,e.max),e.min),Math.ceil((t-2*this.hg)*(n-e.min)/s)},wg:function(t,i,e){var s=this.hg+i-this.rg/2*(e?-1:1);return(s=e?t-s:s)+"px"},xg:function(t,i,e,s){var n=i+this.hg+2*this.og;return s&&(n=t-n-e),n+"px"},Db:function(){var t,i,e,s,n,h,r,o,a,u,c;i=this.ng(0),e=this.ng(1),$((t=this.P).value)||this.define("value",t.value),i&&(a=t.vertical?"height":"width",c=t.vertical?"top":"left",h=(u=t.vertical?this.we:this.hm(t))-2*this.hg-2*this.og,s=this.gg(u,0),r=(n=this.gg(u,1))-s,i.style[c]=this.wg(u,s,t.vertical),e.style[c]=this.wg(u,n,t.vertical),(o=i.parentNode).style[a]=u+"px",o.firstChild.style[a]=h+"px",o.childNodes[1].style[a]=r+"px",o.childNodes[1].style[c]=this.xg(u,s,r,t.vertical),this.ag(i,[s,n],h,c))},yg:0,Mg:function(t,i){R(this.yg)||(t[this.yg].style.visibility="visible"),R(i)||(t[i].style.visibility="hidden",this.yg=i)},ag:function(t,i,e,s){var n=this.P;if(this.P.title){var h=t.parentNode,r=n.vertical?"nextSibling":"previousSibling";if(n.moveTitle){for(var o=h[r].childNodes,a=[],u=0;u<2;u++)a.push(this.Sg(o[u],n.value[u],i[u],e,s,u));var c=n.vertical?a[0]-a[1]-this.rg:a[1]-a[0],f=n.vertical?"clientHeight":"clientWidth";o[0][f]/2+o[1][f]/2>c?this.Mg(o,R(this.lg)?0:this.lg?0:1):this.Mg(o);for(var l=0;l<2;l++)o[l].style[s]=a[l]+"px"}else h[r].innerHTML=this.P.title(this.P,this)}},Sg:function(t,i,e,s,n,h){t.innerHTML=this.P.title({value:i},this);var r=t.clientWidth/2,o=0;return o=this.P.vertical?s-e-this.rg/2-(h?this.hg:0)+2*this.og:(o=e+this.rg/2+2*this.og-r,o=e<r?r-e+o:o,h&&s<r+e?o-r+(s-e):o)},ug:function(){for(var t=0;t<2;t++)this.ng(t).setAttribute("aria-valuenow",this.P.value[t])},dg:function(t){var i=t.target,e=/webix_slider_handle_(\d)/.exec(i.className);this.lg=e?parseInt(e[1],10):-1,e&&this.kg(this.lg)},
$compareValue:function(t,i){return i=this.$prepareValue(i),t[0]===i[0]&&t[1]===i[1]},$getValue:function(){var t=this.P.value;return this.P.stringResult?t.join(this.P.separator):t},kg:function(t){var i=this.ng(t),e=this.ng(1-t);-1==i.className.indexOf("webix_slider_active")&&(i.className+=" webix_slider_active"),e.className=e.className.replace(" webix_slider_active",""),i.focus()},mg:function(t){var i=this.P,e=i.value,s=i.max-i.min,n=i.vertical?"y":"x",h=pt(this.ng().parentNode)[n],r=Math.ceil((t-h)*s/(i.vertical?this.we:this.hm(i)));r=Math.round((r+1*i.min)/i.step)*i.step,i.vertical&&(r=s-r);var o=null,a=pt(this.ng(0))[n],u=pt(this.ng(1))[n];a!=u||i.value[0]!=i.min&&i.value[0]!=i.max?0<=this.lg?o=this.lg:a==u?o=t<a?0:1:(o=Math.abs(a-t)<Math.abs(u-t)?0:1,this.lg=o):(this.lg=o=i.value[0]==i.min?1:0,this.kg(o));return e[o]=o?Math.max(Math.min(r,i.max),e[0]):Math.max(Math.min(r,e[1]),i.min),e}},Qh=(H.protoUI(Zh,Kh.view),{name:"switch",defaults:{template:function(t,i){i.Cg();var e=t.name||"x"+V(),s="";t.labelRight&&(s="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||"&nbsp;"));var n=t.checkValue==t.value,h='aria-label="'+(t.label||t.labelRight||"")+'" role="checkbox" tabindex="0" aria-checked="'+(n?"true":"false")+'" '+(t.readonly?"aria-readonly='true'":"")+'"',r='<div class="webix_switch_box '+(n?" webix_switch_on":"")+'" style="width:'+i.$g+'px"><span class="webix_switch_text">'+((n?t.onLabel:t.offLabel)||"")+'</span><button class="webix_switch_handle" '+h+' style="left:'+(n?i.$g-i.Dg:0)+'px;"><input  id="'+e+'" class="webix_switch_toggle" type="checkbox" '+(n?"checked":"")+"></button></div>"+s;return i.$renderInput(t,r,e)}},$skin:function(){Dh.api.$skin.call(this),this.Dg=Li.switchHeight,this.$g=Li.switchWidth},$setValue:function(t){var i=this.P,e=t==i.checkValue,s=this.$view.querySelector(".webix_switch_box");if(s){var n=s.childNodes[1],h=(e?i.onLabel:i.offLabel)||"";e?yt(s,"webix_switch_on"):Mt(s,"webix_switch_on"),n.style.left=(e?this.$g-this.Dg:0)+"px",n.firstChild.checked=e,n.setAttribute("aria-checked",e?"true":"false"),h&&(s.childNodes[0].innerHTML=h)}},Cg:function(){var t=this.P;if(t.onLabel||t.offLabel){var i=t.onLabel?St(t.onLabel,"webix_switch_text").width:0,e=t.onLabel?St(t.offLabel,"webix_switch_text").width:0;this.$g=Math.max(i,e)+this.Dg}},on_click:{webix_switch_box:function(){this.P.readonly||this.toggle()},webix_label_right:function(){this.P.readonly||this.toggle()}}}),tr=(H.protoUI(Qh,Dh.view),{name:"tabbar",$init:function(){this.attachEvent("onKeyPress",this.ke)},$skin:function(){var t=Li,i=this.defaults;i.topOffset=t.tabTopOffset||0,i.tabOffset="undefined"!=typeof t.tabOffset?t.tabOffset:10,i.bottomOffset=t.tabBottomOffset||0,i.height=t.tabbarHeight,i.tabMargin=t.tabMargin,i.inputPadding=t.inputPadding,i.tabMinWidth=t.tabMinWidth||100,i.tabMoreWidth=t.tabMoreWidth||40,i.borderless=!t.tabBorder},Ig:function(){var t,i,e=this.P,s=this.cu(e.options),n=this.zb-2*e.tabOffset,h=e.optionWidth||e.tabMinWidth;if(i=s.length,e.tabMinWidth&&n/i<h)return{max:parseInt(n/h,10)||1};if(!e.optionWidth)for(t=0;t<i;t++)s[t].width&&(n-=s[t].width+(t||e.type?0:e.tabMargin),i--);return{width:i?n/i:e.tabMinWidth}},fm:function(){var i=this,t=this.P;if(!t.tabbarPopup){var e=si({view:"popup",autofocus:!1,width:t.popupWidth||200,body:{view:"list",borderless:!0,select:!0,navigation:!0,css:"webix_tab_list",autoheight:!0,yCount:t.yCount,type:{template:t.popupTemplate}}}),s=e.getBody();e.attachEvent("onShow",function(){s.unselect(),Mi.setFocus(s);var t=s.getItemNode(s.getFirstId());t&&t.focus()}),s.attachEvent("onItemClick",function(t){return i.Ag(t)}),s.attachEvent("onEnter",function(){return i.Ag()}),t.tabbarPopup=e.P.id,this.Bt.push(e)}this.fm=function(){}},Ag:function(t){var i=oi(this.P.tabbarPopup);return(t=t||i.getBody().getSelectedId())&&this.callEvent("onBeforeTabClick",[t])&&(this.setValue(t),i.hide(),this.callEvent("onAfterTabClick",[t]),this.refresh(),this.focus()),!1},getPopup:function(){return this.fm(),oi(this.P.tabbarPopup)},moreTemplate_setter:Yt,popupTemplate_setter:Yt,
defaults:{popupWidth:200,popupTemplate:"#value#",yCount:7,moreTemplate:'<span class="webix_icon wxi-dots"></span>',template:function(t,i){i.Eb(t.options);var e,s,n,h,r,o,a,u=i.cu(t.options);if(u.length){t.value||(t.value=i.uu(!0)),e="",t.tabOffset&&(e+="<div class='webix_tab_filler' style='width:"+t.tabOffset+"px;'>&nbsp;</div>"),i.zb-2*t.tabOffset-(t.type?0:t.tabMargin*(u.length-1)),o=t.topOffset+t.bottomOffset;var c=i.Ig();if(c.max&&c.max<u.length){var f=i.getPopup();f.hide();var l=f.getBody()||null;if(l)if(c.max){for(var d=0,v=!1;d<u.length&&!v;d++)if(u[d].id==t.value&&(v=!0,d+1>c.max)){var _=u.splice(d,1);u=u.splice(0,c.max-1).concat(_).concat(u)}l.clearAll(),l.parse(u.slice(c.max))}else l.clearAll()}else i.P.tabbarPopup&&oi(i.P.tabbarPopup).hide();r=t.tabOffset;for(var p=0,b=!1;p<u.length&&!b;p++)a=c&&c.max?(c.max==p+1&&(b=!0),(i.zb-2*t.tabOffset-(!t.type&&1<c.max?t.tabMargin*(c.max-1):0)-t.tabMoreWidth)/c.max):c.width,r+=(a=u[p].width||t.optionWidth||a)+(p&&!t.type?t.tabMargin:0),0<t.tabMargin&&p&&!t.type&&(e+="<div class='webix_tab_filler' style='width:"+t.tabMargin+"px;'></div>"),e+=i.Fg(u[p],a),b&&(e+='<div role="button" tabindex="0" aria-label="'+I.aria.showTabs+'" class="webix_tab_more_icon" style="width:'+t.tabMoreWidth+'px;">'+t.moreTemplate(t,i)+"</div>",r+=t.tabMoreWidth);0<(s=i.me-r)&&!t.type&&(e+="<div class='webix_tab_filler' style='width:"+s+"px;'>&nbsp;</div>")}else e="<div class='webix_tab_filler' style='width:"+i.zb+"px; border-right:0px;'></div>";return n="",h=o&&!t.type?"height:"+(i.we-o)+"px":"",t.topOffset&&!t.type&&(n+="<div class='webix_before_all_tabs' style='width:100%;height:"+t.topOffset+"px'></div>"),n+="<div style='"+h+"' role='tablist' class='webix_all_tabs "+(t.type?"webixtype_"+t.type:"")+"'>"+e+"</div>",t.bottomOffset&&!t.type&&(n+="<div class='webix_after_all_tabs' style='width:100%;height:"+t.bottomOffset+"px'></div>"),n}},ru:function(){return this.$view.querySelectorAll(".webix_item_tab")},Fg:function(t,i){var e,s="",n="",h=!!t.disabled,r=this.config;if(t.id==r.value&&(s+=" webix_selected"),h&&(s+=" webix_disabled"),t.css&&(s+=" "+t.css),r.tooltip&&(n=" webix_t_id='"+t.id+"'"),i=t.width||i,e='<div class="webix_item_tab'+s+'" button_id="'+t.id+'" role="tab" aria-selected="'+(t.id==r.value?"true":"false")+'" tabindex="'+(h||t.id!=r.value?"-1":"0")+'" style="width:'+i+'px;"'+(h?' webix_disabled="true"':"")+n+">",this.Tg){var o=this.we-2*r.inputPadding-2,a=this.we-2,u=H.extend({cheight:o,aheight:a},t);e+=this.Tg(u)}else{e+=(t.icon?"<span class='webix_icon "+t.icon+"'></span> ":"")+t.value}return h||!t.close&&!r.close||(e+="<span role='button' tabindex='0' aria-label='"+I.aria.closeTab+"' class='webix_tab_close webix_icon wxi-close'></span>"),e+="</div>"},Lp:function(){return this.tt.firstChild},wd:{image:"<div class='webix_img_btn_top' style='height:#cheight#px;background-image:url(#image#);'><div class='webix_img_btn_text'>#value#</div></div>",icon:"<div class='webix_img_btn' style='line-height:#cheight#px;height:#cheight#px;'><span class='webix_icon_btn #icon#' style='max-width:#cheight#px;max-height:#cheight#px;'></span>#value#</div>",iconTop:"<div class='webix_img_btn_top' style='height:#cheight#px;width:100%;top:0px;text-align:center;'><span class='webix_icon #icon#'></span><div class='webix_img_btn_text'>#value#</div></div>"},type_setter:function(t){return this.P.tabOffset=0,this.wd[t]&&(this.Tg=Yt(this.wd[t])),t}}),ir=(H.protoUI(tr,jh.view),{name:"richtext",defaults:{label:"",labelWidth:80,labelPosition:"left"},$init:function(){this.Vt.className+=" webix_richtext",this.$ready.unshift(this.Vg)},$skin:function(){kn.api.$skin.call(this),this.defaults.paddingX=Li.inputSpacing/2,this.defaults.paddingY=Li.inputPadding},getInputNode:function(){return this.$view.querySelector(".webix_richtext_editor")},zg:function(t){return{view:"toggle",type:"icon",icon:"wxi-"+t,name:t,id:t,label:I.richtext[t],autowidth:!0,action:t,click:this.Bg}},Vg:function(){var t=this,i={view:"template",css:"webix_richtext_container",borderless:!0,
template:"<div class='webix_richtext_editor' contenteditable='true'>"+this.getValue()+"</div>",on:{onAfterRender:function(){t.Fb=!0,t.refresh(),Kt(t.getInputNode(),"blur",function(){t.Hg(this.innerHTML)}),Kt(t.getInputNode(),"keyup",function(){t.Rg()})}},onClick:{webix_richtext_editor:function(){t.Rg()}}},e=[this.zg("underline"),this.zg("bold"),this.zg("italic"),{}],s={view:"toolbar",id:"toolbar",elements:e},n=[s,i];"top"===this.config.labelPosition?(s.elements=e.concat([{view:"label",label:this.config.label,align:"right"},{width:4}]),this.rows_setter(n)):this.config.labelWidth?(this.config.margin=0,this.cols_setter([{template:this.config.label||" ",css:"webix_richtext_inp_label"+(this.config.required?" webix_required":""),borderless:!0,width:this.config.labelWidth},{rows:n}])):this.rows_setter(n)},labelWidth_setter:function(t){return t?Math.max(t,Li.dataPadding):0},Rg:function(){var t;this.$$("toolbar").setValues({italic:!1,underline:!1,bold:!1}),t=window.getSelection?window.getSelection():document.selection.createRange();for(var i=0;i<t.rangeCount;++i)this.$view.contains(this.getInputNode())&&(document.queryCommandState("bold")&&this.$$("bold").setValue(!0),document.queryCommandState("underline")&&this.$$("underline").setValue(!0),document.queryCommandState("italic")&&this.$$("italic").setValue(!0))},refresh:function(){this.Fb&&(this.getInputNode().innerHTML=this.config.value||"")},Eg:function(t){var i,e;if(window.getSelection){e=(i=window.getSelection()).toString().length;var s=this.getInputNode();if(s.contains(i.anchorNode)&&s.contains(i.focusNode)&&0<e)for(var n=0;n<i.rangeCount;++n){var h=i.getRangeAt(n);if(i.isCollapsed){var r=i.focusNode.textContent,o=i.focusNode,a=i.anchorOffset,u=r.substring(0,a).match(/[A-Za-z]*$/)[0],c=r.substring(a).match(/^[A-Za-z]*/)[0],f=a-u.length,l=a+c.length;h.setStart(o,f),h.setEnd(o,l),i.removeAllRanges(),i.addRange(h),document.execCommand(t,!1,"")}else document.execCommand(t,!1,"")}}},Bg:function(){this.getTopParentView().Eg(this.config.action)},focus:function(){if(!Mi.canFocus(this))return!1;this.getInputNode().focus()},Hg:function(t){var i=this.config.value;this.config.value=t||"",i!==t&&this.callEvent("onChange",[t,i])},setValue:function(t){this.Hg(t),this.refresh()},getValue:function(){this.getInputNode()&&(this.config.value=this.getInputNode().innerHTML);var t=this.config.value;return t||(0===t?"0":"")}});H.protoUI(ir,Fe,kn.view);ti(qh.view,{name:"uploader",template:"{common.removeIcon()}{common.percent()}<div style='float:right'>#sizetext#</div>{common.fileName()}",percent:function(t){return"transfer"==t.status?"<div style='width:60px; text-align:center; float:right'>"+t.percent+"%</div>":"<div class='webix_upload_"+t.status+"'><span class='"+("error"==t.status?"error_icon":"webix_icon wxi-check")+"'></span></div>"},removeIcon:function(){return"<div class='webix_remove_upload'><span class='cancel_icon'></span></div>"},fileName:function(t){return"<div style='text-overflow:ellipsis; white-space:nowrap; overflow:hidden; padding-right:8px;'>"+t.name+"</div>"},on_click:{webix_remove_upload:function(t,i){oi(this.config.uploader).files.remove(i)}}});var er={name:"uploader",defaults:{autosend:!0,multiple:!0,inputName:"upload"},$cssName:"button webix_uploader",$allowsClear:!0,on_click:{webix_hidden_upload:function(){return!1}},send:function(){},fileDialog:function(){},stopUpload:function(){},$skin:function(){gh.api.$skin.call(this),"material"!=Oi&&"mini"!=Oi||(this.defaults.css="webix_primary")},$init:function(){this.files=new kh,this.Bt=[this.files],H.extend(this,_s,!0)},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.render()},apiOnly_setter:function(t){return k(this.render,this),this.$apiOnly=t},Vf:function(t){for(var i=0;i<t.length;i++)this.addFile(t[i])},link_setter:function(t){return t&&k(function(){var t=oi(this.P.link);if(!t){var i=this.getTopParentView();i.$$&&(t=i.$$(this.P.link))}t.sync&&t.filter?t.sync(this.files):t.setValues&&this.files.data.attachEvent("onStoreUpdated",function(){t.setValues(this)}),t.P.uploader=this.P.id},this),t},addFile:function(t,i,e,s){
var n=null;"object"==M(t)&&(t=(n=t).name,i=n.size);var h=this.Pg(i);e=e||t.split(".").pop();var r={file:n,name:t,id:V(),size:i,sizetext:h,type:e,context:this.Rf,status:"client"};if(n&&n.webkitRelativePath&&(r.name=n.webkitRelativePath),s&&H.extend(r,s,!0),this.callEvent("onBeforeFileAdd",[r])){this.P.multiple||this.files.clearAll();var o=this.files.add(r);this.callEvent("onAfterFileAdd",[r]),o&&this.P.autosend&&this.send(o)}return r},Pf:function(t){var i=this.P.upload,e=H.extend(t.urlData||{},this.P.urlData||{});if(i&&e){var s=[];for(var n in e)s.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));s.length&&(i+=(-1==i.indexOf("?")?"?":"&")+s.join("&"))}return i},addDropZone:function(t,i){var e=C(t),s="";i&&(s=" "+at({content:'"'+i+'"'},":before"));var n="webix_drop_file"+s,h=null;Kt(e,"dragover",gt),Kt(e,"dragover",function(){yt(e,n,!0),h&&(clearTimeout(h),h=null)}),Kt(e,"dragleave",function(){h=setTimeout(function(){Mt(e,n)},150)}),Kt(e,"drop",S(function(t){return Mt(e,n),this.$drop(t),gt(t)},this))},Pg:function(t){for(var i=0;1024<t;)i++,t/=1024;return Math.round(100*t)/100+" "+I.fileSize[i]},Lf:function(t,i){var e=this.files.getItem(t);H.extend(e,i,!0),e.status="server",e.progress=100,this.callEvent("onFileUpload",[e,i]),this.callEvent("onChange",[]),this.files.updateItem(t),this.isUploaded()&&this.Nf(i)},Nf:function(t){this.callEvent("onUploadComplete",[t]),this.Ef&&(this.Ef.call(this,t),this.Ef=0)},isUploaded:function(){for(var t=this.files.data.order,i=0;i<t.length;i++)if("server"!=this.files.getItem(t[i]).status)return!1;return!0},$onUploadComplete:function(){},$updateProgress:function(t,i){this.files.getItem(t).percent=Math.round(i),this.files.updateItem(t)},setValue:function(t){"string"==typeof t&&t&&(t={value:t,status:"server"}),this.files.clearAll(),t&&this.files.parse(t),this.callEvent("onChange",[])},getValue:function(){var i=[];return this.files.data.each(function(t){"server"==t.status&&i.push(t.value||t.name)}),i.join(",")}},sr=(H.protoUI(er,gh.view),{name:"texthighlight",defaults:{template:function(t,i){var e=t.name||t.id,s="x"+V(),n=i.hm(t),h='<div class="webix_text_highlight" style="width:'.concat(n,'px;"><div class="webix_text_highlight_value"');return"textarea"==t.type&&q.mobile&&q.isSafari&&(h+=' style="margin-left:'.concat(Li.dataPadding+3,"px; margin-right:").concat(Li.dataPadding+3,'px;"')),h+="></div></div>","textarea"==t.type?(h+="".concat(i.om("textarea"),' style="width:').concat(n,'px;" id="').concat(s,'" name="').concat(e,'" class="webix_inp_textarea">').concat(i.Ob(t.value),"</textarea>"),i.$renderInput(t,h,s)):h+i.$renderInput(t)},highlight:function(t){return Yt.escape(t)},type:"text"},$init:function(t){var i=this,e=t.type||this.defaults.type;this.Vt.className+=" webix_el_"+e,"textarea"==e?(t.height=t.height||0,t.minHeight=t.minHeight||60,this.zi=!0):(this.scrollEv=Zt(document,"selectionchange",function(){i.$view.contains(document.getSelection().focusNode)&&i.jg()}),this.attachEvent("onDestruct",function(){Qt(i.scrollEv)})),this.attachEvent("onChange",function(){return i.jg()}),this.attachEvent("onAfterRender",function(){i.Ng();["scroll","focus","blur","paste","cut","keyup","input"].forEach(function(t){return Kt(i.getInputNode(),t,function(){return i.jg()})}),i.Lg(!0)})},$setSize:function(){Sh.api.$setSize.apply(this,arguments),this.Ng()},um:function(t){return"textarea"==this.P.type?t?this.N_-this.P.inputPadding:"":Sh.api.um.apply(this,arguments)},getInputNode:function(){return this.tt.querySelector("text"==this.P.type?"input":"textarea")},Og:function(){return this.tt.querySelector(".webix_text_highlight")},Lg:function(t){var i=this.Og().firstElementChild,e=this.getValue();(t||e!=(this.Wg||""))&&(this.Wg=e,i.innerHTML=this.P.highlight.apply(this,[e])+"&nbsp;")},Ug:function(){var t=this.Og();"text"==this.P.type&&(t=t.firstElementChild);var i=this.getInputNode();t.scrollTop=i.scrollTop,t.scrollLeft=i.scrollLeft},Ng:function(){if(this.Fb&&this.isVisible()){var t=this.getInputNode(),i=this.Og().style;i.left=t.offsetLeft+"px",i.top=t.offsetTop+"px",i.height=t.getBoundingClientRect(
).height+"px"}},jg:function(){k(function(){this.$destructed||(this.Lg(),this.Ug())},this)}}),nr=(H.protoUI(sr,Sh.view),{name:"timeboard",defaults:{width:270,padding:Li.layoutPadding.space,margin:Li.layoutMargin.form,hours:!0,seconds:!1,twelve:/%([a,A])/.test(I.timeFormat)},$init:function(t){var i=this;this.$view.className+=" webix_timeboard";var e=[],s=R(t.twelve)?this.defaults.twelve:t.twelve,n=R(t.hours)?this.defaults.hours:t.hours,h=t.seconds||this.defaults.seconds;if(R(t.height)){var r=1+1*n+1+1*h+1*!!t.button;t.height=Li.inputHeight*r+(t.margin||this.defaults.margin)*(r-1)+2*(t.padding||this.defaults.padding)}e.push(this.Yg(n,h,s)),e.push.apply(e,o(this.qg(n,h,s))),t.button&&e.push(this.Gg()),t.rows=[{view:"form",elements:e,padding:0,borderless:!0,on:{onChange:function(){return i.Xg()}}}],this.$ready.push(function(){this.Jg=this.queryView("form");var t=this.P.value;t&&this.setValue(t)})},setValue:function(t){var i=this.P.value;t=this.$prepareValue(t),sn.equal(t,i)||(this.P.value=t,this.callEvent("onChange",[t,i])),t&&this.$setValue(t)},$prepareValue:function(t){return"string"==typeof t&&(t=I.parseTimeFormatDate(t)),t},$setValue:function(t){var i={};i.minutes=i.sminutes=t.getMinutes(),this.P.hours&&(i.shours=i.hours=t.getHours()),this.P.seconds&&(i.sseconds=i.seconds=t.getSeconds()),this.P.twelve&&(R(i.hours)||(i.day_part=11<i.hours?I.pm[1]:I.am[1],i.hours=i.hours&&12!=i.hours?i.hours%12:12,i.shours=12==i.hours?0:i.hours)),this.Jg.setValues(i)},Xg:function(){var t=this.$getValue(),i=this.P.value?sn.copy(this.P.value):new Date;i.setHours(t.hours||0),i.setMinutes(t.minutes),this.P.seconds&&i.setSeconds(t.seconds),this.setValue(i)},$getValue:function(){var t=this.Jg.getValues();return this.P.twelve&&this.P.hours&&(t.day_part==I.pm[1]&&t.hours<12?t.hours=(1*t.hours+12).toString():t.day_part==I.am[1]&&12==t.hours&&(t.hours=0)),t},getValue:function(){if(this.P.stringResult){var t=this.$getValue(),i=[];return t.hours&&i.push(t.hours),t.minutes&&i.push(t.minutes),t.seconds&&i.push(t.seconds),i.join(":")}return this.P.value},Yg:function(t,i,e){var s=[{},this.Kg("minutes"),{}],n={css:"colon_template",template:'<span class="colon">:</span>',borderless:!0,width:18};if(t&&s.splice(1,0,this.Kg("hours",e),_(n)),i&&s.splice(-1,0,_(n),this.Kg("seconds")),e&&t){var h=I.am[1],r=I.pm[1],o={view:"label",name:"day_part",css:"day_part",template:"<div tabindex='0' role='button' class='webix_el_box' style='width:#awidth#px;height:#aheight#px;line-height:#cheight#px'>#label#</div>",inputWidth:25,on:{onItemClick:function(){this.setValue(this.getValue()==h?r:h)},onKeyPress:function(t,i){this.ke(t,i)}}};s.splice(-1,1,o)}return{type:"clean",cols:s}},Kg:function(i,e){var s=this,n="hours"===i?e?11:23:59;return{view:"text",width:46,name:i,format:{parse:function(t){return 12==t&&"hours"===i&&(t="00"),1<t.length?t.replace(/^0/,""):t||0},edit:function(t){return t<=0&&"hours"===i&&e?t=12:t<0?t=0:n<t&&(t=n),1===(t+"").length?"0"+t:t+""||"00"}},on:{onChange:function(t){s.Jg.elements["s"+i].setValue(1*(!e||"hours"!==i||t&&12!=t?t:0))}}}},qg:function(t,i,e){var s=[this.Zg("minutes",I.calendar.minutes,59)];return t&&s.unshift(this.Zg("hours",I.calendar.hours,e?11:23)),i&&s.push(this.Zg("seconds",I.timeboard.seconds,59,e)),s},Zg:function(e,t,i,s){var n=this,h="hours"===e&&s;return{view:"slider",name:"s"+e,title:t,moveTitle:!1,min:0,max:i,on:{onChange:function(t){n.Jg.elements[e].setValue((h?t&&12!=t?t%12:12:t)+"")},onSliderDrag:function(){var t=this.getValue(),i=this.getFormView();i.blockEvent(),i.elements[e].setValue((h?t&&12!=t?t%12:12:t)+""),i.unblockEvent()}}}},Gg:function(){var t=this;return{view:"button",value:I.calendar.done,css:"webix_primary",click:function(){t.callEvent("onTimeSelect",[t.P.value])}}}}),hr=(H.protoUI(nr,kn.view),{name:"suggest",defaults:{autofocus:!1,type:"list",keyPressTimeout:1,body:{yCount:10,autoheight:!0,body:!0,select:!0,borderless:!0,navigation:!0},filter:function(t,i){return 0===t.value.toString().toLowerCase().indexOf(i.toLowerCase())}},template_setter:Yt,filter_setter:function(t){return v(t,this.$scope)},Qg:!0,
$init:function(t){var i={};H.extend(i,_(this.defaults.body)),i.view=t.type||this.defaults.type;var e=this.tw(i);t.body&&H.extend(e,t.body,!0),t.data&&(e.data=t.data),t.url&&(e.url=t.url),t.datatype&&(e.datatype=t.datatype),t.id&&(i.id=i.id||t.id+"_"+i.view),t.body=i,this.$ready.push(this.iw),this.attachEvent("onShow",function(){if(this.P.master){var t=oi(this.P.master);if(t)(t.Um?t.Um():t.getInputNode()).setAttribute("aria-expanded","true")}this.ba()}),this.attachEvent("onHide",function(){if(this.P.master){var t=oi(this.P.master);if(t)(t.Um?t.Um():t.getInputNode()).setAttribute("aria-expanded","false")}}),this.ew={}},tw:function(t){return t},sw:function(){return null},nw:function(t){this.pa.value=t},hw:function(t){var i,e=t.id?this.getItemText(t.id):t.text||t.value;if(this.P.master){var s=oi(this.P.master);if(i=s.getInputNode()){var n=s.P.text;s.options_setter?s.$setValue(t.$empty?"":t.id):s.$setValueHere?s.$setValueHere(e,t,this.sw()):s.$setValue(e),s.P.text=n}}else this.pa&&this.nw(e);(i=i||this.pa)&&i.focus()},setMasterValue:function(t,i){var e=t.id?this.getItemText(t.id):t.text||t.value;if(this.P.master){var s=oi(this.P.master);i&&t.id?s.refresh():s.options_setter?s.setValue(t.$empty?"":t.id):s.setValueHere?s.setValueHere(e,t,this.sw()):s.setValue(e)}else this.pa&&this.nw(e);i||(this.hide(),this.pa&&this.pa.focus()),this.callEvent("onValueSuggest",[t,e])},getMasterValue:function(){return this.P.master?oi(this.P.master).getValue():null},getItemId:function(t){var i=this.getList();for(var e in i.data.pull){var s=i.getItem(e);if(this.P.filter.call(this,s,t))return s.id}},getItemText:function(t){var i=this.getList().getItem(t);if(!i)return this.ew[t]||"";if(this.P.template)return this.P.template.call(this,i,this.type);if(this.P.textValue)return""+i[this.P.textValue];var e=this.getList().type,s=e.template.call(e,i,e);return this.ew[t]=s},getSuggestion:function(t){var i,e=this.getList(),s=e.data.order;return e.getSelectedId&&(i=e.getSelectedId()),t&&s.length&&(!i||s.find(i)<0)&&(i=s[0],!e.config.dataFeed&&!this.config.filter.call(this,e.data.pull[i],t))?null:i&&("object"==M(i)&&(i+=""),e.getItem(i).$empty)?null:i},getList:function(){return this.$t},iw:function(){var i=this.getList(),t=this.P.type;i.count?(i.attachEvent("onItemClick",S(function(t){this.setMasterValue(i.getItem(t))},this)),i.data.attachEvent("onstoreupdated",S(function(t,i,e){"delete"==e&&t==this.getMasterValue()?this.setMasterValue({id:"",text:""},1):"update"==e&&t==this.getMasterValue()&&this.setMasterValue(i,1)},this)),i.data.attachEvent("onAfterFilter",S(this.Om,this)),R(this.P.fitMaster)&&(this.P.fitMaster=!0)):"calendar"==t?(i.attachEvent("onDateSelect",function(){this.getParentView().setMasterValue({value:i.getSelectedDate()},i.config.multiselect)}),i.attachEvent("onTodaySet",function(t){this.getParentView().setMasterValue({value:t})}),i.attachEvent("onDateClear",function(t){this.getParentView().setMasterValue({value:t})})):"colorboard"==t?i.attachEvent("onItemClick",function(t){this.getParentView().setMasterValue({value:t})}):"timeboard"==t?i.attachEvent("onTimeSelect",function(t){this.getParentView().setMasterValue({value:t})}):"colorselect"==t&&i.attachEvent("onColorSelect",function(t){this.getParentView().setMasterValue({value:t})})},input_setter:function(t){return this.linkInput(t),0},linkInput:function(i){var e;i.getInputNode?(e=i.getInputNode()).webix_master_id=i.P.id:e=C(i),Kt(e,"keydown",function(t){e==document.body&&!this.isVisible()||(i.config?i.config.readonly:e.getAttribute("readonly"))||this.rw(t)},{bind:this}),i.Um&&(e=i.Um()),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","false"),"DIV"===e.tagName&&(e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true")),this.ow=!0},rw:function(t){this.aw&&(this.aw=clearTimeout(this.aw)),t=t||event;var e=this.getList(),s=t.target;if((s!=document.body||this.isVisible())&&"webix_clipbuffer"!=s.className){this.pa=s,this.P.master=s.webix_master_id;var i=t.keyCode;if(16!=i&&17!=i){if(9==i)return this.uw(t,e);if(27==i)return this.cw(t,e);if(13==i
)return this.$enterKey(t,e);if(this.lw(t)&&this.isVisible())return gt(t),!1;var n="true"==s.getAttribute("contentEditable");R(s.value)&&!n||(this.aw=k(function(){if(this.ow||Mi.getFocus()==oi(this.P.master)){this.Wm=!0;var i=n?s.innerText:s.value;this.dw&&this.dw(),e.config.dataFeed?e.filter("value",i):e.filter&&e.filter(S(function(t){return this.P.filter.call(this,t,i)},this))}},this,[],this.P.keyPressTimeout))}}},Om:function(){if(!this.Wm)return!0;this.Wm=!1,0<this.getList().count()?(this.adjust(),this.isVisible()||(this.Lm=!0),this.show(this.pa,null,!0),this.Lm=!1):(this.hide(),this.pa=null)},show:function(t){var i=!t||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName?null:t;if(!this.isVisible()||i&&i!=this.pa){var e=this.getList();e.filter&&!this.Lm&&e.filter(""),this.$customWidth?this.$customWidth(t):t&&t.tagName&&this.P.fitMaster&&(this.P.width=t.offsetWidth-2),e.gd&&e.render(),this.adjust(),i&&(this.pa=i)}th.api.show.apply(this,arguments)},ba:function(t){t=t||this.getList();var i=this.getMasterValue();t.select&&t.showItem?i&&t.exists&&t.exists(i)?(t.select(i),t.showItem(i)):(t.unselect(),t.showItem(t.getFirstId())):t.setValue&&(this.P.master&&(i=oi(this.P.master).$prepareValue(i)),t.setValue(i))},$enterKey:function(t,i){var e,s,n=this.isVisible();this.P.master&&(s=oi(this.P.master)),s&&s.cm&&s.P.editable?s.gi():n&&(i.count?(e=i.getSelectedId(!1,!0),1==i.count()&&i.getFirstId()!=e&&(e=i.getFirstId()),e&&(e=i.getItem(e))):(i.getSelectedDate?e=i.getSelectedDate():i.getValue&&(e=i.getValue()),e&&(e={value:e})),e&&this.setMasterValue(e)),n?this.hide():this.Qg&&this.show(this.pa)},cw:function(){return this.hide()},uw:function(){return this.hide()},lw:function(t){var i,e=this.getList(),s=t.keyCode;if(!(e.moveSelection&&s<41&&32<s)||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return!1;if(40===s||38===s){this.Qg&&!this.isVisible()&&this.show(this.pa);var n=38===s?"up":"down";e.moveSelection(n,!1,!1)}else{if(e.count||!e.count&&!e.isVisible())return!1;var h;33==s&&(h="pgup"),34==s&&(h="pgdown"),35==s&&(h="bottom"),36==s&&(h="top"),37==s&&(h="left"),39==s&&(h="right"),e.moveSelection(h,!1,!1)}return e.count?i=e.getSelectedItem(!1):(e.getSelectedDate?i=e.getSelectedDate():e.getValue&&(i=e.getValue()),i&&(i={value:i})),i&&this.isVisible()&&this.hw(i),!0},getValue:function(){var t=this.getList(),i=(t.getValue?t.getValue():t.getSelectedId())||"";if(i=i.id||i,t.getItem){var e=t.getItem(i);if(e&&e.$empty)return""}return i},setValue:function(t){var i=this.getList();t?i.exists(t)&&(i.select(t),i.showItem(t)):(i.unselect(),i.showItem(i.getFirstId()))}}),rr={api:hr,view:H.protoUI(hr,th.view)},or={name:"multisuggest",defaults:{separator:",",type:"layout",button:!0,width:0,filter:function(t,i){return-1<this.getItemText(t.id).toString().toLowerCase().indexOf(i.toLowerCase())},body:{rows:[{view:"list",type:"multilist",borderless:!0,autoheight:!0,yCount:5,multiselect:"touch",select:!0,on:{onItemClick:function(t){var i=this.getParentView().getParentView();k(function(){i.vw(t)})}}},{view:"button",click:function(){this.getParentView().getParentView().hide(),k(function(){y("onEditEnd",[])})}}]}},vw:function(t,i,e){var s=this.getValue(),n=e||m(s?this.getValue().split(this.P.separator):[]),h=oi(this.P.master);e||(n.find(t)<0?n.push(t):n.remove(t));var r=n.join(this.P.separator),o=this.setValue(n).join(this.P.separator);if(h?h.setValue(r):this.pa&&(this.pa.value=o),this.callEvent("onValueSuggest",[{id:r,text:o}]),i){var a=this.getList().getItemNode(t).getElementsByTagName("SPAN");a&&a.length&&a[0].focus()}},tw:function(t){return t.rows[0]},iw:function(){var t=this.getButton(),i=this.P.button?this.P.buttonText||I.combo.select:0;if(t&&(i?(t.P.value=i,t.refresh()):t.hide()),this.P.selectAll)return this.getBody().getChildViews()[0].show();this.getList().data.attachEvent("onAfterFilter",S(function(){return this.Om()},this))},ba:function(){var t=this.getList(),i=this.getMasterValue();if(i&&(i=i.toString().split(this.config.separator))[0])for(var e=0;e<i.length;e++)t.exists(i[e])&&t.select(i[e],!0)},getButton:function(){return this.getBody().getChildViews()[1]},
getList:function(){return this.getBody().getChildViews()[0]},setValue:function(t){var i=[],e=this.getList();if(e.unselect(),t&&($(t)||(t=t.toString().split(this.config.separator)),t[0]))for(var s=0;s<t.length;s++)e.getItem(t[s])&&(e.exists(t[s])&&e.select(t[s],!0),i.push(this.getItemText(t[s])));return this.P.value=t?t.join(this.config.separator):"",i},getValue:function(){return this.P.value}},ar={api:or,view:H.protoUI(or,rr.view)},ur={name:"checksuggest",defaults:{button:!1,selectAll:!1,body:{rows:[{view:"checkbox",hidden:!0,customCheckbox:!1,borderless:!1,css:"webix_checksuggest_select_all",labelRight:I.combo.selectAll,labelWidth:0,height:28,inputHeight:20,on:{onItemClick:function(t){for(var i=this.getParentView().getParentView(),e=i.getList(),s=e.data.order,n=0;n<s.length;n++){e.getItem(s[n]).$checked=this.getValue()}var h=this.getValue()?[].concat(s):[];i.vw(s[0],t,h),e.refresh()},onChange:function(){var t=this.$view.querySelector("label"),i=I.combo;t.textContent=this.getValue()?i.unselectAll:i.selectAll},onAfterRender:function(){var t=this.getParentView().getParentView();this.setValue(1*t._w())}}},{view:"list",css:"webix_multilist",borderless:!0,autoheight:!0,yCount:5,type:"checklist",on:{onItemClick:function(t,i){var e=this.getItem(t);e.$checked=e.$checked?0:1,this.refresh(t);var s=this.getParentView().getParentView();s.Em=new Date,s.vw(t,i),s.config.selectAll&&(e.$checked?s._w()&&s.getBody().ri[0].setValue(1):s.getBody().ri[0].setValue(0))}}},{view:"button",click:function(){this.getParentView().getParentView().hide(),k(function(){y("onEditEnd",[])})}}]}},_w:function(){return(this.getValue()||"").split(this.config.separator).length===this.getList().count()},tw:function(t){return t.rows[1]},getButton:function(){return this.getBody().getChildViews()[2]},getList:function(){return this.getBody().getChildViews()[1]},$init:function(){this.Qm={},this.ua=!0,this.$ready.push(this.pw)},pw:function(){var t=this.getList();if(t.config.dataFeed){var i=this;t.attachEvent("onAfterLoad",function(){i.setValue(i.P.value)}),t.getItem=function(t){return this.data.pull[t]||i.Qm[t]}}this.config.master&&!this.config.selectAll&&this.getBody().getChildViews()[0].hide()},$enterKey:function(t,i){if(i.count&&i.count())if(this.isVisible()){var e=i.getSelectedId(!1,!0);e&&this.vw(e),this.hide()}else this.show(this.pa);else this.isVisible()&&this.hide()},ba:function(){var t=this.getList();t.select&&t.unselect()},setValue:function(t){var i,e=this.getList(),s=[],n={},h=[];for($(t=t||[])?e.config.dataFeed&&(t=this.Gm(t)):t=t.toString().split(this.config.separator),i=0;i<t.length;i++)n[t[i]]=1,e.getItem(t[i])&&(this.Qm&&(this.Qm[t[i]]=_(e.getItem(t[i]))),s.push(this.getItemText(t[i])));for(e.data.each(function(t){t.$checked?n[t.id]||(t.$checked=0,h.push(t.id)):n[t.id]&&(t.$checked=1,h.push(t.id))},this,!0),i=0;i<h.length;i++)e.refresh(h[i]);return this.P.value=t.length?t.join(this.config.separator):"",s},getValue:function(){return this.P.value},hw:function(){var t;this.P.master&&(t=oi(this.P.master).getInputNode()),(t=t||this.pa)&&t.focus()},Gm:function(t){if(t&&$(t)){for(var i=[],e=0;e<t.length;e++)t[e].id?(this.Qm[t[e].id]=_(t[e]),i.push(t[e].id)):i.push(t[e]);t=i}return t}},cr=(H.protoUI(ur,ar.view),H.protoUI({name:"datasuggest",defaults:{type:"dataview",fitMaster:!1,width:0,body:{xCount:3,autoheight:!0,select:!0}}},rr.view),{name:"gridsuggest",defaults:{type:"datatable",fitMaster:!1,width:0,body:{navigation:!0,autoheight:!0,autowidth:!0,select:!0},filter:function(t,i){return 0===this.config.template(t).toString().toLowerCase().indexOf(i.toLowerCase())}},$init:function(t){t.body.columns||(t.body.autoConfig=!0),t.template||(t.template=S(this.Kg,this))},Kg:function(t){var i=this.getBody(),e=this.config.textValue||i.config.columns[0].id;return i.getText(t.id,e)}}),fr=(H.protoUI(cr,rr.view),{name:"mentionsuggest",defaults:{symbol:"@",filter:function(t,i){var e=this.P.symbol;return-1!==(i=i.substring(0,this.bw)).indexOf(e)&&(!!(i=i.substring(i.lastIndexOf(e)+e.length)).length&&-1!==(t.id?this.getItemText(t.id):t.text||t.value).toString().toLowerCase(
).indexOf(i.toLowerCase()))}},$init:function(){this.attachEvent("onValueSuggest",this.dw)},$enterKey:function(t){var i;this.isVisible()&&(gt(t),this.P.master&&(i=oi(this.P.master)),i&&i.callEvent&&i.callEvent("onEnter"));return rr.api.$enterKey.apply(this,arguments)},dw:function(){this.pa&&(this.bw=Dt(this.pa).start)},sw:function(){return{pos:this.bw,symbol:this.P.symbol}},hw:function(){},nw:function(t){var i=this.P.symbol,e=this.pa.value,s=e.substring(this.bw);e=(e=e.substring(0,this.bw)).substring(0,e.lastIndexOf(i)+i.length)+t,this.pa.value=e+s,$t(this.pa,e.length)},Qg:!1}),lr=(H.protoUI(fr,rr.view),{name:"daterangesuggest",defaults:{type:"daterange",body:{view:"daterange",icons:!0,button:!0,borderless:!0}},getValue:function(){return this.getRange().getValue()},setValue:function(t){this.getRange().setValue(_(t))},getRange:function(){return this.getBody()},getButton:function(){return this.getBody().getChildViews()[1].getChildViews()[1]},mw:function(t,i){var e=oi(this.P.master);e?(e.setValue(t),i&&this.hide()):this.setValue(t)},iw:function(){var t=this.getRange();t.attachEvent("onAfterDateSelect",S(function(t){this.mw(t)},this)),t.attachEvent("onDateClear",S(function(t){this.mw(t)},this)),t.attachEvent("onTodaySet",S(function(t){this.mw(t)},this))}}),dr=(H.protoUI(lr,rr.view),{$cssName:"datepicker",name:"daterangepicker",$init:function(t){delete t.type,delete t.multiselect,delete this.P.multiselect},defaults:{value:{},separator:" - "},fm:function(){var t=this.P;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({view:"daterangesuggest",body:{timepicker:t.timepicker,calendarCount:t.calendarCount,height:250+(t.button||t.icons?30:0)}})),this.ah=function(){}},$prepareValue:function(){return $n.api.$prepareValue.apply(this,arguments)},Id:function(t){return"string"==typeof t&&(t=I.parseFormatDate(t)),isNaN(1*t)?null:t},$compareValue:function(t,i){var e=Fh.api.$compareValue,s=e.call(this,t.start,i.start),n=e.call(this,t.end,i.end);return s&&n},$setValue:function(t){t=t||{},this.P.text=(t.start?this.vm(t.start):"")+(t.end?this.P.separator+this.vm(t.end):""),this.mm()},getValue:function(){var t=this.P.value;if(this.Fb){if(this.P.editable){var i=this.dm||I.dateFormatDate,e=(this.getInputNode().value||"").split(this.P.separator);t=this.gw(i,{start:e[0],end:e[1]})}}else t=this.$prepareValue(t)||null;if(this.P.stringResult){var s=I.parseFormatStr;return this.gw(s,t)}return t||null},gw:function(t,i){return i.start&&(i.start=t(i.start)),i.end&&(i.end=t(i.end)),i}}),vr=(H.protoUI(dr,Fh.view),H.protoUI({name:"excelbar",defaults:{padding:0,type:"line"},$init:function(t){t.cols=[{view:"tabbar",options:[""],optionWidth:200,borderless:!0,on:{onaftertabclick:function(){this.getParentView().callEvent("onExcelSheetSelect",[this.getValue()])}}}]},getValue:function(){return this.getInput().getValue()},setValue:function(t){return this.getInput().setValue(t)},getInput:function(){return this.getChildViews()[0]},setSheets:function(t){var i=this.getInput();i.config.options=t,i.refresh()}},eh.view),{name:"vscroll",$apiOnly:!0,defaults:{scroll:"x",scrollPos:0,scrollSize:18,scrollVisible:1,zoom:1},$init:function(t){var i=t.scroll||"x",e=this.Vt=C(t.container);e.className+=" webix_vscroll_"+i,e.innerHTML="<div class='webix_vscroll_body'></div>",Kt(e,"scroll",this.ww,{bind:this}),this.Lh=0},$skin:function(){this.defaults.scrollStep=Li.rowHeight},reset:function(){this.config.scrollPos=0,this.Vt["x"==this.config.scroll?"scrollLeft":"scrollTop"]=0},xw:function(t){return 15e5<t?(this.P.zoom=t/1e6,t=1e6):this.P.zoom=1,t},scrollWidth_setter:function(t){return t=this.xw(t),this.Vt.firstChild.style.width=t+"px",t},scrollHeight_setter:function(t){return t=this.xw(t),this.Vt.firstChild.style.height=t+"px",t},sizeTo:function(t,i,e){t=t-(i||0)-(e||0);var s=this.P.scrollSize;q.isIE&&s&&(s+=1),s||!this.P.scrollVisible||q.$customScroll||(this.Vt.style.pointerEvents="none",s=14),s?(this.Vt.style.display="block",i&&(this.Vt.style.marginTop=i+"px"),this.Vt.style["x"==this.P.scroll?"width":"height"]=Math.max(0,t)+"px",
this.Vt.style["x"==this.P.scroll?"height":"width"]=s+"px"):this.Vt.style.display="none",this.Lh=t},getScroll:function(){return Math.round(this.P.scrollPos*this.P.zoom)},getSize:function(){return Math.round((this.P.scrollWidth||this.P.scrollHeight)*this.P.zoom)},yw:function(){var t=this.getScroll(),i=Math.max(this.getSize()-this.Lh,0);i<t&&this.scrollTo(i)},scrollTo:function(t){t<0&&(t=0);var i=this.P;if((t/=i.zoom)<0&&(t=0),t!=this.P.scrollPos)return this.Vt["x"==i.scroll?"scrollLeft":"scrollTop"]=t,this.Mw(t,!0),!0},ww:function(){var t=this.Vt["x"==this.P.scroll?"scrollLeft":"scrollTop"];Math.floor(t)!=Math.floor(this.P.scrollPos)&&this.Mw(t,!1)},Mw:function(t,i){var e=this.P.scrollWidth||this.P.scrollHeight;t>=e-this.Lh/(i?this.P.zoom:1)&&(t=Math.max(0,e-this.Lh/this.P.zoom)),this.P.scrollPos=t||0,this.callEvent("onScroll",[this.getScroll()])},activeArea:function(t,i){this.Sw=i,Kt(t,"wheel",this.kw,{bind:this,passive:!1}),this.Cw(t)},Cw:function(t){!q.touch&&window.navigator.pointerEnabled&&(yt(t,"webix_scroll_touch_ie",!0),Kt(t,"pointerdown",function(t){"touch"!=t.pointerType&&"pen"!=t.pointerType||(this.Ge=Yi.js(t),this.$w=this.getScroll())},{bind:this}),Zt(document.body,"pointermove",function(t){var i;this.Ge&&(this.Xe=Yi.js(t),"x"==this.P.scroll?i=this.Xe.x-this.Ge.x:"y"==this.P.scroll&&(i=this.Xe.y-this.Ge.y),i&&5<Math.abs(i)&&this.scrollTo(this.$w-i))},{bind:this}),Zt(window,"pointerup",function(){this.Ge&&(this.Ge=this.Xe=null)},{bind:this}))},kw:function(t){var i=0,e=0===t.deltaMode?30:1;return!t.ctrlKey&&(t.deltaX&&Math.abs(t.deltaX)>Math.abs(t.deltaY)?this.Sw&&this.P.scrollVisible&&(i=t.deltaX/e):!this.Sw&&this.P.scrollVisible&&(i=R(t.deltaY)?t.detail:t.deltaY/e),q.isSafari&&(this.Dw=t.target),i&&this.scrollTo(this.getScroll()+i*this.P.scrollStep)?gt(t):void 0)}}),_r=(H.protoUI(vr,g,Si),{Iw:function(){this.Aw=!0,this.Fw={},this.define("select","area"),this.attachEvent("onAfterScroll",function(){this.refreshSelectArea()}),this.attachEvent("onAfterRender",function(){this.refreshSelectArea(),this.Tw()}),this.attachEvent("onColumnResize",function(){this.refreshSelectArea()}),this.attachEvent("onBeforeColumnHide",function(t){this.Vw=this.getColumnIndex(t)}),this.attachEvent("onAfterColumnHide",function(){this.zw(this.Vw)}),this.attachEvent("onSyncScroll",this.Bw),this.Hw=function(t,i,e,s){if(t.row&&i.row){if(e)return this.addSelectArea(t,i,!0),!(this.Aw=!0);if(!this.callEvent("onAreaDrag",[t,i,s]))return!1;this.Rw||!this.Aw||this.P.multiselect&&s&&s.ctrlKey||(this.removeSelectArea(),this.Aw=!1)}},this.attachEvent("onBeforeAreaAdd",this.Ew),Kt(this.st,q.mouse.down,this.Pw,{bind:this})},Bw:function(t,i,e){Yi.ms(this.jw,t,i,e),Yi.ms(this.Nw,t,i,e),Yi.ms(this.Lw,t,i,e)},Ow:!0,zw:function(t){var i=this.Fw;for(var e in i){var s=i[e];if(this.getColumnIndex(s.start.column)<0)if(s.start.column==s.end.column)this.removeSelectArea(s.name);else{var n=this.columnId(t);n&&this.Ww(s.name,{row:s.start.row,column:n},null)}else if(this.getColumnIndex(s.end.column)<0){var h=this.columnId(t-1);h&&this.Ww(s.name,null,{row:s.end.row,column:h})}}},Uw:function(t,i,e,s){var n,h,r,o,a,u,c,f;if(i){n=this.getColumnIndex(i.start.column),h=this.getColumnIndex(i.end.column),r=this.getIndexById(i.start.row),o=this.getIndexById(i.end.row),a=this.getColumnIndex(t.column),u=this.getIndexById(t.row),c=this.getIndexById(i.init.row),f=this.getColumnIndex(i.init.column),a<n||"left"==e?"left"===e&&s.ctrl?(n=this.Yw(c,n,e),h=f):"left"===e&&f<h?h--:n=a:(h<=a||"right"==e)&&("right"==e&&s.ctrl?(h=this.Yw(c,h,e),n=f):"right"==e&&n<f?n++:h=a),u<r||"up"==e?"up"==e&&s.ctrl?(r=this.Yw(r,f,e),o=c):"up"==e&&c<o?o--:r=u:(o<u||"down"==e)&&("down"==e&&s.ctrl?(o=this.Yw(o,f,e),r=c):"down"==e&&r<c?r++:o=u);var l={row:this.getIdByIndex(r),column:this.columnId(n)},d={row:this.getIdByIndex(o),column:this.columnId(h)};this.callEvent("onBeforeBlockSelect",[l,d,!0])&&(this.Ww(i.name,l,d),this.callEvent("onSelectChange",[]),this.callEvent("onAfterBlockSelect",[l,d]))}},Yw:function(t,i,e){var s=this.config.columns,n=this.data.order,h=this.data.pull[n[t]],r=s[i].id,o=0;if(
"right"==e)for(var a=i+1;a<s.length;a++){if(h[s[a].id]){o=a;break}o=a}else if("left"==e){for(var u=i-1;0<=u;u--)if(h[s[u].id]){o=u;break}}else if("down"==e)for(var c=t+1;c<n.length;c++){if(this.getItem(n[c])[r]){o=c;break}o=c}else if("up"==e)for(var f=t-1;0<=f;f--)if(this.getItem(n[f])[r]){o=f;break}return o},Ww:function(t,i,e,s){var n=this.Fw[t];if(!n)return!1;var h=_(n),r={start:i||n.start,end:e||n.end};this.Ew(r),H.extend(n,r,!0),this.refreshSelectArea(),this.Tw(h),s&&this.callEvent("onSelectChange",[])},areaselect_setter:function(t){return t&&(this.Iw(),this.Iw=function(){}),this.define("blockselect",t),t},addSelectArea:function(t,i,e,s,n,h){var r,o,a,u,c;r=this.getIndexById(t.row),o=this.getIndexById(i.row),a=this.getColumnIndex(t.column),o<r&&(c=r,r=o,o=c),(u=this.getColumnIndex(i.column))<a&&(c=a,a=u,u=c),s=s||this.Rw||V(),this.Rw=null;var f={start:{row:this.getIdByIndex(r),column:this.columnId(a)},end:{row:this.getIdByIndex(o),column:this.columnId(u)}};if(n&&(f.css=n),(h||!1===h)&&(f.handle=h),this.Fw[s])return this.Ww(s,f.start,f.end,!0);f.handle=!0,f.name=s,f.init=f.start,this.callEvent("onBeforeAreaAdd",[f])&&(this.qw=s,e||this.removeSelectArea(),this.Fw[f.name]=f,this.Gw.push(f),this.refreshSelectArea(),this.Tw(),this.callEvent("onAfterAreaAdd",[f]),this.callEvent("onSelectChange",[]))},Xw:function(){var t=ft("DIV");return t.className="webix_area_selection_layer",t.style.top=this.Jw+"px",t},refreshSelectArea:function(){var t,i,e,s,n=null,h=null,r=null,o=this.P.prerender;if(this.Kw){t=this.Zw(o),i=this.Qw(!0===o),this.jw||(this.jw=this.Xw(),this.st.childNodes[1].appendChild(this.jw),this.Nw=this.Xw(),this.st.childNodes[0].appendChild(this.Nw),this.Lw=this.Xw(),this.st.childNodes[2].appendChild(this.Lw)),this.jw.innerHTML="",this.Nw.innerHTML="",this.Lw.innerHTML="";var a=this.P.leftSplit,u=this.P.rightSplit;for(e in this.Fw){s=this.Fw[e];var c=this.tx(s,t,i);if(null!==c){var f=this.getColumnIndex(s.start.column),l=this.getColumnIndex(s.end.column);if(c.r0<=c.r1){if(this.P.topSplit&&this.P.topSplit<=void 0&&void 0<this.ix)return!1;f<a&&(h=this.nx(c.r0,f,c.r1,Math.min(l,a-1))),c.c0<=c.c1&&(n=this.nx(c.r0,c.c0,c.r1,c.c1)),u&&l>=this.hx&&(r=this.nx(c.r0,Math.max(f,this.hx),c.r1,l)),(h||n||r)&&this.ox(h,n,r,e,s.css,s.handle)}}else this.removeSelectArea(e)}}},tx:function(t,i,e){var s,n,h=this.getIndexById(t.start.row),r=this.getIndexById(t.end.row),o=this.getColumnIndex(t.start.column),a=this.getColumnIndex(t.end.column);if(-1===o||-1===a)return null;if(-1===h||-1===r)return null;if(n=Math.min(e[1],r),this.P.topSplit){if((s=h)>=this.P.topSplit&&(s=Math.max(e[0]-this.P.topSplit,h)),n>=this.P.topSplit){var u=this.at(this.getIdByIndex(r),t.end.column),c=this.at(this.getIdByIndex(this.P.topSplit-1),t.end.column);c.top+c.height>u.top+u.height&&(n=this.P.topSplit-1)}}else s=Math.max(e[0],this.getIndexById(t.start.row));return{r0:s,r1:n,c0:Math.max(i[0],o),c1:Math.min(this.hx?i[1]-1:i[1],a)}},nx:function(t,i,e,s){return[this.at(this.getIdByIndex(t),this.columnId(i)),this.at(this.getIdByIndex(e),this.columnId(s))]},ox:function(t,i,e,d,v,s){var n,h,r=this.Fw[d],_=0;this.P.topSplit&&(_=this.ax(r.start,!0));var o=function(t,i,e,s,n){var h,r,o,a,u,c,f={top:1,right:1,bottom:1,left:1};for(h in s&&delete f.left,n&&delete f.right,r=e.top-i.top+e.height-1,o=e.left-i.left+e.width,f){a=i.top+_,"bottom"==h&&(a=e.top+e.height),u=i.left,"right"==h&&(u=e.left+e.width),c="top"==h||"bottom"==h,t.appendChild(ft("DIV",{"class":"webix_area_selection webix_area_selection_"+h+(v?" "+v:""),style:"left:"+u+"px;top:"+a+"px;"+(c?"width:"+o+"px;":"height:"+(r-_)+"px;"),webix_area_name:d},""));var l=t.lastChild;"right"==h&&(l.style.left=u-l.offsetWidth+"px"),"bottom"==h&&(l.style.top=a-l.offsetHeight+"px"),_&&("top"==h&&(l.style.display="none"),e.height==_&&"bottom"==h&&(l.style.display="none"))}};e&&o(this.Lw,e[0],e[1],!!i,!1),i&&o(this.jw,i[0],i[1],!!t,!!e),t&&o(this.Nw,t[0],t[1],!1,!!i),s&&(h=e?e[1]:i?i[1]:t[1],(n=e?this.Lw:i?this.jw:this.Nw).appendChild(ft("DIV",{"class":"webix_area_selection_handle"+(v?" "+v:""),style:"left:"+(h.left+h.width
)+"px;top:"+(h.top+h.height)+"px;",webix_area_name:d},"")),_&&h.height==_&&(n.lastChild.style.display="none"))},ux:function(s){if(s){var t=function(t){for(var i=t.childNodes,e=i.length-1;0<=e;e--)i[e].getAttribute("webix_area_name")==s&&t.removeChild(i[e])};t(this.jw),t(this.Nw),t(this.Lw)}},removeSelectArea:function(t){if(t&&this.Fw[t]){if(this.callEvent("onBeforeAreaRemove",[t])){for(var i in this.Tw(_(this.Fw[t]),!0),delete this.Fw[t],this.ux(t),this.Gw=[],this.Fw)this.Gw.push(this.Fw[i]);this.callEvent("onAfterAreaRemove",[t])}}else for(var e in this.Fw)this.removeSelectArea(e)},Pw:function(t){var i=t.target,e=Ct(i);if(e&&-1!=e.indexOf("webix_area_selection_handle")){var s=i.getAttribute("webix_area_name");this.Rw=s;var n=this.Fw[s],h=this.at(n.start.row,n.start.column),r=this.at(n.end.row,n.end.column),o=this.P.prerender,a=this.getColumnIndex(n.start.column)<this.P.leftSplit?0:this.cx,u=this.getColumnIndex(n.end.column)<this.P.leftSplit?0:this.cx;this.vx=[h.left+1+a-this.bh,h.top+1-(o?this._h:0),{row:n.start.row,column:n.start.column}],this._x=pt(this.st),this.bx(t),this.gx=[r.left+1+u-this.bh,r.top+1-(o?this._h:0)],this.wx(!1,!1,t),gt(t),this.xx()}},getSelectArea:function(t){return this.Fw[t||this.qw]},getAllSelectAreas:function(){return this.Fw},Ew:function(t,i){var e,s,n,h,r,o,a,u,c,f,l,d,v,_=!1,p=t.start,b=t.end;for(f=r=this.getIndexById(p.row),l=n=this.getColumnIndex(p.column),d=o=this.getIndexById(b.row),v=h=this.getColumnIndex(b.column),e=r;e<=o;e++){if(this.getItem(this.getIdByIndex(e)).$row&&!i)_=!0,v=this.rl.length-1;else if(this.config.spans)for(s=n;s<=h;s++)(a=this.getSpan(this.getIdByIndex(e),this.columnId(s)))&&((u=this.getIndexById(a[0]))<f&&(f=u,_=!0),(c=this.getColumnIndex(a[1]))<l&&(_=!0,l=c),u+a[3]-1>d&&(_=!0,d=u+a[3]-1),c+a[2]-1>v&&(_=!0,v=c+a[2]-1))}_&&(t.start={row:this.getIdByIndex(f),column:this.columnId(l)},t.end={row:this.getIdByIndex(d),column:this.columnId(v)},this.Ew(t,!0))},Tw:function(t,i){var e;if(t&&(e=this.getItemNode({row:t.start.row,column:t.start.column}))&&e.removeAttribute("tabindex"),!i&&this.Gw.length){var s=this.getSelectedId(!0)[0];(e=this.getItemNode(s))&&e.setAttribute("tabindex","1")}}}),pr={filterByAll:function(){var r=!1;this.data.silent(function(){this.filter();var t=!1;for(var e in this.So)if(this.isColumnVisible(e)){var i=this.So[e],s=i[2].getValue(i[0]),n=s;i[1].prepare&&(n=i[1].prepare.call(i[2],n,i[1],this)),i[1].value=s;var h=i[1].compare;if(this.callEvent("onBeforeFilter",[e,n,i[1]]))if(i[2].$server||r)r=!0;else{if(""===n)continue;h?(h=this.yx(e,h),this.filter(S(function(t,i){return!!t&&h(t[e],i,t)},this),n,t)):this.filter(e,n,t),t=!0}}r&&this.Mx()},this),r||(this.refresh(),this.callEvent("onAfterFilter",[]))},yx:function(t,h){var i=this.getColumnConfig(t),r=i?i.optionslist:null;return r?("string"!=typeof r&&(r=","),function(t,i,e){if(!t)return!1;for(var s=t.toString().split(r),n=0;n<s.length;n++)if(h(s[n],i,e))return!0}):h},filterMode_setter:function(t){return H.extend(this.data.so,t,!0)},getFilter:function(t){var i=this.So[t];return i&&i[2].Wd?i[2].Wd(i[0]):i&&i[2].getInputNode?i[2].getInputNode(i[0]):null},registerFilter:function(t,i,e){this.So[i.columnId]=[t,i,e]},collectValues:function(t,i){var e=this.getColumnConfig(t),s=i&&i.visible?null:e.collection,n={values:s?this.Vl.call(s,"id","value"):this.Vl(e.id,e.id)};return this.callEvent("onCollectValues",[t,n]),n.values},Vl:function(e,s){var n={"":!0},h=[];if(this.data.each(function(t){var i=t?t[e]:"";0===i&&(i="0"),"object"==M(i)&&(i=String(i)),i===undefined||n[i]||(n[i]=!0,h.push({id:i,value:t[s]}))},this,!0),h.length){var t="string"==typeof h[0].value?"string":"raw";h.sort(this.data.sorting.create({as:t,by:"value",dir:"asc"}))}return h},Mx:function(){var i=this;this.loadNext(0,0,0,0,1).then(function(t){i.editStop&&i.editStop(),i.clearAll(!0),i.parse(t),i.callEvent("onAfterFilter",[])})}},br={hover_setter:function(t){var s=this;return t&&!this.Sx&&(this.Wu(),this.config.experimental=!0,this.attachEvent("onMouseMoving",function(t){var i=s.locate(t);!i&&q.isEdge&&t.relatedTarget&&(i=s.locate(t.relatedTarget))
;var e=i?i.row:null;s.kx!=e&&(s.kx&&s.removeRowCss(s.kx,s.P.hover),s.kx=e,s.kx&&s.addRowCss(s.kx,s.P.hover))}),Kt(this.$view,"mouseout",function(t){var i=t.target;s.kx&&document.body.contains(i)&&((t.relatedTarget?s.locate(t.relatedTarget):null)||(s.removeRowCss(s.kx,s.P.hover),s.kx=null))}),this.Sx=1),t},select_setter:function(t){return!this.select&&t&&(H.extend(this,this.$x.Cx,!0),!0===t?t="row":"multiselect"==t&&(t="row",this.P.multiselect=!0),this.$x[t],H.extend(this,this.$x[t],!0)),t},getSelectedId:function(t){return t?[]:""},getSelectedItem:function(t){return Ne.getSelectedItem.call(this,t)},$x:{Cx:{Dx:" webix_cell_select",$init:function(){this.Ix(),this.on_click.webix_cell=S(this.Ax,this),this.Fx=this.Cc=function(){this.unselect()},this.data.attachEvent("onStoreUpdated",S(this.Sc,this)),this.data.attachEvent("onSyncApply",S(this.Tx,this)),this.data.attachEvent("onClearAll",S(this.Fx,this)),this.data.attachEvent("onAfterFilter",S(this.Cc,this)),this.data.attachEvent("onIdChange",S(this.Ic,this)),this.$ready.push(Ne.Ac)},Ic:function(t,i){for(var e=0;e<this.Vx.length;e++)this.Vx[e]==t&&(this.Vx[e]=i);for(var s=0;s<this.Gw.length;s++){var n=this.Gw[s];n.row==t&&(t=this.zx(n),n.row=i,i=this.zx(n),n.id=i,delete this.Bx[t],this.Bx[i]=!0)}},Sc:function(t,i,e){"delete"==e&&this.unselect(t)},Tx:function(){for(var t=this.Gw.length-1;0<=t;t--){var i=this.Gw[t].row;this.exists(i)||(this.Gw.splice(t,1),delete this.Bx[i])}},Ix:function(){this.Gw=[],this.Bx={},this.Vx=[]},isSelected:function(t,i){var e;return e=R(i)?"object"===M(t)?this.zx(t):t:this.zx({row:t,column:i}),this.Bx[e]},getSelectedId:function(t,i){var e;if(1<this.Gw.length||t){if(e=[].concat(this.Gw),i)for(var s=0;s<e.length;s++)e[s]=e[s].id}else if(e=this.Gw[0],i&&e)return e.id;return e},Hx:function(){return this.row},To:function(t,i){var e=this.zx(t);if(null!==e){if(-1===i)return this.Rx(t);if(t.id=e,t.toString=this.Hx,!this.callEvent("onBeforeSelect",[t,i]))return!1;if(!this.Bx[e]||!i&&1!=this.Gw.length)return i||this.Ex(),this.Gw.push(t),this.Bx[e]=!0,this.callEvent("onAfterSelect",[t,i]),this.Px(this.jx(t)),!0}},Ex:function(){if(!this.Gw.length)return!1;for(var t=0;t<this.Gw.length;t++)if(!this.callEvent("onBeforeUnSelect",[this.Gw[t]]))return!1;for(var i=0;i<this.Vx.length;i++)this.data.removeMark(this.Vx[i],"webix_selected");var e=this.P.columns;if(e)for(var s=0;s<e.length;s++)e[s].$selected=null;var n=this.Gw;this.Ix();for(var h=0;h<n.length;h++)this.callEvent("onAfterUnSelect",[n[h]]);return!0},unselectAll:function(){this.clearSelection()},selectAll:function(){this.selectRange()},clearSelection:function(){this.Ex()&&(this.callEvent("onSelectChange",[]),this.render())},Rx:function(t){var i=this.zx(t);if(!i&&this.Gw.length&&(this.clearSelection(),this.callEvent("onSelectChange",[])),this.Bx[i]){if(!this.callEvent("onBeforeUnSelect",[t]))return!1;for(var e=0;e<this.Gw.length;e++)if(this.Gw[e].id==i){this.Gw.splice(e,1);break}delete this.Bx[i],this.callEvent("onAfterUnSelect",[t]),this.Px(0,this.Nx(t))}},Lx:function(t){var i=this.getItem(t);return this.data.addMark(i.id,"webix_selected",0,{$count:0},!0)},Px:function(t){t&&this.Vx.push(t),this.Tc||(this.render(),this.callEvent("onSelectChange",[]))},Ax:function(t,i){var e=t.ctrlKey||t.metaKey||"touch"==this.P.multiselect,s=t.shiftKey;if(this.P.multiselect||"multiselect"==this.P.select||"area"==this.P.select||(e=s=!1),s&&this.Gw.length){var n=this.Gw[this.Gw.length-1];this.Ox(i,n)}else e&&this.Bx[this.zx(i)]?this.Rx(i):this.To({row:i.row,column:i.column},e)},Wx:function(t,i,e){var s=this.P.columns;if(i){for(var n=[],h=0;h<s.length;h++)s[h].$selected&&n.push(s[h]);s=n}for(var r=this.data.order,o=0,a=0;a<r.length;a++){var u=this.getItem(r[a]);if(u){var c=this.data.getMark(u.id,"webix_selected");if(c||i){for(var f=0,l=0;l<s.length;l++){var d=s[l].id;if(e||i||c[d]){if(!t)return{row:r[a],column:d};u[d]=t(u[d],r[a],d,o,f),f++}}o++}}}}},row:{Dx:" webix_row_select",zx:function(t){return t.row},select:function(t,i){t&&(t=t.toString()),this.data.exists(t),this.To({row:t},i)},jx:function(t){return this.Lx(t.row).$row=!0,t.row
},unselect:function(t){this.Rx({row:t})},Nx:function(t){return this.data.removeMark(t.row,"webix_selected",0,1),t.row},mapSelection:function(t){return this.Wx(t,!1,!0)},Ox:function(t,i){return this.selectRange(t.row,i.row)},selectRange:function(t,i,e){R(e)&&(e=!0);var s=t?this.getIndexById(t):0,n=i?this.getIndexById(i):this.data.order.length-1;if(n<s){var h=s;s=n,n=h}this.Tc=!0;for(var r=s;r<=n;r++){var o=this.getIdByIndex(r);if(!o){t&&this.select(t);break}this.select(o,e)}this.Tc=!1,this.Px()}},cell:{zx:function(t){return t.column?t.row+"_"+t.column:null},select:function(t,i,e){this.data.exists(t),this.To({row:t,column:i},e)},jx:function(t){var i=this.Lx(t.row);return i.$count++,i[t.column]=!0,t.row},unselect:function(t,i){this.Rx({row:t,column:i})},Nx:function(t){var i=this.Lx(t.row);return i.$count--,i[t.column]=!1,i.$count<=0&&this.data.removeMark(t.row,"webix_selected"),t.row},mapSelection:function(t){return this.Wx(t,!1,!1)},Ox:function(t,i){return this.selectRange(t.row,t.column,i.row,i.column)},selectRange:function(t,i,e,s,n){R(n)&&(n=!0);var h=t?this.getIndexById(t):0,r=e?this.getIndexById(e):this.data.order.length-1,o=i?this.getColumnIndex(i):0,a=s?this.getColumnIndex(s):this.rl.length-1;if(r<h){var u=h;h=r,r=u}if(a<o){var c=o;o=a,a=c}this.Tc=!0;for(var f=h;f<=r;f++)for(var l=o;l<=a;l++)this.select(this.getIdByIndex(f),this.columnId(l),n);this.Tc=!1,this.Px()}},column:{Dx:" webix_column_select",zx:function(t){return t.column},Hx:function(){return this.column},select:function(t,i){this.To({column:t},i)},jx:function(t){this.P.columns[this.getColumnIndex(t.column)].$selected=!0,this.Tc||this.Ux()},unselect:function(t){this.Rx({column:t})},Nx:function(t){this.P.columns[this.getColumnIndex(t.column)].$selected=null,this.Ux()},mapSelection:function(t){return this.Wx(t,!0,!1)},Ox:function(t,i){return this.selectRange(t.column,i.column)},selectRange:function(t,i,e){R(e)&&(e=!0);var s=t?this.getColumnIndex(t):0,n=i?this.getColumnIndex(i):this.rl.length-1;if(n<s){var h=s;s=n,n=h}this.Tc=!0;for(var r=s;r<=n;r++)this.select(this.columnId(r),e);this.Tc=!1,this.Ux(),this.Px()},Tx:function(){}},area:{zx:function(t){return t.row+"_"+t.column},getSelectedId:function(t){var i=this.getSelectArea(),e=[];if(i)if(!t||i.start.row==i.end.row&&i.start.column==i.end.column)e.push(i.end);else{var s=this.getIndexById(i.start.row),n=this.getIndexById(i.end.row);if(-1==s||-1==n)return e;for(var h=this.getColumnIndex(i.start.column),r=this.getColumnIndex(i.end.column),o=s;o<=n;o++)for(var a=h;a<=r;a++)e.push({row:this.getIdByIndex(o),column:this.columnId(a)})}return t?e:e[0]},unselect:function(){this.Rx()},Rx:function(){this.removeSelectArea(),this.callEvent("onSelectChange",[])},mapSelection:function(t){var i=this.getSelectArea();if(i)for(var e=this.getColumnIndex(i.start.column),s=this.getColumnIndex(i.end.column),n=this.getIndexById(i.start.row),h=this.getIndexById(i.end.row),r=n;r<=h;r++)for(var o=this.data.order[r],a=this.getItem(o),u=e;u<=s;u++){var c=this.rl[u].id;if(!t)return{row:o,column:c};a[c]=t(a[c],o,c,r-n,u-e)}},select:function(t,i,e){this.data.exists(t),this.To({row:t,column:i},e)},Ox:function(t,i){this.Uw(t,i)},To:function(t){return this.addSelectArea(t,t,!1),!0},Tx:function(){this.Gw.length&&this.refreshSelectArea()}}}},mr={blockselect_setter:function(t){return t&&this.Ow&&(q.touch?this.attachEvent("onLongTouch",this.Yx):Kt(this.Vt,q.mouse.down,this.Yx,{bind:this}),Kt(this.Vt,q.mouse.move,this.qx,{bind:this}),this.Ow=this.vx=this.gx=!1,this.attachEvent("onAfterScroll",this.Gx),H.extend(this,Gt,!0),this.attachEvent("onBeforeAutoScroll",function(){return this.gx})),t},Ow:!0,Xx:function(t,i){for(var e=t.target;e;){if(e.getAttribute&&e.getAttribute("webixignore"))return!1;if(e==i)return!0;e=e.parentNode}return!1},Yx:function(t){if((!this.P.subview||this==oi(t.target))&&this.Xx(t,this.st)){if(t.target&&"INPUT"==t.target.tagName||this.Dv)return;this._x=pt(this.st);var i=q.touch?t:mt(t);this.vx=[i.x-this._x.x,i.y-this._x.y],gt(t),this.xx()}},xx:function(){var i=this,e=Zt(document.body,q.mouse.up,function(t){return Qt(e),i.Jx(t)})},
Jx:function(t){this.Kx&&(this.wx("select",!0,t),this.Kx=dt(this.Kx)),Mt(document.body,"webix_noselect"),this.vx=this.gx=!1,this.rt&&(this.rt=window.clearTimeout(this.rt))},Gx:function(){this.gx&&k(this.wx,this,[!1,!1])},wx:function(t,i,e){var s;this.vx[2]||(this.vx[2]=this.Zx.apply(this,this.vx)),s=this.vx[2];var n=this.Zx.apply(this,this.gx);if(this.callEvent("onBeforeBlockSelect",[s,n,i,e])){if((!this.Hw||!1!==this.Hw(s,n,i,e))&&s.row&&n.row)if("select"===t)this.Ex(),this.Ox(s,n);else{var h,r,o,a;if("box"===t)h=Math.min(this.vx[0],this.gx[0]),o=Math.max(this.vx[0],this.gx[0]),r=Math.min(this.vx[1],this.gx[1]),a=Math.max(this.vx[1],this.gx[1]);else{var u=this.at(s.row,s.column),c=this.at(n.row,n.column),f=this.getScrollState(),l=u.width,d=c.width;this.Qx&&this.vx[0]>this.cx+this.ty?u.left+=this.cx+this.ty:this.cx?this.vx[0]>this.cx&&(u.left<f.x?(l-=f.x-u.left,u.left=this.cx):u.left+=this.cx-f.x):u.left-=f.x,this.Qx&&this.gx[0]>this.cx+this.ty?c.left+=this.cx+this.ty:this.cx?this.gx[0]>this.cx&&(c.left<f.x?(d-=f.x-c.left,c.left=this.cx):c.left+=this.cx-f.x):c.left-=f.x,this.P.prerender&&(u.top-=this._h,c.top-=this._h),h=Math.min(u.left,c.left),o=Math.max(u.left+l,c.left+d),r=Math.min(u.top,c.top),a=Math.max(u.top+u.height,c.top+c.height),this.P.topSplit&&(r+=this.ax(s)),this.rt&&(this.rt=window.clearTimeout(this.rt)),!e||q.touch&&!this.P.prerender||(this.rt=k(this.et,this,[mt(e)],250))}var v=this.Kx.style;v.left=h+"px",v.top=r+"px",v.width=o-h+"px",v.height=a-r+"px"}i&&this.callEvent("onAfterBlockSelect",[s,n])}},bx:function(){this.Kx=ft("div",{"class":"webix_block_selection"},""),this.st.appendChild(this.Kx)},qx:function(t){if(!1!==this.vx){this.gx||yt(document.body,"webix_noselect");var i=q.touch?q.mouse.context(t):mt(t),e=[i.x-this._x.x,i.y-this._x.y];if(Math.abs(this.vx[0]-e[0])<5&&Math.abs(this.vx[1]-e[1])<5)return;!1===this.gx&&this.bx(t),this.gx=e,this.wx(this.config.blockselect,!1,t),q.touch&&gt(t)}},Zx:function(t,i){var e=!1,s=null,n=null;if(this.Qx&&t>this.cx+this.ty?t+=this.ph.getSize()-this.ty-this.cx-this.Qx:(!this.cx||t>this.cx)&&(t+=this.ph.getScroll()),this.P.topSplit&&this.ix>this.P.topSplit){var h=this.at(this.getIdByIndex(this.P.topSplit-1),this.columnId(0));h.top+h.height>i&&(e=!0)}e||(i+=this.getScrollState().y),t<0&&(t=0),i<0&&(i=0);for(var r=this.P.columns,o=this.data.order,a=0,u=0;u<r.length;u++)if(t<=(a+=r[u].width)){n=r[u].id;break}n||(n=r[r.length-1].id),a=0;var c=this.data.$min||0;if(this.P.fixedRowHeight)s=o[c+Math.floor(i/this.P.rowHeight)];else for(var f=c;f<o.length;f++)if(i<=(a+=this.iy(f))){s=o[f];break}return s||(s=o[o.length-1]),{row:s,column:n}},ax:function(t,i){var e=0,s=this.getIndexById(t.row);if(s>=this.P.topSplit){var n=this.at(this.getIdByIndex(s),t.column),h=this.at(this.getIdByIndex(this.P.topSplit-1),t.column);h.top+h.height>n.top&&(e=h.top+h.height-(0<n.top||!i?n.top:0))}return e}},gr={resizeRow_setter:function(t){return this.P.scrollAlignY=!1,this.P.fixedRowHeight=!1,this.resizeColumn_setter(t)},resizeColumn_setter:function(t){return t&&this.ey&&(Kt(this.Vt,"mousemove",this.ny,{bind:this}),Kt(this.Vt,"mousedown",this.hy,{bind:this}),Kt(this.Vt,"mouseup",this.oy,{bind:this}),this.ey=!1),t},ey:!0,hy:function(t){this.P.subview&&this!=oi(t.target)||this.ay&&(this.Dv=[mt(t),this.ay[2]],yt(document.body,"webix_noselect"),ht())},oy:function(){this.Dv=!1,Mt(document.body,"webix_noselect"),rt()},uy:function(){if(!this.Tv){var t=this.ay[0],i=this.Dv[1],e=this.Vs(i);if(e){var s,n=this.Dv[0];if("x"==t?(s=pt(i).x+this.ay[1]-pt(this.st).x,n=n.x,this.ay[1]||(e.cind-=i.parentNode.colSpan||1)):(s=pt(i).y+this.ay[1]-pt(this.st).y+this.Zo,n=n.y,this.ay[1]||e.rind--),0<=e.cind&&0<=e.rind)this.Tv=[t,e,s],new si.resizearea({container:this.Vt,dir:t,eventPos:n,start:s,cursor:("x"==t?"col":"row")+"-resize"}).attachEvent("onResizeEnd",S(this.cy,this));this.hy=this.ay=!1}}},cy:function(t){if(this.Tv){var i=this.Tv[0],e=this.Tv[1],s=t-this.Tv[2];if("x"==i){this.P.rightSplit&&e.cind+1>=this.hx&&e.cind!==this.rl.length-1&&(e.cind++,s*=-1);var n=this.rl[e.cind],h=n.width;delete n.fillspace,
delete n.adjust,this.Do(e.cind,h+s,!0,!0),this.Io()}else{var r=this.getIdByIndex(e.rind),o=this.fy(this.getItem(r));this.setRowHeight(r,o+s)}this.oy()}this.Tv=null},ny:function(t){var i=null,e=this.P;if(this.ay&&this.Dv)return this.uy(t);var s=(t=t||event).target,n=!1,h=s.className||"",r="string"==typeof h&&-1!=h.indexOf("webix_cell");if(!r||!e.drag){var o="string"==typeof h&&-1!=h.indexOf("webix_hcell");if(this.ay=!1,r||o){var a=s.offsetWidth,u=s.offsetHeight,c=bt(t),f=e.resizeRow;"object"==M(f)&&f.headerOnly&&0<(i=this.Vs(s)).cind&&(f=!1),r&&f&&(f="object"==M(f)&&f.size?f.size:3,c.y<f?(i||(i=this.Vs(s)),i.rind&&(this.ay=["y",0,s],n="row-resize")):u-c.y<f+1&&(this.ay=["y",u,s],n="row-resize"));var l=e.resizeColumn;"object"==M(l)&&l.headerOnly&&r&&(l=!1),l&&(l="object"==M(l)&&l.size?l.size:3,c.x<l?(this.ay=["x",0,s],n="col-resize"):a-c.x<l+1&&(this.ay=["x",a,s],n="col-resize"))}this.ly&&window.clearTimeout(this.ly),this.ly=k(this.vy,this,[n],n?100:0)}},vy:function(t){this._y!=t&&(this._y=t,this.Vt.style.cursor=t||"default")}};A("onDataTable",function(t,i){q.touch&&(Yi.$init(),i.scrollSize=0,Yi.De&&Yi.limit(),t.$ready.push(t.$touch))});var wr={$touch:function(){var t=this.P;t.scrollAlignY=!1,H.extend(this,!0===t.prerender?this.gy:this.wy);var i="";t.autowidth||!1===t.scrollX||(i+="x"),t.autoheight||!1===t.scrollY||(i+="y"),this.st.setAttribute("touch_scroll",i),Yi.As(this.st.childNodes[1].firstChild),Yi.ms(this.st.childNodes[1].firstChild,0,0,"0ms"),this.ws(0,0,"0ms")},gy:{xy:function(t,i){Yi.ms(this.st.childNodes[1].firstChild,-t,-i,"0ms"),this.ws(-t,-i,"0ms"),this.callEvent("onAfterScroll",[{e:-t,f:-i}])},yy:function(){var t=Yi._s(this.st.childNodes[1].firstChild);return{x:-t.e,y:-t.f}},$init:function(){this.attachEvent("onBeforeScroll",function(){Yi.Qe=this.st.childNodes[1].firstChild,Yi.Es(Yi.Qe),Yi.gs=this}),this.attachEvent("onTouchEnd",function(){Yi.gs=null}),this.attachEvent("onAfterScroll",function(t){t&&(this.bh=-t.e,this._h=-t.f,this.ph&&(this.ph.P.scrollPos=this.bh),this.vh&&(this.vh.P.scrollPos=this._h))})},ws:function(t,i,e){Yi.ms(this.st.childNodes[1].firstChild,t,i,e),this.P.leftSplit&&Yi.ms(this.st.childNodes[0].firstChild,0,i,e),this.P.rightSplit&&Yi.ms(this.st.childNodes[2].firstChild,0,i,e),this.P.header&&Yi.ms(this.k.childNodes[1].firstChild,t,0,e),this.P.footer&&Yi.ms(this.nl.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},Is:function(){}},wy:{xy:function(t,i){k(function(){this.callEvent("onAfterScroll",[{e:-t,f:-i}])},this)},$scroll:{gravity:0,elastic:!1},$hasYScroll:function(){return 2<this.My-this.Sy},$init:function(){this.attachEvent("onAfterColumnHide",function(){this.xy(0,0)}),this.attachEvent("onBeforeScroll",function(){var t=Yi;t.Qe=this.st.childNodes[1].firstChild,t.Es(t.Qe),t.ts.left=this.bh,t.ts.hidden=this.ph.P.scrollVisible||this.vh.P.scrollVisible,t.ts.dy=this.My,t.gs=this}),this.attachEvent("onAfterRender",function(){this.ph&&this.P.scrollX&&this.ph.yw(),this.vh&&this.P.scrollY&&this.vh.yw()}),this.attachEvent("onAfterScroll",function(t){if(t){var i=this.bh!=-t.e,e=this._h!=-t.f;Yi.gs=null,Yi.ky=null,this._h=0,this.bh=0;var s=Yi.config.translate;return Yi.config.translate="translate",this.ws(this.ph?0:t.e,0,0),Yi.config.translate=s,this.bh=-t.e,this._h=-t.f,this.Cy(),this.render(),i&&(this.ph&&this.ph.scrollTo(this.bh),this.callEvent("onScrollX",[])),e&&(this.vh&&this.vh.scrollTo(this._h),this.callEvent("onScrollY",[])),!1}})},ws:function(t,i,e){i+=this._h,t+=this.bh,Yi.ms(this.st.childNodes[1].firstChild,t,i,e),this.P.leftSplit&&Yi.ms(this.st.childNodes[0].firstChild,0,i,e),this.P.rightSplit&&Yi.ms(this.st.childNodes[2].firstChild,0,i,e),this.P.header&&Yi.ms(this.k.childNodes[1].firstChild,t,0,e),this.P.footer&&Yi.ms(this.nl.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},Is:function(t){t.f-=this._h,t.e-=this.bh}}},xr={$init:function(){this.data.attachEvent("onStoreUpdated",S(function(t){t||this.$y()},this)),this.attachEvent("onStructureLoad",this.$y),this.attachEvent("onStructureUpdate",this.Dy),this.attachEvent("onColumnResize",
function(t,i,e,s){s&&this.Dy()}),this.attachEvent("onResize",this.Dy)},$y:function(){for(var t=!1,i=this.rl,e=0;e<i.length;e++)i[e].adjust&&("header"==i[e].adjust||this.count())&&(t=this.Iy(e,i[e].adjust,!0)||t);t&&(this.Io(!0),this.Dy())},Dy:function(){var t=this.P.columns,i=[],e=0;if(t&&!this.P.autowidth)for(var s=0;s<t.length;s++){var n=t[s].fillspace;n&&(e+=1*(i[s]=n)||1)}e&&this.Ay(i,e)},Ay:function(t,i){var e=this.P.columns;if(e){var s=this.me-this.Fy,n=!1;if(0<s){for(var h=0;h<e.length;h++)t[h]||(s-=e[h].width||this.P.columnWidth);for(var r=0;r<t.length;r++)if(t[r]){var o=Math.min(s,Math.round(s*t[r]/i));n=this.Do(r,o,!0)||n,s-=e[r].width,i-=t[r]}n&&this.Io(!0)}}},Ty:function(t,i){var e=this.P.columns[t],s=e.minWidth||this.P.minColumnWidth;if("header"!=i){var n=this.data.order.length;e.adjustBatch&&e.adjustBatch<n&&(n=e.adjustBatch);for(var h=this.data.order.slice(0,n),r=0;r<n;r++)h[r]=h[r]?this.Vy(this.getItem(h[r]),e,0):"";s=Math.max(s,St(h,"webix_table_cell webix_cell").width)}if("data"!=i){for(var o=0;o<e.header.length;o++){var a=e.header[o];if(a){var u=0;if(a.rotate)for(var c=0;c<(a.rowspan||1);c++)u+=this.al[c];var f="webix_table_cell webix_cell "+(a.css||"")+(a.rotate?"webix_measure_rotate":""),l=St([a.text],f,u);s=Math.max(s,a.rotate?l.height:l.width)}}e.sort&&(s+=10)}return s+=q.isIE?Li.layoutPadding.space:0,Math.min(s,e.maxWidth||this.P.maxColumnWidth||1e5)},Iy:function(t,i,e){if(0<=t){var s=this.Ty(t,i);return this.Do(t,s,e)}},adjustColumn:function(t,i){this.Iy(this.getColumnIndex(t),i)},adjustRowHeight:function(t,i){if(t)this.zy(t);else{for(var e={},s=this.P.columns,n=0;n<s.length;n++)this.zy(s[n].id,e);this.data.each(function(t){t.$height=e[t.id]})}i||this.refresh()},zy:function(t,e){var i,s=this.getColumnConfig(t),n=ft("DIV",{"class":"webix_table_cell webix_measure_size webix_cell"},"");n.style.cssText="width:"+s.width+"px; height:1px; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(n),n.offsetHeight<1&&(i=this.$view.cloneNode(!0),document.body.appendChild(i),i.appendChild(n)),this.data.each(function(t){var i;n.innerHTML=this.Vy(t,s,0),i=Math.max(n.scrollHeight,this.P.rowHeight,this.P.minRowHeight||0),i=Math.min(i,this.P.maxRowHeight||1e5),e?e[t.id]=Math.max(i,e[t.id]||0):t.$height=i},this),n=dt(n),i&&dt(i)}},yr={math_setter:function(t){return t&&this.By(),t},Hy:"$",By:function(){q.strict||(this.data.attachEvent("onStoreUpdated",S(this.Ry,this)),this.data.attachEvent("onStoreLoad",S(this.Ey,this)),this.attachEvent("onStructureLoad",this.Ey))},Ry:function(t,i,e){if(t&&"paint"!=e)if("delete"==e)for(var s=0;s<this.rl.length;s++)this.Py(i,this.rl[s].id);else{"add"==e&&this.jy(i);for(var n=0;n<this.rl.length;n++)this.Ny={},this.Ly(t,this.rl[n].id);this.Ny={}}},Ly:function(t,i){var e,s=this.getItem(t);if((e=s[this.Hy+i]||s[i])&&0<e.length&&"="===e.toString().substr(0,1)?(s[this.Hy+i]=e,s[i]=this.Oy(e,t,i)):("undefined"!=typeof s[this.Hy+i]&&delete s[this.Hy+i],this.Py(s,i)),"undefined"!=typeof s.depends&&"undefined"!=typeof s.depends[i])for(var n in s.depends[i]){var h=s.depends[i][n][0]+"__"+s.depends[i][n][1];"undefined"==typeof this.Ny[h]&&(this.Ny[h]=!0,this.Ly(s.depends[i][n][0],s.depends[i][n][1]))}},Wy:function(t,i){var e=this.getItem(t);"undefined"!=typeof e[this.Hy+i]&&(e[i]=e[this.Hy+i])},Ey:function(){if(this.rl&&this.count()){this.jy();for(var t=0;t<this.rl.length;t++){var i=this.columnId(t);this.data.each(function(t){this.Ny={},this.Ly(t.id,i)},this)}this.Ny={}}},jy:function(t){for(var i=0;i<this.rl.length;i++)if(this.rl[i].math){var e=this.columnId(i),s="="+this.rl[i].math;s=s.replace(/\$c/g,"#$c#"),t?(t[e]=this.Uy(s,t.id,e),delete t[this.Hy+e],this.Py(t,e)):this.data.each(function(t){t[e]=this.Uy(s,t.id,e),delete t[this.Hy+e],this.Py(t,e)},this)}},Uy:function(t,i,e){return Yt(t)({$r:i,$c:e})},Yy:function(t,i){var e;if(!this.exists(t))return"#out_of_range";var s=(e=this.getItem(t))[this.Hy+i]||e[i]||0;return"="!==(s=s.toString()).substring(0,1)?s:("undefined"==typeof e[this.Hy+i]&&(e[this.Hy+i]=e[i]),e[i]=this.Oy(s,t,i,!0),e[i])},Oy:function(t
,i,e,s){if(!0===s){if(this.qy(i,e))return"#selfreference"}else this.Gy();this.Xy(i,e);var n=this.getItem(i);t=t.substring(1);var h=this.Jy(t),r=this.Ky(t,i);t=h?(t=this.Zy(t,r),this.Qy(t,h)):this.Zy(t,r,!0);var o=this.tM(t);if(!1!==o)return o;this.iM(i,e),this.Py(n,e);for(var a=0;a<r.length;a++)this.eM([i,e],r[a]);return!1!==(o=this.tM(t))?o:t?(t=this.sM(t.replace(/\$r/g,n.id)),!1!==(o=this.tM(t))?o:t):t},Jy:function(t){return t.replace(/\[[^)]*?\]/g,"").match(/(\+|-|\*|\/)/g)},Ky:function(t,i){var e=t.match(/\[([^\]]+),([^\]]+)\]/g);null===e&&(e=[]);for(var s=0;s<e.length;s++){var n=e[s],h=n;(n=(n=n.substr(1,n.length-2)).split(","))[0]=this.nM(n[0]),n[1]=this.nM(n[1]),":"===n[0].substr(0,1)&&(n[0]=this.getIdByIndex(n[0].substr(1))),"$r"===n[0]&&(n[0]=i),":"===n[1].substr(0,1)&&(n[1]=this.columnId(n[1].substr(1))),n[2]=h,e[s]=n}return e},Zy:function(t,i,e){var s="(",n=")";e&&(s=n="");for(var h=0;h<i.length;h++){var r=i[h],o=this.Yy(r[0],r[1]);isNaN(o)&&(o='"'+o+'"'),t=t.replace(r[2],s+o+n)}return t},Qy:function(t,i){for(var e=[],s=0;s<i.length;s++){var n=i[s],h=this.hM(t,n);e.push(h[0]),t=h[1]}e.push(t);for(var r=0;r<e.length;r++){var o=this.nM(e[r]);e[r]=o}for(var a="",u=0;u<e.length-1;u++)a+=e[u]+i[u];return a+=e[e.length-1]},sM:function(t){var i;try{i=window.eval(t)}catch(e){i=""}return i.toString()},hM:function(t,i){var e=t.indexOf(i);return[t.substr(0,e),t.substr(e+1)]},nM:function(t){return t=(t=t.replace(/^ */g,"")).replace(/ *$/g,"")},Gy:function(){this.rM=[]},Xy:function(t,i){this.rM[t+"__"+i]=!0},iM:function(t,i){"undefined"!=typeof this.rM[t+"__"+i]&&delete this.rM[t+"__"+i]},qy:function(t,i){return"undefined"!=typeof this.rM[t+"__"+i]},eM:function(t,i){var e=this.getItem(i[0]);"undefined"==typeof e.depends&&(e.depends={}),"undefined"==typeof e.depends[i[1]]&&(e.depends[i[1]]={}),e.depends[i[1]][t[0]+"__"+t[1]]=t,"undefined"==typeof(e=this.getItem(t[0])).triggers&&(e.triggers={}),"undefined"==typeof e.triggers[t[1]]&&(e.triggers[t[1]]={}),e.triggers[t[1]][i[0]+"__"+i[1]]=i},Py:function(t,i){if(t&&"undefined"!=typeof t.triggers)for(var e in t.triggers[i]){var s=t.triggers[i][e],n=this.getItem(s[0]);n&&delete n.depends[s[1]][t.id+"__"+i]}},tM:function(t){var i=t.match(/#\w+/);return null!==i&&0<i.length&&i[0]}},Mr={headermenu_setter:function(t){return t&&(t.data&&(this.oM=!0),t=this.aM(t)),t},aM:function(n){var t={view:"contextmenu",template:"<span class='webix_icon webix_list_icon {common.hidden()}'></span> &nbsp; #value#",type:{hidden:function(t){return t.hidden?"wxi-eye-slash":"wxi-eye"}},on:{onMenuItemClick:S(function(t){var i=oi(this.P.headermenu),e=i.getItem(t).hidden;i.getItem(t).hidden=!e,i.refresh(t),i.$blockRender=!0;var s={spans:"object"==M(n)&&n.spans};return e?this.showColumn(t,s):this.hideColumn(t,s),i.$blockRender=!1},this)},data:[]};"object"==M(n)&&H.extend(t,n,!0);var i=si(t);return i.attachTo(this.k),this.Bt.push(i),this.attachEvent("onStructureLoad",this.uM),this.attachEvent("onStructureUpdate",this.uM),this.aM=function(t){return t},i.P.id},uM:function(){var t=oi(this.P.headermenu),i=this.Co;if(!t.$blockRender){if(this.oM)return t.data.each(function(t){t.hidden=!!i[t.id]}),void t.refresh();var e=[],s=this.xo;s.length||(s=this.rl);for(var n=0;n<s.length;n++){var h=this.getColumnConfig(s[n].id||s[n]),r=h.header[0],o=!!i[h.id];!1!==h.headermenu&&r&&e.push({id:h.id,value:o?r.text:r.groupText||r.text,hidden:o})}e.length&&t.data.importData(e)}}};wn.headerMenu={getValue:function(){},setValue:function(){},refresh:function(t,i){t.P.headermenu||(t.define("headermenu",!0),t.uM()),i.onclick=function(){oi(t.config.headermenu).show(i)}},render:function(){return"<span class='webix_icon wxi-columns' role='button' tabindex='0' aria-label='"+I.aria.headermenu+"'>"}};var Sr={Ia:function(t){return this.getColumnConfig(t.column).editor},getEditor:function(t,i){return t?(1==arguments.length&&(i=t.column,t=t.row),(this.ma[t]||{})[i]):this.Pi},ja:function(t){for(var i in this.ma){var e=this.ma[i];for(var s in e)"$count"!=s&&t.call(this,e[s])}},Aa:function(t,i,e){var s=t.row,n=t.column,h=i.config=this.getColumnConfig(
n);!1!==e&&this.showCell(s,n);var r=i.render();i.$inline&&(r=this.ya(t)),i.node=r;var o,a=this.getItem(s),u=h.editFormat;return this.P.editMath&&(o=a["$"+n]),R(o=o||a[n])&&(o=""),i.setValue(u?u(o):o,a),i.value=a[n],this.za(t,i),i.$inline||(i.cM=this.Ba(t,r,!0)),i.afterRender&&i.afterRender(),this.P.liveValidation&&(Kt(i.node,"keyup",this.fM(t,this)),this.validateEditor(t)),r},fM:function(t,i){return function(){i.validateEditor(t)}},Na:function(t){var i=this.getColumnConfig(t.column).editParse,e=t.getValue();return i?i(e):e},$a:function(t,i,e){var s=e?{}:this.getItem(t.row);return s[t.column]=i,this.P.editMath&&(s["$"+t.column]=null),s},za:function(t,i){var e=this.ma[t.row]=this.ma[t.row]||{};e.$count=(e.$count||0)+1,i.row=t.row,i.column=t.column,this.Pi=e[t.column]=i,this.Ai++,this.lM=this.getScrollState()},Ra:function(t){this.Pi==t&&(this.Pi=0),t.destroy&&t.destroy();var i=this.ma[t.row];delete i[t.column],i.$count--,i.$count||delete this.ma[t.row],this.Ai--},Ma:function(t,i){var e=this.ma[t];if(e)for(var s in this.ma[i]=e,delete this.ma[t],e)"$count"!=s&&(e[s].row=i)},Ha:function(t){var i,e,s,n,h,r=this.getColumnConfig(t.column),o=0;if(r&&r.node&&r.attached){if(s=this.getIndexById(t.row),this.ul&&this.getSpan(t.row,t.column))for(e=0;e<3;e++)for(i=this.dM[e],n=0;!o&&n<i.childNodes.length;n++)(h=i.childNodes[n]).getAttribute("row")==s&&h.getAttribute("column")==this.getColumnIndex(t.column)&&(o=h);!o&&s>=r.vM-this.P.topSplit&&s<r._M&&(o=r.node.childNodes[s-r.vM+this.P.topSplit])}return o},editCell:function(t,i,e,s){return i=i||this.P.columns[0].id,Se.edit.call(this,{row:t,column:i},e,s)},editRow:function(i){i&&i.row&&(i=i.row);var e=!1;this.eachColumn(function(t){this.edit({row:i,column:t},e,!e),e=!0})},editColumn:function(i){i&&i.column&&(i=i.column);var e=!1;this.eachRow(function(t){this.edit({row:t,column:i},e,!e),e=!0})},eachRow:function(t,i){var e=this.data.order;i&&(e=this.data.Ir||e);for(var s=0;s<e.length;s++)t.call(this,e[s])},eachColumn:function(t,i){for(var e in this.ol){var s=this.ol[e];t.call(this,s.id,s)}if(i)for(var n in this.Co){var h=this.Co[n];t.call(this,h.id,h)}},Oa:function(t){if(this.getSelectedId&&1==this.getSelectedId(!0).length)return this.To(t),!1},Ii:function(t,i){if(this.P.editable&&!this.Ai){if(i.target&&"INPUT"==i.target.tagName)return!0;var e=this.getSelectedId(!0);if(1==e.length){var s=e[0];return"row"==this.P.select&&(s.column=this.P.columns[i.shiftKey?0:this.P.columns.length-1].id),this.editNext(t,s),!1}}return!0},La:function(t,i,e){var s=this.getIndexById(t.row),n=this.getColumnIndex(t.column),h=this.data.order,r=this.rl;if(e)for(var o=s;o<h.length;o++){for(var a=n+1;a<r.length;a++){var u={row:h[o],column:r[a].id};if(i.call(this,u)&&(!this.pM||!this.pM(t,u)))return u}n=-1}else for(var c=s;0<=c;c--){for(var f=n-1;0<=f;f--){var l={row:h[c],column:r[f].id};if(i.call(this,l))return l}n=r.length}return null},bM:function(){this.Ai&&(this.mM?this.mM=!1:(this.vh.scrollTo(this.getScrollState().y+this.st.childNodes[1].firstChild.scrollTop),this.st.childNodes[1].firstChild.scrollTop=0,this.mM=!0))},gM:function(){this.Ai&&this.ph.scrollTo(this.st.childNodes[1].scrollLeft)},ka:function(){this.attachEvent("onScrollY",this.wM),this.attachEvent("onScrollX",this.wM),this.attachEvent("onScrollY",this.ga),this.attachEvent("onColumnResize",function(){this.editStop()}),this.attachEvent("onAfterFilter",function(){this.editStop()}),this.attachEvent("onRowResize",function(){this.editStop()}),this.attachEvent("onAfterScroll",function(){this.P.topSplit&&this.editStop()}),this.st.childNodes[1].firstChild.onscroll=S(this.bM,this),this.st.childNodes[1].onscroll=S(this.gM,this)},wM:function(){if(this.Ai){var t=this.lM;this.lM=this.getScrollState();var r=this.lM.y-t.y;this.ja(function(t){if(t.getPopup){var i=this.getItemNode(t),e=!1;if(this.P.prerender){var s=t.cM,n=s.top-this._h,h=s.left-this.bh;e=n<0||n+s.height>this.Sy||h<0||h+s.width>this.$width-this.xM}!i||e?t.getPopup().show({x:-1e4,y:-1e4}):t.getPopup().show(i)}this.P.prerender||t.linkInput||t.$inline||(t.node.top-=r,t.node.style.top=t.node.top+"px")})}}},kr={
$init:function(){this.yM(),this.attachEvent("onStructureLoad",this.MM)},yM:function(){this.Co={},this.xo=m(),this.$o=[0,0]},MM:function(){for(var t=this.rl,i=0;i<t.length;i++)t[i].header&&this.SM(t,t[i].header),t[i].footer&&this.SM(t,t[i].footer);for(var e=t.length-1;0<=e;e--)t[e].hidden?this.hideColumn(t[e].id,{},!0,!0):t[e].batch&&this.config.visibleBatch&&t[e].batch!=this.config.visibleBatch&&this.hideColumn(t[e].id,{},!0,!0)},SM:function(t,i){for(var e=0;e<i.length;e++){var s=i[e];s&&s.colspan&&!s.$colspan&&(s.$colspan=s.colspan)}},moveColumn:function(t,i){var e=this.getColumnIndex(t);if(e!=i){var s=this.P.columns,n=s.splice(e,1),h=i-(e<i?1:0);x.insertAt.call(s,n[0],h);var r=this.xo;if(r.length){var o=(r=m(r)).find(t);r.removeAt(o),0===h?r.unshift(t):r.insertAt(t,r.find(s[h-1].id)+1)}this.kM()}},CM:function(){var t=this.xo,i=this.P.columns;if(!t.length){for(var e=0;e<i.length;e++)t[e]=i[e].id;this.$o=[this.P.leftSplit,this.hx]}},isColumnVisible:function(t){return!this.Co[t]},hideColumn:function(t,i,e,s){var n,h=this.P.columns,r=this.xo,o=this.Co,a=1;if(i=i||{},!1!==s){var u=this.getColumnIndex(t);if(-1===u||!this.callEvent("onBeforeColumnHide",[t]))return;if(-1==u)return;if(this.CM(),i.spans)for(var c=h[u].header,f=0;f<c.length;f++)c[f]&&(c[f].$groupSpan=c[f].colspan||1,a=Math.max(a,c[f].$groupSpan));u<this.P.leftSplit&&(this.P.leftSplit-=a),u>=this.hx?this.P.rightSplit-=a:this.hx-=a;for(var l=u+a-1;u<=l;l--)this.$M(u),(o[(n=h.splice(u,1)[0]).id]=n).vM=-1,delete this.ol[n.id];this.callEvent("onAfterColumnHide",[t])}else{if(!(n=o[t])||!this.callEvent("onBeforeColumnShow",[t]))return;for(var d=null,v=0,_=0;v<r.length;v++){if(r[v]==t){_=v;break}o[r[v]]||(d=r[v])}var p=d?this.getColumnIndex(d)+1:0;if(i.spans)for(var b=n.header,m=0;m<b.length;m++)b[m]&&(b[m].colspan=b[m].$groupSpan||b[m].colspan,delete b[m].$groupSpan,a=Math.max(a,b[m].colspan||1));for(var g=_+a-1;_<=g;g--){var w=o[r[g]];w?(x.insertAt.call(h,w,p),delete w.hidden,delete o[w.id],this.ol[w.id]=w):a--}_<this.$o[0]&&(this.P.leftSplit+=a),_>=this.$o[1]?this.P.rightSplit+=a:this.hx+=a,this.callEvent("onAfterColumnShow",[t])}n.header&&this.DM(n,!1!==s?0:1,"header"),n.footer&&this.DM(n,!1!==s?0:1,"footer"),e||this.kM()},DM:function(t,i,e){for(var s=t[e].length-1;0<=s;s--)for(var n,h=this.xo,r=!1,o=0,a=0;a<h.length;a++){var u=this.getColumnConfig(h[a]),c=u[e][s];this.isColumnVisible(h[a])?(r&&0<o&&n&&0<n.colspan?n=c=u[e][s]=n:c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,n=c),r=null):(c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,r=n=c),n&&0<o&&n.colspan--),o--}},refreshColumns:function(t,i){this.IM=!0,(t&&t!=this.config.columns||i)&&(this.yM(),this.So={},t&&(this.hx=t.length-(this.config.rightSplit||0))),this.ol={};for(var e=0;e<this.rl.length;e++){var s=this.rl[e];(this.ol[s.id]=s).attached=s.node=null}for(var n=0;n<3;n++)this.k.childNodes[n].innerHTML="",this.st.childNodes[n].firstChild.innerHTML="";this.rl=this.config.columns=t||this.config.columns,this.hx=this.rl.length-this.P.rightSplit,this.ko=0,this.AM(),this.Ph(),this.callEvent("onStructureUpdate"),this.render(),this.IM=0},kM:function(){this.ko=0,this.callEvent("onStructureUpdate"),this.FM(),this.render()},showColumn:function(t,i,e){return this.hideColumn(t,i,e,!1)},showColumnBatch:function(s,n){var h=void 0!==n;n=!1!==n,this.eachColumn(function(t,i){if(i.batch){var e=this.Co[i.id];n||(e=!e),i.batch==s&&e?this.hideColumn(i.id,{spans:!0},!0,!n):h||i.batch==s||e||this.hideColumn(i.id,{spans:!0},!0,n)}},!0),this.kM()}},Cr={$init:function(){this.attachEvent("onAfterScroll",this.gu),this.attachEvent("onFocus",function(){yt(this.$view,"webix_dtable_focused")}),this.attachEvent("onBlur",function(){Mt(this.$view,"webix_dtable_focused")})},gu:function(){if(!this.TM()){var t=this.tt.querySelector(".webix_cell");t&&t.setAttribute("tabindex","0")}},TM:function(){for(var t=this.getSelectedId(!0),i=0;i<t.length;i++)if(this.isColumnVisible(t[i].column))return this.getItemNode(t[i]);return null},moveSelection:function(t,i,e){if(this.VM(),!this.P.disabled){i=i||{};var s=this.getSelectedId(!0),n=s.length-1,h=!(
!this.P.multiselect&&!this.P.areaselect)&&i.shift;if(1<s.length&&"cell"!==this.P.select&&(s=s.sort(S(function(t,i){return this.getIndexById(t.row)>this.getIndexById(i.row)||this.getColumnIndex(t.column)>this.getColumnIndex(i.column)?1:-1},this)),"up"!=t&&"left"!=t&&"top"!=t&&"pgup"!=t||(n=0)),n<0&&this.count()){if("down"==t||"right"==t)t="top";else{if("up"!=t&&"left"!=t)return;t="bottom"}n=0,s=[{row:1,column:1}]}if(0<=n){var r=s[n].row,o=s[n].column;if("top"==t||"bottom"==t)r&&("top"==t?r=this.data.getFirstId():"bottom"==t&&(r=this.data.getLastId())),o&&(n=0,"bottom"==t&&(n=this.config.columns.length-1),o=this.columnId(n));else if("up"==t||"down"==t||"pgup"==t||"pgdown"==t){if(r){var a=this.getIndexById(r),u=1;"pgup"!=t&&"pgdown"!=t||(u=this.dc?this.dc.config.size:Math.round(this.Sy/this.P.rowHeight)),"up"==t||"pgup"==t?a-=u:"down"!=t&&"pgdown"!=t||(a+=u),a<0&&(a=0),a>=this.data.order.length&&(a=this.data.order.length-1),!(r=this.getIdByIndex(a))&&this.P.pager&&this.showItemByIndex(a)}}else{if("right"!=t&&"left"!=t)return;if(o&&"row"!=this.config.select){var c=this.getColumnIndex(o);"right"==t?c++:"left"==t&&c--,c<0&&(c=0),c>=this.config.columns.length&&(c=this.config.columns.length-1),o=this.columnId(c)}else{if((this.open||this.zM)&&"right"==t)return this.open?this.open(r):this.openSub(r);if((this.close||this.zM)&&"left"==t)return this.close?this.close(r):this.closeSub(r)}}if(r){this.showCell(r,o),this.select||(H.extend(this,this.$x.Cx,!0),this.P.select=this.open||this.zM?"row":"cell",H.extend(this,this.$x[this.P.select],!0));var f={row:r,column:o};if(h&&"area"==this.P.select){var l=this.Gw[this.Gw.length-1];this.Uw(f,l,t,i)}else this.To(f,h);if(!this.P.clipboard&&!1!==e){var d=this.getItemNode(f);d&&d.focus()}}}return!1}}},$r={Uo:function(t){for(var i=0;i<this.rl.length;i++){var e=this.rl[i],s=this.getItemNode({row:t,cind:i});s?s.parentNode.insertBefore(Xi.dn[i],s):e.node.appendChild(Xi.dn[i])}},Xo:function(){var t=[],i=this.rl.length,e=document.createElement("div");e.className="webix_drop_area",e.style.height=this.P.rowHeight+"px",e.innerHTML=this.$dropHTML();for(var s=0;s<i;s++)t.push(e.cloneNode(!0));return t}},Dr={drag_setter:function(t){return this.attachEvent("onBeforeDrag",function(t){return this.BM(t.source)}),this.attachEvent("onBeforeDragIn",function(t){var i=this.BM(t.target);return!i&&Xi.dn&&(dt(Xi.dn),this.Ko=Xi.dn=null),i}),be.drag_setter.call(this,t),"order"!=t&&"move"!=t||H.extend(this,$r,!0),t},Wo:function(t,i,e){var s=Xi.Gs;this.P.prerender||e||(t=[s.start]);for(var n=0;n<t.length;n++){for(var h=0;h<this.rl.length;h++){var r=this.getItemNode({row:t[n],cind:h});r&&yt(r,i)}this.data.addMark(t[n],i,1,1,!0)}},Oo:function(t,i,e){var s=Xi.Gs;this.P.prerender||e||(t=[s.start]);for(var n=0;n<t.length;n++){for(var h=0;h<this.rl.length;h++){var r=this.getItemNode({row:t[n],cind:h});r&&Mt(r,i)}this.data.removeMark(t[n],i,1,!0)}},BM:function(t){var i,e,s=!1;if(this.P.topSplit&&t)for($(t)||(t=[t]),i=0;!s&&i<t.length;i++)s=0<=(e=this.getIndexById(t[i]))&&e<this.P.topSplit;return!s},Q:function(t){for(var i="<div class='webix_dd_drag' style='width:"+(this.me-this.Fy)+"px;'>",e=this.P.columns,s=0;s<e.length;s++){var n=this.Vy(t,e[s]);i+="<div style='width:"+e[s].width+"px;'>"+n+"</div>"}return i+"</div>"},getHeaderNode:function(t,i){return this.HM(t,i,this.k)},getFooterNode:function(t,i){return this.HM(t,i,this.nl)},HM:function(t,i,e){if(this.isColumnVisible(t)){var s=this.getColumnIndex(t),n=this.P.leftSplit>s?0:this.hx<=s?2:1;i=i||0;return e.childNodes[n].querySelector("div[".concat("column",'="').concat(s,'"][').concat("row",'="').concat(i,'"]'))}return null},getItemNode:function(t){if(t&&!t.header){var i=t.row||t,e="number"==typeof t.rind?t.rind:this.getIndexById(i),s=this.Qw(),n=s[0]-this.P.topSplit;if(e<n&&e>s[1])return;var h=this.Zw(),r=this.P.leftSplit?0:h[0],o="number"==typeof t.cind;if((t.column||o)&&(r=o?t.cind:this.getColumnIndex(t.column))<this.hx&&r>=this.P.leftSplit&&(r<h[0]||r>h[1]))return;var a=this.P.columns[r];if(a.attached&&a.node){if("$webix-drop"===i)return Xi.dn[r];for(
var u=e<this.P.topSplit||this.P.prerender?e:e-n,c=a.node.childNodes,f=Math.min(c.length,u+1),l=0;l<f;l++)"webix_drop_area"===c[l].className&&u++;return c[u]}}},RM:function(t){var i=t.target.nodeName;return"INPUT"!=i&&"TEXTAREA"!=i},dragColumn_setter:function(t){var r;"order"==t?r={$drag:S(function(t,i){if(!this.RM(i)||this.Dv)return!1;var e=this.locate(i);if(!e||!this.callEvent("onBeforeColumnDrag",[e.column,i]))return!1;Xi.Gs={from:r,start:e,custom:"column_dnd"};var s=this.getColumnConfig(e.column);return this.EM=bt(i),this.PM=s.width,this.zo=!0,"<div class='webix_dd_drag_column' style='width:"+s.width+"px'>"+(s.header[0].text||"&nbsp;")+"</div>"},this),$dragPos:S(function(t,i,e){var s=this,n=Xi.getContext(),h=pt(this.$view);e.style.display="none";var r=document.elementFromPoint(t.x,h.y+this.P.headerRowHeight/2),o=r?this.locate(r):null,a=Xi.getContext().start.column;if(o&&o.column!=a&&(!this.jM||o.column!=this.NM)&&"column_dnd"==n.custom&&oi(r)==this){if(!this.callEvent("onBeforeColumnDropOrder",[a,o.column,i]))return;var u=this.getColumnIndex(a),c=this.getColumnIndex(o.column);i.touches&&(this.LM=i.target,this.LM.style.display="none",this.$view.parentNode.appendChild(this.LM)),this.moveColumn(a,c+(u<c?1:0)),this.NM=o.column,this.jM=!0}if(o&&o.column==a&&(this.jM=!1),e.style.display="block",t.x=t.x-this.EM.x,t.y=h.y,t.x<h.x)t.x=h.x;else{var f=h.x+this.$view.offsetWidth-this.Fy-this.PM;t.x>f&&(t.x=f)}Xi.hn=!0,this.rt&&(this.rt=window.clearTimeout(this.rt)),!1!==this.P.dragscroll&&(this.rt=k(function(t){return s.ot(t)},this,[mt(i)],250))},this),$dragDestroy:S(function(t,i){this.zo=null,this.rt&&(this.rt=window.clearTimeout(this.rt)),dt(i),this.LM&&dt(this.LM);var e=Xi.getContext().start;this.callEvent("onAfterColumnDropOrder",[e.column,this.NM,t])},this),$drop:function(){}}:t&&(r={Bo:!0,$drag:S(function(t,i){if(!this.RM(i)||this.Dv)return!1;var e=this.locate(i);if(!e||!this.callEvent("onBeforeColumnDrag",[e.column,i]))return!1;Xi.Gs={from:r,start:e,custom:"column_dnd"};for(var s=this.getColumnConfig(e.column).header,n="&nbsp;",h=0;h<s.length;h++)if(s[h]){n=s[h].text;break}return this.zo=!0,"<div class='webix_dd_drag_column'>"+n+"</div>"},this),$drop:S(function(t,i,e){var s=e;e.touches&&this.OM&&(s=this.OM);var n=this.locate(s);if(!n)return!1;var h=Xi.getContext().start.column;if(h!=n.column){if(!this.callEvent("onBeforeColumnDrop",[h,n.column,e]))return;var r=this.getColumnIndex(h),o=this.getColumnIndex(n.column);this.moveColumn(h,o+(r<o?1:0)),this.callEvent("onAfterColumnDrop",[h,n.column,e])}},this),$dragIn:S(function(t,i,e){var s=this,n=Xi.getContext();if("column_dnd"!=n.custom||n.from!=r)return!1;for(var h=e.target;-1==(h.className||"").indexOf("webix_hcell");)if(!(h=h.parentNode))return;return this.rt&&(this.rt=window.clearTimeout(this.rt)),!1!==this.P.dragscroll&&(this.rt=k(function(t){return s.ot(t)},this,[mt(e)],250)),h!=this.OM&&(this.OM&&Mt(this.OM,"webix_dd_over_column"),yt(h,"webix_dd_over_column")),this.OM=h},this),$dragDestroy:S(function(t,i){this.zo=null,this.rt&&(this.rt=window.clearTimeout(this.rt)),this.OM&&Mt(this.OM,"webix_dd_over_column"),dt(i)},this)}),t&&(Xi.addDrag(this.k,r),Xi.addDrop(this.k,r,!0),this.attachEvent("onDestruct",function(){return Xi.unlink(r)}),this.et||H.extend(this,Gt,!0))}},Ir={ih:function(t,i){if(t.scroll&&!i)return!0;t.header=R(t.header)?!!this.config.header:t.header,t.footer=R(t.footer)?!!this.config.footer:t.footer,t.xCorrection=t.xCorrection||0},Np:function(t,i){for(var e=-1,s=0;e<0&&s<t.length;s++)i(t[s])&&(e=s);return e},WM:function(e,c,f){var l={},d=0;return e.forEach(S(function(t,o){var i=t[0],a=[],u=i.length;i.forEach(S(function(t,i){for(var e=c[i+d],s=0;s<e[f].length;s++){var n=e[f][s];if(n||l[o]&&l[o][s]){if(n=_(n||{text:""}),l[o]&&l[o][s]&&0===i&&(n.colspan=l[o][s],l[o][s]=0),n.colspan){var h=Math.min(n.colspan,u-i);l[o+1]=l[o+1]||{},l[o+1][s]=n.colspan-h,n.colspan=h}n.rowspan&&1===u&&(n.height=(n.height||this.config.headerRowHeight)*n.rowspan,n.rowspan=null);var r={txt:n.rotate?this.getHeaderNode(e.id,s).innerHTML:n.text||(n.contentId?this.getHeaderContent(
n.contentId).getValue():""),className:"webix_hcell webix_"+f+"_cell "+(n.css||""),style:{height:(n.height||this.config.headerRowHeight)+"px",width:n.colspan?"auto":e.width+"px"},span:n.colspan||n.rowspan?{colspan:n.colspan||1,rowspan:n.rowspan||1}:null};a[s]=a[s]||[],a[s][i]=r}}},this)),e[o]="header"==f?a.concat(t):t.concat(a),d+=u},this)),e},eh:function(v,t,_){var p=this.config.columns,b=this.getSelectedId(!0),m="page"==v.fit?Infinity:this.nh(v),g=0,w=0,x=[],y=0,M=[];return _=_||0+v.xCorrection,t=t||[],this.eachRow(S(function(i){for(var t=0,e=this.getItem(i),s=this.getIndexById(i),n=[],h=!1,r=_;r<p.length;r++){var o=p[r].id,a=this.getColumnIndex(o)-_;if(p[r]){if(t+=p[r].width,0===s&&M.push(p[r].width),m<t&&_<r){y=r;break}if("selection"!==v.data||"selection"==v.data&&-1!==this.Np(b,function(t){return t.column==o&&t.row==i})){var u;if(this.getSpan&&(u=this.getSpan(i,o)),u&&this.getColumnIndex(o)===_){var c=this.getColumnIndex(u[1]);c<_&&(u[2]=u[2]-(_-c),u[4]=u[4]?u[4]:e[u[1]]?this.getText(i,u[1]):null,u[1]=o)}if(!u||u&&u[0]==i&&u[1]==o){var f=u&&u[4]?u[4]:this.ol[o]?this.getText(i,o):"",l=this.getCss(i,o)+" "+(p[r].css||"")+(u?" webix_dtable_span "+(u[5]||""):""),d={height:u&&1<u[3]?"auto":(e.$height||this.config.rowHeight)+"px",width:u&&1<u[2]?"auto":p[r].width+"px"};n.push({txt:f,className:l,style:d,span:u?{colspan:u[2],spanStart:this.getColumnIndex(u[1]),rowspan:u[3]}:null}),(f||0===f)&&(g=Math.max(a+1,g),w=Math.max(s+1,w)),h=h||!!f}else u&&(n.push({$inspan:!0}),g=Math.max(a+1,g),w=Math.max(s+1,w))}}}v.skiprows&&!h||x.push(n)},this)),w&&g&&(v.trim&&(x.length=w,x=x.map(function(t){for(var i=t.length-1;0<=i;i--)if(t[i].span&&t[i].span.colspan){t[i].span.colspan=Math.min(t[i].span.colspan,t.length-i);break}return t.length=g,t})),t.push(x)),y?this.eh(v,t,y):(v.footer&&(t=this.WM(t,p,"footer")),v.header&&(t=this.WM(t,p,"header")),"page"==v.fit&&this.UM(t,M,g,v)),t},UM:function(t,i,e,s){e&&s.trim&&(i.length=e);for(var n=0,h=0;h<i.length;h++)n+=i[h];n>this.nh(s)&&t[0].forEach(function(t){for(var i=0;i<t.length;i++)t[i]&&t[i].style&&t[i].style.width&&(t[i].style.width="auto")})},sh:function(n,h){var r=ft("div");return n.forEach(S(function(t,i){var e=ft("table",{"class":"webix_table_print "+this.$view.className+(h.borderless?" borderless":""),style:"border-collapse:collapse",id:this.$view.getAttribute("id")});if(t.forEach(function(t){var s=ft("tr");t.forEach(function(t){if(!t.$inspan){var i=ft("td");for(var e in i.innerHTML=t.txt,i.className=t.className,t.style)i.style[e]=t.style[e];t.span&&(i.colSpan=t.span.colspan,i.rowSpan=t.span.rowspan),s.appendChild(i)}}),e.appendChild(s)}),r.appendChild(e),i+1<n.length){var s=ft("DIV",{"class":"webix_print_pagebreak"});r.appendChild(s)}},this)),r}},Ar={$exportView:function(t){this.isBranchOpen&&H.extend(t,{filterHTML:!0});var i=t.export_mode;if("pdf"!=i&&"excel"!=i||t.dataOnly||!t.styles)return this;t.dataOnly=!0,t.heights=R(t.heights)?"all":t.heights;var e="pdf"==i?$s(this,t):Bs(this,t);return e[0].styles=this.YM(t),delete t.dataOnly,e},YM:function(t){var u=t.export_mode,c=this.config.columns,f=[];return this.qM=this.qM||{},t.docHeader&&"excel"==u&&(f=[{0:this.GM(t.docHeader.css)},{0:{}}]),!1!==t.header&&(f=this.XM(t,"header",f,u)),this.data.each(function(t){for(var i={},e=0;e<c.length;e++){var s=this.getCss(t.id,c[e].id),n=c[e].node.className,h="",r=null,o=null;if(this.ul&&(r=this.getSpan(t.id,c[e].id))?(o=this.getSpanNode({row:r[0],column:r[1]}),h="webix_dtable_span "+(r[5]||"")):o=this.getItemNode({row:t.id,column:c[e].id}),!o){o=ft("div",{"class":s,style:"visibility:hidden"});var a=c[e].node;c[e].attached||(a=ft("div",{"class":n,style:"visibility:hidden"}),this.st.appendChild(a)),a.appendChild(o)}i[e]=this.JM(o,[s,n,h].join(":"),u)}f[f.length]=i},this),!1!==t.footer&&this.config.footer&&(f=this.XM(t,"footer",f,u)),t.docFooter&&"excel"==u&&(f=f.concat([{0:{}},{0:this.GM(t.docFooter.css)}])),f},XM:function(t,i,e,s){for(var n=this.config.columns,h=[],r=0;r<n[0][i].length;r++){for(var o={},a=0;a<n.length;a++){var u=n[a][i][r];if(u){var c=u.colspan?n[a+u.colspan-1].id:n[a].id,
f="header"==i?this.getHeaderNode(c,r):this.getFooterNode(c,r);if(f){var l=[f.parentNode.className,u.css||"","webix_hcell",i];o[a]=this.JM(f,l.join(":"),s),(u.colspan||u.rowspan)&&h.push([r,a,{colspan:u.colspan-1||0,rowspan:u.rowspan-1||0},o[a]])}}else for(var d=0;d<h.length;d++){var v=h[d][2],_=h[d][1],p=h[d][0];_+v.colspan>=a&&p+v.rowspan>=r&&(o[a]=h[d][3])}}e[e.length]=o}return e},KM:function(t,i,e){return"0px"==t["border-".concat(e,"-width")]?null:Le.rgbToHex(t["border-".concat(e,"-color")])||i},JM:function(t,i,e){if(this.qM[i])return this.qM[i];var s=this.ZM(t),n=Le.rgbToHex(s["background-color"])||"FFFFFF",h={backgroundColor:n,fontSize:.75*s["font-size"].replace("px",""),color:Le.rgbToHex(s.color),textAlign:s["text-align"],borderRightColor:this.KM(s,n,"right"),borderLeftColor:this.KM(s,n,"left"),borderBottomColor:this.KM(s,n,"bottom"),borderTopColor:this.KM(s,n,"top")},r="pdf"==e?h:this.QM(s,t,h);return this.qM[i]=r},GM:function(t){t=H.extend(t||{},{visibility:"hidden","white-space":"nowrap","text-align":"left"});var i="";for(var e in t)i+=e+":"+t[e]+";";var s=ft("div",{style:i});this.st.appendChild(s);var n=this.JM(s,i);return dt(s),n},QM:function(t,i,e){var s={font:{},alignment:{},border:{}};return s.font.name=t["font-family"].replace(/,.*$/,""),s.font.sz=e.fontSize,s.font.color={rgb:e.color},"normal"!==t["font-weight"]&&400!=t["font-weight"]&&(s.font.bold=!0),"underline"===t["text-decoration-line"]&&(s.font.underline=!0),"italic"===t["font-style"]&&(s.font.italic=!0),"line-through"===t["text-decoration-line"]&&(s.font.strike=!0),s.alignment.horizontal=e.textAlign,s.alignment.vertical=t.height==t["line-height"]?"center":"top","normal"==t["white-space"]&&(s.alignment.wrapText=!0),i.firstChild&&i.firstChild.className&&-1!==i.firstChild.className.indexOf("webix_rotate")&&(s.alignment.textRotation=90),s.fill={fgColor:{rgb:e.backgroundColor}},e.borderRightColor&&(s.border.right={style:"thin",color:{rgb:e.borderRightColor}}),e.borderBottomColor&&(s.border.bottom={style:"thin",color:{rgb:e.borderBottomColor}}),e.borderLeftColor&&(s.border.left={style:"thin",color:{rgb:e.borderLeftColor}}),e.borderTopColor&&(s.border.top={style:"thin",color:{rgb:e.borderTopColor}}),s},ZM:function(t){return window.getComputedStyle?window.getComputedStyle(t):t.currentStyle}},Fr={subrow_setter:function(t){return!!t&&(this.tS(),this.P.fixedRowHeight=!1,Yt(t))},subview_setter:function(t){return t&&(this.P.subrow=this.subrow_setter("<div></div>")),t},defaults:{subRowHeight:35},iS:function(){this.data.each(function(t){t&&(t.$sub=this.P.subrow(t,this.type))},this),this.eS()},eS:function(t){if("auto"===this.P.subRowHeight&&this.me&&this.sS(),t&&this.P.subview)for(var i in this.zM){var e=oi(this.zM[i]);e.P.hidden||e.adjust()}},nS:function(t){var i=this.getItem(t);i.$sub=this.P.subrow(i,this.type),"auto"===this.P.subRowHeight&&this.sS(i.id,i.$sub)},$init:function(){this.tS=a(function(){var t="#"+this.hS+" .webix_cell.webix_dtable_subview { line-height:normal;}";this.P.fixedRowHeight&&(t+="#"+this.hS+" .webix_column .webix_cell { white-space: nowrap;}"),ut(t),this.zM={},this.attachEvent("onSubViewRender",this.rS),this.data.attachEvent("onStoreUpdated",S(function(t,i,e){t?"update"==e||"add"==e?this.nS(t):"delete"==e&&i.$subContent&&(oi(i.$subContent).destructor(),delete this.zM[i.$subContent]):this.iS()},this)),this.attachEvent("onResize",function(t,i,e){e!=t&&this.eS(!0)})}),this.type.subrow=function(t){return t.$sub?t.$subopen?"<div class='webix_tree_open webix_sub_open'></div>":"<div class='webix_tree_close webix_sub_close'></div>":"<div class='webix_tree_none'></div>"},this.on_click.webix_sub_open=function(t,i){return this.closeSub(i),!1},this.on_click.webix_sub_close=function(t,i){return this.openSub(i),!1}},openSub:function(t){var i=this.getItem(t);if(!i.$subopen){i.$row=this.P.subrow,i.$subHeight=i.$subHeight||this.P.subRowHeight,i.$subopen=!0;var e=this.zM[i.$subContent];e&&(e.repaintMe=!0),this.refresh(t),this.callEvent("onSubViewOpen",[t])}},getSubView:function(t){var i=this.getItem(t);if(i){var e=this.zM[i.$subContent];if(e)return oi(e)}
return null},resizeSubView:function(t){var i=this.getSubView(t);i&&this.oS(this.getItem(t),i)},oS:function(t,i){var e=i.$getSize(0,0)[2],s=t.$subHeight||this.P.subRowHeight;2<Math.abs(e-(s||0))&&(t.$subHeight=e,this.refresh(t.id))},aS:function(t){var i=t.$width;if(t.Pl){var e=t.ri.length-t.Ul;t.Nl?i-=t.qa.left+t.qa.right+2:i-=t.Xa*(e-1)+t.qa.left+t.qa.right+2*e}return 0<i},rS:function(n,t){var i,e=this.zM[n.$subContent];if(e)t.firstChild.appendChild(e),i=oi(n.$subContent),this.aS(i)||i.adjust(),e.repaintMe&&(delete e.repaintMe,i.config.hidden=!1,i.Me());else{var s,h=this.P.subview;(i="function"==typeof h?h.call(this,n,t.firstChild):((s=_(h)).$scope=this.$scope,si(s,t.firstChild))).getMasterView=S(function(){return this},this),n.$subContent=i.config.id,this.zM[n.$subContent]=i.$view,this.Bt.push(i),i.attachEvent("onResize",S(function(t,i,e,s){i&&i!=s&&this.refresh(n.id)},this)),this.callEvent("onSubViewCreate",[i,n])}this.oS(n,i||oi(e))},sS:function(i,e){var t,s=ft("DIV",{"class":"webix_measure_size webix_cell webix_dtable_subrow"},"");s.style.cssText="width:"+this.me+"px; height:auto; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(s),s.offsetHeight<1&&(t=this.$view.cloneNode(!0),document.body.appendChild(t),t.appendChild(s)),this.data.each(function(t){(t&&!i||t.id==i&&t.$sub)&&(s.innerHTML=e||this.P.subrow(t,this.type),t.$subHeight=s.offsetHeight)},this),s=dt(s),t&&dt(t)},closeSub:function(t){var i=this.getItem(t);if(i.$subopen){i.$row=!1,i.$subopen=!1;var e=this.zM[i.$subContent];e&&(oi(e).config.hidden=!0),this.refresh(t),this.callEvent("onSubViewClose",[t])}}},Tr={spans_setter:function(t){return t&&!this.ul&&this.uS(),t},uS:function(){this.ul={},this.dM=[],this.data.attachEvent("onStoreLoad",S(function(t,i){i&&i.spans&&this.addSpan(i.spans)},this)),this.data.attachEvent("onClearAll",S(function(){this.ul={}},this)),this.attachEvent("onSyncScroll",function(t,i,e){for(var s=0;s<3;s++)Yi.ms(this.dM[s],1==s?t:0,i,e)}),this.attachEvent("onScrollY",this.cS),this.attachEvent("onScrollX",this.cS),this.attachEvent("onAfterRender",this.fS),this.attachEvent("onColumnResize",this.fS),this.attachEvent("onSelectChange",this.lS)},addSpan:function(t,i,e,s,n,h){if("object"!=M(t))s=s||1,e=e||1,this.ul[t]||(this.ul[t]={}),this.ul[t][i]=[e,s,n,h];else for(var r=0;r<t.length;r++)this.addSpan.apply(this,t[r])},removeSpan:function(t,i){arguments.length||(this.ul={});var e=this.ul[t];e&&delete e[i]},getSpan:function(t,i){if(!t)return this.ul;var e,s,n,h,r,o=this.ul;for(t in e=this.getIndexById(t),n=this.getColumnIndex(i),o)for(i in o[t])if(r=o[t][i],s=this.getIndexById(t),0<=(h=this.getColumnIndex(i))&&0<=s&&!(e>s+r[1]-1||e<s||n>h+r[0]-1||n<h))return[t,i].concat(r);return null},fS:function(){var t,i,e=this.rl.length-this.P.rightSplit;for(dt(this.dM),i=0;i<3;i++)t=this.dM[i]=ft("DIV",{"class":"webix_span_layer"}),this.st.childNodes[i].appendChild(t);this.cS(),this.P.leftSplit&&this.dS(this.dM[0],0,this.P.leftSplit),this.P.rightSplit&&this.dS(this.dM[2],e,this.rl.length),this.dS(this.dM[1],this.P.leftSplit,e),this.P.topSplit&&!q.touch&&this.vS()},_S:function(){for(var t,i=0,e=0,s=0,n=0;i<this.P.leftSplit;)e+=this.rl[i].width,i++;for(t=(i=this.rl.length-1)-this.P.rightSplit;t<=i;)n+=this.rl[i].width,i--;for(i=this.P.leftSplit;i<this.rl.length-this.P.rightSplit;i++)s+=this.rl[i].width;return[e,s,n]},vS:function(){var t,i,e,s=this.rl.length-this.P.rightSplit;for(i=3;i<6;i++)t=this.dM[i]=ft("DIV",{"class":"webix_span_layer_top"}),this.st.childNodes[i-3].appendChild(t);e=this._S(),this.P.leftSplit&&(this.dM[3].style.width=e[0]+"px",this.dS(this.dM[3],0,this.P.leftSplit,!0)),this.P.rightSplit&&(this.dM[5].style.width=e[2]+"px",this.dS(this.dM[5],s,this.rl.length,!0)),this.dM[4].style.width=e[1]+"px",this.dS(this.dM[4],this.P.leftSplit,s,!0)},dS:function(t,i,e,s){for(var n=0,h=this.data.$min||0,r=this.data.$max||this.data.order.length,o=h;o<r;o++){var a=this.data.order[o];if(a){var u=this.ul[a];if(u&&(!s||o<this.P.topSplit))for(var c=i;c<e;c++){var f=this.rl[c].id;u[f]&&this.pS(t,o,c,u,n,i,a,f)}
n+=this.fy(this.getItem(a))}}},lS:function(){for(var t=this.config.select,i="cell"==t||"column"==t,e=this.getSelectedId(!0),s=[],n=this.bS||[],h=V()+"",r=!1,o=0;o<e.length;o++){var a=this.ul[e[o]];!a||i&&!a[e[o].column]||(a.$selected&&a.$selected.id==e[o].id||(r=!0),a.$selected=e[o],a.$time=h,s.push(e[o].id))}for(var u=0;u<n.length;u++){var c=this.ul[n[u]];c&&c.$time!==h&&(delete c.$selected,r=!0)}this.bS=[].concat(e),r&&this.fS()},mS:function(t,i){for(var e=0,s=t;s<i;s++){var n=this.rl[s];e+=n?n.width:0}return e},gS:function(t,i){for(var e=0,s=t;s<i;s++){var n=this.getItem(this.data.order[s]);e+=n?this.fy(n):this.P.rowHeight}return e},pS:function(t,i,e,s,n,h,r,o){var a=s[o],u=a[2]||this.getText(r,o),c="";!s.$selected||"row"!==this.P.select&&s.$selected.column!==o||(c="webix_selected ");var f={column:e,row:i,"class":c+"webix_cell webix_table_cell webix_dtable_span "+(a[3]||""),"aria-colindex":e+1,"aria-rowindex":i+1};1<a[0]&&(f["aria-colspan"]=a[0]),1<a[1]&&(f["aria-rowspan"]=a[1]);var l=ft("DIV",f,""+u);l.style.top=n+"px",l.style.left=this.mS(h,e)+"px",l.style.width=this.mS(e,e+a[0])+"px",l.style.height=this.gS(i,i+a[1])+"px",t.appendChild(l)},cS:function(){if(!this.P.prerender)for(var t=this.getScrollState(),i=0;i<3;i++)this.dM[i].style.top="-"+(t.y||0)+"px"},pM:function(t,i){var e,s,n=!1;return this.ul&&(e=this.getSpan(t.row,t.column),s=this.getSpan(i.row,i.column),e&&s&&e[0]==s[0]&&e[1]==s[1]&&(n=!0)),n},getSpanNode:function(t){for(var i=this.dM,e=this.getIndexById(t.row),s=this.getColumnIndex(t.column),n=0;n<i.length;n++)for(var h=i[n].childNodes,r=0;r<h.length;r++)if(h[r].getAttribute("row")==e&&h[r].getAttribute("column")==s)return h[r];return null}},Vr={name:"datatable",defaults:{leftSplit:0,rightSplit:0,topSplit:0,columnWidth:100,sort:!0,prerender:!1,autoheight:!1,autowidth:!1,header:!0,fixedRowHeight:!0,scrollAlignY:!0,scrollX:!0,scrollY:!0,datafetch:50,navigation:!0},$skin:function(){this.defaults.rowHeight=Li.rowHeight,this.defaults.minRowHeight=Li.rowHeight-6,this.defaults.headerRowHeight=Li.barHeight-2*Li.borderWidth,this.defaults.minColumnWidth=2*Li.dataPadding+Li.borderWidth},on_click:{webix_excel_filter:function(){return!1},webix_richfilter:function(){return!1},webix_table_checkbox:function(t,i){i=this.locate(t);var e=this.getItem(i.row),s=this.getColumnConfig(i.column),n=t.target,h=("checkbox"==n.type?n.checked:e[i.column]!=s.checkValue)?s.checkValue:s.uncheckValue,r={};return r[i.column]=h,this.updateItem(i.row,r,this.P.checkboxRefresh?"update":"save"),this.callEvent("onCheck",[i.row,i.column,h]),!1},webix_table_radio:function(t){var e=this.locate(t),i=this.getItem(e.row),s=this.getColumnConfig(e.column);return this.eachRow(function(t){var i=this.data.pull[t];i&&i[e.column]==s.checkValue&&(i[e.column]=s.uncheckValue)}),i[e.column]=s.checkValue,this.callEvent("onCheck",[e.row,e.column,!0]),this.refresh(),!1}},on_dblclick:{webix_table_checkbox:function(){return this.on_click.webix_table_checkbox.apply(this,arguments)}},on_context:{},$init:function(t){this.on_click=H.extend({},this.on_click);this.Wi.innerHTML="<div class='webix_ss_header' section='header'><div class='webix_hs_left'></div><div class='webix_hs_center'></div><div class='webix_hs_right'></div></div><div class='webix_ss_body'><div class='webix_ss_left'><div class='webix_ss_center_scroll'></div></div><div class='webix_ss_center'><div class='webix_ss_center_scroll' role='rowgroup'></div></div><div class='webix_ss_right'><div class='webix_ss_center_scroll'></div></div></div><div class='webix_ss_hscroll' role='scrollbar' aria-orientation='horizontal'></div><div class='webix_ss_footer' section='footer'><div class='webix_hs_left'></div><div class='webix_hs_center'></div><div class='webix_hs_right'></div></div><div class='webix_ss_vscroll_header'></div><div class='webix_ss_vscroll' role='scrollbar' aria-orientation='vertical'></div><div class='webix_ss_vscroll_footer'></div>",this.hS=this.Wi.id=this.name+V(),this.Wi.className+=" webix_dtable",this.tt=this.Wi,this.k=this.Wi.firstChild,this.st=this.k.nextSibling,this.nl=this.st.nextSibling.nextSibling,
this.Vt.setAttribute("role","grid"),t.editable||this.Vt.setAttribute("aria-readonly","true"),this.data.provideApi(this,!0),this.data.attachEvent("onParse",S(this.wS,this)),this.$ready.push(this.xS),this.rl=[],this.xo=[],this.al=[],this.cl=[],this.yS=[],this.Fo={},this.So={},this.MS={},this.SS=[],this.Zo=this.kS=0,this.Bt=[],this.data.attachEvent("onServerConfig",S(this.CS,this)),this.data.attachEvent("onServerOptions",S(this.$S,this)),this.attachEvent("onViewShow",function(){this.n_(),this.DS()}),this.data.attachEvent("onClearAll",S(function(t){t||(this.bh=this._h=0,this.ph&&this.ph.reset(),this.vh&&this.vh.reset(),this.IS(0))},this)),this.attachEvent("onDestruct",this.AS),this.attachEvent("onKeyPress",this.ke),this.attachEvent("onScrollY",this.FS),y("onDataTable",[this,t])},TS:function(){this.xM=this.Fy=q.scrollSize;var t=this.P.headerRowHeight+1;ut("#"+this.hS+" .webix_cell { height:"+this.P.rowHeight+"px; line-height:"+(this.P.rowLineHeight||this.P.rowHeight)+"px;"+(this.P.fixedRowHeight?"":"white-space:normal;")+" }"),ut("#"+this.hS+" .webix_hcell { height:"+t+"px; line-height:"+t+"px;}"),this.TS=function(){}},xS:function(){this.data.attachEvent("onStoreLoad",S(this.DS,this)),this.data.attachEvent("onSyncApply",S(this.DS,this)),this.data.attachEvent("onStoreUpdated",S(function(){return this.render.apply(this,arguments)},this)),this.data.attachEvent("onStoreUpdated",S(this.VS,this)),this.render()},refresh:function(){this.render()},VM:function(){var t=this;clearTimeout(this.zS),this.zS=k(function(){t.zS=0,R(t.BS)||(t.IS(t.BS),delete t.BS),t.render()})},render:function(t,i,e){if("save"!=e&&!this.zS){if(!this.rl.length){var s=this.P.columns;if(!s||!s.length){if(!this.P.autoConfig||!this.data.order.length||this.xo.length)return;this.ko=0,this.HS()}this.AM()}if(!this.isVisible(this.P.id)||this.$blockRender)return this.TS();var n=this.config.experimental&&!this.P.subview;return!t||-1==i||"paint"!=e&&"update"!=e||n?(this.RS&&(clearTimeout(this.RS),this.RS=0),this.callEvent("onBeforeRender",[this.data])?(this.TS(),this.ko||this.FM(),t&&"update"==e||(this.My=this.ES(),this.PS()),this.me&&(n&&("paint"==e||"update"==e)&&t?this.jS(t):this.NS(!0,!0)),this.Vt.setAttribute("aria-colcount",Math.max(this.xo.length,this.rl.length)),this.Vt.setAttribute("aria-rowcount",this.data.count()),this.callEvent("onAfterRender",[this.data]),!0):void 0):(this.RS&&clearTimeout(this.RS),void(this.RS&&this.LS!=t?(this.LS=null,this.RS=k(function(){this.render()},this)):(this.LS=t,this.RS=k(function(){this.render(t,-1,e)},this))))}},getColumnConfig:function(t){return this.ol[t]||this.Co[t]},$S:function(t){for(var i in t){var e=this.getColumnConfig(i),s=new kh({data:t[i]});this.Bt.push(s),this.zu(s,e)}},CS:function(t){this.$u(),t.columns&&this.ko&&this.refreshColumns(null,!0)},AM:function(){if(this.P.columns){this.rl=this.P.columns,this.ol={};for(var t=0;t<this.rl.length;t++){var i=this.rl[t],e=(this.ol[i.id]=i).cssFormat;if(e&&(i.cssFormat=v(e,this.$scope)),i.width=this.OS(i.width||this.P.columnWidth,i),"string"==typeof i.format&&(i.format=I[i.format]||window[i.format]),i.numberFormat){var s=i.numberFormat;"string"==typeof s&&(i.numberFormat=s=nn.getConfig(s)),i.format=nn.numToStr(s),i.editFormat=i.editFormat||function(t){return nn.format(t,s)},i.editParse=i.editParse||function(t){return nn.parse(t,s)}}R(i.checkValue)&&(i.checkValue=1),R(i.uncheckValue)&&(i.uncheckValue=0),i.css&&"object"==M(i.css)&&(i.css=at(i.css));var n=i.template;n&&("string"==typeof n&&(n=n.replace(/#\$value#/g,"#"+i.id+"#")),i.template=Yt(n))}this.WS("header",this.al),this.WS("footer",this.cl),this.callEvent("onStructureLoad",[])}},US:function(){this.FM()},AS:function(){for(var t=0;t<this.rl.length;t++)delete this.rl[t].attached,delete this.rl[t].node},FM:function(){this.hx=this.rl.length-this.P.rightSplit;for(var t=this.YS=0;t<this.rl.length;t++){if(!this.rl[t].node){var i=ft("DIV");i.style.width=this.rl[t].width+"px",this.rl[t].node=i}t>=this.P.leftSplit&&t<this.hx&&(this.YS+=this.rl[t].width)}var e=[];if(this.P.rightSplit){var s=this.rl.length-this.P.rightSplit
;e[s]=" webix_first",e[s-1]=" webix_last"}if(this.P.leftSplit){var n=this.P.leftSplit;e[n]=" webix_first",e[n-1]=" webix_last"}e[0]=(e[0]||"")+" webix_first webix_select_mark";var h=this.rl.length-1;e[h]=(e[h]||"")+" webix_last";for(var r=0;r<this.rl.length;r++){var o=this.rl[r].node;o.setAttribute("column",r),o.className="webix_column "+(this.rl[r].css||"")+(e[r]||"")}this.qS(),this.GS(),this.XS(),this.Ux(),this.ko=!0},GS:function(){for(var t=0,i=0;i<this.rl.length;i++){var e=this.rl[i];i!=this.P.leftSplit&&i!=this.hx||(t=0),e.node&&(e.node.style.left=t+"px",(this.P.leftSplit||this.P.rightSplit)&&(dt(e.node),e.attached=!1)),t+=e.width}},Ux:function(){this.JS||(this.JS=0),this.Zo=this.kS=0,this.P.header&&(this.KS(this.k,0,1),this.WS("header",this.al),this.Zo=this.al.ZS,this.QS(this.k,"header",this.al)),this.P.footer&&(this.KS(this.nl,0,1),this.WS("footer",this.cl),this.kS=this.cl.ZS,this.QS(this.nl,"footer",this.cl)),this.refreshHeaderContent(!1,!1),this.tk();for(var t=0;t<this.SS.length;t++){var i=this.SS[t];this.ik(i,this.MS[i])}},ek:function(t,i,e){var s=0,n=t.colspan||1,h="webix_hcell "+(t.css||"");if(t.rotate)h+=" webix_measure_rotate";else for(var r=0;r<n;r++)s+=this.rl[e+r]?this.rl[e+r].width:this.config.columnWidth;var o=St([t.text],h,s);return(t.rotate?o.width:o.height)+1},WS:function(t,i){for(var e=0,s=i.length=0;s<this.rl.length;s++){var n=this.rl[s][t];n&&"object"==M(n)&&n.length||(R(n)&&(n="header"==t?this.rl[s].id:""),n=[n]);for(var h=0;h<n.length;h++)"object"!=M(n[h])&&(n[h]={text:n[h]}),n[h]&&n[h].height&&(i[h]=Math.max(i[h]||0,n[h].height)),n[h]&&n[h].autoheight&&(i[h]=Math.max(i[h]||0,this.ek(n[h],this.rl[s],s))),n[h]&&n[h].css&&"object"===M(n[h].css)&&(n[h].css=at(n[h].css));e=Math.max(e,n.length),this.rl[s][t]=n}for(var r=(i.ZS=e)-1;0<=r;r--)i[r]=i[r]||this.P.headerRowHeight,i.ZS+=1*i[r];for(var o=0;o<this.rl.length;o++)for(var a=this.rl[o][t],u=0;u<a.length;u++){if(a[u]&&a[u].rowspan)for(var c=1;c<a[u].rowspan;c++)a[u+c]=null;if(a[u]&&a[u].colspan)for(var f=1;f<a[u].colspan;f++)this.rl[o+f][t][u]=null}for(var l=0;l<this.rl.length;l++){var d=this.rl[l][t];if(d.length<e){var v=d.length-1;d[v].rowspan=e-d.length+1;for(var _=v+1;_<e;_++)d[_]=null}}return e},sk:function(t,i){return t.querySelector("DIV[".concat("active_id",'="').concat(i,'"]'))},getHeaderContent:function(t){var i=this.sk(this.k,t);if(i||(i=this.sk(this.nl,t)),i){var e=this.Fo[t],s=wn[e.content],n={type:s,getValue:function(t){return s.getValue(i,t)},setValue:function(t){return s.setValue(i,t)}};return s.getHelper&&H.extend(n,s.getHelper(i,e)),n}},nk:function(t,i,e,s,n){if(t==i)return"";for(var h="",r="",o=this.rl[0][s].length,a=0,u=t;u<i;u++){var c=this.rl[u].width,f=0,l=u==t?"position:static;":"position:absolute; top:".concat(f,"px; left:").concat(a,"px;");h+='<div class="webix_hcolumn" style="'.concat(l,"width:").concat(c,'px;overflow:hidden;">');for(var d=0;d<o;d++){var v=!1,_=this.rl[u][s][d],p=n[d];if(_){_.content&&(_.contentId=_.contentId||V(),_.columnId=this.rl[u].id,_.format=this.rl[u].format,wn[_.content],_.content,_.text=wn[_.content].render(this,_),this.Fo[_.contentId]=_,this.hk=!0);var b="<div row='"+d+"'column='"+(_.colspan?_.colspan-1+u:u)+"'",m="webix_hcell";_.css&&(m+=" "+_.css),this.rl[u].$selected&&(m+=" webix_sel_hcell"),u==t&&(m+=" webix_first"),i-1<=u+(_.colspan?_.colspan-1:0)&&(m+=" webix_last"),(_.rowspan&&d+_.rowspan===o||d===o-1)&&(m+=" webix_last_row");var g="";if(_.contentId&&(b+=" active_id='"+_.contentId+"'"),_.colspan||_.rowspan){var w=this.rk(this.rl,u,_.colspan)||c,x=this.ak(n,d,_.rowspan);x<=0&&(x=p),m+=" webix_span",g=" colspan='".concat(_.colspan||1,"' style='position:absolute; top:").concat(f,"px; left:").concat(a,"px; line-height:").concat(x+1,"px; width:").concat(w,"px; height:").concat(x+1,"px;'"),h+="<div class='webix_hcell' style='border-bottom-color:transparent;border-right-color:transparent;height:".concat(p+1,"px;'></div>"),v=!0}else p!=this.P.headerRowHeight&&(g=" style='line-height:".concat(p+1,"px; height:").concat(p+1,"px;'"));m&&(b+=' class="'+m+'"'),f+=p+1,b+=" "+g+">"
;var y=""===_.text?"&nbsp;":_.text;_.rotate&&(y="<div class='webix_rotate' style='width:"+(p-10)+"px; transform-origin:center "+(p-15)/2+"px;-webkit-transform-origin:center "+(p-15)/2+"px;'>"+y+"</div>"),b+=y+"</div>",v?r+=b:h+=b}else h+="<div class='webix_hcell' style='border-bottom-color:transparent;border-right-color:transparent;height:".concat(p+1,"px;'></div>"),f+=p+1}a+=c,h+="</div>"}return h+r},ak:function(t,i,e){var s=-1;for(e+=i;i<e;i++)s+=t[i]+1;return s},rk:function(t,i,e){var s=0;for(e+=i;i<e;i++)s+=t[i].width;return s},showItemByIndex:function(t,i){var e=this.P.pager;if(e&&t>=this.P.topSplit){var s=Math.floor(t/e.size);s!=e.page&&oi(e.id).select(s)}var n=this.getScrollState();if(t>=this.P.topSplit||this.P.prerender&&-1!=t){var h=this.Qw();if(t<h[0]+1||t>=h[1]-1){var r=this.uk(e?this.data.$min:0,t),o=this.Sy+1,a=this.iy(t);if(t<h[0]+1)r=Math.max(0,r)-(this.ck||0);else if(o<r+a){r+=a-o;for(var u=t;0<u&&0<o;u--)o-=this.iy(u);0<t&&o&&(r+=this.iy(t+1))}else r=n.y;n.y=r}}if(-1!=i){if(i<this.P.leftSplit||i>=this.hx)return this.scrollTo(n.x,n.y);var c=this.Zw();if(i<c[0]+1||i>=c[1]-1){for(var f=0,l=this.P.leftSplit;l<i;l++)f+=this.rl[l].width;var d=this.rl[i].width;i<c[0]+1||(f+d>this.ty?f+=d-this.ty:f=n.x),n.x=f}}this.scrollTo(n.x,n.y)},showCell:function(t,i){if(!i||!t){var e=this.getSelectedId(!0);1==e.length&&(i=i||e[0].column,t=t||e[0].row)}i=i?this.getColumnIndex(i):-1,t=t?this.getIndexById(t):-1,this.showItemByIndex(t,i)},scrollTo:function(t,i){if(this.ph){if(this.xy)return this.xy(t,i);null!==t&&this.ph.scrollTo(t),null!==i&&this.vh.scrollTo(i)}},jo:"touch",getScrollState:function(){if(this.yy)return this.yy();var t=this.Jw?0:this.fk||0;return{x:this.bh||0,y:this._h+t}},showItem:function(t){this.showItemByIndex(this.getIndexById(t),-1)},QS:function(t,i,e){var s=t.childNodes;s[0].innerHTML=this.nk(0,this.P.leftSplit,this.cx,i,e),s[1].innerHTML=this.nk(this.P.leftSplit,this.hx,this.YS,i,e),s[2].innerHTML=this.nk(this.hx,this.rl.length,this.Qx,i,e),this.IM&&(s[1].scrollLeft=this.getScrollState().x),s[1].onscroll=S(this.lk,this)},lk:function(){var t=this.getScrollState().x,i=this.k.childNodes[1].scrollLeft;Math.ceil(i)!=Math.ceil(t)&&this.scrollTo(i,null)},VS:function(){this.refreshHeaderContent(!0,!0)},DS:function(){this.refreshHeaderContent(!1,!0)},refreshHeaderContent:function(t,i,e){this.P.header&&(i&&this.KS(this.k,t,1,e),this.KS(this.k,t,0,e)),this.P.footer&&(i&&this.KS(this.nl,t,1,e),this.KS(this.nl,t,0,e))},refreshFilter:function(t){this.refreshHeaderContent(!1,!0,t)},KS:function(t,i,e,s){if(this.hk&&t)for(var n=t.querySelectorAll("".concat("DIV","[").concat("active_id","]")),h=0;h<n.length;h++){var r=n[h].getAttribute("active_id");if(r){var o=this.Fo[r];if(s&&s!=o.columnId)continue;var a=wn[o.content];e?a.getValue&&(o.value=a.getValue(n[h])):i&&!a.trackCells||a.refresh(this,n[h],o)}}},headerContent:[],dk:function(t,i,e){if(this.Fy){if(t.style.height=Math.max(i,1)-1+"px",t.style.width=(this.hx?0:e)+this.Fy-1+"px",q.isWebKit)t.offsetWidth}else t.style.display="none"},tk:function(){this.P.header&&this.dk(this.vk,this.Zo,this.JS),this.P.footer&&this.dk(this._k,this.kS,this.JS)},Ph:function(){var t=!(this.P.autowidth||!1===this.P.scrollX);this.xM=t?q.scrollSize:0;var i=!(this.P.autoheight||!1===this.P.scrollY);this.Fy=i?q.scrollSize:0,q.touch&&(t=i=!1),this.ph&&(this.ph.P.scrollSize=this.xM,this.ph.P.scrollVisible=t),this.vh&&(this.vh.P.scrollSize=this.Fy,this.vh.P.scrollVisible=i)},qS:function(){var t,i;if(this._h=0,this.bh=0,t=i=1,(this.P.autoheight||!1===this.P.scrollY)&&(i=this.Fy=0),(this.P.autowidth||!1===this.P.scrollX)&&(t=this.xM=0),q.touch&&(t=i=0),this.ph||(this.ph=si({view:"vscroll",container:this.nl.previousSibling,scrollWidth:this.YS,scrollSize:this.xM,scrollVisible:t}),!t||this.xM||q.$customScroll||(this.ph.Vt.style.position="absolute"),this.ph.attachEvent("onScroll",S(this.pk,this))),!this.vh){this.vk=this.nl.nextSibling;var e=this.vk.nextSibling;this._k=e.nextSibling,this.vh=si({view:"vscroll",container:e,scrollHeight:100,scroll:"y",scrollSize:this.Fy,scrollVisible:i}),this.vh.activeArea(
this.st),this.ph.activeArea(this.st,!0),this.vh.attachEvent("onScroll",S(this.bk,this))}this.me&&this.callEvent("onResize",[this.me,this.we]),q.$customScroll&&re.enable(this),this.qS=function(){}},columnId:function(t){return this.rl[t].id},getColumnIndex:function(t){for(var i=0;i<this.rl.length;i++)if(this.rl[i].id==t)return i;return-1},mk:function(t,i){var e,s=0,n=0,h=0,r=0,o=0;for(e=0;e<this.rl.length&&(this.hx!=e&&this.P.leftSplit!=e||(s=0,o++),this.rl[e].id!=i);e++)s+=this.rl[e].width;for(n+=this.rl[e].width,e=0;e<this.data.order.length&&this.data.order[e]!=t;e++)r+=this.iy(e);return h+=this.iy(e),[s,n,r-this._h,h,this.st.childNodes[o]]},Hx:function(){return this.row},locate:function(t,i){if(this!=oi(t))return null;for(t=t.target||t;t&&t.getAttribute&&t!==this.$view;){var e=Ct(t).toString(),s=null;if(-1!=e.indexOf("webix_cell")&&(s=this.Vs(t))&&(s.row=this.data.order[s.rind]),-1!=e.indexOf("webix_hcell")&&(s=this.Vs(t))&&(s.header=!0),-1!=e.indexOf("webix_drop_area")&&(s=this.Vs(t))&&(s.row=s.rind="$webix-drop"),s)return i?s.header?null:s.row:(s.column=this.rl[s.cind].id,s.toString=this.Hx,s);t=t.parentNode}return null},Vs:function(t){var i=t.parentNode;if(!i)return null;var e=1*(t.getAttribute("column")||i.getAttribute("column")),s=t.getAttribute("aria-rowindex");return{rind:t.getAttribute("row")||(s?s-1:0),cind:e,span:1*(t.getAttribute("colspan")||i.getAttribute("colspan"))}},Cy:function(){for(var t=-this.ty,i=0;i<this.rl.length;i++)t+=this.rl[i].width;this.bh=Math.min(this.bh,Math.max(0,t))},Io:function(t){this.ko&&(this.Cy(),this.GS(),this.XS(),this.Ux(),this.PS(),t||this.NS(!1,!1))},setColumnWidth:function(t,i,e){return this.Do(this.getColumnIndex(t),i,e)},Do:function(t,i,e,s){if(!(isNaN(i)||t<0)){var n=this.rl[t];i=this.OS(i,n);var h=n.width;return h!=i&&(t>=this.P.leftSplit&&t<this.hx&&(this.YS+=i-h),n.width=i,!!n.node&&(n.node.style.width=i+"px",e||this.Io(),this.callEvent("onColumnResize",[n.id,i,h,!!s]),!0))}},OS:function(t,i){return t=Math.max(t,i.minWidth||this.P.minColumnWidth||0),t=Math.min(t,i.maxWidth||this.P.maxColumnWidth||1e5)},fy:function(t){return(t.$height||this.P.rowHeight)+(t.$subopen?t.$subHeight:0)},iy:function(t){var i=this.data.order[t];return i?this.fy(this.data.pull[i]):this.P.rowHeight},uk:function(t,i){if(this.P.fixedRowHeight)return Math.max(i-t,0)*this.P.rowHeight;for(var e=0;t<i;t++)e+=this.iy(t);return e},at:function(t,i,e){t.row&&(i=t.column,t=t.row);var s=this.getColumnConfig(i).width,n=this.getItem(t).$height||this.P.rowHeight;if(this.config.spans&&e){var h=this.getSpan(t,i);if(h){var r=this.getSpanNode({row:h[0],column:h[1]});s=r.offsetWidth,n=r.offsetHeight}}for(var o=0,a=0,u=0;u<this.rl.length;u++){u!=this.P.leftSplit&&u!=this.hx||(o=0);var c=this.rl[u];if(c.id==i){var f=u<this.P.leftSplit?0:u>=this.hx?2:1;a=this.st.childNodes[f].firstChild;break}o+=c.width}var l,d=this.getIndexById(t);if(d<this.P.topSplit)l=this.uk(0,d);else{var v=this.ix||0;l=this.uk(v,d)+(this.Jw||0)+(v<=d&&this.ck||0)}return{parent:a,top:l,left:o,width:s,height:n}},ES:function(){var t=this.P.pager,i=0,e=this.data.order.length;return t&&(i=t.size*t.page,e=Math.min(e,i+t.size),t.level&&(i=this.data.$min,e=this.data.$max)),this.uk(i,e)},setRowHeight:function(t,i){if(!isNaN(i)){i=Math.max(i,this.P.minRowHeight||0),i=Math.min(i,this.P.maxRowHeight||1e5);var e=this.getItem(t),s=e.$height||this.P.rowHeight;s!=i&&(e.$height=i,this.config.fixedRowHeight=!1,this.render(),this.callEvent("onRowResize",[t,i,s]))}},bk:function(t){var i=this._h!==t;if(this._h=t,this.P.prerender)for(var e=this.st.childNodes,s=0;s<e.length;s++)e[s].scrollTop=t;else this.NS();q.$customScroll&&re.Ph(this.st),i&&(this.callEvent("onScrollY",[]),this.callEvent("onAfterScroll",[]))},IS:function(t){this.st.childNodes[1].scrollLeft=this.bh=t,this.P.header&&(this.k.childNodes[1].scrollLeft=t),this.P.footer&&(this.nl.childNodes[1].scrollLeft=t)},pk:function(t){var i=this.bh!==t;this.zS?this.BS=t:this.IS(t),!1===this.P.prerender&&this.NS(!this.gk),q.$customScroll&&re.Ph(this.st),i&&(this.callEvent("onScrollX",[]),this.callEvent("onAfterScroll",[]))
},Zw:function(t){if(t)return[0,this.rl.length];for(var i=this.bh,e=this.P.leftSplit;0<i&&this.rl.length-1>e;)i-=this.rl[e].width,e++;var s=e;for(i&&0<e&&e--,i+=this.ty;0<i&&s<this.hx;)i-=this.rl[s].width,s++;return[e,s]},getVisibleCount:function(){return Math.floor(this.Sy/this.config.rowHeight)},Qw:function(t){var i=this._h,e=0,s=this.count(),n=this.P.pager;n&&(e=n.page*n.size,s=Math.min(s,e+n.size),n.level&&(e=this.data.$min,s=this.data.$max));var h=e+this.P.topSplit;if(t||this.P.autoheight)return[h,s,0];var r=this.P.fixedRowHeight?this.P.rowHeight:0;if(r){var o=Math.ceil(i/r);i-=o*r,h+=o}else for(;0<i;)i-=this.iy(h),h++;var a=0<h&&i?-(this.iy(h-1)+i):0,u=h;if(i&&h--,i+=(this.Sy||this.we)-(this.ck||0),r){var c=Math.ceil(i/r);i-=c*r,u+=c}else for(;0<i&&u<s;)i-=this.iy(u),u++;return s<u&&(u=s),[h,u,a]},jS:function(t){var i=this.getItem(t),e=this.getIndexById(t),s=this.Qw(),n=this.P.topSplit,h="";if(n<=e){if(e<s[0]||e>=s[1])return;e-=s[0]-n}else h=e==n-1?" webix_topcell webix_last_topcell":" webix_topcell";for(var r=this.Zw(),o=0;o<this.rl.length;o++){var a=this.rl[o];if(o<this.hx&&o>=this.P.leftSplit&&(o<r[0]||o>r[1])&&(a.vM=-999),a.attached&&a.node){var u=a.node.childNodes[e];if(!u)continue;var c=this.Vy(i,this.rl[o],0);u.innerHTML=c,u.className=this.wk(this.rl[o],c,i,t)+h}}},NS:function(t,i){if(this.rl.length&&!this.zS){i&&this.xk();var e=this.Zw(this.P.prerender),s=this.Qw(!0===this.P.prerender);if(t){for(var n=this.P.leftSplit;n<e[0];n++)this.$M(n,i);for(var h=e[1];h<this.hx;h++)this.$M(h,i)}this.Kw=[];for(var r=0;r<this.P.leftSplit;r++)this.yk(r,s,i);for(var o=e[0];o<e[1];o++)this.yk(o,s,i,o==e[0]);for(var a=this.hx;a<this.rl.length;a++)this.yk(a,s,i);this.Mk(s[0],s[1],i),this.Sk(s)}},kk:function(t,i){this.Ck=t,this.$k=i,dt(this.yS),this.yS=[]},FS:function(){if(this.P.prerender&&this.Dk){var t=this.getScrollState();this.Dk.style.top="-"+(t.y||0)+"px"}},Mk:function(t,i,e){if(this.Dk&&(this.Dk.style.top=this.Jw+"px"),e||t!=this.Ck||i!=this.$k){if(this.kk(t,i),this.Ik){this.Ik=!1;for(var s=0;s<this.Kw.length;s++){var n,h=this.Kw[s],r=this.getItem(h.id);n="function"==typeof r.$row?r.$row.call(this,r,this.type):this.Vy(r,this.getColumnConfig(r.$row),s);var o=this.yS[s]=ft("DIV",null,n);o.className="webix_cell "+(r.$sub?"webix_dtable_sub"+(this.P.subview?"view":"row"):"webix_dtable_colrow"+(r.$row?" webix_topcell"+(this.data.getMark(r.id,"webix_selected")?" webix_selected":""):"")),o.setAttribute("column",0),o.setAttribute("row",h.index);var a=r.$height||this.P.rowHeight;r.$subopen?o.style.height=r.$subHeight+"px":o.style.height=a+"px",o.style.paddingRight=q.scrollSize+"px";var u=this.Kw[s].index<this.config.topSplit?-this.Jw:0;o.style.top=u+h.top+(r.$subopen?a-1:0)+"px",this.Dk||(this.Dk=ft("DIV"),this.Dk.style.position="relative",this.Dk.style.top=this.Jw+"px",this.st.appendChild(this.Dk)),this.Dk.appendChild(o),this.attachEvent("onSyncScroll",function(t,i,e){Yi.ms(this.Dk,0,i,e)}),this.P.subview&&this.callEvent("onSubViewRender",[r,o])}}}else if(this.config.topSplit)for(var c=0;c<this.Kw.length;c++){var f=this.yS[c];this.Kw[c].index<this.config.topSplit&&(f.style.top=this.Kw[c].top-this.Jw+"px")}},Sk:function(t){var i=this.P.pager,e=this.P.datafetch,s=!this.Ak||t[0]>=this.Ak;if(this.Ak=t[0],this.Fk){if(i&&(!e||e>=i.size)&&this.Tk([0,i.size*i.page],Math.max(e,i.size),!0))return this.Fk=null;this.hl(this.Fk,s),this.Fk=null}else this.P.loadahead&&this.Tk(t,this.P.loadahead,s)},Tk:function(t,i,e){var s=t[1],n=s+i;e||(s=t[0]-i,n=t[0]),s<0&&(s=0),n=Math.min(n,this.data.order.length-1);for(var h=!1,r=s;r<n;r++)this.data.order[r]||(h?(h.last=r,h.count=r-s):h={start:r,count:n-s});if(h)return this.hl(h,e),!0},hl:function(t,i){var e=Math.max(t.count,this.P.datafetch||this.P.loadahead||0),s=i?t.start:t.last-e+1;this.mo(t.count,t.start)||this.loadNext(e,s)},Vk:function(t){if(q.isSafari){var i,e,s,n,h=[this.ph,this.vh];for(i=0;i<2;i++)(n=h[i])&&n.Dw&&n.Dw.parentNode==t&&(e=n.Dw);e&&(this.zk&&dt(this.zk),s=(this.zk=e).cloneNode(!0),e.parentNode.insertBefore(s,e),this.zk.style.display="none",this.st.appendChild(this.zk))}},
$M:function(t){var i=this.rl[t];this.Vk(i.node),dt(i.node),i.attached=!1},xk:function(){for(var t=0;t<this.rl.length;t++)this.rl[t].vM=-1;this.yS.length&&(dt(this.yS),this.yS=[])},getText:function(t,i){return this.Vy(this.getItem(t),this.getColumnConfig(i),0)},getCss:function(t,i){var e=this.getItem(t);return this.wk(this.getColumnConfig(i),e[i],e,t)},wk:function(t,i,e,s){var n="webix_cell";if(t.cssFormat){var h=t.cssFormat(i,e,s,t.id);h&&("object"==M(h)?n+=" "+at(h):n+=" "+h)}var r=e.$css;r&&("object"==M(r)&&(e.$css=r=at(r)),n+=" "+r);var o=this.data.Dr[s];if(o&&(o.$css&&(n+=" "+o.$css),o.$cellCss)){var a=o.$cellCss[t.id];a&&(n+=" "+a)}if(e.$cellCss){var u=e.$cellCss[t.id];u&&("object"==M(u)&&(u=at(u)),n+=" "+u)}var c=this.data.getMark(e.id,"webix_selected");return(c&&(c.$row||c[t.id])||t.$selected)&&(n+=this.Dx),n},Vy:function(t,i,e){return t?((s=t[i.id])!==undefined&&null!==s||(s=""),i.format&&(s=i.format(s)),i.template&&(s=i.template(t,this.type,s,i,e)),s):"";var s},type:{checkbox:function(t,i,e,s){return"<input class='webix_table_checkbox' type='checkbox' "+(e==s.checkValue?'checked="true"':"")+">"},radio:function(t,i,e,s){return"<input class='webix_table_radio' type='radio' "+(e==s.checkValue?'checked="true"':"")+">"},editIcon:function(){return"<span class='webix_icon wxi-pencil'></span>"},trashIcon:function(){return"<span class='webix_icon wxi-trash'></span>"}},type_setter:function(t){return this.types&&this.types[t]?(this.type=l(this.types[t]),this.type.css&&(this.Wi.className+=" "+this.type.css)):ti(this,t),this.type.on_click&&H.extend(this.on_click,this.type.on_click),t},yk:function(t,i,e,s){var n=this.rl[t];if(!n.attached){var h=t<this.P.leftSplit?0:t>=this.hx?2:1;this.st.childNodes[h].firstChild.appendChild(n.node),n.attached=!0,n.split=h}if(this.ix=i[0],this.Jw=0,this.fk=i[2],this.P.scrollAlignY?i[1]==this.data.order.length||this.data.$pagesize&&i[1]%this.data.$pagesize==0?n.node.style.top=(this.Jw=i[2])+"px":n.Bk&&(n.node.style.top="0px"):(this.Jw=i[2],n.node.style.top=i[2]+"px"),!(e||n.vM!=i[0]||n._M!=i[1]||this.P.topSplit&&n.Jw!=this.Jw))return 0;for(var r="",o=this.P.columns[t],a={row:this.P.rowHeight,total:0,single:s},u=0;u<this.P.topSplit;u++)r+=this.Hk(u,o,i,a,-this.Jw,t);this.Fk=null;for(var c=Math.max(i[0],this.P.topSplit);c<i[1];c++)r+=this.Hk(c,o,i,a,-1,t);return this.Vk(n.node),n.node.innerHTML=r,n.vM=i[0],n._M=i[1],n.Bk=i[2],n.Jw=this.Jw,1},Hk:function(t,i,e,s,n,h){var r=this.data.order[t],o=this.data.getItem(r),a="";if(o){var u=" role='gridcell' aria-rowindex='"+(t+1)+"' aria-colindex='"+(this.getColumnIndex(i.id)+1)+"'"+(o.$count||o.$sub?" aria-expanded='"+(o.open||o.$subopen?"true":"false")+"'":"")+(o.$level?" aria-level='"+o.$level+"'":"");if(s.single&&o.$row&&(this.Ik=!0,this.Kw.push({top:s.total,id:o.id,index:t}),!o.$sub)){var c=o.$height||s.row;return s.total+=c,"<div"+u+" class='webix_cell' style='height:"+c+"px;'></div>"}var f=this.Vy(o,i,t),l=this.wk(i,f,o,r),d=" aria-selected='true' tabindex='0'";if(-1!==l.indexOf("select"))if(-1!==l.indexOf("row"))this.Zw()[0]===h&&(u+=d);else-1!==l.indexOf("col")?t===e[0]&&(u+=d):u+=d;var v=!!o.$subopen,_=v?"margin-bottom:"+o.$subHeight+"px;":"";0<=n&&(0<n&&(_+="top:"+n+"px;'"),l="webix_topcell "+l,t==this.P.topSplit-1&&(l="webix_last_topcell "+l)),o.$height?(a="<div"+u+" class='"+l+"' style='height:"+o.$height+"px;"+_+"'>"+f+"</div>",s.total+=o.$height-s.row):a="<div"+u+" class='"+l+"'"+(_?" style='"+_+"'":"")+">"+f+"</div>",v&&(s.total+=o.$subHeight)}else a="<div role='gridcell' class='webix_cell'></div>",this.Fk?this.Fk.last=t:this.Fk={start:t,count:e[1]-t};return s.total+=s.row,a},PS:function(){if(this.rl.length&&!isNaN(1*this.we)){var t=this.My+(this.xM?this.xM:0);if(!this.P.autoheight&&!this.P.yCount||!this.resize()){this.vh.sizeTo(this.we,this.Zo,this.kS),this.vh.define("scrollHeight",t),this.ck=this.P.topSplit?this.uk(0,this.P.topSplit):0,this.Sy=Math.max(0,this.we-this.xM-this.Zo-this.kS);for(var i=0;i<3;i++)this.st.childNodes[i].style.height=this.Sy+"px",
this.P.prerender?this.st.childNodes[i].firstChild.style.height=this.My+"px":this.st.childNodes[i].firstChild.style.height=this.Sy+"px";this.k.style.height=this.Zo+"px"}}},XS:function(){if(this.rl.length){var t=0;for(this.cx=0,this.Qx=0,this.ty=0;t<this.P.leftSplit;)this.cx+=this.rl[t].width,t++;for(t=this.rl.length-1;t>=this.hx;)this.Qx+=this.rl[t].width,t--;if(this.me&&(!this.P.autowidth||!this.resize())){this.ty=this.me-this.Qx-this.cx-this.Fy,this.st.childNodes[1].firstChild.style.width=this.YS+"px",this.st.childNodes[0].style.width=this.cx+"px",this.st.childNodes[1].style.width=this.ty+"px",this.st.childNodes[2].style.width=this.Qx+"px",this.k.childNodes[0].style.width=this.cx+"px",this.k.childNodes[1].style.width=this.ty+"px",this.k.childNodes[2].style.width=this.Qx+"px",this.nl.childNodes[0].style.width=this.cx+"px",this.nl.childNodes[1].style.width=this.ty+"px",this.nl.childNodes[2].style.width=this.Qx+"px";var i=this.ty-this.YS;if(i<0&&(i=0),i!=this.JS&&(this.JS=i,this.tk()),q.isWebKit){this.st.childNodes[0].offsetWidth;this.st.childNodes[1].offsetWidth,this.st.childNodes[1].firstChild.offsetWidth,this.st.childNodes[2].offsetWidth}this.ph.sizeTo(this.me-this.Fy),this.ph.define("scrollWidth",this.YS+this.cx+this.Qx)}}},$getSize:function(t,i){if((this.P.autoheight||this.P.yCount)&&this.P.columns){var e=(this.P.yCount||0)*this.P.rowHeight;e||(e=this.isVisible()?this.My:this.count()*this.P.rowHeight),this.P.height=Math.max(e+(this.xM?this.xM:0)-1,this.P.minHeight||0)+this.Zo+this.kS}this.P.autowidth&&this.P.columns&&(this.P.width=Math.max(this.YS+this.cx+this.Qx+this.Fy,this.P.minWidth||0));var s=this.cx+this.Qx+this.Fy,n=Hi.api.$getSize.call(this,t,i);return n[0]=Math.max(n[0]||s),n},n_:function(){if(this.ph&&!q.touch){var t=this.getScrollState();this.ph.config.scrollPos=this.vh.config.scrollPos=0,this.scrollTo(t.x,t.y)}},$setSize:function(){var t=this.me,i=this.we;Hi.api.$setSize.apply(this,arguments)&&(this.ko&&(this.callEvent("onResize",[this.me,this.we,t,i]),this.XS(),this.PS()),this.render())},Rk:function(t,i){var e=this.getColumnConfig(t);if(this.P.sort&&e.sort){var s="asc";this.Mo[e.id]&&(s="asc"==this.Mo[e.id].dir?"desc":"asc"),this.Ao(e.id,s,e.sort,i.ctrlKey||i.metaKey)}},markSorting:function(t,i,e){if(i=i||"asc",!e)for(var s in this.SS=[],this.MS)if(s!==t){var n=this.MS[s].parentNode;n&&(n.removeAttribute("aria-sort"),n.removeAttribute("tabindex")),dt(this.MS[s]),delete this.MS[s]}else this.SS.push(s),this.MS[s].firstChild.innerHTML="1";if(t){if(this.MS[t])this.MS[t].className="webix_ss_sort_".concat(i);else{var h=ft("div",{webix_sort_dir:i,"class":"webix_ss_sort_".concat(i)},'<div class="webix_ss_sort_num">'.concat(this.SS.length+1,"</div>"));this.ik(t,h,i),this.MS[t]=h,this.SS.push(t)}var r=this.MS[this.SS[0]];switch(this.SS.length){case 1:yt(r,"webix_ss_sort_single");break;case 2:Mt(r,"webix_ss_sort_single")}}},ik:function(t,i,e){e=e||i.getAttribute("webix_sort_dir");var s=this.Ek(this.getColumnIndex(t));s&&("absolute"!=s.style.position&&(s.style.position="relative"),s.appendChild(i),s.setAttribute("aria-sort",e+"ending"),s.setAttribute("tabindex","0"))},scroll_setter:function(t){return"string"==typeof t?(this.P.scrollX=-1!=t.indexOf("x"),this.P.scrollY=-1!=t.indexOf("y"),t):this.P.scrollX=this.P.scrollY=t},Ek:function(t){for(var i=this.k.querySelectorAll("div[".concat("column",'="').concat(t,'"]')),e=null,s=0;s<i.length;s++){var n=i[s].getAttribute("active_id");if(n&&!wn[this.Fo[n].content].$icon)return null;if(i[s].innerHTML&&(e=i[s],(i[s].colSpan||0)<2))return e}return e},yo:[],Mo:{},Ao:function(t,i,e,s){var n=this;i=i||"asc",(s="multi"===this.P.sort&&s)||(this.yo=[],this.Mo={});var h=this.getColumnConfig(t),r="function"==typeof h.sort?{as:h.sort,dir:i}:{by:h.id,dir:i,as:h.sort};if(this.Mo[h.id]||this.yo.push(h.id),this.Mo[h.id]=r,"server"==e){var o=[h.id,i,e];1<this.yo.length&&(o=[this.yo.map(function(t){return n.Mo[t]})]),this.callEvent("onBeforeSort",o),this.loadNext(0,0,0,0,1).then(function(t){n.clearAll(!0),n.parse(t),n.callEvent("onAfterSort",o)})}else{if("text"==e){var a="$text_"+h.id
;this.data.each(function(t){t[a]=this.getText(t.id,h.id)},this),r.as="string",r.by=a}1<this.yo.length?this.data.sort(this.yo.map(function(t){return n.Mo[t]})):this.data.sort(r)}this.markSorting(h.id,r.dir,s)},Pk:function(t,i,e,s){var n;if(t.length)for(n=0;n<t.length;n++)if(!1===v(t[n],this.$scope).call(this,i,e,s))return!1},Gu:function(t,i,e,s){var n=(t=t||event).target;if(!this.P.subview||this==oi(n)){for(var h="",r=[],o=!1,a=null;n&&n.parentNode&&n!=this.Vt.parentNode;){if(h=Ct(n))for(var u=(h=h.toString().split(" ")).length-1;0<=u;u--)i[h[u]]&&r.push(i[h[u]]);if(n.parentNode.getAttribute&&!a){var c=n.parentNode.getAttribute("column")||n.getAttribute("column");if(c){var f=this.st.contains(n);if(!this.rl[c])return;if(o=!0,f){var l=n.parentNode.getAttribute("row")||n.getAttribute("row");if(!l){if(n.getAttribute("column"))return;if((l=ot(n))>=this.P.topSplit)(this.P.pager||!this.P.prerender&&!this.P.autoheight)&&(l+=this.rl[c].vM-this.P.topSplit)}this.Pu=a={row:this.data.order[l],column:this.rl[c].id},a.toString=this.Hx}else this.Pu=a={column:this.rl[c].id};if(!1===this.Pk(r,t,a,n))return;if(f)this.callEvent("on"+e,[a,t,n])&&s&&this.callEvent("on"+s,[a,t,n]);else if("ItemClick"==e){this.k.contains(n)&&this.callEvent("onHeaderClick",[a,t,n])&&this.Rk(a.column,t)}r=[]}}n=n.parentNode}return this.Pk(r,t,a,this.$view),o}},Fe:function(t,i){var e=this.locate(i);if(!e)return null;var s,n=ai.Nt;if(e.header){for(var h,r=i.target,o=r,a=e.cind-(e.span?e.span-1:0),u=-1;o&&!h;)h=(o=o.parentNode).getAttribute("section");for(;r&&u<0;){var c=r.getAttribute("row");c&&(u=c),r=r.parentNode}var f=this.rl[a][h][u];if(!f.tooltip)return null;n.type.template=Yt(!0===f.tooltip?"#text#":f.tooltip),s=f}else{var l=n.type.column=this.getColumnConfig(e.column);if(!l.tooltip&&l.tooltip!==undefined)return null;if(!0===l.tooltip||!l.tooltip&&R(this.P.tooltip.template))s=this.getText(e.row,e.column).toString();else if(l.tooltip){var d=i.target.getAttribute("webix_area");n.type.template=d?function(t,i){var e=t[l.id];return Yt(l.tooltip).call(this,t,i,e[d],d)}:Yt(l.tooltip)}else n.type.template=Yt(this.P.tooltip.template)}return s!==undefined?s:this.getItem(e.row)},$tooltipOut:function(){return ai.Yt(),delete ai.Nt.type.column,null},showOverlay:function(t){if(!this.jk){var i=ft("DIV",{"class":"webix_overlay"},"");this.st.appendChild(i),this.jk=i}this.jk.innerHTML=t},hideOverlay:function(){this.jk&&(dt(this.jk),this.jk=null)},mapCells:function(t,i,e,s,n,h){if(null===t&&0<this.data.order.length&&(t=this.data.order[0]),null===i&&(i=this.columnId(0)),null===e&&(e=this.data.order.length),null===s&&(s=this.P.columns.length),this.exists(t)&&(t=this.getIndexById(t),null!==(i=this.getColumnIndex(i))))for(var r=0;r<e&&t+r<this.data.order.length;r++){var o=t+r,a=this.data.order[o];if(a)for(var u=this.getItem(a),c=0;c<s&&i+c<this.P.columns.length;c++){var f=i+c,l=this.columnId(f),d=n(u[l],a,l,r,c);h||(u[l]=d)}}},wS:function(t,i){!this.P.columns&&t.getConfig&&this.define("columns",t.getConfig(i))},HS:function(){var t=this.getItem(this.getFirstId()),i=this.P.columns=[];for(var e in t)"id"!=e&&"$"!=e[0]&&i.push({id:e,header:e[0].toUpperCase()+e.substr(1),sort:"string",editor:"text"});i.length&&(i[0].fillspace=!0),"undefined"==typeof this.P.select&&this.define("select","row")}},zr={api:Vr,view:H.protoUI(Vr,_r,pe,hs,ae,Se,Te,Re,he,Ir,ps,{clearValidation:function(){for(var t in this.data.Dr)this.Nk(t);this.data.clearMark("webix_invalid",!0)},nr:function(t,i){for(var e in this.Nk(t),i)this.addCellCss(t,e,"webix_invalid_cell");this.addCss(t,"webix_invalid")},Qh:function(t){this.Nk(t),this.removeCss(t,"webix_invalid")},Nk:function(t){var i=this.data.getMark(t,"$cellCss");if(i)for(var e in i)i[e]=i[e].replace("webix_invalid_cell","").replace("  "," ")},addRowCss:function(t,i,e){this.addCss(t,i,e)},removeRowCss:function(t,i,e){this.removeCss(t,i,e)},addCellCss:function(t,i,e,s){var n=this.data.getMark(t,"$cellCss"),h=n||{},r=h[i]||"";h[i]=r.replace(e,"").replace("  "," ")+" "+e,n||this.data.addMark(t,"$cellCss",!1,h,!0),s||this.refresh(t)},removeCellCss:function(t,i,e,s){
var n=this.data.getMark(t,"$cellCss");if(n){var h=n[i]||"";h&&(n[i]=h.replace(e,"").replace("  "," ")),s||this.refresh(t)}}},Ar,be,Dr,Cr,kr,Sr,yr,Mr,xr,wr,gr,Fr,mr,br,pr,{topSplit_setter:function(t){return this.data&&(this.data.$freeze=t),t},freezeRow:function(t,i){var r=this.P.topSplit,e=this.data.order,s=this.data.Ir;function n(t,i,e,s,n){var h;if(e&&r<=t){for(n||r++,h=t;r<=h;h--)s[h]=s[h-1];s[r-1]=i}if(!e&&t<r){for(n||r--,h=t;h<r;h++)s[h]=s[h+1];s[r]=i}}t?(n(this.getIndexById(t),t=t.toString(),i,e),s&&n(s.find(t),t,i,s,!0)):i||(r=0),this.define("topSplit",r),this.refresh()}},Tr,Pi,De,oe,_e,ze,Ve,Hi.view,g,Si)},Br={name:"excelviewer",$init:function(){var t=this;this.$ready.push(function(){this.P.toolbar&&oi(this.P.toolbar).attachEvent("onExcelSheetSelect",S(this.showSheet,this))}),this.data.attachEvent("onClearAll",function(){delete t.Lk})},defaults:{datatype:"excel"},$onLoad:function(t){if(t.sheets){this.Ok=t,this.P.toolbar&&oi(this.P.toolbar).setSheets(t.names);var i=t.names[0];return this.showSheet(i.id||i),!0}return!1},$exportView:function(t){var i=t.export_mode;if("pdf"!=i&&"excel"!=i||t.dataOnly)return this;!0===t.sheets?t.sheets=this.getSheets().map(function(t){return t.id||t}):t.sheets&&t.sheets.length?"string"==typeof t.sheets&&(t.sheets=[t.sheets]):t.sheets=[this.Lk],t.dataOnly=!0,t.heights=R(t.heights)&&t.styles?"all":t.heights;for(var e=[],s=this.Lk,n=0;n<t.sheets.length;n++){var h=t.sheets[n],r=h.id||h,o=h.options?H.extend(_(h.options),t):_(t);o.name||(o.name=r),this.showSheet(r),r!=s&&(o.It=!0),"pdf"==i&&R(o.textBefore)&&(o.textBefore=o.name);var a="pdf"==i?$s(this,o):Bs(this,o);o.styles&&(a[0].styles=this.YM(o)),"pdf"==i&&t.autowidth&&Ts(o,t),e=e.concat(a)}return this.showSheet(s),delete t.dataOnly,e},showSheet:function(t){if(t!=this.Lk){this.clearAll();var i=this.data.driver.sheetToArray(this.Ok.sheets[t],{spans:this.P.spans}),e=this.P.excelHeader,s={},n={};if(i.sizes)for(var h=0;h<i.sizes.length;h++)"column"==i.sizes[h][0]?s[i.sizes[h][1]]=Math.round(i.sizes[h][2]):"row"==i.sizes[h][0]&&(n[i.sizes[h][1]]=Math.round(i.sizes[h][2]));if(e)if(!0===e){e=i.data.splice(0,1)[0];for(var r=0;r<e.length;r++)e[r]={header:e[r],id:"data"+r,width:s[r],adjust:!s[r],editor:"text",sort:"string"}}else e=_(e);else{e=_(i.data[0]);for(var o=0;o<e.length;o++)e[o]={header:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[o],id:"data"+o,width:s[o],adjust:!s[o],editor:"text",sort:"string"}}this.config.columns=e,this.refreshColumns(),this.parse(i,this.P.datatype),this.Lk=t;var a=this.Wk(i.spans),u=this.Uk(n),c=this.Yk(i.styles,a);(a||u||c)&&this.refresh()}},getSheets:function(){return this.Ok.names},qk:function(t,i,e,s){for(var n=!1,h=0;h<t.length;h++)if(t[h][0]===i&&t[h][1]===e){t[h][5]=at(this.Gk(s)),this.addSpan(t[h][0],t[h][1],t[h][2],t[h][3],t[h][4],t[h][5]),n=!0;break}return n},Yk:function(t,i){var e=0;if(t&&t.length){for(var s=0;s<t.length;s++){var n=t[s][0]-(this.config.excelHeader?1:0);if(0<=n){var h=this.getIdByIndex(n);if(this.exists(h)){var r=this.getItem(h),o=this.columnId(t[s][1]);o&&(i.length&&this.qk(i,h,o,t[s][2])||(r.$cellCss=r.$cellCss||{},r.$cellCss[o]=this.Gk(t[s][2])),e++)}}}return e}return!1},Xk:function(t){return 8===(t=t||"000000").length&&(t=t.substring(2)),"#"+t},Gk:function(t){var i={};if(t.fill&&t.fill.fgColor&&(i["background-color"]=this.Xk(t.fill.fgColor.rgb)),t.font){var e=t.font;e.name&&(i["font-family"]=e.name),e.sz&&(i["font-size"]=e.sz/.75+"px"),e.color&&e.color.rgb&&(i.color=this.Xk(e.color.rgb)),e.bold&&(i["font-weight"]="bold"),e.underline&&(i["text-decoration"]="underline"),e.italic&&(i["font-style"]="italic"),e.strike&&(i["text-decoration"]="line-through")}if(t.alignment){var s=t.alignment;s.vertical&&"center"==s.vertical&&(i.display="flex",i["justify-content"]="flex-start",i["align-items"]="center"),s.vertical&&"bottom"==s.vertical&&(i.display="flex",i["justify-content"]="flex-end",i["align-items"]="flex-end"),s.horizontal&&(!s.vertical||"center"!=s.vertical&&"bottom"!=s.vertical?i["text-align"]=s.horizontal:i["justify-content"]="center"),s.wrapText&&(i["white-space"]="normal")}if(t.border){var n=t.border
;n.top&&(i["border-top"]="1px solid "+this.Xk(n.top.color.rgb)),n.bottom&&(i["border-bottom"]="1px solid "+this.Xk(n.bottom.color.rgb)+" !important"),n.left&&(i["border-left"]="1px solid "+this.Xk(n.left.color.rgb)),n.right&&(i["border-right"]="1px solid "+this.Xk(n.right.color.rgb)+" !important")}return i},Uk:function(t){var i=0;for(var e in t){var s=this.config.excelHeader?e-1:e;if(0<=s){var n=this.getIdByIndex(s);this.exists(n)&&(this.getItem(n).$height=t[e],i++)}}return this.config.fixedRowHeight=!i,i},Wk:function(t){var i=[];if(this.P.spans&&t&&t.length){this.ul={};for(var e=0;e<t.length;e++)this.config.excelHeader&&t[e][0]--,0<=t[e][0]&&(t[e][0]=this.getIdByIndex(t[e][0]),t[e][1]="data"+t[e][1],i.push(t[e]));return this.addSpan(i),i}return!1}},Hr=(H.protoUI(Br,zr.view),{name:"pdfbar",reset:function(){this.setPage(0),this.setValues(0,"auto")},$init:function(t){this.$view.className+=" pdf_bar",t.cols=[{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-angle-left",width:35,click:function(){this.getParentView().lw("prev")}},{view:"text",width:70,value:"0",on:{onBlur:function(){this.getParentView().lw(this.getValue())},onKeyPress:function(t){13===t&&this.getParentView().lw(this.getValue())}}},{template:I.PDFviewer.of+" #limit#",width:70,data:{limit:0},borderless:!0},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-angle-right",width:35,click:function(){this.getParentView().lw("next")}},{},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-minus",width:35,click:function(){this.getParentView().zoom("out")}},{view:"richselect",options:[],maxWidth:195,suggest:{padding:0,css:"pdf_opt_list",borderless:!0,body:{type:{height:25},scroll:!1,yCount:13}},on:{onChange:function(){this.getParentView().setMasterScale(this.getValue())}}},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-plus",width:35,click:function(){this.getParentView().zoom("in")}},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-download",width:35,click:function(){this.getParentView().download()}}],this.$ready.push(this.Jk)},Jk:function(){var t=this.getChildViews()[6].getPopup().getBody();t.clearAll(),t.parse([{id:"auto",value:I.PDFviewer.automaticZoom},{id:"page-actual",value:I.PDFviewer.actualSize},{id:"page-fit",value:I.PDFviewer.pageFit},{id:"page-width",value:I.PDFviewer.pageWidth},{id:"page-height",value:I.PDFviewer.pageHeight},{id:"0.5",value:"50%"},{id:"0.75",value:"75%"},{id:"1",value:"100%"},{id:"1.25",value:"125%"},{id:"1.5",value:"150%"},{id:"2",value:"200%"},{id:"3",value:"300%"},{id:"4",value:"400%"}]);var i=0;t.data.each(function(t){i=Math.max(St(t.value,"webixbutton").width,i)}),this.getChildViews()[6].define("width",i+20),this.getChildViews()[6].resize()},lw:function(t){this.setMasterPage(t),this.setPage(this.$master.$pageNum)},setScale:function(t){var i=this.getChildViews()[6];i.blockEvent(),i.getPopup().getList().exists(t)?i.setValue(t):(i.setValue(""),i.getInputNode().innerHTML=(100*t).toFixed(0)+"%"),i.unblockEvent()},setMasterScale:function(t){this.$master&&this.$master.setScale(t)},setMasterPage:function(t){this.$master&&("prev"===t?this.$master.prevPage():"next"===t?this.$master.nextPage():isNaN(parseInt(t))||this.$master.renderPage(parseInt(t)))},zoom:function(t){this.$master&&("out"===t?this.$master.zoomOut():"in"===t&&this.$master.zoomIn())},setPage:function(t){this.getChildViews()[1].setValue(t)},setValues:function(t,i){this.getChildViews()[2].data.limit=t,this.getChildViews()[2].refresh(),this.setScale(i)},download:function(){this.$master&&this.$master.download()}}),Rr=(H.protoUI(Hr,eh.view),{name:"pdfviewer",defaults:{scale:"auto"},$init:function(t){this.$view.className+=" webix_pdf";var i=document.createElement("DIV");i.className="canvas_wrapper";var e=document.createElement("canvas");this.Kk=this.$view,this.At=this.$view.appendChild(i),this.He=this.At.appendChild(e),this.$pdfDoc=null,this.$pageNum=0,this.$numPages=0,this.Zk=!1,this.Qk=null,this.tC=this.He.getContext("2d"),this.iC=.1,this.eC=t.scaleDelta||1.1,this.sC=t.minScale||.25,this.nC=t.maxScale||10,this.hC=1.25,this.rC=40,
this.oC=10,this.Bt=[],this.$ready.push(this.aC)},toolbar_setter:function(t){if("string"==typeof t){var i=oi(t);return i&&(i.$master=this,i.refresh()),this.attachEvent("onDocumentReady",function(){i?(i.setPage(this.$pageNum),i.setValues(this.$numPages,this.P.scale)):this.toolbar_setter(t)}),t}},aC:function(){if(delete this.P.datatype,this.attachEvent("onScaleChange",function(t){this.P.toolbar&&oi(this.P.toolbar).setScale&&oi(this.P.toolbar).setScale(t)}),this.attachEvent("onPageRender",function(t){this.P.toolbar&&oi(this.P.toolbar).setPage&&oi(this.P.toolbar).setPage(t)}),q.touch)this.uC=!1,Kt(this.Vt,"touchstart",S(function(t){var i=t.targetTouches;2===i.length&&(gt(t),this.uC=Math.abs(i[0].pageY-i[1].pageY))},this)),Kt(this.$view,"touchmove",S(function(t){var i=t.targetTouches;2===i.length&&!1!==this.uC&&(gt(t),Math.abs(i[0].pageY-i[1].pageY)>this.uC?this.zoomIn():this.zoomOut(),this.uC=!1)},this)),this.attachEvent("onSwipeX",function(t,i){this.$view.scrollLeft=this.$view.scrollLeft-(i.x-t.x)}),this.attachEvent("onSwipeY",function(t,i){var e=this.$view.clientHeight,s=this.$view.scrollHeight,n=this.$view.offsetHeight,h=this.$view.scrollTop,r=i.y-t.y;if(e===s||r<0&&s-n<h||0<r&&0===h){var o=this.$pageNum+(0<r?-1:1);0<o&&o<=this.$numPages&&(this.$pageNum=o,this.cC(this.$pageNum),this.$view.scrollTop=0<r?s:0)}else this.$view.scrollTop=h-r});else{var t=q.isFF?"DOMMouseScroll":"mousewheel";Kt(this.$view,t,function(t){var i=("DOMMouseScroll"===t.type?-t.detail:t.wheelDelta)<0?"out":"in";t.ctrlKey&&(gt(t),"in"==i?this.zoomIn():this.zoomOut())},{bind:this,passive:!1})}},$onLoad:function(t){return window.PDFJS?this.fC(t):Tt([q.cdn+"/extras/pdfjs/compatibility.min.js",q.cdn+"/extras/pdfjs/pdf.min.js"],function(){PDFJS.workerSrc=q.cdn+"/extras/pdfjs/pdf.worker.min.js",this.fC(t)},this),!0},fC:function(t){if(t.name){var i=new FileReader;i.onload=S(function(t){this.fC({data:t.target.result})},this),i.readAsArrayBuffer(t)}else this.lC({data:t.data})},lC:function(i){var e=this;return PDFJS.getDocument({data:i.data,password:i.password}).then(function(t){e.clear(),e.$pdfDoc=t,e.$numPages=e.$pdfDoc.numPages,e.$pageNum=1,e.dC(e.$pageNum).then(function(){e.callEvent("onDocumentReady")})},function(t){"PasswordException"==t.name&&e.vC(i)})},getPopup:function(){var e=this;return this._C||(this._C=si({view:"window",position:"center",modal:!0,head:I.PDFviewer.enterPassword,body:{view:"form",elements:[{view:"text",name:"password",type:"password",invalidMessage:I.PDFviewer.passwordError,required:!0},{cols:[{view:"button",value:I.message.cancel,hotkey:"esc",click:function(){e.getPopup().hide()}},{view:"button",css:"webix_primary",value:I.message.ok,hotkey:"enter",click:function(){var t=e.getPopup(),i=t.getBody();i.validate()?(e.lC({data:e.pC,password:i.getValues().password}),t.hide()):i.focus()}}]}]},on:{onHide:function(){var t=e.getPopup().getBody();t.clear(),t.clearValidation(),delete e.pC}}}),this.Bt.push(this._C)),this._C},vC:function(t){var i=this.getPopup(),e=i.getBody();this.pC=t.data,t.password&&(e.markInvalid("password"),e.setValues({password:t.password})),i.show(),e.focus()},bC:function(t,i){var e=t.getViewport(i);return this.He.height=e.height,this.He.width=e.width,this.At.style.width=e.width+"px",this.At.style.height=e.height+"px",e},dC:function(t){var n=this;return this.Zk=!0,this.$pdfDoc.getPage(t).then(function(t){var i=isNaN(parseFloat(n.P.scale))?n.iC:n.P.scale,e=n.bC(t,i);i!==n.P.scale&&(i=n.mC(n.P.scale),e=n.bC(t,i),n.P.scale=i);var s={canvasContext:n.tC,viewport:e};return t.cleanupAfterRender=!0,t.render(s).promise.then(function(){n.callEvent("onPageRender",[n.$pageNum]),n.Zk=!1,null!==n.Qk&&(n.dC(n.Qk),n.Qk=null)})})},cC:function(t){this.Zk?this.Qk=t:this.dC(t)},renderPage:function(t){!this.$pdfDoc||t<=0||t>this.$numPages||(this.$pageNum=t,this.cC(this.$pageNum))},prevPage:function(){this.$pageNum<=1||(this.$pageNum--,this.cC(this.$pageNum))},nextPage:function(){this.$pageNum>=this.$numPages||(this.$pageNum++,this.cC(this.$pageNum))},zoomIn:function(){var t=this.P.scale;t=(t*this.eC).toFixed(2),t=Math.ceil(10*t)/10,t=Math.min(
this.nC,t),this.setScale(t)},zoomOut:function(){var t=this.P.scale;t=(t/this.eC).toFixed(2),t=Math.floor(10*t)/10,t=Math.max(this.sC,t),this.setScale(t)},mC:function(t){if(!isNaN(parseFloat(t)))return t;isNaN(parseFloat(this.P.scale))&&(this.P.scale=this.iC);var i=1,e=((this.Kk.clientWidth-this.rC)*this.P.scale/this.He.clientWidth).toFixed(2),s=((this.Kk.clientHeight-this.oC)*this.P.scale/this.He.clientHeight).toFixed(2);switch(t){case"page-actual":i=1;break;case"page-width":i=e;break;case"page-height":i=s;break;case"page-fit":i=Math.min(e,s);break;case"auto":var n=this.Kk.clientWidth>this.Kk.clientHeight?Math.min(s,e):e;i=Math.min(this.hC,n)}return i},setScale:function(t){if(isNaN(parseFloat(t))){var i=this.mC(t);this.gC(i)}else this.gC(t)},gC:function(t){this.P.scale=t,this.renderPage(this.$pageNum),this.callEvent("onScaleChange",[t])},download:function(){if(this.$pdfDoc){var i=(this.P.downloadName||"document")+".pdf";this.$pdfDoc.getData().then(function(t){kt(PDFJS.createBlob(t,"application/pdf"),i)})}},clear:function(){this.$pdfDoc&&(this.tC.clearRect(0,0,this.He.width,this.He.height),this.At.style.height=this.At.style.width=this.He.width=this.He.height=0,this.P.scale="auto",this.$pageNum=this.$numPages=0,this.$pdfDoc.transport.startCleanup(),this.$pdfDoc.destroy(),this.$pdfDoc=null,this.P.toolbar&&oi(this.P.toolbar)&&oi(this.P.toolbar).reset())}}),Er=(H.protoUI(Rr,g,Ht,Hi.view),{name:"video",$init:function(t){t.id||(t.id=V()),this.$ready.push(this.wC)},wC:function(){var t=this.P;if(this.Wi=ft("video",{"class":"webix_view_video",style:"width:100%;height:100%;",autobuffer:"autobuffer"},""),t.poster&&(this.Wi.poster=t.poster),t.src){"object"!=M(t.src)&&(t.src=[t.src]);for(var i=0;i<t.src.length;i++)this.Wi.innerHTML+=' <source src="'+t.src[i]+'">'}t.controls&&(this.Wi.controls=!0),t.autoplay&&(this.Wi.autoplay=!0),this.Vt.appendChild(this.Wi)},getVideo:function(){return this.Wi},defaults:{src:"",controls:!0}}),Pr=(H.protoUI(Er,Hi.view),{name:"gage",defaults:{value:0,minRange:0,maxRange:100,minWidth:250,minHeight:200,smoothFlow:!0,scale:3,stroke:7},$init:function(){this.$ready.push(S(this.xC,this)),this.attachEvent("onDestruct",function(){this.yC=this.MC=this.SC=null})},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.kC()},kC:function(){this.CC=this.config.value;var t=this.$view.querySelector(".webix_gage_curves"),i=this.$view.querySelector(".webix_gage_info"),e=this.config.scale,s=Math.min(this.$width,this.$height),n=s/100*this.config.stroke,h=s/e;t.setAttribute("r",h),t.setAttribute("strokeDasharray",Math.round(Math.PI*h)),t.style.r=h,t.style.strokeDasharray=Math.round(Math.PI*h),t.style["stroke-width"]=n+"px",i.setAttribute("style","width: "+Math.round(2*h)+"px;"),this.SC.setAttribute("style","height: "+Math.round(h+n)+"px;"),this.yC.setAttribute("r",h),this.yC.setAttribute("style","stroke-dasharray: "+Math.round(this.gradientLength*Math.PI*h)+", 1900; stroke-width:"+n+"px"),this.$C(h),this.DC()},IC:function(t){return Math.min(Math.max(t,this.P.minRange),this.P.maxRange)},$C:function(t){var i=this.$width,e=Math.min(this.$width,this.$height)/100*this.config.stroke;this.MC.style.transformOrigin=i/2+"px 0 0",this.MC.setAttribute("y1","0"),this.MC.setAttribute("x1",Math.round(i)/2+e),this.MC.setAttribute("y2","0"),this.MC.setAttribute("x2",Math.round((i+e)/2+t))},DC:function(){var t=this.config.value,i=this.$view.querySelector(".webix_gage_value"),e=this.IC(t)-this.config.minRange,s=Math.round(180*e/(this.config.maxRange-this.config.minRange)),n=Math.min(this.$width,this.$height);this.$view.style.fontSize=Math.floor(n/8)+"px",i.innerHTML=t,this.yC.style.stroke=this.color,this.yC.setAttribute("stroke",this.color),this.MC.setAttribute("transform","rotate("+s+" "+n/2+" 0)"),this.MC.style.transform="rotate("+s+"deg)"},AC:function(){this.config.minRange,this.config.maxRange,this.gradientLength=(this.IC(this.config.value)-this.config.minRange)/(this.config.maxRange-this.config.minRange);var t=this.config.color;this.color=t?"function"==typeof t?t.call(this,this.config.value):t:"hsl("+(120-Math.round(
120*this.gradientLength))+", 100%, 50%)",!0===this.config.animation?this.defaultColor="hsl(125, 100%, 50%)":this.defaultColor="hsl("+(120-Math.round(120*this.gradientLength))+", 100%, 50%)"},xC:function(){var t=this.config.smoothFlow&&q.svganimation&&!q.isEdge;this.gradientLength=0,this.AC(),this.$view.innerHTML='<div class="webix_gage_box"><div>\n\t\t\t<div class="webix_gage_label"><span>'.concat(this.config.label||"",'</span></div>\n\t\t\t<svg class="webix_gage_body" style="height:300px; position: relative;">\n\t\t\t\t<circle class="webix_gage_curves" r="0" cx="50%" cy="0" stroke="#EEEEEE" fill="none"></circle>\n\t\t\t\t<circle class="webix_gage_gradient').concat(t?" webix_gage_animated":"",'" r="0" stroke=').concat(this.defaultColor,' cx="50%" cy="0" fill="none" style="stroke-dasharray: 0, 1900;"></circle>\n\t\t\t\t<line class="webix_gage_gradient_point').concat(t?" webix_gage_gradient_point_animated":"",'" x1="0" x2="0" y1="0" y2="0" style="stroke:#B0B0B0; stroke-width:4;"></line>\n\t\t\t</svg>\n\t\t\t<div class="webix_gage_info">\n\t\t\t\t<div class="webix_gage_min_range">').concat(this.config.minRange,'</div>\n\t\t\t\t<div class="webix_gage_max_range">').concat(this.config.maxRange,'</div>\n\t\t\t\t<div class="webix_gage_placeholder">\n\t\t\t\t\t<div class="webix_gage_value">').concat(this.config.value,'</div>\n\t\t\t\t\t<div class="webix_gage_range_info">').concat(this.config.placeholder||"","</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div></div>"),this.yC=this.$view.querySelector(".webix_gage_gradient"),this.MC=this.$view.querySelector(".webix_gage_gradient_point"),this.SC=this.$view.querySelector(".webix_gage_body")},refresh:function(){var t=this.config.value;this.config.smoothFlow&&t!=this.CC&&(this.config.value=this.CC),this.xC(),this.kC(),this.CC!=t&&this.Vt.parentNode.clientHeight&&this.setValue(t)},setValue:function(t){this.config.value=t,this.AC(),this.kC()},getValue:function(){return this.config.value}}),jr=(H.protoUI(Pr,g,Hi.view),{name:"barcode",defaults:{type:"ean13",height:160,width:220,paddingY:10,paddingX:20,textHeight:20,color:"#000",ariaLabel:"bars"},$init:function(){this.$view.className+=" webix_barcode",this.types||(this.types={"default":this.type},this.type.name="default")},type:{},render:function(){this.isVisible(this.P.id)&&(this.canvas&&this.canvas.clearCanvas(!0),this.$view.innerHTML="",this.FC())},FC:function(){this.canvas=new ji({container:this.$view,name:this.name,title:this.P.ariaLabel,width:this.$width,height:this.$height}),this.TC()},TC:function(){var t,i,e,s,n=this.P.value,h=this.P.type;if(!h||!this.types[h]||!n)return!1;if(s=(t=this.type.encode(n)).length,i=this.canvas.getCanvas(),s){var r=(this.$width-2*this.config.paddingX)/s,o=0;for(e=0;e<s;e++){parseInt(t.charAt(e),10)?(o++,e==s-1&&this.VC(i,e+1,r,o,s)):o&&(this.VC(i,e,r,o,s),o=0)}this.zC(n,r)}},VC:function(t,i,e,s,n){var h,r,o,a;r=parseInt(i*e+this.config.paddingX,10),h=parseInt(r-s*e,10),o=this.config.paddingY,a=this.$height-this.config.paddingY-this.config.textHeight,this.BC()&&(i<4||n-4<i||i<n/2+2&&n/2-2<i)&&(a+=this.config.textHeight/2),t.fillStyle=this.config.color,t.beginPath(),t.moveTo(h,o),t.lineTo(r,o),t.lineTo(r,a),t.lineTo(h,a),t.lineTo(h,o),t.fill()},zC:function(t,i){var e,s,n;if(this.type.template&&(t=this.type.template(t)),this.BC()){if(this.type.firstDigit&&(this.canvas.renderTextAt(!0,"left",this.config.paddingX,this.$height-this.config.paddingY,t.charAt(0)),t=t.slice(1)),s=t.length,this.type.lastDigit&&s--,s){var h=(this.$width-2*this.config.paddingX-11*i)/s;for(e=0;e<s;e++)n=this.config.paddingX+e*h+(e<s/2?3:8)*i+h/2,this.canvas.renderTextAt(!0,!0,n,this.$height-this.config.paddingY,t.charAt(e));this.type.lastDigit&&(n=this.config.paddingX+s*h+11*i,this.canvas.renderTextAt(!0,!1,n,this.$height-this.config.paddingY,t.charAt(s)))}}else this.canvas.renderTextAt(!0,!0,this.$width/2,this.$height-this.config.paddingY,t)},setValue:function(t){return this.P.value=t,this.render(),t},getValue:function(){var t=this.P.value;return this.type.template?this.type.template(t):t},type_setter:function(t){return this.types[t]?(
this.type=l(this.types[t]),this.type.css&&(this.Wi.className+=" "+this.type.css)):this.customize(t),t},BC:function(){var t=this.config.type;return 0===t.indexOf("ean")||-1!=t.indexOf("upcA")},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&this.render()}}),Nr=H.protoUI(jr,Hi.view);ti(Nr,{name:"upcA",firstDigit:!0,lastDigit:!0,encode:function(t){return t.length<12&&(t="0"+t),Lr.encode(t)},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,11)+this.checksum(t)},checksum:function(t){return t.length<12&&(t="0"+t),Lr.checksum(t)}}),ti(Nr,{name:"ean8",encodings:[["0001101","1110010"],["0011001","1100110"],["0010011","1101100"],["0111101","1000010"],["0100011","1011100"],["0110001","1001110"],["0101111","1010000"],["0111011","1000100"],["0110111","1001000"],["0001011","1110100"]],encode:function(t){var i,e;if(7!=(t=t.replace(/[^0-9]/g,"").substring(0,7)).length)return"";for(t+=this.checksum(t),i="101",e=0;e<4;e++)i+=this.encodings[parseInt(t.charAt(e),10)][0];for(i+="01010",e=4;e<8;e++)i+=this.encodings[parseInt(t.charAt(e),10)][1];return i+="101"},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,7)+this.checksum(t)},checksum:function(t){t=t.substring(0,7);var i,e=!0,s=0;for(i=0;i<7;i++)s+=(e?3:1)*parseInt(t.charAt(i),10),e=!e;return((10-s%10)%10).toString()}});var Lr={name:"ean13",firstDigit:!0,encodings:[["0001101","0100111","1110010","000000"],["0011001","0110011","1100110","001011"],["0010011","0011011","1101100","001101"],["0111101","0100001","1000010","001110"],["0100011","0011101","1011100","010011"],["0110001","0111001","1001110","011001"],["0101111","0000101","1010000","011100"],["0111011","0010001","1000100","010101"],["0110111","0001001","1001000","010110"],["0001011","0010111","1110100","011010"]],encode:function(t){var i,e,s;if(12!=(t=t.replace(/[^0-9]/g,"").substring(0,12)).length)return"";for(t+=this.checksum(t),i="101",e=this.encodings[parseInt(t.charAt(0),10)][3],s=1;s<7;s++)i+=this.encodings[parseInt(t.charAt(s),10)][parseInt(e.charAt(s-1),10)];for(i+="01010",s=7;s<13;s++)i+=this.encodings[parseInt(t.charAt(s),10)][2];return i+="101"},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,12)+this.checksum(t)},checksum:function(t){var i,e=!1,s=0;for(t=t.substring(0,12),i=0;i<12;i++)s+=(e?3:1)*parseInt(t.charAt(i),10),e=!e;return((10-s%10)%10).toString()}};ti(Nr,Lr);var Or,Wr,Ur,Yr,qr={name:"bullet",defaults:{color:"#394646",marker:!1,layout:"x",barWidth:40,flowTime:500,labelWidth:150,minRange:0,maxRange:100,stroke:8,value:0,smoothFlow:!0,tickSize:10,bands:[{value:100,color:"#5be5d6"},{value:80,color:"#fff07e"},{value:60,color:"#fd8b8c"}],scale:{step:10}},label_setter:Yt,placeholder_setter:Yt,$init:function(t){var i="undefined"!=typeof t.tickSize?t.tickSize:this.defaults.tickSize;t&&(t.layout&&"x"!==t.layout||!R(t.height)||(t.height=!1===t.scale?60:i?76+i:74),"y"===t.layout&&R(t.width)&&(t.width=!1===t.scale?60:i?87+i:87))},scale_setter:function(t){return t&&(t.step=t.step||10,t.template=Yt(t.template||"#value#")),t},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&(this.xC("y"===this.P.layout?i:t),(this.P.value||0===this.P.value)&&this.DC(0,this.P.value))},IC:function(t){return Math.min(Math.max(t,this.P.minRange),this.P.maxRange)-this.P.minRange},HC:function(t){var i;this.RC=t-(this.rs||t),this.rs=t,(1e3<(i=this.P.flowTime>this.RC?this.P.flowTime/this.RC:this.P.flowTime)||i<5)&&(i=30);var e=(this.P.value-this.EC)/i;this.PC+=e,Math.abs(this.PC-this.P.value)<Math.abs(e)&&(this.PC=this.P.value),this.PC!=this.P.value?this.jC=requestAnimationFrame(this.HC.bind(this)):(cancelAnimationFrame(this.jC),this.jC=null),this.NC.setAttribute("width",Math.floor(this.IC(this.PC)*this.LC)),this.NC.style.fill=this.qc()},DC:function(t,i){this.EC=this.PC=t,this.P.value=this.CC=i,!0===this.isVisible()&&!0===this.P.smoothFlow&&window.requestAnimationFrame?this.jC||(this.jC=requestAnimationFrame(this.HC.bind(this))):(this.NC.setAttribute("width",Math.floor(this.IC(i)*this.LC)),this.NC.style.fill=this.qc())},qc:function(){var t=this.P.color;return"function"==typeof t?t(this.CC):t},
OC:function(t,i,e){for(var s=0;s<i.length;s++)t.setAttribute(i[s],e[s])},WC:function(t,i,e){var s=document.createElementNS("http://www.w3.org/2000/svg",t);return i&&this.OC(s,i,e),s},UC:function(t){var i=this.WC(t[0],t[1],t[2]),e=t[3];if(e)for(var s=0;s<e.length;s++)i.appendChild(this.UC(e[s]));return i},YC:function(){var t="d"+V(),i=this.WC("svg",["class"],["webix_bullet_graph_svg"]),e=this.WC("g"),s=this.WC("g"),n=this.WC("rect",["x","y","width","height","class","style"],[this.qC,this.GC,100,this.P.stroke,"webix_bullet_value","filter:url(#"+t+");fill:"+this.qc()]),h=this.WC("rect",["x","y","width","height","fill"],[0,5,3,this.P.barWidth-10,"rgba(0,0,0,0.5)"]),r=this.WC("g",["stroke","stroke-width","fill"],["#8b94ac","2","none"]),o=this.WC("text",["text-anchor","stroke","fill"],["end","none","#8b94ac"]),a="y"==this.P.layout?"50%":this.qC-10,u="y"==this.P.layout?11:17,c=this.WC("tspan",["x","y","class"],[a,u,"webix_bullet_header"]),f=this.WC("tspan",["x","y","class"],[a,u+17,"webix_bullet_subheader"]),l=this.WC("text",["text-anchor","stroke","class","fill"],["middle","none","webix_bullet_scale","#8b94ac"]),d=this.UC(["filter",["id","x","y","width","height"],[t,"0","-150%","110%","400%"],[["feOffset",["in","dx","dy"],["SourceAlpha",0,0]],["feGaussianBlur",["stdDeviation"],["2"]],["feComponentTransfer",0,0,[["feFuncA",["type","slope"],["linear","0.5"]]]],["feMerge",0,0,[["feMergeNode"],["feMergeNode",["in"],["SourceGraphic"]]]]]]);i.appendChild(d);var v=document.createElement("div");e.appendChild(s),!1!==this.P.marker&&(h.setAttribute("x",this.qC+this.IC(this.P.marker)*this.LC-2),e.appendChild(h)),e.appendChild(n),o.appendChild(c),o.appendChild(f),i.appendChild(o);var _="y"===this.P.layout,p=this.P.tickSize;if(this.P.scale){for(var b=this.qC,m=this.P.minRange;m<=this.P.maxRange;m+=this.P.scale.step){var g=Math.max(m-this.P.minRange,0),w=Math.floor(g*this.LC-(g?.1:-1)),x=_?(this.$width-this.P.barWidth)/2+(p?2-p:4):w+b,y=_?this.XC+b-w+6:this.P.barWidth+(p?16+p:14),M=_?-4:this.P.barWidth+3+p,S=_?"end":"middle",k=this.WC("tspan",["x","y","text-anchor"],[x,y,S]),C=this.WC("line",["x1","y1","x2","y2","stroke-width"],[w+b,M,w+b,M-p,1]);v.innerHTML=this.P.scale.template({value:m}),k.appendChild(v.childNodes[0]),l.appendChild(k),r.appendChild(C)}e.appendChild(r),i.appendChild(l)}for(var $=0;$<this.P.bands.length;$++){var D=this.P.bands[$],I=this.WC("path"),A=this.IC(D.value)*this.LC;I.setAttribute("d","M "+this.qC+",0 l "+A+",0 l 0,"+this.P.barWidth+" l -"+A+",0 z"),I.setAttribute("fill",D.color),s.appendChild(I)}if(i.appendChild(e),"y"===this.P.layout){var F=this.P.scale?this.$width/2-10:0,T=this.$height+this.qC-28;e.setAttribute("transform","translate("+F+", "+T+") rotate(270)"),o.setAttribute("text-anchor","middle"),o.childNodes[0].setAttribute("x","55%"),o.childNodes[1].setAttribute("x","55%"),l.setAttribute("text-anchor","right")}return i.setAttribute("viewBox","0 0 "+this.$width+" "+this.$height),i},xC:function(t){this.config.minRange,this.config.maxRange,t=t||("x"==this.P.layout?this.$width:this.$height);var i=this.$view;i.innerHTML="";var e=this.P,s=e.label&&e.label(e)||e.placeholder&&e.placeholder(e);this.qC=s?e.labelHeight||e.labelWidth:7,this.GC=Math.floor((this.P.barWidth-this.P.stroke)/2),this.XC=t-this.qC-30,this.LC=this.XC/(this.P.maxRange-this.P.minRange);var n=this.YC();n.setAttribute("height",this.$height),n.setAttribute("width",this.$width),i.appendChild(n),this.NC=i.querySelector(".webix_bullet_value");var h=this.P.label;h&&(this.$view.querySelector(".webix_bullet_header").textContent=h(this.P));var r=this.P.placeholder;r&&(this.$view.querySelector(".webix_bullet_subheader").textContent=r(this.P))},refresh:function(){this.xC(),this.DC(this.CC,this.P.value)},setValue:function(t){this.P.value!=t&&this.DC(this.P.value,t)},getValue:function(){return this.P.value}},Gr=(H.protoUI(qr,Hi.view),{name:"geochart",defaults:{chart:{displayMode:"auto",region:"world",resolution:"countries"}},$init:function(t){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",
this.Wi=this.$view.firstChild,this.JC=b.defer(),t.chart=H.extend(t.chart||{},this.defaults.chart),this.data.provideApi(this,!0),this.$ready.push(this.render),this.data.attachEvent("onClearAll",S(this.KC,this)),this.data.attachEvent("onStoreUpdated",S(this.ZC,this))},getMap:function(t){return t?this.JC:this.du},QC:function(t){return S(function(){"function"==typeof t&&t(),Or=Or||window.google,this.t$()},this)},render:function(){"undefined"==typeof window.google||"undefined"==typeof window.google.charts?(Wr||((Wr=document.createElement("script")).type="text/javascript",Wr.src="//www.gstatic.com/charts/loader.js",document.getElementsByTagName("head")[0].appendChild(Wr)),Wr.onload=this.QC(Wr.onload)):this.QC()()},t$:function(){Or.visualization&&Or.visualization.GeoChart?(this.du=new Or.visualization.GeoChart(this.Wi),this.i$(),this.JC.resolve(this.du)):(Or.charts.load("current",{packages:["geochart"],mapsApiKey:this.P.key}),Or.charts.setOnLoadCallback(S(function(){this.t$()},this)))},$onLoad:function(t){return!this.du&&(this.JC.then(S(function(){this.parse(t,this.P.datatype)},this)),!0)},ZC:function(){if(this.du){var n=this.rl&&this.rl.length?this.rl:this.e$(),h=[];if(this.data.each(function(t){for(var i=[],e=0;e<n.length;e++){var s=t[n[e].label];"number"==n[e].type?s*=1:"tooltip"==n[e].role&&(s=this.P.tooltip(t)),i.push(s)}h.push(i)},this),n.length){for(var t=new Or.visualization.DataTable,i=0;i<n.length;i++)t.addColumn(n[i]);t.addRows(h);var e=new Or.visualization.DataView(t);this.du.draw(e,this.P.chart)}else this.du.draw(Or.visualization.arrayToDataTable([["",""]]),{})}else this.du||this.JC.then(S(this.ZC,this))},setDisplayMode:function(t){this.P.chart.displayMode=t,this.refresh()},setRegion:function(t){this.P.chart.region=t,this.refresh()},refresh:function(){this.du.clearChart(),this.ZC()},tooltip_setter:function(t){var i=this.P.chart.tooltip;return this.P.chart.tooltip=H.extend(i||{},{isHtml:!0}),Yt(t)},$setSize:function(t,i){Hi.api.$setSize.apply(this,arguments)&&this.du&&(H.extend(this.P,{width:t,height:i}),this.refresh())},KC:function(){this.rl=null,this.ZC()},s$:function(t,i){if(!t||R(t[i]))return"string";var e=M(t[i]);return"string"!=e||isNaN(1*t[i])||(e="number"),e},e$:function(){var t=this.P.columns||[],i=this.data.pull[this.data.order[0]];if(!t.length&&i)for(var e in i)"id"!==e&&t.push(e);for(var s=0;s<t.length;s++)"object"!==M(t[s])&&(t[s]={type:this.s$(i,t[s]),label:t[s]});return this.P.tooltip&&t.push({type:"string",role:"tooltip",p:{html:!0}}),this.rl=t},i$:function(){Or.visualization.events.addListener(this.du,"error",S(function(){this.callEvent("onMapError",arguments)},this)),Or.visualization.events.addListener(this.du,"ready",S(function(){this.callEvent("onMapReady",arguments)},this)),Or.visualization.events.addListener(this.du,"regionClick",S(function(){this.callEvent("onRegionClick",arguments)},this)),Or.visualization.events.addListener(this.du,"select",S(function(){var t=this.du.getSelection()[0],i=t||this.n$;if(i){var e=this.data.order[i.row];this.n$=i,this.callEvent("onItemClick",[e,!!t])}},this))}}),Xr=(H.protoUI(Gr,_e,g,Hi.view),{name:"google-map",$init:function(){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.Wi=this.$view.firstChild,this.JC=b.defer(),this.data.provideApi(this,!0),this.$ready.push(this.render)},getMap:function(t){return t?this.JC:this.du},QC:function(t){return S(function(){"function"==typeof t&&t(),Ur=Ur||window.google,this.t$.call(this)},this)},render:function(){if("undefined"==typeof window.google||"undefined"==typeof window.google.maps){if(!Yr){(Yr=document.createElement("script")).type="text/javascript";var t=this.P,i=t.src||"//maps.google.com/maps/api/js";i+=-1===i.indexOf("?")?"?":"&",t.key&&(i+="&key="+t.key),t.libraries&&(i+="&libraries="+t.libraries),Yr.src=i,document.getElementsByTagName("head")[0].appendChild(Yr)}Yr.onload=this.QC(Yr.onload)}else this.QC()()},t$:function(){var t=this.config;this.isVisible(t.id)&&(this.du=new Ur.maps.Map(this.Wi,{zoom:t.zoom,center:new Ur.maps.LatLng(t.center[0],t.center[1]),
mapTypeId:Ur.maps.MapTypeId[t.mapType]}),this.JC.resolve(this.du),this.Wi.firstChild.setAttribute("webix_disable_drag","true"))},center_setter:function(t){return this.du&&this.du.setCenter(new Ur.maps.LatLng(t[0],t[1])),t},mapType_setter:function(t){return this.du&&this.du.setMapTypeId(Ur.maps.MapTypeId[t]),t},zoom_setter:function(t){return this.du&&this.du.setZoom(t),t},layerType_setter:function(t){return"heatmap"==t&&(this.config.libraries="visualization"),this.h$[t]&&(H.extend(this,this.h$[t],!0),this.data.attachEvent("onStoreUpdated",S(function(){this.JC.then(S(function(){this.drawData.call(this,arguments)},this))},this))),t},defaults:{zoom:5,center:[39.5,-98.5],mapType:"ROADMAP",layerType:"marker"},$setSize:function(){Hi.api.$setSize.apply(this,arguments),this.du&&Ur.maps.event.trigger(this.du,"resize")},$onLoad:function(t){return!this.du&&(this.JC.then(S(function(){this.parse(t)},this)),!0)},h$:{marker:{drawData:function(t,i,e){switch(e){case"add":case"update":i.$marker=this.r$(i);break;case"delete":i.$marker.setMap(null);break;default:this.data.each(function(t){t.$marker=this.r$(t)},this)}},clearAll:function(t){this.data.each(function(t){t.$marker.setMap(null)}),this.data.clearAll(t)},showItem:function(t){var i=this.getItem(t);this.du.setCenter(new Ur.maps.LatLng(i.lat,i.lng))},r$:function(t){var i={};for(var e in t)i[e]=t[e];i.position=new Ur.maps.LatLng(t.lat,t.lng),i.map=t.hidden?null:this.du;var s=t.$marker;return s?t.$marker.setMap(i.map):(s=new Ur.maps.Marker(i),this.yt(s)),this.callEvent("onItemRender",[t]),s},yt:function(t){var i=this;t.addListener("click",function(){i.callEvent("onItemClick",[this.id,this])}),t.getDraggable()&&(t.addListener("dragend",function(){i.o$(this,!0)}),t.addListener("drag",function(){i.o$(this)}))},o$:function(t,i){var e=this.getItem(t.id),s=t.getPosition(),n=i?"onAfterDrop":"onDrag";e.lat=s.lat(),e.lng=s.lng(),this.callEvent(n,[e.id,e])}},heatmap:{heatmapConfig_setter:function(t){return t=t||{}},drawData:function(){this.a$&&(this.a$.setMap(null),this.a$=null);var i=[];if(this.data.each(function(t){i.push(this.u$(t))},this),i.length){var t=H.extend(this.config.heatmapConfig,{data:i,map:this.du},!0);this.a$=new Ur.maps.visualization.HeatmapLayer(t),this.callEvent("onHeatMapRender",[this.a$])}},getHeatmap:function(){return this.a$},u$:function(t){var i={};for(var e in t)i[e]=t[e];return i.location=new Ur.maps.LatLng(t.lat,t.lng),i}}}}),Jr=(H.protoUI(Xr,_e,g,Hi.view),{name:"organogram",defaults:{scroll:"auto",ariaLabel:"lines"},$init:function(){this.Vt.className+=" webix_organogram",this.Oi=document.createElement("DIV"),this.$ready.push(this.c$),H.extend(this.data,ls,!0),this.data.provideApi(this,!0)},Qo:"webix_dg_id",on_click:{webix_organogram_item:function(t,i){this.P.select&&("multiselect"==this.P.select||this.P.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.P.multiselect,t.shiftKey):this.select(i),this.Fm=!1)}},on_context:{},on_dblclick:{},c$:function(){this.tt.style.position="relative",this.data.attachEvent("onStoreUpdated",S(this.render,this))},vf:function(t){var i=this.data.Dr[t.id];return this.callEvent("onItemRender",[t]),this.type.templateStart.call(this,t,this.type,i)+(t.$template?this.type["template"+t.$template].call(this,t,this.type,i):this.type.template.call(this,t,this.type,i))+this.type.templateEnd.call(this)},Q:function(t){var i=this.vf(t);return this.data.branch[t.id]&&(i+=this.f$(t.id)),i},l$:function(){return this.type.listMarginX||this.type.listMarginY},f$:function(t,i){var e,s,n,h,r="",o=this.data.branch[t],a=this.data.Dr[t],u=this.getItem(t),c=!!u&&u.$type;if(i=i||0,"list"===c&&(i+=this.type.listMarginX),t||(this.d$=[],this.$xy={},h=this.$width-2*this.type.padding,this.$xy[0]={totalWidth:h,start:this.type.padding,width:0,height:0,left:h/2,top:this.type.padding||0}),o){n=this.$xy[t],"list"!=c||this.l$()||(r+=this.type.templateListStart.call(this,u,this.type,a));var f=0,l=0;for(e=0;e<o.length;e++){s=o[e],h=this.v$[s];var d=this.getItem(s);d.open==undefined&&(d.open=!0),"list"==c&&this.data.addMark(s,"list_item","",1,!0);var v=this._$(s);if(
"list"==c){var _=0;this.l$()?_=this.type.listMarginY:e||(_=this.type.marginY),this.$xy[s]={totalWidth:h,start:n.start,width:this.type.width,height:v,left:n.start+h/2-this.type.width/2+i,top:e?this.$xy[o[e-1]].top+this.$xy[o[e-1]].height+_+l:n.top+n.height+_},l=this.data.branch[s]?this.p$(s):0}else this.$xy[s]={totalWidth:h,start:n.start+f,width:this.type.width,height:v,left:n.start+f+h/2-this.type.width/2,top:n.top+n.height+(t?this.type.marginY:0)};r+=this.vf(d),f+=h}for(e=0;e<o.length;e++)s=o[e],this.data.branch[s]&&this.getItem(s).open?r+=this.f$(s,i):u&&("list"!=u.$type?this.d$.push(this.$xy[s].top+this.$xy[s].height):e==o.length-1&&this.d$.push(this.$xy[s].top+this.$xy[s].height));var p=0;for(var b in this.$xy){var m=this.$xy[b];p=Math.max(m.left+m.width,p)}this.tt.style.width=p+this.type.padding+this.type.marginX/2+"px","list"!=c||this.l$()||(r+=this.type.templateListEnd(u,this.type,a))}return r},p$:function(t){for(var i=this.data.branch[t],e=0,s=0;s<i.length;s++)e+=this._$(i[s])+this.type.listMarginY,this.data.branch[i[s]]&&(e+=this.p$(i[s]));return e+this.type.marginY},_$:function(t){var i=this.getItem(t),e=this.type.height;return"function"==typeof e&&(e=e.call(i,this.type,this.data.Dr[t])),this.b$||(this.b$=ft("div"),this.tt.appendChild(this.b$)),this.b$.className=this.type.classname(i,this.type,this.data.Dr[t]),this.b$.style.cssText="width:"+this.type.width+"px;height:"+e+("auto"==e?"":"px")+";",this.b$.innerHTML=this.type.template.call(this,i,this.type,this.data.Dr[t]),this.b$.scrollHeight},m$:function(){var n={},h=this.type.width,r=this.type.marginX;return this.data.each(function(t){n[t.id]=h+r;var i=this.getParentId(t.id);if(i&&"list"!=this.getItem(i).$type)for(;i;){for(var e=this.branch[i],s=n[i]=0;s<e.length;s++)n[i]+=n[e[s]]||0;i=this.getParentId(i)}}),this.v$=n},getItemNode:function(t){if(this.Ni)return this.Ni[t];this.Ni={};for(var i=this.tt.childNodes,e=0;e<i.length;e++){var s=i[e].getAttribute(this.Qo);if(s&&(this.Ni[s]=i[e]),-1!=i[e].className.indexOf("webix_organogram_list")&&!this.l$())for(var n=i[e].childNodes,h=0;h<n.length;h++)(s=n[h].getAttribute(this.Qo))&&(this.Ni[s]=n[h])}return this.getItemNode(t)},gc:function(t){return this.Oi.innerHTML=this.vf(t),this.Oi.firstChild},render:function(t,i,e){if(this.isVisible(this.P.id)&&!this.$blockRender){if("update"!=e)return this.callEvent("onBeforeRender",[this.data])&&(this.m$(),this.Ni=null,this.tt.innerHTML=this.f$(0),this.b$=null,this.tt.style.height=Math.max.apply(Math,this.d$)+this.type.padding+"px",this.FC(),this.resize(),this.callEvent("onAfterRender",[])),!0;var s=this.getItemNode(t);return vt(this.Ni[t]=this.gc(i),s),dt(s),!0}},FC:function(){this.canvas&&this.canvas.clearCanvas(!0),this.canvas=new ji({container:this.tt,name:this.name,title:this.P.ariaLabel,width:this.tt.offsetWidth,height:this.tt.offsetHeight}),this.g$(0)},w$:function(t,i,e,s,n,h,r){t.strokeStyle=h,t.lineCap="square",t.lineWidth=r,t.beginPath(),t.moveTo(i,e),t.lineTo(s,n),t.stroke(),t.lineWidth=1},g$:function(t,i){var e,s,n,h,r,o,a,u,c,f;if(i||(i=this.canvas.getCanvas()),this.$xy&&(t=t||0,n=this.data.branch[t],s=this.getItem(t),n&&n.length)){if(h=this.$xy[t],t)if(o=parseInt(h.left+h.width/2,10)+.5,a=parseInt(h.top+h.height,10),u=parseInt(h.top+h.height+this.type.marginY/2,10),"list"==s.$type){if(!this.l$())return u=parseInt(h.top+h.height+this.type.marginY,10),void this.w$(i,o,a,o,u,this.type.lineColor)}else this.w$(i,o,a,o,u,this.type.lineColor);for(a=parseInt(h.top+h.height+this.type.marginY/2,10)+.5,e=0;e<n.length;e++)t&&(r=this.$xy[n[e]],"list"==s.$type&&this.l$()?(o=parseInt(h.left+this.type.listMarginX/2,10)+.5,e?e==n.length-1&&(f=o):c=o,u=parseInt(r.top+r.height/2,10),this.w$(i,o,a-this.type.marginY/2,o,u,this.type.lineColor),this.w$(i,o,u,o+this.type.listMarginX/2,u,this.type.lineColor)):(o=parseInt(r.left+r.width/2,10)+.5,e?e==n.length-1&&(f=o):c=o,u=parseInt(r.top,10),this.w$(i,o,a,o,u,this.type.lineColor))),this.getItem(n[e]).open&&this.g$(n[e],i);t&&this.w$(i,c,a,f,a,this.type.lineColor)}},$getSize:function(t,i){var e=this.P.autowidth,s=this.P.autoheight;return e&&(
t=this.tt.offsetWidth+(this.tt.offsetHeight>i&&!s?q.scrollSize:0)),s&&(i=this.tt.offsetHeight+(this.tt.offsetWidth>t&&!e?q.scrollSize:0)),Hi.api.$getSize.call(this,t,i)},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i)&&(this.tt.style.width=this.$width+"px",this.tt.style.height=this.$height+"px",this.render())},type:{width:120,height:"auto",padding:20,marginX:20,marginY:20,listMarginX:0,listMarginY:0,lineColor:Li.organogramLineColor||"#90caf9",classname:function(t,i,e){var s="webix_organogram_item";return t.$css&&("object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css),e&&e.list_item&&(s+=" webix_organogram_list_item"),e&&e.$css&&(s+=e.$css),s+=" webix_organogram_level_"+t.$level,i.css&&(s+=" "+i.css),s},listClassName:function(t){var i="webix_organogram_list webix_organogram_list_"+t.$level;return t.$listCss&&("object"==M(t.$listCss)&&(t.$listCss=at(t.$listCss)),i+=" "+t.$listCss),i},template:Yt("#value#"),templateStart:function(t,i,e){var s="";if((!e||!e.list_item||i.listMarginX||i.listMarginY)&&this.$xy){var n=this.$xy[t.id];s+="width: "+n.width+"px; height: "+n.height+"px;",s+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div webix_dg_id="'+t.id+'" class="'+i.classname.call(this,t,i,e)+'"'+(s?'style="'+s+'"':"")+'">'},templateEnd:Yt("</div>"),templateListStart:function(t,i,e){var s="";if(this.$xy){var n=this.$xy[t.id];s+="width: "+n.width+"px;",s+="top: "+(n.top+n.height+i.marginY)+"px; left: "+n.left+"px;"}return'<div class="'+i.listClassName.call(this,t,i,e)+'"'+(s?'style="'+s+'"':"")+'">'},templateListEnd:Yt("</div>")}}),Kr=(H.protoUI(Jr,Pi,De,rs,oe,Ne,ze,je,Pe,as,_e,Hi.view,g),{$render_pie:function(t,i,e,s,n,h){this.x$(t,i,e,s,1,h,n)},x$:function(t,i,e,s,n,h,r){if(i.length){var o=this.y$(e,s),a=this.P.radius?this.P.radius:o.radius;if(!(a<0)){var u=this.M$(i),c=this.Jc(u),f=this.Xc(u,c),l=this.P.x?this.P.x:o.x,d=this.P.y?this.P.y:o.y;1==n&&this.P.shadow&&this.S$(t,l,d,a),d/=n;var v,_=-Math.PI/2,p=[];if(t.scale(1,n),this.P.gradient){var b=1!=n?l+a/3:l,m=1!=n?d+a/3:d;this.k$(t,l,d,a,b,m)}for(var g=0;g<i.length;g++)if(u[g]){t.strokeStyle=this.P.lineColor.call(this,i[g]),t.beginPath(),t.moveTo(l,d),p.push(_);var w=-Math.PI/2+f[g]-1e-4;t.arc(l,d,a,_,w,!1),t.lineTo(l,d);var x=this.P.color.call(this,i[g]);t.fillStyle=x,t.fill(),this.P.pieInnerText&&this.C$(l,d,5*a/6,_,w,n,this.P.pieInnerText(i[g],c),!0),this.P.label&&this.C$(l,d,a+this.P.labelOffset,_,w,n,this.P.label(i[g])),1!=n&&(this.D$(t,l,d,_,w,a,!0),t.fillStyle="#000000",t.globalAlpha=.2,this.D$(t,l,d,_,w,a,!1),t.globalAlpha=1,t.fillStyle=x),h.addSector(i[g].id,_,w,l-e.x,d-e.y/n,a,n,r),_=w}for(t.globalAlpha=.8,g=0;g<p.length;g++)v=this.I$(p[g],l,d,a),this.w$(t,l,d,v.x,v.y,this.P.lineColor.call(this,i[g]),2);(t.globalAlpha=1)==n&&this.P.border&&(t.lineWidth=this.P.borderWidth||2,t.strokeStyle=this.P.borderColor?this.P.borderColor.call(this):"#ffffff",t.beginPath(),t.arc(l,d,a+1,0,2*Math.PI,!1),t.stroke()),t.scale(1,1/n)}}},M$:function(t){for(var i=[],e=0;e<t.length;e++)i.push(Math.abs(parseFloat(this.P.value(t[e])||0)));return i},Jc:function(t){for(var i=0,e=0;e<t.length;e++)i+=t[e];return i},Xc:function(t,i){var e,s=[],n=0;i=i||this.Jc(t);for(var h=0;h<t.length;h++)e=t[h],s[h]=2*Math.PI*(i?(e+n)/i:1/t.length),n+=e;return s},y$:function(t,i){var e=i.x-t.x,s=i.y-t.y;return{x:t.x+e/2,y:t.y+s/2,radius:Math.min(e/2,s/2)}},D$:function(t,i,e,s,n,h,r){if(t.lineWidth=1,s<=0&&0<=n||0<=s&&n<=Math.PI||.003<Math.abs(s-Math.PI)&&s<=Math.PI&&n>=Math.PI){s<=0&&0<=n&&(s=0,r=!1,this.A$(t,i,e,h,s,n)),s<=Math.PI&&n>=Math.PI&&(n=Math.PI,r=!1,this.A$(t,i,e,h,s,n));var o=(this.P.pieHeight||Math.floor(h/4))/this.P.cant;t.beginPath(),t.arc(i,e,h,s,n,!1),t.lineTo(i+h*Math.cos(n),e+h*Math.sin(n)+o),t.arc(i,e+o,h,n,s,!0),t.lineTo(i+h*Math.cos(s),e+h*Math.sin(s)),t.fill(),r&&t.stroke()}},A$:function(t,i,e,s,n,h){t.beginPath(),t.arc(i,e,s,n,h,!1),t.stroke()},S$:function(t,i,e,s){t.globalAlpha=.5;for(var n=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"],h=n.length-1;-1<h;h--)t.beginPath(),t.fillStyle=n[h],t.arc(i+1,e+1,s+h,0,2*Math.PI,!0),t.fill(
);t.globalAlpha=1},F$:function(t){return t.addColorStop(0,"#ffffff"),t.addColorStop(.7,"#7a7a7a"),t.addColorStop(1,"#000000"),t},k$:function(t,i,e,s,n,h){var r;t.beginPath(),r="function"!=typeof this.P.gradient?(r=t.createRadialGradient(n,h,s/4,i,e,s),this.F$(r)):this.P.gradient(r),t.fillStyle=r,t.arc(i,e,s,0,2*Math.PI,!0),t.fill(),t.globalAlpha=.7},C$:function(t,i,e,s,n,h,r,o){var a=this.canvases[0].renderText(0,0,r,0,1);if(a){var u=a.scrollWidth;a.style.width=u+"px",t<u&&(u=t);var c=n-s<.2?4:8;o&&(c=u/1.8);var f=s+(n-s)/2;e-=(c-8)/2;var l=-c,d="right";(f>=Math.PI/2&&f<Math.PI||f<=3*Math.PI/2&&f>=Math.PI)&&(l=-u-l+1,d="left");var v=0;!o&&h<1&&0<f&&f<Math.PI&&(v=(this.P.height||Math.floor(e/4))/h);var _=(i+Math.floor((e+v)*Math.sin(f)))*h-8,p=t+Math.floor((e+c/2)*Math.cos(f))+l,b=n<Math.PI/2+.01,m=s<Math.PI/2;m&&b?p=Math.max(p,t+3):m||b?!o&&(f>=Math.PI/2&&f<Math.PI||f<=3*Math.PI/2&&f>=Math.PI)&&(p+=u/3):p=Math.min(p,t-u),a.style.top=_+"px",a.style.left=p+"px",a.style.width=u+"px",a.style.textAlign=d,a.style.whiteSpace="nowrap"}},$render_pie3D:function(t,i,e,s,n,h){this.x$(t,i,e,s,this.P.cant,h)},$render_donut:function(t,i,e,s,n,h){if(i.length){this.x$(t,i,e,s,1,h,n);var r=this.P,o=this.y$(e,s),a=r.radius?r.radius:o.radius;if(!(a<=0)){var u=r.innerRadius&&r.innerRadius<a?r.innerRadius:a/3,c=r.x?r.x:o.x,f=r.y?r.y:o.y;t.fillStyle=Li.backColor,t.beginPath(),t.arc(c,f,u,0,2*Math.PI,!0),t.fill()}}}}),Zr={$render_bar:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b,m,g=s.y-e.y;m=!!this.P.yAxis,b=!!this.P.xAxis,c=(u=this.T$()).max,f=u.min,o=(s.x-e.x)/i.length,n||"auto"!=this.P.origin&&!m||this.V$(i,e,s,f,c,o),m&&(c=parseFloat(this.P.yAxis.end),f=parseFloat(this.P.yAxis.start)),l=(v=this.z$(f,c))[0],d=v[1],p=l?g/l:l,m||"auto"!=this.P.origin&&b||(_=10,p=l?(g-_)/l:_),!n&&"auto"!=this.P.origin&&!m&&this.P.origin>f&&this.B$(t,i,e,s,o,s.y-p*(this.P.origin-f)),r=parseInt(this.P.barWidth,10);var w=0,x=0;for(a=0;a<this.H$.length;a++)a==n&&(x=w),"bar"==this.H$[a].type&&w++;this.H$&&o<r*w+4&&(r=parseInt(o/w-4,10));var y=(o-r*w)/2,M="undefined"!=typeof this.P.radius?parseInt(this.P.radius,10):Math.round(r/5),S=!1,k=this.P.gradient;for(k&&"function"!=typeof k?(S=k,k=!1):k&&(k=t.createLinearGradient(0,s.y,0,e.y),this.P.gradient(k)),b||this.w$(t,e.x,s.y+.5,s.x,s.y+.5,"#edeff0",1),a=0;a<i.length;a++){var C=parseFloat(this.P.value(i[a])||0);if(this.R$&&(C=this.E$(C)),C&&!isNaN(C)){c<C&&(C=c),C-=f,C*=d;var $=e.x+y+a*o+(r+1)*x,D=s.y,I=k||this.P.color.call(this,i[a]),A=this.P.border?1:0,F=this.P.label(i[a]);m||"auto"!=this.P.origin&&b?C==this.P.origin||"auto"==this.P.origin&&this.P.value(i[a])==f?(A=0,F=""):(C<0||this.P.yAxis&&0===C&&!("auto"!=this.P.origin&&this.P.origin>f))&&(C=A=0,F=""):C+=_/p,t.globalAlpha=this.P.alpha.call(this,i[a]);var T=this.VC(t,e,$,D,r,f,M,p,C,I,k,S,A);S&&this.P$(t,$,D,r,f,M,p,C,I,S,A),A&&this.j$(t,$,D,r,f,M,p,C,I),t.globalAlpha=1,T[0]!=$?this.canvases[n].renderTextAt(!1,!0,$+Math.floor(r/2),T[1],F):this.canvases[n].renderTextAt(!0,!0,$+Math.floor(r/2),T[3],F),h.addRect(i[a].id,[$-e.x,T[3]-e.y,T[2]-e.x,T[1]-e.y],n)}}},N$:function(t,i,e,s,n,h,r){var o=e;return"auto"!=this.P.origin&&this.P.origin>r&&(o=e-=(this.P.origin-r)*n,(s-=this.P.origin-r)<0&&(s*=-1,t.translate(i+h,e),t.rotate(Math.PI),e=i=0),e-=.5),{value:s,x0:i,y0:e,start:o}},VC:function(t,i,e,s,n,h,r,o,a,u,c,f,l){t.save(),t.fillStyle=u;var d=this.N$(t,e,s,a,o,n,h),v=this.L$(t,d.x0,d.y0,n,r,o,d.value,l);c&&!f&&t.lineTo(d.x0+l,i.y),t.fill(),t.restore();var _=d.x0,p=d.x0!=e?e+v[0]:v[0];return[_,d.x0!=e?d.start-v[1]-d.y0:d.y0,p,d.x0!=e?d.start-d.y0:v[1]]},O$:function(t,i){var e,s;s=Le.toRgb(i),(e=Le.rgbToHsv(s[0],s[1],s[2]))[2]/=1.4;var n="rgb("+Le.hsvToRgb(e[0],e[1],e[2])+")";t.strokeStyle=n,1==t.globalAlpha&&(t.globalAlpha=.9)},j$:function(t,i,e,s,n,h,r,o,a){var u;t.save(),u=this.N$(t,i,e,o,r,s,n),this.O$(t,a),this.L$(t,u.x0,u.y0,s,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},P$:function(t,i,e,s,n,h,r,o,a,u,c){t.save();var f=this.N$(t,i,e,o,r,s,n),l=this.W$(t,f.x0,f.y0,f.x0+s,f.y0-r*f.value+2,u,a,"y");t.fillStyle=l.gradient,this.L$(t,f.x0+l.offset,f.y0,
s-2*l.offset,h,r,f.value,l.offset+c),t.fill(),t.restore()},L$:function(t,i,e,s,n,h,r,o,a){t.beginPath();var u=0;if(h*r<n){var c=(n-h*r)/n;c<=1&&-1<=c&&(u=-Math.acos(c)+Math.PI/2)}t.moveTo(i+o,e);var f=e-Math.floor(h*r)+n+(n?0:o);n<h*r&&t.lineTo(i+o,f);var l=i+n;n&&0<n&&t.arc(l,f,Math.max(n-o,0),-Math.PI+u,-Math.PI/2,!1);var d=i+s-n-o,v=f-n+(n?o:0);t.lineTo(d,v),n&&0<n&&t.arc(d+o,f,Math.max(n-o,0),-Math.PI/2,0-u,!1);var _=i+s-o;return t.lineTo(_,e),a||t.lineTo(i+o,e),[_,v]}},Qr={$render_line:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b;if(u=this.U$(t,i,e,s,n),r=this.P,i.length){for(c=r.offset?e.x+.5*u.cellWidth:e.x,a=[],o=0;o<i.length;o++)if((b=this.Y$(i[o],e,s,u))||"0"==b){if(l=o?u.cellWidth*o-.5+c:c,v="object"==M(b)?b.y0:b,o&&this.P.fixOverflow){if((p=this.Y$(i[o-1],e,s,u)).out&&p.out==b.out)continue;f=u.cellWidth*(o-1)-.5+c,d="object"==M(p)?p.y0:p,p.out&&(_="min"==p.out?s.y:e.y,a.push({x:this.q$(f,l,d,v,_),y:_})),b.out&&(_="min"==b.out?s.y:e.y,a.push({x:this.q$(f,l,d,v,_),y:_}))}b.out||a.push({x:l,y:b,index:o})}for(this.G$=e,o=1;o<=a.length;o++)f=a[o-1].x,d=a[o-1].y,o<a.length&&(l=a[o].x,v=a[o].y,this.w$(t,f,d,l,v,r.line.color.call(this,i[o-1]),r.line.width),r.line&&r.line.shadow&&(t.globalAlpha=.3,this.w$(t,f+2,d+r.line.width+8,l+2,v+r.line.width+8,"#eeeeee",r.line.width+3),t.globalAlpha=1)),"undefined"!=typeof a[o-1].index&&this.X$(t,f,d,i[a[o-1].index],r.label(i[a[o-1].index]),n,h,e)}},q$:function(t,i,e,s,n){return t+(n-e)*(i-t)/(s-e)},X$:function(t,i,e,s,n,h,r){var o=this.P.item,a=parseInt(o.radius.call(this,s),10)||0,u=this.G$,c=o.type.call(this,s);if(a){if(t.save(),o.shadow){t.lineWidth=1,t.strokeStyle="#bdbdbd",t.fillStyle="#bdbdbd";for(var f=[.1,.2,.3],l=f.length-1;0<=l;l--)t.globalAlpha=f[l],t.strokeStyle="#d0d0d0",t.beginPath(),this.J$(t,i,e+2*a/3,a+l+1,c),t.stroke();t.beginPath(),t.globalAlpha=.3,t.fillStyle="#bdbdbd",this.J$(t,i,e+2*a/3,a+1,c),t.fill()}t.restore(),t.lineWidth=o.borderWidth,t.fillStyle=o.color.call(this,s),t.strokeStyle=o.borderColor.call(this,s),t.globalAlpha=o.alpha.call(this,s),t.beginPath(),this.J$(t,i,e,a+1,c),t.fill(),t.stroke(),t.globalAlpha=1}if(n&&this.canvases[h].renderTextAt(!1,!0,i,e-a-this.P.labelOffset,this.P.label.call(this,s)),r){var d=this.P.eventRadius||a+1;r.addRect(s.id,[i-d-u.x,e-d-u.y,i+d-u.x,e+d-u.y],h)}},J$:function(t,i,e,s,n){var h=[];if(!n||"square"!=n&&"s"!=n)if(!n||"diamond"!=n&&"d"!=n)h=!n||"triangle"!=n&&"t"!=n?[[i,e,s,0,2*Math.PI,!0]]:[[i,e-s],[i+Math.sqrt(3)*s/2,e+s/2],[i-Math.sqrt(3)*s/2,e+s/2],[i,e-s]];else{var r=1<t.lineWidth?t.lineWidth*Math.sqrt(2)/4:0;h=[[i,e-s],[i+s,e],[i,e+s],[i-s,e],[i+r,e-s-r]]}else h=[[i-(s*=Math.sqrt(2)/2)-t.lineWidth/2,e-s],[i+s,e-s],[i+s,e+s],[i-s,e+s],[i-s,e-s]];this.K$(t,h)},Y$:function(t,i,e,s){var n=s.minValue,h=s.maxValue,r=s.unit,o=s.valueFactor,a=this.P.value(t);this.R$&&(a=this.E$(a));var u=(parseFloat(a||0)-n)*o;this.P.yAxis||(u+=s.startValue/r);var c=e.y-r*u;return!this.P.fixOverflow||"line"!=this.P.type&&"area"!=this.P.type?(h<a&&(c=i.y),(u<0||a<n)&&(c=e.y)):h<a?c={y:i.y,y0:c,out:"max"}:(u<0||a<n)&&(c={y:e.y,y0:c,out:"min"}),c},U$:function(t,i,e,s,n){var h,r={};r.totalHeight=s.y-e.y,this.P.cellWidth?r.cellWidth=Math.min(s.x-e.x,this.P.cellWidth):r.cellWidth=(s.x-e.x)/(this.P.offset?i.length:i.length-1);var o=!!this.P.yAxis,a=-1!=this.P.type.indexOf("stacked")?this.Z$(i):this.T$();r.maxValue=a.max,r.minValue=a.min,n||this.V$(i,e,s,r.minValue,r.maxValue,r.cellWidth),o&&(r.maxValue=parseFloat(this.P.yAxis.end),r.minValue=parseFloat(this.P.yAxis.start));var u=this.z$(r.minValue,r.maxValue);return h=u[0],r.valueFactor=u[1],r.unit=h?r.totalHeight/h:10,r.startValue=0,o||(r.startValue=10,r.unit!=r.totalHeight&&(r.unit=h?(r.totalHeight-r.startValue)/h:10)),r}},to={$render_barH:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b,m,g,w,x,y,M,S,k,C;for(a=(s.y-e.y)/i.length,d=(l=this.T$("h")).max,v=l.min,x=s.x-e.x,C=!!this.P.xAxis,n||this.Q$(t,i,e,s,v,d,a),C&&(d=parseFloat(this.P.xAxis.end),v=parseFloat(this.P.xAxis.start)),b=(g=this.z$(v,d))[0],p=g[1],M=b?x/b:10,C||(w=10,M=b?(x-w)/b:10),(o=parseInt(this.P.barWidth,10)
)*this.H$.length+4>a&&(o=a/this.H$.length-4),r=Math.floor((a-o*this.H$.length)/2),m="undefined"!=typeof this.P.radius?parseInt(this.P.radius,10):Math.round(o/5),_=!1,(c=this.P.gradient)&&"function"!=typeof c?(_=c,c=!1):c&&(c=t.createLinearGradient(e.x,e.y,s.x,e.y),this.P.gradient(c)),C||this.w$(t,e.x-.5,e.y,e.x-.5,s.y,"#edeff0",1),f=0;f<i.length;f++)if(y=parseFloat(this.P.value(i[f]||0)),this.R$&&(y=this.E$(y)),y&&!isNaN(y))if(d<y&&(y=d),y-=v,y*=p,S=e.x,k=e.y+r+f*a+(o+1)*n,y<0&&"auto"==this.P.origin||this.P.xAxis&&0===y&&!("auto"!=this.P.origin&&this.P.origin>v))this.canvases[n].renderTextAt("middle","right",S+10,k+o/2+r,this.P.label(i[f]));else{y<0&&"auto"!=this.P.origin&&this.P.origin>v&&(y=0),C||(y+=w/M),u=c||this.P.color.call(this,i[f]),this.P.border&&this.tD(t,S,k,o,v,m,M,y,u),t.globalAlpha=this.P.alpha.call(this,i[f]);var $=this.iD(t,s,S,k,o,v,m,M,y,u,c,_);_&&this.eD(t,S,k,o,v,m,M,y,u,_),t.globalAlpha=1,$[3]==k?(this.canvases[n].renderTextAt("middle","left",$[0]-5,$[3]+Math.floor(o/2),this.P.label(i[f])),h.addRect(i[f].id,[$[0]-e.x,$[3]-e.y,$[2]-e.x,$[3]+o-e.y],n)):(this.canvases[n].renderTextAt("middle",!1,$[2]+5,$[1]+Math.floor(o/2),this.P.label(i[f])),h.addRect(i[f].id,[$[0]-e.x,k-e.y,$[2]-e.x,$[3]-e.y],n))}},sD:function(t,i,e,s,n,h,r,o,a){var u=0;if(h*r<n){var c=(n-h*r)/n;u=-Math.asin(c)+Math.PI/2}t.moveTo(i,e+o);var f=i+h*r-n-(n?0:o);f=Math.max(i,f),n<h*r&&t.lineTo(f,e+o);var l=e+n;n&&0<n&&t.arc(f,l,n-o,-Math.PI/2+u,0,!1);var d=e+s-n-(n?0:o),v=f+n-(n?o:0);t.lineTo(v,d),n&&0<n&&t.arc(f,d,n-o,0,Math.PI/2-u,!1);var _=e+s-o;return t.lineTo(i,_),a||t.lineTo(i,e+o),[v,_]},Q$:function(t,i,e,s,n,h,r){var o=0;this.P.xAxis&&(this.canvases.x||(this.canvases.x=this.nD("axis_x")),o=this.hD(this.canvases.x.getCanvas(),i,e,s,n,h)),this.P.yAxis&&(this.canvases.y||(this.canvases.y=this.nD("axis_y")),this.rD(this.canvases.y.getCanvas(),i,e,s,r,o))},rD:function(t,i,e,s,n,h){if(this.P.yAxis){var r,o=parseInt(h||e.x,10)-.5,a=s.y+.5,u=e.y;this.w$(t,o,a,o,u,this.P.yAxis.color,1);for(var c=0;c<i.length;c++){var f="auto"!=this.P.origin&&"barH"==this.P.type&&parseFloat(this.P.value(i[c]))<this.P.origin;r=u+n/2+c*n,this.canvases.y.renderTextAt("middle",!f&&"left",f?o+5:o-5,r,this.P.yAxis.template(i[c]),"webix_axis_item_y",f?0:o-10),this.P.yAxis.lines.call(this,i[c])&&this.w$(t,e.x,r,s.x,r,this.P.yAxis.lineColor.call(this,i[c]),1)}this.P.yAxis.lines.call(this,{})&&this.w$(t,e.x+.5,u+.5,s.x,u+.5,this.P.yAxis.lineColor.call(this,{}),1),this.oD(e,s)}},hD:function(t,i,e,s,n,h){var r,o={},a=this.P.xAxis;if(a){var u=s.y+.5,c=e.x-.5,f=s.x-.5,l=e.x;if(this.w$(t,c,u,f,u,a.color,1),a.step&&(r=parseFloat(a.step)),"undefined"!=typeof this.aD.step&&"undefined"!=typeof this.aD.start&&"undefined"!=typeof this.aD.end||(n=(o=this.uD(n,h)).start,h=o.end,r=o.step,this.P.xAxis.end=h,this.P.xAxis.start=n,this.P.xAxis.step=r),0!==r){for(var d=(f-c)*r/(h-n),v=0,_=n;_<=h;_+=r){var p=this.R$?Math.pow(10,_):_;o.fixNum&&(p=parseFloat(p).toFixed(o.fixNum));var b=Math.floor(c+v*d)+.5;if(_==n&&"auto"==this.P.origin||!a.lines.call(this,_)||this.w$(t,b,u,b,e.y,this.P.xAxis.lineColor.call(this,_),1),_==this.P.origin&&(l=b+1),r<1&&!this.R$){var m=Math.min(Math.floor(this.E$(r)),n<=0?0:Math.floor(this.E$(n))),g=Math.pow(10,-m);_=p=Math.round(p*g)/g}this.canvases.x.renderTextAt(!1,!0,b,u+2,a.template(p.toString()),"webix_axis_item_x"),v++}return this.canvases.x.renderTextAt(!0,!1,c,s.y+this.P.padding.bottom-3,this.P.xAxis.title,"webix_axis_title_x",s.x-e.x),l}}},cD:function(t,i,e,s,n,h,r){var o=i;return this.P.yAxis&&"auto"!=this.P.origin&&this.P.origin>r&&(o=i+=(this.P.origin-r)*n,(s-=this.P.origin-r)<0&&(s*=-1,t.translate(i,e+h),t.rotate(Math.PI),i=.5,e=0),i+=.5),{value:s,x0:i,y0:e,start:o}},iD:function(t,i,e,s,n,h,r,o,a,u,c,f){t.save();var l=this.cD(t,e,s,a,o,n,h);t.fillStyle=u,t.beginPath();var d=this.sD(t,l.x0,l.y0,n,r,o,l.value,this.P.border?1:0);c&&!f&&t.lineTo(i.x,l.y0+(this.P.border?1:0)),t.fill(),t.restore();var v=l.y0,_=l.y0!=s?s:d[1];return[l.y0!=s?l.start-d[0]:l.start,v,l.y0!=s?l.start:d[0],_]},tD:function(t,i,e,s,n,h,r,o,a){t.save();var u=this.cD(t,i,e,o,r,s,
n);t.beginPath(),this.O$(t,a),t.globalAlpha=.9,this.sD(t,u.x0,u.y0,s,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},eD:function(t,i,e,s,n,h,r,o,a,u){t.save();var c=this.cD(t,i,e,o,r,s,n),f=this.W$(t,c.x0,c.y0+s,c.x0+r*c.value,c.y0,u,a,"x");t.fillStyle=f.gradient,t.beginPath(),this.sD(t,c.x0,c.y0+f.offset,s-2*f.offset,h,r,c.value,f.offset),t.fill(),t.globalAlpha=1,t.restore()}},io={$render_stackedBar:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d=this.P,v=s.y-e.y,_=!!d.yAxis,p=!!d.xAxis,b=this.Z$(i),m=0===d.origin;r=b.max,o=b.min;var g=Math.floor((s.x-e.x)/i.length);n||(a=this.V$(i,e,s,o,r,g)),_&&(r=parseFloat(d.yAxis.end),o=parseFloat(d.yAxis.start));var w=this.z$(o,r);l=w[0],f=w[1];var x=l?v/l:10,y=parseInt(d.barWidth,10);g<y+4&&(y=g-4);var M=Math.floor((g-y)/2),S=!!d.gradient&&d.gradient;p||this.w$(t,e.x,s.y+.5,s.x,s.y+.5,"#edeff0",1);for(var k=0;k<i.length;k++){var C=Math.abs(parseFloat(d.value(i[k]||0)));this.R$&&(C=this.E$(C)),u=e.x+M+k*g;var $=m&&C<0;if(n?c=$?i[k].$startYN:i[k].$startY:(c=a-1,i[k].$startY=c,m&&($&&(c=a+1),i[k].$startYN=a+1)),C&&!isNaN(C)&&(n||m||(C-=o),C*=f,!(c<e.y+1))){var D=this.P.color.call(this,i[k]),I=Math.abs(c-(m?s.y+o*x:s.y))<3;t.globalAlpha=d.alpha.call(this,i[k]),t.fillStyle=t.strokeStyle=d.color.call(this,i[k]),t.beginPath();var A=c-x*C+(I?$?-1:1:0),F=this.fD(t,u-(d.border?.5:0),c,y+(d.border?.5:0),A,0,e.y);if(t.fill(),t.stroke(),S){t.save();var T=this.W$(t,u,c,u+y,F[1],S,D,"y");t.fillStyle=T.gradient,t.beginPath(),F=this.fD(t,u+T.offset,c,y-2*T.offset,A,d.border?1:0,e.y),t.fill(),t.restore()}d.border&&(t.save(),"string"==typeof d.border?t.strokeStyle=d.border:this.O$(t,D),t.beginPath(),this.fD(t,u-.5,parseInt(c,10)+.5,y+1,parseInt(A,10)+.5,0,e.y,I),t.stroke(),t.restore()),t.globalAlpha=1,this.canvases[n].renderTextAt(!1,!0,u+Math.floor(y/2),F[1]+(c-F[1])/2-7,this.P.label(i[k])),h.addRect(i[k].id,[u-e.x,F[1]-e.y,F[0]-e.x,i[k][$?"$startYN":"$startY"]-e.y],n),i[k][$?"$startYN":"$startY"]=F[1]}}},fD:function(t,i,e,s,n,h,r,o){t.moveTo(i,e),n<r&&(n=r),t.lineTo(i,n);var a=i+s,u=n;t.lineTo(a,u);var c=i+s;return t.lineTo(c,e),o||t.lineTo(i,e),[c,u]}},eo={$render_stackedBarH:function(t,i,e,s,n,h){var r,o,a,u,c=s.x-e.x,f=!!this.P.yAxis,l=this.Z$(i);r=l.max,o=l.min;var d=Math.floor((s.y-e.y)/i.length);n||this.Q$(t,i,e,s,o,r,d),f&&(r=parseFloat(this.P.xAxis.end),o=parseFloat(this.P.xAxis.start));var v=this.z$(o,r);u=v[0],a=v[1];var _=u?c/u:10,p=0;f||(p=10,_=u?(c-p)/u:10);var b=parseInt(this.P.barWidth,10);d<b+4&&(b=d-4);var m=(d-b)/2,g=!1,w=this.P.gradient;w&&(g=!0),f||this.w$(t,e.x-.5,e.y,e.x-.5,s.y,"#edeff0",1);var x=0,y=0;for(M=0;M<this.H$.length;M++)M==n&&(y=x),"stackedBarH"==this.H$[M].type&&x++;for(var M=0;M<i.length;M++){y||(i[M].$startX=e.x);var S=Math.abs(parseFloat(this.P.value(i[M]||0)));r<S&&(S=r),S-=o,S*=a;var k=e.x,C=e.y+m+M*d;if(y?k=i[M].$startX:i[M].$startX=k,S&&!isNaN(S)){f||(S+=p/_);var $=this.P.color.call(this,i[M]);t.globalAlpha=this.P.alpha.call(this,i[M]),t.fillStyle=this.P.color.call(this,i[M]),t.beginPath();var D=this.sD(t,k,C,b,0,_,S,0);if(w&&!g&&t.lineTo(e.x+c,C+(this.P.border?1:0)),t.fill(),g){var I=this.W$(t,k,C+b,k,C,g,$,"x");t.fillStyle=I.gradient,t.beginPath(),D=this.sD(t,k,C,b,0,_,S,0),t.fill()}this.P.border&&this.tD(t,k,C,b,o,0,_,S,$),t.globalAlpha=1,this.canvases[n].renderTextAt("middle",!0,i[M].$startX+(D[0]-i[M].$startX)/2-1,C+(D[1]-C)/2,this.P.label(i[M])),h.addRect(i[M].id,[i[M].$startX-e.x,C-e.y,D[0]-e.x,D[1]-e.y],n),i[M].$startX=D[0]}}}},so={$render_area:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b,m,g,w;if(f=this.U$(t,i,e,s,n),u=(o=this.P).eventRadius||Math.floor(f.cellWidth/2),i.length){for(l=[],_=o.offset?e.x+.5*f.cellWidth:e.x,a=0;a<i.length;a++)if(c=i[a],v=this.Y$(c,e,s,f),m=_+f.cellWidth*a,v){if(g="object"==M(v)?v.y0:v,a&&this.P.fixOverflow){if((d=this.Y$(i[a-1],e,s,f)).out&&d.out==v.out)continue;p=f.cellWidth*(a-1)-.5+_,b="object"==M(d)?d.y0:d,d.out&&(w="min"==d.out?s.y:e.y,l.push([this.q$(p,m,b,g,w),w])),v.out&&(w="min"==v.out?s.y:e.y,l.push([this.q$(p,m,b,g,w),w]),a==i.length-1&&w==e.y&&l.push([m,e.y]))}v.out||(l.push([m,g]),h.addRect(c.id,[
m-u-e.x,g-u-e.y,m+u-e.x,g+u-e.y],n)),o.yAxis||(r=o.offset||a!=i.length-1?"center":"left",this.canvases[n].renderTextAt(!1,r,m,g-o.labelOffset,o.label(c)))}l.length&&(l.push([m,s.y]),l.push([l[0][0],s.y])),t.globalAlpha=this.P.alpha.call(this,i[0]),t.fillStyle=this.P.color.call(this,i[0]),t.beginPath(),this.K$(t,l),t.fill(),t.lineWidth=1,t.globalAlpha=1,o.border&&(t.lineWidth=o.borderWidth||1,o.borderColor?t.strokeStyle=o.borderColor.call(this,i[0]):this.O$(t,t.fillStyle),t.beginPath(),this.K$(t,l),t.stroke())}},$render_stackedArea:function(t,e,i,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b,m,g,w,x,y;if(v=this.U$(t,e,i,s,n),l=(u=this.P).eventRadius||Math.floor(v.cellWidth/2),e.length){_=[],m=[],p=u.offset?i.x+.5*v.cellWidth:i.x;var M=function(t,i){return n?e[t].$startY?i-s.y+e[t].$startY:0:i};for(c=0;c<e.length;c++)d=e[c],c?p+=v.cellWidth:(b=M(c,s.y),_.push([p,b])),b=M(c,this.Y$(d,i,s,v)),m.push(isNaN(b)&&!c?e[c].$startY||s.y:b),b&&(_.push([p,b]),h.addRect(d.id,[p-l-i.x,b-l-i.y,p+l-i.x,b+l-i.y],n),u.yAxis||(u.offset,a="center",this.canvases[n].renderTextAt(!1,a,p,b-u.labelOffset,u.label(d))));if(_.push([p,M(c-1,s.y)]),n)for(c=e.length-2;0<c;c--)p-=v.cellWidth,(b=e[c].$startY)&&_.push([p,b]);for(_.push([_[0][0],_[0][1]]),t.globalAlpha=this.P.alpha.call(this,e[0]),t.fillStyle=this.P.color.call(this,e[0]),t.beginPath(),this.K$(t,_),t.fill(),c=0;c<e.length;c++){if(!(b=m[c]))for(c==e.length-1&&(b=e[c].$startY),f=c+1;f<e.length;f++)if(m[f]){r={x:i.x,y:m[0]},o={x:i.x+v.cellWidth*f,y:m[f]},g=i.x+v.cellWidth*c,void 0,b=(y=((x=o).y-(w=r).y)/(x.x-w.x))*g+w.y-y*w.x;break}e[c].$startY=b}}}},no={$render_radar:function(t,i,e,s,n,h){this.lD(t,i,e,s,n,h)},lD:function(t,i,e,s,n,h){if(i.length){for(var r=this.y$(e,s),o=this.P.radius?this.P.radius:r.radius,a=this.P.x?this.P.x:r.x,u=this.P.y?this.P.y:r.y,c=[],f=0;f<i.length;f++)c.push(1);var l=this.Xc(c,i.length);this.G$=e,n||this.dD(l,a,u,o,i),this.vD(t,l,a,u,o,i,n,h)}},vD:function(t,i,e,s,n,h,r,o){var a,u,c,f,l,d,v,_,p,b,m,g,w,x,y,M,S,k,C;for(l=(c=this.P).yAxis.start,d=c.yAxis.end,k=(g=(C=this.z$(l,d))[0])?n/g:n/2,S=C[1],a=u=w=-Math.PI/2,p=[],f=_=0;f<h.length;f++)y=M||(x=c.value(h[f]),this.R$&&(x=this.E$(x)),(parseFloat(x||0)-l)*S),b=Math.floor(k*y),x=c.value(f!=h.length-1?h[f+1]:h[0]),this.R$&&(x=this.E$(x)),M=(parseFloat(x||0)-l)*S,m=Math.floor(k*M),a=u,u=f!=h.length-1?w+i[f]-1e-4:w,v=_||this.I$(a,e,s,b),_=this.I$(u,e,s,m),p.push(v);c.fill&&this._D(t,p,h),!c.disableLines&&2<h.length&&this.pD(t,p,h),(!c.disableItems||h.length<3)&&this.bD(t,p,h,r,o),p=null},bD:function(t,i,e,s,n){for(var h=0;h<i.length;h++)this.X$(t,i[h].x,i[h].y,e[h],this.P.label.call(this,e),s,n)},_D:function(t,i,e){var s,n;t.globalAlpha=this.P.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.P.fill.call(this,e[h]),s=i[h],n=i[h+1]||i[0],h||t.moveTo(s.x,s.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},pD:function(t,i,e){for(var s,n,h=0;h<i.length;h++)s=i[h],n=i[h+1]||i[0],this.w$(t,s.x,s.y,n.x,n.y,this.P.line.color.call(this,e[h]),this.P.line.width)},dD:function(t,i,e,s,n){var h=this.P.yAxis,r=this.P.xAxis,o=h.start,a=h.end,u=h.step,c={},f=this.mD;if("undefined"==typeof f.step||"undefined"==typeof f.start||"undefined"==typeof f.end){var l=this.T$();o=(c=this.uD(l.min,l.max)).start,a=c.end,u=c.step,h.end=a,h.start=o}var d,v,_,p,b,m=[],g=0,w=s*u/(a-o);u<1&&(p=Math.min(this.E$(u),o<=0?0:this.E$(o)),b=Math.pow(10,-p));var x=[];this.canvases.scale||(this.canvases.scale=this.nD("radar_scale"));var y=this.canvases.scale.getCanvas();for(d=a;o<=d;d-=u){var M=this.R$?Math.pow(10,d):d;c.fixNum&&(M=parseFloat(d).toFixed(c.fixNum)),m.push(Math.floor(g*w)+.5),b&&!this.R$&&(d=M=Math.round(M*b)/b);var S=e-s+m[m.length-1];this.canvases.scale.renderTextAt("middle","left",i,S,h.template(M.toString()),"webix_axis_item_y webix_radar");var k,C=-Math.PI/2,$=C;for(v=0;v<t.length;v++)g||x.push($),k=C+t[v]-1e-4,this.gD(y,2<t.length?f.lineShape||"line":"arc",i,e,s-m[m.length-1],$,k,d,v,n[d]),$=k;g++}for(d=0;d<x.length;d++)_=this.I$(x[d],i,e,s),r&&(r.lines.call(this,n[d],d)&&this.w$(y,i,e,_.x,_.y,r.lineColor.call(this,n[d]),1),
this.wD(y,i,e,s,x[d],r.template.call(this,n[d])))},gD:function(t,i,e,s,n,h,r,o,a){var u,c;if(n<0)return!1;u=this.I$(h,e,s,n),c=this.I$(r,e,s,n);var f=this.P.yAxis;f.bg&&(t.beginPath(),t.moveTo(e,s),"arc"==i?t.arc(e,s,n,h,r,!1):(t.lineTo(u.x,u.y),t.lineTo(c.x,c.y)),t.fillStyle=f.bg(o,a),t.moveTo(e,s),t.fill(),t.closePath()),f.lines.call(this,o)&&(t.lineWidth=1,t.beginPath(),"arc"==i?t.arc(e,s,n,h,r,!1):(t.moveTo(u.x,u.y),t.lineTo(c.x,c.y)),t.strokeStyle=f.lineColor.call(this,o),t.stroke())},wD:function(t,i,e,s,n,h){if(!h)return!1;var r=this.canvases.scale.renderText(0,0,h,"webix_axis_radar_title",1),o=r.scrollWidth,a=r.offsetHeight,u=this.I$(n,i,e,s+5),c=0,f=0;(n<0||n>Math.PI)&&(f=-a),n>Math.PI/2&&(c=-o),Math.abs(n+Math.PI/2)<.001||Math.abs(n-Math.PI/2)<.001?c=-o/2:(Math.abs(n)<.001||Math.abs(n-Math.PI)<.001)&&(f=-a/2),r.style.top=u.y+f+"px",r.style.left=u.x+c+"px",r.style.width=o+"px",r.style.whiteSpace="nowrap"}},ho={$render_scatter:function(t,i,e,s,n,h){if(this.P.xValue){var r=this.P,o=!(r.disableLines||"undefined"==typeof r.disableLines),a=this.T$(),u=this.T$("h","xValue");n||(this.canvases.x||(this.canvases.x=this.nD("axis_x")),this.canvases.y||(this.canvases.y=this.nD("axis_y")),this.xD(this.canvases.y.getCanvas(),i,e,s,a.min,a.max),this.hD(this.canvases.x.getCanvas(),i,e,s,u.min,u.max)),a={min:r.yAxis.start,max:r.yAxis.end},u={min:r.xAxis.start,max:r.xAxis.end};var c=this.yD(t,i,e,s,u,a);this.G$=e;for(var f,l,d,v,_,p=[],b=0;b<i.length;b++){var m=this.MD(c,s,e,u,i[b],"X"),g=this.MD(c,e,s,a,i[b],"Y");isNaN(m)||isNaN(g)||p.push({x:m,y:g,index:b})}for(var w=0;w<p.length;w++){if(_=p[w].index,o){var x=r.line.color.call(this,i[_]);f=p[w].x,l=p[w].y,w==p.length-1?r.shape&&2<p.length&&(this.w$(t,d,v,p[0].x,p[0].y,x,r.line.width),r.disableItems||this.SD(t,h,p[0],i[0],n),r.fill&&this.kD(t,p,i)):(d=p[w+1].x,v=p[w+1].y,this.w$(t,f,l,d,v,x,r.line.width))}!r.disableItems&&p[w]&&this.SD(t,h,p[w],i[_],n)}}},kD:function(t,i,e){var s,n;t.globalAlpha=this.P.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.P.fill.call(this,e[h]),s=i[h],n=i[h+1]||i[0],h||t.moveTo(s.x,s.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},yD:function(t,i,e,s,n,h){var r={};return r.totalHeight=s.y-e.y,r.totalWidth=s.x-e.x,this.CD(r,n.min,n.max,r.totalWidth,"X"),this.CD(r,h.min,h.max,r.totalHeight,"Y"),r},SD:function(t,i,e,s,n){this.X$(t,e.x,e.y,s,this.P.label.call(this,s),n,i)},MD:function(t,i,e,s,n,h){var r=this.P["X"==h?"xValue":"value"].call(this,n),o=t["valueFactor"+h],a=(parseFloat(r||0)-s.min)*o,u=t["unit"+h],c=e[h.toLowerCase()]-("X"==h?-1:1)*Math.floor(u*a);return a<0&&(c=e[h.toLowerCase()]),r>s.max&&(c=i[h.toLowerCase()]),r<s.min&&(c=e[h.toLowerCase()]),c},CD:function(t,i,e,s,n){var h=this.z$(i,e);t["relValue"+(n=n||"")]=h[0],t["valueFactor"+n]=h[1],t["unit"+n]=t["relValue"+n]?s/t["relValue"+n]:10}},ro={$render_splineArea:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b,m,g=this.P,w=[];if(f=this.U$(t,i,e,s,n),c=g.eventRadius||Math.floor(f.cellWidth/2),a=[],i.length){for(v=e.x,o=0;o<i.length;o++)((b=this.Y$(i[o],e,s,f))||"0"==b)&&(d=o?f.cellWidth*o-.5+v:v,a.push({x:d,y:b,index:o}),h.addRect(i[o].id,[d-c-e.x,b-c-e.y,d+c-e.x,b+c-e.y],n));for(l=this.$D(a),o=0;o<a.length;o++)if(_=a[o].x,o<a.length-1){for(p=a[o+1].x,m=a[o+1].y,u=_;u<p;u++){var x=this.DD(u,_,o,l.a,l.b,l.c,l.d);x<e.y&&(x=e.y),x>s.y&&(x=s.y);var y=this.DD(u+1,_,o,l.a,l.b,l.c,l.d);y<e.y&&(y=e.y),y>s.y&&(y=s.y),w.push([u,x]),w.push([u+1,y])}w.push([p,m])}r=this.P.color.call(this,i[0]),w.length&&(w.push([p,s.y]),w.push([w[0][0],s.y])),t.globalAlpha=this.P.alpha.call(this,i[0]),t.fillStyle=r,t.beginPath(),this.K$(t,w),t.fill(),t.lineWidth=1,t.globalAlpha=1,g.border&&(t.lineWidth=g.borderWidth||1,g.borderColor?t.strokeStyle=g.borderColor.call(this,i[0]):this.O$(t,r),t.beginPath(),w.splice(w.length-3),this.K$(t,w),t.stroke())}}},oo={dynamic_setter:function(t){return t&&function i(r){if(r.ID)return;var o=r.P;o.cellWidth||(o.cellWidth=30);o.animateDuration||(o.animateDuration=400);o.offset=!1,r.ID=r.attachEvent("onBeforeRender",function(t,i){var e=r.AD(r.me,r.we)
;!function s(e){uo(e,function(t,i){i.Ee(e.me+2*e.P.cellWidth,e.we)})}(r),function h(t,i,e,s){if(s&&t.length){var n=Math.ceil((e.x-i.x)/s);t.length>n+1&&t.splice(0,t.length-n-1)}}(t,e.start,e.end,o.cellWidth),"add"==i&&function n(i){var t=i.P.cellWidth;i.FD!=t&&(i.FD=t,i.render());i.FD=0,i.TD=null,window.requestAnimationFrame&&!document.hidden&&window.requestAnimationFrame(function(t){!function h(i,t){var e,s=i.P.animateDuration,n=i.P.cellWidth;n&&1<i.count()&&(i.TD||(i.TD=t),e=t-i.TD,i.FD=Math.min(Math.max(e/s*n,1),n),i.render(),e<s&&window.requestAnimationFrame(function(t){h(i,t)}))}(i,t)});i.VD||(i.VD=i.attachEvent("onAfterRender",function(t){!function h(t,c){var f=t.count(),e=t.AD(t.me,t.we),l=t.P.cellWidth,d=t.FD||0,i=c.length<f||(c.length-1)*l>e.end.x-e.start.x;function s(t,i,e,s){var n=t.getCanvas(),h=t.He,r=t.Te,o=t.Ve;if(d&&(c.length<f||(c.length-1)*l>e-i)?(h.style.left=-d+"px",1<c.length&&(!function u(t,i,e){if(t.length){dt(t[0]);for(var s=1;s<t.length;s++)ao(e,t[s])||(t[s].style.left=t[s].offsetLeft-i+"px")}}(r,d,o),n.clearRect(0,0,i+d,h.offsetHeight),n.clearRect(e+d,0,h.offsetWidth,h.offsetHeight))):(h.style.left="0px",s||d==l||n.clearRect(i+(c.length-1)*l-l+d,0,h.offsetWidth,h.offsetHeight)),1<r.length&&d&&d!=l){var a=r.length-1;ao(o,r[a])&&(a-=1),r[a].style.display="none"}}uo(t,function(t,i){s(i,e.start.x,e.end.x,"x"==t)}),function n(t,i,e){t.Wi.Ni.style.left=i.start.x-e+"px",t.Wi.Ni.style.width=i.end.x-i.start.x+e+"px"}(t,e,i?d:0)}(i,t)}))}(r)}),r.zD=r.attachEvent("onBeforeXAxis",function(t,i,e,s,n,h){return function _(t,i,e,s,n,h,r){var o,a,u,c,f=t.P,l=s.x-.5,d=parseInt(r||n.y,10)+.5,v=n.x;if(!f.dynamic)return!1;for(u=(e.length-1)*h>v-l||e.length<t.count(),a=0;a<e.length;a++)c=l+a*h,o=u?1<a:!!a,c=Math.ceil(c)-.5,t.BD(c,d,e[a],o),a&&f.xAxis.lines.call(t,e[a])&&t.HD(i,c,n.y,s.y,e[a]);t.canvases.x.renderTextAt(!0,!1,l,n.y+f.padding.bottom-3,f.xAxis.title,"webix_axis_title_x",n.x-s.x),t.w$(i,l,d,v+(u?t.FD:0),d,f.xAxis.color,1)}(r,t,i,e,s,n,h),!1})}(this),t}};function ao(t,i){return"axis_x"===t&&-1!==i.className.indexOf("webix_axis_title_x")}function uo(t,i){if(t.canvases){for(var e=0;e<t.H$.length;e++)t.canvases[e]&&i(e,t.canvases[e]);t.canvases.x&&i("x",t.canvases.x)}}var co={name:"chart",$init:function(t){if(this.H$=[this.P],this.RD=[],this.Wi.className+=" webix_chart",this.$ready.push(this.rr),t.preset&&this.ED(t),t.series){var i=t.series;delete t.series,t.series=i}this.data.provideApi(this,!0)},rr:function(){this.data.attachEvent("onStoreUpdated",S(function(){this.render.apply(this,arguments)},this))},defaults:{ariaLabel:"chart",color:"default",alpha:"1",radius:0,label:!1,value:"{obj.value}",padding:{},type:"pie",lineColor:"#ffffff",cant:.5,barWidth:30,line:{width:2,color:"#1ca1c1"},item:{radius:3,borderColor:"#1ca1c1",borderWidth:2,color:"#ffffff",alpha:1,type:"r",shadow:!1},shadow:!1,gradient:!1,border:!1,labelOffset:20,origin:"auto",scale:"linear"},Qo:"webix_area_id",on_click:{webix_chart_legend_item:function(t,i,e){var s=e.getAttribute("series_id");if(this.callEvent("onLegendClick",[t,s,e])&&void 0!==s&&1<this.H$.length){var n=this.P,h=n.legend.values;(h&&h[s].toggle||n.legend.toggle)&&(-1!=e.className.indexOf("hidden")?this.showSeries(s):this.hideSeries(s))}}},on_dblclick:{},on_mouse_move:{},locate:function(t){return _t(t,this.Qo)},$setSize:function(t,i){var e=Hi.api.$setSize.call(this,t,i);if(e){for(var s in this.canvases)this.canvases[s].Ee(this.me,this.we);this.render()}return e},type_setter:function(t){return this["$render_"+t],"undefined"==typeof this.P.offset&&(this.P.offset=!(-1!=t.toLowerCase().indexOf("area"))),"radar"!=t||this.P.yAxis||this.define("yAxis",{}),"scatter"==t&&(this.P.yAxis||this.define("yAxis",{}),this.P.xAxis||this.define("xAxis",{})),t},destructor:function(){this.removeAllSeries(),ki.destructor.apply(this,arguments)},removeAllSeries:function(){this.clearCanvas(),this.PD&&(this.PD.innerHTML="",this.PD.parentNode.removeChild(this.PD),this.PD=null),this.canvases&&(this.canvases={}),this.Wi.innerHTML="",this.H$=[]},clearCanvas:function(){if(this.canvases&&"object"==M(
this.canvases))for(var t in this.canvases)this.canvases[t].clearCanvas()},render:function(t,i,e){var s,n,h,r;if(this.isVisible(this.P.id)&&(n=this.jD(),this.callEvent("onBeforeRender",[n,e]))){if(this.canvases&&"object"==M(this.canvases))for(var o in this.canvases)this.canvases[o].clearCanvas();else this.canvases={};if(this.P.legend&&(this.canvases.legend||(this.canvases.legend=this.nD("legend")),this.ND(this.data.getRange(),this.me,this.we)),this.du=h=new Ae(this.Qo),r=this.P,s=this.AD(this.me,this.we),this.H$)for(var a=0;a<this.H$.length;a++)this.P=this.H$[a],this.canvases[a]||(this.canvases[a]=this.nD(this.name+" "+a,"z-index:"+(2+a),null,a,this.P.ariaLabel)),this["$render_"+this.P.type](this.canvases[a].getCanvas(),n,s.start,s.end,a,h);if(h.render(this.Wi),this.Wi.lastChild.style.zIndex=80,this.LD(this.Wi.lastChild,s),this.callEvent("onAfterRender",[n]),this.P=r,this.P.legend&&this.P.legend.values)for(var u=this.P.legend.values,c=0;c<u.length;c++)u[c].$hidden&&this.hideSeries(c)}},LD:function(t,i){var e={};for(var s in e.left=i.start.x,e.top=i.start.y,e.width=i.end.x-i.start.x,e.height=i.end.y-i.start.y,e)t.style[s]=e[s]+"px"},jD:function(){var t,i,e,s,n,h,r,o,a,u;if(s=this.data.getRange(),t=-1!=this.P.type.toLowerCase().indexOf("barh")?"yAxis":"xAxis",(i=this.P[t])&&i.units&&"object"==M(i.units)){if(o=[],"undefined"!=typeof(e=i.units).start&&"undefined"!=typeof e.end&&"undefined"!=typeof e.next)for(r=e.start;r<=e.end;)o.push(r),r=e.next.call(this,r);else"[object Array]"===Object.prototype.toString.call(e)&&(o=e);if(h=[],o.length){for(a=i.value,u={},n=0;n<s.length;n++)u[a(s[n])]=n;for(n=0;n<o.length;n++)"undefined"!=typeof u[o[n]]?(s[u[o[n]]].$unit=o[n],h.push(s[u[o[n]]])):h.push({$unit:o[n]})}return h}return s},series_setter:function(t){if(t&&"object"==M(t)){this.Rt(t.length?t[0]:t),this.H$=[this.P];for(var i=1;i<t.length;i++)this.addSeries(t[i])}else;return t},value_setter:Yt,xValue_setter:Yt,yValue_setter:function(t){this.define("value",t)},alpha_setter:Yt,label_setter:Yt,lineColor_setter:Yt,borderColor_setter:Yt,pieInnerText_setter:Yt,gradient_setter:function(t){return"function"!=typeof t&&t&&!0===t&&(t="light"),t},colormap:{RAINBOW:function(t){var i=Math.floor(this.getIndexById(t.id)/this.count()*1536);return 1536==i&&(i-=1),this.OD[Math.floor(i/256)](i%256)},"default":function(t){var i=this.count(),e=this.Yc.length,s=this.getIndexById(t.id);return i<e?(s&&(s=s<e-i?this.Uc+2:this.Uc+1),this.Uc=s):s%=e,this.Yc[s]}},color_setter:function(t){return this.colormap[t]||Yt(t)},fill_setter:function(t){return!(!t||"0"==t)&&Yt(t)},ED:function(t){this.define("preset",t.preset),delete t.preset},preset_setter:function(t){var i,e,s;if(this.defaults=H.extend({},this.defaults),"object"!=M(s=this.presets[t]))return!1;for(i in s)if("object"==M(s[i]))if(this.defaults[i]&&"object"==M(this.defaults[i]))for(e in this.defaults[i]=H.extend({},this.defaults[i]),s[i])this.defaults[i][e]=s[i][e];else this.defaults[i]=H.extend({},s[i]);else this.defaults[i]=s[i];return t},legend_setter:function(t){return t?("object"!=M(t)&&(t={template:t}),this.Ei(t,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:-1!=this.P.type.toLowerCase().indexOf("stacked")?"":"hide",marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3}),t.template=Yt(t.template),t):(this.PD&&(this.PD.innerHTML="",this.PD=null),!1)},item_setter:function(t){"object"!=M(t)&&(t={color:t,borderColor:t}),this.Ei(t,H.extend({},this.defaults.item));return this.WD(["alpha","borderColor","color","radius","type"],t),t},line_setter:function(t){return"object"!=M(t)&&(t={color:t}),(t=H.extend(t,this.defaults.line)).color=Yt(t.color),t},padding_setter:function(t){return"object"!=M(t)&&(t={left:t,right:t,top:t,bottom:t}),this.Ei(t,{left:50,right:20,top:35,bottom:40}),t},xAxis_setter:function(t){if(!t)return!1;"object"!=M(t)&&(t={template:t}),this.Ei(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0});return this.WD(["lineColor","template","lines"],t),this.aD=H.extend({},t),t},yAxis_setter:function(t){this.Ei(t,{title:"",
color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0,bg:Li.backColor});return this.WD(["lineColor","template","lines","bg"],t),this.mD=H.extend({},t),t},WD:function(t,i){for(var e=0;e<t.length;e++)i[t[e]]=Yt(i[t[e]])},nD:function(t,i,e,s,n){var h={container:e||this.Wi,name:t,title:R(n)?t:n||"",series:s,style:i||"",width:this.me,height:this.we};return new ji(h)},V$:function(t,i,e,s,n,h){var r,o=0;return this.P.yAxis&&(this.canvases.y||(this.canvases.y=this.nD("axis_y")),o=this.xD(this.canvases.y.getCanvas(),t,i,e,s,n)),this.P.xAxis&&(this.canvases.x||(this.canvases.x=this.nD("axis_x")),r=this.canvases.x.getCanvas(),this.callEvent("onBeforeXAxis",[r,t,i,e,h,o])&&this.B$(r,t,i,e,h,o)),o},B$:function(t,i,e,s,n,h){var r,o,a=this.P,u=e.x-.5,c=parseInt(h||s.y,10)+.5,f=s.x,l=!0,d="stackedBar"==a.type?s.y+.5:c;for(r=0;r<i.length;r++){!0===a.offset?o=u+n/2+r*n:(o=r!=i.length-1||a.cellWidth?u+r*n:s.x,l=!!r),o=Math.ceil(o)-.5;var v="auto"!=a.origin&&"bar"==a.type&&parseFloat(a.value(i[r]))<a.origin;this.BD(o,d,i[r],l,v),(a.offset||r||a.cellWidth)&&a.xAxis.lines.call(this,i[r])&&this.HD(t,o,s.y,e.y,i[r])}this.canvases.x.renderTextAt(!0,!1,u,s.y+a.padding.bottom-3,a.xAxis.title,"webix_axis_title_x",s.x-e.x),this.w$(t,u,c,f,c,a.xAxis.color,1),a.xAxis.lines.call(this,{})&&a.offset&&this.w$(t,f+.5,s.y,f+.5,e.y+.5,a.xAxis.lineColor.call(this,{}),1)},xD:function(t,i,e,s,n,h){var r,o={};if(this.P.yAxis){var a=e.x-.5,u=s.y,c=e.y,f=s.y+.5;if(this.P.yAxis.step&&(r=parseFloat(this.P.yAxis.step)),"undefined"==typeof this.mD.step||"undefined"==typeof this.mD.start||"undefined"==typeof this.mD.end?(n=(o=this.uD(n,h)).start,h=o.end,r=o.step,this.P.yAxis.end=h,this.P.yAxis.start=n):"logarithmic"==this.config.scale&&(this.R$=!0),this.oD(e,s),0!==r){if(h==n)return u;for(var l=(u-c)*r/(h-n),d=0,v=n;v<=h;v+=r){var _=this.R$?Math.pow(10,v):v;o.fixNum&&(_=parseFloat(_).toFixed(o.fixNum));var p=Math.floor(u-d*l)+.5;if(v==n&&"auto"==this.P.origin||!this.P.yAxis.lines.call(this,v)||this.w$(t,a,p,s.x,p,this.P.yAxis.lineColor.call(this,v),1),v==this.P.origin&&(f=p),r<1&&!this.R$){var b=Math.min(Math.floor(this.E$(r)),n<=0?0:Math.floor(this.E$(n))),m=Math.pow(10,-b);v=_=Math.round(_*m)/m}this.canvases.y.renderText(0,p-5,this.P.yAxis.template(_.toString()),"webix_axis_item_y",e.x-5),d++}return this.w$(t,a,u+1,a,c,this.P.yAxis.color,1),f}}},oD:function(t,i){var e=this.canvases.y.renderTextAt("middle",!1,0,parseInt((i.y-t.y)/2+t.y,10),this.P.yAxis.title,"webix_axis_title_y");e&&(e.style.left=(q.transform?(e.offsetHeight-e.offsetWidth)/2:0)+"px")},UD:function(t,i){return{start:Math.floor(this.E$(t)),step:1,end:Math.ceil(this.E$(i))}},YD:function(t){var i=Math.floor(this.E$(t)),e=Math.pow(10,i),s=t/e;return s=5<s?10:5,parseInt(s,10)*e},uD:function(t,i){if(this.R$=!1,"logarithmic"==this.P.scale){var e=Math.floor(this.E$(t)),s=Math.ceil(this.E$(i));if(0<t&&0<i&&1<s-e)return this.R$=!0,this.UD(t,i)}var n,h;"auto"!=this.P.origin&&this.P.origin<t&&(t=this.P.origin);var r=this.YD((i-t)/8||1),o=Math.floor(this.E$(r));if(r>Math.abs(t))n=t<0?-r:0;else{var a=Math.abs(t),u=Math.floor(this.E$(a)),c=a/Math.pow(10,u);for(n=0!=u||.1<=r?Math.ceil(10*c)/10*Math.pow(10,u)-r:a,1<a&&.1<r&&(n=Math.ceil(n));t<0?n<=t:t<=n;)n-=r;t<0&&(n=-n-2*r),n-=n%r,n=parseFloat((1*n).toFixed(Math.abs(o)))}for(10<i-n&&(r=this.YD((i-n)/8||1)),h=n,0==i&&i==t&&(i=r);h<i;)h+=r,h=parseFloat((1*h).toFixed(Math.abs(o)));return{start:n,end:h,step:r,fixNum:o<0?Math.abs(o):0}},T$:function(t,i){var e,s,n=this.data.no(),h=arguments.length&&"h"==t?this.aD:this.mD;if(i=i||"value",h&&"undefined"!=typeof h.end&&"undefined"!=typeof h.start&&h.step)e=parseFloat(h.end),s=parseFloat(h.start);else if(e=Ce.max(this.H$[0][i],n),s=h&&"undefined"!=typeof h.start?parseFloat(h.start):Ce.min(this.H$[0][i],n),1<this.H$.length)for(var r=1;r<this.H$.length;r++){var o=Ce.max(this.H$[r][i],n),a=Ce.min(this.H$[r][i],n);e<o&&(e=o),a<s&&(s=a)}return{max:e,min:s}},E$:function(t){return Math.log(t)/Math.LN10},BD:function(t,i,e,s,n){if(this.P.xAxis){var h=this.canvases.x.renderTextAt(n,s,t,i-(n?2:0),this.P.xAxis.template(e));h&&(
h.className+=" webix_axis_item_x")}},HD:function(t,i,e,s,n){this.P.xAxis&&this.P.xAxis.lines&&this.w$(t,i,e,i,s,this.P.xAxis.lineColor.call(this,n),1)},w$:function(t,i,e,s,n,h,r){t.strokeStyle=h,t.lineWidth=r,t.beginPath(),t.moveTo(i,e),t.lineTo(s,n),t.stroke(),t.lineWidth=1},z$:function(t,i){return[i!=t?i-t:t,1]},OD:[function(t){return"#FF"+Le.toHex(t/2,2)+"00"},function(t){return"#FF"+Le.toHex(t/2+128,2)+"00"},function(t){return"#"+Le.toHex(255-t,2)+"FF00"},function(t){return"#00FF"+Le.toHex(t,2)},function(t){return"#00"+Le.toHex(255-t,2)+"FF"},function(t){return"#"+Le.toHex(t,2)+"00FF"}],Yc:["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],Uc:0,addSeries:function(t){var i=this.P;this.P=H.extend({},i),this.Rt(t),this.H$.push(this.P),this.P=i},$tooltipIn:function(t){return t},Fe:function(t,i){var e=this.locate(i);if(!e)return null;var s=this.qD(i),n=H.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.H$[s].tooltip||{template:""},!0);return ai.Nt.define(n),this.getItem(e)},qD:function(t){var i,e,s,n,h,r,o,a;for(e=this.du.vu,n=pt(this.Wi.Ni),o=(h=mt(t)).x-n.x,a=h.y-n.y,s=0;s<e.length;s++)o<=(i=e[s].points)[2]&&o>=i[0]&&a<=i[3]&&a>=i[1]&&(r?e[s].index>r.index&&(r=e[s]):r=e[s]);return r?r.index:0},hideSeries:function(t){this.canvases[t].hideCanvas();var i=this.P.legend;i&&i.values&&i.values[t]&&(i.values[t].$hidden=!0,this.ND()),this.du.hide(this.Wi,t,!0)},showSeries:function(t){this.canvases[t].showCanvas();var i=this.P.legend;i&&i.values&&i.values[t]&&(delete i.values[t].$hidden,this.ND()),this.du.hide(this.Wi,t,!1)},ND:function(t,i){var e,s,n,h,r,o,a,u,c,f,l,d=0,v=0;if(t=t||[],i=i||this.me,u=this.canvases.legend.getCanvas(),s=this.P.legend,a="x"!=this.P.legend.layout?"width:"+s.width+"px":"",this.PD&&(this.PD.innerHTML="",this.PD.parentNode.removeChild(this.PD)),this.canvases.legend.clearCanvas(!0),n=ft("DIV",{"class":"webix_chart_legend",style:"left:"+d+"px; top:"+v+"px;"+a},""),s.padding&&(n.style.padding=s.padding+"px"),this.PD=n,this.Wi.appendChild(n),r=[],s.values)for(e=0;e<s.values.length;e++)r.push(this.GD(n,s.values[e].text,"undefined"!=typeof s.values[e].id?M(s.values[e].id):e,s.values[e].$hidden));else for(e=0;e<t.length;e++)r.push(this.GD(n,s.template(t[e]),t[e].id));for(0===n.offsetWidth&&(n.style.width="auto"),o=n.offsetWidth,h=n.offsetHeight,o<i&&("x"==s.layout&&"center"==s.align&&(d=(i-o)/2),"right"==s.align&&(d=i-o),s.margin&&"center"!=s.align&&(d+=("left"==s.align?1:-1)*s.margin)),h<this.we&&("middle"==s.valign&&"center"!=s.align&&"x"!=s.layout?v=(this.we-h)/2:"bottom"==s.valign&&(v=this.we-h),s.margin&&"middle"!=s.valign&&(v+=("top"==s.valign?1:-1)*s.margin)),n.style.left=d+"px",n.style.top=v+"px",u.save(),e=0;e<r.length;e++)l=r[e],c=s.values&&s.values[e].$hidden?(f=!0,s.values[e].disableColor?s.values[e].disableColor:"#edeff0"):(f=!1,s.values?s.values[e].color:this.P.color.call(this,t[e])),this.XD(u,l.offsetLeft+d,l.offsetTop+v,c,l.offsetHeight,f,e);u.restore(),r=null},GD:function(t,i,e,s){var n="";"x"==this.P.legend.layout&&(n="float:left;");var h=ft("DIV",{style:n+"padding-left:"+(10+this.P.legend.marker.width)+"px","class":"webix_chart_legend_item"+(s?" hidden":""),role:"button",tabindex:"0","aria-label":I.aria[(s?"show":"hide")+"Chart"]+" "+i},i);return 2<arguments.length&&h.setAttribute("series_id",e),t.appendChild(h),h},XD:function(t,i,e,s,n,h,r){var o=[],a=this.P.legend.marker,u=this.P.legend.values,c=u&&u[r].markerType?u[r].markerType:a.type;if(s&&(t.strokeStyle=t.fillStyle=s),"round"!=c&&a.radius)if("item"==c){if(this.P.line&&"scatter"!=this.P.type&&!this.P.disableLines){t.beginPath(),t.lineWidth=this.H$[r].line.width,t.strokeStyle=h?s:this.H$[r].line.color.call(this,{});var f=i+5,l=e+n/2;t.moveTo(f,l);var d=f+a.width;t.lineTo(d,l),t.stroke()}var v=this.H$[r].item,_=parseInt(v.radius.call(this,{}),10)||0,p=v.type.call(this,{});_&&(t.beginPath(),h?(t.lineWidth=v.borderWidth,t.strokeStyle=s,t.fillStyle=s):(t.lineWidth=v.borderWidth,t.fillStyle=v.color.call(this,{}),
t.strokeStyle=v.borderColor.call(this,{}),t.globalAlpha=v.alpha.call(this,{})),t.beginPath(),i+=a.width/2+5,e+=n/2,this.J$(t,i,e,_+1,p),t.fill(),t.stroke()),t.globalAlpha=1}else t.beginPath(),t.lineWidth=1,i+=5,e+=n/2-a.height/2,o=[[i+a.radius,e+a.radius,a.radius,Math.PI,3*Math.PI/2,!1],[i+a.width-a.radius,e],[i+a.width-a.radius,e+a.radius,a.radius,-Math.PI/2,0,!1],[i+a.width,e+a.height-a.radius],[i+a.width-a.radius,e+a.height-a.radius,a.radius,0,Math.PI/2,!1],[i+a.radius,e+a.height],[i+a.radius,e+a.height-a.radius,a.radius,Math.PI/2,Math.PI,!1],[i,e+a.radius]],this.K$(t,o),t.stroke(),t.fill();else{t.beginPath(),t.lineWidth=a.height,t.lineCap=a.type,i+=t.lineWidth/2+5,e+=n/2,t.moveTo(i,e);var b=i+a.width-a.height+1;t.lineTo(b,e),t.stroke(),t.fill()}},AD:function(t,i){var e,s,n,h;if(e=this.P.padding.left,s=this.P.padding.top,n=t-this.P.padding.right,h=i-this.P.padding.bottom,this.P.legend){var r=this.P.legend,o=this.P.legend.width,a=this.P.legend.height;"x"==r.layout?"center"==r.valign?"right"==r.align?n-=o:"left"==r.align&&(e+=o):"bottom"==r.valign?h-=a:s+=a:"right"==r.align?n-=o:"left"==r.align&&(e+=o)}return{start:{x:e,y:s},end:{x:n,y:h}}},Z$:function(t){var i,e,s,n,h;if(this.P.yAxis&&"undefined"!=typeof this.P.yAxis.end&&"undefined"!=typeof this.P.yAxis.start&&this.P.yAxis.step)s=parseFloat(this.P.yAxis.end),n=parseFloat(this.P.yAxis.start);else{for(i=0;i<t.length;i++)for(t[i].$sum=0,t[i].$min=Infinity,e=0;e<this.H$.length;e++)h=Math.abs(parseFloat(this.H$[e].value(t[i])||0)),isNaN(h)||(-1!=this.H$[e].type.toLowerCase().indexOf("stacked")&&(t[i].$sum+=h),h<t[i].$min&&(t[i].$min=h));for(s=-Infinity,n=Infinity,i=0;i<t.length;i++)t[i].$sum>s&&(s=t[i].$sum),t[i].$min<n&&(n=t[i].$min);0<n&&(n=0)}return{max:s,min:n}},W$:function(t,i,e,s,n,h,r,o){var a,u,c,f,l,d;return"light"==h?(a="x"==o?t.createLinearGradient(i,e,s,e):t.createLinearGradient(i,e,i,n),d=[[0,"#FFFFFF"],[.9,r],[1,r]],u=2):"falling"==h||"rising"==h?(a="x"==o?t.createLinearGradient(i,e,s,e):t.createLinearGradient(i,e,i,n),c=Le.toRgb(r),(f=Le.rgbToHsv(c[0],c[1],c[2]))[1]*=.5,l="rgb("+Le.hsvToRgb(f[0],f[1],f[2])+")","falling"==h?d=[[0,l],[.7,r],[1,r]]:"rising"==h&&(d=[[0,r],[.3,r],[1,l]]),u=0):(t.globalAlpha=.37,u=0,a="x"==o?t.createLinearGradient(i,n,i,e):t.createLinearGradient(i,e,s,e),d=[[0,"#9d9d9d"],[.3,"#e8e8e8"],[.45,"#ffffff"],[.55,"#ffffff"],[.7,"#e8e8e8"],[1,"#9d9d9d"]]),this.JD(a,d),{gradient:a,offset:u}},I$:function(t,i,e,s){return t*=-1,{x:i+=Math.cos(t)*s,y:e-=Math.sin(t)*s}},JD:function(t,i){for(var e=0;e<i.length;e++)t.addColorStop(i[e][0],i[e][1])},K$:function(t,i){var e,s;for(e=0;e<i.length;e++)s=e?"lineTo":"moveTo",2<i[e].length&&(s="arc"),t[s].apply(t,i[e])},KD:function(t,i,e,s,n){t.addRect(i,[e[0].x-s.x,e[0].y-s.y,e[1].x-s.x,e[1].y-s.y],n)}},fo={api:co,view:H.protoUI(co,Kr,Zr,Qr,to,io,eo,{$render_spline:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,b,m;if(c=this.U$(t,i,e,s,n),r=this.P,this.G$=e,a=[],i.length){for(d=r.offset?e.x+.5*c.cellWidth:e.x,o=0;o<i.length;o++)((p=this.Y$(i[o],e,s,c))||"0"==p)&&(l=o?c.cellWidth*o-.5+d:d,a.push({x:l,y:p,v:this.P.value(i[o]),index:o}));for(f=this.$D(a),o=0;o<a.length;o++){if(v=a[o].x,b=a[o].y,o<a.length-1){for(_=a[o+1].x,m=a[o+1].y,u=v;u<_;u++){var g=this.DD(u,v,o,f.a,f.b,f.c,f.d);g<e.y&&(g=e.y),g>s.y&&(g=s.y);var w=this.DD(u+1,v,o,f.a,f.b,f.c,f.d);w<e.y&&(w=e.y),w>s.y&&(w=s.y),this.w$(t,u,g,u+1,w,r.line.color(i[o]),r.line.width)}this.w$(t,_-1,this.DD(u,v,o,f.a,f.b,f.c,f.d),_,m,r.line.color(i[o]),r.line.width)}this.X$(t,v,b,i[a[o].index],r.label(i[a[o].index]),n,h)}}},$D:function(t){var i,e,s,n,h,r,o,a,u=[],c=[],f=t.length;for(h=0;h<f-1;h++)u[h]=t[h+1].x-t[h].x,c[h]=(t[h+1].y-t[h].y)/u[h];for(a=[],(o=[])[0]=0,o[1]=2*(u[0]+u[1]),a[0]=0,a[1]=6*(c[1]-c[0]),h=2;h<f-1;h++)o[h]=2*(u[h-1]+u[h])-u[h-1]*u[h-1]/o[h-1],a[h]=6*(c[h]-c[h-1])-u[h-1]*a[h-1]/o[h-1];for((r=[])[f-1]=r[0]=0,h=f-2;1<=h;h--)r[h]=(a[h]-u[h]*r[h+1])/o[h];for(i=[],e=[],s=[],n=[],h=0;h<f-1;h++)i[h]=t[h].y,e[h]=-u[h]*r[h+1]/6-u[h]*r[h]/3+(t[h+1].y-t[h].y)/u[h],s[h]=r[h]/2,n[h]=(r[h+1]-r[h])/(6*u[h]);for(h=0;h<t.length-1;h++
)0===t[h].v&&0===t[h+1].v&&(i[h]=t[h].y,n[h]=s[h]=e[h]=0);return{a:i,b:e,c:s,d:n}},DD:function(t,i,e,s,n,h,r){return s[e]+(t-i)*(n[e]+(t-i)*(h[e]+(t-i)*r[e]))}},so,no,ho,{presets:{simple:{item:{borderColor:"#ffffff",color:"#2b7100",shadow:!1,borderWidth:2},line:{color:"#8ecf03",width:2}},plot:{color:"#8664C6",item:{borderColor:"#8664C6",borderWidth:1,color:"#ffffff",type:"r",shadow:!1},line:{color:"#8664C6",width:2}},diamond:{color:"#FF5C4C",item:{borderColor:"#FF5C4C",color:"#FF5C4C",type:"d",radius:3,shadow:!0},line:{color:"#FF5C4C",width:2}},point:{color:"#1ca1c1",disableLines:!0,fill:!1,disableItems:!1,item:{color:"#1ca1c1",borderColor:"#1ca1c1",radius:2,borderWidth:2,type:"r"},alpha:1},line:{line:{color:"#1ca1c1",width:2},item:{color:"#ffffff",borderColor:"#1ca1c1",radius:2,borderWidth:2,type:"d"},fill:!1,disableItems:!1,disableLines:!1,alpha:1},area:{fill:"#1ca1c1",line:{color:"#1ca1c1",width:1},disableItems:!0,alpha:.2,disableLines:!1},round:{item:{radius:3,borderColor:"#1ca1c1",borderWidth:1,color:"#1ca1c1",type:"r",shadow:!1,alpha:.6}},square:{item:{radius:3,borderColor:"#00a497",borderWidth:2,color:"#ffffff",type:"s",shadow:!1,alpha:1},line:{color:"#00a497"}},column:{color:"RAINBOW",gradient:!1,barWidth:45,radius:0,alpha:1,border:!0},stick:{barWidth:5,gradient:!1,color:"#1ca1c1",radius:2,alpha:1,border:!1},alpha:{color:"#b9a8f9",barWidth:70,gradient:"falling",radius:0,alpha:.5,border:!0}}},ro,oo,De,Pi,_e,ze,g,Hi.view)},lo={name:"rangechart",$init:function(){this.attachEvent("onAfterRender",this.ZD),this.QD()},ZD:function(){if(-1===this.P.type.indexOf("pie")&&"radar"!==this.P.type&&this.P.type,this.du.vu.length&&!this.tI){this.iI(),this.eI=(this.du.vu[0].points[2]-this.du.vu[0].points[0])/2;var t={webix_disable_drag:"true",tabindex:"0",role:"button","aria-label":I.aria.resizeChart};this.sI=ft("div",H.extend({"class":"webix_chart_resizer right"},t)),this.nI=ft("div",H.extend({"class":"webix_chart_resizer left"},t)),this.tI=ft("div",{"class":"webix_chart_frame",webix_disable_drag:"true"}),this.Vt.appendChild(this.nI),this.Vt.appendChild(this.tI),this.Vt.appendChild(this.sI),this.hI(),Kt(this.sI,q.mouse.down,this.rI,{bind:this}),Kt(this.nI,q.mouse.down,this.rI,{bind:this}),Kt(this.tI,q.mouse.down,this.rI,{bind:this}),Kt(C(this.sI),"keydown",this.oI,{bind:this}),Kt(C(this.nI),"keydown",this.oI,{bind:this}),this.CC&&(this.P.range=this.QD(this.CC)),this.aI(),this.callEvent("onAfterRangeChange",[this.CC]),this.data.attachEvent("onStoreUpdated",S(this.aI,this))}else this.hI(!0)},$setSize:function(t,i){fo.api.$setSize.call(this,t,i)&&(this.iI(),this.aI())},hI:function(t){this.sI&&!this.uI&&(this.uI=this.sI.clientWidth/2,t&&this.aI())},iI:function(){var t=this.AD(this.me,this.we);this.G$=t.start,this.cI=t.end},removeAllSeries:function(){this.tI=this.sI=this.nI=null,fo.api.removeAllSeries.apply(this,arguments)},oI:function(t){var i=t.which||t.keyCode;if(37===i||39===i){gt(t);var e=-1!==t.target.className.indexOf("right")?"eindex":"sindex",s=-1!==t.target.className.indexOf("right")?"end":"start",n=this.CC;n[e]=n[e]+(37===i?-1:1),this.du.vu[n[e]]&&(n[s]=this.fI(n[e]),this.setFrameRange(n))}},rI:function(t){if(-1!==t.target.className.indexOf("webix_chart_resizer"))this.lI=t.target;else if(this.du.vu.length){var i=this.du.vu[this.CC.sindex].points[2]-this.eI,e=this.du.vu[this.CC.eindex].points[2]-this.eI;this.dI={ex:mt(t).x,fx:i+this.G$.x,fw:e-i}}yt(this.Vt,"webix_noselect webix_wresize_cursor"),this.vI(),this._I=Zt(document.body,q.mouse.move,this.pI,{bind:this}),this.bI=Zt(document.body,q.mouse.up,this.mI,{bind:this})},vI:function(){this._I&&(Qt(this._I),Qt(this.bI),this.bI=this._I=null)},pI:function(t){if(this.lI){var i=mt(t).x-pt(this.$view).x;i>=this.G$.x&&i<=this.cI.x&&(-1!==this.lI.className.indexOf("left")?i<this.sI.offsetLeft&&(this.lI.style.left=i-this.uI+"px",this.tI.style.left=i+"px",this.tI.style.width=this.sI.offsetLeft-this.nI.offsetLeft-1+"px"):i>this.nI.offsetLeft+this.uI&&(this.lI.style.left=i-this.uI+"px",this.tI.style.width=this.sI.offsetLeft-this.nI.offsetLeft-1+"px"))}else if(this.dI){var e=mt(t
).x-this.dI.ex,s=this.dI.fx+e,n=s+this.dI.fw;this.G$.x<=s&&this.cI.x>=n&&(H.extend(this.dI,{lx:s,rx:n},!0),this.nI.style.left=s-this.uI+"px",this.sI.style.left=n-this.uI+"px",this.tI.style.left=s+"px")}},mI:function(t){if(this.vI(),Mt(this.Vt,"webix_noselect"),Mt(this.Vt,"webix_wresize_cursor"),this.count()){if(this.lI){var i=q.touch?t.changedTouches[0].pageX:mt(t).x;i-=pt(this.$view).x+this.G$.x;var e=this.gI(i),s=this.fI(e);this.lI===this.nI?(e>=this.CC.eindex&&(e=this.CC.eindex,s=this.fI(e)),this.CC.start=s,this.CC.sindex=e):(e<=this.CC.sindex&&(e=this.CC.sindex,s=this.fI(e)),this.CC.end=s,this.CC.eindex=e),this.lI=null}else if(this.dI&&this.dI.lx){var n=this.CC.sindex=this.gI(this.dI.lx-this.G$.x),h=this.CC.eindex=this.gI(this.dI.rx-this.G$.x);this.CC.start=this.fI(n),this.CC.end=this.fI(h),this.dI=null}this.aI(),this.callEvent("onAfterRangeChange",[this.CC.start,this.CC.end])}},fI:function(t){return t>=this.data.order.length&&(t=this.data.order.length-1),this.getItem(this.data.order[t])[this.P.frameId||"id"]},gI:function(t){for(var i=this.du.vu,e=0;e<i.length;e++)if(t<=i[e].points[2]-this.eI)return e;return i.length-1},wI:function(t){for(var i=this.P.frameId||"id",e=0;e<this.data.order.length;e++)if(this.getItem(this.data.order[e])[i]==t)return e;return-1},QD:function(t){t?(t.start&&(t.sindex=this.wI(t.start)),t.end&&(t.eindex=this.wI(t.end)),t.start=t.start||this.fI(t.sindex),t.end=t.end||this.fI(t.eindex)):t={start:0,end:0,sindex:0,eindex:0},this.CC=t},range_setter:function(t){return this.QD(t),this.CC},getFrameData:function(){for(var t=[],i=this.CC.sindex;i<=this.CC.eindex;i++){var e=this.getItem(this.data.order[i]);e&&t.push(e)}return t},setFrameRange:function(t){this.QD(t),this.aI(),this.callEvent("onAfterRangeChange",[t])},aI:function(){if(this.du){var t=this.du.vu;if(t.length){var i=t[this.CC.sindex].points[0]+this.G$.x+this.eI-1,e=t[this.CC.eindex].points[0]+this.G$.x+this.eI-1;this.nI.style.left=i-this.uI+"px",this.sI.style.left=e-this.uI+"px",this.tI.style.left=i+"px",this.tI.style.width=e-i+"px",this.P.range=this.CC}}},getFrameRange:function(){return this.P.range}},vo=(H.protoUI(lo,fo.view),{name:"grouplist",defaults:{animate:{}},Im:"webix_grouplist",$init:function(){H.extend(this.data,ls,!0),this.data.count=function(){return this.order.length},this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",S(this.xI,this)),this.xI()},xI:function(){this.yI=[],this.MI=[]},$setSize:function(){Hi.api.$setSize.apply(this,arguments)&&(this.tt.style.width=this.me)},on_click:{webix_list_item:function(t,i){if(this.Xv)return!1;for(var e=0;e<this.MI.length;e++)if(this.MI[e]==i){for(var s=e;s<this.MI.length;s++)this.data.getItem(this.MI[s]).$template="";return e?(this.yI=this.data.branch[this.MI[e-1]],this.MI.splice(e)):(this.yI=this.data.branch[0],this.MI=[]),this.SI=!1,this.render()}var n=this.getItem(i);if(n.$count)return this.SI=!0,this.MI.push(i),n.$template="Back",this.yI=this.data.branch[n.id],this.render();this.P.select&&(this.Fm=!0,"multiselect"==this.P.select||this.P.multiselect?this.select(i,!1,"touch"==this.P.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i),this.Fm=!1)}},getOpenState:function(){return{parents:this.MI,branch:this.yI}},render:function(t,i,e){var s,n,h=this,r=arguments;if(this.MI=_(this.MI),this.yI=_(this.yI),this.MI.length)for(s=0;s<this.MI.length;s++)this.data.branch[this.MI[s]]||(this.MI.splice(s,1),s--);if(n=this.MI.length?this.MI[this.MI.length-1]:0,this.yI=_(this.data.branch[n]),!this.yI.length&&this.MI.length&&(this.yI=[n],this.MI.pop()),this.Xv)return this.Xv.then(function(){return h.render.apply(h,r)});for(s=0;s<this.yI.length;s++)this.data.getItem(this.yI[s]).$template="";if(this.yI.length||(this.yI=this.data.branch[0]),this.data.order=m([].concat(this.MI).concat(this.yI)),this.callEvent("onBeforeRender",[this.data])){if(!this.Fm&&this.tt.innerHTML&&Ni.isSupported()&&this.P.animate&&this.kI!=this.MI.length){if(this.callEvent("onBeforeRender",[this.data])){this.CI||(this.CI=[]);var o=this.tt.cloneNode(!1);o.innerHTML=this.data.getRange().map(this.Q,this).join("")
;var a=H.extend({},this.P.animate);a.direction=this.SI?"left":"right";var u,c=[l(a),l(a)];this.SI?this.CI.push(this.getScrollState()):u=this.CI.pop();var f=Ni.formLine(o,this.tt,a);a.master=this,a.callback=function(){this.tt=o,this.SI?this.scrollTo(0,0):u&&this.scrollTo(0,u.y),Ni.breakLine(f),a.master=a.callback=null,this.Ni=this.Xv=null,a.wait_animation.resolve(),this.callEvent("onAfterRender",[])},Ni(f,c),this.Xv=a.wait_animation=b.defer()}}else{if(t&&"delete"!==e&&-1===this.data.getIndexById(t))return;Pe.render.apply(this,arguments)}this.kI=this.MI.length}},templateBack_setter:function(t){this.type.templateBack=Yt(t)},templateItem_setter:function(t){this.type.templateItem=Yt(t)},templateGroup_setter:function(t){this.type.templateGroup=Yt(t)},type:{template:function(t,i){return t.$count?i.templateGroup(t,i):i.templateItem(t,i)},css:"group",classname:function(t,i,e){return"webix_list_item webix_"+(t.$count?"group":"item")+(t.$template?"_back":"")+(e&&e.webix_selected?" webix_selected":"")+(i.css?" "+i.css:"")+(t.$css?" "+t.$css:"")},templateStart:Yt('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()};  overflow:hidden;" {common.aria()}>'),templateBack:Yt("#value#"),templateItem:Yt("#value#"),templateGroup:Yt("#value#"),templateEnd:function(t){var i="";return t.$count&&(i+="<div class='webix_arrow_icon'></div>"),i+="</div>"}},showItem:function(t){var i,e;for(t&&(e=(i=this.getItem(t)).$parent,i.$count&&(e=i.id)),this.yI=this.data.branch[e||0],this.MI=[];e;)this.getItem(e).$template="Back",this.MI.unshift(e),e=this.getItem(e).$parent;this.Fm=!0,this.render(),this.Fm=!1,Pe.showItem.call(this,t)}});ti(H.protoUI(vo,De,qh.view),{});var _o={name:"unitlist",Qo:"webix_item_id",uniteBy_setter:Yt,render:function(t,i,e){var s=this.P;if(this.isVisible(s.id)&&s.uniteBy){if(t){var n=this.getItemNode(t);if(n&&"update"==e&&this.P.uniteBy.call(this,i)==this.getItem(t).$unitValue)return vt(this.Ni[t]=this.gc(i),n),void dt(n)}this.callEvent("onBeforeRender",[this.data])&&(this.units=null,this.$I(),this.units&&(this.callEvent("onUnits",[]),this.tt.innerHTML=this.DI().map(this.Q,this).join(""),this.Ni=null),this.callEvent("onAfterRender",[]))}},getUnits:function(){var t=[];if(this.units)for(var i in this.units)t.push(i);return t},getUnitList:function(t){return this.units?this.units[t]:null},Q:function(t){var i=this.data.Dr[t.id];return!t.$template||this.type["template"+t.$template],t.$template,this.callEvent("onItemRender",[t]),t.$unit?this.type.templateStartHeader(t,this.type)+this.type.templateHeader.call(this,t.$unit)+this.type.templateEnd(t,this.type):this.type.templateStart(t,this.type,i)+(t.$template?this.type["template"+t.$template]:this.type.template)(t,this.type)+this.type.templateEnd(t,this.type)},DI:function(){var t=[],i=this.data.$min||0,e=this.data.$max||Infinity,s=0;for(var n in this.units){t.push({$unit:n});for(var h=this.units[n],r=0;r<h.length;r++){if(s==i&&(t=[{$unit:n}]),t.push(this.getItem(h[r])),s==e)return m(t);s++}}return m(t)},$I:function(){var e=this;this.units={},this.data.each(function(t){var i=e.P.uniteBy.call(this,t);t.$unitValue=i,e.units[i]||(e.units[i]=[]),e.units[i].push(t.id)})},type:{headerHeight:20,classname:function(t,i,e){var s="webix_list_item";return i.css&&(s+=" webix_list_"+i.css+"_item"),e&&e.$css&&(s+=" "+e.$css),t.$css&&("object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css),s},templateHeader:function(t){return"<span class='webix_unit_header_inner'>"+t+"</span>"},templateStart:function(t,i,e){if(t.$unit)return i.templateStartHeader.apply(this,arguments);var s="width:"+i.widthSize(t,i,e)+"; height:"+i.heightSize(t,i,e)+"; overflow:hidden;"+(i.layout&&"x"==i.layout?"float:left;":"");return'<div webix_item_id="'+t.id+'" class="'+i.classname(t,i,e)+'" style="'+s+'" '+i.aria(t,i,e)+">"},templateStartHeader:function(t,i,e){var s="webix_unit_header"+(i.css?" webix_unit_header_"+i.css+"_item":""),n="width:"+i.widthSize(t,i,e)+"; height:"+i.headerHeight+"px; overflow:hidden;"
;return'<div webix_unit_id="'+t.$unit+'" class="'+s+'" style="'+n+'">'}},$skin:function(){qh.api.$skin.call(this),this.type.headerHeight=Li.unitHeaderHeight}};H.protoUI(_o,qh.view);I.dbllist={selectAll:"<span class='webix_icon wxi-angle-double-right'></span>",selectOne:"<span class='webix_icon wxi-angle-right'></span>",deselectAll:"<span class='webix_icon wxi-angle-double-left'></span>",deselectOne:"<span class='webix_icon wxi-angle-left'></span>"};var po={name:"dbllist",defaults:{borderless:!0},$init:function(){this.II={},this.AI=S(function(t){return this.II[t.id]},this),this.FI=S(function(t){return!this.II[t.id]},this),this.$view.className+=" webix_dbllist",this.$ready.unshift(this.Vg)},$onLoad:function(t,i){var e=this.$$("left"),s=this.$$("right");return this.TI(function(){e.data.driver=i,e.parse(t),s.data.driver=i,s.parse(t)}),this.VI=!0,this.kC(),!0},zI:function(){if(!1===this.P.buttons)return{width:10};var t=I.dbllist,i=[this.BI("deselect_all",t.deselectAll),this.BI("select_all",t.selectAll),this.BI("deselect_one",t.deselectOne),this.BI("select_one",t.selectOne)];return i={width:120,template:i.join(""),onClick:{dbllist_button:function(t,i,e){this.getTopParentView().HI(e.getAttribute("action"))}}},this.P.buttons&&(i.template=this.P.buttons),i},BI:function(t,i){return"<button class='dbllist_button' action='"+t+"'>"+i+"</button>"},RI:function(t,i,e,s){var n={view:"list",select:"multiselect",multiselect:"touch",id:t,action:i,drag:!0,type:{margin:3,id:t},on:{onBeforeDrop:function(t){var i=t.from,e=t.to,s=i.getTopParentView();if(s===this.getTopParentView()){var n="select_one"!=e.P.action;s.select(t.source,n)}return!1},onItemDblClick:function(){return this.getTopParentView().HI(this.config.action)}}};return this.P.list&&H.extend(n,this.P.list,!0),e&&(n={rows:[{view:"label",label:e,css:"webix_inp_top_label"},n]}),s?{rows:[n,{view:"label",height:20,label:s,css:"bottom_label"}]}:n},Vg:function(){var t=[{margin:10,type:"clean",cols:[this.RI("left","select_one",this.P.labelLeft,this.P.labelBottomLeft),this.zI(),this.RI("right","deselect_one",this.P.labelRight,this.P.labelBottomRight)]}];this.cols_setter(t)},HI:function(t){var i=null,e=!1;"select_all"===t?(i=this.$$("left").data.order,e=!0):"select_one"===t?(i=this.$$("left").getSelectedId(!0),e=!0):"deselect_all"===t?(i=this.$$("right").data.order,e=!1):"deselect_one"===t&&(i=this.$$("right").getSelectedId(!0),e=!1),this.select(i,e)},select:function(t,i){var e;if("object"!==M(t)&&(t=[t]),i)for(e=0;e<t.length;e++)this.II[t[e]]=!0;else for(e=0;e<t.length;e++)delete this.II[t[e]];this.kC(),this.callEvent("onChange",[])},TI:function(t,i){li(S(t,this),!1),i&&(this.$$("left").P.autoheight||this.$$("right").P.autoheight)&&this.resize()},kC:function(){var t=this.$$("left"),i=this.$$("right");t&&this.TI(function(){t.filter(this.FI),i.filter(this.AI)},!0)},focus:function(){if(!Mi.canFocus(this))return!1;Mi.setFocus(this)},value_setter:function(t){this.setValue(t)},setValue:function(t){if(this.II={},t){"object"!==M(t)&&(t=t.toString().split(","));for(var i=0;i<t.length;i++)this.II[t[i]]=!0}this.kC()},getValue:function(){var t=[],i=this.$$("left");for(var e in this.II)this.VI&&!i.data.pull[e]||t.push(e);return t.join(",")}},bo=(H.protoUI(po,Ht,Fe,kn.view),{name:"tree",defaults:{scroll:"auto",navigation:!0},$init:function(){this.Vt.className+=" webix_tree",H.extend(this.data,ls,!0),H.extend(this.on_click,os),this.data.provideApi(this,!0),this.Vt.setAttribute("role","tree")},Qo:"webix_tm_id",on_context:{},on_dblclick:{webix_tree_checkbox:function(){if(this.on_click.webix_tree_checkbox)return this.on_click.webix_tree_checkbox.apply(this,arguments)}},$fixEditor:function(t){var i=this.getItemNode(t.id).querySelector("span");if(i){""===i.innerHTML&&(i.innerHTML="&nbsp;");var e=i.offsetLeft;t.node.style.width=this.$view.scrollWidth-e-10+"px",t.node.style.marginLeft=e+"px",t.node.style.left="0px"}},on_click:{webix_tree_item:function(t,i){this.P.activeTitle&&(this.getItem(i).open?this.close(i):this.open(i));if(this.P.select)if("multiselect"==this.P.select||this.P.multiselect){
var e=t.ctrlKey||t.metaKey||"touch"==this.P.multiselect;if("level"==this.P.multiselect&&(e||t.shiftKey)){var s=this.getSelectedId(!0)[0];if(s&&this.getParentId(i)!=this.getParentId(s))return}this.select(i,!1,e,t.shiftKey)}else this.select(i)}},Zn:{insert:function(t){var i=this.getSelectedId()||"0";this.add({value:t},null,i)},modify:function(t){for(var i=this.getSelectedId(!0),e=0;e<i.length;e++)this.getItem(i[e]).value=t,this.refresh(i[e])},custom:function(){}},Go:!0,$dragHTML:function(t,i,e){var s="<div class='webix_tree_item'>"+this.type.template(t,this.type)+"</div>";return $(e.source)&&1<e.source.length&&(s=this.No(s,e.source.length)),s},Yo:function(t){for(var i=t.source,e=0;e<i.length;e++)this.close(i[e])},Uo:function(t,i){var e=this.getItemNode(t);e?e.parentNode.insertBefore(Xi.dn[0],e):i.children[0].children[0].appendChild(Xi.dn[0])},type:H.extend({template:function(t,i){return(i["template"+t.level]||i.templateCommon).apply(this,arguments)},classname:function(t,i,e){var s="webix_tree_item";return t.$css&&("object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css),e&&e.$css&&(s+=" "+e.$css),i.css&&(s+=" "+i.css),s},aria:function(t,i,e){return'role="treeitem"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count?'aria-expanded="'+(t.open?"true":"false")+'"':"")+'aria-level="'+t.$level+'"'},templateCommon:Yt("{common.icon()} {common.folder()} <span>#value#</span>"),templateStart:Yt('<div webix_tm_id="#id#" class="{common.classname()}" {common.aria()}>'),templateEnd:Yt("</div>"),templateCopy:Yt("#value#")},vs)}),mo=H.protoUI(bo,fs,De,rs,be,us,Ne,Te,ze,je,as,Uh.view,cs,ne,g),go={api:bo,view:mo};ti(mo,{name:"lineTree",css:"webixLineTree",icon:function(t,i){for(var e="",s="",n=1;n<=t.$level;n++){n==t.$level&&(s=t.$count?t.open?"webix_tree_open ":"webix_tree_close ":"webix_tree_none ");var h=i.EI(t,i,n);h&&(e+="<div class='"+s+"webix_tree_img webix_tree_"+h+"'></div>")}return e},EI:function(t,i,e){var s=i.bf,n=cs.ze;if(0===s&&n){var h=t.$level,r=t.id;for(s=[];h;){var o=n.getParentId(r),a=n.data.branch[o];a[a.length-1]==r&&(s[h]=!0),r=o,h--}i.bf=s}if(!s)return 0;if(e!=t.$level)return s[e]?"blank":"line1";var u=3;return t.$parent||0===t.$index&&(u=4),s[t.$level]&&(u=2),t.$count?t.open?"minus"+u:"plus"+u:"line"+u}});var wo={name:"treemap",defaults:{activeItem:!1,subRender:!0,header:!0,headerHeight:35,value:Yt("#value#"),headerTemplate:"",navigation:!0},value_setter:Yt,headerTemplate_setter:Yt,header_setter:function(t){return t&&!0!==t&&(this.type.header=t),t},$init:function(){this.$view.className+=" webix_treemap",this.Vt.setAttribute("role","tree"),this.jI=document.createElement("DIV"),H.extend(this.data,ls,!0),this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",S(function(){this.Oi="",this.$values={},this.$xy={}},this)),this.attachEvent("onKeyPress",this.ke)},vf:function(t){var i=this.data.Dr[t.id];this.callEvent("onItemRender",[t]);var e=t.$template?this.type["template"+t.$template].call(this,t,this.type,i):this.type.template.call(this,t,this.type,i);return this.type.templateStart.call(this,t,this.type,i)+e+this.type.templateEnd.call(this)},NI:function(t){var i=this.getItem(t),e=this.P.headerHeight,s="<div class='webix_treemap_header' style='height:"+e+"px;line-height:"+e+"px;'>";return s+=this.type.header.call(this,i,this.type),s+="</div>"},f$:function(t){var i,e,s,n,h=[];if(!this.$width||!this.count())return this.Oi="",!1;if(t||(t=this.config.branch||0,this.Oi="",this.$values={},this.$xy={},this.$xy[t]={width:this.$width,height:this.$height,top:0,left:0},t&&this.P.header&&(this.$xy[t].height-=this.P.headerHeight,this.$xy[t].top=this.P.headerHeight,this.Oi+=this.NI(t)),n=0,this.data.each(function(t){var i=this.getParentId(t.id);if(!this.data.branch[t.id]&&(s=1*this.config.value.call(this,t),!isNaN(s)&&s))for(this.$values[t.id]=s,n+=s;i;)this.$values[i]||(this.$values[i]=0),this.$values[i]+=s,i=this.getParentId(i)},this,!1,t)),this.data.eachChild(t,function(t){this.$values[t.id]&&h.push(_(t))},this),n=n||this.$values[t],h.length&&n){(e={top:(i=this.$xy[t]).top,left:i.left,
dx:i.width,dy:i.height,set:[],sum:0}).dim=Math.min(e.dx,e.dy);for(var r=e.dx*e.dy/n,o=0;o<h.length;o++)h[o].$value=this.$values[h[o].id]*r;h.sort(function(t,i){return t.$value>i.$value?-1:1});for(var a=Infinity,u=0;h[u];){var c=this.LI(e,h[u]);if(c<a)e.sum+=h[u].$value,e.set.push(h[u]),a=c,u++;else{this.Qp(e);var f={top:e.top,left:e.left,dx:e.dx,dy:e.dy,set:[],sum:0},l=e.sum/e.dim;e.dx>e.dy?(f.left+=l,f.dx-=l):(f.top+=l,f.dy-=l),(e=f).dim=Math.min(e.dx,e.dy),a=Infinity}}}e&&this.Qp(e)},Qp:function(t){var i,e,s,n,h=t.top,r=t.left;for(t.mode=t.dy<t.dx,t.contra=t.sum/t.dim,i=0;i<t.set.length;i++)e=t.set[i].id,n=t.mode?(s=t.contra,t.set[i].$value/t.contra):(s=t.set[i].$value/t.contra,t.contra),this.$xy[e]={},this.$xy[e].top=h,this.$xy[e].left=r,t.mode?h+=n:r+=s,this.$xy[e].width=s,this.$xy[e].height=n,this.Oi+=this.vf(this.getItem(e)),this.P.subRender&&this.data.branch[e]&&this.f$(e)},LI:function(t,i){var e=t.sum+i.$value,s=e*e/(t.dim*t.dim*i.$value);return t.set.length&&(s=Math.max(t.dim*t.dim*t.set[0].$value/(e*e),s)),1<s?s:1/s},gc:function(t){return this.jI.innerHTML=this.vf(t),this.jI.firstChild},showBranch:function(t){this.P.branch=t,this.refresh()},render:function(t,i,e){if(this.isVisible(this.P.id)&&!this.$blockRender){if("update"==e){var s=this.getItemNode(t);if(s)vt(this.Ni[t]=this.gc(i),s),dt(s)}else!this.data.branch||this.P.branch&&!this.data.branch[this.P.branch]||(this.Ni=null,this.callEvent("onBeforeRender",[]),this.f$(),this.tt.innerHTML=this.Oi,this.callEvent("onAfterRender",[]));return!0}},Qo:"webix_dm_id",on_click:{webix_treemap_item:function(t,i){this.P.select&&("multiselect"==this.P.select||this.P.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.P.multiselect,t.shiftKey):this.select(i)),this.P.activeItem&&this.isBranch(i)&&this.showBranch(i)},webix_treemap_header_item:function(t){var i=_t(t,"webix_dm_header_id");this.define("branch",i),this.refresh()},webix_treemap_reset:function(){this.define("branch",0),this.refresh()}},on_dblclick:{},on_mouse_move:{},OI:function(t){var i="";for(var e in t)i+=e+":"+t[e]+";";return i},type:{template:Yt("#value#"),header:function(t,i){for(var e=t.id,s="<div role='button' tabindex='0' aria-label='"+I.aria.resetTreeMap+"' class='webix_treemap_reset'></div>",n=[];e;)t=this.getItem(e),n.push(i.headerItem.call(this,t,i)),e=this.getParentId(e);return n.reverse(),s+n.join("<span class='webix_icon wxi-angle-right webix_treemap_path_icon'></span>")},headerItem:function(t){var i=this.config.headerTemplate(t),e='<a role="button" tabindex="0" aria-label="'+i+'" webix_dm_header_id="'+t.id+'" class="webix_treemap_header_item">';return e+=i,e+="</a>"},classname:function(t,i,e){var s="webix_treemap_item";i.css&&(s+=" "+i.css),t.$css&&("object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css);var n=this.$xy[t.id];e&&e.$css&&(s+=" "+e.$css),s+=" webix_treemap_level_"+this.getItem(t.id).$level;var h=this.getParentId(t.id);if(h&&h!=this.P.branch||(s+=" webix_treemap_level_top"),this.$height-n.top-n.height<1&&(s+=" webix_treemap_item_bottom"),this.$width-n.left-n.width<1&&(s+=" webix_treemap_item_right"),i.cssClass){var r=i.cssClass.call(this,t,i,e);r&&("object"==M(r)?s+=" "+at(r):s+=" "+r)}return s},templateStart:function(t,i,e){var s="";if(this.$xy){var n=this.$xy[t.id];s+="width: "+n.width+"px; height: "+n.height+"px;",s+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div role="treeitem" aria-level="'+t.$level+'" '+(e&&e.webix_selected?'aria-selected="true" tabindex="0"':"")+' webix_dm_id="'+t.id+'" class="'+i.classname.call(this,t,i,e)+'" style="'+s+'">'},templateEnd:Yt("</div>")}},xo=(H.protoUI(wo,De,rs,Ne,Te,ze,je,as,Uh.view,cs,ne,g),{name:"dataview",$init:function(t){t.sizeToContent&&this.$ready.unshift(this.rr);var i=t.type||t.item;t.prerender||this.defaults.prerender||i&&"auto"==i.width||"move"==t.drag||"order"==t.drag||t.autoheight||H.extend(this,ms,!0),t.autoheight&&(t.scroll=!1),i&&"tiles"==i.type&&(this.WI=i.padding||this.type.padding,this.Vt.firstChild.style["float"]="left",this.Vt.firstChild.style.padding=this.WI/2+"px"),this.Wi.className+=" webix_dataview",
this.Vt.setAttribute("role","listbox")},rr:function(){var t=ft("DIV",0,this.type.template({}));t.className="webix_dataview_item",t.style.position="absolute",document.body.appendChild(t),this.type.width=t.offsetWidth+this.WI,this.type.height=t.offsetHeight+this.WI,dt(t)},defaults:{scroll:!0,datafetch:50,navigation:!0},Qo:"webix_l_id",oh:"webix_dataview_item",WI:0,Jo:"x",on_click:{webix_dataview_item:function(t,i){this.P.select&&("multiselect"==this.P.select||this.P.multiselect?this.select(i,!1,"touch"==this.P.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i))}},on_dblclick:{},on_mouse_move:{},type:{template:Yt("#value#"),templateLoading:Yt("Loading..."),width:160,height:50,padding:8,classname:function(t,i,e){var s="webix_dataview_item";return i.css&&(s+=" "+i.css),i.type&&(s+=" "+i.type),t.$css&&("object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css),e&&e.$css&&(s+=" "+e.$css),s},aria:function(t,i,e){return'role="option"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')},templateStart:function(t,i,e){var s=i.width,n=i.height,h=0;return"tiles"==i.type&&(s-=i.padding,n-=i.padding,h=i.padding/2),'<div webix_l_id="'+t.id+'" class="'+i.classname(t,i,e)+'" '+i.aria(t,i,e)+' style="margin:'+h+"px; width:"+s+"px; height:"+n+'px; float:left; overflow:hidden;">'},templateEnd:Yt("</div>")},$dropHTML:function(){var t=this.WI;return'<div class="webix_drop_area_inner" style="width:'.concat(this.type.width-t,"px; height:").concat(this.type.height-t,"px; margin:").concat(t/2,'px"></div>')},UI:function(t){return this.P.height=this.type.height*Math.ceil(this.data.count()/Math.floor(t/this.type.width))},autoheight_setter:function(t){return t&&(this.data.attachEvent("onStoreLoad",S(this.resize,this)),this.Wi.style.overflowY="hidden"),t},$getSize:function(t,i){this.P.xCount&&"auto"!=this.type.width&&!this.YI&&(this.P.width=this.type.width*this.P.xCount+this.WI+(this.ge?q.scrollSize:0)),this.P.yCount&&"auto"!=this.type.height&&!this.qI&&(this.P.height=this.type.height*this.P.yCount+this.WI);var e=this.P.width||this.me;return this.P.autoheight&&e&&(this.GI(),this.UI(e),this.scroll_setter(!1)),Hi.api.$getSize.call(this,t,i)},GI:function(){return this.P.yCount&&(this.qI||"auto"==this.type.height)&&(this.type.height=Math.floor((this.we-this.WI)/this.P.yCount),this.qI=this.P.yCount),this.P.xCount&&(this.YI||"auto"==this.type.width)&&(this.type.width=Math.floor((this.me-this.WI)/this.P.xCount),this.YI=this.P.xCount),this.qI||this.YI},$setSize:function(t,i){var e=this.P;if(Hi.api.$setSize.call(this,t,i)){if(e.autoheight&&this.UI()!=this.we)return k(this.resize,this);(this.GI()||this.Gf)&&this.render()}else(e.yCount&&e.yCount!=this.qI||e.xCount&&e.xCount!=this.YI)&&this.GI()&&this.render()}});H.protoUI(xo,ae,be,ze,Te,Ne,je,he,Uh.view);I.pager={first:"<span class='webix_icon wxi-angle-double-left'></span>",last:"<span class='webix_icon wxi-angle-double-right'></span>",next:"<span class='webix_icon wxi-angle-right'></span>",prev:"<span class='webix_icon wxi-angle-left'></span>"};var yo={defaults:{size:10,page:0,group:5,template:"{common.pages()}",maxWidth:1e5,height:30,borderless:!0},name:"pager",on_click:{webix_pager_item:function(t,i){this.select(i)}},$init:function(t){this.data=this.P,this.tt=this.Vt,this.Vt.className+=" webix_pager"+(t.autowidth?" webix_pager_auto":""),!1!==t.master&&0!==t.master||this.$ready.push(this.XI)},XI:function(){this.refresh(),this.$master={refresh:function(){},select:function(){}}},select:function(t){if(this.$master&&"pager"==this.$master.name)return this.$master.select(t);switch(t){case"next":t=this.P.page+1;break;case"prev":t=this.P.page-1;break;case"first":t=0;break;case"last":t=this.P.limit-1}t<0&&(t=0),t>=this.data.limit&&(t=this.data.limit-1);var i=this.data.page;this.callEvent("onBeforePageChange",[t,i])&&(this.data.page=1*t,this.refresh()&&(this.P.animate&&this.DC(i,1*t,this.P.animate)||this.$master.refresh()),this.callEvent("onAfterPageChange",[t]))},Qo:"webix_p_id",template_setter:Yt,type:{template:function(t,i){return t.template.call(this,t,i)},pages:function(t){var i=""
;if(-1==t.page)return"";t.$min=t.page-Math.round((t.group-1)/2),t.$max=t.$min+1*t.group-1,t.$min<0&&(t.$max+=-1*t.$min,t.$min=0),t.$max>=t.limit&&(t.$min-=Math.min(t.$min,t.$max-t.limit+1),t.$max=t.limit-1);for(var e=t.$min||0;e<=t.$max;e++)i+=this.button({id:e,index:e+1,selected:e==t.page?"_selected":"",label:I.aria.page+" "+(e+1)});return i},page:function(t){return t.page+1},first:function(){return this.button({id:"first",index:I.pager.first,selected:"",label:I.aria.pages[0]})},last:function(){return this.button({id:"last",index:I.pager.last,selected:"",label:I.aria.pages[3]})},prev:function(){return this.button({id:"prev",index:I.pager.prev,selected:"",label:I.aria.pages[1]})},next:function(){return this.button({id:"next",index:I.pager.next,selected:"",label:I.aria.pages[2]})},button:Yt("<button type='button' webix_p_id='{obj.id}' class='webix_pager_item{obj.selected}' aria-label='{obj.label}'>{obj.index}</button>")},clone:function(t){t.$view||(t.view="pager",t=si(t)),((this.KI=t).$master=this).JI()},refresh:function(){var t=this.P;t.limit=Math.ceil(t.count/t.size)||1;var i=Math.min(t.limit-1,t.page);return i!=t.page?this.$master.setPage(i):0<=(t.page=i)&&i!=t.old_page||t.limit!=t.old_limit||t.old_count!=t.count?(this.render(),this.JI(),t.old_limit=t.limit,t.old_page=t.page,t.old_count=t.count,!0):void 0},apiOnly_setter:function(t){return this.$apiOnly=t},JI:function(){this.KI&&(this.KI.P.count=this.P.count,this.KI.P.page=this.P.page,this.KI.refresh())},DC:function(t,i,e){if(t==i)return!1;if(this.ZI)return this.QI&&window.clearTimeout(this.QI),this.QI=k(this.DC,this,[t,i,e],100);var s=t<i?"left":"right";"top"!=e.direction&&"bottom"!=e.direction||(s=t<i?"top":"bottom"),e.flip&&(s="");var n=0,h=this.$master.tt,r=!!this.$master.st;r&&(n=(h=this.$master.st).offsetTop,yt(this.$master.$view,"webix_animation"));var o,a=h.cloneNode(!0);a.style.width=h.style.width="100%",this.$master.refresh(),vt(a,h.nextSibling,h.parentNode),r&&(a.childNodes[1].scrollLeft=h.childNodes[1].scrollLeft);var u=!0!==e?e:{},c=H.extend({direction:s,callback:S(function(){c.callback=null,Ni.breakLine(o),this.ZI=!1,this.$master.st&&Mt(this.$master.$view,"webix_animation")},this),top:n,keepViews:r},u);o=Ni.formLine(h,a,c),Ni([h,a],c),this.ZI=!0}},Mo=(H.protoUI(yo,ze,Ri,Hi.view,g),{name:"comments",defaults:{sendAction:"click",mode:"comments",highlight:!0},$init:function(t){this.$view.className+=" webix_comments",this.Bt=[],t.rows=[this.tA(t)],t.moreButton||(t.moreButton=Yt(I.comments.moreComments)),t.readonly||(t.rows.push(this.iA(t)),this.eA()),this.sA(t.users),this.$ready.push(this.c$)},$exportView:function(){return this.nA},c$:function(){var e=this;this.nA=this.queryView("list"),this.Jg=this.queryView("form"),this.hA=this.queryView("button"),this.rA=this.queryView({localId:"textarea"}),this.config.mentions&&this.oA(this.config.mentions),this.nA.data.provideApi(this,!0),this.serialize=function(){var t=e.nA.serialize(),i=e.getIndexById("$more");return 0<=i&&t.splice(i,1),t},this.P.readonly||(this.aA=A("onClick",function(t){var i=oi(t);i==e.rA?e.focus():i===e.hA||i===e.uA||e.cA&&i===e.cA.getList()||t&&-1!==(t.target.className||"").toString().indexOf("webix_comments_menu")||e.fA()}),this.attachEvent("onDestruct",function(){F(this.aA)}),this.nA.attachEvent("onAfterScroll",function(){e.uA.hide()}))},$onLoad:function(t,i){return this.lA(t,i)},lA:function(t,i){var e=this,s=this.nA||this.queryView({view:"list"});s.data.driver=i;var n=!1;if(t="function"==typeof t.serialize?t.serialize():(n=t.more,i.getRecords(t)),this.dA){if(this.dA=!1,t.length){var h=s.data.order,r=1;if("chat"==this.P.mode)s.data.order=m([h[0]].concat(new Array(t.length),h.slice(1)));else{var o=s.getIndexById("$more");s.data.order=m(h.slice(0,o).concat(new Array(t.length),h.slice(o))),r=o}s.parse({data:t,pos:r}),n&&le(this.nA).ignore(function(){e.nA.updateItem("$more",{value:n})}),"chat"==this.P.mode&&s.showItem(s.getIdByIndex(t.length))}t.length&&n||le(this.nA).ignore(function(){e.nA.remove("$more")})}else n&&!s.exists("$more")&&(n={id:"$more",value:n,$css:"webix_comments_more_item"},
"chat"==this.P.mode?t.unshift(n):t.push(n)),s.parse(t),"chat"==this.P.mode&&s.waitData.then(function(){return s.showItem(s.getLastId())});return!0},$skin:function(){kn.api.$skin.call(this),this.Hb=Li.inputHeight+6},getUsers:function(){return this.vA},getMenu:function(){return this.uA},setCurrentUser:function(t){this.config.currentUser=t,this.Jg.clear(),this.nA.refresh()},edit:function(t){if(!this.config.readonly&&this.callEvent("onBeforeEditStart",[t])){this.fA(!0);var i=this.nA.getItem(t);this.Jg.setValues(i),this.Jg.focus();var e=this.Jg.elements.text.getInputNode();e.scrollTop=e.scrollHeight,$t(e,i.text.length),this.callEvent("onAfterEditStart",[t])}},_A:function(t){var i=this.Jg.getValues();i.text&&(i.id?this.updateItem(i.id,i):(this.config.currentUser&&(i.user_id=this.config.currentUser),i.date=new Date,this.add(i),this.nA.showItem(i.id)),this.Jg.clear(),t&&(this.rA.getInputNode().value=""))},pA:function(t){this.Jg.getValues().id==t&&this.Jg.clear(),this.remove(t)},fA:function(t){if(!q.touch&&!t!=!this.bA){var i=this.rA;this.bA=t?(this.hA.getParentView().show(),i.define({height:84}),!0):(Mi.hasFocus(this.hA)&&Mi.setFocus(this.nA),this.hA.getParentView().hide(),i.define({height:this.Hb}),!1),i.resize()}},focus:function(){var t=this;this.fA(!0),k(function(){t.rA.focus()})},mA:function(t){t||(t=this.rA.getValue()),t&&!this.hA.isEnabled()?this.hA.enable():!t&&this.hA.isEnabled()&&this.hA.disable()},eA:function(){var e=this;this.uA=si({view:"contextmenu",autowidth:!0,point:!1,data:[{id:"edit",icon:"wxi-pencil",value:I.comments.edit},{id:"remove",icon:"wxi-trash",value:I.comments.remove}],on:{onShow:function(){var t=e.uA.getContext();e.nA.addCss(t.id,"active_menu")},onHide:function(){var t=e.uA.getContext();e.nA.removeCss(t.id,"active_menu")},onItemClick:function(t){var i=e.uA.getContext();e.callEvent("onBeforeMenuAction",[t,i.id])&&("edit"==t?e.edit(i.id):"remove"==t&&(I.comments.confirmMessage?Zs({text:I.comments.confirmMessage,callback:function(t){t&&e.pA(i.id)}}):e.pA(i.id)))}}}),this.Bt.push(this.uA)},iA:function(t){var n=this,i=I.comments,e={view:"textarea",localId:"textarea",css:"webix_comments_textarea",height:this.Hb,name:"text",placeholder:i.placeholder,keyPressTimeout:100,on:{onTimedKeyPress:function(){n.mA()},onChange:function(t){n.mA(t)},onKeyPress:function(t,i){if(13==t){var e=n.P.sendAction,s=i.shiftKey;("enter"==e&&!s||"enter"!==e&&s)&&(gt(i),n._A(!0))}}}};return!1!==t.highlight&&H.extend(e,{view:"texthighlight",type:"textarea",highlight:function(t){return n.gA(Yt.escape(t),!0)}},!0),{view:"form",minHeight:50,paddingX:10,elements:[e,{hidden:!q.touch,cols:[{},{view:"button",disabled:!0,css:"webix_comments_send webix_primary",value:i.send,autowidth:!0,click:function(){n._A()}}]}]}},gA:function(t,n){var h,r=this;if(-1===t.indexOf("@"))return t;"users"===this.P.highlight&&(h=this.cA&&this.cA.P.textValue||"value");var i=n?this.wA:this.xA;return t.replace(i,function(t,i,e,s){return r.yA(t,s||i,h,n)})},yA:function(t,i,e,s){return e&&!this.vA.find(function(t){return t[e]==i},!0)?t:'<span class="webix_comments_mention">'.concat(s?t:"@"+i,"</span>")},tA:function(i){var r=this,o="webix_comments_",e={height:"auto",templateStatus:function(t){return"<span class = '"+o+"status "+t.status+"'></span>"},templateUser:function(t){var i=r.getUsers(),e=i&&i.exists(t.user_id)?i.getItem(t.user_id):{};return"<span class = '"+o+"name'>"+(e.value||"")+"</span>"},templateMenu:function(){return r.config.readonly?"":"<span class='webix_icon wxi-dots "+o+"menu'></span>"},templateDate:function(t){var i=sn.dateToStr("%d %M, %H:%i");return t.date?"<span class='"+o+"date'>"+i(t.date)+"</span>":""},templateLinks:function(t){return t.text.replace(/(https?:\/\/[^\s]+)/g,function(t){var i="<a target='_blank' href='"+(t=Yt.escape(t))+"'>";return t.match(/.(jpg|jpeg|png|gif)$/)?i+="<img class='webix_comments_image' src='"+t+"'/>":i+=t,i+"</a>"})},templateMentioned:function(t){return r.gA(t.text)},templateText:function(t,i){return r.P.mentions&&r.P.highlight&&((t=_(t)).text=i.templateMentioned(t,i)),"<div class = '"+o+"message'>"+i.templateLinks(t
)+"</div>"},templateAvatar:function(t,i){var e="<div class='"+o+"avatar'>",s=r.getUsers(),n=s&&s.exists(t.user_id)?s.getItem(t.user_id):{};if(n.status&&(e+=i.templateStatus(n)),e+="<div class='"+o+"avatar_image ",n.image)e+="'><img src = '"+n.image+"' class='"+o+"photo'>";else{var h=n.value?n.value[0].toUpperCase():"<span class='webix_icon wxi-user'></span>";e+=o+"avatar_text'>"+h}return e+="</div></div>"},template:function(t,i){var e;if("$more"==t.id)e="<div class='webix_comments_more'>"+r.P.moreButton(t)+"</div>";else{var s=i.templateAvatar(t,i),n=i.templateUser(t,i),h=i.templateDate(t,i);e=s+n+i.templateMenu(t,i)+h+i.templateText(t,i)}return e},classname:function(t,i,e){var s=qh.api.type.classname(t,i,e);return(t.user_id&&t.user_id==r.P.currentUser||!r.vA.count())&&(s+=" webix_comments_current"),s}};e=H.extend(e,i.listItem||{},!0);var s={$init:function(t){t.date&&(t.date=I.parseFormatDate(t.date))}};i.scheme&&Object.keys(i.scheme).forEach(function(t){s[t]=i.scheme[t]});var t={view:"list",navigation:!1,type:e,scheme:s,onClick:{webix_comments_menu:function(t,i){r.uA.isVisible()?r.uA.hide():(r.uA.setContext({obj:r,id:i}),r.uA.show(t.target,e.menuPosition||{pos:"left",y:30,x:10}))},webix_comments_more:function(){if(r.config.url&&r.callEvent("onDataRequest",[])){r.dA=!0;var t=r.nA.getItem("$more").value,i="chat"==r.P.mode?t:r.nA.getIndexById("$more"),e=W.$parse(r.config.url),s={error:function(){r.dA=!1}};"string"==typeof e&&(e=e+(e.indexOf("?")<0?"?":"&")+"pos="+i+"&more="+t),r.load(e,s,{pos:i,more:t})}}}};return i.save&&(t.save=i.save),t},sA:function(t){var i=this;t&&t.getItem?this.vA=t:(this.vA=new kh,this.Bt.push(this.vA),t&&"string"==typeof t?this.vA.load(t):this.vA.parse(t||[])),this.vA.data.attachEvent("onStoreUpdated",function(){return i.nA.refresh()})},oA:function(t){var s=this,i=this.config.readonly;i||this.MA(t),this.config.highlight&&(i||(this.wA=new RegExp("@((&quot;(.*?)&quot;)|([^\\s]{1,}))","g")),this.xA=new RegExp('@(("(.*?)")|([^\\s]{1,}))',"g")),b.all([this.nA.waitData,this.vA.waitData]).then(function(){s.nA.refresh()}),this.nA.data.attachEvent("onStoreUpdated",function(t,i,e){!t||"add"!==e&&"update"!==e||s.SA(i)})},MA:function(t){var i="object"!=M(t)?{}:t;"object"!==M(i.body)?i.body={data:this.vA}:i.body.data=this.vA,H.extend(i,{view:"mentionsuggest"},!0);var e=this.rA.define("suggest",i);this.rA.setValueHere=function(t,i,e){return-1!=t.indexOf(" ")&&(t='"'.concat(t,'"')),Sh.api.setValueHere.apply(this,[t,i,e])},this.cA=oi(e)},SA:function(r){var o=this;if(-1!=r.text.indexOf("@")){var a=this.cA&&this.cA.P.textValue||"value",u={};r.text.replace(this.xA,function(t,i,e,s){var n=s||i,h=o.vA.find(function(t){return t[a]==n},!0);return h&&!u[n]&&(o.callEvent("onUserMentioned",[h.id,r.id]),u[n]=!0),t})}}}),So=(H.protoUI(Mo,Ht,kn.view),{name:"timeline",defaults:{scroll:"auto"},$init:function(t){var s=this,i="x"===t.layout;if(i){var e=t.type;this.type.type=e&&e.type||"top",R(t.scroll)&&(t.scroll="x")}this.Vt.className+=i?" webix_timeline_horizontal":" webix_timeline",this.$blockRender=!0,this.data.provideApi(this,!0),this.data.attachEvent("onStoreUpdated",function(t,i,e){return s.render(t,i,e)})},Qo:"webix_tl_id",on_click:{},$setSize:function(t,i){this.$blockRender=!1,Vi.api.$setSize.call(this,t,i)&&this.refresh()},render:function(t,i,e){if(this.isVisible(this.P.id)&&!this.$blockRender){if("update"!=e)return this.callEvent("onBeforeRender",[this.data])&&(this.Ni=null,this.tt.innerHTML=this.data.getRange().map(this.Q,this).join(""),this.callEvent("onAfterRender",[])),!0;var s=this.getItemNode(t);return vt(this.Ni[t]=this.gc(i),s),dt(s),!0}},Q:function(t){this.callEvent("onItemRender",[t]);var i=this.getIndexById(t.id);return this.type.templateStart.call(this,t,this.type,i)+this.type.template.call(this,t,this.type,i)+this.type.templateEnd.call(this)},type:{type:"left",classname:function(t,i,e){var s="webix_timeline_item";return"alternate"!==i.type?s+="  webix_timeline_"+i.type:"x"==this.P.layout?s+=" webix_timeline_"+(e%2?"bottom":"top"):s+=" webix_timeline_"+(e%2?"right":"left"),i.css&&(s+=" "+i.css),t.$css&&(
"object"==M(t.$css)&&(t.$css=at(t.$css)),s+=" "+t.$css),s},lineColor:function(t){return t.color},templateValue:Yt("#value#"),templateDetails:function(t){return t.details||""},templateDate:function(t){return sn.dateToStr("%d %M, %Y")(t.date)},template:function(t,i,e){var s,n,h,r,o,a,u,c,f=Li.dataPadding,l="string"==typeof i.lineColor?i.lineColor:i.lineColor(t,i),d="stroke-width:".concat(2,"px; stroke:").concat(l||Li.timelineColor,";"),v=this.P.scroll?q.scrollSize:0,_=this.$width-2*f-v,p=this.$height-2*f-v,b=i.type,m=e+1==this.count(),g=0,w="",x="",y=i.templateDetails(t,i),M=i.templateValue(t,i);if("x"==this.P.layout){var S=g=Li.listItemHeight,k=g-2*f,C=p-g,$=g+14+f,D="top",I=y?14:0;"bottom"==b?(C=(g=p-g)-I,k=g+14+f,$=p-g+S+14+f+7,D="bottom"):"alternate"==b&&(k=(g=Math.floor(.5*p))-2*f,$=g+14+f,C=g-I,e%2&&(k=$,$=g+S+14+f+7,D="bottom")),w="top:".concat(k,"px; height:").concat(S,"px;"),x="".concat(D,":").concat($,"px; height:auto; max-height:").concat(C,"px; width:inherit;"),s=i.width+14,n=g+14,h=15,r=g,o=i.width+9-6+f,u=9,c=a=g}else{g=Math.floor(.35*_);var A=f,F=Math.floor(.65*_)-14,T=g+14+f,V=g-14;"right"==b?(A=(g=_-T+14+f)+14+f,T=f):"alternate"==b&&(T=(g=Math.floor(.5*_))+14+f,V=F=g-14,e%2&&(A=T,T=f)),w="left:".concat(A,"px; width:").concat(V,"px;"),x="left:".concat(T,"px; width:").concat(F,"px; height:").concat(i.height-f,"px;"),s=g+14,n=i.height+14,r=15,o=h=g,a=i.height+9-6,u=g,c=9}return'<div style="'.concat(w,'" class="webix_timeline_date">').concat(i.templateDate(t,i),'</div>\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="').concat(s,'px" height="').concat(n,'px">\n\t\t\t\t\t\t').concat(m?"":'<line x1="'.concat(h,'px" y1="').concat(r,'" x2="').concat(o,'px" y2="').concat(a,'" class="webix_timeline_node" style="').concat(d,'"/>'),'\n\t\t\t\t\t\t<circle cx="').concat(u,'px" cy="').concat(c,'" r="').concat(6,'" class="webix_timeline_node webix_timeline_point" style="').concat(d,' fill:transparent;" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<div class="webix_timeline_event" style="').concat(x,'">\n\t\t\t\t\t\t<div class="webix_timeline_value">').concat(M,"</div>\n\t\t\t\t\t\t").concat(y?'<div class="webix_timeline_details">'.concat(y,"</div>"):"","\n\t\t\t\t\t</div>")},templateStart:function(t,i,e){return"x"==this.P.layout?"<div ".concat("webix_tl_id",'="',t.id,'" class="').concat(i.classname.call(this,t,i,e),'" style="width:').concat(i.width,'px;">'):"<div ".concat("webix_tl_id",'="',t.id,'" class="').concat(i.classname.call(this,t,i,e),'" style="height:').concat(i.height,'px;">')},templateEnd:Yt("</div>")},templateValue_setter:function(t){this.type.templateValue=Yt(t)},templateDetails_setter:function(t){this.type.templateDetails=Yt(t)},templateDate_setter:function(t){this.type.templateDate=Yt(t)},$skin:function(){this.type.height=Li.timelineItemHeight,this.type.width=3*Li.timelineItemHeight}}),ko=(H.protoUI(So,je,Pe,_e,ze,g,Pi,Vi.view),{name:"menu",Im:"webix_menu",$init:function(t){t.autowidth&&(this.kA=!0,delete t.autowidth),this.data.attachEvent("onStoreUpdated",S(function(){this.Mu()},this)),this.attachEvent("onMouseMove",this.CA),this.attachEvent("onMouseOut",function(t){this.$A()&&"click"==this.P.openAction||!this.DA&&t.relatedTarget&&this.Mu()}),this.attachEvent("onItemClick",function(t,i,e){var s=this.getItem(t);if(s){if(s.$template)return;var n=this.getTopMenu();if(!n.callEvent("onMenuItemClick",[t,i,e]))return void(i.showpopup=n.P.id);this!=n&&n.mc(t,i,e),this.type.IA(s)||n.AA?((q.touch||this===n&&"click"==n.P.openAction)&&this.ku(t,e),i.showpopup=n.P.id):(n.Mu(!0),n.FA&&n.hide())}}),this.attachEvent("onKeyPress",function(t){if(9===t)this.getTopMenu().Mu();else if(13===t||32===t){var i,e=this.getSelectedId();e&&(i=this.getItemNode(e)),i&&xt(i,"MouseEvents","click")}}),this.data.attachEvent("onClearAll",function(){this.TA=[]}),this.data.TA=[],this.Vt.setAttribute("role","menubar"),this.Bt=[]},sizeToContent:function(){if("y"==this.P.layout){var i=[],e=!1;this.data.each(function(t){i.push(this.Q(t)),t.submenu&&(e=!0)},this),this.config.width=St(i,this.$view.className).width+16+2+(e?15:0),this.resize()}},
getTopMenu:function(){for(var t=this;t.yu;)t=oi(t.yu);return t},Vm:function(t){this.P.autoheight&&(t=this.count());for(var i=this.count(),e=0,s=0;s<t;s++){var n=this.data.pull[this.data.order[s]];n&&"Separator"==n.$template?(e+=4,this.P.autoheight||t++):e+=this.type.height}return this.Mc(t&&t<i,"y"),e},on_mouse_move:{},type:{IA:function(t){return t.submenu||t.data||t.item},css:"menu",width:"auto",aria:function(t,i,e){return'role="menuitem"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':'tabindex="-1"')+(i.IA(t)?'aria-haspopup="true"':"")+(t.disabled?' aria-disabled="true"  webix_disabled="true"':"")},templateStart:function(t,i,e){if("Separator"===t.$template||"Spacer"===t.$template)return'<div webix_l_id="#id#" role="separator" tabindex="-1" class="webix_context_'+t.$template.toLowerCase()+'">';var s=(t.href?" href='"+t.href+"' ":"")+(t.target?" target='"+t.target+"' ":"");return qh.api.type.templateStart(t,i,e).replace(/^<div/,"<a "+s)+(i.IA(t)&&i.subsign?"<div class='webix_submenu_icon'></div>":"")},templateEnd:function(t){return"Separator"===t.$template||"Spacer"===t.$template?"</div>":"</a>"},templateSeparator:Yt("<div class='sep_line'></div>"),templateSpacer:Yt("<div></div>")},getMenu:function(t){if(this.data.pull[t])return this;for(var i in this.data.pull){var e=this.getItem(i);if(e.submenu){var s=this.VA(e).getMenu(t);if(s)return s}}},getSubMenu:function(t){var i=this.getMenu(t),e=i.getItem(t);return e.submenu?i.VA(e):null},getMenuItem:function(t){return this.getMenu(t).getItem(t)},VA:function(t){var i=oi(t.submenu);return i||(t.submenu=this.zA(t),i=oi(t.submenu)),i},CA:function(t,i,e){this.$A()&&this.ku(t,e)},$A:function(){if(q.touch)return!1;var t=this.getTopMenu();if("click"!=t.P.openAction)return!0;var i=t.BA;return!(!i||!oi(i).isVisible())},ku:function(t,i){var e=this.getItem(t);if(e&&(this.DA=null,this.BA&&e.submenu!=this.BA&&this.Mu(!0),this.type.IA(e)&&!this.config.hidden)){var s=this.VA(e);if(!this.isItemEnabled(t))return;s.show(i,{pos:this.P.subMenuPos}),s.yu=this.P.id,this.BA=e.submenu}},disableItem:function(t){var i=this.getMenu(t);i&&i.Bm(t,!0)},enableItem:function(t){var i=this.getMenu(t);i&&i.Bm(t,!1)},isItemEnabled:function(t){var i=this.getMenu(t);if(i)return qh.api.isItemEnabled.apply(i,arguments)},HA:function(t,i){var e=this.data;e.TA[t]!=i&&(e.TA[t]=i,e.filter(function(t){return!e.TA[t.id]}),this.resize())},hideItem:function(t){var i=this.getMenu(t);i&&i.HA(t,!0)},showItem:function(t){var i=this.getMenu(t);if(i)return i.HA(t,!1),qh.api.showItem.call(i,t)},Mu:function(t){if(this.BA){var i=oi(this.BA);i.Mu&&i.Mu(t),!t&&i.Xn||(i.hide(),this.BA=null)}},zA:function(t){var i={view:"submenu",data:this.type.IA(t)},e=this.getTopMenu().P.submenuConfig;e&&H.extend(i,e,!0);var s=this.getMenuItem(t.id);s&&s.config&&H.extend(i,s.config,!0);var n=si(i);return this.Bt.push(n),n.yu=this,n.P.id},Su:function(t,i,e){var s=this.getItem(t);return"Separator"!=s.$template&&"Spacer"!=s.$template&&this.isItemEnabled(t)?t:(t=this.getNextId(t,e)||null)&&t!=i?this.Su(t,i,e):i},$skin:function(){qh.api.$skin.call(this),this.type.height=Li.menuHeight},defaults:{scroll:"",layout:"x",mouseEventDelay:100,subMenuPos:"bottom"}}),Co={api:ko,view:H.protoUI(ko,qh.view)},$o={name:"submenu",$init:function(){this.$t=l(this.RA),(this.$t.Ht=this).attachEvent("onMouseOut",function(t){"click"!=this.getTopMenu().P.openAction&&(this.DA||this.Xn||!t.relatedTarget||this.hide())}),this.attachEvent("onMouseMoving",function(){this.yu&&(oi(this.yu).DA=!0)}),this.attachEvent("onBeforeShow",function(){this.getTopMenu().kA&&this.sizeToContent&&!this.isVisible()&&this.sizeToContent()}),this.tt.setAttribute("role","menu")},$skin:function(){Co.api.$skin.call(this),th.api.$skin.call(this),this.type.height=Li.menuHeight},RA:{$getSize:function(t,i){var e=1*this.Ht.P.height,s=1*this.Ht.P.width,n=Co.api.$getSize.call(this.Ht,t,i);return this.Ht.P.height=e,this.Ht.P.width=s,n},$setSize:function(t,i){this.Ht.P.scroll&&(this.Ht.Fn.style.height=i+"px")},destructor:function(){this.Ht=null}},body_setter:function(){},getChildViews:function(){return[]},
defaults:{width:150,subMenuPos:"right",layout:"y",autoheight:!0},type:{height:Li.menuHeight,subsign:!0}},Do={api:$o,view:H.protoUI($o,Co.view,th.view)},Io={name:"sidemenu",defaults:{animate:!0,position:"left",width:200,borderless:!0},$init:function(){this.$view.className+=" webix_sidemenu"},$skin:function(){th.api.$skin.call(this),this.defaults.padding=0},position_setter:function(t){var i=this.P.position;return i&&Mt(this.$view," webix_sidemenu_"+i),yt(this.$view," webix_sidemenu_"+t),t},$getSize:function(){var t=ie.api.$getSize.apply(this,arguments);return this.EA=t},$setSize:function(t,i){Hi.api.$setSize.call(this,t,i),t=this.me-2*this.P.padding,i=this.we-2*this.P.padding,this.Wi.style.padding=this.P.padding+"px",this.vn.style.display="none",this.Fn.style.height=i+"px",this.$t.$setSize(t,i)},show:function(){if(!this.callEvent("onBeforeShow",arguments))return!1;this.P.hidden=!1,this.Vt.style.zIndex=_i(this.P.zIndex),(this.P.modal||this.Vn)&&(this._n(!0),this.Vn=null),this.Vt.style.display="block",this.Me(),this.P.position&&this.Qt(),this.Rn=1,k(function(){this.Rn=0},this,[],q.touch?400:100),this.config.autofocus&&(this.En=Mi.getFocus(),Mi.setFocus(this)),-1==ii.kt.find(this)&&ii.kt.push(this),this.callEvent("onShow",[])},Qt:function(t){var i,e,s,n,h,r=0,o=0,a={};this.$view.style.position="fixed",s=document.documentElement.offsetWidth,n=document.documentElement.offsetHeight,i=this.EA[0]||s,e=this.EA[2]||n,"top"==(h=this.P.position)?i=s:"right"==h?(e=n,r=s-i):"bottom"==h?(i=s,o=n-e):e=n,a={left:r,top:o,width:i,height:e,maxWidth:s,maxHeight:n},"function"==typeof this.P.state&&this.P.state.call(this,a),this.PA=a,this.$setSize(a.width,a.height),void 0===t&&this.jA()?(Mt(this.$view,"webix_animate"),this.DC[this.P.position].beforeShow.call(this,a),k(function(){yt(this.$view,"webix_animate",!0)},this,null,1),k(function(){this.DC[this.P.position].show.call(this,a)},this,null,10)):("right"===this.P.position&&(a.left=a.right?s-a.width-a.right:s-a.width),this.setPosition(a.left,a.top))},PA:{},jA:function(){return Ni.isSupported()&&this.P.animate&&!(q.isIE&&-1!=navigator.appVersion.indexOf("MSIE 9"))},hidden_setter:function(t){return t?this.hide():this.show(),!!t},DC:{left:{beforeShow:function(t){this.$view.style.left=-t.width+"px",this.$view.style.top=t.top+"px"},show:function(t){this.$view.style.left=t.left?t.left+"px":"0px"},hide:function(t){this.$view.style.left=-t.width+"px"}},right:{beforeShow:function(t){this.$view.style.left="auto",this.$view.style.right=-t.width+"px",this.$view.style.top=t.top+"px"},show:function(t){this.$view.style.right=t.right?t.right+"px":"0px"},hide:function(t){this.$view.style.right=-t.width+"px"}},top:{beforeShow:function(t){this.setPosition(t.left,t.top),this.$view.style.height="0px",this.Fn.style.height="0px"},show:function(t){this.$view.style.height=t.height+"px",this.Fn.style.height=t.height+"px"},hide:function(){this.$view.style.height="0px",this.Fn.style.height="0px"}},bottom:{beforeShow:function(t){this.$view.style.left=t.left+"px",this.$view.style.top="auto";var i=t.bottom!=undefined?t.bottom:t.maxHeight-t.top-t.height;this.$view.style.bottom=i+"px",this.$view.style.height="0px"},show:function(t){this.$view.style.height=t.height+"px"},hide:function(){this.$view.style.height="0px"}}},Nn:function(){var t=document.documentElement.offsetWidth,i=document.documentElement.offsetHeight;if(this.jA()&&t==this.PA.maxWidth&&i==this.PA.maxHeight){this.DC[this.P.position].hide.call(this,this.PA);var e=Zt(this.$view,q.transitionEnd,S(function(){this.Ln(),Qt(e)},this))}else this.Ln()}},Ao=(H.protoUI(Io,th.view),{name:"sidebar",defaults:{type:"sideBar",activeTitle:!0,select:!0,scroll:!1,collapsed:!1,collapsedWidth:44,position:"left",width:250,mouseEventDelay:10},$skin:function(){this.defaults.titleHeight=Li.sidebarTitleHeight},$init:function(t){this.$view.className+=" webix_sidebar",this.$ready.push(this.NA),this.$ready.push(this.LA),this.data.Rr=function(t){t.data?t.menu=_(t.data):t.item&&(t.menu=_(t.item.length?t.item:[t.item]))},t.multiselect=!1},on_context:{},on_mouse_move:{},NA:function(){
this.OA=this.config.width,this.attachEvent("onBeforeOpen",function(t){if(!this.config.multipleOpen)for(var i=this.getOpenItems(),e=0;e<i.length;e++)this.getParentId(t)==this.getParentId(i[e])&&this.close(i[e]);return!this.config.collapsed}),this.attachEvent("onItemClick",function(t,i,e){var s=this.getPopup();s&&!s.config.hidden&&(i.showpopup=s.config.id),q.touch&&this.WA(t,e)}),this.attachEvent("onBeforeSelect",function(t){return!this.getItem(t).$count&&(this.clearCss("webix_sidebar_selected"),!0)}),this.attachEvent("onAfterSelect",function(t){this.UA(this,t,!Li.sidebarMarkAll),this.getPopup().YA(t)}),this.attachEvent("onAfterUnSelect",function(){this.clearCss("webix_sidebar_selected")}),this.attachEvent("onMouseMove",function(t,i,e){this.WA(t,e)}),this.attachEvent("onMouseOut",function(){this.config.collapsed&&(this.getPopup().masterId=null)}),this.config.collapsed&&this.collapse()},WA:function(t,i){if(this.config.collapsed){var e=this.getPopup();e&&(this.qA(t,e),this.GA(t,e),e.masterId=t,e.show(i,{x:"left"==this.config.position?this.config.collapsedWidth:-e.config.width,y:-1}))}},qA:function(t,i){var e=i.getBody().getChildViews()[0];e&&i.masterId!=t&&(e.parse(this.getItem(t)),this.getSelectedId()==t?yt(e.$view,"webix_selected",!0):Mt(e.$view,"webix_selected"))},GA:function(t,i){var e=i.getBody().getChildViews()[1];if(e&&i.masterId!=t){this.exists(i.masterId)&&this.getItem(i.masterId).menu&&this.updateItem(i.masterId,{menu:e.data.serialize()}),e.clearCss("webix_sidebar_selected"),e.unselectAll();var s=_(this.getItem(t).menu||[]);if(s.length){e.show(),e.data.importData(s);var n=this.getSelectedId();e.exists(n)?e.select(n):n&&this.UA(e,n)}else e.hide(),e.data.clearAll()}},LA:function(){var e,n=this,s=n.config;if(s.popup&&(e=oi(s.popup)),!e){var t="left"==s.position?"webix_sidebar_popup_left":"webix_sidebar_popup_right",i="left"==s.position?"right":"left",h=function(t){var i="wxi-angle-"+("left"==s.position?"right":"left");return(t.submenu||t.data||t.item?'<div class="webix_icon '+i+'"></div>':"")+t.value},r=s.css?" "+s.css:"",o={view:"popup",css:"webix_sidebar_popup "+t+r,autofit:!1,width:this.OA-this.config.collapsedWidth,borderless:!0,padding:0,body:{rows:[{view:"template",borderless:!0,css:"webix_sidebar_popup_title",template:"#value#",height:this.config.titleHeight+2,onClick:{webix_template:function(){var t=this.getValues().id;n.getItem(t).$count||n.select(t)}}},{view:"menu",submenu:"data",layout:"y",subMenuPos:i,select:!0,borderless:!0,autoheight:!0,css:"webix_sidebar_popup_list "+t+r,template:h,type:{subsign:!1},submenuConfig:{padding:0,subMenuPos:i,template:h,select:!0,type:{subsign:!1},css:"webix_sidebar_popup_list "+t+r,on:{onShow:function(){this.clearCss("webix_sidebar_selected"),this.unselectAll();var t=n.getSelectedId();t&&this.exists(t)?this.select(t):t&&n.UA(this,t)},onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onAfterSelect:function(t){for(var i=n.getPopup().queryView({view:"menu"}),e=n.getParentId(t);e;){var s=i.getMenu(e);s&&(s.unselectAll(),n.UA(s,t)),e=n.getParentId(e)}n.UA(this,t)}}},on:{onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onMenuItemClick:function(t){this.getSubMenu(t)||n.select(t)}}}]}};H.extend(o,s.popup||{},!0),(e=si(o)).YA=function(t){if(n.config.collapsed&&1==n.getItem(t).$level){var i=e.getBody().getChildViews()[0];i&&yt(i.$view,"webix_selected",!0)}},e.queryView({view:"menu"}).AA=!0}e.attachEvent("onBeforeShow",function(){return s.collapsed}),this.Bt=[e],s.popupId=e.config.id,Kt(document.body,"mousemove",function(t){var i=t.target;e.config.hidden||e.$view.contains(i)||this.$view.firstChild.contains(i)||e.queryView({view:"menu"}).BA||e.hide()},{bind:this})},UA:function(i,e,s){var n="webix_sidebar_selected";i.data.each(function(t){!this.XA(e,t.id)||s&&"0"!=this.getParentId(t.id)?i.hasCss(t.id,n)&&i.removeCss(t.id,n):i.addCss(t.id,n)},this)},XA:function(t,i){var e=this.getParentId(t);return i==e||!!e&&this.XA(e,i)},getPopup:function(){return oi(this.config.popupId)},position_setter:function(t){var i=t,e="left"==t?"right":"left";Mt(this.$view,"webix_sidebar_"+e),
yt(this.$view,"webix_sidebar_"+i,!0);var s=this.getPopup();if(s){var n=s.$view;Mt(n,"webix_sidebar_popup_"+e),yt(n,"webix_sidebar_popup_"+i,!0)}return t},select:function(t){t&&($(t)&&(t=t.pop()),go.api.select.call(this,t))},selectAll:function(){},collapse:function(){this.define("collapsed",!0)},expand:function(){this.define("collapsed",!1)},toggle:function(){var t=!this.config.collapsed;this.define("collapsed",t)},collapsed_setter:function(t){var i;return t?(i=this.config.collapsedWidth,this.closeAll(),this.type.collapsed=!0,Mt(this.$view,"webix_sidebar_expanded")):(i=this.OA,this.type.collapsed=!1,yt(this.$view,"webix_sidebar_expanded",!0)),this.define("width",i),this.resize(),t},getState:function(){var t={collapsed:this.config.collapsed};return H.extend(t,rs.getState.call(this)),t},setState:function(t){rs.setState.call(this,t),this.define("collapsed",t.collapsed)}});ti(go.view,{name:"sideBar",height:"auto",template:function(t,i){return i.collapsed?i.icon(t,i):i.arrow(t,i)+i.icon(t,i)+"<span>"+t.value+"</span>"},arrow:function(t){for(var i="",e=1;e<=t.$level;e++){if(e==t.$level&&t.$count)i+="<span class='"+("webix_sidebar_dir_icon webix_icon "+("wxi-angle-"+(t.open?"down":"left")))+"'></span>"}return i},icon:function(t){var i="";return 2<t.$level&&(i='style="padding-left:'+40*(t.$level-2)+'px"'),t.icon?"<span class='webix_icon webix_sidebar_icon "+t.icon+"' "+i+"></span>":"<span "+i+"></span>"}});H.protoUI(Ao,go.view),H.protoUI({name:"context"},ee,th.view);var Fo={name:"contextmenu",FA:!0,$init:function(t){t.submenuConfig&&H.extend(t,t.submenuConfig)}},To=(H.protoUI(Fo,ee,Do.view),{name:"treetable",$init:function(){for(var t in H.extend(this.data,ls,!0),H.extend(this.type,vs),H.extend(this,us,!0),os)this.on_click[t]||(this.on_click[t]=this.JA(os[t]));this.type.treetable=Yt("{common.space()}{common.icon()} {common.folder()}"),this.type.treecheckbox=function(t){return t.indeterminate&&!t.nocheckbox?"<div class='webix_tree_checkbox webix_indeterminate'></div>":vs.checkbox.apply(this,arguments)},this.data.provideApi(this,!0),this.Vt.setAttribute("role","treegrid")},Go:!1,JA:function(e){return function(t,i){return i=i.row,e.call(this,t,i)}},Yo:function(t){for(var i=this.P.prerender?t.source:[t.start],e=0;e<i.length;e++)this.close(i[e])},getState:function(){var t=pe.getState.call(this);return H.extend(t,rs.getState.call(this)),t},setState:function(t){rs.setState.call(this,t)&&pe.setState.call(this,t)},clipboard_setter:function(t){return H.extend(this.Zn,ds),hs.clipboard_setter.call(this,t)},hl:function(t,i){for(var e=0;e<t.start;e++){var s=this.data.order[e];s&&1!=this.getItem(s).$level&&t.start--}return zr.api.hl.call(this,t,i)}}),Vo=(H.protoUI(To,rs,fs,as,zr.view),{name:"filter",$init:function(t){t.mode=t.mode||"number",this.P.conditions=t.conditions,this.P.mode=this.mode_setter(t.mode),delete t.mode,t.rows=this.KA(t),this.$ready.push(this.c$)},$onLoad:function(t,i){return this.lA(t,i)},lA:function(t,i){var e=this,s=this.nA||this.queryView("list");s.data.driver=i;var n=[],h={};if("function"==typeof t.serialize?(t.data&&"DataStore"==t.data.name&&(t=t.data),t.each(function(t){return e.ZA(t,n,h)})):i.getRecords(t).forEach(function(t){return e.ZA(t,n,h)}),s.clearAll(),s.parse(n),this.nA){var r=this.P.value.includes;this.QA(),this.tF(r)}return!0},ZA:function(t,i,e){var s=t[this.P.field];R(s)||e[s]||(e[s]=!0,i.push(_(t)))},c$:function(){var t=this;this.nA=this.queryView("list"),this.uv=this.queryView("toggle"),this.To=this.queryView("richselect"),this.rA=this.queryView({batch:this.iF}),this.nA.data.provideApi(this,!0),this.nA.data.attachEvent("onSyncApply",function(){return t.lA(t.nA,t.nA.data.driver)}),this.setValue(this.P.value,!0)},mode_setter:function(t){if(this.eF[t],this.sF=this.nF(this.P.conditions,t),this.rA){var i=this.To.getList();i.clearAll(),i.parse(this.sF),this.To.config.value="",this.To.setValue(this.sF[0].id)}else this.iF=this.sF[0].batch;return t},KA:function(t){var e=this,i=this.hF(t.inputs);return[{visibleBatch:this.iF,cols:[{view:"richselect",value:this.sF[0].id,width:160,options:this.sF,on:{onChange:function(
t){e.rF(t),e.applyFilter()}}}].concat(o(i))},{view:"toggle",batch:"includes",onLabel:I.combo.unselectAll,offLabel:I.combo.selectAll,value:!0,on:{onItemClick:function(){e.oF(e.uv.getValue()),e.callEvent("onChange",[])}}},{view:"list",batch:"includes",css:"webix_multilist",autoheight:!0,borderless:!0,yCount:5,type:"checklist",template:t.template||"#".concat(t.field,"#"),on:{onItemClick:function(t){var i=e.nA.getItem(t);e.nA.updateItem(t,{$checked:!i.$checked}),e.P.value.includes=e.aF(),e.uF(e.uv,e._w()),e.callEvent("onChange",[])}}}]},hF:function(t){var i=this;t=t||Object.keys(this.di);for(var e=0;e<t.length;e++)if(this.di[t[e]]){if(t[e]=_(this.di[t[e]]),t[e].on){var s=t[e].on;for(var n in s)s[n]=function(){return i.applyFilter()}}}else t[e]&&t[e].batch;return t},di:{text:{view:"text",batch:"text",on:{onTimedKeyPress:!0}},datepicker:{view:"datepicker",batch:"datepicker",on:{onChange:!0}},daterangepicker:{view:"daterangepicker",batch:"daterangepicker",on:{onChange:!0}},none:{view:"spacer",batch:"none"}},cF:{number:ln.number,text:ln.text,date:{greater:{batch:"datepicker",handler:ln.date.greater},less:{batch:"datepicker",handler:ln.date.less},greaterOrEqual:{batch:"datepicker",handler:ln.date.greaterOrEqual},lessOrEqual:{batch:"datepicker",handler:ln.date.lessOrEqual},equal:{batch:"datepicker",handler:ln.date.equal},notEqual:{batch:"datepicker",handler:ln.date.notEqual},between:{batch:"daterangepicker",handler:ln.date.between},notBetween:{batch:"daterangepicker",handler:ln.date.notBetween}}},eF:{number:["greater","less","greaterOrEqual","lessOrEqual","equal","notEqual","contains","notContains"],text:["contains","notContains","equal","notEqual","beginsWith","notBeginsWith","endsWith","notEndsWith"],date:["greater","less","greaterOrEqual","lessOrEqual","equal","notEqual","between","notBetween"]},nF:function(t,i){t=t||this.eF[i];for(var e=[],s=0;s<t.length;s++){var n=this.fF(t[s],i);e.push(n)}return e},fF:function(t,i){if(t&&"function"==typeof t.handler)return t;if(this.cF[i][t]){var e={id:t,value:I.filter[t]},s="function"==typeof this.cF[i][t]?{batch:"text",handler:this.cF[i][t]}:this.cF[i][t];return H.extend(e,s,!0)}return null},lF:function(t){for(var i=0;i<this.sF.length;i++)if(this.sF[i].id==t)return this.sF[i]},aF:function(){var i=this,e=[];return this.nA.data.each(function(t){t.$checked&&e.push(t[i.P.field])}),e.length==this.nA.count()?null:e},getValue:function(){return{condition:{filter:this.rA.getValue?this.rA.getValue()||"":null,type:this.To.getValue()},includes:this.aF()}},_w:function(){for(var t=this.nA.data.order,i=0;i<t.length;i++)if(!this.getItem(t[i]).$checked)return!1;return!0},$compareValue:function(t,i){if(!t||t.condition.type!==i.condition.type||t.condition.filter!==i.condition.filter)return!1;if(t.includes&&i.includes){if(t.includes.length!==i.includes.length)return!1;for(var e={},s=0;s<t.includes.length;s++)e[t.includes[s]]=!0;for(var n=0;n<i.includes.length;n++)if(!e[i.includes[n]])return!1;return!0}return t.includes===i.includes},setValue:function(t,i){if(t=this.$prepareValue(t),!this.$compareValue(this.P.value,t)){var e=t.condition,s=t.includes;this.rF(e.type),this.uF(this.rA,e.filter),this.uF(this.To,e.type),this.QA(),this.tF(s),this.uF(this.uv,this._w()),this.P.value=t,i||this.callEvent("onChange")}},tF:function(i){var e=this.P.field;this.nA.data.each(function(t){t.$checked=!i||-1!=i.indexOf(t[e])}),this.nA.refresh()},uF:function(t,i){t.setValue&&(t.blockEvent(),t.setValue(i),t.unblockEvent())},$prepareValue:function(t){return(t=t||{}).condition=t.condition||{filter:"",type:this.sF[0].id},t.includes=t.includes||null,t},QA:function(){var i=this.rA.getValue?this.rA.getValue()||"":null;if(""===i)this.nA.filter();else{var e=this.P.field,s=this.lF(this.To.getValue()).handler;this.nA.filter(function(t){return s(t[e],i)})}this.showBatch("includes",!!this.nA.count())},rF:function(t){var i=this.lF(t).batch;i!=this.iF&&(this.iF=i,this.rA=this.queryView({batch:i}),this.rA.setValue&&this.rA.setValue(""),this.rA.getParentView().showBatch(i))},applyFilter:function(){this.QA(),this.uF(this.uv,!0),this.oF(!0),
this.callEvent("onChange")},oF:function(i){this.nA.data.each(function(t){t.$checked=i}),this.nA.refresh(),this.P.value=this.getValue()},getFilterFunction:function(){var e=this.P.field,s="date"==this.P.mode,t=this.getValue(),n=t.includes,h=t.condition,r=this.lF(h.type).handler;return n&&s&&(n=n.map(function(t){return t.valueOf()})),function(t){var i=t[e];return n?-1!=n.indexOf(s?i.valueOf():i):""===h.filter||r(i,h.filter)}}}),zo=(H.protoUI(Vo,Ht,kn.view),H.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(t){this.data=t||{};var i=t&&t.id?t.id:V();this.P={id:i},si.views[i]=this},getValues:function(){return this.data},setValues:function(t,i){this.data=i?H.extend(this.data,t,!0):t,this.callEvent("onChange",[t])},refresh:function(){this.callEvent("onBindRequest")}},g,Ai,Ht,Si)),Bo=H.proto({name:"DataValue",isVisible:function(){return!0},$init:function(t){t&&!R(t.value)||(this.data=t||"");var i=t&&t.id?t.id:V();this.P={id:i},si.views[i]=this},setValue:function(t){this.data=t,this.callEvent("onChange",[t])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},g,Ai),Ho=H.proto({name:"TreeCollection",$init:function(){H.extend(this.data,ls,!0),this.data.provideApi(this,!0),H.extend(this,us,!0)}},as,kh);H.Date=sn,H.Number=nn,H.promise=b,H.DataCollection=kh,H.DataRecord=zo,H.DataValue=Bo,H.TreeCollection=Ho,H.AtomDataLoader=Ht,H.AtomRender=qt,H.AutoScroll=Gt,H.AutoTooltip=Pi,H.BaseBind=Ai,H.BindSource=Ii,H.Canvas=ji,H.CodeParser=Rt,H.CollectionBind=Ci,H.ContextHelper=ee,H.CopyPaste=ne,H.CustomPrint=he,H.CustomScroll=re,H.DataMarks=oe,H.DataMove=ae,H.DataLoader=_e,H.DataState=pe,H.DataStore=ve,H.Destruction=ki,H.DragControl=Xi,H.DragItem=be,H.DragOrder=me,H.EditAbility=Se,H.EventSystem=g,H.FlexLayout=ke,H.Group=De,H.GroupMethods=Ce,H.GroupStore=$e,H.HTMLOptions=Ie,H.HtmlMap=Ae,H.IdSpace=Fe,H.KeysNavigation=Te,H.MapCollection=Ve,H.Modality=Zi,H.MouseEvents=ze,H.Movable=Ji,H.NavigationButtons=Be,H.OverlayBox=He,H.PagingAbility=Re,H.ProgressBar=Ee,H.RecordBind=Di,H.RenderStack=Pe,H.ResizeArea=Qi,H.SingleRender=Ri,H.Scrollable=je,H.SelectionModel=Ne,H.Settings=Si,H.Sparklines=ss,H.TablePaste=hs,H.TooltipControl=ai,H.Touch=Yi,H.TreeAPI=rs,H.TreeClick=os,H.TreeDataLoader=as,H.TreeDataMove=us,H.TreeRenderStack=cs,H.TreeStateCheckbox=fs,H.TreeStore=ls,H.TreeTablePaste=ds,H.TreeType=vs,H.UIManager=Mi,H.Undo=ge,H.UploadDriver=_s,H.ValidateCollection=ps,H.ValidateData=ce,H.ValueBind=$i,H.Values=bs,H.VirtualRenderStack=ms,H.VRenderStack=gs,H.html=vn,H.skin=Ui,H.debug=function Oo(t){if(t)if("object"!==M(t))r={events:!0};else for(var i in t)r[i]=t[i];else r={}},H.i18n=I,H.ready=pi,H.env=q,H.color=Le,H.csv=ns,H.clipbuffer=se,H.storage=rn,H.template=Yt,H.type=ti,H.editors=Me,H.animate=Ni,H.print=function(t,i){var e=oi(t);e&&e.$printView&&(e=e.$printView()),e&&(e.callEvent&&e.callEvent("onBeforePrint",[i]),function s(t){yt(document.body,"webix_print"),t.docHeader&&fn("Header",t),t.docFooter&&fn("Footer",t),ut("@media print { @page{ size:"+t.paper+" "+t.mode+";margin-top:"+t.margin.top+"px;margin-bottom:"+t.margin.bottom+"px;margin-right:"+t.margin.right+"px;margin-left:"+t.margin.left+"px;}}","print")}(i=function n(t){(t=t||{}).paper=on[(t.paper||"").toLowerCase()]||"A4",t.mode=un[t.mode]?t.mode:"portrait",t.fit=an[t.fit]?t.fit:"page",t.scroll=t.scroll||!1,t.size=cn[t.paper],t.margin=t.margin||0===t.margin?t.margin:{};var i=isNaN(1*t.margin)?q.printMargin:t.margin;return t.margin={top:t.margin.top||0===t.margin.top?t.margin.top:i,bottom:t.margin.bottom||0===t.margin.bottom?t.margin.bottom:i,right:t.margin.right||0===t.margin.right?t.margin.right:i,left:t.margin.left||0===t.margin.left?t.margin.left:i},t}(i)),e.$customPrint&&!0!==e.$customPrint(i)||function r(t,i){var e=t.$view.cloneNode(!0),s=t.$view.getElementsByTagName("canvas");if(s.length)for(var n=s.length-1;0<=n;n--){var h=e.getElementsByTagName("canvas")[n].getContext("2d");h.drawImage(s[n],0,0)}vt(e,i.docFooter,document.body),yt(e,"webix_ui_print"),!i.scroll&&(t.tt&&t.data&&t.data.pull||t.getBody)&&yt(e,"webix_print_noscroll"),
window.print(),dt(e)}(e,i),function h(t){Mt(document.body,"webix_print"),ct("print"),t.docHeader&&dt(t.docHeader),t.docFooter&&dt(t.docFooter)}(i))},H.rules=ue,H.filters=ln,H.patterns=dn,H.fullscreen=yi,H.version="8.0.0",H.name="core",H.level_in=function Wo(){0},H.level_out=function Uo(){0},H.clone=l,H.copy=_,H.single=function Yo(t){var i=null;return function(){return i||(i=new t({})),i.dF&&i.dF.apply(i,arguments),i}},H.bind=S,H.exec=p,H.wrap=function qo(i,e){return i?function(){var t=i.apply(this,arguments);return e.apply(this,arguments),t}:e},H.isUndefined=R,H.delay=k,H.once=a,H.uid=V,H.toNode=C,H.toFunctor=v,H.isArray=$,H.isDate=D,H.vF=m,H._F=x,H.pF=Jt,H.bF=Kt,H.event=Zt,H.eventRemove=Qt,H.callEvent=y,H.attachEvent=A,H.detachEvent=F,H.blockEvent=function(){return w.blockEvent()},H.unblockEvent=function(){return w.unblockEvent()},H.mapEvent=function(t){return w.mapEvent(t)},H.hasEvent=function(t){return w.hasEvent(t)},H.stringify=c,H.toPNG=function(s,n){var h=b.defer();return Tt(q.cdn+"/extras/html2canvas-1.0.min.js").then(function(){"string"==typeof n&&(n={filename:n}),n=n||{};var t=oi(s);if(t&&t.$exportView&&(t=t.$exportView(n)),!t)return h.reject(ws);var i=t?t.$view:C(s),e=(n.filename||"Data")+".png";return window.html2canvas(i,{background:"#fff",logging:!1,useCORS:!0}).then(function(t){var i=function(t){!1!==n.download&&kt(t,e),h.resolve(t)};t.msToBlob?i(t.msToBlob()):t.toBlob(i,"image/png")}),h})},H.toCSV=function(t,i){i=i||{};var e=oi(t);if(e&&e.$exportView&&(e=e.$exportView(i)),!e)return b.reject(ws);i.export_mode="csv",i.filterHTML=!0;var s=Ss(e,i),n=function o(t){return ns.stringify(t)}(ks(e,i,s)),h=(i.filename||"Data")+".csv",r=new Blob(["\ufeff"+n],{type:"text/csv"});return!1!==i.download&&kt(r,h),b.resolve(r)},H.toPDF=$s,H.toExcel=Bs,H.alert=function Go(){var t=Ks.apply(this,arguments);return t.type=t.type||"alert",qs(t)},H.confirm=Zs,H.modalbox=Qs,H.prompt=function Xo(){var t=Ks.apply(this,arguments);return t.type=t.type||"prompt",t.input=t.input||{},Js(t)},H.message=tn,H.editStop=function Jo(){y("onEditEnd",[])},H.ajax=B,H.DataDriver=zt,H.dp=le,H.DataProcessor=de,H.remote=mn,H.require=Tt,H.proxy=W,H.send=function Ko(t,i,e,s){var n=ft("FORM",{target:s||"_self",action:t,method:e||"POST"},"");for(var h in i){var r=ft("INPUT",{type:"hidden",name:h,value:i[h]},"");n.appendChild(r)}n.style.display="none",document.body.appendChild(n),n.submit(),document.body.removeChild(n)},H.ui=si,H.$$=oi,Object.defineProperty(H,"mF",{value:!0})});
//# sourceMappingURL=webix.js.map
