webix
Version:
Webix UI
20 lines (19 loc) • 671 kB
JavaScript
/**
* @license
* webix UI v.11.0.0
* This software is allowed to use under GPL or you need to obtain Commercial License
* to use it in non-GPL project. Please contact sales@webix.com for details
*/
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.webix={})}(this,function(R){"use strict";function w(t){return(w="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 z(t,i){return function(t){if(Array.isArray(t))return t}(t)||e(t,i)||n(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t){return function(t){if(Array.isArray(t))return L(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,i){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var s,n,h=[],r=!0,o=!1;try{for(e=e.call(t);!(r=(s=e.next()).done)&&(h.push(s.value),!i||h.length!==i);r=!0);}catch(a){o=!0,n=a}finally{try{r||null==e["return"]||e["return"]()}finally{if(o)throw n}}return h}}function n(t,i){var e;if(t)return"string"==typeof t?L(t,i):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?L(t,i):void 0}function L(t,i){(null==i||i>t.length)&&(i=t.length);for(var e=0,s=new Array(i);e<i;e++)s[e]=t[e];return s}var i=window,O=1,N={},W=!1;function Y(t){i.setImmediate?i.setImmediate(t):i.importScripts||!i.addEventListener?setTimeout(t):(N[++O]=t,i.postMessage(O,"*"))}function B(t){if("function"!=typeof t&&t!=undefined)throw TypeError();if("object"!=w(this)||this&&this.then)throw TypeError();var i,e,n=this,h=0,r=0,s=[],o=((n.promise=n).resolve=function(t){return i=n.fn,e=n.er,h||(r=t,h=1,Y(u)),n},n.reject=function(t){return i=n.fn,e=n.er,h||(r=t,h=2,Y(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)},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"!=w(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(W)Y(N[t.data]);else{W=!0;try{"function"==typeof N[t.data]&&N[t.data]()}catch(t){}delete N[t.data],W=!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();var s;return e instanceof Array?(s=new B,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.reject(TypeError())},B.race=function(e){if(1!=this.i)throw TypeError();var s;return e instanceof Array?0==e.length?new B:(s=new B,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.reject(TypeError())},B.i=1,B.defer=function(){return new B(null)};var U={};function q(t,i){U[t]=i}var G={};function X(t){var i=X.h;return i.prototype=t,new i}function m(t,i,e){var s,n,h=!!(window.Map&&window.Set&&window.WeakMap&&window.WeakSet);for(n in i?(s=t,t=i):s=C(t)?[]:{},t){var r,o=t[n];!o||"object"!=w(o)||o instanceof RegExp?s[n]=o:(r=!!o.o&&!!o.$init&&!!o.define,it(o)?s[n]=new Date(o):h&&(o instanceof Map||o instanceof Set||o instanceof WeakMap||o instanceof WeakSet)||e&&r?s[n]=o:(s[n]=C(o)?[]:{},m(s[n],o,e)))}return s}function f(t,i){return function(){return t.apply(i,arguments)}}function K(t){return window.eval(t)}function E(t){return void 0===t}function b(i,e,s,t){return window.setTimeout(function(){var t;if(!e||!e.$destructed)return t=i.apply(e,s||[]),i=e=s=null,t},t||1)}function Z(t){var i=!0;return function(){i&&(i=!1,t.apply(this,arguments))}}X.h=function(){},R.extend=function(t,i,e){if(t.$protoWait)et.insertAt.call(t.$protoWait,i,1);else{for(var s in i)s in t&&!e||(t[s]=i[s]);i.defaults&&R.extend(t.defaults,i.defaults),i.$init&&i.$init.call(t)}return t};var y=(new Date).valueOf();function J(){return++y}function Q(t){return"string"==typeof t?document.getElementById(t):t}function tt(t,i){var e;return"string"==typeof t?(e=t.replace("()",""),i&&i[e]?i[e]:window[e]||K(t)):t}function C(t){return Array.isArray(t)}function it(t){return t instanceof Date}function $(t){return R.extend(t||[],et,!0)}var et={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}},j={parseFormat:"%Y-%m-%d %H:%i:%s",parseTimeFormat:"%H:%i:%s"};function st(t){var i=Date.prototype.toJSON;return Date.prototype.toJSON=function(){return j.parseFormatStr(this)},t=t instanceof Date?t.toJSON():JSON.stringify(t),Date.prototype.toJSON=i,t}var s={$init:function(){this.u||(this.u={},this._={},this.m={})},blockEvent:function(){this.u.w=!0},unblockEvent:function(){this.u.w=!1},mapEvent:function(t){R.extend(this.m,t,!0)},on_setter:function(t){if(t)for(var i in t){var e=tt(t[i],this.$scope),s=i.indexOf("->");-1!==s?this[i.substr(0,s)].attachEvent(i.substr(s+2),f(e,this)):this.attachEvent(i,e)}},callEvent:function(t,i){var e=this.S||this;if(this.u.w)return!0;t=t.toLowerCase();var s,n=this.u[t.toLowerCase()],h=!0;if(n)for(var r=0;r<n.length;r++)!1===n[r].apply(e,i||[])&&(h=!1);return this.m[t]&&((s=this.m[t]).$eventSource=this,s.callEvent(t,i)||(h=!1),s.$eventSource=null),h},attachEvent:function(t,i,e){t=t.toLowerCase(),e=e||++y,i=tt(i,this.$scope);var s=this.u[t]||$();return arguments[3]?s.unshift(i):s.push(i),this.u[t]=s,this._[e]={f:i,t:t},e},detachEvent:function(t){var i,e;this._[t]?(i=this._[t].t,e=this._[t].f,this.u[i].remove(e),delete this._[t]):(i=(t+"").toLowerCase(),this.u[i]&&(this.u[i]=$()))},hasEvent:function(t){t=t.toLowerCase();var i=this.u[t];return!(!i||!i.length)||!!(i=this.m[t])&&i.hasEvent(t)}},nt={},p=(R.extend(nt,s,!0),function(t,i){return nt.callEvent(t,i)}),ht=function(t,i,e,s){return nt.attachEvent(t,i,e,s)},rt=function(t){return nt.detachEvent(t)},ot={k:function(t){return!t||!t.documentElement||t.getElementsByTagName("parsererror").length?null:t},toObject:function(t,i){i=i?i.rawxml?i.rawxml():i:null;return this.k(i)||(i="string"==typeof t?this.fromString(t.replace(/^[\s]+/,"")):t,this.k(i))?i: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=(i=this.xpath(t,this.config)).length?this.assignTypes(this.tagToObject(i[0],{})):null;return{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){for(var e=t,s=[],n=(t=-1==t.nodeName.indexOf("document")?t.ownerDocument:t).evaluate(i,e,null,XPathResult.ANY_TYPE,null),h=n.iterateNext();h;)s.push(h),h=n.iterateNext();return s}var e=!0;try{"undefined"==typeof t.selectNodes&&(e=!1)}catch(r){}return e?t.selectNodes(i):(e=i.split("/").pop(),t.getElementsByTagName(e))},assignTypes:function(t){for(var i in t){var e=t[i];"object"==w(e)?this.assignTypes(e):"string"==typeof e&&""!==e&&("true"==e?t[i]=!0:"false"==e?t[i]=!1:e==+e&&(t[i]=+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,a=t.childNodes,u=0;u<a.length;u++)1==a[u].nodeType&&(i[o=a[u].tagName]?("function"!=typeof i[o].push&&(i[o]=[i[o]]),i[o].push(this.tagToObject(a[u],{}))):i[o]=this.tagToObject(a[u],{}),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");var i;if(window.ActiveXObject)return(i=new ActiveXObject("Microsoft.xmlDOM")).loadXML(t),i}catch(e){return null}}},at={toObject:function(t){if(!t)return null;if("string"==typeof t)try{var e;t=this.parseDates?(e=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1-3})?Z/,JSON.parse(t,function(t,i){return"string"==typeof i&&e.test(i)?new Date(i):i})):JSON.parse(t)}catch(i){return null}return t},getRecords:function(t){return(t=t&&t.data?t.data:t)&&!C(t)?[t]:t},getDetails:function(t){return"string"==typeof t?{id:t||++y,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 ut(t,i,e){return 0!==arguments.length?(new ut).get(t,i,e):this&&this.getXHR?this:new ut}ut.count=0,ut.prototype={master:null,getXHR:function(){return new XMLHttpRequest},stringify:st,$:function(t,i,s,e){i&&(C(i)||"function"==typeof(i.success||i.error||i))&&(n=s,s=i,i=null);var n,h=B.defer(),r=this.getXHR(),o=this.D||{};if(!p("onBeforeAjax",[e,t,i,r,o,null,h]))return h.reject(r);var a=!1;if("GET"!==e){var u,c=!1;for(u in o)"content-type"==u.toString().toLowerCase()&&(c=!0,"application/json"==o[u]&&(a=!0));c||window.FormData&&i instanceof window.FormData||(o["Content-Type"]="application/x-www-form-urlencoded")}if("object"==w(i)&&!(window.FormData&&i instanceof window.FormData))if(a)i=this.stringify(i);else{var l,f=[];for(l in i){var d=i[l];"object"===w(d=null!==d&&d!==undefined?d:"")&&(d=this.stringify(d)),f.push(encodeURIComponent(l)+"="+encodeURIComponent(d))}i=f.join("&")}i&&"GET"===e&&(t=t+(-1!=t.indexOf("?")?"&":"?")+i,i=null),r.open(e,t,!this.I);var _,e=this.T;for(_ in e&&(r.responseType=e),o)r.setRequestHeader(_,o[_]);var v=this;return this.master=this.master||n,r.onreadystatechange=function(){var t,i,e;r.readyState&&4!=r.readyState||(ut.count++,t=400<=r.status||0===r.status,e="blob"==r.responseType||"arraybuffer"==r.responseType?(i="",r.response):(i=r.responseText||"",v.P(r)),t?(p("onAjaxError",[r]),h.reject(r)):h.resolve(e),s&&ut.$callback(v.master||window,s,i,e,r,t))},this.H&&(r.timeout=this.H),this.I?r.send(i||null):setTimeout(function(){r.send(i||null)},0),this.master&&!this.I&&h.then(function(t){return v.master=null,s=v=n=null,t}),this.I?r:h},P:function(i){return{xml:function(){try{return ot.tagToObject(ot.toObject(i.responseText,this))}catch(t){i.responseText,t.toString()}},rawxml:function(){return window.XPathResult?i.responseXML:ot.fromString(i.responseText)},text:function(){
return i.responseText},json:function(){return at.toObject(i.responseText,!1)}}},get:function(t,i,e){return this.$(t,i,e,"GET")},post:function(t,i,e){return this.$(t,i,e,"POST")},put:function(t,i,e){return this.$(t,i,e,"PUT")},del:function(t,i,e){return this.$(t,i,e,"DELETE")},patch:function(t,i,e){return this.$(t,i,e,"PATCH")},sync:function(){return this.I=!0,this},timeout:function(t){return this.H=t,this},response:function(t){return this.T=t,this},headers:function(t){return this.D=R.extend(this.D||{},t),this},bind:function(t){return this.master=t,this}},ut.$callback=function(t,i,e,s,n,h){var r;t.$destructed||(h&&p("onAjaxError",[n]),i&&(r=i.success||i,(r=h?i.error:r)&&r.call&&r.call(t,e,s,n)))};var ct={$proxy:!0,load:function(){var i=this.source.split("@"),e=i[0].split(".").pop();return ut().response("arraybuffer").get(i[0]).then(function(t){return{data:t,options:{ext:e,dataurl:i[1]}}})}},lt={$proxy:!0,load:function(){},save:function(t,i,e){b(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)})}},ft={$proxy:!0,load:function(){return ut(this.source)},save:function(t,i){return ft.V.call(this,i,ut())},V:function(t,i){var e=this.source,s="",n=e.indexOf("?"),n=(-1!==n&&(s=e.substr(n),e=e.substr(0,n)),e+="/"==e.charAt(e.length-1)?"":"/",t.operation),t=t.data;return"insert"==n&&delete t.id,"update"==n?i.put(e+t.id+s,t):"delete"==n?i.del(e+t.id+s,t):i.post(e+s,t)}},dt={$proxy:!0,load:function(){return ut(this.source)},save:function(t,i){var e=ut().headers({"Content-Type":"application/json"});return ft.V.call(this,i,e)}},_t={$proxy:!0,load:function(t,i){return i=R.extend(i||{},this.params||{},!0),ut().post(this.source,i)}};var vt={$proxy:!0,ignoreErrors:!0,save:function(t){return this.load(t)},load:function(t){var r,i={query:this.source},o=1<arguments.length;return o||(i.variables=t),ut().headers({"Content-type":"application/json"}).post(this.url,i,function(){r=arguments.length<=2?undefined:arguments[2]}).then(function(t){var t=t.json(),i=t.data,t=t.errors;if(t&&!vt.ignoreErrors)return B.reject(o?r:{xhr:r,errors:t});var e=i;if(!e||"object"===!w(e)||Array.isArray(e))return e;var s,n="",h=0;for(s in e){if(2==++h)return e;n=s}return e[n]})}};function pt(t,i,e){t=m(pt[t]);return t.source=i,e&&R.extend(t,e,!0),t.init&&t.init(),t}pt.$parse=function(t){var i;return"string"==typeof t&&-1!=t.indexOf("->")?pt((i=t.split("->"))[0],i[1]):t},pt.binary=ct,pt.debug=lt,pt.json=dt,pt.post=_t,pt.rest=ft,pt.GraphQL=vt;var ct={toObject:function(t){return"string"==typeof t?JSON.parse(t):t},getRecords:function(t){return t=t&&t.data?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},lt={toObject:function(t){var i;return"string"==typeof t?(i=null,(i=-1==t.indexOf("<")?Q(t):i)||((i=document.createElement("DIV")).innerHTML=t),i.firstChild):t},getRecords:function(t){return t.getElementsByTagName(this.tag)},getDetails:function(t){return ot.tagToObject(t)},getOptions:function(){return!1},getInfo:function(){return{size:0}},tag:"LI"},mt=0,bt={},gt={};function wt(){mt=mt||document.onselectstart,document.onselectstart=At}function xt(){0!==mt&&(document.onselectstart=mt||null),mt=0}function yt(t){for(var i=0;t=t.previousSibling;)i++;return i}function St(t,i){var e,s="";for(e in i=i||"",t)s+=e+":"+t[e]+";";var n=gt[s+i];return n||(Mt("."+(n="s"+ ++y)+(i||"")+"{"+s+"}"),gt[s+i]=n),n}function Mt(t,i){var e=i?bt[i]:bt["default"];e||((e=document.createElement("style")).setAttribute("type","text/css"),e.setAttribute("media","screen,print"),document.getElementsByTagName("head")[0].appendChild(e),i?bt[i]=e:bt["default"]=e),e.appendChild(document.createTextNode(t))}function kt(t){t=bt[t||"default"];t&&(t.innerHTML="")}function g(t,i,e){i=i||{};var s,n=document.createElement(t);for(s in i)n.setAttribute(s,i[s]);return i.style&&(n.style.cssText=i.style),i["class"]&&(n.className=i["class"]),e&&(n.innerHTML=e)
,n}function Ct(t){return(t=Q(t))?E(t.value)?t.innerHTML:t.value:""}function x(t){if(t instanceof Array)for(var i=0;i<t.length;i++)x(t[i]);else t&&t.parentNode&&t.parentNode.removeChild(t)}function $t(t,i,e){t&&(i&&i.parentNode?i.parentNode.insertBefore(t,i):e.appendChild(t))}function Dt(t,i){for(var e=t.tagName?t:t.target;e;){if(e.getAttribute){var s=e.getAttribute(i);if(s)return s}e=e.parentNode}return null}function It(t){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,s=s.clientLeft||e.clientLeft||0,e=i.top+n-r,n=i.left+h-s;return{y:Math.round(e),x:Math.round(n),width:t.offsetWidth,height:t.offsetHeight}}function Ft(t){return{x:t.offsetX,y:t.offsetY}}function Tt(t){return t.type?{x:(t=t.touches&&t.touches[0]?t.touches[0]:t).pageX,y:t.pageY}:{x:t.x,y:t.y}}function d(t){return t.preventDefault(),At(t)}function At(t){return t.stopPropagation(),!1}function Pt(t,i,e,s){var n;"function"==typeof window[i]?(s=R.extend(s||{},{bubbles:!0,cancelable:!0}),n=new window[i](e,s)):(n=document.createEvent(i)).initEvent(e,!0,!0),t.dispatchEvent(n)}function u(t,i,e){e&&-1!==t.className.indexOf(i)||(t.className+=" "+i)}function c(t,i){t.className=t.className.replace(RegExp(" "+i,"g"),"")}function Ht(t,i,e){for(var s=g("DIV",{"class":"webix_view webix_measure_size "+(i||"")},""),n=(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),"object"!==w(t)?[t]:t),h=0,r=0,o=0;o<n.length;o++){s.innerHTML=n[o];var a=s.getBoundingClientRect(),h=Math.max(h,Math.ceil(a.width)),r=Math.max(r,Math.ceil(a.height))}return x(s),{width:h,height:r}}function zt(t,i){var e=!1;if("object"==w(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(),b(function(){e&&window.URL.revokeObjectURL(t),document.body.removeChild(s),s.remove()})}function Vt(t){return t&&(t=(t=t.className||"").baseVal?t.baseVal:t).indexOf?t:""}function Bt(t,i,e){t.focus();t.setSelectionRange&&["password","search","tel","text","url"].includes(t.type)&&t.setSelectionRange(i=i||0,e=e||i)}function Rt(t){return{start:t.selectionStart||0,end:t.selectionEnd||0}}function Et(t,i){document.getElementsByTagName("head").item(0).appendChild(g("meta",{name:t,content:i}))}var jt,dt=Object.freeze({denySelect:wt,allowSelect:xt,index:yt,createCss:St,addStyle:Mt,removeStyle:kt,create:g,getValue:Ct,remove:x,insertBefore:$t,locate:Dt,offset:It,posRelative:Ft,pos:Tt,preventEvent:d,stopEvent:At,triggerEvent:Pt,addCss:u,removeCss:c,getTextSize:Ht,download:zt,B:Vt,setSelectionRange:Bt,getSelectionRange:Rt,addMeta:Et}),_t={toObject:function(t){(t=Q(t)).tagName.toLowerCase();var i=t.rows;return x(t),i},getRecords:function(t){for(var i=[],e=t[0]&&t[0].R?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].R=!0);for(var s=0;s<e.length;s++){var n={id:"data"+s,header:this.j(e[s].innerHTML)},h=this.O(e[s]),n=R.extend(n,h);i.push(n)}return i},j:function(t){var i=t.indexOf("json://");return t=-1!=i?JSON.parse(t.substr(i+7)):t},O:function(t){for(var i=t.attributes,e={},s=0;s<i.length;s++)e[i[s].nodeName]=this.j(i[s].nodeValue);return e.width=parseInt(e.width,10),e}},D={cdn:"//cdn.webix.com",codebase:"",zIndexBase:100,scrollSize:17},Lt=(D.strict=!!window.webix_strict,D.https="https:"===document.location.protocol,navigator.userAgentData),Ot=Lt&&Lt.platform&&Lt.brands.length?null:navigator.userAgent,Nt={Chromium:"Chrom",IE:"Trident",Edge:"Edg",FF:"Firefox",Safari:"Safari"};for(jt in Nt)if("break"===function(i){var t=Ot?-1!=Ot.indexOf(Nt[i]
):Lt.brands.find(function(t){return-1!=t.brand.indexOf(Nt[i])});if(t&&(D["is"+i]=!0,"Chromium"!=i))return"break"}(jt))break;var Wt=Ot||Lt.platform;D.isMac=-1!=Wt.toLowerCase().indexOf("mac"),/iPad|iPhone|iPod/.test(Wt)&&(D.isIOS=!0),-1!=Wt.indexOf("Android")&&(D.isAndroid=!0),Ot?(D.isIOS||D.isAndroid||-1!=Ot.indexOf("Mobile")||-1!=Ot.indexOf("Windows Phone"))&&(D.mobile=!0):D.mobile=Lt.mobile,(D.mobile||1<navigator.maxTouchPoints)&&(D.touch=!0),D.fastClick=!D.touch,(D.isIE||D.isEdge||D.isFF)&&(D.maxHTMLElementSize=1e7),D.isSafari&&(D.maxHTMLElementSize=1e8),D.transform="transform",D.transition="transition",D.transitionDuration="transitionDuration",D.translate="translate3d",D.transitionEnd="transitionend",D.passiveEventListeners=!1;try{var Yt=Object.defineProperty({},"passive",{get:function(){D.passiveEventListeners=!0}});window.addEventListener("testPassive",null,Yt),window.removeEventListener("testPassive",null,Yt)}catch(Bn){}D.svg=document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),D.svganimation=document.implementation.hasFeature("https://www.w3.org/TR/SVG11/feature#SVG-animation","1.1");var Ut={};function qt(e,t,i){var s=B.defer();if(t&&!0!==t&&(s=s.then(function(){t.call(i||this)})),qt.disabled)s.resolve();else if("string"!=typeof e){var n=e.length||0;if(n){var h=function(){n?(n--,qt(e[e.length-n-1]).then(h,function(){return s.reject()})):s.resolve()};h()}else{for(var r in e)n++;var o,a=function(){0===--n&&s.resolve()};for(o in e)qt(o).then(a,function(){return s.reject()})}}else if(!0!==Ut[e]){var u=e;if(!0===t)return K(ut().sync().get(u).responseText),Ut[e]=!0,s.resolve();if(Ut[e])return Ut[e].push(s),s;Ut[e]=[s];var c,l=function(){var t=Ut[e];Ut[e]=!1;for(var i=0;i<t.length;i++)t[i].reject()},f=function(){var t=Ut[e];Ut[e]=!0;for(var i=0;i<t.length;i++)t[i].resolve()},d=e.split("?");".css"===d[0].substring(d[0].length-".css".length)?((c=g("LINK",{type:"text/css",rel:"stylesheet",href:u})).onload=f,c.onerror=l,document.getElementsByTagName("head")[0].appendChild(c)):(c=document.createElement("script"),".mjs"===d[0].substring(d[0].length-".mjs".length)&&(c.type="module"),c.onload=f,c.onerror=l,document.getElementsByTagName("head")[0].appendChild(c),c.src=u)}else s.resolve();return s}var Wt=R.extend({toObject:function(t){var i,e,s;return t.excel?t:((i=t.options||{}).dataurl&&R.extend(i,this.N(i.dataurl)),t=t.data||t,e=B.defer(),t.name?(i.ext=t.name.split(".").pop(),(s=new FileReader).onload=f(function(t){e.resolve(this.parseData(t.target.result,i))},this),s.readAsArrayBuffer(t)):e.resolve(this.parseData(t,i)),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"),qt(D.cdn+"/extras/xlsx.core.styles.min.js").then(f(function(){var t=("xls"==n?XLS:XLSX).read(s.join(""),{type:"binary",cellStyles:!0,cellDates:!!E(e.cellDates)||e.cellDates,sheetStubs:e.sheetStubs}),i=t.Workbook,i={sheets:t.Sheets,names:t.SheetNames,options:e,ranges:i&&i.Names||[],states:i&&i.Sheets?i.Sheets.map(function(t){return["visible","hidden","veryHidden"][t.Hidden]}):t.SheetNames.map(function(){return"visible"})};return R.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=[],a=[],u={},c={n:"number",d:"date",s:"string",b:"boolean"};if(t&&t["!ref"]){for(var l=XLS.utils.decode_range(t["!ref"]),f=l.s.c,d=l.s.r+(i.rows?i.rows[0]:0),_=l.s.r;_<=l.e.r;_++){for(var v,p,m=[],b=l.s.c;b<=l.e.c;b++)(p=t[XLS.utils.encode_cell({r:_,c:b})])?(v="",v=i.math&&p.f?"="==p.f.charAt(0)?p.f:"="+p.f:"d"==p.t&&it(p.v)?j.dateFormatStr(p.v):p.v,m.push(v),p.s&&n.push([_-d,b-f,p.s]),p.t&&r.push([_-d,b-f,c[p.t]]),p.l&&a.push([_-d,b-f,p.l.location?"#"+p.l.location:p.l.Target])):m.push("");e.push(m)}if(t["!merges"])for(var g=t["!merges"],w=0;w<g.length;w++){var x=g[w].s,y=g[w].e;(
!i.rows||0<=x.r-d&&y.r-d<=i.rows[1])&&s.push([x.r-d,x.c-f,y.c-x.c+1,y.r-x.r+1])}if(t["!cols"])for(var S=t["!cols"],M=0;M<S.length;M++){var k,C=S[M];C&&(h.push(["column",k=M-f,Math.round(C.wch/(8.43/70))]),C.hidden&&o.push(["column",k]))}if(t["!rows"])for(var $=t["!rows"],D=0;D<$.length;D++){var I,F=$[D];F&&(h.push(["row",I=D-d,F.hpx]),F.hidden&&o.push(["row",I]))}t["!settings"]&&(u=t["!settings"])}return{data:e,spans:s,styles:n,sizes:h,types:r,hidden:o,links:a,sheetSettings:u,excel:!0}},N:function(t){var t=t.split("["),i={};return i.name=t[0],t[1]&&((t=t[1].split(/[^0-9]+/g))[0]=+t[0]||0,t[1]=+t[1]||9999999,i.rows=t),i}},ct),Gt={json:at,jsarray:ct,xml:ot,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:lt,htmltable:_t,excel:Wt},Xt={},Kt={$init:function(t){this.W=0,this.data={},this.waitData=B.defer(),t&&(this.o.datatype=t.datatype||"json"),this.$ready.push(this.Y)},Y:function(){this.U=!0,this.o.url&&this.url_setter(this.o.url),this.o.data&&this.data_setter(this.o.data)},url_setter:function(t){return t=pt.$parse(t),this.U&&this.load(t,this.o.datatype),t},data_setter:function(t){return this.U?(this.parse(t,this.o.datatype),!0):t},load:function(t,i,e,s){var n,h=this,t=("string"==typeof i&&(n=i,i=e),this.q(t,n,e||null));if(t&&t.then)return t.then(function(t){return h.G(t,s),i&&ut.$callback(h,i,"",t,-1),t},function(t){return h.X(t)})},q:function(t,i,e){var s=this;if(!i&&this.data.driver||(this.data.driver=Gt[i||"json"]),!this.callEvent("onBeforeLoad",[]))return B.reject();(i=(t=pt.$parse(t)).$proxy&&t.load?t.load(this,e):"function"==typeof t?t.call(this,e):ut().bind(this).get(t))&&!i.then&&(i=B.resolve(i));var n=++this.W;return i&&i.then?i.then(function(t){return s.$destructed||s.W!==n?B.reject(Xt):t}):i},parse:function(t,i,e){var s,n=this;if(t&&"function"==typeof t.then)return s=++this.W,t.then(function(t){if(n.$destructed||n.W!==s)return B.reject();n.parse(t,i,e)});if(t&&t.sync&&this.sync)this.K(t);else{if(!this.callEvent("onBeforeLoad",[]))return B.reject();!i&&this.data.driver||(this.data.driver=Gt[i||"json"]),this.G(t,e)}return B.resolve()},K:function(t){this.data&&this.data.attachEvent&&this.data.attachEvent("onSyncApply",f(function(){this.Z&&this.Z()},this)),this.sync(t)},J:function(t){var i=this.data.driver,t=i.getRecords(t)[0],t=t?m(i.getDetails(t)):{};this.setValues?this.setValues(t,!1,"auto"):this.data=t},Q:function(t,i){t?this.$onLoad&&this.$onLoad(t,this.data.driver,i)||(this.data&&this.data.J?(i&&this.data.clearAll(!0),this.data):(i&&this.clearAll(!0),this)).J(t):this.X(t),this.Z&&this.Z(),this.callEvent("onAfterLoad",[]),this.waitData.resolve()},G:function(t,i){var e=this;t&&"function"==typeof t.text&&!t.name&&(t=t.text()),(t=this.data.driver.toObject(t))&&t.then?t.then(function(t){return e.Q(t,i)}):this.Q(t,i)},X:function(t){return t!==Xt&&(this.$destructed||(this.callEvent("onAfterLoad",[]),this.callEvent("onLoadError",arguments)),p("onLoadError",[t,this])),B.reject(t)},tt:function(t){var i;return!(this.o.dataFeed&&!this.it&&t)||("function"==typeof(i=this.o.dataFeed)?i.call(this,t.id||t,t):(i=i+(-1==i.indexOf("?")?"?":"&")+"action=get&id="+encodeURIComponent(t.id||t),this.callEvent("onBeforeLoad",[])&&ut(i,function(t,i,e){this.it=!0;var s=Gt.json,t=s.toObject(t,i);t?this.setValues(s.getDetails(s.getRecords(t)[0]),!1,"auto"):this.X(e),this.it=!1,this.callEvent("onAfterLoad",[])},this),!1))}},Zt={collapseNames:function(t,i,e,s){if(e=e||{},i=i||"",s=s||function(){return!0},!t||"object"!=w(t))return null;for(var n in t){var h=t[n],n=i+n;h&&"object"==w(h)&&!it(h)&&!C(h)&&s(n)?Zt.collapseNames(h,n+".",e,s):e[n]=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}},Jt={},Qt={},ti=new RegExp("(\\r\\n|\\n)","g"),ii=new RegExp('(\\")',"g"),ei=new RegExp("(\\\\)","g"),si={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},ni=/[&<>"'`]/g,hi=function(t){return si[t]||"&"};function _(e){if("function"==typeof e)return e;if(!Jt[e]){if(-1!=(e=(e||"").toString()).indexOf("->")){var t=e.split("->");switch(t[0]){case"html":e=Ct(t[1]);break;case"http":e=(new ut).sync().get(t[1],{uid:++y}).responseText}}if(e=(e||"").toString(),D.strict){if(!Qt[e]){Qt[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=Zt.collapseNames(t)),_.escape(t[i])}})):h.push({pos:e,str:t,fn:function(t){return(t=-1!=i.indexOf(".")?Zt.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){Qt[t].push(function(){return t.slice(i,e)})},n=0;n<h.length;n++){var r=h[n].pos;s(e,i,r),Qt[e].push(h[n].fn),i=r+h[n].str.length}s(e,i,e.length)}else Qt[e].push(function(){return e})}return function(){for(var t="",i=0;i<Qt[e].length;i++)t+=Qt[e][i].apply(this,arguments);return t}}var o,a=!1;e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(ei,"\\\\")).replace(ti,"\\n")).replace(ii,'\\"')).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)?(a=!0,'"+template.escape(obj.'+i.substr(1)+')+"'):'"+(obj.'+i+')+"'});try{a?(o=Function("obj","common","marks","value","template",'return "'+e+'";'),Jt[e]=function(t,i,e,s){return o(t,i,e,s,_)}):Jt[e]=Function("obj","common",'return "'+e+'";')}catch(Bn){}}return Jt[e]}_.escape=function(t){return t===undefined||null===t?"":(t.toString()||"").replace(ni,hi)},_.empty=function(){return""};var ri={et:function(t){return t.$empty?"":this.o.template(t,this)},render:function(){var t=this.o;return!!this.isVisible(t.id)&&(this.callEvent&&!this.callEvent("onBeforeRender",[this.data])||(this.data&&!t.content&&(this.st.innerHTML="",this.st.innerHTML=this.et(this.data)),this.callEvent&&this.callEvent("onAfterRender",[])),!0)},sync:function(i){this.nt=!1,"DataStore"!=i.name&&(i.data&&"DataStore"==i.data.name?i=i.data:this.nt=!0),this.nt?i.bind("change",f(function(t){t.id==this.data.id&&(this.data=t.attributes,this.refresh())},this)):i.attachEvent("onStoreUpdated",f(function(t){t&&t!=this.data.id||(this.data=i.pull[t],this.refresh())},this))},template_setter:_},oi={ht:function(t){var i=this.o.dragscroll,e=-1!==(i="string"!=typeof i?this.o.layout||"xy":i).indexOf("x"),i=-1!==i.indexOf("y"),s=It(this.rt||this.$view),n=Math.max((this.o.rowHeight||(this.type&&!isNaN(parseFloat(this.type.height))?this.type.height:0))+5,40),h=!1;i&&this.ot(t,s,n)&&(h=!0),(h=e&&this.at(t,s,n)?!0:h)&&(this.ut=b(this.ht,this,[t],100))},ct:function(t){var i,e=this.o.dragscroll;"string"==typeof e&&-1===e.indexOf("x")||(e=It(this.D||this.$view),i=Math.max(this.o.headerRowHeight||0,40),this.at(t,e,i)&&(this.ut=b(this.ct,this,[t],100)))},ot:function(t,i,e){var s=i.y,i=s+i.height,n=this.getScrollState(),h=this.o;return h.topSplit&&(s+=(h=this.lt(this.getIdByIndex(h.topSplit-1),this.columnId(0))).top+h.height),t.y<s+e?this.ft(
n.x,n.y-2*e,t,"y"):t.y>i-e&&this.ft(n.x,n.y+2*e,t,"y")},at:function(t,i,e){var s=i.x,i=s+i.width,n=this.getScrollState();return t.x<s+e?this.ft(n.x-2*e,n.y,t,"x"):t.x>i-e&&this.ft(n.x+2*e,n.y,t,"x")},ft:function(t,i,e,s){var n;return!!this.callEvent("onBeforeAutoScroll",[e])&&(this.scrollTo(t,i),this.callEvent("onAfterAutoScroll",[]),e=this.getScrollState(),n=!this.dt&&this._t||0,Math.abs(("x"===s?t:i)-e[s]+n)<1)}},ai={};function ui(){for(var t in ai)ci(t)}function o(t,i,e,s){(s=s||{}).inner=!0,l(t,i,e,s)}function l(t,i,e,s){s=s||{},t=Q(t);var n=s.id||++y,h=[t,i,e=s.bind?f(e,s.bind):e,s.capture],h=(s.inner||(ai[n]=h),!!s.capture);return!E(s.passive)&&D.passiveEventListeners&&(h={passive:s.passive,capture:h}),t.addEventListener(i,e,h),n}function ci(t){var i;t&&(ai[t],(i=ai[t])[0].removeEventListener(i[1],i[2],!!i[3]),delete ai[t])}function li(t,i){if(!t.$protoWait){(t="function"==typeof t?t.prototype:t).types||(t.types={"default":t.type},t.type.name="default");var e,s=i.name,n=t.type;for(e in s&&(n=t.types[s]=X(i.baseType?t.types[i.baseType]:t.type)),i)0===e.indexOf("template")?n[e]=_(i[e]):n[e]=i[e];return s}t.vt||(t.vt=[]),t.vt.push(i)}var S={top_views:[],pt:null,mt:null,bt:null,gt:null,wt:null,xt:null,yt:null,St:null,Mt:0,kt:null,Ct:null,$t:[],destructors:[],Dt:null,It:[],Ft:$(),Tt:null},fi={};function a(t,i,e){S.Mt++;var s,n=S.pt,h=S.mt;S.pt=t.$scope||n;try{s=function(t,i,e){var s,n=C(t),h=Q(t.container||i||document.body);h.o&&(e=function(t,i,e){var s=[t];if(i)s=t.getChildViews();else if(t.At)s=[t.At];else{if("number"==typeof e)return e;if(e)return _i(s=[v(e)]),s[0].config.id}return _i(s),e}(h,n,e));var r=!1,o=h==document.body;t.o||h&&n?(s=t,r=!0):(h&&o&&(t.$topView=!0),t.Pt||(t.Pt={}),i&&i.getParentView&&(S.yt=e||0===e?i:i.getParentView()),s=vi(t));!o||s.setPosition||s.$apiOnly||(0,U.fixHeight)();s.o&&s.o.Ht&&!h.$view?s.o.zt=h:s.$apiOnly||(h.appendChild?di(h,s,t):h.destructor?(n=h,(h=e||0===e||C(s)?h:(e=h).getParentView())&&h.Vt?(r&&s.getParentView&&((i=s.getParentView())&&i.Bt&&i.Bt(s),s.yt=h,s.$scope=h.$scope),h.Vt(s,e)):(o=n.$view.parentNode,n.destructor(),di(o,s,t))):t.container);return s}(t,i,e)}finally{S.Mt--,S.pt=n,S.mt=h}return s}function di(t,i,e){t.appendChild(i.Rt),i.getParentView()||((i.setPosition&&!i.o.fullscreen||t!=document.body)&&!i.o.position||S.top_views.push(i.Et),e.skipResize||i.adjust())}function _i(t){for(var i=t.length-1;0<=i;i--){var e=t[i];delete fi[e.config.id],e.config.id="x"+ ++y,(fi[e.config.id]=e).getChildViews&&_i(e.getChildViews()),e.jt&&_i(e.jt)}}function vi(t){if(t.view)return new a[t.view](t);if(t.rows||t.cols){for(var i=t.rows||t.cols,e=!1,s=0;s<i.length;s++)!i[s].body||i[s].view||i[s].align||(e=!0);return new(e?a.headerlayout:a.layout)(t)}return new(t.cells?a.multiview:t.template||t.content?a.template:t.align&&t.body?a.align:a.spacer)(t)}function v(t){if(!t)return null;if(fi[t])return fi[t];var i=t;if("object"==w(t)){if(t.o)return t;i=t.target||t}return fi[Dt({target:Q(i)},"view_id")]}a.views=fi,a.Lt=vi,"undefined"==typeof window.$$&&(window.$$=v),R.protoUI=function(){var h=arguments[0].name,r=function(t){if(!r)return a[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&&(a[e[s].prototype.name]=e[s]);if(a[h]=R.proto.apply(-1,e),r.vt)for(var n=0;n<r.vt.length;n++)li(a[h],r.vt[n]);r=i=null}return-1!=this?new a[h](t):a[h]};return r.$protoWait=Array.prototype.slice.call(arguments,0),a[h]=r},R.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,r=t[n].defaults;for(h in i.defaults||(i.defaults={}),r)E(i.defaults[h])&&(i.defaults[h]=r[h])}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();e=function(t){this.$ready=[],this.$init,this.$init(t),
this.Ot&&this.Ot(t,this.defaults);for(var i=0;i<this.$ready.length;i++)this.$ready[i].call(this)};return e.prototype=i,i=t=null,e},ht("onClick",function(t){var i=v(t);if(i&&i.touchable&&(U.UIManager.applyChanges(i),!i.config.disabled)){var e="",s=t.target;if(!s.className||0!==s.className.toString().indexOf("webix_view")){for(i&&U.UIManager.Nt(i);s&&s.parentNode;){if(s.getAttribute){if(s.getAttribute("view_id"))break;if(e=s.className)for(var e=e.toString().split(" "),n=0;n<e.length;n++)if(i.on_click[e[n]])if(!1===i.on_click[e[n]].call(i,t,i.o.id,s))return}s=s.parentNode}!i.o.click||(r=tt(i.o.click,i.$scope))&&r.call&&r.call(i,i.o.id,t);var h,r=i.o.popup;!r||i.o.readonly||t.longtouch_drag||(r=v(r)).isVisible()||(h=i.getInputNode()||i.getNode(),r.o.master=i.o.id,r.show(h,null,!0),h.setAttribute("aria-expanded",!0),r.o.id!=i.o.suggest&&U.UIManager.setFocus(r.getBody())),i.callEvent("onItemClick",[i.o.id,t])}}});var pi={Wt:$(["dummy"]),Yt:0,overflow:!1,delay:400,addTooltip:function(t,i){var e,s,n=this,i=((t=Q(t))instanceof Element?(e=t,"string"==typeof i?e.setAttribute("webix_tooltip",i):s=i):(e=t.$view,s=t),this.Wt.find(s=s||this));-1===i&&(i=this.Wt.length,this.Wt.push(s)),e.webix_tooltip=i,this.Yt++,this.Ut||(this.Ut=new a.tooltip({}),this.Ut.qt="webix_tooltip webix_global_tooltip",this.Gt=l(document,"pointermove",function(t){return n.Xt(t)}),this.Kt=l(document.body,"pointerleave",function(){return n.Zt()}),this.Jt=ht("onDragMode",function(){return n.Zt()}),this.Qt=ht("onClick",function(){return n.Zt()}))},getTooltip:function(){return this.Ut},Xt:function(t){if("mouse"===t.pointerType){for(var i,e={},s=t.target;s instanceof Element&&"HTML"!=s.tagName;){if(e.first&&e.overflow||(i=s.getAttribute("webix_tooltip"),e.first=e.first||i,i&&s.scrollWidth>s.clientWidth&&(e.overflow=i)),this.Wt[s.webix_tooltip])return this.ti&&this.ti!=s?(this.$tooltipOut(this.ti,s,t),void(this.ti=null)):(this.ti||(this.ti=this.$tooltipIn(s,t)),this.$tooltipMove(s,t,e));s=s.parentElement}this.ti&&(this.ti=this.$tooltipOut(this.ti,null,t))}},Zt:function(){clearTimeout(this.ii),this.Ut.hide()},getMaster:function(t){return this.Wt[t.webix_tooltip]},removeTooltip:function(t){var i=(t=(t=Q(t))instanceof Element?t:t.$view).webix_tooltip;i&&(this.ti==t&&(this.Zt(),this.ti=null),delete t.webix_tooltip,this.Yt--,this.Wt[i]=null),!this.Yt&&this.Ut&&(this.Gt=ci(this.Gt),this.Kt=ci(this.Kt),this.Jt=rt(this.Jt),this.Qt=rt(this.Qt),this.Ut.destructor(),this.Ut=this.ti=null,this.Wt=$(["dummy"]))},$tooltipIn:function(t,i){var e=this.Wt[t.webix_tooltip];return e.$tooltipIn&&e!=this?e.$tooltipIn(t,i):(this.Ut.define({dx:20,dy:0,template:"",css:""}),t)},$tooltipOut:function(t,i,e){var s=this.Wt[t.webix_tooltip];return s.$tooltipOut&&s!=this?s.$tooltipOut(t,i,e):(this.Zt(),null)},$tooltipMove:function(t,i,e){var s=this.Wt[t.webix_tooltip];if(s.$tooltipMove&&s!=this)return s.$tooltipMove(t,i,e);t=(E(s.overflow)?this:s).overflow,s=(E(s.delay)?this:s).delay,t=t?e.overflow:e.first;0<s&&this.Zt(),this.ii=b(this.Ut.show,this.Ut,[t||{},Tt(i)],s)}};function mi(t){return"$"+t+(bi[t]=(bi[t]||0)+1)}var bi={},gi=!1;function wi(t,i){gi=!0;t=t();return t&&t.then?t=t.then(function(t){return(gi=!1)!==i&&xi(),t}):(gi=!1)!==i&&xi(),t}function xi(){if(U.UIManager.applyChanges(),p("onClick",[]),S.ei=!0,!gi)for(var t=S.top_views.length-1;0<=t;t--)S.top_views[t].obj&&S.top_views[t].obj.resize();S.ei=!1}function yi(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])&&yi(n[h],i,e)}function Si(t){return E(t)?D.zIndexBase++:(D.zIndexBase=Math.max(D.zIndexBase,t+1),t)}function Mi(t){ki?t.call():Ci.push(t)}l(window,"resize",function(){D.touch&&S.St&&new Date-S.St<1e3||xi()});var ki=!1,Ci=[],Yt=document.getElementsByTagName("SCRIPT"),ct=(Yt.length,Yt.length&&((Yt=(Yt[Yt.length-1].getAttribute("src")||"").split("/")).splice(Yt.length-1,1),D.codebase=Yt.slice(0,Yt.length).join("/")+"/"),function(){D.isIE&&(document.body.className+=" webix_ie"),p("onReady",[])}),$i=function(){ki=!0,window.webix_ready&&C(webix_ready)&&(Ci=webix_ready.concat(Ci));for(
var t=0;t<Ci.length;t++)Ci[t].call();Ci=[]},Di=(ht("onReady",function(t){t?$i():b($i)}),"complete"==document.readyState?ct():l(window,"load",ct),Mi(function(){l(document.body,"click",function(t){p("onClick",[t])})}),{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}});function Ii(t,i){if(-1!=t.type.indexOf("prompt"))if(!1===i)t.si.reject();else{var e=t.ni.querySelector(".webix_popup_input"),s=e.querySelector("input");if(t.input.required&&!s.value)return t.input.invalid=!0,void u(e,"webix_popup_invalid");i=s.value||"",t.si.resolve(i)}-1!=t.type.indexOf("confirm")&&!1===i?t.si.reject():t.si.resolve(i);e=t.callback;e&&e(i,t.details),Li.hide(t.id)}function Fi(t){var i=Li.order,e=i.length,s=t.target;if(0<e&&Oi.keyboard){var n=t.which||t.keyCode;if(13==n||32==n||27==n){for(var h,r=e-1;0<=r;r--){var o=Li.pull[i[r]];if(o.ni!=s&&o.ni.contains(s)&&32==n)return;if(o.container&&o.container.contains(s)){h=o;break}}return h=h||Li.pull[i[i.length-1]],13==n||32==n?Ii(h,!0):27==n&&Ii(h,!1),d(t),!(t.cancelBubble=!0)}}}function Ti(t,i){var e,s=i||document.body;return E(s.modality)?((e=g("DIV",{"class":"webix_modal_cover",style:"position:"+(i?"absolute":"fixed")+";"})).onkeydown=Fi,i&&"fixed"!=(i=window.getComputedStyle(i).position)&&"absolute"!=i&&"sticky"!=i&&"relative"!=i&&(s.style.position="relative"),s.appendChild(e),s.modality=1):t?s.modality++:s.modality--,(t&&1===s.modality||0===s.modality)&&(e=e||Array.prototype.slice.call(s.querySelectorAll(".webix_modal_cover")).filter(function(t){return t.parentNode==s})[0])&&(s.modality?1==s.modality&&(e.style.display="inline-block",u(s,"webix_modalbox_inside")):(e.style.display="none",c(s,"webix_modalbox_inside"))),e}function Ai(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 Pi(e,t,i,s){var n,h=document.createElement("DIV"),r=e.css?" "+e.css:"",o=(h.className="webix_modal_box webix_"+e.type+r,h.setAttribute("webixbox",1),h.setAttribute("role","alertdialog"),h.setAttribute("aria-label",e.title||""),h.setAttribute("tabindex","0"),"");if(e.width&&(h.style.width=e.width+(Di.isNumber(e.width)?"px":"")),e.height&&(h.style.height=e.height+(Di.isNumber(e.height)?"px":"")),e.title&&(o+='<div class="webix_popup_title">'+e.title+"</div>"),o=o+('<div class="webix_popup_text'+(s?" webix_popup_label":"")+'"><span>'+(!e.content&&e.text||"")+"</span></div>")+'<div class="webix_popup_controls">',s&&(o+="<div tabindex='0' class='webix_popup_input webix_el_text"+((r=e.input).required?" webix_required":"")+"'><input value='"+_.escape(r.value||"")+"' placeholder='"+_.escape(r.placeholder||"")+"'></input></div>"),i&&(o+=Ai(e.cancel||j.message.cancel,!1)),t&&(o+=Ai(e.ok||j.message.ok,!0,"confirm")),e.buttons&&!t&&!i)for(var a=0;a<e.buttons.length;a++)o+=Ai(e.buttons[a],a);return h.innerHTML=o+="</div>",e.content&&("none"==(s="string"==typeof(s=e.content)?document.getElementById(s):s).style.display&&(s.style.display=""),h.childNodes[e.title?1:0].appendChild(s)),-1!=e.type.indexOf("prompt")&&((n=h.querySelector(".webix_popup_input")).querySelector("input").oninput=function(){e.input.invalid&&(c(n,"webix_popup_invalid"),e.input.invalid=!1)}),h.onclick=function(t){var i=t.target;-1!=(i=i.className?i:i.parentNode).className.indexOf("webix_popup_button")&&(i=i.getAttribute("result"),Ii(e,i="true"==i||"false"!=i&&i)),t.cancelBubble=!0},e.ni=h}function Hi(t,i,e,s){var i=t.tagName?t:Pi(t,i,e,s),e=t.container,n=e?e.offsetWidth:window.innerWidth||document.documentElement.offsetWidth,h=e?e.offsetHeight:window.innerHeight||document.documentElement.offsetHeight,r=e?e.scrollLeft:0,e=e?e.scrollTop:0,o=(t.container&&(i.style.position="absolute"),Q((t.container||document.body).appendChild(i)),Ti(!0,t.container)),n=t.left||Math.abs(r+Math.floor((n-i.offsetWidth)/2)),h=t.top||Math.abs(e+Math.floor((h-i.offsetHeight)/2));return"top"==t.position?i.style.top="-3px":(
i.style.top=h+"px",o&&(o.style.top=e+"px",o.style.left=r+"px")),i.style.left=n+"px",i.onkeydown=Fi,(s?i.querySelector(".webix_popup_input input"):i).focus(),t.id?Li.pull[t.id]&&Li.hide(t.id):t.id=mi("modalbox"),Li.order.push(t.id),(Li.pull[t.id]=t).si=B.defer(),t.si}function zi(t){return Hi(t,!0)}function Vi(t){return Hi(t,!0,!0)}function Bi(t){return Hi(t)}function Ri(t){return Hi(t,!0,!0,!0)}function Ei(t,i,e){return"object"!=w(t)&&("function"==typeof i&&(e=i,i=""),t={text:t,type:i,callback:e}),t}function ji(){var t=Ei.apply(this,arguments);return t.type=t.type||"confirm",Vi(t)}function Li(){var t=Ei.apply(this,arguments);return t.type=t.type||"alert",Bi(t)}function Oi(t,i,e,s){var n,h;switch((t=function(t,i,e,s){return(t="object"!=w(t)?{text:t,type:i,expire:e,id:s}:t).id=t.id||mi("message"),t.expire=t.expire||r.expire,t}.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return zi(t);case"confirm":return Vi(t);case"modalbox":return Bi(t);case"prompt":return Ri(t);default:return n=t,r.area||(r.area=document.createElement("DIV"),r.area.className="webix_message_area",r.area.style[r.position]="5px",document.body.appendChild(r.area)),r.area.setAttribute("role","alert"),r.area.setAttribute("aria-atomic",!0),r.hide(n.id),(h=document.createElement("DIV")).innerHTML="<div>"+n.text+"</div>",h.className="webix_message webix_"+n.type,h.onclick=function(){n&&r.hide(n.id),n=null},"bottom"==r.position&&r.area.firstChild?r.area.insertBefore(h,r.area.firstChild):r.area.appendChild(h),0<n.expire&&(r.timers[n.id]=window.setTimeout(function(){r.hide(n.id)},n.expire)),h.style.height=h.offsetHeight-2+"px",r.pull[n.id]=h,h=null,n.id}}l(document,"keydown",Fi,{capture:!0}),Li.pull={},Li.order=[],Li.hide=function(t){var i;t&&Li.pull[t]&&((i=Li.pull[t].ni)&&(i.parentNode.removeChild(i),Li.order.splice(Li.order.indexOf(t),1),Ti(!1,Li.pull[t].container),delete Li.pull[t]))},Li.hideAll=function(){for(var t in Li.pull)this.hide(t)};var A,Ni,r=Oi,Wi=(r.expire=4e3,r.keyboard=!0,r.position="top",r.pull={},r.timers={},r.hideAll=function(){for(var t in r.pull)r.hide(t)},r.hide=function(t){var i=r.pull[t];i&&i.parentNode&&(window.setTimeout(function(){i.parentNode.removeChild(i),i=null},2e3),i.style.height=0,i.className+=" hidden",r.area.removeAttribute("role"),r.timers[t]&&window.clearTimeout(r.timers[t]),delete r.pull[t])},q("message",Oi),{set:function(t,i){i=i||{},this.Lt&&this.exit(),v(t)?t=v(t):(t="string"==typeof t?document.getElementById(t):t)instanceof Element&&(t={$view:t,$html:!0}),this.Lt=t,this.hi=this.ri();var e=t.config;return t.setPosition?(e.fullscreen=!0,t.resize(),t):(this.oi=a({view:"window",head:this.ai(i),css:i.css||"",fullscreen:!0,borderless:!0,body:{rows:[]}}),e&&(this.ci={width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,height:e.height,minHeight:e.minHeight,maxHeight:e.maxHeight}),t.getParentView&&t.getParentView()?(this.li=t.getParentView(),this.li.index&&(this.hi.index=this.li.index(t),this.hi.active=!!this.li.getActiveId&&this.li.getActiveId()==e.id)):(this.li=t.$view.parentNode,this.hi.node=g("div"),this.li.replaceChild(this.hi.node,t.$view)),this.oi.getBody().addView(t.$html?{view:"template",content:t.$view,css:"webix_fullscreen_html"}:t),this.oi.show(),this.fi(t),this.oi)},exit:function(){var t;this.Lt&&(t=this.Lt.config,this.ri(!0),this.Lt.setPosition?(t.fullscreen=!1,this.Lt.resize()):(this.li instanceof Element?(this.Lt.yt=null,this.Lt.di&&this.Lt.di(this.Lt.config),this.li.replaceChild(this.Lt.$view,this.hi.node)):E(this.hi.index)?(this.Lt.yt=this.li,this.li.Vt(this.Lt)):(this.li.addView(this.Lt,this.hi.index),this.hi.active&&this.Lt.show(!1,!1)),this.fi(this.Lt,this.ci),this.Lt.$html||(this.oi.getBody()._i=[]),this.oi.close()),this.vi())},vi:function(){delete this.li,delete this.Lt,delete this.ci,delete this.hi,delete this.oi},ri:function(i){var e,s=this,t=this.Lt,n={};return t.setPosition?i?t.setPosition(this.hi.left,this.hi.top):(n.left=t.config.left,n.top=t.config.top,t.setPosition(0,0)):(e=t.$view.style,["position","top","bottom","left","right"].forEach(function(t){i?e[t]=s.hi[t]:(n[t
]=e[t],e[t]="position"==t?"relative":0)})),n},fi:function(t,i){t.$html||(t.define(i=i||{height:0,minHeight:0,maxHeight:0,width:0,minWidth:0,maxWidth:0}),t.resize())},ai:function(t){var i=this;return!1===t.head||"object"==w(t.head)?t.head:{cols:[{template:t.head||"",type:"header",borderless:!0},{view:"icon",icon:"wxi-close",click:function(){i.exit()}}]}}}),M={Lt:null,pi:{},St:0,mi:{esc:"escape",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pgdown:"pagedown",pgup:"pageup",space:" ",multiply:"*",add:"+",subtract:"-",decimal:".",divide:"/",pausebreak:"pause","5numlocked":"clear"},bi:{input:1,button:1,textarea:1,select:1},gi:function(){var t=this;l(document,"keydown",this.wi,{bind:this}),l(d