This repository has been archived by the owner on Jan 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalight_0.12.last.min.js
7 lines (7 loc) · 55.1 KB
/
alight_0.12.last.min.js
1
2
3
4
5
6
7
/**
* Angular Light 0.12.11
* (c) 2015 Oleg Nechaev
* Released under the MIT License.
* 2016-01-22, http://angularlight.org/
*/!function(){function e(){var e={filters:{},text:{},ctrl:{},core:{},utils:{},d:{al:{},bo:{}},hooks:{directive:[],binding:[]}},t={};e.f$=t,e.directives=e.d,e.controllers=e.ctrl;var n=function(e,t){var n=e.indexOf(t);n>=0?e.splice(n,1):console.warn("trying to remove not exist item")};!function(){t.before=function(e,t){var n=e.parentNode;n.insertBefore(t,e)},t.after=function(e,t){var n=e.parentNode,r=e.nextSibling;r?n.insertBefore(t,r):n.appendChild(t)},t.remove=function(e){var t=e.parentNode;t&&t.removeChild(e)},t.on=function(e,t,n){e.addEventListener(t,n,!1)},t.off=function(e,t,n){e.removeEventListener(t,n,!1)},t.isFunction=function(e){return e&&"[object Function]"===Object.prototype.toString.call(e)},t.isObject=function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},t.isElement=function(e){return e instanceof HTMLElement},t.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},t.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^| )"+t.split(" ").join("|")+"( |$)","gi")," ")},t.ready=function(){function e(){r=!0,t.off(document,"DOMContentLoaded",e);for(var i=0;i<n.length;i++)n[i]();n.length=0}var n=[],r=!1;return t.on(document,"DOMContentLoaded",e),function(e){r?e():n.push(e)}}(),t.rawAjax=function(e){var t=new XMLHttpRequest;t.open(e.type||"GET",e.url,!0,e.username,e.password);for(var n in e.headers)t.setRequestHeader(n,e.headers[n]);e.success&&(t.onload=function(){t.status>=200&&t.status<400?e.success(t.responseText):e.error&&e.error()}),e.error&&(t.onerror=e.error),t.send(e.data||null)},t.ajaxCache={},t.ajax=function(e){if(e.username||e.password||e.headers||e.data||!e.cache)return t.rawAjax(e);var n=e.type||"GET",r=n+":"+e.url,i=t.ajaxCache[r];return i||(t.ajaxCache[r]=i={callback:[]}),i.result?void(e.success&&e.success(i.result)):(i.callback.push(e),void(i.loading||(i.loading=!0,t.rawAjax({type:n,url:e.url,success:function(e){i.loading=!1,i.result=e;for(var t=0;t<i.callback.length;t++)i.callback[t].success&&i.callback[t].success(e);i.callback.length=0},error:function(){i.loading=!1;for(var e=0;e<i.callback.length;e++)i.callback[e].error&&i.callback[e].error();i.callback.length=0}}))))},function(){var e='@charset "UTF-8";[al-cloak],.al-hide{display:none !important;}',t=document.querySelectorAll("head")[0],n=document.createElement("style");n.setAttribute("type","text/css"),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}()}();var r,i,o,a,c,l,s,u,p,f,h,d;e.ChangeDetector=function(e){var t,n;return n=new i,t=new r(n,e||{}),n.topCD=t,t},u=function(){var e,n;return t.isFunction(window.Map)?(n=new Map,{set:function(e){n.set(e,!0)},get:function(e){return n.size?n.get(e):!1},clear:function(){n.clear()}}):(e=[],{set:function(t){e.push(t)},get:function(t){return e.length?e.indexOf(t)>=0:!1},clear:function(){e.length=0}})},i=function(){return this.watchers={any:[],finishBinding:[],finishScan:[],finishScanOnce:[],onScanOnce:[]},this.status=null,this.extraLoop=!1,this.finishBinding_lock=!1,this.lateScan=!1,this.topCD=null,this.skippedWatches=u(),this},i.prototype.destroy=function(){return this.watchers.any.length=0,this.watchers.finishBinding.length=0,this.watchers.finishScan.length=0,this.watchers.finishScanOnce.length=0,this.watchers.onScanOnce.length=0,this.topCD?this.topCD.destroy():void 0},r=function(e,t){return this.scope=t,this.root=e,this.watchList=[],this.destroy_callbacks=[],this.parent=null,this.children=[],this.rwatchers={any:[],finishScan:[]},this},r.prototype["new"]=function(e){var t,n;return n=this,t=new r(n.root,e||n.scope),t.parent=n,n.children.push(t),t},r.prototype.destroy=function(){var e,t,r,i,o,a,c,l,s,u,p,f,h,d,v,m,g,y,w,$,b;for(e=this,$=e.root,e.scope=null,e.parent&&n(e.parent.children,e),v=e.children.slice(),o=0,l=v.length;l>o;o++)t=v[o],t.destroy();for(m=e.destroy_callbacks,a=0,s=m.length;s>a;a++)(i=m[a])();for(e.destroy_callbacks.length=0,g=e.watchList,c=0,u=g.length;u>c;c++)r=g[c],r.onStop&&r.onStop();for(e.watchList.length=0,y=e.rwatchers.any,h=0,p=y.length;p>h;h++)b=y[h],n($.watchers.any,b);for(e.rwatchers.any.length=0,w=e.rwatchers.finishScan,d=0,f=w.length;f>d;d++)b=w[d],n($.watchers.finishScan,b);e.rwatchers.finishScan.length=0,$.topCD===e&&($.topCD=null,$.destroy())},c=function(t,n){var r,i,o;if(r=!1,o=n.scope,o.$ns&&o.$ns.filters&&(i=o.$ns.filters[t],i||o.$ns.inheritGlobal||(r=!0)),i||r||(i=e.filters[t]),!i)throw"Filter not found: "+t;return i},s=function(){var e,t;return t=1,e=function(){return"wf"+t++},function(e,t,n,r){var i,o,a,l,s,u,p,f,h,d,v,m,g;for(d=e.root,m=r.isArray?"array":r.deep?"deep":"simple",f=n,h=t.filters.length,p=[];h>0;)a=t.filters[--h].trim(),u=a.indexOf(":"),u>0?(l=a.slice(0,+(u-1)+1||9e9),o=a.slice(u+1)):(l=a,o=null),s=c(l,e),Object.keys(s.prototype).length?(i=new s(o,e.scope,{setValue:f,changeDetector:e}),i.setValue=f,i.watchMode&&(m=i.watchMode),i.onStop&&p.push(i.onStop.bind(i)),i.onChange&&(f=i.onChange.bind(i))):f=function(e,t,n,r){return function(i){return t(e(i,n,r.scope))}}(s,f,o,e);return g={oneTime:r.oneTime,onStop:function(){var e,t,n;for(t=0,n=p.length;n>t;t++)(e=p[t])();return p.length=0}},"array"===m?g.isArray=!0:"deep"===m&&(g.deep=!0),v=e.watch(t.expression,f,g)}}(),o=function(e){return this.cb=e},h=function(e,t,r){var i,a;return i=e.root,a=new o(r),e.rwatchers[t].push(a),i.watchers[t].push(a),{stop:function(){return n(e.rwatchers[t],a),n(i.watchers[t],a)}}},d=function(){},r.prototype.watch=function(r,i,o){var c,l,u,p,f,v,m,g,y,w;if(o=o||{},o===!0&&(o={isArray:!0}),o.init&&console.warn("watch.init is depticated"),c=this,y=c.root,w=c.scope,t.isFunction(r))p=r,m=e.utils.getId(),f=!0;else{if(f=!1,p=null,r=r.trim(),"::"===r.slice(0,2)&&(r=r.slice(2),o.oneTime=!0),m=r,"$any"===m)return h(c,"any",i);if("$finishScan"===m)return h(c,"finishScan",i);if("$finishScanOnce"===m)return y.watchers.finishScanOnce.push(i);if("$onScanOnce"===m)return y.watchers.onScanOnce.push(i);if("$destroy"===m)return c.destroy_callbacks.push(i);if("$finishBinding"===m)return y.watchers.finishBinding.push(i);m=o.deep?"d#"+m:o.isArray?"a#"+m:"v#"+m}if(e.debug.watch&&console.log("$watch",r),v=!1,!f)if(o.watchText)p=o.watchText.fn;else{if(l=e.utils.compile.expression(r),l.filters)return s(c,l,i,o);v=l.isSimple&&0===l.simpleVariables.length&&!o.isArray,p=l.fn}return o.deep&&(o.isArray=!1),u={isStatic:v,isArray:Boolean(o.isArray),extraLoop:!o.readOnly,deep:o.deep,value:d,callback:i,exp:p,src:""+r,onStop:o.onStop||null,el:o.element||null,ea:o.elementAttr||null},v?c.watch("$onScanOnce",function(){return a(w,u,u.exp(w))}):c.watchList.push(u),g={$:u,stop:function(){return u.isStatic?void 0:(n(c.watchList,u),o.onStop?o.onStop():void 0)}},o.oneTime&&(u.callback=function(e){return void 0!==e?(g.stop(),i(e)):void 0}),g},l=function(){return window.performance?function(){return Math.floor(performance.now())}:function(){return(new Date).getTime()}}(),p=function(e,t){var n,r,i,o,a,c;if(null===e||null===t)return!0;if(o=typeof e,a=typeof t,o!==a)return!0;if("object"===o){if(e.length!==t.length)return!0;for(n=r=0,i=e.length;i>r;n=++r)if(c=e[n],c!==t[n])return!0}return!1},a=function(e,t,n){t.el?t.ea?t.el.setAttribute(t.ea,n):t.el.nodeValue=n:t.callback.call(e,n)},f=function(t,n){var r,i,o,a,c,l,s,u,f,h,v,m,g,y,w,$,b;if(g=t.root,c=!1,a=0,w=0,t){for(v=[],l=0,o=t;o;){for(y=n.scope=o.scope,w+=o.watchList.length,m=o.watchList.slice(),s=0,f=m.length;f>s;s++)b=m[s],n.src=b.src,u=b.value,$=b.exp(y),u!==$&&(h=!1,b.isArray?(r=Array.isArray(u),i=Array.isArray($),r===i?r?p(u,$)&&(h=!0,b.value=$.slice()):(h=!0,b.value=$):(h=!0,b.value=i?$.slice():$)):b.deep?e.utils.equal(u,$)||(h=!0,b.value=e.utils.clone($)):(h=!0,b.value=$),h&&(h=!1,a++,b.el?b.ea?b.el.setAttribute(b.ea,$):b.el.nodeValue=$:g.skippedWatches.get(b)||(u===d&&(u=void 0),"$scanNoChanges"!==b.callback.call(y,$,u)&&b.extraLoop&&(c=!0))),e.debug.scan>1&&console.log("changed:",b.src));v.push.apply(v,o.children),o=v[l++]}n.total=w,n.changes=a,n.extraLoop=c,n.scope=null}},r.prototype.digest=function(){var t,n,r,i,o,a,c,s,u,p,h;u=this.root,a=10,h=0,e.debug.scan&&(p=l());try{for(s={total:0,changes:0,extraLoop:!1,src:"",scope:null};a;){if(a--,u.extraLoop=!1,u.watchers.onScanOnce.length)for(c=u.watchers.onScanOnce.slice(),u.watchers.onScanOnce.length=0,i=0,o=c.length;o>i;i++)t=c[i],t.call(u);if(f(this,s),h+=s.changes,!s.extraLoop&&!u.extraLoop)break}e.debug.scan&&(n=l()-p,console.log("$scan: loops: ("+(10-a)+"), last-loop changes: "+s.changes+", watches: "+s.total+" / "+n+"ms"))}catch(d){r=d,e.exceptionHandler(r,"$scan, error in expression: "+s.src,{src:s.src,scope:s.scope,result:s})}return s.mainLoop=a,s.totalChanges=h,s},r.prototype.scan=function(n){var r,i,o,a,c,l,s,u,p,f,h,d,v;if(v=this.root,n=n||{},t.isFunction(n)&&(n={callback:n}),n.callback&&v.watchers.finishScanOnce.push(n.callback),n.skipWatch&&v.skippedWatches.set(n.skipWatch.$),n.late){if(v.lateScan)return;return v.lateScan=!0,void e.nextTick(function(){return v.lateScan?v.topCD.scan():void 0})}if("scaning"===v.status)return void(v.extraLoop=!0);if(v.lateScan=!1,v.status="scaning",d=v.topCD?v.topCD.digest():{},d.totalChanges)for(f=v.watchers.any,a=0,s=f.length;s>a;a++)(i=f[a])();for(v.status=null,v.skippedWatches.clear(),h=v.watchers.finishScan,c=0,u=h.length;u>c;c++)(r=h[c])();for(o=v.watchers.finishScanOnce.slice(),v.watchers.finishScanOnce.length=0,l=0,p=o.length;p>l;l++)r=o[l],r.call(v);if(0===d.mainLoop)throw"Infinity loop detected";return d},e.core.ChangeDetector=r,r.prototype.compile=function(t,n){return e.utils.compile.expression(t,n).fn},r.prototype.setValue=function(t,n){var r,i,o,a,c,l,s,u,p,f;r=this,o=r.compile(t+" = $value",{input:["$value"],no_return:!0});try{return o(r.scope,n)}catch(h){if(i=h,s="can't set variable: "+t,e.debug.parser&&console.warn(s),(""+i).indexOf("TypeError")>=0&&(p=t.match(/^([\w\d\.]+)\.[\w\d]+$/),p&&p[1])){for(f=r.scope,u=p[1].split("."),a=0,l=u.length;l>a;a++)c=u[a],void 0===f[c]&&(f[c]={}),f=f[c];try{return void o(r.scope,n)}catch(h){}}return e.exceptionHandler(i,s,{name:t,value:n})}},r.prototype.eval=function(e){var t;return(t=this.compile(e))(this.scope)},r.prototype.getValue=function(e){return this.eval(e)};var v;e.hooks.scope=[],e.Scope=function(t){var n,r,i,o,a,c,l,s;if(t=t||{},t.customScope){if(l=t.customScope,!l.$scan)for(a in v.prototype)l[a]=v.prototype[a]}else l=new v;if(t.childFromChangeDetector?(n=t.childFromChangeDetector["new"](l),l.$rootChangeDetector=n):l.$rootChangeDetector=e.ChangeDetector(l),t.$parent&&(l.$parent=t.$parent),l.$changeDetector=null,e.hooks.scope.length){for(s={scope:l,changeDetector:l.$rootChangeDetector},c=e.hooks.scope,i=0,o=c.length;o>i;i++)r=c[i],r.fn.call(s);l=s.scope}return l},v=function(){},e.core.Scope=v,v.prototype.$watch=function(t,n,r){var i;return i=r&&r.changeDetector?r.changeDetector:this.$changeDetector,i||this.$rootChangeDetector.children.length||(i=this.$rootChangeDetector),i?i.watch(t,n,r):void e.exceptionHandler("","You can do $watch during binding only: "+t,{name:t,option:r,scope:this})},v.prototype.$scan=function(e){var t;return t=this.$rootChangeDetector,t.scan(e)},v.prototype.$setValue=function(e,t){var n;n=this.$rootChangeDetector,n.setValue(e,t)},v.prototype.$getValue=function(e,t){var n;return n=this.$rootChangeDetector,n.getValue(e,t)},v.prototype.$eval=function(e){var t;return t=this.$rootChangeDetector,t.eval(e)},v.prototype.$compile=function(e,t){var n;return n=this.$rootChangeDetector,n.compile(e,t)},v.prototype.$destroy=function(){var e;e=this.$rootChangeDetector,e.destroy()},v.prototype.$new=function(){if(!this.$changeDetector)throw"No change detector";return e.Scope({$parent:this,childFromChangeDetector:this.$changeDetector})},function(){var t,n;return t=function(){var e;return e=0,function(){return e++,"wt"+e}}(),e.text.$base=function(t){var n,r,i,o,a;if(o=t.point,n=t.cd,a=n.scope,r=a.$ns&&a.$ns.text?a.$ns.text[t.name]:e.text[t.name],!r)throw"No directive alight.text."+t.name;return i={changeDetector:n,setter:function(e){return o.value=null===e?"":""+e,t.update()},"finally":function(e){return o.value=null===e?"":""+e,o.type="text",t["finally"]()}},a.$changeDetector=n,r(i.setter,t.exp,a,i),a.$changeDetector=null},n=function(t,n,r){var i,o,c,l,s,u,p,f,h,d,v,m,g,y,w,$,b,x,k,D,C,_,S;if(r=r||{},o=this,e.debug.watchText&&console.log("$watchText",t),D=e.utils.compile.buildSimpleText(t,null))return void o.watch(t,n,{watchText:D,element:r.element,elementAttr:r.elementAttr});for(s=e.utils.parsText(t),S=0,i=!0,b=!1,p=u=function(){},v=0,g=s.length;g>v;v++)if(l=s[v],"expression"===l.type)if(f=l.list.join(" | "),w=f.match(/^([^\w\d\s\$"'\(\u0410-\u044F\u0401\u0451]+)/))$=w[1],"#"===$?(d=f.indexOf(" "),0>d?($=f.substring(1),f=""):($=f.slice(1,d),f=f.slice(d))):f=f.substring($.length),e.text.$base({name:$,exp:f,cd:o,point:l,update:function(){return p()},"finally":function(){return p(),u()}}),b=!0,"text"!==l.type&&(S++,i=!1);else if(c=e.utils.compile.expression(f,{string:!0}),c.filters)S++,i=!1,function(e){return o.watch(f,function(t){return null==t&&(t=""),e.value=t,p()})}(l);else{if(l.fn=c.fn,!c.rawExpression)throw"Error";c.isSimple&&0===c.simpleVariables.length?(l.type="text",l.value=l.fn()):(l.re=c.rawExpression,S++)}if(!S){for(C="",m=0,y=s.length;y>m;m++)l=s[m],C+=l.value;return void o.watch("$onScanOnce",function(){return a(o.scope,{callback:n,el:r.element,ea:r.elementAttr},C)})}return i?(D=b?e.utils.compile.buildSimpleText(null,s):e.utils.compile.buildSimpleText(t,s),void o.watch(t,n,{watchText:{fn:D.fn},element:r.element,elementAttr:r.elementAttr})):(_=null,k="",s.scope=o.scope,h=e.utils.compile.buildText(t,s),p=function(){return k=h()},u=function(){var e,t;for(d=!0,e=0,t=s.length;t>e;e++)if(l=s[e],"expression"===l.type){d=!1;break}return d?(o.watch("$finishScanOnce",function(){return _.stop()}),r.onStatic?r.onStatic():void 0):void 0},x=function(){return k},p(),void(_=o.watch(x,n,{element:r.element,elementAttr:r.elementAttr})))},r.prototype.watchText=n,v.prototype.$watchText=function(t,n,r){var i;i=this.$changeDetector,i||this.$rootChangeDetector.children.length||(i=this.$rootChangeDetector),i?i.watchText(t,n,r):e.exceptionHandler("","You can do $watchText during binding only: "+t,{expression:t,option:r,scope:this})}}();var m,g,y,w,$,b,x;e.version="0.12.11",e.debug={scan:0,directive:!1,watch:!1,watchText:!1,parser:!1},function(){var n;return e.hooks.attribute=n=[],n.push({code:"dataPrefix",fn:function(){"data-"===this.attrName.slice(0,5)&&(this.attrName=this.attrName.slice(5))}}),n.push({code:"colonNameSpace",fn:function(){var e;if(!this.directive)return e=this.attrName.indexOf(":"),0>e&&(e=this.attrName.indexOf("-")),0>e?(this.result="noNS",void(this.stop=!0)):(this.ns=this.attrName.substring(0,e),void(this.name=this.attrName.substring(e+1).replace(/(-\w)/g,function(e){return e.substring(1).toUpperCase()})))}}),n.push({code:"getScopeDirective",fn:function(){var e,t;if(!this.directive&&(e=this.cd.scope.$ns,e&&e.directives))if(t=e.directives[this.ns]){if(this.directive=t[this.name],!this.directive&&!e.inheritGlobal)return this.result="noDirective",void(this.stop=!0)}else e.inheritGlobal||(this.result="noNS",this.stop=!0)}}),n.push({code:"getGlobalDirective",fn:function(){var t;if(!this.directive){if(t=e.d[this.ns],!t)return this.result="noNS",void(this.stop=!0);this.directive=t[this.name],this.directive||(this.result="noDirective",this.stop=!0)}}}),n.push({code:"cloneDirective",fn:function(){var e,n,r,i;if(r=this.directive,e={},t.isFunction(r))e.init=r;else{if(!t.isObject(r))throw"Wrong directive: "+ns+"."+name;for(n in r)i=r[n],e[n]=i}if(e.priority=r.priority||0,e.restrict=r.restrict||"A",e.restrict.indexOf(this.attrType)<0)throw"Directive has wrong binding (attribute/element): "+name;this.directive=e}}),n.push({code:"preprocessor",fn:function(){var t,n,r;r=this.ns,n=this.name,t=this.directive,t.$init=function(i,o,a,c){var l,s;l=function(){var e,t,n,r,i;for(n=s.procLine,t=i=0,r=n.length;r>i;t=++i)if(e=n[t],e.fn.call(s),s.isDeferred){s.procLine=n.slice(t+1);break}return null},s={element:o,value:a,cd:i,env:c,ns:r,name:n,directive:t,isDeferred:!1,procLine:e.hooks.directive,makeDeferred:function(){return s.isDeferred=!0,s.env.stopBinding=!0,s.doBinding=!0,function(){return s.isDeferred=!1,l()}}},t.stopBinding&&(s.env.stopBinding=!0),l()}}})}(),function(){var n;return n=e.hooks.directive,n.push({code:"init",fn:function(){var t;this.directive.init&&(e.debug.directive&&this.directive.scope&&console.warn(this.ns+"-"+this.name+" uses scope and init together, probably you need use link instead of init"),this.env.changeDetector=this.cd,this.cd.scope.$changeDetector=this.cd,t=this.directive.init(this.cd.scope,this.element,this.value,this.env),t&&t.start&&t.start(),this.cd.scope.$changeDetector=null)}}),n.push({code:"templateUrl",fn:function(){var e,n;n=this,this.directive.templateUrl&&(e=this.makeDeferred(),t.ajax({cache:!0,url:this.directive.templateUrl,success:function(t){return n.directive.template=t,e()},error:e}))}}),n.push({code:"template",fn:function(){var e;this.directive.template&&(1===this.element.nodeType?this.element.innerHTML=this.directive.template:8===this.element.nodeType&&(e=document.createElement("p"),e.innerHTML=this.directive.template.trim(),e=e.firstChild,t.after(this.element,e),this.element=e,this.doBinding=!0))}}),n.push({code:"scope",fn:function(){var t,n,r;if(this.directive.scope){switch(n=this.cd,this.directive.scope){case!0:r=e.Scope({$parent:n.scope,childFromChangeDetector:n}),t=r.$rootChangeDetector;break;case"root":r=e.Scope({$parent:n.scope}),t=r.$rootChangeDetector,n.watch("$destroy",function(){return t.destroy()});break;default:throw"Wrong scope value: "+this.directive.scope}this.env.parentChangeDetector=n,this.cd=t,this.env.stopBinding=!0,this.doBinding=!0}}}),n.push({code:"link",fn:function(){var e;this.directive.link&&(this.env.changeDetector=this.cd,this.cd.scope.$changeDetector=this.cd,e=this.directive.link(this.cd.scope,this.element,this.value,this.env),e&&e.start&&e.start(),this.cd.scope.$changeDetector=null)}}),n.push({code:"scopeBinding",fn:function(){this.doBinding&&e.bind(this.cd,this.element,{skip_attr:this.env.skippedAttr()})}})}(),x=function(){var t;return t=function(e,t,n){var r;"A"===t.attr_type?(r=n||{},r.priority=-5,r.is_attr=!0,r.name=e,r.attrName=e,r.element=t.element,t.list.push(r)):"M"===t.attr_type&&t.list.push(n)},function(n,r){var i,o,a,c,l;if(r.skip_attr.indexOf(n)>=0)return t(n,r,{skip:!0});for(o={attrName:n,attrType:r.attr_type,element:r.element,cd:r.cd,result:null},l=e.hooks.attribute,c=0,a=l.length;a>c&&(i=l[c],i.fn.call(o),!o.stop);c++);return"noNS"===o.result?void t(n,r):"noDirective"===o.result?void t(n,r,{noDirective:!0}):void r.list.push({name:n,directive:o.directive,priority:o.directive.priority,attrName:n})}}(),b=function(e,t){return e.priority===t.priority?0:e.priority>t.priority?-1:1},m=function(t,n,r,i){var o;return o=r,o.indexOf(e.utils.pars_start_tag)<0?void 0:(t.watchText(o,null,{element:n,elementAttr:i}),!0)},$=function(t,n){var r;return r=n.data,r.indexOf(e.utils.pars_start_tag)<0?void 0:(t.watchText(r,null,{element:n}),!0)},g=function(t,n){var r,i,o,a,c,l,s,u,p,f;if(p=n.nodeValue.trim(),"directive:"===p.slice(0,10)){if(p=p.slice(10).trim(),s=p.indexOf(" "),s>=0?(o=p.slice(0,+(s-1)+1||9e9),f=p.slice(s+1)):(o=p,f=""),r={list:u=[],element:n,attr_type:"M",cd:t,skip_attr:[]},x(o,r),i=u[0],i.noDirective)throw"Comment directive not found: "+o;a=i.directive,l={element:n,attrName:o,attributes:[],skippedAttr:function(){return[]}},e.debug.directive&&console.log("bind",i.attrName,f,i);try{a.$init(t,n,f,l)}catch(h){c=h,e.exceptionHandler(c,"Error in directive: "+i.name,{value:f,env:l,cd:t,scope:t.scope,element:n})}return l.skipToElement?{directive:1,skipToElement:l.skipToElement}:{directive:1,skipToElement:null}}},y=function(){var t,n;return n=function(e,t){var n,r,i,o,a;for(1===arguments.length&&(t=!0),o=this.attributes,i=0,r=o.length;r>i;i++)if(n=o[i],n.attrName===e)return t&&(n.skip=!0),a=this.element.getAttribute(e),a||!0},t=function(){var e,t,n,r,i;for(r=this.attributes,i=[],n=0,t=r.length;t>n;n++)e=r[n],e.skip&&i.push(e.attrName);return i},function(r,i,o){var a,c,l,s,u,p,f,h,d,v,g,y,$,k,D,C,_,S,T,A,B,N,M,O,E;if(u={directive:0,text:0,attr:0,hook:0,skipToElement:null},o=o||{},N=!1,O=o.skip_attr||[],O instanceof Array||(O=[O]),!o.skip_top){for(a={list:D=[],element:i,skip_attr:O,attr_type:"E",cd:r},l=i.nodeName.toLowerCase(),x(l,a),a.attr_type="A",A=i.attributes,C=0,y=A.length;y>C;C++)c=A[C],x(c.name,a);if(o.attachDirective){B=o.attachDirective;for(l in B)s=B[l],x(l,a)}for(D=D.sort(b),_=0,$=D.length;$>_;_++)if(h=D[_],!h.skip){if(h.noDirective)throw"Directive not found: "+h.name;if(h.skip=!0,E=o.attachDirective&&o.attachDirective[h.attrName]?o.attachDirective[h.attrName]:i.getAttribute(h.attrName),h.is_attr)m(r,i,E,h.attrName)&&u.attr++;else{u.directive++,d=h.directive,g={element:i,attrName:h.attrName,attributes:D,takeAttr:n,skippedAttr:t,stopBinding:!1},e.debug.directive&&console.log("bind",h.attrName,E,h);try{d.$init(r,i,E,g)}catch(j){v=j,e.exceptionHandler(v,"Error in directive: "+h.attrName,{value:E,env:g,cd:r,scope:r.scope,element:i})}if(g.stopBinding){N=!0;break}g.skipToElement&&(u.skipToElement=g.skipToElement)}}}if(!N)for(M=null,f=function(){var e,t,n,r;for(n=i.childNodes,r=[],t=0,e=n.length;e>t;t++)p=n[t],r.push(p);return r}(),S=0,k=f.length;k>S;S++)p=f[S],p&&(M?M===p&&(M=null):(T=w(r,p),u.directive+=T.directive,u.text+=T.text,u.attr+=T.attr,u.hook+=T.hook,M=T.skipToElement));return u}}(),w=function(t,n,r){var i,o,a,c,l,s;if(s={directive:0,text:0,attr:0,hook:0,skipToElement:null},e.hooks.binding.length)for(l=e.hooks.binding,a=0,o=l.length;o>a;a++)if(i=l[a],s.hook+=1,c=i.fn(t,n,r),c&&c.owner)return s;return 1===n.nodeType?(c=y(t,n,r),s.directive+=c.directive,s.text+=c.text,s.attr+=c.attr,s.hook+=c.hook,s.skipToElement=c.skipToElement):3===n.nodeType?$(t,n,r)&&s.text++:8===n.nodeType&&(c=g(t,n,r),c&&(s.directive+=c.directive,s.skipToElement=c.skipToElement)),s},e.nextTick=function(){var t,n,r;return r=null,n=[],t=function(){var t,i,o,a,c,l,s;for(r=null,i=n.slice(),n.length=0,l=0,c=i.length;c>l;l++){a=i[l],t=a[0],s=a[1];try{t.call(s)}catch(u){o=u,e.exceptionHandler(o,"$nextTick, error in function",{fn:t,self:s})}}return null},function(e){return n.push([e,this]),r?void 0:r=setTimeout(t,0)}}(),e.bind=e.applyBindings=function(t,n,r){var i,o,a,c,l,s,u,p;if(!n)throw"No element";if(!t)throw"No Scope";if(r=r||{},o=t instanceof e.core.ChangeDetector?t:r.changeDetector||t.$changeDetector||t.$rootChangeDetector,p=o.root,a=!p.finishBinding_lock,a&&(p.finishBinding_lock=!0,p.bindingResult={directive:0,text:0,attr:0,hook:0}),u=w(o,n,r),p.bindingResult.directive+=u.directive,p.bindingResult.text+=u.text,p.bindingResult.attr+=u.attr,p.bindingResult.hook+=u.hook,o.digest(),a){for(p.finishBinding_lock=!1,l=p.watchers.finishBinding.slice(),p.watchers.finishBinding.length=0,s=0,c=l.length;c>s;s++)(i=l[s])();u.total=p.bindingResult}return u},e.bootstrap=function(n,r){var i,o,a,c,l,s,u,p;if(!n)return e.bootstrap("[al-app]"),e.bootstrap("[al\\:app]"),void e.bootstrap("[data-al-app]");if("string"==typeof n?n=document.querySelectorAll(n):t.isElement(n)&&(n=[n]),Array.isArray(n)||"number"==typeof n.length){for(a=null,r&&(s=e.Scope({customScope:r})),l=0,c=n.length;c>l;l++)o=n[l],o.ma_bootstrapped||(o.ma_bootstrapped=!0,p=s?s:e.Scope(),u={skip_attr:["al-app","al:app"]},i=o.getAttribute("al-app")||o.getAttribute("al:app"),i&&(u.attachDirective={"al-ctrl":i}),e.bind(p,o,u),a=p);return a}e.exceptionHandler("Error in bootstrap","Error input arguments",{input:n})};var k,D;e.utils.getId=function(){var e,t;return t=function(){var e,t,n,r,i,o;for(o="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),n=Math.floor((new Date).valueOf()/1e3)-1388512800,i="";n>0;)e=Math.floor(n/62),r=62*e,t=n-r,n=e,i=o[t]+i;return i}(),e=1,function(){return t+"#"+e++}}(),e.utils.clone=k=function(e){var t,n,r,i;if(!e)return e;if("object"==typeof e){if(e instanceof Array)return r=function(){var n,r,i;for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(k(t));return i}();if(e instanceof Date)return new Date(e.valueOf());if(e.nodeType&&"function"==typeof e.cloneNode)return e;r={};for(n in e)i=e[n],"$"!==n[0]&&(r[n]=k(i));return r}return e},e.utils.equal=D=function(e,t){var n,r,i,o,a,c,l,s;if(!e||!t)return e===t;if(c=typeof e,l=typeof t,c!==l)return!1;if("object"===c){if(e instanceof Array){if(e.length!==t.length)return!1;for(n=r=0,o=e.length;o>r;n=++r)if(s=e[n],!D(s,t[n]))return!1;return!0}if(e instanceof Date)return e.valueOf()===t.valueOf();if(e.nodeType&&"function"==typeof e.cloneNode)return e===t;a={};for(i in e)if(s=e[i],"$"!==i[0]&&(a[i]=!0,!D(s,t[i])))return!1;for(i in t)if(s=t[i],"$"!==i[0]&&!a[i]&&!D(s,e[i]))return!1;return!0}return e===t},e.exceptionHandler=function(e,t,n){var r;return console.warn(t+"\n",(e.message||"")+"\n",n),r="string"==typeof e?e:e.stack,console.error(r)},function(){var t,n,r,i,o,a;return a=function(){var e,t,n,r;for(r={},e=0,n=arguments.length;n>e;e++)t=arguments[e],r[t]=!0;return r},o=a("instanceof","typeof","in","null","true","false","undefined","return"),n=function(){var e;return e=/[a-zA-Z\u0410-\u044F\u0401\u0451_\.\$]/,function(t){return t.match(e)}}(),r=function(e){return e.charCodeAt()>=48&&e.charCodeAt()<=57},i=function(){var e;return e=a("+","-",">","<","=","&","|","^","!","~"),function(t){return e[t]||!1}}(),t=a("=","+=","-=","++","--","|=","^=","&=","!=","<<=",">>="),e.utils.parsExpression=function(c,l){var s,u,p,f,h,d,v,m,g,y;return l=l||{},h=a.apply(null,l.input||[]),y=1,d=function(e){var o,a,c,l,s,u,p,f,h,v,m,g,w,$,b,x,k,D,C,_,S;for(g=e.line,$=e.result||[],h=e.index||0,m=e.level||0,k=e.stopKey||null,_="",v=null,S=[],b="",x=!1,w="",D="",C="",f="",l=0,p=null,u=function(){return f&&$.push({type:"free",value:f}),f=""};h<=g.length;)if(c=g[h-1],o=g[h++]||"",a=g[h],(x&&f||!o)&&u(),"string"!==x){if("key"===x){if(n(o)||r(o)){_+=o;continue}if("["===o){if(_+=o,s=d({line:g,index:h,level:m+1,stopKey:"]"}),!s.stopKeyOk)throw"Error expression";h=s.index,_+="###"+s.uniq+"###]",S.push(s);continue}if("?"===o&&("."===a||"("===a||"["===a)){_+=o;continue}if("("===o){if(_+=o,s=d({line:g,index:h,level:m+1,stopKey:")"}),!s.stopKeyOk)throw"Error expression";h=s.index,_+="###"+s.uniq+"###)",S.push(s);continue}v={type:"key",value:_,start:h-_.length-1,finish:h-1,children:S},$.push(v),x="",_="",S=[]}else if("sign"===x){if(i(o)){b+=o;continue}if("|"===b&&0===m&&0===l){p=g.substring(h-1),h=g.length+1;continue}t[b]&&(v.assignment=!0),$.push({type:"sign",value:b}),x="",b=""}if(n(o))x="key",_+=o;else if(i(o))x="sign",b+=o;else if('"'!==o&&"'"!==o){if(o===k)return u(),{result:$,index:h,stopKeyOk:!0,uniq:y++};"("===o&&l++,")"===o&&l--,"{"!==o?(":"===o&&"}"===k&&(v.type="free"),f+=o):(u(),s=d({line:g,index:h,level:m+1,stopKey:"}"}),$.push({type:"{}",child:s}),h=s.index)}else D=o,x="string",C+=o}else{if(o===D&&"\\"!==c){C+=o,$.push({type:"string",value:C}),C="",D="",x="";continue}C+=o}return u(),{result:$,index:h,filters:p}},p=d({line:c}),v={isSimple:!p.filters,simpleVariables:[]},p.filters?(v.expression=c.substring(0,c.length-p.filters.length-1),v.filters=p.filters.split("|")):v.expression=c,m=function(e){var t;return t=e.split(/[\.\[\(\?]/),{count:t.length,firstPart:t[0]}},g=function(e,t){return t?"($$="+e+",$$==null)?undefined:":"($$=$$"+e+",$$==null)?undefined:"},f=function(e){return e.split(/[\.\[\(\?]/)[0]},u=function(e){var t,n,r,i,a,c,l,s,u,p;if("this"===e)return"$$scope";if(t=f(e),i=o[t]||h[t],s=e.split("?"),1===s.length)return i?e:"$$scope."+e;for(i?(p=g(s[0],!0),n=s[0]):(p=g("scope."+s[0]),n="scope."+s[0]),u=s.slice(1,s.length-1),r=0,c=u.length;c>r;r++)l=u[r],"("===l[0]?p+=g(n+l,i):(p+=g(l),n+=l);return a=s[s.length-1],"("===a[0]?(i||(p+="$$"),p+=n+a):p+="$$"+a,"("+p+")"},s=function(e){var t,n,r,i,a,c,l,p,f,h,d,g,y;for(g="",h=e.result,i=0,l=h.length;l>i;i++)if(r=h[i],"key"!==r.type)g+="{}"!==r.type?r.value:"{"+s(r.child)+"}";else{if(r.assignment?(y=m(r.value),f="this"===y.firstPart?"$$scope"+r.value.substring(4):y.count<2?"($$scope.$$root || $$scope)."+r.value:"$$scope."+r.value,v.isSimple=!1):o[r.value]?f=r.value:(f=u(r.value),v.simpleVariables.push(f)),r.children.length)for(d=r.children,a=0,p=d.length;p>a;a++)t=d[a],c="###"+t.uniq+"###",n=s(t),f=f.split(c).join(n);g+=f}return g},v.result=s(p),e.debug.parser&&console.log(c,v),v}}(),function(){var t,n,r;return e.utils.pars_start_tag="{{",e.utils.pars_finish_tag="}}",r=function(t){var n,r,i,o,a,c,l,s,u;return u=e.utils.pars_start_tag,r=e.utils.pars_finish_tag,l=[],o=0,c=0,i=function(e){var n;return e=e||1,n=t.substring(c,o-e),c=o,n},s=null,a=function(e,n,c){var u,p,f,h;for(e||(s={type:"expression",list:[]},l.push(s)),h=null,u=null;o<t.length;){if(h=u,u=t[o],o+=1,p=h+u,f=t[o],u===n)return;if(!c){if(p===r&&0===e)return s.list.push(i(2)),!0;"("===u?a(e+1,")"):"{"===u?a(e+1,"}"):'"'===u?a(e+1,'"',!0):"'"===u?a(e+1,"'",!0):"|"===u&&0===e&&("|"===f?o+=1:s.list.push(i()))}}},n=function(){var e,n,r,c,s;for(r=null,e=null;o<t.length;)if(r=e,e=t[o],o+=1,n=r+e,n===u){if(s=i(2),s&&l.push({type:"text",value:s}),!a(0))throw"Wrong expression"+t;e=null}return c=i(-1),c?l.push({type:"text",value:c}):void 0},n(),e.debug.parser&&console.log("parsText",l),l},t={},n=function(e){var t,n,r;return r=function(){var r,i,o;for(o=[],r=0,i=e.length;i>r;r++)t=e[r],n={type:t.type,value:t.value},t.list&&(n.list=t.list.slice()),o.push(n);return o}()},e.utils.parsText=function(e){var i;return i=t[e],i||(t[e]=i=r(e)),n(i)}}(),function(){var t;return e.utils.compile=t={},t.cache={},t.Function=Function,t.expression=function(n,r){var i,o,a,c,l,s,u,p;if(r=r||{},n=n.trim(),s=n+"#",s+=r.no_return?"+":"-",s+=r.string?"s":"v",r.input&&(s+=r.input.join(",")),l=t.cache[s])return l;l=e.utils.parsExpression(n,{input:r.input}),a=l.result,u=r.no_return||!1,u?p="var $$;"+a:r.string&&!l.filters?(p="var $$, __ = ("+a+"); return '' + (__ || (__ == null?'':__))",l.rawExpression="(__="+a+") || (__ == null?'':__)"):p="var $$;return ("+a+")";try{r.input?(i=r.input.slice(),i.unshift("$$scope"),i.push(p),c=t.Function.apply(null,i)):c=t.Function("$$scope",p)}catch(f){throw o=f,e.exceptionHandler(o,"Wrong expression: "+n,{src:n,cfg:r}),"Wrong expression: "+a}return l.fn=c,t.cache[s]=l},t.cacheText={},t.buildText=function(e,n){var r,i,o,a,c,l,s;if(o=t.cacheText[e])return function(){return o.call(n)};for(s=[],c=a=0,l=n.length;l>a;c=++a)r=n[c],"expression"===r.type?s.push(r.fn?"this["+c+"].fn(this.scope)":"((x=this["+c+"].value) || (x == null?'':x))"):r.value&&(i=r.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),s.push('"'+i+'"'));return s=s.join(" + "),o=t.Function("var x; return ("+s+")"),t.cacheText[e]=o,function(){return o.call(n)}},t.cacheSimpleText={},t.buildSimpleText=function(e,n){var r,i,o,a,c,l,s,u,p;if(l=e?t.cacheSimpleText[e]:null,l||!n)return l||null;for(u=[],p=[],c=a=0,s=n.length;s>a;c=++a)r=n[c],"expression"===r.type?(u.push("("+r.re+")"),r.simpleVariables&&p.push.apply(p,r.simpleVariables)):r.value&&(i=r.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),u.push('"'+i+'"'));return u=u.join(" + "),o=t.Function("$$scope","var $$, __; return ("+u+")"),l={fn:o,simpleVariables:p},e&&(t.cacheSimpleText[e]=l),l}}();var C,_,S;S=function(e){var t,n,r,i;if(!e.length)return"el";for(i="el",n=0,r=e.length;r>n;n++)t=e[n],i+=".childNodes["+t+"]";return i},C=function(t){var n,r,i,o,a,c,l;for(i=e.utils.parsText(t),o=0,c=i.length;c>o;o++)if(r=i[o],"expression"===r.type){if(r.list.length>1)return null;if(a=r.list[0],"#"===a[0])return null;if("="===a[0])return null;if("::"===a.slice(0,2))return null;if(n=e.utils.compile.expression(a,{string:!0}),!n.rawExpression)throw"Error";r.re=n.rawExpression}return l=e.utils.compile.buildSimpleText(t,i),l.fn},e.core.fastBinding=_=function(t){var n,r,i,o;return r=this,i=[],r.fastWatchFn=[],n=[],o=function(t,a){var c,l,s,u,p,f,h,d,v,m,g,y,w,$;if(1===t.nodeType){for(m=t.attributes,p=0,d=m.length;d>p;p++)c=m[p],c.value.indexOf(e.utils.pars_start_tag)<0||($=c.value,h=c.nodeName,y=S(n),s=C($),w=$.replace(/"/g,'\\"').replace(/\n/g,"\\n"),s?(i.push("s.fw('"+w+"', "+r.fastWatchFn.length+", "+y+", '"+h+"');"),r.fastWatchFn.push(s)):i.push("s.wt('"+w+"', "+y+", '"+h+"');"));
for(g=t.childNodes,u=f=0,v=g.length;v>f;u=++f)l=g[u],n.length=a+1,n[a]=u,o(l,a+1)}else if(3===t.nodeType){if(t.nodeValue.indexOf(e.utils.pars_start_tag)<0)return;$=t.nodeValue,y=S(n),s=C($),w=$.replace(/"/g,'\\"').replace(/\n/g,"\\n"),s?(i.push('s.fw("'+w+'", '+r.fastWatchFn.length+", "+y+");"),r.fastWatchFn.push(s)):i.push('s.wt("'+w+'", '+y+");")}return null},o(t,0),i=i.join("\n"),r.resultFn=e.utils.compile.Function("s","el","f$",i),this},_.prototype.bind=function(e,n){var r;r=this,r.currentCD=e,r.resultFn(r,n,t)},_.prototype.fw=function(e,t,n,r){var i,o,c,l,s;c=this,i=c.currentCD,o=c.fastWatchFn[t],l=o(i.scope),s={isStatic:!1,isArray:!1,extraLoop:!1,deep:!1,value:l,callback:null,exp:o,src:e,onStop:null,el:n,ea:r||null},i.watchList.push(s),a(i.scope,s,l)},_.prototype.wt=function(e,t,n){this.currentCD.watchText(e,null,{element:t,elementAttr:n}),this.currentCD.scan()},function(){var t,n,r,i;return n={enter:13,tab:9,"delete":46,backspace:8,esc:27,space:32,up:38,down:40,left:37,right:39},i=function(t,r){return r=r||{},function(i,o){var a,c,l,s,u,p,f,h,d;for(d=r.stop||!1,p=r.prevent||!1,c=!1,h=!0,a={},f=o.slice(1),l=0,u=f.length;u>l;l++)s=f[l],"stop"!==s?"prevent"!==s?"nostop"!==s?"noprevent"!==s?"noscan"!==s?r.filtered&&(c=!0,n[s]&&(s=n[s]),a[s]=!0):h=!1:p=!1:d=!1:p=!0:d=!0;return function(n,r,o){var l,s;l=n.$compile(o,{no_return:!0,input:["$event"]}),s=function(t){if(!c||a[t.keyCode]){p&&t.preventDefault(),d&&t.stopPropagation();try{l(n,t)}catch(s){t=s,e.exceptionHandler(t,"Error in event: "+i+" = "+o,{attr:i,exp:o,scope:n,element:r})}h&&n.$scan()}},r.addEventListener(t,s),n.$watch("$destroy",function(){return r.removeEventListener(t,s)})}}},r=function(e,t){var n;return n=t[0],i(n)(e,t)},t={click:i("click",{stop:!0,prevent:!0}),dblclick:i("dblclick",{stop:!0,prevent:!0}),submit:i("submit",{stop:!0,prevent:!0}),keyup:i("keyup",{filtered:!0}),keypress:i("keypress",{filtered:!0}),keydown:i("keydown",{filtered:!0})},e.hooks.attribute.unshift({code:"events",fn:function(){var e,n,i,o,a;i=this.attrName.match(/^\(([\w\.]+)\)$/),i&&(n=i[1],e=n.split("."),o=e[0],a=t[o]?t[o]:r,this.directive={priority:10,link:a(n,e)})}})}();var T;T=function(n){return{priority:10,stopPropagation:!0,link:function(r,i,o,a){var c;return c={stopPropagation:this.stopPropagation,callback:r.$compile(o,{no_return:!0,input:["$event"]}),start:function(){c.onDom(),c.stop=a.takeAttr("al-click-stop")},onDom:function(){t.on(i,n,c.doCallback),r.$watch("$destroy",c.offDom)},offDom:function(){t.off(i,n,c.doCallback)},doCallback:function(t){if(c.stop||(t.preventDefault(),c.stopPropagation&&t.stopPropagation()),!i.getAttribute("disabled")){try{c.callback(r,t)}catch(n){t=n,e.exceptionHandler(t,"al-click, error in expression: "+o,{name:o,scope:r,element:i})}c.stop&&r.$eval(c.stop)&&(t.preventDefault(),c.stopPropagation&&t.stopPropagation()),r.$scan()}}}}}},e.d.al.click=T("click"),e.d.al.dblclick=T("dblclick"),e.d.al.value=function(n,r,i){var o;return o={onDom:function(){t.on(r,"input",o.updateModel),t.on(r,"change",o.updateModel),n.$watch("$destroy",o.offDom)},offDom:function(){t.off(r,"input",o.updateModel),t.off(r,"change",o.updateModel)},updateModel:function(){e.nextTick(function(){var e;e=r.value,n.$setValue(i,e),n.$scan({skipWatch:o.watch})})},watchModel:function(){o.watch=n.$watch(i,o.updateDom)},updateDom:function(e){return null==e&&(e=""),r.value=e,"$scanNoChanges"},start:function(){o.onDom(),o.watchModel()}}},e.d.al.checked={priority:100,link:function(e,n,r){var i;return i={start:function(){i.onDom(),i.watchModel()},onDom:function(){t.on(n,"change",i.updateModel),e.$watch("$destroy",i.offDom)},offDom:function(){t.off(n,"change",i.updateModel)},updateModel:function(){var t;t=n.checked,e.$setValue(r,t),e.$scan({skipWatch:i.watch})},watchModel:function(){i.watch=e.$watch(r,i.updateDom)},updateDom:function(e){return n.checked=!!e,"$scanNoChanges"}}}},e.d.al["if"]={priority:700,stopBinding:!0,link:function(n,r,i,o){var a;return a={item:null,childCD:null,base_element:null,top_element:null,start:function(){a.prepare(),a.watchModel()},prepare:function(){a.base_element=r,a.top_element=document.createComment(" "+o.attrName+": "+i+" "),t.before(r,a.top_element),t.remove(r)},updateDom:function(e){e?a.insertBlock(e):a.removeBlock()},removeBlock:function(){a.childCD&&(a.childCD.destroy(),a.childCD=null,a.removeDom(a.item),a.item=null)},insertBlock:function(){a.childCD||(a.item=a.base_element.cloneNode(!0),a.insertDom(a.top_element,a.item),a.childCD=o.changeDetector["new"](),e.bind(a.childCD,a.item,{skip_attr:o.skippedAttr()}))},watchModel:function(){n.$watch(i,a.updateDom)},removeDom:function(e){t.remove(e)},insertDom:function(e,n){t.after(e,n)}}}},e.d.al.ifnot={priority:700,stopBinding:!0,link:function(t,n,r,i){var o;return o=e.d.al["if"].link(t,n,r,i),o.updateDom=function(e){e?o.removeBlock():o.insertBlock()},o}},e.directives.al.repeat={priority:1e3,restrict:"AM",stopBinding:!0,init:function(n,r,i,o){var a,c;return a=n.$changeDetector,c={start:function(){c.parsExpression(),c.prepareDom(),c.buildUpdateDom(),c.watchModel(),c.makeChildConstructor()},parsExpression:function(){var e,t;if(t=i.trim(),"("===t[0])if(c.objectMode=!0,e=t.match(/\((\w+),\s*(\w+)\)\s+in\s+(.+)\s+orderBy:(.+)\s*$/))c.objectKey=e[1],c.objectValue=e[2],c.expression=e[3]+(" | toArray:"+c.objectKey+","+c.objectValue+" | orderBy:"+e[4]),c.nameOfKey="$item",c.trackExpression="$item."+c.objectKey;else{if(e=t.match(/\((\w+),\s*(\w+)\)\s+in\s+(.+)\s*$/),!e)throw"Wrong repeat: "+i;c.objectKey=e[1],c.objectValue=e[2],c.expression=e[3]+(" | toArray:"+c.objectKey+","+c.objectValue),c.nameOfKey="$item",c.trackExpression="$item."+c.objectKey}else{if(e=t.match(/(.*) track by ([\w\.\$\(\)]+)/),e&&(c.trackExpression=e[2],t=e[1]),e=t.match(/\s*(\w+)\s+in\s+(.+)/),!e)throw"Wrong repeat: "+i;c.nameOfKey=e[1],c.expression=e[2]}},watchModel:function(){var e;e=c.objectMode?{deep:!0}:{isArray:!0},c.watch=a.watch(c.expression,c.updateDom,e)},prepareDom:function(){var e,n,a,l,s,u;if(8===r.nodeType){for(c.top_element=r,c.element_list=n=[],e=r.nextSibling;e;){if(8===e.nodeType&&(s=e.nodeValue,u=s.trim().split(/\s+/),"/directive:"===u[0]&&"al-repeat"===u[1])){o.skipToElement=e;break}n.push(e),e=e.nextSibling}for(a=0,l=n.length;l>a;a++)e=n[a],t.remove(e)}else c.base_element=r,c.top_element=document.createComment(" "+i+" "),t.before(r,c.top_element),t.remove(r)},makeChildConstructor:function(){var e;e=function(){return this.$$root=a.scope.$$root||a.scope,this},e.prototype=a.scope,c.ChildScope=e},makeChild:function(e,t,n){var r,i;return i=new c.ChildScope,i.$rootChangeDetector=r=a["new"](i),c.updateChild(r,e,t,n),r},updateChild:function(e,t,n,r){var i;i=e.scope,c.objectMode?(i[c.objectKey]=t[c.objectKey],i[c.objectValue]=t[c.objectValue]):i[c.nameOfKey]=t,i.$index=n,i.$first=0===n,i.$last=n===r.length-1},rawUpdateDom:function(e,n){var r,i,o,a,c,l;for(i=0,c=e.length;c>i;i++)r=e[i],t.remove(r);for(a=0,l=n.length;l>a;a++)o=n[a],t.after(o.after,o.element)},buildUpdateDom:function(){return c.updateDom=function(){var t,n,i,l,s,u,p,f,h,d,v;return v=[],u=0,i=!1,"$index"===c.trackExpression?(p={},h=function(){var e;return e=u,p[e]||null},f=function(e){var t;t=e.$id,null!=t&&delete p[t]},d=function(e,t){var n;n=u,t.$id=n,p[n]=t}):c.trackExpression?(p={},t=function(){var e;return e=a.compile(c.trackExpression,{input:["$id",c.nameOfKey]}),function(t,n){return e(a.scope,t,n)}}(),n=function(t){var n;return(n=t.$alite_id)?n:n=t.$alite_id=e.utils.getId()},h=function(e){var r;return r=t(n,e),null!=r?p[r]:null},f=function(e){var t;t=e.$id,null!=t&&delete p[t]},d=function(e,r){var i;i=t(n,e),r.$id=i,p[i]=r}):window.Map?(p=new Map,h=function(e){return p.get(e)},f=function(e){p["delete"](e.item)},d=function(e,t){p.set(e,t)}):(p={},h=function(e){var t;return"object"!=typeof e?p[e]||null:(t=e.$alite_id)?p[t]:null},f=function(e){var t;t=e.$id,p[t]&&(e.$id=null,delete p[t])},d=function(t,n){var r;"object"==typeof t?(r=e.utils.getId(),t.$alite_id=r,n.$id=r,p[r]=n):(n.$id=t,p[t]=n)}),l=[],s=function(e){var t,n;if(n=typeof e,"object"!==n){if("number"===n)t=Math.floor(e);else if("string"===n&&(t=Math.floor(e),isNaN(t)))return[];if(t<l.length)l.length=t;else for(;l.length<t;)l.push(l.length);return l}return e&&e.length?e:[]},c.element_list?function(t){var n,r,i,a,l,p,m,g,y,w,$,b,x,k,D,C,_,S,T,A,B,N,M,O,E,j,L,V,F,I,H,W,K,q,P,U,R,G,Y;for(E=s(t),C=c.top_element,a=[],I=[],y=0,_=v.length;_>y;y++)F=v[y],F.active=!1;for(u=x=0,S=E.length;S>x;u=++x)$=E[u],F=h($),F&&(F.active=!0);for(l=[],k=0,T=v.length;T>k;k++)if(F=v[k],!F.active){for(F.prev&&(F.prev.next=F.next),F.next&&(F.next.prev=F.prev),f(F),F.CD.destroy(),U=F.element_list,D=0,A=U.length;A>D;D++)p=U[D],l.push(p);F.next=null,F.prev=null,F.element_list=null}for(n=[],K=null,P=null,q=!1,m=c.element_list.length-1,u=j=0,B=E.length;B>j;u=++j)if($=E[u],b=$,F=h($)){if(c.updateChild(F.CD,$,u,E),F.prev===P){if(q)for(R=F.element_list,L=0,N=R.length;N>L;L++)p=R[L],a.push({element:p,after:C}),C=p;P=F,C=F.element_list[m],F.active=!0,I.push(F);continue}for(F.prev=P,P&&(P.next=F),G=F.element_list,H=0,M=G.length;M>H;H++)p=G[H],a.push({element:p,after:C}),C=p;q=!0,P=F,F.active=!0,I.push(F)}else i=c.makeChild(b,u,E),g=function(){var e,t,o,l;for(o=c.element_list,l=[],t=0,e=o.length;e>t;t++)r=o[t],p=r.cloneNode(!0),n.push({cd:i,el:p}),a.push({element:p,after:C}),l.push(C=p);return l}(),F={CD:i,element_list:g,prev:P,next:null,active:!0,item:$},d($,F),P?(V=P.next,P.next=F,F.next=V,V&&(V.prev=F)):0===u&&v[0]&&(V=v[0],F.next=V,V.prev=F),P=F,I.push(F);for(v=I,c.rawUpdateDom(l,a),l.length=0,a.length=0,Y=o.skippedAttr(),W=0,O=n.length;O>W;W++)w=n[W],e.bind(w.cd,w.el,{skip_attr:Y})}:function(t){var n,a,l,p,m,g,y,w,$,b,x,k,D,C,_,S,T,A,B,N,M,O,E,j,L,V,F;for(A=s(t),k=c.top_element,l=[],O=[],m=0,D=v.length;D>m;m++)M=v[m],M.active=!1;for(u=$=0,C=A.length;C>$;u=++$)y=A[u],M=h(y),M&&(M.active=!0);for(p=[],b=0,_=v.length;_>b;b++)M=v[b],M.active||(M.prev&&(M.prev.next=M.next),M.next&&(M.next.prev=M.prev),f(M),M.CD.destroy(),p.push(M.element),M.next=null,M.prev=null,M.element=null);for(n=[],E=null,L=null,j=!1,u=x=0,S=A.length;S>x;u=++x)if(y=A[u],w=y,M=h(y)){if(c.updateChild(M.CD,y,u,A),M.prev===L){j&&l.push({element:M.element,after:L.element}),L=M,k=M.element,M.active=!0,O.push(M);continue}M.prev=L,L&&(L.next=M),l.push({element:M.element,after:k}),j=!0,k=M.element,L=M,M.active=!0,O.push(M)}else a=c.makeChild(w,u,A),r=c.base_element.cloneNode(!0),n.push({cd:a,el:r}),l.push({element:r,after:k}),M={CD:a,element:r,prev:L,next:null,active:!0,item:y},k=r,d(y,M),L?(N=L.next,L.next=M,M.next=N,N&&(N.prev=M)):0===u&&v[0]&&(N=v[0],M.next=N,N.prev=M),L=M,O.push(M);for(v=O,c.rawUpdateDom(p,l),p.length=0,l.length=0,F=o.skippedAttr(),B=0,T=n.length;T>B;B++)g=n[B],i?i.bind(g.cd,g.el):(V=e.bind(g.cd,g.el,{skip_attr:F}),0===V.directive&&0===V.hook&&(i=new e.core.fastBinding(c.base_element)))}}()}}}},e.d.al.init=function(t,n,r){var i,o;try{o=t.$compile(r,{no_return:!0}),o(t)}catch(a){i=a,e.exceptionHandler(i,"al-init, error in expression: "+r,{exp:r,scope:t,element:n})}},e.d.al["class"]=e.d.al.css={priority:30,link:function(n,r,i){var o;return o={start:function(){o.parsLine(),o.prepare()},parsLine:function(){var t,a,c,l,s,u;for(o.list=s=[],u=i.split(","),c=0,l=u.length;l>c;c++)t=u[c],a=t.indexOf(":"),0>a?e.exceptionHandler(t,"al-css, error in expression: "+i,{exp:i,e:t,scope:n,element:r}):s.push({css:t.slice(0,+(a-1)+1||9e9).trim().split(" "),exp:t.slice(a+1).trim()})},prepare:function(){var e,t,r,i,a;for(a=o.list,r=0,i=a.length;i>r;r++)t=a[r],e=function(e){return function(t){return o.draw(e,t),"$scanNoChanges"}}(t),n.$watch(t.exp,e)},draw:function(e,n){var i,o,a,c,l,s,u;if(n)for(s=e.css,o=0,c=s.length;c>o;o++)i=s[o],t.addClass(r,i);else for(u=e.css,a=0,l=u.length;l>a;a++)i=u[a],t.removeClass(r,i)}}}},e.d.al.src=function(e,t,n){var r;r=function(e){return e||(e=""),t.setAttribute("src",e),"$scanNoChanges"},e.$watchText(n,r)},e.d.al.text=function(e,t,n){var r;return r={start:function(){r.watchModel()},updateDom:function(e){return null==e&&(e=""),void 0!==t.textContent?t.textContent=e:t.innerText=e,"$scanNoChanges"},watchModel:function(){e.$watch(n,r.updateDom)}}},e.d.al.app={priority:2e3,stopBinding:!0},e.d.bo["switch"]={priority:500,ChangeDetector:!0,link:function(e,t,n,r){r.changeDetector.$switch={value:e.$eval(n),on:!1}}},e.d.bo.switchWhen={priority:500,link:function(e,n,r,i){var o;o=i.changeDetector,o.$switch.value!==r?(t.remove(n),i.stopBinding=!0):o.$switch.on=!0}},e.d.bo.switchDefault={priority:500,link:function(e,n,r,i){i.changeDetector.$switch.on&&(t.remove(n),i.stopBinding=!0)}},function(){var n;return n=function(e){var n;return n={priority:700,link:function(n,r,i,o){var a;a=n.$eval(i),!a===e&&(t.remove(r),o.stopBinding=!0)}}},e.d.bo["if"]=n(!0),e.d.bo.ifnot=n(!1)}(),e.d.al.stop={priority:-10,restrict:"AE",stopBinding:!0},e.d.al.include={priority:100,stopBinding:!0,link:function(n,r,i,o){var a,c,l,s,u;return l=null,c=null,u=null,a=null,s={start:function(){s.prepare(),s.watchModel()},prepare:function(){c=r,u=document.createComment(" "+o.attrName+": "+i+" "),t.before(r,u),t.remove(r)},loadHtml:function(e){t.ajax(e)},removeBlock:function(){l&&(l.destroy(),l=null),a&&(s.removeDom(a),a=null)},insertBlock:function(t){a=c.cloneNode(!0),a.innerHTML=t,s.insertDom(u,a),l=o.changeDetector["new"](),e.bind(l,a,{skip_attr:o.skippedAttr()})},updateDom:function(e){return e?void s.loadHtml({cache:!0,url:e,success:function(e){return s.removeBlock(),s.insertBlock(e)},error:s.removeBlock}):void s.removeBlock()},removeDom:function(e){t.remove(e)},insertDom:function(e,n){t.after(e,n)},watchModel:function(){n.$watch(i,s.updateDom)}}}},e.d.al.cloak=function(e,n,r,i){n.removeAttribute(i.attrName),r&&t.removeClass(n,r)},e.d.al.enable=function(e,t,n){var r;r=function(e){e?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")},e.$watch(n,r)},e.d.al.disable=function(e,t,n){var r;r=function(e){e?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")},e.$watch(n,r)},e.d.al.focused=function(e,n,r){var i;return i={updateModel:function(t){e.$getValue(r)!==t&&(e.$setValue(r,t),e.$scan({skipWatch:self.watch}))},onDom:function(){var r,o;o=function(){return i.updateModel(!0)},r=function(){return i.updateModel(!1)},t.on(n,"focus",o),t.on(n,"blur",r),e.$watch("$destroy",function(){return t.off(n,"focus",o),t.off(n,"blur",r)})},updateDom:function(e){return e?n.focus():n.blur(),"$scanNoChanges"},watchModel:function(){self.watch=e.$watch(r,i.updateDom)},start:function(){i.onDom(),i.watchModel()}}},e.d.al.readonly=function(e,t,n){var r;r=function(e){t.readOnly=!!e},e.$watch(n,r,{readOnly:!0})},e.d.al.submit=function(n,r,i){var o;return o={callback:n.$compile(i,{no_return:!0,input:["$event"]}),start:function(){o.onDom()},onDom:function(){t.on(r,"submit",o.doCallback),n.$watch("$destroy",o.offDom)},offDom:function(){t.off(r,"submit",o.doCallback)},doCallback:function(t){t.preventDefault(),t.stopPropagation();try{o.callback(n,t)}catch(a){t=a,e.exceptionHandler(t,"al-submit, error in expression: "+i,{name:i,scope:n,element:r})}n.$scan()}}};var A,B,N,M,O;for(O=["keydown","keypress","keyup","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","focus","blur","change"],A=function(n){return e.d.al[n]=function(r,i,o){var a;return a={start:function(){a.makeCaller(),a.onDom()},makeCaller:function(){a.caller=r.$compile(o,{no_return:!0,input:["$event"]})},onDom:function(){t.on(i,n,a.callback),r.$watch("$destroy",a.offDom)},offDom:function(){t.off(i,n,a.callback)},callback:function(t){try{a.caller(r,t)}catch(c){t=c,e.exceptionHandler(t,n+", error in expression: "+o,{exp:o,scope:r,element:i})}r.$scan()}}}},B=0,M=O.length;M>B;B++)N=O[B],A(N);e.d.al.html={priority:100,stopBinding:!0,link:function(t,n,r,i){var o,a,c;o=i.changeDetector,a=null,c=function(t){return a&&(a.destroy(),a=null),t?(n.innerHTML=t,a=o["new"](),void e.bind(a,n,{skip_attr:i.skippedAttr()})):void(n.innerHTML="")},o.watch(r,c)}},e.d.al.radio={priority:10,link:function(e,n,r,i){var o;return o={start:function(){o.makeValue(),o.onDom(),o.watchModel()},makeValue:function(){var t,n;t=i.takeAttr("al-value"),n=t?e.$eval(t):i.takeAttr("value"),o.value=n},onDom:function(){t.on(n,"change",o.updateModel),e.$watch("$destroy",o.offDom)},offDom:function(){t.off(n,"change",o.updateModel)},updateModel:function(){e.$setValue(r,o.value),e.$scan({skipWatch:o.watch})},watchModel:function(){o.watch=e.$watch(r,o.updateDom)},updateDom:function(e){return n.checked=e===o.value,"$scanNoChanges"}}}},e.d.al.show=function(e,n,r){var i;return i={showDom:function(){t.removeClass(n,"al-hide")},hideDom:function(){t.addClass(n,"al-hide")},updateDom:function(e){return e?i.showDom():i.hideDom(),"$scanNoChanges"},watchModel:function(){e.$watch(r,i.updateDom)},start:function(){i.watchModel()}}},e.d.al.hide=function(t,n,r,i){var o;return o=e.d.al.show(t,n,r,i),o.updateDom=function(e){return e?o.hideDom():o.showDom(),"$scanNoChanges"},o},e.d.al.style=function(e,t,n){var r,i;r={},i=function(e){var n,i,o,a;for(i in r)a=r[i],t.style[i]="";r={},o=e||{};for(n in o)a=o[n],i=n.replace(/(-\w)/g,function(e){return e.substring(1).toUpperCase()}),r[i]=a,t.style[i]=a||""},e.$watch(n,i,{deep:!0})},function(){var n;return window.Map?(n=function(){return this.idByItem=new Map,this.itemById={},this.index=1,this},n.prototype.acquire=function(e){var t;return t="i"+this.index++,this.idByItem.set(e,t),this.itemById[t]=e,t},n.prototype.release=function(e){var t;t=this.itemById[e],delete this.itemById[e],this.idByItem["delete"](t)},n.prototype.replace=function(e,t){var n;n=this.itemById[e],this.idByItem["delete"](n),this.idByItem.set(t,e),this.itemById[e]=t},n.prototype.getId=function(e){return this.idByItem.get(e)},n.prototype.getItem=function(e){return this.itemById[e]||null}):(n=function(){return this.itemById={"i#null":null},this},n.prototype.acquire=function(t){var n;return null===t?"i#null":("object"==typeof t?(n=t.$alite_id,n||(t.$alite_id=n=e.utils.getId())):n=""+t,this.itemById[n]=t,n)},n.prototype.release=function(e){delete this.itemById[e]},n.prototype.replace=function(e,t){this.itemById[e]=t},n.prototype.getId=function(e){return null===e?"i#null":"object"==typeof e?e.$alite_id:""+e},n.prototype.getItem=function(e){return this.itemById[e]||null}),e.d.al.select=function(r,i,o,a){var c,l,s,u;return c=a.changeDetector["new"](),a.stopBinding=!0,c.$select=l=new n,e.bind(c,i,{skip_attr:a.skippedAttr()}),u=c.watch(o,function(e){var t;return t=l.getId(e),t?i.value=t:i.selectedIndex=-1}),c.scan(),s=function(e){var t;return t=l.getItem(e.target.value),c.setValue(o,t),c.scan({skipWatch:u})},t.on(i,"input",s),t.on(i,"change",s),c.watch("$destroy",function(){return t.off(i,"input",s),t.off(i,"change",s)})},e.d.al.option=function(t,n,r,i){var o,a,c,l,s,u;for(o=u=i.changeDetector,a=l=0;4>=l&&!(s=u.$select);a=++l)u=u.parent||{};return s?(c=null,o.watch(r,function(e){c?s.getId(e)!==c?(s.release(c),c=s.acquire(e),n.value=c):s.replace(c,e):(c=s.acquire(e),n.value=c)}),void o.watch("$destroy",function(){return s.release(c)})):void e.exceptionHandler("","Error in al-option - al-select is not found",{cd:o,scope:o.scope,element:n,value:r})}}(),e.d.al.ctrl={global:!1,stopBinding:!0,priority:500,link:function(t,n,r,i){var o,a;return o=function(o,a){e.exceptionHandler(o,a,{name:r,env:i,scope:t,element:n})},a={getController:function(n){var r,i;return r=t.$ns,r&&r.ctrl&&(i=r.ctrl[n],!i&&!r.inheritGlobal)?void o("","Controller not found in $ns: "+n):(i||(i=e.ctrl[n],!i&&e.d.al.ctrl.global&&(i=window[n])),i||o("","Controller not found: "+n),i)},start:function(){var c,l,s,u,p,f,h,d;if(r){if(u=a.getController(r),!u)return}else u=null;if(u&&Object.keys(u.prototype).length){c=function(){},f=v.prototype;for(p in f)d=f[p],c.prototype[p]=d;h=u.prototype;for(p in h)d=h[p],c.prototype[p]=d;l=e.Scope({$parent:t,customScope:new c})}else l=e.Scope({$parent:t,childFromChangeDetector:i.changeDetector});try{u&&u.call(l,l,n,r,i)}catch(m){s=m,o(s,"Error in controller: "+r)}e.bind(l,n,{skip_attr:i.skippedAttr()})}}}},e.filters.slice=function(e,t,n){var r,i,o,a,c,l;return l=null,r=null,i=null,a=null,c=function(){return l&&a?n.setValue(2===a?l.slice(r,i):l.slice(r)):void 0},o=e.split(","),1===o.length?t.$watch(e,function(e){return a=1,r=e,c()}):t.$watch(o[0]+" + '_' + "+o[1],function(e){var t;return a=2,t=e.split("_"),r=Number(t[0]),i=Number(t[1]),c()}),this.onChange=function(e){return l=e,c()},this},e.filters.slice.prototype.ext=!0,function(){var t,n;return t=function(e){return 10>e?"0"+e:""+e},n=function(e,n){var r,i,o,a,c;if(!n)return"";for(n=new Date(n),c=[[/yyyy/g,n.getFullYear()],[/mm/g,t(n.getMonth()+1)],[/dd/g,t(n.getDate())],[/HH/g,t(n.getHours())],[/MM/g,t(n.getMinutes())],[/SS/g,t(n.getSeconds())]],a=e,i=0,o=c.length;o>i;i++)r=c[i],a=a.replace(r[0],r[1]);return a},e.filters.date=function(e,t){return n(t,e)}}();var E;e.filters.json=E=function(){function t(){}return t.prototype.watchMode="deep",t.prototype.onChange=function(t){return this.setValue(JSON.stringify(e.utils.clone(t),null,4))},t}();var j;e.filters.filter=j=function(){function e(e,t,n){var r,i;i=this,r=null,this.value=[],this.doFiltering=function(){var e,t,o,a,c,l,s;if(t=r,!t)return n.setValue(i.value),null;if("string"==typeof t)t={__all:t};else if("object"!=typeof t)return n.setValue(i.value),null;return l=function(){var n,r,l,u;for(l=i.value,u=[],n=0,r=l.length;r>n;n++)if(c=l[n],"object"==typeof c){if(o=!0,t.__all){o=!1,e=t.__all.toLowerCase();for(a in c)if(s=c[a],"$alite_id"!==a&&(""+s).toLowerCase().indexOf(e)>=0){o=!0;break}if(!o)continue}for(a in t)if(s=t[a],"__all"!==a){if(e=c[a],!e){o=!1;break}if((""+e).toLowerCase().indexOf((""+s).toLowerCase())<0){o=!1;break}}if(!o)continue;u.push(c)}else{if(!t.__all)continue;if(e=t.__all.toLowerCase(),(""+c).toLowerCase().indexOf(e)<0)continue;u.push(c)}return u}(),n.setValue(l),null},t.$watch(e,function(e){return r=e,i.doFiltering()},{deep:!0})}return e.prototype.onChange=function(e){return this.value=e,this.doFiltering()},e}();var L;e.filters.orderBy=L=function(){function e(e,t){var n;this.list=null,this.key="key",this.direction=1,n=e.split(","),n[0]&&t.$watch(n[0].trim(),function(e){return function(t){return e.key=t,e.doSort()}}(this)),n[1]&&t.$watch(n[1].trim(),function(e){return function(t){return e.direction=t?1:-1,e.doSort()}}(this))}return e.prototype.doSort=function(){return this.list instanceof Array?(this.list.sort(this.sortFn.bind(this)),this.setValue(this.list)):void 0},e.prototype.sortFn=function(e,t){var n,r;return n=e[this.key]||null,r=t[this.key]||null,r>n?-this.direction:n>r?this.direction:0},e.prototype.onChange=function(e){return this.list=e instanceof Array?e.slice():null,this.doSort()},e}();var V;e.filters.throttle=V=function(){function e(e,t,n){var r;e=Number(e),r=null,this.onChange=function(i){return r&&clearTimeout(r),r=setTimeout(function(){return r=null,n.setValue(i),t.$scan()},e)}}return e.prototype.ext=!0,e}();var F;return e.filters.toArray=F=function(){function e(e,t,n){var r,i,o,a;if(e){if(r=e.split(","),2!==r.length)throw"Wrong filter arguments for toArray";i=r[0].trim(),a=r[1].trim()}else i="key",a="value";o=[],this.onChange=function(e){var t,c;o.length=0;for(t in e)c=e[t],r={},r[i]=t,r[a]=c,o.push(r);return n.setValue(o)}}return e.prototype.watchMode="deep",e}(),e.filters.storeTo=function(e,t,n){return n.$setValue(t,e),e},e.text["="]=function(t,n,r,i){var o;if(o=e.utils.compile.expression(n),o.filters)throw"Conflict: bindonce and filters, use one-time binding";i["finally"](o.fn(r))},e.text["::"]=function(e,t,n,r){n.$watch(t,function(e){return r["finally"](e)},{oneTime:!0})},e.text["&"]=function(e,t,n){var r,i;return r=t.split(":"),i=n.$compile(r[1],{input:["$value"]}),n.$watch(r[0],function(t){var r;return r=i(n,t),window.Promise&&r instanceof Promise?r.then(function(t){return e(t),n.$scan()}):e(r)})},e}var t=e();t.makeInstance=e,"function"==typeof define?define(function(){return t}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t:"function"==typeof alightInitCallback?alightInitCallback(t):(t.d.al.ctrl.global=!0,window.alight=t,t.f$.ready(t.bootstrap))}();