/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
imagelinks-interactive-image-builder-lite
/
assets
/
js
/
Upload File
HOME
!function(y){"use strict";Object.is||(Object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),"function"!=typeof DataTransfer.prototype.setDragImage&&(DataTransfer.prototype.setDragImage=function(e,t,n){});var t,i,o=o||function(l){if(!(void 0===l||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=l.document,s=function(){return l.URL||l.webkitURL||l},c=e.createElementNS("http://www.w3.org/1999/xhtml","a"),u="download"in c,p=/constructor/i.test(l.HTMLElement),d=/CriOS\/[\d]+/.test(navigator.userAgent),f=function(e){(l.setImmediate||l.setTimeout)(function(){throw e},0)},h=function(e){setTimeout(function(){"string"==typeof e?s().revokeObjectURL(e):e.remove()},4e4)},m=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},i=function(e,n,t){t||(e=m(e));var i,a=this,o="application/octet-stream"===e.type,r=function(){!function(e,t,n){for(var i=(t=[].concat(t)).length;i--;){var a=e["on"+t[i]];if("function"==typeof a)try{a.call(e,n||e)}catch(e){f(e)}}}(a,"writestart progress write writeend".split(" "))};if(a.readyState=a.INIT,u)return i=s().createObjectURL(e),void setTimeout(function(){var e,t;c.href=i,c.download=n,e=c,t=new MouseEvent("click"),e.dispatchEvent(t),r(),h(i),a.readyState=a.DONE});!function(){if((d||o&&p)&&l.FileReader){var t=new FileReader;return t.onloadend=function(){var e=d?t.result:t.result.replace(/^data:[^;]*;/,"data:attachment/file;");l.open(e,"_blank")||(l.location.href=e),e=void 0,a.readyState=a.DONE,r()},t.readAsDataURL(e),a.readyState=a.INIT}i||(i=s().createObjectURL(e)),o?l.location.href=i:l.open(i,"_blank")||(l.location.href=i);a.readyState=a.DONE,r(),h(i)}()},t=i.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return t=t||e.name||"download",n||(e=m(e)),navigator.msSaveOrOpenBlob(e,t)}:(t.abort=function(){},t.readyState=t.INIT=0,t.WRITING=1,t.DONE=2,t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null,function(e,t,n){return new i(e,t||e.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=o:"undefined"!=typeof define&&null!==define&&null!==define.amd&&define([],function(){return o}),function(e){var t;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,i=window.Cookies=e();i.noConflict=function(){return window.Cookies=n,i}}}(function(){function l(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function c(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function e(s){function r(){}function n(e,t,n){if("undefined"!=typeof document){"number"==typeof(n=l({path:"/"},r.defaults,n)).expires&&(n.expires=new Date(1*new Date+864e5*n.expires)),n.expires=n.expires?n.expires.toUTCString():"";try{var i=JSON.stringify(t);/^[\{\[]/.test(i)&&(t=i)}catch(e){}t=s.write?s.write(t,e):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var o in n)n[o]&&(a+="; "+o,!0!==n[o]&&(a+="="+n[o].split(";")[0]));return document.cookie=e+"="+t+a}}function t(e,t){if("undefined"!=typeof document){for(var n={},i=document.cookie?document.cookie.split("; "):[],a=0;a<i.length;a++){var o=i[a].split("="),r=o.slice(1).join("=");t||'"'!==r.charAt(0)||(r=r.slice(1,-1));try{var l=c(o[0]);if(r=(s.read||s)(r,l)||c(r),t)try{r=JSON.parse(r)}catch(e){}if(n[l]=r,e===l)break}catch(e){}}return e?n[e]:n}}return r.set=n,r.get=function(e){return t(e,!1)},r.getJSON=function(e){return t(e,!0)},r.remove=function(e,t){n(e,"",l(t,{expires:-1}))},r.defaults={},r.withConverter=e,r}(function(){})}),y("#imagelinks-app-items").length?y(".imagelinks .imagelinks-toggle").on("click touchend",function(e){e.stopPropagation(),e.preventDefault();var t=y(this),n=t.data("id"),i=null;if(!t.hasClass("imagelinks-locked")){t.addClass("imagelinks-readonly"),i=t.hasClass("imagelinks-checked")?(t.removeClass("imagelinks-checked").addClass("imagelinks-unchecked"),!1):(t.removeClass("imagelinks-unchecked").addClass("imagelinks-checked"),!0);var a=imagelinks_globals.ajax_url,o=imagelinks_globals.ajax_nonce,r=imagelinks_globals.ajax_action_update,l=imagelinks_globals.ajax_msg_error,s={id:n,active:i},c=y.extend(!0,{},s);c=JSON.stringify(c),y.ajax({url:a,type:"POST",dataType:"json",data:{nonce:o,action:r,config:c}}).done(function(e){e&&!e.success&&(i?t.removeClass("imagelinks-checked").addClass("imagelinks-unchecked"):t.removeClass("imagelinks-unchecked").addClass("imagelinks-checked"))}).fail(function(){console.log(l)}).always(function(){t.removeClass("imagelinks-readonly")})}}):y("#imagelinks-app-item").length?(i={alight:null,rootScope:null,wpFileFrameImage:null,wp_base_url:null,wp_upload_url:null,wp_plugin_url:null,wp_ajax_url:null,wp_ajax_nonce:null,wp_ajax_action_update:null,wp_ajax_action_get:null,wp_ajax_action_modal:null,wp_ajax_action_template_save:null,wp_ajax_action_template_delete:null,wp_ajax_msg_error:null,wp_item_id:null,themes:null,import_items:!1,image:new Image,settings:{themeJavaScript:null,themeCSS:null},config:null,ui:{fullscreen:!1,sidebar:!0,sidebarWidth:400,canvas:{zoomStep:.1,zoom:1,x:0,y:0},moveCanvas:{initX:null,initY:null,lastX:null,lastY:null},sidebarResize:{initX:null,lastX:null,width:null},mapMarkers:new Map,activeMarker:null,activeMarkerWatch:null,editMarker:{type:null,initX:null,initY:null,lastX:null,lastY:null,centerX:null,centerY:null,rotation:0,markerAngle:null,markerX:null,markerY:null,markerWidth:null,markerHeight:null},tabs:{general:!0,markers:!1,customCSS:!1,customJS:!1,shortcode:!1},markerTabs:{marker:!0,tooltip:!1},borderTabs:{all:!0,top:!1,right:!1,bottom:!1,left:!1},markerSections:{general:!1,data:!0,appearance:!0,animation:!0,special:!0},tooltipSections:{data:!1,appearance:!0,animation:!0}},defaultConfig:{active:!0,title:null,image:{relative:!1,url:null},imageWidth:0,imageHeight:0,autoWidth:!0,autoHeight:!0,containerWidth:null,containerHeight:null,theme:"light",class:null,background:{color:null,image:{relative:!1,url:null},size:null,repeat:null,position:null},customCSS:{active:!1,data:null},customJS:{active:!1,data:null},markers:[]},defaultMarker:{title:null,data:null,x:0,y:0,autoWidth:!1,autoHeight:!1,width:100,height:100,angle:0,link:null,linkNewWindow:!1,userData:null,lock:!1,visible:!0,responsive:!0,noevents:!1,className:null,view:{icon:{name:null,label:null,size:{value:14,type:"px"},color:"#ffffff",margin:{all:{value:null,type:"px"},top:{value:null,type:"px"},right:{value:null,type:"px"},bottom:{value:null,type:"px"},left:{value:null,type:"px"}}},background:{color:null,image:{relative:!1,url:null},size:"contain",repeat:"no-repeat",position:"50% 50%"},border:{all:{active:!1,width:{value:1,type:"px"},style:"solid",color:"#000000"},top:{active:!1,width:{value:1,type:"px"},style:"solid",color:"#000000"},right:{active:!1,width:{value:1,type:"px"},style:"solid",color:"#000000"},bottom:{active:!1,width:{value:1,type:"px"},style:"solid",color:"#000000"},left:{active:!1,width:{value:1,type:"px"},style:"solid",color:"#000000"},radius:{all:{value:null,type:"px"},topLeft:{value:null,type:"px"},topRight:{value:null,type:"px"},bottomRight:{value:null,type:"px"},bottomLeft:{value:null,type:"px"}}},pulse:{active:!1,color:"#ffffff",duration:1700},customCSS:{id:null,data:null}},tooltip:{active:!1,data:null,placement:"top",offset:{x:0,y:0},width:null,widthFromCSS:!1,trigger:"hover",followCursor:!1,responsive:!1,interactive:!0,smart:!1,showOnInit:!1,showAnimation:null,hideAnimation:null,duration:null,className:null}},fn:{init:function(a){a.fn.enableLoading(a);var e=y("#imagelinks-app-item");if(e.removeAttr("style"),e.on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",y.proxy(a.fn.onFullScreenChange,this,a)),y(window).on("resize",y.proxy(a.fn.onResize,this,a)),a.plan=imagelinks_globals.plan,a.wp_base_url=imagelinks_globals.wp_base_url,a.wp_upload_url=imagelinks_globals.upload_base_url,a.wp_plugin_url=imagelinks_globals.plugin_base_url,a.wp_ajax_url=imagelinks_globals.ajax_url,a.wp_ajax_nonce=imagelinks_globals.ajax_nonce,a.wp_ajax_action_update=imagelinks_globals.ajax_action_update,a.wp_ajax_action_get=imagelinks_globals.ajax_action_get,a.wp_ajax_action_modal=imagelinks_globals.ajax_action_modal,a.wp_ajax_action_template_save=imagelinks_globals.ajax_action_template_save,a.wp_ajax_action_template_delete=imagelinks_globals.ajax_action_template_delete,a.wp_ajax_msg_error=imagelinks_globals.ajax_msg_error,a.msg_pro_title=imagelinks_globals.msg_pro_title,a.msg_edit_text=imagelinks_globals.msg_edit_text,a.msg_custom_js_error=imagelinks_globals.msg_custom_js_error,a.wp_item_id=imagelinks_globals.ajax_item_id,imagelinks_globals.config){for(var t=y.extend(!0,{},a.defaultConfig,JSON.parse(imagelinks_globals.config)),n=0;n<t.markers.length;n++)t.markers[n]=y.extend(!0,{},a.defaultMarker,t.markers[n]);a.config=t}if(imagelinks_globals.settings&&(t=y.extend(!0,{},JSON.parse(imagelinks_globals.settings))))for(var i in t)a.settings.hasOwnProperty(i)&&(a.settings[i]=t[i]);a.image.onload=function(e){var t=y("#imagelinks-markers-image"),n=this;a.config.imageWidth=n.width,a.config.imageHeight=n.height,t.css({"background-image":"url("+n.src+")",width:n.width,height:n.height}),t.get(0).offsetHeight,a.fn.canvasZoomFit(a),a.rootScope.scan()},a.image.onerror=function(e){var t=y("#imagelinks-markers-image");a.config.imageWidth=0,a.config.imageHeight=0,t.css({"background-image":"url("+this.src+")",width:0,height:0}),a.fn.canvasZoomFit(a),a.rootScope.scan()},a.rootScope.watch("appData.config.image",function(e){var t=a.fn.getImageUrl(a,e);a.image.src="",a.image.src=t},{deep:2}),a.rootScope.watch("appData.ui.canvas",function(e){y("#imagelinks-markers-canvas").css({transform:"translate3d("+e.x+"px,"+e.y+"px,0) scale("+e.zoom+")"})},{deep:2}),a.rootScope.watch("appData.ui.activeMarker",function(i,e){a.ui.activeMarkerWatch&&(a.ui.activeMarkerWatch.stop(),a.ui.activeMarkerWatch=null),e&&(y("#wp-imagelinks-tooltip-editor-wrap").hasClass("html-active")?e.tooltip.data=y("#imagelinks-tooltip-editor").val():null!==(t=tinyMCE.get("imagelinks-tooltip-editor"))&&(e.tooltip.data=t.getContent()));var t,n=i&&i.tooltip.data?i.tooltip.data:"";y("#wp-imagelinks-tooltip-editor-wrap").hasClass("html-active")?y("#imagelinks-tooltip-editor").val(n):null!==(t=tinyMCE.get("imagelinks-tooltip-editor"))&&t.setContent(n),i&&(a.ui.activeMarkerWatch=a.rootScope.watch("appData.ui.activeMarker.view",function(e,t){var n=a.ui.mapMarkers.get(i);a.fn.setMarkerView(a,i,n)},{deep:5}))}),a.fn.loadData(a,"themes").done(function(e){a.themes=e.list}).always(function(){a.rootScope.scan(),a.fn.disableLoading(a)}),a.fn.loadData(a,"import-items-count").done(function(e){a.import_items=0<e.count})},enableLoading:function(e){y("#imagelinks-app-item").removeClass("imagelinks-active")},disableLoading:function(e){setTimeout(function(){y("#imagelinks-app-item").addClass("imagelinks-active")},1e3)},loadData:function(i,e,t){var a=y.Deferred();return y.ajax({url:i.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:i.wp_ajax_nonce,action:i.wp_ajax_action_get,type:e,id:t},success:function(e){e&&e.success?a.resolve(e.data):this.error()},error:function(e,t,n){i.fn.showNotice(i,i.wp_ajax_msg_error,"notice-error"),a.resolve(null)}}),a.promise()},preview:function(e){e.wp_item_id&&window.open(e.wp_base_url+"?imagelinks="+e.wp_item_id,"_blank")},getPluginConfig:function(t){var e={};e.title=t.config.title,e.imgSrc=t.fn.getImageUrl(t,t.config.image),!t.config.autoWidth&&t.config.containerWidth&&(e.width=t.config.containerWidth),!t.config.autoHeight&&t.config.containerHeight&&(e.height=t.config.containerHeight),e.theme=t.config.theme,e.className=t.config.class,e.flags={customCSS:t.config.customCSS.active,fontawesome:!1,effects:!1};for(var n=[],i=0;i<t.config.markers.length;i++){var a=t.config.markers[i];a.visible&&(a.view.icon.name&&(e.flags.fontawesome=!0),(a.tooltip.showAnimation||a.tooltip.hideAnimation)&&(e.flags.effects=!0),n.push({title:a.title,x:t.config.imageWidth?a.x/(t.config.imageWidth/2)*100:0,y:t.config.imageHeight?a.y/(t.config.imageHeight/2)*100:0,autoWidth:a.autoWidth,autoHeight:a.autoHeight,width:a.width,height:a.height,angle:a.angle,link:a.link,linkNewWindow:a.linkNewWindow,responsive:a.responsive,noevents:a.noevents,className:a.className,userData:a.userData,tooltip:{active:a.tooltip.active,placement:a.tooltip.placement,offset:{x:a.tooltip.offset.x,y:a.tooltip.offset.y},width:a.tooltip.width,widthFromCSS:a.tooltip.widthFromCSS,trigger:a.tooltip.trigger,followCursor:a.tooltip.followCursor,responsive:a.tooltip.responsive,interactive:a.tooltip.interactive,smart:a.tooltip.smart,showOnInit:a.tooltip.showOnInit,showAnimation:a.tooltip.showAnimation,hideAnimation:a.tooltip.hideAnimation,duration:a.tooltip.duration,className:a.tooltip.className}}))}if(e.markers=0<n.length?n:null,t.config.customJS.active){e.onLoad=t.config.customJS.data;try{new Function(e.onLoad)}catch(e){t.fn.showNotice(t,t.msg_custom_js_error+": "+e.message,"notice-error")}}return e},saveConfig:function(t){t.fn.enableLoading(t),t.fn.saveEditorsData(t);var e=y.extend(!0,{},t.config),n=JSON.stringify(e),i=t.fn.getPluginConfig(t),a=JSON.stringify(i);y.ajax({url:t.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:t.wp_ajax_nonce,action:t.wp_ajax_action_update,id:t.wp_item_id,data:n,config:a}}).done(function(e){if(e)return t.wp_item_id=e.data.id,t.fn.showNotice(t,e.data.msg,e.success?"notice-success":"notice-error"),void t.rootScope.scan();t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).fail(function(){t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).always(function(){t.fn.disableLoading(t)})},loadConfigFromJson:function(e,t){if(t){var n=JSON.parse(t);e.config=y.extend(!0,{},n),e.rootScope.scan()}},loadConfigFromFile:function(e){var t=y("#imagelinks-load-config-from-file").off("change");t.one("change",y.proxy(function(n,e){var t=e.target.files[0];if(e.target.value="",t){var i=new FileReader;i.onload=y.proxy(function(e){var t=e.target.result;n.fn.loadConfigFromJson(n,t)},this),i.readAsText(t)}},this,e)),t.click()},saveConfigToFile:function(e){var t=y.extend(!0,{},e.config),n=JSON.stringify(t),i=e.wp_item_id?"imagelinks_config_"+e.wp_item_id+".json":"imagelinks_config.json",a=new File([n],i,{type:"application/json;charset=utf-8"});o(a)},selectImportItem:function(t){var n={importItems:null,selectedImportItem:null,fn:{onClickItem:function(e,t,n,i){var a=y("#imagelinks-modal-"+e.id),o=y(n);a.find(".imagelinks-import-item.imagelinks-active").removeClass("imagelinks-active"),o.addClass("imagelinks-active"),e.selectedImportItem=i},onDblClickItem:function(e){e.deferred.resolve(!0)}}};t.modal.fn.show(t,"import-items",n,t.fn.selectImportItemCallback).then(function(e){t.modal.fn.close(t,n.id),"close"!=e&&e&&n.selectedImportItem&&t.fn.importItem(t,n.selectedImportItem)})},selectImportItemCallback:function(t){t.appData.fn.loadData(i,"import-items").done(function(e){t.importItems=e.list,t.rootScope.scan(),y("#imagelinks-modal-"+t.id).find(".imagelinks-modal-data").removeClass("imagelinks-modal-loading")})},importItem:function(s,e){s.fn.enableLoading(s),s.fn.loadData(s,"import-item",e.id).done(function(r){if(s.config=y.extend(!0,{},s.defaultConfig),s.rootScope.scan(),s.config.title=e.title,s.config.theme="light",s.config.image={url:r.item.imageUrl,relative:r.item.imageUrlLocal},r.item.hotSpots){var l=new Image;l.onload=l.onerror=function(e){for(var t=l.width?l.width:0,n=l.height?l.height:0,i=0;i<r.item.hotSpots.length;i++){var a=r.item.hotSpots[i],o=y.extend(!0,{},s.defaultMarker);o.x=(a.x-.5)*t,o.y=(a.y-.5)*n,a.imageUrl?(o.width=a.imageWidth?a.imageWidth:0,o.height=a.imageHeight?a.imageHeight:0,o.view.background.image={url:a.imageUrl,relative:!1}):(o.width=48,o.height=48,o.view.background.image={url:s.wp_plugin_url+"assets/images/bubles.png",relative:!1},o.view.background.size="none",o.view.background.repeat="no-repeat",o.className="imgl-bubble-pulse"),o.link=a.link,o.linkNewWindow=a.linkNewWindow,a.className&&(o.className=a.className),a.content&&(o.userData=a.content),a.popover&&(o.tooltip.active=a.popover,o.tooltip.data=a.popoverContent,o.tooltip.placement=a.popoverPlacement,o.tooltip.showOnInit=a.popoverShow),s.config.markers.push(o)}s.rootScope.scan()},l.src=s.fn.getImageUrl(s,s.config.image)}r.item.customCSS&&(s.config.customCSS={active:r.item.customCSS,data:r.item.customCSSContent}),r.item.customJS&&(s.config.customJS={active:r.item.customJS,data:r.item.customJSContent})}).always(function(){s.rootScope.scan(),s.fn.disableLoading(s)})},showNotice:function(e,t,n){var i=y("#imagelinks-messages"),a=y("<div></div>").addClass("notice is-dismissible").addClass(n),o=y("<p></p>").html(t),r=y("<button></button>").attr("type","button").addClass("notice-dismiss").html('<span class="screen-reader-text">Dismiss this notice.</span>');function l(){clearTimeout(a.data("timer")),a.fadeTo(100,0,function(){a.slideUp(100,function(){a.remove()})})}a.data("timer",setTimeout(l,5e3)),r.click(function(e){e.preventDefault(),l()}),a.append(o,r),i.append(a)},createBlob:function(e,t,n){return new Blob([t],{type:n})},createObjectURL:function(e,t,n){var i=e.fn.createBlob(e,t,n);return URL.createObjectURL(i)},getImageUrl:function(e,t,n){var i="";return t&&t.url&&0<t.url.length&&(i=t.relative?e.wp_upload_url+t.url:t.url,"style"==n&&(i="url("+i+")")),i},selectImage:function(n,i,a){n.wpFileFrameImage&&(n.wpFileFrameImage.detach(),n.wpFileFrameImage=null),n.wpFileFrameImage=wp.media.frames.file_frame=wp.media({library:{type:["image"]},multiple:!1}),n.wpFileFrameImage.on("select",function(e){var t=n.wpFileFrameImage.state().get("selection").first().toJSON().url;-1!==t.indexOf(n.wp_upload_url)?(t=t.replace(n.wp_upload_url,""),a.relative=!0):a.relative=!1,a.url=t,i.scan()}),n.wpFileFrameImage.open()},saveEditorsData:function(e){if(e.ui.activeMarker)if(y("#wp-imagelinks-tooltip-editor-wrap").hasClass("html-active"))e.ui.activeMarker.tooltip.data=y("#imagelinks-tooltip-editor").val();else{var t=tinyMCE.get("imagelinks-tooltip-editor");null!==t&&(e.ui.activeMarker.tooltip.data=t.getContent())}var n=y("#imagelinks-notepad-css");if(n.length){var i=ace.edit(n.get(0));e.config.customCSS.data=i.getSession().getValue()}var a=y("#imagelinks-notepad-js");if(a.length){var o=ace.edit(a.get(0));e.config.customJS.data=o.getSession().getValue()}},onTab:function(e,t){if(!e.ui.tabs[t]){var n=e.ui.tabs;for(var i in n)n.hasOwnProperty(i)&&(n[i]=!1);switch(e.ui.tabs[t]=!0,e.fn.saveEditorsData(e),e.rootScope.scan(),t){case"general":case"markers":break;case"customCSS":var a=y("#imagelinks-notepad-css"),o=ace.edit(a.get(0));o.$blockScrolling=1/0,o.setTheme("ace/theme/monokai"),o.session.setMode("ace/mode/css"),e.settings.themeCSS&&o.setTheme("ace/theme/"+e.settings.themeCSS),e.config.customCSS.data&&o.getSession().setValue(e.config.customCSS.data);break;case"customJS":var r=y("#imagelinks-notepad-js"),l=ace.edit(r.get(0));l.$blockScrolling=1/0,l.setTheme("ace/theme/monokai"),l.session.setMode("ace/mode/javascript"),e.settings.themeJavaScript&&l.setTheme("ace/theme/"+e.settings.themeJavaScript),e.config.customJS.data&&l.getSession().setValue(e.config.customJS.data)}}},onGeneralTab:function(e,t){e.ui.generalTab[t]=!e.ui.generalTab[t]},onBorderTab:function(e,t){if(!e.ui.borderTabs[t]){var n=e.ui.borderTabs;for(var i in n)n.hasOwnProperty(i)&&(n[i]=!1);e.ui.borderTabs[t]=!0}},onMarkerTab:function(e,t){if(!e.ui.markerTabs[t]){var n=e.ui.markerTabs;for(var i in n)n.hasOwnProperty(i)&&(n[i]=!1);e.ui.markerTabs[t]=!0}},onMarkerSection:function(e,t){e.ui.markerSections[t]=!e.ui.markerSections[t]},onTooltipSection:function(e,t){e.ui.tooltipSections[t]=!e.ui.tooltipSections[t]},onResize:function(e,t){},onFullScreenChange:function(e,t){document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement?(y("#imagelinks-app-item").addClass("imagelinks-fullscreen"),e.ui.fullscreen=!0):(y("#imagelinks-app-item").removeClass("imagelinks-fullscreen"),e.ui.fullscreen=!1),e.rootScope.scan()},toggleFullscreen:function(e){if(e.ui.fullscreen)try{document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}catch(e){console.error("The browser does not support the fullscreen API")}else try{var t=y("#imagelinks-app-item").get(0);t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}catch(e){console.error("The browser does not support the fullscreen API")}},toggleSidebarPanel:function(e){e.ui.sidebar=!e.ui.sidebar,e.rootScope.scan()},canvasZoomIn:function(e){var t=e.ui.canvas.zoom+e.ui.canvas.zoomStep;t=parseFloat(parseFloat(t).toFixed(2)),e.ui.canvas.zoom=t},canvasZoomOut:function(e){var t=e.ui.canvas.zoom-e.ui.canvas.zoomStep;t=parseFloat(parseFloat(t).toFixed(2)),e.ui.canvas.zoom=t<0?0:t},canvasZoomDefault:function(e){e.ui.canvas.zoom=1},canvasZoomFit:function(e){var t=y("#imagelinks-markers-image"),n=y("#imagelinks-markers-canvas-wrap"),i=t.width()?n.width()/t.width():0,a=t.height()?n.height()/t.height():0,o=1;o=a<i?a:i,e.ui.canvas.zoom=o,e.ui.canvas.x=e.ui.canvas.y=0},canvasMoveDefault:function(e){e.ui.canvas.x=0,e.ui.canvas.y=0},getCanvasZoom:function(e){var t=parseFloat(parseFloat(100*e.ui.canvas.zoom).toFixed(2));return parseInt(t,10)},initMarker:function(e,t,n){var i=y(n);e.ui.mapMarkers.set(t,i),e.fn.setMarkerView(e,t,i)},selectMarker:function(e,t){e.ui.activeMarker=t,e.rootScope.scan();var n=e.ui.mapMarkers.get(t);if(n){var i=window.scrollX,a=window.scrollY;n.focus(),window.scrollTo(i,a)}},isMarkerActive:function(e,t){return Object.is(e.ui.activeMarker,t)},onMarkerItemClick:function(e,t){e.fn.isMarkerActive(e,t)?(e.ui.activeMarker=null,e.ui.activeMarkerWatch&&(e.ui.activeMarkerWatch.stop(),e.ui.activeMarkerWatch=null)):e.fn.selectMarker(e,t)},onMarkerClick:function(e,t){e.fn.isMarkerActive(e,t)||e.fn.selectMarker(e,t)},prevMarker:function(e){if(0!=e.config.markers.length)if(e.ui.activeMarker){for(var t=e.config.markers.length-1;0<t&&!Object.is(e.config.markers[t],e.ui.activeMarker);t--);t=t-1<0?e.config.markers.length-1:t-1,e.fn.selectMarker(e,e.config.markers[t])}else 0<e.config.markers.length&&e.fn.selectMarker(e,e.config.markers[e.config.markers.length-1])},nextMarker:function(e){if(0!=e.config.markers.length)if(e.ui.activeMarker){for(var t=0;t<e.config.markers.length&&!Object.is(e.config.markers[t],e.ui.activeMarker);t++);t=t+1>=e.config.markers.length?0:t+1,e.fn.selectMarker(e,e.config.markers[t])}else 0<e.config.markers.length&&e.fn.selectMarker(e,e.config.markers[0])},editMarker:function(t,n){var i={marker:y.extend(!0,{},n),markerWatch:null,fn:{initMarker:function(e,t){e.$marker=y(t)}}};t.modal.fn.show(t,"marker-view",i,t.fn.editMarkerCallback).then(function(e){i.markerWatch&&(i.markerWatch.stop(),i.markerWatch=null),t.modal.fn.close(t,i.id),"close"!=e&&e&&(t.fn.assignObject(t,i.marker,n),t.rootScope.scan())})},editMarkerCallback:function(t){function n(e,t){e.appData.fn.setMarkerView(e.appData,t,e.$marker);var n=y("#imagelinks-modal-"+e.id),i=n.find(".imagelinks-marker-canvas-wrap"),a=n.find(".imagelinks-marker-canvas"),o=n.find(".imagelinks-marker-wrap"),r=a.height()/i.height(),l=a.width()/i.width();if(1<r||1<l){var s=1/(l<r?r:l);o.css({transform:"scale("+s+")"})}else o.css({transform:""})}t.markerWatch=t.rootScope.watch("modalData.marker",function(e){n(t,e)},{deep:6}),n(t,t.marker)},addMarker:function(e){e.fn.selectMarkerTemplate(e,e.rootScope)},selectMarkerTemplate:function(a,e){var n={templates:null,selectedTemplate:null,fn:{initMarker:function(e,t,n){var i=y(n);a.fn.setMarkerView(a,t.data,i)},onClick:function(e,t,n,i){var a=y("#imagelinks-modal-"+e.id),o=y(n);a.find(".imagelinks-marker-template-wrap.imagelinks-active").removeClass("imagelinks-active"),o.addClass("imagelinks-active"),e.selectedTemplate=i},onDblClick:function(e){e.deferred.resolve(!0)},deleteTemplate:function(a,o){var r=y("#imagelinks-modal-"+a.id);r.find(".imagelinks-modal-data").addClass("imagelinks-modal-loading"),a.appData.fn.deleteMarkerTemplate(a.appData,o.name).done(function(e){if(e){for(var t=null,n=a.templates.length,i=0;i<n;i++)if(Object.is(o,a.templates[i])){t=i;break}if(null==t)return;a.templates.splice(t,1),a.rootScope.scan()}r.find(".imagelinks-modal-data").removeClass("imagelinks-modal-loading")})}}};a.modal.fn.show(a,"marker-templates",n,a.fn.selectMarkerTemplateCallback).then(function(e){if(a.modal.fn.close(a,n.id),"close"!=e&&e&&n.selectedTemplate){var t=n.selectedTemplate.data;a.config.markers.push(t),a.fn.selectMarker(a,t)}})},selectMarkerTemplateCallback:function(n){n.appData.fn.loadData(i,"templates").done(function(e){e.list.unshift({name:null,data:y.extend(!0,{},i.defaultMarker),predefined:!0}),n.templates=e.list,n.rootScope.scan();var t=y("#imagelinks-modal-"+n.id);t.find(".imagelinks-modal-data").removeClass("imagelinks-modal-loading"),t.find(".imagelinks-marker-template-wrap").each(function(e,t){var n=y(t),i=n.find(".imagelinks-marker-template"),a=n.find(".imagelinks-marker-wrap"),o=i.height()/n.height(),r=i.width()/n.width();if(1<o||1<r){var l=1/(r<o?o:r);a.css({transform:"scale("+l+")"})}else a.css({transform:""})})})},copyMarker:function(e){if(null!=e.ui.activeMarker){for(var t=null,n=e.config.markers.length,i=null,a=0;a<n;a++)if(i=e.config.markers[a],Object.is(e.ui.activeMarker,i)){t=a;break}null!=t&&((i=y.extend(!0,{},i)).title=(i.title?i.title:"")+" [copy]",e.config.markers.splice(t+1,0,i),e.fn.selectMarker(e,i))}},updownMarker:function(e,t){if(null!=e.ui.activeMarker){for(var n=null,i=e.config.markers.length,a=null,o=0;o<i;o++)if(a=e.config.markers[o],Object.is(e.ui.activeMarker,a)){n=o;break}if(null!=n)if("up"==t&&0<n)e.config.markers[n]=e.config.markers[n-1],e.config.markers[n-1]=a,n-=1;else{if(!("down"==t&&n<i-1))return;e.config.markers[n]=e.config.markers[n+1],e.config.markers[n+1]=a,n+=1}}},saveMarkerTemplate_:function(t,e,n){t.fn.enableLoading(t);var i=y.extend(!0,{},e);i.x=i.y=0;var a=JSON.stringify(i);y.ajax({url:t.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:t.wp_ajax_nonce,action:t.wp_ajax_action_template_save,name:n,data:a}}).done(function(e){if(e)return t.fn.showNotice(t,e.data.msg,e.success?"notice-success":"notice-error"),void t.rootScope.scan();t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).fail(function(){t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).always(function(){t.fn.disableLoading(t)})},saveMarkerTemplate:function(t,n){var i={templateName:null};t.modal.fn.show(t,"marker-template-name",i,null).then(function(e){t.modal.fn.close(t,i.id),"close"!=e&&t.fn.saveMarkerTemplate_(t,n,i.templateName)})},deleteMarkerTemplate:function(i,e){var a=y.Deferred();return y.ajax({url:i.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:i.wp_ajax_nonce,action:i.wp_ajax_action_template_delete,name:e},success:function(e){e&&e.success?a.resolve(!0):this.error()},error:function(e,t,n){i.fn.showNotice(i,i.wp_ajax_msg_error,"notice-error"),a.resolve(!1)}}),a.promise()},deleteMarker:function(e){if(null!=e.ui.activeMarker){e.ui.activeMarkerWatch&&(e.ui.activeMarkerWatch.stop(),e.ui.activeMarkerWatch=null);for(var t=null,n=e.config.markers.length,i=0;i<n;i++){var a=e.config.markers[i];if(Object.is(e.ui.activeMarker,a)){t=i;break}}if(null!=t){var o=t;0<=t&&t<n&&(e.config.markers.splice(t,1),t==n-1&&1<n?o=n-2:1==n&&(o=null)),e.fn.selectMarker(e,e.config.markers[o])}}},editMarkerAlign:function(e,t){if(null!=e.ui.activeMarker){var n=e.ui.activeMarker;switch(t){case"top":n.y=-e.config.imageHeight/2+n.height/2;break;case"middle":n.y=0;break;case"bottom":n.y=e.config.imageHeight/2-n.height/2;break;case"left":n.x=-e.config.imageWidth/2+n.width/2;break;case"center":n.x=0;break;case"right":n.x=e.config.imageWidth/2-n.width/2}}},toggleMarkerTooltip:function(e,t){t.tooltip.active=!t.tooltip.active},toggleMarkerVisible:function(e,t){t.visible=!t.visible},toggleMarkerLock:function(e,t){t.lock=!t.lock},setMarkerView:function(e,t,n){if(n){n.css({"background-image":e.fn.getImageUrl(e,t.view.background.image,"style"),"background-color":t.view.background.color?t.view.background.color:"","background-size":t.view.background.size?t.view.background.size:"","background-repeat":t.view.background.repeat?t.view.background.repeat:"","background-position":t.view.background.position?t.view.background.position:"","border-width":t.view.border.all.active&&t.view.border.all.width.value?t.view.border.all.width.value+t.view.border.all.width.type:"","border-style":t.view.border.all.active&&t.view.border.all.style?t.view.border.all.style:"","border-color":t.view.border.all.active&&t.view.border.all.color?t.view.border.all.color:""}),t.view.border.top.active&&n.css({"border-top-width":t.view.border.top.width.value?t.view.border.top.width.value+t.view.border.top.width.type:"","border-top-style":t.view.border.top.style?t.view.border.top.style:"","border-top-color":t.view.border.top.color?t.view.border.top.color:""}),t.view.border.right.active&&n.css({"border-right-width":t.view.border.right.width.value?t.view.border.right.width.value+t.view.border.right.width.type:"","border-right-style":t.view.border.right.style?t.view.border.right.style:"","border-right-color":t.view.border.right.color?t.view.border.right.color:""}),t.view.border.bottom.active&&n.css({"border-bottom-width":t.view.border.bottom.width.value?t.view.border.bottom.width.value+t.view.border.bottom.width.type:"","border-bottom-style":t.view.border.bottom.style?t.view.border.bottom.style:"","border-bottom-color":t.view.border.bottom.color?t.view.border.bottom.color:""}),t.view.border.left.active&&n.css({"border-left-width":t.view.border.left.width.value?t.view.border.left.width.value+t.view.border.left.width.type:"","border-left-style":t.view.border.left.style?t.view.border.left.style:"","border-left-color":t.view.border.left.color?t.view.border.left.color:""});var i=t.view.border.radius.all.value?t.view.border.radius.all.value+t.view.border.radius.all.type:"";n.css({"border-top-left-radius":t.view.border.radius.topLeft.value?t.view.border.radius.topLeft.value+t.view.border.radius.topLeft.type:i,"border-top-right-radius":t.view.border.radius.topRight.value?t.view.border.radius.topRight.value+t.view.border.radius.topRight.type:i,"border-bottom-right-radius":t.view.border.radius.bottomRight.value?t.view.border.radius.bottomRight.value+t.view.border.radius.bottomRight.type:i,"border-bottom-left-radius":t.view.border.radius.bottomLeft.value?t.view.border.radius.bottomLeft.value+t.view.border.radius.bottomLeft.type:i});var a=t.view.icon.margin.all.value?t.view.icon.margin.all.value+t.view.icon.margin.all.type:"";if(n.find(".imagelinks-marker-icon-wrap").css({"margin-top":t.view.icon.margin.top.value?t.view.icon.margin.top.value+t.view.icon.margin.top.type:a,"margin-right":t.view.icon.margin.right.value?t.view.icon.margin.right.value+t.view.icon.margin.right.type:a,"margin-bottom":t.view.icon.margin.bottom.value?t.view.icon.margin.bottom.value+t.view.icon.margin.bottom.type:a,"margin-left":t.view.icon.margin.left.value?t.view.icon.margin.left.value+t.view.icon.margin.left.type:a}),t.view.pulse.active){var o=n.prev(".imagelinks-marker-pulse");o.length&&o.css({"background-color":t.view.pulse.color,"animation-duration":t.view.pulse.duration+"ms","border-top-left-radius":t.view.border.radius.topLeft.value?t.view.border.radius.topLeft.value+t.view.border.radius.topLeft.type:i,"border-top-right-radius":t.view.border.radius.topRight.value?t.view.border.radius.topRight.value+t.view.border.radius.topRight.type:i,"border-bottom-right-radius":t.view.border.radius.bottomRight.value?t.view.border.radius.bottomRight.value+t.view.border.radius.bottomRight.type:i,"border-bottom-left-radius":t.view.border.radius.bottomLeft.value?t.view.border.radius.bottomLeft.value+t.view.border.radius.bottomLeft.type:i})}}},getMarkerStyle:function(e,t,n){switch(n){case"x":var i=e.ui.mapMarkers.get(t),a=(t.autoWidth?i.outerWidth():t.width)/2;return t.x-a+"px";case"y":return i=e.ui.mapMarkers.get(t),a=(t.autoHeight?i.outerHeight():t.height)/2,t.y-a+"px";case"width":return t.autoWidth?"":t.width+"px";case"height":return t.autoHeight?"":t.height+"px";case"angle":return t.angle?"rotate("+t.angle+"deg)":"rotate(0deg)"}return null},getMarkerCoord:function(e,t,n){switch(n){case"x":return parseFloat(parseFloat(t.x).toFixed(2));case"y":return parseFloat(parseFloat(t.y).toFixed(2));case"angle":return Math.floor(t.angle)}return""},onEditMarkerKeyDown:function(e,t,n){var i=e.ui.mapMarkers.get(t);if(!t.lock&&!i.hasClass("imagelinks-editing")){var a=!1;switch(n.which){case 37:t.x-=1,a=!0;break;case 38:t.y-=1,a=!0;break;case 39:t.x+=1,a=!0;break;case 40:t.y+=1,a=!0}a&&(n.preventDefault(),n.stopPropagation(),e.rootScope.scan())}},onEditMarkerStart:function(e,t,n,i){var a=e.ui.mapMarkers.get(t);t.lock||a.hasClass("imagelinks-editing")||(e.fn.onMarkerClick(e,t),e.ui.editMarker.type=n,e.ui.editMarker.initX=i.pageX,e.ui.editMarker.initY=i.pageY,e.ui.editMarker.lastX=i.pageX,e.ui.editMarker.lastY=i.pageY,e.ui.editMarker.centerX=a.offset().left+a.width()/2,e.ui.editMarker.centerY=a.offset().top+a.height()/2,e.ui.editMarker.rotation=Math.atan2(i.pageY-e.ui.editMarker.centerY,i.pageX-e.ui.editMarker.centerX),e.ui.editMarker.markerAngle=t.angle,e.ui.editMarker.markerX=t.x,e.ui.editMarker.markerY=t.y,e.ui.editMarker.markerWidth=t.width,e.ui.editMarker.markerHeight=t.height,i.preventDefault(),i.stopPropagation(),y("body").on("mousemove",y.proxy(e.fn.onEditMarkerMove,this,e,t)),y("body").on("mouseup",y.proxy(e.fn.onEditMarkerEnd,this,e,t)),y("body").on("mouseleave",y.proxy(e.fn.onEditMarkerEnd,this,e,t)))},onEditMarkerMove:function(n,i,a){a.preventDefault(),a.stopPropagation();var e,t,o,r=n.ui.canvas.zoom;function l(){var e=a.pageX-n.ui.editMarker.initX,t=n.ui.editMarker.markerWidth-2*e/r;i.width=t<=0?0:t,n.rootScope.scan()}function s(){var e=a.pageY-n.ui.editMarker.initY,t=n.ui.editMarker.markerHeight-2*e/r;i.height=t<=0?0:t,n.rootScope.scan()}function c(){var e=a.pageX-n.ui.editMarker.initX,t=n.ui.editMarker.markerWidth+2*e/r;i.width=t<=0?0:t,n.rootScope.scan()}function u(){var e=a.pageY-n.ui.editMarker.initY,t=n.ui.editMarker.markerHeight+2*e/r;i.height=t<=0?0:t,n.rootScope.scan()}switch(n.ui.editMarker.type){case"drag":t=a.pageX-n.ui.editMarker.lastX,o=a.pageY-n.ui.editMarker.lastY,n.ui.editMarker.lastX=a.pageX,n.ui.editMarker.lastY=a.pageY,i.x=i.x+t/r,i.y=i.y+o/r,n.rootScope.scan();break;case"rotate":e=(Math.atan2(a.pageY-n.ui.editMarker.centerY,a.pageX-n.ui.editMarker.centerX)-n.ui.editMarker.rotation)*(180/Math.PI),i.angle=n.ui.editMarker.markerAngle+e,i.angle<0?i.angle=360+i.angle:360<=i.angle&&(i.angle=i.angle-360),n.rootScope.scan();break;case"tl":s(),l();break;case"tm":s();break;case"tr":s(),c();break;case"rm":c();break;case"br":u(),c();break;case"bm":u();break;case"bl":u(),l();break;case"lm":l()}},onEditMarkerEnd:function(e,t,n){n.preventDefault(),n.stopPropagation(),y("body").off("mousemove",y.proxy(e.fn.onEditMarkerMove,this,e,t)),y("body").off("mouseup",y.proxy(e.fn.onEditMarkerEnd,this,e,t)),y("body").off("mouseleave",y.proxy(e.fn.onEditMarkerEnd,this,e,t)),e.ui.editMarker.type=null,e.ui.editMarker.initX=null,e.ui.editMarker.initY=null,e.ui.editMarker.lastX=null,e.ui.editMarker.lastY=null,e.ui.editMarker.centerX=null,e.ui.editMarker.centerY=null,e.ui.editMarker.rotation=0,e.ui.editMarker.markerAngle=null,e.ui.editMarker.markerX=null,e.ui.editMarker.markerY=null,e.ui.editMarker.markerWidth=null,e.ui.editMarker.markerHeight=null},onMoveCanvasStart:function(e,t){t.preventDefault(),t.stopPropagation(),e.ui.moveCanvas.initX=t.pageX,e.ui.moveCanvas.initY=t.pageY,e.ui.moveCanvas.lastX=t.pageX,e.ui.moveCanvas.lastY=t.pageY,y("body").on("mousemove",y.proxy(e.fn.onMoveCanvas,this,e)),y("body").on("mouseup",y.proxy(e.fn.onMoveCanvasEnd,this,e)),y("body").on("mouseleave",y.proxy(e.fn.onMoveCanvasEnd,this,e))},onMoveCanvas:function(e,t){t.preventDefault(),t.stopPropagation();var n=t.pageX-e.ui.moveCanvas.lastX,i=t.pageY-e.ui.moveCanvas.lastY;e.ui.moveCanvas.lastX=t.pageX,e.ui.moveCanvas.lastY=t.pageY,e.ui.canvas.x+=n,e.ui.canvas.y+=i,e.rootScope.scan()},onMoveCanvasEnd:function(e,t){t.preventDefault(),t.stopPropagation(),y("body").off("mousemove",y.proxy(e.fn.onMoveCanvas,this,e)),y("body").off("mouseup",y.proxy(e.fn.onMoveCanvasEnd,this,e)),y("body").off("mouseleave",y.proxy(e.fn.onMoveCanvasEnd,this,e)),e.ui.moveCanvas.initX=null,e.ui.moveCanvas.initY=null,e.ui.moveCanvas.lastX=null,e.ui.moveCanvas.lastY=null},onSidebarResizeStart:function(e,t){t.preventDefault(),t.stopPropagation(),e.ui.sidebarResize.initX=t.pageX,e.ui.sidebarResize.lastX=t.pageX,e.ui.sidebarResize.width=e.ui.sidebarWidth,y("body").on("mousemove",y.proxy(e.fn.onSidebarResize,this,e)),y("body").on("mouseup",y.proxy(e.fn.onSidebarResizeEnd,this,e)),y("body").on("mouseleave",y.proxy(e.fn.onSidebarResizeEnd,this,e))},onSidebarResize:function(e,t){t.preventDefault(),t.stopPropagation();var n=t.pageX-e.ui.sidebarResize.lastX;e.ui.sidebarResize.lastX=t.pageX,e.ui.sidebarResize.width+=n,200<=e.ui.sidebarResize.width&&e.ui.sidebarResize.width<=800&&(e.ui.sidebarWidth=e.ui.sidebarResize.width,e.rootScope.scan())},onSidebarResizeEnd:function(e,t){t.preventDefault(),t.stopPropagation(),y("body").off("mousemove",y.proxy(e.fn.onSidebarResize,this,e)),y("body").off("mouseup",y.proxy(e.fn.onSidebarResizeEnd,this,e)),y("body").off("mouseleave",y.proxy(e.fn.onSidebarResizeEnd,this,e)),e.ui.sidebarResize.initX=null,e.ui.sidebarResize.lastX=null,e.ui.sidebarResize.width=null},selectShowAnimation:function(t,n){var i={selectedClass:null};t.modal.fn.show(t,"show-effects",i,t.fn.selectAnimationCallback).then(function(e){t.modal.fn.close(t,i.id),"close"!=e&&e&&(n.showAnimation=i.selectedClass,t.rootScope.scan())})},selectHideAnimation:function(t,n){var i={selectedClass:null};t.modal.fn.show(t,"hide-effects",i,t.fn.selectAnimationCallback).then(function(e){t.modal.fn.close(t,i.id),"close"!=e&&e&&(n.hideAnimation=i.selectedClass,t.rootScope.scan())})},selectAnimationCallback:function(i){var a=y("#imagelinks-modal-"+i.id);a.find(".imagelinks-modal-effect[data-fx-name]").on("click",function(e){a.find(".imagelinks-modal-effect.imagelinks-active").removeClass("imagelinks-active");var t=y(this),n=t.data("fx-name");t.removeClass(n).addClass(n).addClass("imagelinks-active"),i.selectedClass=n,i.rootScope.scan()}),a.find(".imagelinks-modal-effect[data-fx-name]").on("dblclick",function(e){var t=y(this).data("fx-name");i.selectedClass=t,i.deferred.resolve(!0)}),a.find(".imagelinks-modal-effect[data-fx-name]").on(function(){var e=document.createElement("fakeelement"),t={animation:"animationend",MSAnimationEnd:"msAnimationEnd",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(var n in t)if(void 0!==e.style[n])return t[n]}(),function(e){var t=y(this),n=t.data("fx-name");t.hasClass(n)&&t.removeClass(n)})},selectIcon:function(t,n,i){var a={icons:null,selectedIcon:null,fn:{onClickIcon:function(e,t,n,i){var a=y("#imagelinks-modal-"+e.id),o=y(n);a.find(".imagelinks-modal-icon.imagelinks-active").removeClass("imagelinks-active"),o.addClass("imagelinks-active"),e.selectedIcon=e.fn.getIcon(e,i)},onDblClickIcon:function(e){e.deferred.resolve(!0)},selectIcon:function(e){e.deferred.resolve(!0)},getIcon:function(e,t){return t.name},getIconName:function(e,t){return t.name.replace(/fa-/g,"")}}};t.modal.fn.show(t,"icons",a,t.fn.selectIconCallback).then(function(e){t.modal.fn.close(t,a.id),"close"!=e&&e&&a.selectedIcon&&(i.name=a.selectedIcon,n.scan())})},selectIconCallback:function(t){t.appData.fn.loadData(i,"icons").done(function(e){t.icons=e.list,t.rootScope.scan(),y("#imagelinks-modal-"+t.id).find(".imagelinks-modal-data").removeClass("imagelinks-modal-loading")})},getIconStyle:function(e,t,n){switch(n){case"color":return t.color?t.color:"";case"font-size":return t.size.value?t.size.value+t.size.type:""}return null},floor:function(e,t){return Math.floor(t)},assignObject:function(e,t,n){for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i])},copyToClipboard:function(e,t){var n=y(t);if(0!=n.length){var i=n.val();if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",i);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var a=document.createElement("textarea");a.textContent=i,a.style.position="fixed",document.body.appendChild(a),a.select();try{document.execCommand("copy")}catch(e){console.warn("Copy to clipboard failed.",e)}finally{document.body.removeChild(a)}}n.select()}}},modal:{count:0,items:[],fn:{show:function(i,e,a,t){var o=++i.modal.count,r=y.Deferred();return i.modal.items.push(o),i.inprocess++,y.ajax({url:i.wp_ajax_url,type:"GET",dataType:"html",data:{nonce:i.wp_ajax_nonce,action:i.wp_ajax_action_modal,name:e}}).done(function(e){y("body").addClass("imagelinks-modal-open");var t=y(e),n={};n.modalData=a,n.modalData.id=o,n.modalData.deferred=r,n.modalData.appData=i,(null==a.easyClose||a.easyClose)&&t.on("click",function(e){n.modalData.deferred.resolve("close")}),t.find(".imagelinks-modal-dialog").on("click",function(e){return!1}),y("#imagelinks-modals").append(t),a.rootScope=i.alight(t.get(0),n)}).fail(function(e,t,n){i.fn.showNotice(i,i.wp_ajax_msg_error,"notice-error")}).always(function(){t&&"function"==typeof t&&t.call(this,a),i.inprocess--}),r.promise()},close:function(e,t){y("#imagelinks-modal-"+t).remove();var n=e.modal.items.indexOf(t);e.modal.items.splice(n,1),0==e.modal.items.length&&jQuery("body").removeClass("imagelinks-modal-open")}}}},window.alightInitCallback=function(e){delete window.alightInitCallback,e.directives.al.text={restrict:"EA",link:function(i,e,a,o){var r=y(e),l=y(e);l.on("input change",function(e){var t,n=l.val();(!(t=n)||/^\s*$/.test(t))&&(n=null),o.setValue(a,n),o.scan(),function(){var e=r.data("callback");if(e){var t=o.changeDetector.compile(e);t(i)}}()}),o.watch(a,function(e){null==e?l.val(null):l.val(e)},{readOnly:!0})}},e.directives.al.textarea={restrict:"EA",link:function(i,e,a,o){var r=y(e),l=y(e);r.addClass("imagelinks-textarea"),l.on("input change",function(e){var t,n=l.val();(!(t=n)||/^\s*$/.test(t))&&(n=null),o.setValue(a,n),o.scan(),function(){var e=r.data("callback");if(e){var t=o.changeDetector.compile(e);t(i)}}()}),o.watch(a,function(e){null==e?l.val(null):l.val(e)},{readOnly:!0})}},e.directives.al.integer={restrict:"EA",link:function(a,e,o,r){var l=y(e),s=y(e);s.on("input change",function(e){var t,n=s.val(),i=!0;!(t=n)||/^\s*$/.test(t)?n=null:n.match("^([+-]?[1-9]+[0-9]*|0)$")?n=parseInt(n,10):i=!1,i?(r.setValue(o,n),r.scan(),function(){var e=l.data("callback");if(e){var t=r.changeDetector.compile(e);t(a)}}(),l.removeClass("imagelinks-invalid")):l.addClass("imagelinks-invalid")}),r.watch(o,function(e){l.removeClass("imagelinks-invalid"),null==e?s.val(null):s.val(e)},{readOnly:!0})}},e.directives.al.float={restrict:"EA",link:function(a,e,o,r){var l=y(e),s=y(e);s.on("input change",function(e){var t,n=s.val(),i=!0;!(t=n)||/^\s*$/.test(t)?n=null:n.match("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)$")?n=parseFloat(n):i=!1,i?(r.setValue(o,n),r.scan(),function(){var e=l.data("callback");if(e){var t=r.changeDetector.compile(e);t(a)}}(),l.removeClass("imagelinks-invalid")):l.addClass("imagelinks-invalid")}),r.watch(o,function(e){l.removeClass("imagelinks-invalid"),null==e?s.val(null):s.val(e)},{readOnly:!0})}},e.directives.al.toggle={restrict:"EA",link:function(n,e,t,i){var a=y(e);a.addClass("imagelinks-toggle").html(" "),a.on("mousedown touchstart",function(e){i.setValue(t,!i.getValue(t)),i.scan(),function(){var e=a.data("callback");if(e){var t=i.changeDetector.compile(e);t(n)}}()}),i.watch(t,function(e){e?a.addClass("imagelinks-checked").removeClass("imagelinks-unchecked"):a.removeClass("imagelinks-checked").addClass("imagelinks-unchecked")},{readOnly:!0})}},e.directives.al.checkbox={restrict:"EA",link:function(n,e,t,i){var a=y(e);a.addClass("imagelinks-checkbox").html('<i class="imagelinks-icon imagelinks-icon-check"></i>'),a.on("mousedown touchstart",function(e){i.setValue(t,!i.getValue(t)),i.scan(),function(){var e=a.data("callback");if(e){var t=i.changeDetector.compile(e);t(n)}}()}),i.watch(t,function(e){e?a.addClass("imagelinks-checked").removeClass("imagelinks-unchecked"):a.removeClass("imagelinks-checked").addClass("imagelinks-unchecked")},{readOnly:!0})}},e.directives.al.unit={restrict:"EA",link:function(t,e,a,o){var n=y(e),r=y("<input/>").addClass("imagelinks-unit-value"),l=y("<select/>").addClass("imagelinks-unit-type");function s(){var e=n.data("callback");e&&o.changeDetector.compile(e)(t)}l.append('<option value="px">px</li>'),l.append('<option value="%">%</li>'),l.append('<option value="em">em</li>'),l.append('<option value="cm">cm</li>'),l.append('<option value="mm">mm</li>'),l.append('<option value="in">in</li>'),l.append('<option value="pt">pt</li>'),l.append('<option value="pc">pc</li>'),l.append('<option value="ex">ex</li>'),l.append('<option value="ch">ch</li>'),l.append('<option value="rem">rem</li>'),l.append('<option value="vw">vw</li>'),l.append('<option value="vh">vh</li>'),l.append('<option value="vmin">vmin</li>'),l.append('<option value="vmax">vmax</li>'),n.append(r,l),r.on("input change",function(e){var t,n=r.val(),i=!0;!(t=n)||/^\s*$/.test(t)?n={value:null,type:l.val()}:n.match("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)$")?n={value:parseFloat(n),type:l.val()}:i=!1,i?(o.setValue(a,n),o.scan(),s(),r.removeClass("imagelinks-invalid")):r.addClass("imagelinks-invalid")}),l.on("change",function(e){var t=l.val(),n=o.getValue(a);n&&(n.type=t,o.setValue(a,n),o.scan(),s())}),o.watch(a,function(e){r.removeClass("imagelinks-invalid"),null==e?(r.val(null),l.val("px")):(r.val(e.value),l.val(e.type))},{readOnly:!0})}},e.directives.al.style={restrict:"EA",link:function(e,t,n,i){if(i.attrArgument){var a=y(t),o=i.attrArgument.split(".")[0];i.watch(n,function(e){a.css(o,e)},{readOnly:!0})}}},e.directives.al.backgroundrepeat={restrict:"EA",link:function(e,t,n,i){var a=y(t),o=y("<select/>").addClass(a.get(0).className);o.append('<option value="none">none</option>'),o.append('<option value="repeat">repeat</option>'),o.append('<option value="repeat-x">repeat-x</option>'),o.append('<option value="repeat-y">repeat-y</option>'),o.append('<option value="no-repeat">no-repeat</option>'),a.append(o),o.unwrap(),o.on("change",function(e){var t=o.val();"none"==t&&(t=null),i.setValue(n,t),i.scan()}),i.watch(n,function(e){null==e?o.val("none"):o.val(e)},{readOnly:!0})}},e.directives.al.backgroundsize={restrict:"EA",link:function(e,t,n,i){var a=y(t),o=y("<select/>").addClass(a.get(0).className);o.append('<option value="none">none</option>'),o.append('<option value="auto">auto</option>'),o.append('<option value="cover">cover</option>'),o.append('<option value="contain">contain</option>'),o.append('<option value="100% 100%">stretch</option>'),a.append(o),o.unwrap(),o.on("change",function(e){var t=o.val();"none"==t&&(t=null),i.setValue(n,t),i.scan()}),i.watch(n,function(e){null==e?o.val("none"):o.val(e)},{readOnly:!0})}},e.directives.al.borderstyle={restrict:"EA",link:function(e,t,n,i){var a=y(t),o=y("<select/>").addClass(a.get(0).className);o.append('<option value="none">none</option>'),o.append('<option value="solid">solid</option>'),o.append('<option value="hidden">hidden</option>'),o.append('<option value="dotted">dotted</option>'),o.append('<option value="dashed">dashed</option>'),a.append(o),o.unwrap(),o.on("change",function(e){var t=o.val();"none"==t&&(t=null),i.setValue(n,t),i.scan()}),i.watch(n,function(e){null==e?o.val("none"):o.val(e)},{readOnly:!0})}},e.directives.al.color={restrict:"EA",link:function(t,o,r,l){var n=y(o),i=y("<div></div>").addClass("imagelinks-color-btn").append("<div><div></div></div>"),a=y("<input/>").addClass("imagelinks-color-value");n.append(i,a),i.on("click touchend",function(e){u.show(i,l.getValue(r))}),a.on("input change",function(e){var t,n=y(this).val(),i=!0;if(!(t=n)||/^\s*$/.test(t))n=null;else{var a=new c;a.setColor(n)||(i=!1)}i?(l.setValue(r,n),l.scan(),p(),y(o).removeClass("imagelinks-invalid")):y(o).addClass("imagelinks-invalid")});var s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}}];function c(){this.rgb={r:0,g:0,b:0},this.hsb={h:0,s:0,b:0},this.alpha=1}function e(e){this.config=null,this.color=new c,this.controls={},this.inputEdit={enabled:!1,pageY:0,value:0,type:null},this._init(e)}c.prototype={rgb:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},rgba:function(){return"rgba("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+","+this.alpha+")"},hex:function(){return this.toHex()},RGBAtoHSBA:function(e,t,n,i){var a=0,o=Math.max(e,t,n),r=o-Math.min(e,t,n),l=o/255,s=0!=o?r/o:0;if(s){var c=(o-e)/r,u=(o-t)/r,p=(o-n)/r;a=e==o?p-u:t==o?2+c-p:4+u-c,(a/=6)<0&&a++}return{h:Math.round(360*a),s:Math.round(100*s),b:Math.round(100*l),a:i||1}},HSBAtoRGBA:function(e,t,n,i){var a,o,r,l,s;return e=(e=e)%360/60,a=o=r=(n/=100)-(s=n*(t/=100)),a+=[s,l=s*(1-Math.abs(e%2-1)),0,0,l,s][e=~~e],o+=[l,s,s,l,0,0][e],r+=[0,0,l,s,s,l][e],{r:Math.round(255*a),g:Math.round(255*o),b:Math.round(255*r),a:i||1}},setColor:function(e){for(var t in e=e.toLowerCase(),s)if(s.hasOwnProperty(t)){var n=s[t],i=n.re.exec(e),a=i&&n.parse(i);if(a){var o=this.RGBAtoHSBA.apply(null,a);return this.hsb={h:o.h,s:o.s,b:o.b},this.rgb={r:a[0],g:a[1],b:a[2]},this.alpha=o.a,!0}}return!1},setRed:function(e){255<e?e=255:e<0&&(e=0),this.rgb.r=e;var t=this.RGBAtoHSBA(this.rgb.r,this.rgb.g,this.rgb.b);this.hsb={h:t.h,s:t.s,b:t.b}},setGreen:function(e){255<e?e=255:e<0&&(e=0),this.rgb.g=e;var t=this.RGBAtoHSBA(this.rgb.r,this.rgb.g,this.rgb.b);this.hsb={h:t.h,s:t.s,b:t.b}},setBlue:function(e){255<e?e=255:e<0&&(e=0),this.rgb.b=e;var t=this.RGBAtoHSBA(this.rgb.r,this.rgb.g,this.rgb.b);this.hsb={h:t.h,s:t.s,b:t.b}},setHue:function(e){360<e?e=360:e<0&&(e=0),this.hsb.h=e;var t=this.HSBAtoRGBA(this.hsb.h,this.hsb.s,this.hsb.b);this.rgb={r:t.r,g:t.g,b:t.b}},setSaturation:function(e){100<e?e=100:e<0&&(e=0),this.hsb.s=e;var t=this.HSBAtoRGBA(this.hsb.h,this.hsb.s,this.hsb.b);this.rgb={r:t.r,g:t.g,b:t.b}},setBrightness:function(e){100<e?e=100:e<0&&(e=0),this.hsb.b=e;var t=this.HSBAtoRGBA(this.hsb.h,this.hsb.s,this.hsb.b);this.rgb={r:t.r,g:t.g,b:t.b}},setAlpha:function(e){1<(e=parseInt(100*e,10)/100)?e=1:e<0&&(e=0),this.alpha=e},toRGBA:function(){return{r:this.rgb.r,g:this.rgb.g,b:this.rgb.b,a:this.alpha}},toHSBA:function(){return{h:this.hsb.h,s:this.hsb.s,b:this.hsb.b,a:this.alpha}},toHex:function(){return"#"+(1<<24|parseInt(this.rgb.r,10)<<16|parseInt(this.rgb.g,10)<<8|parseInt(this.rgb.b,10)).toString(16).substr(1)}},e.prototype={defaults:{onSelect:null},_init:function(e){this.config=y.extend(!0,{},this.defaults,e),this._create()},_create:function(){this._buildDOM(),this._bind(),this._refresh()},_buildDOM:function(){var e=y("<div></div>").addClass("imagelinks-data"),t=y("<div></div>").addClass("imagelinks-color-picker"),n=y("<div></div>").addClass("imagelinks-thumb"),i=y("<div></div>").addClass("imagelinks-pallete").append(n),a=y("<div></div>").addClass("imagelinks-thumb"),o=y("<div></div>").addClass("imagelinks-hue").append(a),r=y("<div></div>").addClass("imagelinks-panel"),l=y("<div></div>").addClass("imagelinks-input").append('<span>R<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>'),s=y("<div></div>").addClass("imagelinks-input").append('<span>G<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>'),c=y("<div></div>").addClass("imagelinks-input").append('<span>B<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>'),u=y("<div></div>").addClass("imagelinks-line"),p=y("<div></div>").addClass("imagelinks-input").append('<span>H<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>'),d=y("<div></div>").addClass("imagelinks-input").append('<span>S<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>'),f=y("<div></div>").addClass("imagelinks-input").append('<span>B<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>');r.append(l,s,c,u,p,d,f),t.append(e.append(i,o,r)),this.controls.$picker=t,this.controls.$pallete=i,this.controls.$pallete_thumb=n,this.controls.$hue=o,this.controls.$hue_thumb=a,this.controls.$input_rgb_r=l.find("input"),this.controls.$input_rgb_g=s.find("input"),this.controls.$input_rgb_b=c.find("input"),this.controls.$input_hsb_h=p.find("input"),this.controls.$input_hsb_s=d.find("input"),this.controls.$input_hsb_b=f.find("input"),this.controls.$input_rgb_r_thumb=l.find(".imagelinks-thumb"),this.controls.$input_rgb_g_thumb=s.find(".imagelinks-thumb"),this.controls.$input_rgb_b_thumb=c.find(".imagelinks-thumb"),this.controls.$input_hsb_h_thumb=p.find(".imagelinks-thumb"),this.controls.$input_hsb_s_thumb=d.find(".imagelinks-thumb"),this.controls.$input_hsb_b_thumb=f.find(".imagelinks-thumb"),e=y("<div></div>").addClass("imagelinks-data");var h=y("<div></div>").addClass("imagelinks-thumb"),m=y("<div></div>").addClass("imagelinks-gradient"),g=y("<div></div>").addClass("imagelinks-alpha").append(m,h),v=(r=y("<div></div>").addClass("imagelinks-panel"),y("<div></div>").addClass("imagelinks-input").append('<span>A<input type="text" maxlength="3" size="3"/><span class="imagelinks-thumb"></span></span>'));r.append(v),t.append(e.append(g,r)),this.controls.$alpha=g,this.controls.$alpha_thumb=h,this.controls.$alpha_gradient=m,this.controls.$input_alpha=v.find("input"),this.controls.$input_alpha_thumb=v.find(".imagelinks-thumb"),e=y("<div></div>").addClass("imagelinks-data");var b=y("<div></div>").addClass("imagelinks-preview").append("<div><div></div></div>"),k=y("<input readonly />").addClass("imagelinks-input-color"),w=y("<div></div>").addClass("imagelinks-submit").text("OK");t.append(e.append(b,k,w)),this.controls.$preview=b.find("> div > div"),this.controls.$input_color=k,this.controls.$submit=w,t.appendTo("body")},_bind:function(){this.controls.$pallete.on("mousedown",y.proxy(this._onPalleteEditStart,this)),this.controls.$pallete.on("click",y.proxy(this._onPalleteEditMove,this)),this.controls.$hue.on("mousedown",y.proxy(this._onHueEditStart,this)),this.controls.$hue.on("click",y.proxy(this._onHueEditMove,this)),this.controls.$alpha.on("mousedown",y.proxy(this._onAlphaEditStart,this)),this.controls.$alpha.on("click",y.proxy(this._onAlphaEditMove,this)),this.controls.$input_rgb_r_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"rgb_r")),this.controls.$input_rgb_g_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"rgb_g")),this.controls.$input_rgb_b_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"rgb_b")),this.controls.$input_hsb_h_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"hsb_h")),this.controls.$input_hsb_s_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"hsb_s")),this.controls.$input_hsb_b_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"hsb_b")),this.controls.$input_alpha_thumb.on("mousedown",y.proxy(this._onInputEditStart,this,"alpha")),this.controls.$input_rgb_r.on("input",y.proxy(this._onInput,this,"rgb_r")),this.controls.$input_rgb_g.on("input",y.proxy(this._onInput,this,"rgb_g")),this.controls.$input_rgb_b.on("input",y.proxy(this._onInput,this,"rgb_b")),this.controls.$input_hsb_h.on("input",y.proxy(this._onInput,this,"hsb_h")),this.controls.$input_hsb_s.on("input",y.proxy(this._onInput,this,"hsb_s")),this.controls.$input_hsb_b.on("input",y.proxy(this._onInput,this,"hsb_b")),this.controls.$input_alpha.on("input",y.proxy(this._onInput,this,"alpha")),this.controls.$submit.on("click",y.proxy(this._onSubmit,this))},_refresh:function(){var e=this.color.toRGBA(),t=this.color.toHSBA(),n=this.controls.$pallete.outerHeight()-2,i=this.controls.$pallete.outerWidth()-2;this.controls.$pallete.css({"background-color":"hsl("+t.h+", 100%, 50%)"}),this.controls.$pallete_thumb.css({top:parseInt(n-n*t.b/100,10)}),this.controls.$pallete_thumb.css({left:parseInt(i-i*(100-t.s)/100,10)}),n=this.controls.$hue.outerHeight()-2,this.controls.$hue_thumb.css({top:parseInt(n-n*t.h/360,10)}),i=this.controls.$alpha.outerWidth()-2,this.controls.$alpha_thumb.css({left:parseInt(i-i*(1-t.a),10)}),this.controls.$alpha_gradient.css({background:"linear-gradient(to left,"+this.color.hex()+",rgba(0,0,0,0))"}),this.controls.$input_rgb_r.val(e.r),this.controls.$input_rgb_g.val(e.g),this.controls.$input_rgb_b.val(e.b),this.controls.$input_hsb_h.val(t.h),this.controls.$input_hsb_s.val(t.s),this.controls.$input_hsb_b.val(t.b),this.controls.$input_alpha.val(parseInt(100*e.a,10)),this.controls.$preview.css({"background-color":this.color.rgba()}),this.controls.$input_color.val(1!=e.a?this.color.rgba():this.color.hex())},_show:function(e){var t=e.offset(),n=e.outerWidth(),i=e.outerHeight(),a=this.controls.$picker.outerWidth(),o=this.controls.$picker.outerHeight(),r=t.top-o-1,l=t.left;this.controls.$picker.offset({top:r,left:l});var s=this.controls.$picker.get(0).getBoundingClientRect();s.y<0&&(r=t.top+i+offsetH+1,this.controls.$picker.offset({top:r})),s.x+s.width>window.innerWidth&&(l=t.left+n-a,this.controls.$picker.offset({left:l})),this.controls.$picker.addClass("imagelinks-active"),y("body").on("mousedown touchstart",y.proxy(this._onBodyClick,this))},_hide:function(){this.controls.$picker.removeClass("imagelinks-active").css({top:"",left:""}),y("body").off("mousedown touchstart",y.proxy(this._onBodyClick,this))},_destroy:function(){this.controls.$picker&&this.controls.$picker.remove(),this.config=null,this.color=new c,this.controls={}},_onPalleteEditStart:function(e){y("body").on("mouseup",y.proxy(this._onPalleteEditEnd,this)),y("body").on("mousemove",y.proxy(this._onPalleteEditMove,this))},_onPalleteEditMove:function(e){var t=this.controls.$pallete.outerHeight(),n=this.controls.$pallete.outerWidth(),i=100-parseInt(100*(n-Math.max(0,Math.min(n,e.pageX-this.controls.$pallete.offset().left)))/n,10),a=parseInt(100*(t-Math.max(0,Math.min(t,e.pageY-this.controls.$pallete.offset().top)))/t,10);return this.color.setSaturation(i),this.color.setBrightness(a),this._refresh(),!1},_onPalleteEditEnd:function(e){return y("body").off("mouseup",y.proxy(this._onPalleteEditEnd,this)),y("body").off("mousemove",y.proxy(this._onPalleteEditMove,this)),this._refresh(),!1},_onHueEditStart:function(e){y("body").on("mouseup",y.proxy(this._onHueEditEnd,this)),y("body").on("mousemove",y.proxy(this._onHueEditMove,this))},_onHueEditMove:function(e){var t=this.controls.$hue.outerHeight(),n=parseInt(360*(t-Math.max(0,Math.min(t,e.pageY-this.controls.$hue.offset().top)))/t,10);return this.color.setHue(n),this._refresh(),!1},_onHueEditEnd:function(e){return y("body").off("mouseup",y.proxy(this._onHueEditEnd,this)),y("body").off("mousemove",y.proxy(this._onHueEditMove,this)),this._refresh(),!1},_onAlphaEditStart:function(e){y("body").on("mouseup",y.proxy(this._onAlphaEditEnd,this)),y("body").on("mousemove",y.proxy(this._onAlphaEditMove,this))},_onAlphaEditMove:function(e){var t=this.controls.$alpha.outerWidth(),n=1-(t-Math.max(0,Math.min(t,e.pageX-this.controls.$alpha.offset().left)))/t;return this.color.setAlpha(n),this._refresh(),!1},_onAlphaEditEnd:function(e){return y("body").off("mouseup",y.proxy(this._onAlphaEditEnd,this)),y("body").off("mousemove",y.proxy(this._onAlphaEditMove,this)),this._refresh(),!1},_onInputEditStart:function(e,t){y("body").on("mouseup",y.proxy(this._onInputEditEnd,this)),y("body").on("mousemove",y.proxy(this._onInputEditMove,this)),this.inputEdit.enabled=!0,this.inputEdit.pageY=t.pageY,this.inputEdit.value=parseInt(y(t.target).siblings("input").val(),10),this.inputEdit.type=e},_onInputEditMove:function(e){if(this.inputEdit.enabled){var t=e.pageY-this.inputEdit.pageY,n=this.inputEdit.value+t;switch(this.inputEdit.type){case"rgb_r":this.color.setRed(n);break;case"rgb_g":this.color.setGreen(n);break;case"rgb_b":this.color.setBlue(n);break;case"hsb_h":this.color.setHue(n);break;case"hsb_s":this.color.setSaturation(n);break;case"hsb_b":this.color.setBrightness(n);break;case"alpha":this.color.setAlpha(n/100)}}return this._refresh(),!1},_onInputEditEnd:function(e){return y("body").off("mouseup",y.proxy(this._onInputEditEnd,this)),y("body").off("mousemove",y.proxy(this._onInputEditMove,this)),this.inputEdit.enabled=!1,this.inputEdit.pageY=0,this.inputEdit.value=0,this.inputEdit.type=null,this._refresh(),!1},_onInput:function(e,t){var n=y(t.target).val();switch(n=parseInt(n,10)||0,e){case"rgb_r":this.color.setRed(n);break;case"rgb_g":this.color.setGreen(n);break;case"rgb_b":this.color.setBlue(n);break;case"hsb_h":this.color.setHue(n);break;case"hsb_s":this.color.setSaturation(n);break;case"hsb_b":this.color.setBrightness(n);break;case"alpha":this.color.setAlpha(n/100)}return this._refresh(),!1},_onSubmit:function(e){this._hide(),"function"==typeof this.config.onSelect&&this.config.onSelect.call(this,this.color)},_onBodyClick:function(e){0!==this.controls.$picker.has(e.target).length||y(e.target).hasClass("imagelinks-color-picker")||this._hide()},show:function(e,t){t&&(this.color.setColor(t),this._refresh()),this._show(e)},hide:function(){this._hide()},destroy:function(){this._destroy()}};var u=new e({onSelect:function(e){var t=1==e.alpha?e.hex():e.rgba();l.setValue(r,t),l.scan(),p(),a.val(t)}});function p(){var e=n.data("callback");e&&l.changeDetector.compile(e)(t)}l.changeDetector.watch("$destroy",function(){u.destroy()}),l.watch(r,function(e){if(y(o).removeClass("imagelinks-invalid"),null==e)a.val(null),i.find("> div > div").css({"background-color":""});else{var t=new c;t.setColor(e)?i.find("> div > div").css({"background-color":t.rgba()}):i.find("> div > div").css({"background-color":""}),a.val(e)}},{readOnly:!0})}},e.directives.al.tooltipplacement={restrict:"EA",link:function(e,t,n,i){var a=y(t),o=y("<select/>").addClass(a.get(0).className);o.append('<option value="none">none</option>'),o.append('<option value="top-left">top-left</option>'),o.append('<option value="top">top</option>'),o.append('<option value="top-right">top-right</option>'),o.append('<option value="right-top">right-top</option>'),o.append('<option value="right">right</option>'),o.append('<option value="right-bottom">right-bottom</option>'),o.append('<option value="bottom-right">bottom-right</option>'),o.append('<option value="bottom">bottom</option>'),o.append('<option value="bottom-left">bottom-left</option>'),o.append('<option value="left-bottom">left-bottom</option>'),o.append('<option value="left">left</option>'),o.append('<option value="left-top">left-top</option>'),a.append(o),o.unwrap(),o.on("change",function(e){var t=o.val();"none"==t&&(t=null),i.setValue(n,t),i.scan()}),i.watch(n,function(e){null==e?o.val("none"):o.val(e)},{readOnly:!0})}},e.directives.al.tooltiptrigger={restrict:"EA",link:function(e,t,n,i){var a=y(t),o=y("<select/>").addClass(a.get(0).className);o.append('<option value="none">none</option>'),o.append('<option value="hover">hover</option>'),o.append('<option value="focus">focus</option>'),o.append('<option value="click">click</option>'),o.append('<option value="clickbody">click & body</option>'),o.append('<option value="sticky">sticky</option>'),a.append(o),o.unwrap(),o.on("change",function(e){var t=o.val();"none"==t&&(t=null),i.setValue(n,t),i.scan()}),i.watch(n,function(e){null==e?o.val("none"):o.val(e)},{readOnly:!0})}},i.config=y.extend(!0,{},i.defaultConfig),i.alight=e,i.rootScope=i.alight(document.querySelectorAll("#imagelinks-app-item")[0],{appData:i}),i.fn.init(i)}):y("#imagelinks-app-settings").length&&(t={alight:null,rootScope:null,wp_ajax_url:null,wp_ajax_nonce:null,wp_ajax_action_update:null,wp_ajax_action_get:null,wp_ajax_action_delete_data:null,wp_ajax_msg_error:null,themes:null,config:{themeJavaScript:null,themeCSS:null},ui:{tabs:{general:!0,actions:!1}},fn:{init:function(e){y("#imagelinks-app-settings").removeAttr("style"),e.plan=imagelinks_globals.plan,e.wp_ajax_url=imagelinks_globals.ajax_url,e.wp_ajax_nonce=imagelinks_globals.ajax_nonce,e.wp_ajax_action_update=imagelinks_globals.ajax_action_update,e.wp_ajax_action_get=imagelinks_globals.ajax_action_get,e.wp_ajax_action_delete_data=imagelinks_globals.ajax_action_delete_data,e.wp_ajax_msg_error=imagelinks_globals.ajax_msg_error,e.fn.initConfig(e)},enableLoading:function(e){y("#imagelinks-app-settings").removeClass("imagelinks-active")},disableLoading:function(e){setTimeout(function(){y("#imagelinks-app-settings").addClass("imagelinks-active")},1e3)},loadThemes:function(i){var a=y.Deferred();return y.ajax({url:i.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:i.wp_ajax_nonce,action:i.wp_ajax_action_get,type:"editor-themes"},success:function(e){e&&e.success?a.resolve(e.data.list):this.error()},error:function(e,t,n){i.fn.showNotice(i,i.wp_ajax_msg_error,"notice-error"),a.resolve(null)}}),a.promise()},initConfig:function(n){n.fn.enableLoading(n),n.fn.loadThemes(n).done(function(e){n.themes=e}).always(function(){if(imagelinks_globals.config){var e=y.extend(!0,{},JSON.parse(imagelinks_globals.config));if(e)for(var t in e)n.config.hasOwnProperty(t)&&(n.config[t]=e[t])}n.rootScope.scan(),n.fn.disableLoading(n)})},saveConfig:function(t){t.fn.enableLoading(t);var e=y.extend(!0,{},t.config);e=JSON.stringify(e),y.ajax({url:t.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:t.wp_ajax_nonce,action:t.wp_ajax_action_update,config:e}}).done(function(e){e?t.fn.showNotice(t,e.data.msg,e.success?"notice-success":"notice-error"):t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).fail(function(){t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).always(function(){t.fn.disableLoading(t)})},deleteAllData:function(t,e){confirm(e)&&(t.fn.enableLoading(t),y.ajax({url:t.wp_ajax_url,type:"POST",dataType:"json",data:{nonce:t.wp_ajax_nonce,action:t.wp_ajax_action_delete_data}}).done(function(e){e?t.fn.showNotice(t,e.data.msg,e.success?"notice-success":"notice-error"):t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).fail(function(){t.fn.showNotice(t,t.wp_ajax_msg_error,"notice-error")}).always(function(){t.fn.disableLoading(t)}))},showNotice:function(e,t,n){var i=y("#imagelinks-messages"),a=y("<div></div>").addClass("notice is-dismissible").addClass(n),o=y("<p></p>").html(t),r=y("<button></button>").attr("type","button").addClass("notice-dismiss").html('<span class="screen-reader-text">Dismiss this notice.</span>');function l(){clearTimeout(a.data("timer")),a.fadeTo(100,0,function(){a.slideUp(100,function(){a.remove()})})}a.data("timer",setTimeout(l,5e3)),r.click(function(e){e.preventDefault(),l()}),a.append(o,r),i.append(a)},onTab:function(e,t){if(!e.ui.tabs[t]){var n=e.ui.tabs;for(var i in n)n.hasOwnProperty(i)&&(n[i]=!1);e.ui.tabs[t]=!0}}}},window.alightInitCallback=function(e){delete window.alightInitCallback,e.directives.al.toggle={restrict:"EA",link:function(n,e,t,i){var a=y(e);a.addClass("imagelinks-toggle").html(" "),a.on("mousedown touchstart",function(e){i.setValue(t,!i.getValue(t)),i.scan(),function(){var e=a.data("callback");if(e){var t=i.changeDetector.compile(e);t(n)}}()}),i.watch(t,function(e){e?a.addClass("imagelinks-checked").removeClass("imagelinks-unchecked"):a.removeClass("imagelinks-checked").addClass("imagelinks-unchecked")},{readOnly:!0})}},t.alight=e,t.rootScope=t.alight(document.querySelectorAll("#imagelinks-app-settings")[0],{appData:t}),t.fn.init(t)});var n=y(".imagelinks-page-info");n.length&&!Cookies.get("imagelinks-page-info-hidden")&&n.addClass("imagelinks-active").find(".imagelinks-page-info-close").on("click",function(e){n.removeClass("imagelinks-active"),Cookies.set("imagelinks-page-info-hidden",!0,{expires:365})}),function(){function e(){var U=function(e,t){return U.bootstrap(e,t)};U.version="0.14.0",U.filters={},U.text={},U.core={},U.utils={},U.option={globalController:!1,removeAttribute:!0,domOptimization:!0,domOptimizationRemoveEmpty:!0,fastBinding:!0},U.debug={scan:0,directive:!1,watch:!1,watchText:!1,parser:!1},U.ctrl=U.controllers={},U.d=U.directives={al:{},bo:{},$global:{}},U.hooks={directive:[],binding:[]},U.priority={al:{app:2e3,checked:20,class:30,css:30,focused:20,if:700,ifnot:700,model:25,radio:25,repeat:1e3,select:20,stop:-10,value:20,on:10},$component:5,$attribute:-5};var e,t,n,i,a,u,k,o,r,w,j,c,f,y,p,l,_,s,x,T,I,d,h,N,m,B,O,g,v,b,C,S,M,D,E,$,A,F,L,R,H,z,W,V,P,X,Y,K,J,q,G,Z,Q,ee,te,ne,ie,ae,oe,re,le,se,ce,ue=U.f$={},pe=function(e,t){var n=e.indexOf(t);0<=n?e.splice(n,1):console.warn("trying to remove not exist item")};function de(t,e){var n,i=[],a=!1,o=e.cd,r=e.callback;if(e.filterConf.args.length){var l=[];e.filterConf.args.forEach(function(e,t){var n=o.watch(e,function(e){i[t+1]=e,c()});n.$.isStatic||l.push(n)});var s=!1,c=function(){s||(s=!0,o.watch("$onScanOnce",function(){if(s=!1,a){var e=t.apply(null,i);ue.isPromise(e)?e.then(function(e){r(e),o.scan()}):r(e)}}))};l.length&&(n=function(){l.forEach(function(e){return e.stop()})})}else c=function(){var e=t(i[0]);ue.isPromise(e)?e.then(function(e){r(e),o.scan()}):r(e)};return{onChange:function(e){a=!0,i[0]=e,c()},onStop:n,watchMode:e.watchMode}}function fe(e,t,n,i){i.setValue(i.attrArgument,t)}return ue.before=function(e,t){e.parentNode.insertBefore(t,e)},ue.after=function(e,t){var n=e.parentNode,i=e.nextSibling;i?n.insertBefore(t,i):n.appendChild(t)},ue.remove=function(e){var t=e.parentNode;t&&t.removeChild(e)},ue.on=function(e,t,n){e.addEventListener(t,n,!1)},ue.off=function(e,t,n){e.removeEventListener(t,n,!1)},ue.isFunction=function(e){return e&&"[object Function]"===Object.prototype.toString.call(e)},ue.isObject=function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},ue.isPromise=function(e){return e&&window.Promise&&e instanceof window.Promise},ue.isElement=function(e){return e instanceof HTMLElement},ue.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},ue.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^| )"+t.split(" ").join("|")+"( |$)","gi")," ")},ue.rawAjax=function(e){var t=new XMLHttpRequest;for(var n in t.open(e.type||"GET",e.url,!0,e.username,e.password),e.headers)t.setRequestHeader(n,e.headers[n]);e.success&&(t.onload=function(){200<=t.status&&t.status<400?e.success(t.responseText):e.error&&e.error()}),e.error&&(t.onerror=e.error),t.send(e.data||null)},ue.ajaxCache={},ue.ajax=function(e){if(e.username||e.password||e.headers||e.data||!e.cache)return ue.rawAjax(e);var t=e.type||"GET",n=t+":"+e.url,i=ue.ajaxCache[n];i||(ue.ajaxCache[n]=i={callback:[]}),i.result?e.success&&e.success(i.result):(i.callback.push(e),i.loading||(i.loading=!0,ue.rawAjax({type:t,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}})))},e='@charset "UTF-8";[al-cloak],[hidden],.al-hide{display:none !important;}',t=document.querySelectorAll("head")[0],(n=document.createElement("style")).setAttribute("type","text/css"),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n),ue.ready=(a=!(i=[]),ue.on(document,"DOMContentLoaded",function e(){a=!0,ue.off(document,"DOMContentLoaded",e);for(var t=0;t<i.length;t++)i[t]();i.length=0}),function(e){a?e():i.push(e)}),window.jQuery&&(window.jQuery.fn.alight=function(e){var n=[];if(this.each(function(e,t){return n.push(t)}),n.length)return U(n,e)}),U.core.getFilter=function(e,t){var n=t.locals[e];if(n&&(ue.isFunction(n)||n.init||n.fn))return n;if(n=U.filters[e])return n;throw"Filter not found: "+e},U.core.buildFilterNode=function(e,t,n,i){if(ue.isFunction(n))return de(n,{cd:e,filterConf:t,callback:i});if(n.init)return n.init.call(e,e.scope,t.raw,{setValue:i,conf:t,changeDetector:e});if(ue.isFunction(n.fn))return de(n.fn,{cd:e,filterConf:t,callback:i,watchMode:n.watchMode});throw"Wrong filter: "+t.name},U.ChangeDetector=function(e){var t,n;return n=new o,t=new u(n,e||{}),n.topCD=t},(o=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}).prototype.destroy=function(){if(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)return this.topCD.destroy()},(u=function(e,t){this.scope=t,this.locals=t,this.root=e,this.watchList=[],this.destroy_callbacks=[],this.parent=null,this.children=[],this.rwatchers={any:[],finishScan:[],elEvents:[]}}).prototype.new=function(e,t){var n,i,a;return t=t||{},a=this,null==e&&(e=a.scope),(i=new u(a.root,e)).parent=a,e===a.scope&&(t.locals?((n=a._ChildLocals)||(a._ChildLocals=n=function(){return this.$$root=e,this},n.prototype=a.locals),i.locals=new n):i.locals=a.locals),a.children.push(i),i},u.prototype.destroy=function(){var e,t,n,i,a,o,r,l,s,c,u,p,d,f,h,m,g,v,b,k,w,y,_;for(y=(e=this).root,e.scope=null,e.parent&&pe(e.parent.children,e),i=0,r=(m=e.destroy_callbacks).length;i<r;i++)(0,m[i])();for(a=0,l=(g=e.children.slice()).length;a<l;a++)g[a].destroy();for(o=e.destroy_callbacks.length=0,s=(v=e.watchList).length;o<s;o++)(t=v[o]).onStop&&t.onStop();for(d=e.watchList.length=0,c=(b=e.rwatchers.any).length;d<c;d++)_=b[d],pe(y.watchers.any,_);for(f=e.rwatchers.any.length=0,u=(k=e.rwatchers.finishScan).length;f<u;f++)_=k[f],pe(y.watchers.finishScan,_);for(h=e.rwatchers.finishScan.length=0,p=(w=this.rwatchers.elEvents).length;h<p;h++)n=w[h],ue.off(n[0],n[1],n[2]);this.rwatchers.elEvents.length=0,y.topCD===e&&(y.topCD=null,y.destroy())},r=function(e){return this.cb=e},l=function(e,t,n){var i,a;return i=e.root,a=new r(n),e.rwatchers[t].push(a),i.watchers[t].push(a),{stop:function(){return pe(e.rwatchers[t],a),pe(i.watchers[t],a)}}},u.prototype.on=function(e,t,n){return ue.on(e,t,n),this.rwatchers.elEvents.push([e,t,n])},f={$any:function(e,t){return l(e,"any",t)},$finishScan:function(e,t){return l(e,"finishScan",t)},$finishScanOnce:function(e,t){e.root.watchers.finishScanOnce.push(t)},$onScanOnce:function(e,t){e.root.watchers.onScanOnce.push(t)},$destroy:function(e,t){e.destroy_callbacks.push(t)},$finishBinding:function(e,t){e.root.watchers.finishBinding.push(t)}},_=function(){},u.prototype.watch=function(n,t,e){var i,a,o,r,l,s,c,u,p,d;if(l=f[n])return l(this,t);if(!0===(e=e||{})&&(e={isArray:!0}),e.init&&console.warn("watch.init is depricated"),(i=this).root,d=i.scope,ue.isFunction(n)?(r=n,u=U.utils.getId(),s=!0):(s=!1,r=null,"::"===(n=n.trim()).slice(0,2)&&(n=n.slice(2),e.oneTime=!0),u=n,u=e.deep?"d#"+u:e.isArray?"a#"+u:"v#"+u),U.debug.watch&&console.log("$watch",n),c=!1,!s)if(e.watchText)r=e.watchText.fn;else{if((a=U.utils.compile.expression(n)).filter)return function(t,e,n,i){var a=null,o=i.oneTime;if(i.isArray?a="array":i.deep&&(a="deep"),!n){var r={el:i.element,ea:i.elementAttr};n=function(e){j(t.scope,r,e)}}for(var l=U.utils.parsFilter(e.filter),s=[],c=l.result.length-1;0<=c;c--){var u=U.core.getFilter(l.result[c].name,t),p=U.core.buildFilterNode(t,l.result[c],u,n);p.watchMode&&(a=p.watchMode),p.onStop&&s.push(p.onStop),n=p.onChange}return i={oneTime:o},"array"===a?i.isArray=!0:"deep"===a&&(i.deep=!0),s.length&&(i.onStop=function(){s.forEach(function(e){return e()}),s.length=0}),t.watch(e.expression,n,i)}(i,a,t,e);c=a.isSimple&&0===a.simpleVariables.length,r=a.fn}return e.deep&&(e.isArray=!1),o={isStatic:c,isArray:Boolean(e.isArray),extraLoop:!e.readOnly,deep:!0===e.deep?10:e.deep,value:_,callback:t,exp:r,src:""+n,onStop:e.onStop||null,el:e.element||null,ea:e.elementAttr||null},c?i.watch("$onScanOnce",function(){return j(d,o,o.exp(d))}):i.watchList.push(o),p={$:o,stop:function(){var t;if(e.onStop)try{e.onStop()}catch(e){t=e,U.exceptionHandler(t,"Error in onStop of watcher: "+n,n)}if(!o.isStatic)return pe(i.watchList,o)},refresh:function(){var e;return(e=o.exp(i.locals))&&o.deep?o.value=U.utils.clone(e,o.deep):e&&o.isArray?o.value=e.slice():o.value=e}},e.oneTime&&(o.callback=function(e){if(void 0!==e)return p.stop(),t(e)}),p},u.prototype.watchGroup=function(e,t){var n,i,a,o,r,l;if(n=this,!t&&ue.isFunction(e)&&(t=e,e=null),l=!1,i=function(){if(!l)return l=!0,n.watch("$onScanOnce",function(){return l=!1,t()})},e)for(a=0,r=e.length;a<r;a++)o=e[a],n.watch(o,i);return i},c=window.performance?function(){return Math.floor(performance.now())}:function(){return(new Date).getTime()},y=function(e,t){var n,i,a,o;if(null===e||null===t)return!0;if((o=typeof e)!==typeof t)return!0;if("object"===o){if(e.length!==t.length)return!0;for(n=i=0,a=e.length;i<a;n=++i)if(e[n]!==t[n])return!0}return!1},j=function(e,t,n){t.el?t.ea?t.el.setAttribute(t.ea,n):t.el.nodeValue=n:t.callback.call(e,n)},w=function(e,t,n,i){var a,o;return a={src:n.src,scope:t.scope,locals:t.locals},n.el&&(a.element=n.el),o=1===i?"$scan, error in callback: ":"$scan, error in expression: ",U.exceptionHandler(e,o+n.src,a)},k=function(){},p=function(e,t){var n,i,a,o,r,l,s,c,u,p,d,f,h,m,g,v,b;if(e.root,l=!1,g=o=0,e){for(h=[],s=0,a=e;a;){for(d=a.locals,g+=a.watchList.length,c=0,p=(m=a.watchList.slice()).length;c<p;c++){u=(b=m[c]).value;try{v=b.exp(d)}catch(e){r=e,v=k}if(u!==v){if(f=!1,b.isArray?(n=Array.isArray(u))===(i=Array.isArray(v))?n?y(u,v)&&(f=!0,b.value=v.slice()):(f=!0,b.value=v):(f=!0,b.value=i?v.slice():v):b.deep?U.utils.equal(u,v,b.deep)||(f=!0,b.value=U.utils.clone(v,b.deep)):(f=!0,b.value=v),f)if(f=!1,v===k)w(r,a,b);else{o++;try{b.el?b.ea?null!=v?b.el.setAttribute(b.ea,v):b.el.removeAttribute(b.ea):b.el.nodeValue=v:(u===_&&(u=void 0),"$scanNoChanges"!==b.callback.call(a.scope,v,u)&&b.extraLoop&&(l=!0))}catch(e){w(r=e,a,b,1)}}1<U.debug.scan&&console.log("changed:",b.src)}}h.push.apply(h,a.children),a=h[s++]}t.total=g,t.changes=o,t.extraLoop=l}},u.prototype.digest=function(){var e,t,n,i,a,o,r,l,s;for(r=this.root,i=10,s=0,U.debug.scan&&(l=c()),o={total:0,changes:0,extraLoop:!1,src:"",scope:null,element:null};i;){if(i--,r.extraLoop=!1,r.watchers.onScanOnce.length)for(a=r.watchers.onScanOnce.slice(),t=r.watchers.onScanOnce.length=0,n=a.length;t<n;t++)a[t].call(r);if(p(this,o),s+=o.changes,!o.extraLoop&&!r.extraLoop&&!r.watchers.onScanOnce.length)break}return U.debug.scan&&(e=c()-l,console.log("$scan: loops: ("+(10-i)+"), last-loop changes: "+o.changes+", watches: "+o.total+" / "+e+"ms")),o.mainLoop=i,o.totalChanges=s,o},u.prototype.scan=function(e){var t,n,i,a,o,r,l,s,c,u,p;if(p=this.root,e=e||{},!U.option.zone||e.zone){if(ue.isFunction(e)&&(e={callback:e}),e.callback&&p.watchers.finishScanOnce.push(e.callback),e.late){if(p.lateScan)return;return p.lateScan=!0,void U.nextTick(function(){if(p.lateScan)return p.topCD.scan()})}if("scaning"!==p.status){if(p.lateScan=!1,p.status="scaning",(u=p.topCD?p.topCD.digest():{}).totalChanges)for(n=0,o=(s=p.watchers.any).length;n<o;n++)(0,s[n])();for(p.status=null,i=0,r=(c=p.watchers.finishScan).length;i<r;i++)(0,c[i])();for(t=p.watchers.finishScanOnce.slice(),a=p.watchers.finishScanOnce.length=0,l=t.length;a<l;a++)t[a].call(p);if(0===u.mainLoop)throw"Infinity loop detected";return u}p.extraLoop=!0}},(U.core.ChangeDetector=u).prototype.compile=function(e,t){return U.utils.compile.expression(e,t).fn},u.prototype.setValue=function(t,n){var i,a,o,r,l,s,c,u,p,d;o=(i=this).compile(t+" = $value",{input:["$value"],no_return:!0});try{return o(i.locals,n)}catch(e){if(a=e,u="can't set variable: "+t,U.debug.parser&&console.warn(u),0<=(""+a).indexOf("TypeError")&&(d=t.match(/^([\w\d\.]+)\.[\w\d]+$/))&&d[1]){for(c=i.locals,r=0,s=(p=d[1].split(".")).length;r<s;r++)void 0===c[l=p[r]]&&(c[l]={}),c=c[l];try{return void o(i.locals,n)}catch(e){}}return U.exceptionHandler(a,u,{name:t,value:n})}},u.prototype.eval=function(e){return this.compile(e)(this.locals)},u.prototype.getValue=function(e){return this.eval(e)},U.text.$base=function(t){var e,n,i,a,o;if(a=t.point,!(n=(o=(e=t.cd).scope).$ns&&o.$ns.text?o.$ns.text[t.name]:U.text[t.name]))throw"No directive alight.text."+t.name;return i={changeDetector:e,setter:function(e){if(t.update)return a.value=null===e?"":""+e,t.update()},setterRaw:function(e){if(t.updateRaw)return a.value=null===e?"":""+e,t.updateRaw()},finally:function(e){if(t.finally)return a.value=null===e?"":""+e,a.type="text",t.finally(),t.update=null,t.finally=null}},n.call(e,i.setter,t.exp,o,i)},s=function(e,t,n){var i,a,o,r,l,s,c,u,p,d,f,h,m,g,v,b,k,w,y,_,x,C,S,M,D,E,$,A,T;if(n=n||{},a=this,U.debug.watchText&&console.log("$watchText",e),M=U.utils.compile.buildSimpleText(e,null))a.watch(e,t,{watchText:M,element:n.element,elementAttr:n.elementAttr});else{for(l=U.utils.parsText(e),x=!(i=!(A=0)),c=u=s=function(){},m=0,b=l.length;m<b;m++)if("expression"===(r=l[m]).type)if(y=(p=r.list.join("|")).match(/^([^\w\d\s\$"'\(\u0410-\u044F\u0401\u0451]+)/))r.isDir=!0,_=y[1],p="#"===_?(h=p.indexOf(" "))<0?(_=p.substring(1),""):(_=p.slice(1,h),p.slice(h)):p.substring(_.length),U.text.$base({name:_,exp:p,cd:a,point:r,update:function(){return c()},updateRaw:function(){return u()},finally:function(){return c(),s()}}),x=!0,"text"!==r.type&&(i=!1);else if((o=U.utils.compile.expression(p,{string:!0})).filter)A++,i=!1,r.watched=!0,function(t){a.watch(p,function(e){return null==e&&(e=""),t.value=e,c()})}(r);else{if(r.fn=o.fn,!o.rawExpression)throw"Error";o.isSimple&&0===o.simpleVariables.length?(r.type="text",r.value=r.fn()):(r.re=o.rawExpression,A++)}if(i){if(A)return M=x?U.utils.compile.buildSimpleText(null,l):U.utils.compile.buildSimpleText(e,l),void a.watch(e,t,{watchText:{fn:M.fn},element:n.element,elementAttr:n.elementAttr});for(E="",g=0,k=l.length;g<k;g++)r=l[g],E+=r.value;a.watch("$onScanOnce",function(){return j(a.scope,{callback:t,el:n.element,ea:n.elementAttr},E)})}else if(T={callback:t,el:n.element,ea:n.elementAttr},l.scope=a.scope,f=U.utils.compile.buildText(e,l),u=function(){return j(a.scope,T,f())},A){for($=null,S="",c=function(){S=f()},s=function(){var e,t;for(h=!0,e=0,t=l.length;e<t;e++)if("expression"===(r=l[e]).type){h=!1;break}h&&(a.watch("$finishScanOnce",function(){return $.stop()}),n.onStatic&&n.onStatic())},C=function(){return S},v=0,w=l.length;v<w;v++)if("expression"===(r=l[v]).type){if(r.isDir||r.watched)continue;r.watched=!0,function(t,e){a.watch(e,function(e){return null==e&&(e=""),t.value=e,c()})}(r,r.list.join(" | "))}c(),$=a.watch(C,t,{element:n.element,elementAttr:n.elementAttr})}else D=!1,d=function(){return D=!1,u()},(c=function(){if(!D)return D=!0,a.watch("$onScanOnce",d)})()}},u.prototype.watchText=s,x={TR:1,TD:1,LI:1},U.utils.optmizeElement=function(e,t){var n,i,a,o,r,l,s,c,u,p,d,f,h,m,g,v,b,k,w;if(1===e.nodeType){for(t=t||!U.option.domOptimizationRemoveEmpty,"PRE"===e.nodeName&&(t=!0),!(o=e.firstChild)||3!==o.nodeType||o.nodeValue.trim()||t||(ue.remove(o),o=e.firstChild),g=!1;o;)h=o.nextSibling,!g||3!==o.nodeType||o.nodeValue.trim()||t?(g=1===o.nodeType&&x[o.nodeName],U.utils.optmizeElement(o,t)):ue.remove(o),o=h;!(o=e.lastChild)||3!==o.nodeType||o.nodeValue.trim()||t||ue.remove(o)}else if(3===e.nodeType){if(k=e.data,d=U.utils.pars_start_tag,(l=k.indexOf(d))<0)return;if(k.slice(l+d.length).indexOf(d)<0)return;for(m="t",b=[n={value:""}],s=0,u=(a=U.utils.parsText(k)).length;s<u;s++)"text"===(i=a[s]).type?n.value+=i.value:(r=i.list.join("|"),w=U.utils.pars_start_tag+r+U.utils.pars_finish_tag,r.match(/^([^\w\d\s\$"'\(\u0410-\u044F\u0401\u0451]+)/)?("t"===m||"d"===m?n.value+=w:(n={value:w},b.push(n)),m="d"):1===i.list.length?("t"===m||"v"===m?n.value+=w:(n={value:w},b.push(n)),m="v"):"t"===m?n.value+=w:(n={value:w},b.push(n)));if(b.length<2)return;for((o=e).data=b[0].value,c=0,p=(v=b.slice(1)).length;c<p;c++)i=v[c],f=document.createTextNode(i.value),ue.after(o,f),o=f}},U.hooks.attribute=g=[],g.push({code:"dataPrefix",fn:function(){"data-"===this.attrName.slice(0,5)&&(this.attrName=this.attrName.slice(5))}}),g.push({code:"colonNameSpace",fn:function(){var e,t;this.directive||this.name||((t=(e=(t=this.attrName.match(/^(\w+)[\-\:](.+)$/))?(this.ns=t[1],t[2]):(this.ns="$global",this.attrName)).match(/^([^\.]+)\.(.*)$/))&&(e=t[1],this.attrArgument=t[2]),this.name=e.replace(/(-\w)/g,function(e){return e.substring(1).toUpperCase()}))}}),g.push({code:"getGlobalDirective",fn:function(){var e;if(!this.directive){if(!(e=U.d[this.ns]))return this.result="noNS",void(this.stop=!0);this.directive=e[this.name],this.directive||("$global"===this.ns?this.result="noNS":this.result="noDirective",this.stop=!0)}}}),g.push({code:"cloneDirective",fn:function(){var e,t,n,i,a,o;if(a=this.directive,i=this.ns,n=this.name,e={},ue.isFunction(a))e.init=a;else{if(!ue.isObject(a))throw"Wrong directive: "+i+"."+n;for(t in a)o=a[t],e[t]=o}if(e.priority=a.priority||U.priority[i]&&U.priority[i][n]||0,e.restrict=a.restrict||"A",e.restrict.indexOf(this.attrType)<0)throw"Directive has wrong binding (attribute/element): "+n;this.directive=e}}),g.push({code:"preprocessor",fn:function(){var r,l,s;s=this.ns,l=this.name,(r=this.directive).$init=function(e,t,n,i){var a,o;if(o={element:t,value:n,cd:e,env:i,ns:s,name:l,doBinding:(a=function(){var e,t,n,i;for(e=t=0,i=(n=o.procLine).length;t<i;e=++t)if(n[e].fn.call(o),o.isDeferred){o.procLine=n.slice(e+1);break}return o.async=!0,null},!1),directive:r,isDeferred:!1,procLine:U.hooks.directive,makeDeferred:function(){return o.isDeferred=!0,o.doBinding=!0,o.retStopBinding=!0,o.async=!1,function(){if(o.isDeferred=!1,o.async)return a()}}},r.stopBinding&&(i.stopBinding=!0),a(),o.retStopBinding)return"stopBinding"}}}),(v=U.hooks.directive).push({code:"init",fn:function(){var e;this.directive.init&&(U.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,(e=this.directive.init.call(this.env,this.cd.scope,this.element,this.value,this.env))&&e.start&&e.start())}}),v.push({code:"templateUrl",fn:function(){var t,n;(n=this).directive.templateUrl&&(t=this.makeDeferred(),ue.ajax({cache:!0,url:this.directive.templateUrl,success:function(e){return n.directive.template=e,t()},error:t}))}}),v.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")).innerHTML=this.directive.template.trim(),e=e.firstChild,ue.after(this.element,e),this.element=e,this.doBinding=!0))}}),v.push({code:"scope",fn:function(){var e,t;if(this.directive.scope){switch(t=this.cd,this.directive.scope){case!0:e=t.new({$parent:t.scope});break;case"root":e=U.ChangeDetector({$parent:t.scope}),t.watch("$destroy",function(){return e.destroy()});break;default:throw"Wrong scope value: "+this.directive.scope}this.env.parentChangeDetector=t,this.cd=e,this.doBinding=!0,this.retStopBinding=!0}}}),v.push({code:"link",fn:function(){var e;this.directive.link&&(this.env.changeDetector=this.cd,(e=this.directive.link.call(this.env,this.cd.scope,this.element,this.value,this.env))&&e.start&&e.start())}}),v.push({code:"scopeBinding",fn:function(){this.doBinding&&!this.env.stopBinding&&U.bind(this.cd,this.element,{skip_attr:this.env.skippedAttr()})}}),b=function(e,t,n){var i;"A"===t.attr_type?((i=n||{}).priority=U.priority.$attribute,i.is_attr=!0,i.name=e,i.attrName=e,i.element=t.element,t.list.push(i)):"M"===t.attr_type&&t.list.push(n)},O=function(e,t){var n,i,a,o;if(0<=t.skip_attr.indexOf(e))return b(e,t,{skip:!0});for(n={attrName:e,attrType:t.attr_type,element:t.element,cd:t.cd,result:null},i=0,a=(o=U.hooks.attribute).length;i<a&&(o[i].fn.call(n),!n.stop);i++);if("noNS"!==n.result)return"noDirective"===n.result?"E"===t.attr_type?void t.list.push({name:e,priority:-10,attrName:e,noDirective:!0}):void b(e,t,{noDirective:!0}):void t.list.push({name:e,directive:n.directive,priority:n.directive.priority,attrName:e,attrArgument:n.attrArgument});b(e,t)},B=function(e,t){return e.priority===t.priority?0:e.priority>t.priority?-1:1},I=function(e,t,n,i){var a;if(!((a=n).indexOf(U.utils.pars_start_tag)<0))return e.watchText(a,null,{element:t,elementAttr:i}),!0},m=function(e,t,n){var i;if(!((i=t.data).indexOf(U.utils.pars_start_tag)<0))return e.watchText(i,null,{element:t}),i},d=function(t,n,e){var i,a,o,r,l,s,c,u,p,d;if("directive:"===(p=n.nodeValue.trim()).slice(0,10)){if(d=0<=(c=(p=p.slice(10).trim()).indexOf(" "))?(o=p.slice(0,+(c-1)+1||9e9),p.slice(c+1)):(o=p,""),i={list:u=[],element:n,attr_type:"M",cd:t,skip_attr:[]},O(o,i),(a=u[0]).noDirective)throw"Comment directive not found: "+o;r=a.directive,s=new T({element:n,attrName:a.attrName,attributes:u}),U.debug.directive&&console.log("bind",a.attrName,d,a);try{r.$init(t,n,d,s)}catch(e){l=e,U.exceptionHandler(l,"Error in directive: "+a.name,{value:d,env:s,cd:t,scope:t.scope,element:n})}return s.skipToElement?{directive:1,skipToElement:s.skipToElement}:{directive:1,skipToElement:null}}},(T=function(e){var t,n;for(t in e)n=e[t],this[t]=n;return this}).prototype.takeAttr=function(e,t){var n,i,a,o;for(1===arguments.length&&(t=!0),i=0,a=(o=this.attributes).length;i<a;i++)if((n=o[i]).attrName===e)return t&&(n.skip=!0),this.element.getAttribute(e)||!0},T.prototype.skippedAttr=function(){var e,t,n,i,a;for(a=[],t=0,n=(i=this.attributes).length;t<n;t++)(e=i[t]).skip&&a.push(e.attrName);return a},T.prototype.scan=function(e){return this.changeDetector.scan(e)},T.prototype.on=function(e,t,n){return this.changeDetector.on(e,t,n)},T.prototype.watch=function(e,t,n){return this.changeDetector.watch(e,t,n)},T.prototype.watchGroup=function(e,t){return this.changeDetector.watchGroup(e,t)},T.prototype.watchText=function(e,t,n){return this.changeDetector.watchText(e,t,n)},T.prototype.getValue=function(e){return this.changeDetector.getValue(e)},T.prototype.setValue=function(e,t){return this.changeDetector.setValue(e,t)},T.prototype.eval=function(e){return this.changeDetector.eval(e)},T.prototype.new=function(e,t){return!0===t?t={locals:!0}:!0===e&&null==t&&(t={locals:!(e=null)}),this.changeDetector.new(e,t)},T.prototype.bind=function(e,t,n){var i,a,o,r,l,s,c;for(this.stopBinding=!0,l=o=0,s=arguments.length;l<s;l++)(i=arguments[l])instanceof u&&(a=i,o+=1),ue.isElement(i)&&(r=i,o+=1);return(c=arguments[o])||(c={skip:this.skippedAttr()}),r||(r=this.element),a||(a=this.changeDetector),U.bind(a,r,c)},h=function(t,a,e){var n,i,o,r,l,s,c,u,p,d,f,h,m,g,v,b,k,w,y,_,x,C,S,M,D,E,$,A;if(r={directive:0,hook:0,skipToElement:null,fb:m={attr:[],dir:[],children:[]}},D=!1,$=(e=e||{}).skip_attr,!0===e.skip?e.skip_top=!0:$||($=e.skip||[]),$ instanceof Array||($=[$]),!e.skip_top){for(n={list:y=[],element:a,skip_attr:$,attr_type:"E",cd:t},o=a.nodeName.toLowerCase(),O(o,n),"script"!==o&&"style"!==o||(D=!0),n.attr_type="A",v=0,b=(S=a.attributes).length;v<b;v++)i=S[v],O(i.name,n);if(e.attachDirective)for(o in M=e.attachDirective)M[o],O(o,n);for(_=0,k=(y=y.sort(B)).length;_<k;_++)if(!(u=y[_]).skip){if(u.noDirective)throw"Directive not found: "+u.name;if(u.skip=!0,A=e.attachDirective&&e.attachDirective[u.attrName]?e.attachDirective[u.attrName]:a.getAttribute(u.attrName),u.is_attr)I(t,a,A,u.attrName)&&m.attr.push({attrName:u.attrName,value:A});else{p=u.directive,f=new T({element:a,attrName:u.attrName,attrArgument:u.attrArgument||null,attributes:y,stopBinding:!1,elementCanBeRemoved:e.elementCanBeRemoved,fbElement:e.fbElement}),U.debug.directive&&console.log("bind",u.attrName,A,u);try{"stopBinding"===p.$init(t,a,A,f)&&(D=!0)}catch(e){d=e,U.exceptionHandler(d,"Error in directive: "+u.attrName,{value:A,env:f,cd:t,scope:t.scope,element:a})}if(f.fastBinding?(h=ue.isFunction(f.fastBinding)?f.fastBinding:p.init,m.dir.push({fb:h,attrName:u.attrName,value:A,attrArgument:f.attrArgument,fbData:f.fbData})):r.directive++,f.stopBinding){D=!0;break}f.skipToElement&&(r.skipToElement=f.skipToElement)}}}if(!D)for(E=null,g=x=0,w=(s=function(){var e,t,n,i;for(i=[],t=0,e=(n=a.childNodes).length;t<e;t++)l=n[t],i.push(l);return i}()).length;x<w;g=++x)(l=s[g])&&(E?E===l&&(E=null):(e.fbElement&&(c={fbElement:e.fbElement.childNodes[g]}),C=N(t,l,c),r.directive+=C.directive,r.hook+=C.hook,E=C.skipToElement,C.fb&&(C.fb.text||C.fb.attr&&C.fb.attr.length||C.fb.dir&&C.fb.dir.length||C.fb.children&&C.fb.children.length)&&m.children.push({index:g,fb:C.fb})));return r},N=function(e,t,n){var i,a,o,r,l,s,c;if(s={directive:0,hook:0,skipToElement:null,fb:null},U.hooks.binding.length)for(a=0,o=(l=U.hooks.binding).length;a<o;a++)if(i=l[a],s.hook+=1,(r=i.fn(e,t,n))&&r.owner)return s;return 1===t.nodeType?(r=h(e,t,n),s.directive+=r.directive,s.hook+=r.hook,s.skipToElement=r.skipToElement,s.fb=r.fb):3===t.nodeType?(c=m(e,t))&&(s.fb={text:c}):8===t.nodeType&&(r=d(e,t))&&(s.directive+=r.directive,s.skipToElement=r.skipToElement),s},U.nextTick=(M=null,S=[],C=function(){var t,e,n,i,a,o,r;for(M=null,e=S.slice(),a=S.length=0,o=e.length;a<o;a++){t=(i=e[a])[0],r=i[1];try{t.call(r)}catch(e){n=e,U.exceptionHandler(n,"$nextTick, error in function",{fn:t,self:r})}}return null},function(e){if(S.push([e,this]),!M)return M=setTimeout(C,0)}),U.bind=function(e,t,n){var i,a,o,r,l,s;if(!e)throw"No changeDetector";if(!t)throw"No element";if(n=n||{},U.option.domOptimization&&!n.noDomOptimization&&U.utils.optmizeElement(t),(i=!(s=e.root).finishBinding_lock)&&(s.finishBinding_lock=!0,s.bindingResult={directive:0,hook:0}),l=N(e,t,n),s.bindingResult.directive+=l.directive,s.bindingResult.hook+=l.hook,e.digest(),i){for(s.finishBinding_lock=!1,r=s.watchers.finishBinding.slice(),a=s.watchers.finishBinding.length=0,o=r.length;a<o;a++)(0,r[a])();l.total=s.bindingResult}return l},function(){function l(e,t,n,i,a,o){i.callback.apply(null,o);var r=t._properties.root;r&&r.topCD&&r.topCD.scan({zone:!0})}var s=U.bind;U.bind=function(e,t,n){var i=e.root,a=U.option.zone;if(a){var o=!0===a?Zone:a,r=i.zone;if(r||(i.zone=r=o.current.fork({name:o.current.name+".x",properties:{root:i},onInvokeTask:l})),o.current!==r)return i.zone.run(s,null,[e,t,n])}return s(e,t,n)}}(),U.bootstrap=function(e,t){if(!e)return U.bootstrap("[al-app]"),U.bootstrap("[al\\:app]"),void U.bootstrap("[data-al-app]");var n;if(e instanceof U.core.ChangeDetector)n=e,e=t;else if(t instanceof U.core.ChangeDetector)n=t;else if(ue.isFunction(t)){var i={};n=U.ChangeDetector(i),t.call(n,i)}else t&&(n=U.ChangeDetector(t));if(Array.isArray(e)){for(var a=void 0,o=0,r=e;o<r.length;o++){var l=r[o];a=U.bootstrap(l,n)}return a}if("string"==typeof e){a=void 0;for(var s=0,c=document.querySelectorAll(e);s<c.length;s++){var u=c[s];a=U.bootstrap(u,n)}return a}if(n||(n=U.ChangeDetector()),ue.isElement(e)){for(var p,d,f,h=0,m=["al-app","al:app","data-al-app"];h<m.length&&(p=m[h],d=e.getAttribute(p),e.removeAttribute(p),!d);h++);return d&&(f={skip_attr:[p],attachDirective:{}},U.d.al.ctrl?f.attachDirective["al-ctrl"]=d:f.attachDirective[d+"!"]=""),U.bind(n,e,f),n}U.exceptionHandler("Error in bootstrap","Error input arguments",{input:e})},U.utils.getId=(A=function(){var e,t,n,i,a;for(a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),n=Math.floor((new Date).valueOf()/1e3)-1388512800,i="";0<n;)t=n-62*(e=Math.floor(n/62)),n=e,i=a[t]+i;return i}(),$=1,function(){return A+"#"+$++}),U.utils.clone=D=function(i,a){var o,e,t,n;if(null==a&&(a=128),a<1)return null;if(!i)return i;if("object"!=typeof i)return i;if(i instanceof Array)return t=function(){var e,t,n;for(n=[],e=0,t=i.length;e<t;e++)o=i[e],n.push(D(o,a-1));return n}();if(i instanceof Date)return new Date(i.valueOf());if(i.nodeType&&"function"==typeof i.cloneNode)return i;for(e in t={},i)n=i[e],"$"!==e[0]&&(t[e]=D(n,a-1));return t},U.utils.equal=E=function(e,t,n){var i,a,o,r,l,s,c;if(null==n&&(n=128),n<1)return!0;if(!e||!t)return e===t;if((s=typeof e)!==typeof t)return!1;if("object"!==s)return e===t;if(e instanceof Array){if(e.length!==t.length)return!1;for(i=a=0,r=e.length;a<r;i=++a)if(c=e[i],!E(c,t[i],n-1))return!1;return!0}if(e instanceof Date)return e.valueOf()===t.valueOf();if(e.nodeType&&"function"==typeof e.cloneNode)return e===t;for(o in l={},e)if(c=e[o],"$"!==o[0]&&(l[o]=!0,!E(c,t[o],n-1)))return!1;for(o in t)if(c=t[o],"$"!==o[0]&&!l[o]&&!E(c,e[o],n-1))return!1;return!0},U.exceptionHandler=function(e,t,n){var i;return i=[],t&&i.push(t),e&&e.message&&i.push(e.message),n&&i.push(n),e&&i.push(e.stack?e.stack:e),console.error.apply(console,i)},z=(W=function(){var e,t,n;for(n={},e=0,t=arguments.length;e<t;e++)n[arguments[e]]=!0;return n})("instanceof","typeof","in","null","true","false","undefined","return"),V=/[a-zA-Z\u0410-\u044F\u0401\u0451_\.\$]/,L=function(e){return e.match(V)},R=function(e){return 48<=e.charCodeAt()&&e.charCodeAt()<=57},P=W("+","-",">","<","=","&","|","^","!","~"),H=function(e){return P[e]||!1},F=W("=","+=","-=","++","--","|=","^=","&=","!=","<<=",">>="),U.utils.parsExpression=function(e,t){var h,m,n,p,g,_,v,b,d,x;return g=W.apply(null,(t=t||{}).input||[]),x=1,n=(_=function(e){var t,n,i,a,o,r,l,s,c,u,p,d,f,h,m,g,v,b,k,w,y;for(f=e.line,h=e.result||[],u=e.index||0,d=e.level||0,v=e.stopKey||null,g=!(y=[]),c=k=b=l=m=w="",a=0,s=p=null,r=function(){return c&&h.push({type:"free",value:c}),c=""};u<=f.length;)if(i=f[u-1],t=f[u++]||"",n=f[u],(g&&c||!t)&&r(),"string"!==g){if("key"===g){if(L(t)||R(t)){w+=t;continue}if("["===t){if(w+=t,!(o=_({line:f,index:u,level:d+1,stopKey:"]"})).stopKeyOk)throw"Error expression";u=o.index,w+="###"+o.uniq+"###]",y.push(o);continue}if("?"===t&&("."===n||"("===n||"["===n)){w+=t;continue}if("("===t){if(w+=t,!(o=_({line:f,index:u,level:d+1,stopKey:")"})).stopKeyOk)throw"Error expression";u=o.index,w+="###"+o.uniq+"###)",y.push(o);continue}p={type:"key",value:w,start:u-w.length-1,finish:u-1,children:y},h.push(p),w=g="",y=[]}else if("sign"===g){if(H(t)){m+=t;continue}if("|"===m&&0===d&&0===a){s=f.substring(u-1),u=f.length+1;continue}(F[m]||"="===m[0]&&"="!==m[1])&&(p.assignment=!0),h.push({type:"sign",value:m}),m=g=""}else if("digit"===g){if(R(t)||"."===t){l+=t;continue}h.push({type:"digit",value:l}),l=""}if(L(t))g="key",w+=t;else if(H(t))g="sign",m+=t;else if(R(t))g="digit",l+=t;else if('"'!==t&&"'"!==t){if(t===v)return r(),{result:h,index:u,stopKeyOk:!0,uniq:x++};"("===t&&a++,")"===t&&a--,"{"!==t?(":"===t&&"}"===v&&(p.type="free"),c+=t):(r(),o=_({line:f,index:u,level:d+1,stopKey:"}"}),h.push({type:"{}",child:o}),u=o.index)}else g="string",k+=b=t}else{if(t===b&&"\\"!==i){k+=t,h.push({type:"string",value:k}),g=b=k="";continue}k+=t}return r(),{result:h,index:u,filter:s}})({line:e}),v={isSimple:!n.filter,simpleVariables:[]},n.filter?(v.expression=e.substring(0,e.length-n.filter.length-1),v.filter=n.filter):v.expression=e,b=function(e){var t;return{count:(t=e.split(/[\.\[\(\?]/)).length,firstPart:t[0]}},d=function(e,t){return t?"($$="+e+",$$==null)?undefined:":"($$=$$"+e+",$$==null)?undefined:"},p=function(e){return e.split(/[\.\[\(\?]/)[0]},m=function(e){var t,n,i,a,o,r,l,s,c,u;if("this"===e)return"$$scope";if(t=p(e),a=z[t]||g[t],"this"===t&&(e="$$scope"+e.slice(4),a=!0),1===(s=e.split("?")).length)return a?e:"$$scope."+e;for(n=a?(u=d(s[0],!0),s[0]):(u=d("scope."+s[0]),"scope."+s[0]),i=0,r=(c=s.slice(1,s.length-1)).length;i<r;i++)"("===(l=c[i])[0]?u+=d(n+l,a):(u+=d(l),n+=l);return"("===(o=s[s.length-1])[0]?(a||(u+="$$"),u+=n+o):u+="$$"+o,"("+u+")"},h=function(e){var t,n,i,a,o,r,l,s,c,u,p,d,f;for(d="",a=0,l=(u=e.result).length;a<l;a++)if("key"!==(i=u[a]).type)"{}"!==i.type?d+=i.value:d+="{"+h(i.child)+"}";else{if(i.assignment?(c="this"===(f=b(i.value)).firstPart?"$$scope"+i.value.substring(4):g[f.firstPart]?i.value:f.count<2?"($$scope.$$root || $$scope)."+i.value:"$$scope."+i.value,v.isSimple=!1):z[i.value]?c=i.value:(c=m(i.value),v.simpleVariables.push(c)),i.children.length)for(o=0,s=(p=i.children).length;o<s;o++)r="###"+(t=p[o]).uniq+"###",n=h(t),c=c.split(r).join(n);d+=c}return d},v.result=h(n),U.debug.parser&&console.log(e,v),v},U.utils.parsFilter=function(e){var t,n,i;for(i=[],e=e.trim();e;){if(!(t=e.match(/^(\w+)([^\w])(.*)$/))){if(!(t=e.match(/^(\w+)$/)))return null;i.push({name:t[1],args:[],raw:""});break}e="|"===t[2]?(i.push({name:t[1],args:[],raw:""}),t[3]):(n=U.utils.parsArguments(t[3],{stop:"|"}),i.push({name:t[1],args:n.result,raw:t[3].slice(0,n.length)}),t[3].slice(n.length+1).trim())}return{result:i}},U.utils.parsArguments=function(e,t){var n,i,a,o,r,l,s,c;for(t=t||{},i="",o=r=0,c=s=!(a=[]),l=function(){i&&(a.push(i),i="")};r<=e.length;)if(n=e[r]||"",r++,s)i+=n,'"'===n&&(s=!1);else if(c)i+=n,"'"===n&&(c=!1);else if('"'!==n)if("'"!==n)if(o)i+=n,"("===n&&o++,")"===n&&o--;else if(" "!==n&&","!==n){if(t.stop&&t.stop===n){l();break}"("===n&&(o=1),i+=n}else l();else i+=n,c=!0;else i+=n,s=!0;return l(),{result:a,length:r-1}},U.utils.pars_start_tag="{{",U.utils.pars_finish_tag="}}",K=function(r){var l,s,c,u,n,p,d,a;return a=U.utils.pars_start_tag,l=U.utils.pars_finish_tag,p=[],n=c=0,s=function(e){var t;return e=e||1,t=r.substring(n,c-e),n=c,t},d=null,u=function(e,t,n){var i,a,o;for(e||(d={type:"expression",list:[]},p.push(d)),i=null;c<r.length;){if(a=i+(i=r[c]),o=r[c+=1],i===t)return;if(!n){if(a===l&&0===e)return d.list.push(s(2)),!0;"("===i?u(e+1,")"):"{"===i?u(e+1,"}"):'"'===i?u(e+1,'"',!0):"'"===i?u(e+1,"'",!0):"|"===i&&0===e&&("|"===o?c+=1:d.list.push(s()))}}},function(){var e,t,n,i;for(e=t=null;c<r.length;)if(t=e,e=r[c],c+=1,t+e===a){if((i=s(2))&&p.push({type:"text",value:i}),!u(0))throw"Wrong expression"+r;e=null}if(n=s(-1))p.push({type:"text",value:n})}(),U.debug.parser&&console.log("parsText",p),p},X={},Y=function(i){var a,o;return function(){var e,t,n;for(n=[],e=0,t=i.length;e<t;e++)a=i[e],o={type:a.type,value:a.value},a.list&&(o.list=a.list.slice()),n.push(o);return n}()},U.utils.parsText=function(e){var t;return(t=X[e])||(X[e]=t=K(e)),Y(t)},U.utils.compile=J={},J.cache={},J.Function=Function,J.expression=function(t,n){var e,i,a,o,r,l,s;if(n=n||{},l=(t=t.trim())+"#",l+=n.no_return?"+":"-",l+=n.string?"s":"v",n.input&&(l+=n.input.join(",")),r=J.cache[l])return r;a=(r=U.utils.parsExpression(t,{input:n.input})).result,n.no_return?s="var $$;"+a:n.string&&!r.filter?(s="var $$, __ = ("+a+"); return '' + (__ || (__ == null?'':__))",r.rawExpression="(__="+a+") || (__ == null?'':__)"):s="var $$;return ("+a+")";try{o=n.input?((e=n.input.slice()).unshift("$$scope"),e.push(s),J.Function.apply(null,e)):J.Function("$$scope",s)}catch(e){throw i=e,U.exceptionHandler(i,"Wrong expression: "+t,{src:t,cfg:n}),"Wrong expression: "+a}return r.fn=o,J.cache[l]=r},J.cacheText={},J.buildText=function(e,t){var n,i,a,o,r,l,s;if(a=J.cacheText[e])return function(){return a.call(t)};for(s=[],r=o=0,l=t.length;o<l;r=++o)"expression"===(n=t[r]).type?n.fn?s.push("this["+r+"].fn(this.scope)"):s.push("((x=this["+r+"].value) || (x == null?'':x))"):n.value&&(i=n.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),s.push('"'+i+'"'));return s=s.join(" + "),a=J.Function("var x; return ("+s+")"),J.cacheText[e]=a,function(){return a.call(t)}},J.cacheSimpleText={},J.buildSimpleText=function(e,t){var n,i,a,o,r,l,s,c;if((r=e?J.cacheSimpleText[e]:null)||!t)return r||null;for(s=[],c=[],o=a=0,l=t.length;a<l;o=++a)"expression"===(n=t[o]).type?(s.push("("+n.re+")"),n.simpleVariables&&c.push.apply(c,n.simpleVariables)):n.value&&(i=n.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),s.push('"'+i+'"'));return s=s.join(" + "),r={fn:J.Function("$$scope","var $$, __; return ("+s+")"),simpleVariables:c},e&&(J.cacheSimpleText[e]=r),r},Z=function(e){var t,n,i;if(!e.length)return"el";for(i="el",t=0,n=e.length;t<n;t++)i+=".childNodes["+e[t]+"]";return i},G=function(e){var t,n,i,a,o,r;for(a=0,r=(i=U.utils.parsText(e)).length;a<r;a++)if("expression"===(n=i[a]).type){if(1<n.list.length)return null;if("#"===(o=n.list[0])[0])return null;if("="===o[0])return null;if("::"===o.slice(0,2))return null;if(!(t=U.utils.compile.expression(o,{string:!0})).rawExpression)throw"Error";n.re=t.rawExpression}return U.utils.compile.buildSimpleText(e,i).fn},U.core.fastBinding=function(e){if(U.option.fastBinding&&!e.directive&&!e.hook&&e.fb)return new q(e)},(q=function(e){var b,k,w,y;return w=[],(k=this).fastWatchFn=[],b=[],(y=function(e,t){var n,i,a,o,r,l,s,c,u,p,d,f,h,m,g,v;if(e.dir)for(m=Z(b),o=0,c=(d=e.dir).length;o<c;o++)n=d[o],w.push("s.dir("+k.fastWatchFn.length+", "+m+");"),k.fastWatchFn.push(n);if(e.attr)for(r=0,u=(f=e.attr).length;r<u;r++)v=(a=f[r]).value,l=a.attrName,m=Z(b),i=G(v),g=v.replace(/"/g,'\\"').replace(/\n/g,"\\n"),i?(w.push('s.fw("'+g+'", '+k.fastWatchFn.length+", "+m+', "'+l+'");'),k.fastWatchFn.push(i)):w.push("s.wt('"+g+"', "+m+", '"+l+"');");if(e.text&&(m=Z(b),i=G(e.text),g=e.text.replace(/"/g,'\\"').replace(/\n/g,"\\n"),i?(w.push('s.fw("'+g+'", '+k.fastWatchFn.length+", "+m+");"),k.fastWatchFn.push(i)):w.push('s.wt("'+g+'", '+m+");")),e.children)for(s=0,p=(h=e.children).length;s<p;s++)a=h[s],b.length=t+1,b[t]=a.index,y(a.fb,t+1)})(e.fb,0),w=w.join("\n"),k.resultFn=U.utils.compile.Function("s","el","f$",w),this}).prototype.bind=function(e,t){this.currentCD=e,this.resultFn(this,t,ue)},q.prototype.dir=function(e,t){var n,i,a,o;i=this.fastWatchFn[e],n=this.currentCD,a=new T({attrName:i.attrName,attrArgument:i.attrArgument,changeDetector:n,fbData:i.fbData}),(o=i.fb.call(a,n.scope,t,i.value,a))&&o.start&&o.start()},q.prototype.fw=function(e,t,n,i){var a,o,r,l;a=this.currentCD,l={isStatic:!1,isArray:!1,extraLoop:!1,deep:!1,value:r=(o=this.fastWatchFn[t])(a.locals),callback:null,exp:o,src:e,onStop:null,el:n,ea:i||null},a.watchList.push(l),j(a.scope,l,r)},q.prototype.wt=function(e,t,n){this.currentCD.watchText(e,null,{element:t,elementAttr:n})},U.hooks.attribute.unshift({code:"events",fn:function(){var e;(e=this.attrName.match(/^\@([\w\.\-]+)$/))&&(this.ns="al",this.name="on",this.attrArgument=e[1])}}),U.hooks.eventModifier={},(re=function(e,n){return U.hooks.eventModifier[e]={event:["keydown","keypress","keyup"],fn:function(e,t){e[n]||(t.stop=!0)}}})("alt","altKey"),re("control","ctrlKey"),re("ctrl","ctrlKey"),re("meta","metaKey"),re("shift","shiftKey"),U.hooks.eventModifier.self=function(e,t){if(e.target!==t.element)return t.stop=!0},U.hooks.eventModifier.once={beforeExec:function(e,t){return t.unbind()}},te=function(e,t){var n,i,a,o,r,l;if(l={},"string"==typeof e?l.event=e:"object"==typeof e&&e.event&&(l.event=e.event),"string"==typeof l.event&&(l.event=l.event.split(/\s+/)),t&&l.event){for(a=!1,i=0,o=(r=l.event).length;i<o;i++)if(n=r[i],0<=t.indexOf(n)){a=!0;break}if(!a)return null}return ue.isFunction(e)?l.fn=e:e.fn&&(l.fn=e.fn),e.beforeExec&&(l.beforeExec=e.beforeExec),e.init&&(l.init=e.init),l},U.d.al.on=function(e,t,n,i){var u,a;i.attrArgument&&(U.option.removeAttribute&&(t.removeAttribute(i.attrName),i.fbElement&&i.fbElement.removeAttribute(i.attrName)),a=i.attrArgument.split(".")[0],(u=function(){}).prototype=oe(i.attrArgument,Q[a]),n&&(u.prototype.fn=i.changeDetector.compile(n,{no_return:!0,input:["$event","$element","$value"]})),u.prototype.expression=n,i.fastBinding=function(e,i,t,n){var a,o,r,l,s,c;for((r=new u).scope=e,r.element=i,r.cd=n.changeDetector,a=function(e){return ie(r,e)},l=0,s=(c=r.eventList).length;l<s;l++)o=c[l],ue.on(i,o,a);r.initFn&&r.initFn(e,i,t,n),r.unbind=function(){var e,t,n;for(e=0,t=(n=r.eventList).length;e<t;e++)o=n[e],ue.off(i,o,a)},n.changeDetector.watch("$destroy",r.unbind)},i.fastBinding(e,t,n,i))},ae={enter:13,tab:9,delete:46,backspace:8,esc:27,space:32,up:38,down:40,left:37,right:39},Q={click:{stop:!0,prevent:!0},dblclick:{stop:!0,prevent:!0},submit:{stop:!0,prevent:!0},keyup:{filterByKey:!0},keypress:{filterByKey:!0},keydown:{filterByKey:!0}},oe=function(e,t){var n,i,a,o,r,l,s,c,u;for(i={attrArgument:e,throttle:null,throttleTime:0,debounce:null,debounceId:null,initFn:null,eventList:null,stop:(t=t||{}).stop||!1,prevent:t.prevent||!1,scan:!0,modifiers:[]},a=(n=e.split("."))[0],o=null,(c=U.hooks.eventModifier[a])&&(c=te(c)).event&&(i.eventList=c.event,c.fn&&i.modifiers.push(c),c.init&&(i.initFn=c.init)),i.eventList||(i.eventList=[a]),r=0,s=(u=n.slice(1)).length;r<s;r++)"stop"!==(l=u[r])?"prevent"!==l?"nostop"!==l?"noprevent"!==l?"noscan"!==l?"throttle-"!==l.substring(0,9)?"debounce-"!==l.substring(0,9)?(c=U.hooks.eventModifier[l])?(c=te(c,i.eventList))&&i.modifiers.push(c):t.filterByKey&&(null===o&&(o={}),ae[l]&&(l=ae[l]),o[l]=!0):i.debounce=Number(l.substring(9)):i.throttle=Number(l.substring(9)):i.scan=!1:i.prevent=!1:i.stop=!1:i.prevent=!0:i.stop=!0;return i.filterByKey=o,i},ne=function(e,t){var n;return"checkbox"===(n=e.element).type?n.checked:"radio"===n.type?n.value||n.checked:t.component?t.value:n.value},ee=function(t,n){var i,e,a,o,r;for(e=0,a=(r=t.modifiers).length;e<a;e++)(o=r[e]).beforeExec&&o.beforeExec(n,t);if(t.fn)try{t.fn(t.cd.locals,n,t.element,ne(t,n))}catch(e){i=e,U.exceptionHandler(i,"Error in event: "+t.attrArgument+" = "+t.expression,{attr:t.attrArgument,exp:t.expression,scope:t.scope,cd:t.cd,element:t.element,event:n})}t.scan&&t.cd.scan()},ie=function(e,t){var n,i,a,o,r,l;if(!e.filterByKey||e.filterByKey[t.keyCode]){if(e.modifiers.length)for((n=function(){}).prototype=e,(i=new n).stop=!1,a=0,o=(l=e.modifiers).length;a<o;a++)if((r=l[a]).fn&&(r.fn(t,i),i.stop))return;e.prevent&&t.preventDefault(),e.stop&&t.stopPropagation(),e.debounce?(e.debounceId&&clearTimeout(e.debounceId),e.debounceId=setTimeout(function(){return e.debounceId=null,ee(e,t)},e.debounce)):e.throttle?e.throttleTime<Date.now()&&(e.throttleTime=Date.now()+e.throttle,ee(e,t)):ee(e,t)}},U.hooks.attribute.unshift({code:"directDirective",fn:function(){var e=this.attrName.match(/^(.*)\!$/);if(e){var t=e[1].replace(/(-\w)/g,function(e){return e.substring(1).toUpperCase()}),s=this.cd.locals[t]||U.ctrl[t]||U.option.globalController&&window[t];ue.isFunction(s)?this.directive=function(e,t,n,i){var a=i.changeDetector;if(n){for(var o=U.utils.parsArguments(n),r=Array(o.result.length),l=0;l<o.result.length;l++)r[l]=U.utils.compile.expression(o.result[l],{input:["$element","$env"]}).fn(a.locals,t,i);s.apply(a,r)}else s.call(a,e,t,n,i)}:(this.result="noDirective",this.stop=!0)}}}),U.hooks.attribute.unshift({code:"elementVariable",fn:function(){var e=this.attrName.match(/^#([\w\.]*)$/);e&&(this.directive=fe,this.attrArgument=e[1])}}),U.d.al.value=function(e,t,n,i){var a,o;return i.fastBinding=!0,a=function(){i.setValue(n,t.value),o.refresh(),i.scan()},i.on(t,"input",a),i.on(t,"change",a),o=i.watch(n,function(e){return null==e&&(e=""),t.value=e,"$scanNoChanges"})},U.d.al.checked=function(e,n,t,i){var a=i.fbData={opt:{},watch:[]};function o(e){var t=i.takeAttr(e);return U.option.removeAttribute&&(n.removeAttribute(e),i.fbElement&&i.fbElement.removeAttribute(e)),t}function r(e,t){var n=o(t);if(n)return a.opt[e]=n,!0;var i=o(":"+t)||o("al-attr."+t);return i?(a.watch.push([i,e]),!0):void 0}function s(n,i,a){for(var e in i.fbData.opt)n[e]=i.fbData.opt[e];for(var t=function(e){var t=e[1];i.watch(e[0],function(e){n[t]=e,a()})},o=0,r=i.fbData.watch;o<r.length;o++){t(r[o])}}r("value","value")?i.fastBinding=function(e,t,n,i){var a,o=null;function r(){return t.checked=o&&0<=o.indexOf(l.value),"$scanNoChanges"}var l={};s(l,i,r),a=i.watch(n,function(e){o=e,Array.isArray(o)||(o=null),r()},{isArray:!0}),i.on(t,"change",function(){if(o||(o=[],i.setValue(n,o)),t.checked)o.indexOf(l.value)<0&&o.push(l.value);else{var e=o.indexOf(l.value);0<=e&&o.splice(e,1)}a.refresh(),i.scan()})}:(r("true","true-value"),r("false","false-value"),i.fastBinding=function(e,t,n,i){var a,o,r={true:!0,false:!1};function l(){return t.checked=a===r.true,"$scanNoChanges"}s(r,i,l),o=i.watch(n,function(e){a=e,l()}),i.on(t,"change",function(){a=t.checked?r.true:r.false,i.setValue(n,a),o.refresh(),i.scan()})}),i.fastBinding(e,n,t,i)},U.d.al.if=function(e,t,n,i){var a;return i.elementCanBeRemoved?(U.exceptionHandler(null,i.attrName+" can't control element because of "+i.elementCanBeRemoved,{scope:e,element:t,value:n,env:i}),{}):(i.stopBinding=!0,a={item:null,childCD:null,base_element:null,top_element:null,start:function(){a.prepare(),a.watchModel()},prepare:function(){a.base_element=t,a.top_element=document.createComment(" "+i.attrName+": "+n+" "),ue.before(t,a.top_element),ue.remove(t)},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=i.changeDetector.new(),U.bind(a.childCD,a.item,{skip_attr:i.skippedAttr(),elementCanBeRemoved:i.attrName}))},watchModel:function(){i.watch(n,a.updateDom)},removeDom:function(e){ue.remove(e)},insertDom:function(e,t){ue.after(e,t)}})},U.d.al.ifnot=function(e,t,n,i){var a;return(a=U.d.al.if(e,t,n,i)).updateDom=function(e){e?a.removeBlock():a.insertBlock()},a},U.directives.al.repeat={restrict:"AM",init:function(e,S,o,X){var l,Y;return X.elementCanBeRemoved?(U.exceptionHandler(null,X.attrName+" can't control element because of "+X.elementCanBeRemoved,{scope:e,element:S,value:o,env:X}),{}):(X.stopBinding=!0,l=X.changeDetector,Y={start:function(){Y.parsExpression(),Y.prepareDom(),Y.buildUpdateDom(),Y.watchModel()},parsExpression:function(){var e,t;if("("===(t=o.trim())[0])if(Y.objectMode=!0,e=t.match(/\((\w+),\s*(\w+)\)\s+in\s+(.+)\s+orderBy:(.+)\s*$/))Y.objectKey=e[1],Y.objectValue=e[2],Y.expression=e[3]+" | toArray:"+Y.objectKey+","+Y.objectValue+" | orderBy:"+e[4],Y.nameOfKey="$item",Y.trackExpression="$item."+Y.objectKey;else{if(!(e=t.match(/\((\w+),\s*(\w+)\)\s+in\s+(.+)\s*$/)))throw"Wrong repeat: "+o;Y.objectKey=e[1],Y.objectValue=e[2],Y.expression=e[3]+" | toArray:"+Y.objectKey+","+Y.objectValue,Y.nameOfKey="$item",Y.trackExpression="$item."+Y.objectKey}else{if((e=t.match(/(.*) track by ([\w\.\$\(\)]+)/))&&(Y.trackExpression=e[2],t=e[1]),!(e=t.match(/\s*(\w+)\s+in\s+(.+)/)))throw"Wrong repeat: "+o;Y.nameOfKey=e[1],Y.expression=e[2]}},watchModel:function(){var e;e=Y.objectMode?{deep:!0}:{isArray:!0},Y.watch=l.watch(Y.expression,Y.updateDom,e)},prepareDom:function(){var e,t,n,i,a;if(8===S.nodeType){for(Y.top_element=S,Y.element_list=t=[],e=S.nextSibling;e;){if(8===e.nodeType&&"/directive:"===(a=e.nodeValue.trim().split(/\s+/))[0]&&"al-repeat"===a[1]){X.skipToElement=e;break}t.push(e),e=e.nextSibling}for(n=0,i=t.length;n<i;n++)e=t[n],ue.remove(e)}else Y.base_element=S,Y.top_element=document.createComment(" "+o+" "),ue.before(S,Y.top_element),ue.remove(S),U.option.removeAttribute&&S.removeAttribute(X.attrName)},makeChild:function(e,t,n){var i;return i=l.new(null,{locals:!0}),Y.updateLocals(i,e,t,n),i},updateLocals:function(e,t,n,i){var a;a=e.locals,Y.objectMode?(a[Y.objectKey]=t[Y.objectKey],a[Y.objectValue]=t[Y.objectValue]):a[Y.nameOfKey]=t,a.$index=n,a.$first=0===n,a.$last=n===i.length-1},rawUpdateDom:function(e,t){var n,i,a,o,r,l;for(i=0,r=e.length;i<r;i++)n=e[i],ue.remove(n);for(o=0,l=t.length;o<l;o++)a=t[o],ue.after(a.after,a.element)},buildUpdateDom:function(){return Y.updateDom=(V=[],x=null,C=R=0,P=X.skippedAttr(),W="$index"===Y.trackExpression?(r={},z=function(e){return r[R]||null},H=function(e){null!=e.$id&&delete r[e.$id]},function(e,t){t.$id=R,r[R]=t}):Y.trackExpression?(r={},n=l.compile(Y.trackExpression,{input:["$id",Y.nameOfKey]}),i=function(e,t){return n(l.scope,e,t)},a=function(e){var t;return(t=e.$alite_id)?t:t=e.$alite_id=U.utils.getId()},z=function(e){var t;return null!=(t=i(a,e))?r[t]:null},H=function(e){var t;null!=(t=e.$id)&&delete r[t]},function(e,t){var n;n=i(a,e),t.$id=n,r[n]=t}):window.Map?(r=new Map,z=function(e){return r.get(e)},H=function(e){r.delete(e.item)},function(e,t){r.set(e,t)}):(r={},z=function(e){var t;return"object"!=typeof e?r[e]||null:(t=e.$alite_id)?r[t]:null},H=function(e){var t;t=e.$id,r[t]&&(e.$id=null,delete r[t])},function(e,t){var n;"object"==typeof e?(n=U.utils.getId(),e.$alite_id=n,t.$id=n,r[n]=t):(t.$id=e,r[e]=t)}),o=[],L=function(e){var t,n;if("object"==(n=typeof e))return e&&e.length?e:[];if("number"===n)t=Math.floor(e);else if("string"===n&&(t=Math.floor(e),isNaN(t)))return[];if(t<o.length)o.length=t;else for(;o.length<t;)o.push(o.length);return o},Y.element_list?function(e){var a,o,r,l,t,s,n,i,c,u,p,d,f,h,m,g,v,b,k,w,y,_,x,C,S,M,D,E,$,A,T,j,I,N,B,O,F;for(S=L(e),g=Y.top_element,l=[],A=[],c=0,v=V.length;c<v;c++)($=V[c]).active=!1;for(R=f=0,b=S.length;f<b;R=++f)p=S[R],($=z(p))&&($.active=!0);for(t=[],h=0,k=V.length;h<k;h++)if(!($=V[h]).active){for($.prev&&($.prev.next=$.next),$.next&&($.next.prev=$.prev),H($),$.CD.destroy(),m=0,w=(B=$.element_list).length;m<w;m++)s=B[m],t.push(s);$.next=null,$.prev=null,$.element_list=null}for(N=null,I=!(a=[]),n=Y.element_list.length-1,R=M=0,y=S.length;M<y;R=++M)if(p=S[R],$=z(d=p)){if(Y.updateLocals($.CD,p,R,S),$.prev===N){if(I)for(D=0,_=(O=$.element_list).length;D<_;D++)s=O[D],l.push({element:s,after:g}),g=s;g=(N=$).element_list[n],$.active=!0,A.push($);continue}for(($.prev=N)&&(N.next=$),T=0,x=(F=$.element_list).length;T<x;T++)s=F[T],l.push({element:s,after:g}),g=s;I=!0,(N=$).active=!0,A.push($)}else r=Y.makeChild(d,R,S),i=function(){var e,t,n,i;for(i=[],t=0,e=(n=Y.element_list).length;t<e;t++)o=n[t],s=o.cloneNode(!0),a.push({cd:r,el:s}),l.push({element:s,after:g}),i.push(g=s);return i}(),W(p,$={CD:r,element_list:i,prev:N,next:null,active:!0,item:p}),N?(E=N.next,((N.next=$).next=E)&&(E.prev=$)):0===R&&V[0]&&(E=V[0],($.next=E).prev=$),N=$,A.push($);for(V=A,Y.rawUpdateDom(t,l),t.length=0,j=l.length=0,C=a.length;j<C;j++)u=a[j],U.bind(u.cd,u.el,{skip_attr:P,elementCanBeRemoved:X.attrName,noDomOptimization:!0})}:function(e){var t,n,i,a,o,r,l,s,c,u,p,d,f,h,m,g,v,b,k,w,y,_;for(g=L(e),d=Y.top_element,C++,i=[],k=[],y=null,w=!(t=[]),R=r=0,f=g.length;r<f;R=++r)if(s=g[R],b=z(c=s)){if(Y.updateLocals(b.CD,s,R,g),b.prev===y){w&&i.push({element:b.element,after:y.element}),d=(y=b).element,b.version=C,k.push(b);continue}(b.prev=y)&&(y.next=b),i.push({element:b.element,after:d}),w=!0,d=b.element,(y=b).version=C,k.push(b)}else n=Y.makeChild(c,R,g),S=Y.base_element.cloneNode(!0),null===x?(o=Y.base_element.cloneNode(!0),_=U.bind(n,S,{skip_attr:P,elementCanBeRemoved:X.attrName,noDomOptimization:!0,fbElement:o}),(x=U.core.fastBinding(_)||!1)&&(Y.base_element=o)):t.push({cd:n,el:S}),i.push({element:S,after:d}),W(s,b={CD:n,element:d=S,prev:y,next:null,version:C,item:s}),y?(v=y.next,((y.next=b).next=v)&&(v.prev=b)):0===R&&V[0]&&(v=V[0],(b.next=v).prev=b),y=b,k.push(b);for(a=[],u=0,h=V.length;u<h;u++)(b=V[u]).version!==C&&(b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),H(b),b.CD.destroy(),a.push(b.element),b.next=null,b.prev=null,b.element=null);for(V=k,Y.rawUpdateDom(a,i),a.length=0,p=i.length=0,m=t.length;p<m;p++)l=t[p],x?x.bind(l.cd,l.el):U.bind(l.cd,l.el,{skip_attr:P,elementCanBeRemoved:X.attrName,noDomOptimization:!0})});var i,a,x,o,L,R,r,H,z,W,V,P,C,n}})}},U.d.al.init=function(t,n,i,a){var o,r,e,l,s;U.option.removeAttribute&&(n.removeAttribute(a.attrName),a.fbElement&&a.fbElement.removeAttribute(a.attrName)),o=a.changeDetector,s=["$element"],"window"===a.attrArgument&&s.push("window");try{l=o.compile(i,{no_return:!0,input:s}),a.fastBinding=e=function(e,t,n,i){return l(i.changeDetector.locals,t,window)},e(0,n,0,a)}catch(e){r=e,U.exceptionHandler(r,"al-init, error in expression: "+i,{exp:i,scope:t,cd:o,element:n}),a.fastBinding=function(){}}},U.d.al.app={stopBinding:!0},U.d.al.stop={restrict:"AE",stopBinding:!0},U.d.al.cloak=function(e,t,n,i){t.removeAttribute(i.attrName),n&&ue.removeClass(t,n)},U.d.al.html={restrict:"AM",priority:100,modifier:{},link:function(a,o,r,l){var s;return l.elementCanBeRemoved&&8!==o.nodeType?(U.exceptionHandler(null,l.attrName+" can't control element because of "+l.elementCanBeRemoved,{scope:a,element:o,value:r,env:l}),{}):(l.stopBinding=!0,s={baseElement:null,topElement:null,activeElement:null,childCD:null,name:r,watchMode:null,start:function(){s.parsing(),s.prepare(),s.watchModel()},parsing:function(){var e,t,n,i;if(l.attrArgument)for(e=0,t=(i=l.attrArgument.split(".")).length;e<t;e++)"literal"!==(n=i[e])?"tpl"!==n?U.d.al.html.modifier[n]&&U.d.al.html.modifier[n](s,{scope:a,element:o,inputName:r,env:l}):s.watchMode="tpl":s.watchMode="literal"},prepare:function(){8===o.nodeType?(s.baseElement=null,s.topElement=o):(s.baseElement=o,s.topElement=document.createComment(" "+l.attrName+": "+r+" "),ue.before(o,s.topElement),ue.remove(o))},removeBlock:function(){var e,t,n,i;if(s.childCD&&(s.childCD.destroy(),s.childCD=null),s.activeElement){if(Array.isArray(s.activeElement))for(t=0,n=(i=s.activeElement).length;t<n;t++)e=i[t],s.removeDom(e);else s.removeDom(s.activeElement);s.activeElement=null}},insertBlock:function(e){var t,n,i;if(s.baseElement)s.activeElement=s.baseElement.cloneNode(!1),s.activeElement.innerHTML=e,s.insertDom(s.topElement,s.activeElement),s.childCD=l.changeDetector.new(),U.bind(s.childCD,s.activeElement,{skip_attr:l.skippedAttr(),elementCanBeRemoved:l.attrName});else for((i=document.createElement("body")).innerHTML=e,t=s.topElement,s.activeElement=[],s.childCD=l.changeDetector.new();n=i.firstChild;)s.insertDom(t,n),t=n,s.activeElement.push(n),U.bind(s.childCD,t,{skip_attr:l.skippedAttr(),elementCanBeRemoved:l.attrName})},updateDom:function(e){s.removeBlock(),e&&s.insertBlock(e)},removeDom:function(e){ue.remove(e)},insertDom:function(e,t){ue.after(e,t)},watchModel:function(){"literal"===s.watchMode?s.updateDom(s.name):"tpl"===s.watchMode?l.watchText(s.name,s.updateDom):l.watch(s.name,s.updateDom)}})}},U.d.al.html.modifier.id=function(i){return i.updateDom=function(e){var t,n;i.removeBlock(),(n=document.getElementById(e))&&(t=n.innerHTML)&&i.insertBlock(t)}},U.d.al.html.modifier.url=function(t){return t.loadHtml=function(e){ue.ajax(e)},t.updateDom=function(e){e?t.loadHtml({cache:!0,url:e,success:function(e){t.removeBlock(),t.insertBlock(e)},error:t.removeBlock}):t.removeBlock()}},U.d.al.html.modifier.scope=function(a,o){var e,r,l;if(2===(e=a.name.split(":")).length)a.name=e[0],l=e[1];else{if(e=a.name.match(/(.+)\:\s*\:\:([\d\w]+)$/))r=!0;else if(r=!1,!(e=a.name.match(/(.+)\:\s*([\.\w]+)$/)))throw"Wrong expression "+a.name;a.name=e[1],l=e[2]}return"outer",a.insertBlock=function(e){var t,n,i;a.activeElement=a.baseElement.cloneNode(!1),a.activeElement.innerHTML=e,a.insertDom(a.topElement,a.activeElement),n=o.env.changeDetector,(t=a.childCD=n.new(null,{locals:!0})).locals.outer=null,i=n.watch(l,function(e){return t.locals.outer=e},{oneTime:r}),a.childCD.watch("$destroy",function(){return i.stop()}),U.bind(a.childCD,a.activeElement,{skip_attr:o.env.skippedAttr()})}},U.d.al.html.modifier.inline=function(e,t){var n;return n=e.prepare,e.prepare=function(){return n(),t.env.setValue(e.name,e.baseElement.innerHTML)}},U.d.al.radio=function(e,t,n,i){var a,o,r;return a=i.takeAttr("al-value"),o=a?i.eval(a):i.takeAttr("value"),i.on(t,"change",function(){i.setValue(n,o),r.refresh(),i.scan()}),r=i.watch(n,function(e){return t.checked=o===e,"$scanNoChanges"})},window.Map?((le=function(){return this.idByItem=new Map,this.itemById={},this.index=1,this}).prototype.acquire=function(e){var t;return t="i"+this.index++,this.idByItem.set(e,t),this.itemById[t]=e,t},le.prototype.release=function(e){var t;t=this.itemById[e],delete this.itemById[e],this.idByItem.delete(t)},le.prototype.replace=function(e,t){var n;n=this.itemById[e],this.idByItem.delete(n),this.idByItem.set(t,e),this.itemById[e]=t},le.prototype.getId=function(e){return this.idByItem.get(e)},le.prototype.getItem=function(e){return this.itemById[e]||null}):((le=function(){return this.itemById={"i#null":null},this}).prototype.acquire=function(e){var t;return null===e?"i#null":("object"==typeof e?(t=e.$alite_id)||(e.$alite_id=t=U.utils.getId()):t=""+e,this.itemById[t]=e,t)},le.prototype.release=function(e){delete this.itemById[e]},le.prototype.replace=function(e,t){this.itemById[e]=t},le.prototype.getId=function(e){return null===e?"i#null":"object"==typeof e?e.$alite_id:""+e},le.prototype.getItem=function(e){return this.itemById[e]||null}),U.d.al.select=function(e,n,t,i){var a,o,r,l,s,c;return a=i.changeDetector.new(),i.stopBinding=!0,a.$select={mapper:r=new le},o=null,a.$select.change=function(){return U.nextTick(function(){return s(o)})},s=function(e){var t;return(t=r.getId(e))?n.value=t:n.selectedIndex=-1},c=a.watch(t,function(e){return s(o=e)}),l=function(e){return o=r.getItem(e.target.value),a.setValue(t,o),c.refresh(),a.scan()},i.on(n,"input",l),i.on(n,"change",l),U.bind(a,n,{skip_attr:i.skippedAttr()})},U.d.al.option=function(e,t,n,i){var a,o,r,l,s,c;for(a=c=i.changeDetector,r=0;r<=4&&!(s=c.$select);++r)c=c.parent||{};s?(l=s.mapper,o=null,a.watch(n,function(e){o?l.getId(e)!==o?(l.release(o),o=l.acquire(e),t.value=o,s.change()):l.replace(o,e):(o=l.acquire(e),t.value=o,s.change())}),a.watch("$destroy",function(){return l.release(o),s.change()})):U.exceptionHandler("","Error in al-option - al-select is not found",{cd:a,scope:a.scope,element:t,value:n})},U.hooks.attribute.unshift({code:"attribute",fn:function(){var e,t;(e=this.attrName.match(/^\:([\w\.\-]+)$/))&&("html"===(t=e[1]).split(".")[0]?(this.name="html",t=t.substring(5)):this.name="attr",this.ns="al",this.attrArgument=t)}}),se={checked:"checked",readonly:"readOnly",value:"value",selected:"selected",muted:"muted",disabled:"disabled",hidden:"hidden"},U.d.al.attr=function(e,t,a,n){var o,r,i,l,s,c,u,p,d,f;if(n.attrArgument){if(i=n.attrArgument.split("."),r=i[0],u=se[r],s=0<i.indexOf("tpl"),U.option.removeAttribute&&(t.removeAttribute(n.attrName),n.fbElement&&n.fbElement.removeAttribute(n.attrName)),o={readOnly:!0},p=null,"style"===r){if(!i[1])throw"Style is not declared";d=i[1].replace(/(-\w)/g,function(e){return e.substring(1).toUpperCase()}),p=function(e,t){return null==t&&(t=""),e.style[d]=t}}else"class"===r&&1<i.length?(s=!1,c=i.slice(1),p=function(e,t){var n,i,a,o,r;if(t)for(i=0,o=c.length;i<o;i++)n=c[i],ue.addClass(e,n);else for(a=0,r=c.length;a<r;a++)n=c[a],ue.removeClass(e,n)}):"focus"===r?p=function(e,t){return t?e.focus():e.blur()}:u?p=function(e,t){if(void 0===t&&(t=null),e[u]!==t)return e[u]=t}:(o.element=t,o.elementAttr=r);f=s?"watchText":"watch",(l=p?function(e,t,n,i){return i.changeDetector[f](a,function(e){return p(t,e)},o)}:function(e,t,n,i){return i.changeDetector[f](a,null,{readOnly:!0,element:t,elementAttr:r})})(e,t,a,n),n.fastBinding=l}},U.d.al.model=function(e,t,n,i){var a;if("select"===(a=t.nodeName.toLowerCase()))return U.d.al.select.call(this,e,t,n,i);if("input"===a){if("checkbox"===t.type)return U.d.al.checked.call(this,e,t,n,i);if("radio"===t.type)return U.d.al.radio.call(this,e,t,n,i)}return U.d.al.value.call(this,e,t,n,i)},U.filters.slice=function(e,t,n){return e?n?e.slice(t,n):e.slice(t):null},ce=function(e){return e<10?"0"+e:""+e},U.filters.date=function(e,t){var n,i,a,o,r;if(!e)return"";for(o=t,i=0,a=(r=[[/yyyy/g,(e=new Date(e)).getFullYear()],[/mm/g,ce(e.getMonth()+1)],[/dd/g,ce(e.getDate())],[/HH/g,ce(e.getHours())],[/MM/g,ce(e.getMinutes())],[/SS/g,ce(e.getSeconds())]]).length;i<a;i++)n=r[i],o=o.replace(n[0],n[1]);return o},U.filters.json={watchMode:"deep",fn:function(e){return JSON.stringify(U.utils.clone(e),null,4)}},U.filters.filter=function(e,t,n){var i,a,o,r,l,s,c,u,p,d,f;if(2===arguments.length)l=null,f=t;else{if(3!==arguments.length)return e;l=t,f=n}if(!e||null==f||""===f)return e;if(u=[],p=(""+f).toLowerCase(),l)for(a=0,s=e.length;a<s;a++)(i=e[a])[l]===f?u.push(i):0<=(""+i[l]).toLowerCase().indexOf(p)&&u.push(i);else for(o=0,c=e.length;o<c;o++)for(r in i=e[o])(d=i[r])===f?u.push(i):0<=(""+d).toLowerCase().indexOf(p)&&u.push(i);return u},U.filters.orderBy=function(e,n,i){return!e instanceof Array?null:(i=i?1:-1,e.sort(function(e,t){return e[n]<t[n]?-i:e[n]>t[n]?i:0}))},U.filters.throttle={init:function(e,t,n){var i;return t=Number(t),i=null,{onChange:function(e){return i&&clearTimeout(i),i=setTimeout(function(){return i=null,n.setValue(e),n.changeDetector.scan()},t)}}}},U.filters.toArray={init:function(e,t,a){var o,r,l;return l=2===a.conf.args.length?(o=a.conf.args[0],a.conf.args[1]):(o="key","value"),r=[],{watchMode:"deep",onChange:function(e){var t,n,i;for(n in r.length=0,e)i=e[n],(t={})[o]=n,t[l]=i,r.push(t);return a.setValue(r)}}}},U.filters.storeTo={init:function(e,t,n){return{onChange:function(e){return n.changeDetector.setValue(t,e),n.setValue(e)}}}},U.text["="]=function(e,t,n,i){var a;if((a=U.utils.compile.expression(t)).filters)throw"Conflict: bindonce and filters, use one-time binding";i.finally(a.fn(i.changeDetector.locals))},U.text["::"]=function(e,t,n,i){i.changeDetector.watch(t,function(e){return i.finally(e)},{oneTime:!0})},function(){var E=U.f$;function s(e){return e.replace(/(-\w)/g,function(e){return e.substring(1).toUpperCase()})}function $(e){var t,n=e.listener,i=e.childCD,a=e.name,o=e.parentName,r=e.parentCD,l={};if(a=s(a),n&&!0!==n)if(E.isFunction(n))t=n;else{if(t=n.onChange,"copy"===n||"copy"===n.watchMode)return void(t?t(o):i.scope[a]=o);"array"!==n&&"array"!==n.watchMode||(l.isArray=!0),"deep"!==n&&"deep"!==n.watchMode||(l.deep=!0)}t||(t=function(e){i.scope[a]=e,i.scan()}),r.watch(o,t,l)}U.component=function(M,D){var e,t,n=M.match(/^(\w+)[\-](.+)$/);t=s(t=n?(e=n[1],n[2]):(e="$global",M)),U.d[e]||(U.d[e]={}),U.d[e][t]={restrict:"E",stopBinding:!0,priority:U.priority.$component,init:function(e,i,t,n){var a={$sendEvent:function(e,t){var n=new CustomEvent(e);n.value=t,n.component=!0,i.dispatchEvent(n)}},o=n.changeDetector.new(),r=U.ChangeDetector(a),l=new T({element:i,attributes:n.attributes,changeDetector:r,parentChangeDetector:o});try{var s=D.call(r,a,i,l)||{}}catch(e){return void U.exceptionHandler(e,"Error in component <"+M+">: ",{element:i,scope:a,cd:r})}s.onStart&&r.watch("$finishBinding",function(){s.onStart(),r.scan()});var c=!1;o.watch("$destroy",function(){c=!0,r.destroy()}),r.watch("$destroy",function(){s.onDestroy&&s.onDestroy(),c||o.destroy()});for(var u=0,p=i.attributes;u<p.length;u++){if("#"===(k=p[u]).name[0]){var d=k.name.slice(1);if(d){s.api?o.setValue(d,s.api):o.setValue(d,a);break}}}function f(e,t){var n=":"+e,i=l.takeAttr(n);if(!i){if(!(i=l.takeAttr(e)))return;t="copy"}$({childCD:r,listener:t,name:e,parentName:i,parentCD:o})}if(s.props)if(Array.isArray(s.props))for(var h=0,m=s.props;h<m.length;h++){f(g=m[h],!0)}else for(var g in s.props)f(g,s.props[g]);else for(var v=0,b=i.attributes;v<b.length;v++){var k,w=(k=b[v]).name,y=k.value;if(y){var _=w.match(/^\:(.*)$/);_&&$({childCD:r,name:_[1],parentName:y,parentCD:o})}}var x=!1;if(o.watch("$onScanOnce",function(){return x=!0}),s.template&&(i.innerHTML=s.template),s.templateId){var C=document.getElementById(s.templateId);if(!C)throw"No template "+s.templateId;i.innerHTML=C.innerHTML}function S(e){x||o.digest(),U.bind(r,i,{skip:!0})}s.templateUrl?E.ajax({url:s.templateUrl,cache:!0,success:function(e){i.innerHTML=e,S(!0)},error:function(){console.error("Template is not loaded",s.templateUrl)}}):S()}}}}(),U}var t=e();t.makeInstance=e,"function"==typeof alightInitCallback?alightInitCallback(t):"function"==typeof define?define(function(){return t}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t:(t.option.globalController=!0,(window.alight=t).f$.ready(t.bootstrap))}()}(jQuery);