var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=0,o=n[i];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];o;){var r=s&&s[o];r&&(this.off(t,o),delete s[o]),o.apply(this,e),i+=r?0:1,o=n[i]}return this}},t}),function(t,e){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(n){return e(t,n)}):"object"==("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e(t,require("ev-emitter")):t.Unipointer=e(t,t.EvEmitter)}(window,function(t,e){function n(){}function i(){}var o=i.prototype=Object.create(e.prototype);o.bindStartEvent=function(t){this._bindStartEvent(t,!0)},o.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},o._bindStartEvent=function(e,n){n=void 0===n||!!n;var i=n?"addEventListener":"removeEventListener";t.navigator.pointerEnabled?e[i]("pointerdown",this):t.navigator.msPointerEnabled?e[i]("MSPointerDown",this):(e[i]("mousedown",this),e[i]("touchstart",this))},o.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},o.getTouch=function(t){for(var e=0;e.5;var o=this.colorGrid[e.toUpperCase()];this.updateCursor(o),this.setTexts(),this.setBackgrounds(),n||this.emitEvent("change",[e,t.hue,t.sat,t.lum])}},f.setTexts=function(){if(this.setTextElems)for(var t=0;t0&&(void 0===document.addEventListener||void 0===o?console.log("This browser does not support visibilityChange"):document.addEventListener(s,function(){document[o]?t():e()},!1),h.each(function(t){var e=$(this).data("id"),n=$(this).data("dataonly"),o=1==n?2e4:1e3,s=$(this),h=5e3,c=function n(){$.ajax({url:i+"/get_stats/"+e,dataType:"json",success:function(t){s.html(t.html),"active"==t.status?h=o:h<3e4&&(h+=2e3)},complete:function(){r[t]=window.setTimeout(n,h)}})};a[t]=c,c()})),$("#upload").change(function(){n(this)}),$("#sortable").sortable({stop:function(t,e){var n=$("#sortable").sortable("toArray",{attribute:"data-id"});$.post(i+"/order",{order:n})}}),$("#sortable").sortable("disable"),$("#app").on("click","#config-button",function(t){t.preventDefault();var e=$("#app"),n=e.hasClass("header");e.toggleClass("header"),n?($(".add-item").hide(),$(".item-edit").hide(),$("#app").removeClass("sidebar"),$("#sortable").sortable("disable")):($("#sortable").sortable("enable"),setTimeout(function(){$(".add-item").fadeIn(),$(".item-edit").fadeIn()},350))}).on("click","#add-item, #pin-item",function(t){t.preventDefault();var e=$("#app");e.hasClass("sidebar");e.toggleClass("sidebar")}).on("click",".close-sidenav",function(t){t.preventDefault(),$("#app").removeClass("sidebar")}).on("click","#test_config",function(t){t.preventDefault();var e=$("#create input[name=url]").val(),n=$('#create input[name="config[override_url]"]').val();n.length&&""!=n&&(e=n);var o={};o.url=e,$(".config-item").each(function(t){var e=$(this).data("config");o[e]=$(this).val()}),$.post(i+"/test_config",{data:o},function(t){alert(t)})}),$("#pinlist").on("click","a",function(t){t.preventDefault();var e=$(this),n=e.data("id"),o=e.data("tag");$.get(i+"/items/pintoggle/"+n+"/true/"+o,function(t){var n=$(t).filter("#sortable").html();$("#sortable").html(n),e.toggleClass("active")})})});