text: /*! FibOS - v1.0.5 - 2015-03-27 */
  var FibOS=function(){var a="v1.0.5",b=function(a){function b(a,b){this.$el=null,this._ID=a,this._selectorsMapping=null,this._globalSelectors=null,this._styles={},this._options={extension:{},reference:"body"},this._init(b)}return b.prototype={initOptions:function(){},initStyles:function(){},initEvents:function(){},createSubElements:function(){},afterInit:function(){},appendTo:function(b){b&&(b instanceof String&&(b=a(b)),this.$el.appendTo(b))},show:function(){this.$el.show()},hide:function(){this.$el.hide()},setOptions:function(){for(var a in arguments)arguments.hasOwnProperty(a)&&this._extendObject(this._options,arguments[a])},setStyles:function(){for(var a in arguments)arguments.hasOwnProperty(a)&&this._extendObject(this._styles,arguments[a])},_init:function(a){this.initOptions(a),this.initStyles(this._options.extension),this._createElement(),this._createStyleTag(),this.initEvents(),this.afterInit()},_createElement:function(){var b=a("#"+this._ID);b.length>0&&(b.remove(),console.log("Container ID already in use and thus has been removed.")),this.$el=a("<div/>").attr("id",this._ID),this.createSubElements()},_createStyleTag:function(){var b=this._ID+"-style";a("#"+b).remove();var c,d,e,f,g,h=a("<style/>").attr("id",b);for(e in this._styles)this._styles.hasOwnProperty(e)&&(f=this._styles[e],d=this._selectorsMapping&&this._selectorsMapping[e],g=this._globalSelectors&&this._globalSelectors[e],c=g?"":"#"+this._ID,"main"!=e&&(c+=" "+(d||"."+e)),h.append(c+" {"+this._styleObjectToString(f)+"}"));a("head").append(h)},_extendObject:function(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]&&a[c]instanceof Object&&!(a[c]instanceof Array)?this._extendObject(a[c],b[c]):a[c]=b[c])},_styleObjectToString:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+":"+a[c]+";");return b.join("")}},b}(jQuery),c=function(a,b){function c(a,c){b.call(this,a,c)}function d(a){return null===a?!1:"boolean"==typeof a?a:"function"==typeof a?a():void 0}function e(a){var b,c=d(this._options.checkUseMarker),e=d(this._options.checkUseFont);return c||e?(b=m.call(this,a),c&&f.call(this,a,b),e&&g.call(this,a,b),!0):!1}function f(b,c){var d=this._options.markerData;if(a(b).data(d)===!0)return!0;c||(c=m.call(this,b));for(var e,f,g=p(b),j=a("<div/>").addClass("fibo-markers").on("click",function(b){i(a(b.currentTarget),d)}),k=a("<div/>").addClass("fibo-lines").appendTo(j),l=0;l<g.tot;l++)f=s.call(this,c,-(l*g.lh)),e=t.call(this,c,-(l*g.lh)),k.append(f),j.append(e);h.call(this,b,j,d)}function g(b,c){var d=this._options.fontData;if(a(b).data(d)===!0)return!0;c||(c=m.call(this,b));var e,f,g=p(b),j=a("<div/>").addClass("fibo-fontinfo").on("click",function(b){i(a(b.currentTarget),d)});f=l(b),e=u.call(this,c,f,-g.height),j.append(e),h.call(this,b,j,d)}function h(b,c,d){a(b).data(d,!0),a(c).data("ref",b),this.$el.append(c)}function i(b,c){a(a(b).data("ref")).data(c,!1),a(b).remove()}function j(a){if(o.call(this,a.target)){var b=e.call(this,a.target);return b&&a.preventDefault(),b&&a.stopPropagation(),!b}return!0}function k(b){return a(b.currentTarget).remove(),!1}function l(b){var c=a(b),d=c.css("font-weight"),e=c.css("font-size").replace("px",""),f=c.css("font-family").split(",")[0].replace(/\"|\'/g,""),g=f.split(" ")[0].substr(0,1).toUpperCase(),h=f.split(" ")[1]?f.split(" ")[1].substr(0,1).toUpperCase():f.substr(1,1).toLowerCase(),i=g+h;return[i,d,e]}function m(b){var c=a(b),d=c.width(),e=c.offset().left+parseFloat(c.css("padding-left")),f=q.call(this,c);return f.base+=this._options.markerOffset,f.top-=this._options.markerOffset,{width:d,height:f.base-f.top,offset:{top:f.top,left:e}}}function n(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&a[c]&&b.push(c);return b.join(",")}function o(b){var c=a(b);if(""!==this._options.excluded&&c.closest(this._options.excluded).length>0)return!1;var d=""!==c.html()&&""!==c.text()&&" "!==c.text()&&"&nbsp;"!==c.text();if(d){var e,f=this._options.taglist;for(e in f)if(f.hasOwnProperty(e)&&f[e]&&c.is(e))return!0;if(c.is("div")&&0===c.find("*").length)return!0}return!1}function p(b){var c=parseFloat(a(b).css("line-height")),d=a(b).height(),e=Math.round(d/c);return{tot:e,lh:c,height:c*(e-1)}}function q(b){var c=b.css("font-family"),d=parseFloat(b.css("font-size")),e=a("<img/>").attr("src",this._options.markerLine).css({width:"1px",height:"1px","vertical-align":"baseline"});e.appendTo(b);var f=e.offset().top,g=f-r.call(this,c,d);return e.remove(),{base:f+1,top:g}}function r(b,c){var d=a("<div/>").attr("id","txh").css({"font-family":b,"font-size":"200px",width:"10ex"}),e=a("<div/>").attr("id","tmh").css({"font-family":b,"font-size":"200px",width:"10em"}),f=a("<div/>").attr("id","txt").css({"font-family":b,"font-size":"200px",width:"1ex"}),g=a("<div/>").attr("id","tmt").css({"font-family":b,"font-size":"200px",width:"1em"}),h=a("<div/>").attr("id","tyh").css({"font-family":b,"font-size":"400px",width:"10ex"}),i=a("<div/>").attr("id","tnh").css({"font-family":b,"font-size":"400px",width:"10em"}),j=a("<div/>").attr("id","tyt").css({"font-family":b,"font-size":"400px",width:"1ex"}),k=a("<div/>").attr("id","tnt").css({"font-family":b,"font-size":"400px",width:"1em"}),l=a("<div/>").attr("id","tfs").css({"font-family":b,"font-size":c,width:"100em"}),m=a("<div/>").attr("id","xh_cont").append(d).append(e).append(f).append(g).append(h).append(i).append(j).append(k).append(l);a("body").append(m);{var n=d[0].offsetWidth/e[0].offsetWidth,o=f[0].offsetWidth/g[0].offsetWidth,p=h[0].offsetWidth/i[0].offsetWidth,q=j[0].offsetWidth/k[0].offsetWidth,r=l[0].offsetWidth/100,s=Math.round(p*r);p.toPrecision(3)}m.empty().remove();var t=.005;return(Math.abs(n-p)>t||Math.abs(o-p)>t||Math.abs(q-p)>t)&&alert("inconsistent values: "+n+" "+o+" "+p+" "+q),s}function s(b,c){if(!d(this._options.checkShowLines))return null;var e={top:b.offset.top+(c||0),left:b.offset.left},f={top:e.top,base:e.top+b.height};f.base-=this._options.markerOffset+1,f.top+=this._options.markerOffset;var g=a("<div/>");for(var h in f)f.hasOwnProperty(h)&&a("<div/>").addClass(this._options.linesClass).css({top:f[h],left:b.offset.left,width:b.width}).appendTo(g);return g.children()}function t(b,c){var d={top:b.offset.top+(c||0),left:b.offset.left};return a("<div/>").addClass(this._options.markerClass).width(b.width).height(b.height).offset(d)}function u(b,c,d){var e={top:b.offset.top-45+(d||0),left:b.offset.left+10},f=a("<p/>").addClass("fi1").text(c[0]),g=a("<p/>").addClass("fi2").text(c[1]),h=a("<p/>").addClass("fi3").text(c[2]);return a("<div/>").addClass(this._options.fontClass).append(f,g,h).offset(e)}return c.prototype=Object.create(b.prototype),c.prototype.initOptions=function(a){this.setOptions({markerLine:"",markerOffset:2,checkUseMarker:!0,checkShowLines:!0,checkUseFont:!0,markerClass:"fiboMarker",linesClass:"fiboLine",fontClass:"fiboFontinfo",markerData:"markerHL",fontData:"markerFI",excluded:"",taglist:{p:!0,span:!0,strong:!0,li:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,a:!0,input:!0,select:!0,textfield:!0,label:!0}},a),this._options.excluded=(""===this._options.excluded?"":this._options.excluded+",")+"."+this._options.fontClass},c.prototype.initStyles=function(a){var b=this._options.markerClass,c=this._options.linesClass,d=this._options.fontClass;this._selectorsMapping={marker:"."+b,line:"."+c,fontinfo:"."+d,fontinfo_p:"."+d+" p",fontinfo_p1:"."+d+" p.fi1",fontinfo_p2:"."+d+" p.fi2",fontinfo_p3:"."+d+" p.fi3"},this.setStyles({main:{position:"absolute"},marker:{position:"absolute !important","z-index":"1",background:"#0ff",opacity:"0.5"},line:{position:"absolute !important","z-index":"2",background:"#f00",left:0,"font-size":"1px","line-height":"1px",height:"1px",width:"100%",overflow:"hidden"},fontinfo:{position:"absolute !important","z-index":"3",background:"rgba(34, 34, 34, 0.7)",border:"1px solid #fff",padding:"3px","font-family":"Open Sans",color:"#fff"},fontinfo_p:{margin:"0",cursor:"default","text-algin":"center"},fontinfo_p1:{"font-size":"13px","font-weight":"700","margin-top":"-4px"},fontinfo_p2:{"font-size":"10px","font-weight":"400",margin:"-5px 0"},fontinfo_p3:{"font-size":"14px","font-weight":"600","margin-bottom":"-4px"}},a)},c.prototype.initEvents=function(){var b=this._options.reference,c="."+this._options.markerClass,d=n(this._options.taglist);a(b).off(".markerevent").on("click.markerevent",c,k.bind(this)),a(d).off(".markerevent").on("click.markerevent",j.bind(this)).data(this._options.markerData,null).data(this._options.fontData,null)},c.prototype.addMarkerToElement=function(a){return e.call(this,a)},c.prototype.markEvent=function(a){return j.call(this,a)},c.prototype.unmarkEvent=function(a){return k.call(this,a)},c}(jQuery,b),d=function(a,b){function c(a,c){b.call(this,a,c)}function d(){var b,c,d,e,f=this.ruler.clone().addClass("ruler_min"),g=this.ruler.clone().addClass("ruler_med"),h=this.ruler.clone().addClass("ruler_max"),i=Math.floor(this._options.rulerMed/this._options.rulerMin),j=Math.floor(this._options.rulerMax/this._options.rulerMed),k=Math.ceil(o.call(this)/this._options.rulerMax),l=Math.ceil(n.call(this)/this._options.rulerMax);for(b=0;i>b;b++)g.append(f.clone().css(p(b*this._options.rulerMin)));for(c=0;j>c;c++)h.append(g.clone().css(p(c*this._options.rulerMed)));if(this._options.showRulerH){for(d=0;l>d;d++)this.rulers_h.append(h.clone().css(p(d*this._options.rulerMax)).append(this.ruler_lab.clone().text((d+1)*this._options.rulerMax)));this.$el.append(this.rulers_h)}if(this._options.showRulerV){for(e=0;k>e;e++)this.rulers_v.append(h.clone().css(p(e*this._options.rulerMax)).append(this.ruler_lab.clone().text((e+1)*this._options.rulerMax)));this.$el.append(this.rulers_v)}this._options.showMousePos&&0===a("#").length&&this.$el.append(this.mousepos),this.$el.append(this.rulertop),this.$el.append(this.guides)}function e(a){if(this._options.showMousePos){var b=l.call(this,a.pageX,a.pageY),c="x:"+b.relative.left+", y:"+b.relative.top;this.mousepos.offset(b.absolute),this.mousepos.text(c)}if(this.guide_dragging){var d,e=q(this.guide_dragging),f=m.call(this),g=k.call(this,a);return"v"===e&&(d={top:f.top,left:g.coords.x}),"h"===e&&(d={left:f.left,top:g.coords.y}),this.guide_dragging.offset(d),!1}return!0}function f(b){var c=r(b.currentTarget),d=this.guideline.clone().addClass("guide_"+c),f=a(this._options.guidelinesContainer);return f.append(d),this.guide_dragging=d,this.guide_dragged=null,e.call(this,b),!1}function g(b){return this.guide_dragging=a(b.currentTarget),this.guide_dragged=null,e.call(this,b),!1}function h(b){var c=k.call(this,b),d=a(b.target).closest(".rulers_container").length>0,e=b.pageX>c.bounds.x.min&&b.pageX<c.bounds.x.max&&b.pageY>c.bounds.y.min&&b.pageY<c.bounds.y.max;!this.guide_dragging||!d&&e||(this.guide_dragging.remove(),this.guide_dragging=null),this.guide_dragged=this.guide_dragging,this.guide_dragging=null}function i(a){var b=a.shiftKey?10:a.altKey?.5:1;if(this.guide_dragged&&a.keyCode>=37&&a.keyCode<=40){var c={top:this.guide_dragged.position().top+(38===a.keyCode?-b:40===a.keyCode?b:0),left:this.guide_dragged.position().left+(37===a.keyCode?-b:39===a.keyCode?b:0)};return"v"===q(this.guide_dragged)&&this.guide_dragged.css({left:c.left}),"h"===q(this.guide_dragged)&&this.guide_dragged.css({top:c.top}),!1}return!0}function j(){var b=m.call(this).top-a(window).scrollTop()-this._options.rulerWidth,c=m.call(this).left-a(window).scrollLeft()-this._options.rulerWidth;this.$el.css({top:m.call(this).top,left:m.call(this).left});var d=0>=b?{position:"fixed",top:"0",left:m.call(this).left}:{position:"absolute",top:-this._options.rulerWidth,left:0},e=0>=c?{left:-m.call(this).left+a(window).scrollLeft()}:{left:-this._options.rulerWidth};this.rulers_h.css(d),this.rulers_v.css(e);var f={top:d.top,position:d.position};f.left=0>=b?this.rulers_v.offset().left:e.left,this.rulertop.css(f),a(".guide_h").css({width:n.call(this)})}function k(a){var b=m.call(this),c=b.left-this._options.rulerWidth,d=b.top-this._options.rulerWidth,e=n.call(this)+b.left,f=o.call(this)+b.top,g=a.pageX<c?c:a.pageX>e?e:a.pageX,h=a.pageY<d?d:a.pageY>f?f:a.pageY;return{coords:{x:g,y:h},bounds:{x:{min:c,max:e},y:{min:d,max:f}},isInside:g===a.pageX&&h===a.pageY}}function l(b,c){var d={},e=this.mousepos.width()+4,f=10,g=16;return d.absolute={left:b+f,top:c+g},d.absolute.left+e+f>a(window).width()&&(d.absolute.left=b-e-f),b-=a(this._options.reference).offset().left,c-=a(this._options.reference).offset().top,d.relative={left:Math.round(b),top:Math.round(c)},d}function m(){return a(this._options.reference).offset()}function n(){var b="body"==this._options.reference?document:this._options.reference,c=a(b),d=b==document?null:c.css("box-sizing");return c.width()+(d&&Number((-1===d.indexOf("-box")||0===d.indexOf("content"))&&parseInt(c.css("padding-left"))+parseInt(c.css("padding-right"))))}function o(){var b="body"==this._options.reference?document:this._options.reference,c=a(b),d=b==document?null:c.css("box-sizing");return c.height()+(d&&Number((-1===d.indexOf("-box")||0===d.indexOf("content"))&&parseInt(c.css("padding-top"))+parseInt(c.css("padding-left"))))}function p(a){return{left:a+"px",top:a+"px"}}function q(b){return a(b).attr("class").replace(/ruler_guideline|guide_| /g,"")}function r(b){return a(b).attr("class").replace(/rulers_|container| /g,"")}return c.prototype=Object.create(b.prototype),c.prototype.initOptions=function(a){this.setOptions({guidelinesContainer:"#ruler_guides",showMousePos:!0,showRulerV:!0,showRulerH:!0,rulerWidth:20,rulerUnit:5,rulerStepMin:2,rulerStepMed:5},a);var b=this._options;b.rulerMin||(b.rulerMin=b.rulerUnit),b.rulerMed||(b.rulerMed=b.rulerMin*b.rulerStepMin),b.rulerMax||(b.rulerMax=b.rulerMed*b.rulerStepMed)},c.prototype.initStyles=function(a){var b=this._options.rulerWidth,c=b/2,d=c/2;this._selectorsMapping={rulers_top:".ruler_origin",rulers_cont:".rulers_container",ruler_min:".ruler.ruler_min",ruler_med:".ruler.ruler_med",ruler_max:".ruler.ruler_max",ruler_label:".ruler .ruler_label",ruler_labelv:".rulers_v .ruler_label",ruler_labelh:".rulers_h .ruler_label",ruler_v:".rulers_v .ruler",ruler_h:".rulers_h .ruler",guide_v:".ruler_guideline.guide_v",guide_h:".ruler_guideline.guide_h",guideline:".ruler_guideline",mousepos:".ruler_mousepos",rulerv_min:".rulers_v .ruler_min",rulerv_med:".rulers_v .ruler_med",rulerv_max:".rulers_v .ruler_max",rulerh_min:".rulers_h .ruler_min",rulerh_med:".rulers_h .ruler_med",rulerh_max:".rulers_h .ruler_max"},this.setStyles({main:{position:"absolute",top:m.call(this).top+"px",left:m.call(this).left+"px"},rulers_cont:{position:"absolute",overflow:"hidden",background:"rgba(255,255,255,.8)"},rulers_v:{width:this._options.rulerWidth+"px",height:o.call(this)+"px",top:"0",left:"-"+this._options.rulerWidth+"px"},rulers_h:{height:this._options.rulerWidth+"px",width:n.call(this)+"px",left:"0",top:"-"+this._options.rulerWidth+"px"},ruler:{"z-index":"1",position:"absolute",border:"0 solid #000"},ruler_v:{"border-bottom-width":"1px",left:"0 !important"},ruler_h:{"border-right-width":"1px",top:"0 !important"},rulers_top:{"z-index":"2",position:"absolute",width:this._options.rulerWidth+"px",height:this._options.rulerWidth+"px",top:"-"+this._options.rulerWidth+"px",left:"-"+this._options.rulerWidth+"px",background:"#fff","border-right":"1px solid #000000","border-bottom":"1px solid #000000"},ruler_min:{width:this._options.rulerMin-1+"px",height:this._options.rulerMin-1+"px"},ruler_med:{width:this._options.rulerMed-1+"px",height:this._options.rulerMed-1+"px"},ruler_max:{width:this._options.rulerMax-1+"px",height:this._options.rulerMax-1+"px"},ruler_label:{position:"absolute","font-family":"helvetica","font-size":"8px",cursor:"default"},ruler_labelh:{bottom:"0px",right:"1px"},ruler_labelv:{bottom:"2px",right:"0px",width:"10px",transform:"rotate(-90deg)"},mousepos:{"z-index":"3",position:"absolute",width:"auto",height:"auto",background:"rgba(200,200,200,.8)",border:"1px solid #fff","font-size":"12px",padding:"1px 5px 3px","white-space":"nowrap"},guideline:{position:"absolute",background:"#0f0",width:"1px",height:"1px"},guide_v:{height:o.call(this)+"px",cursor:"ew-resize"},guide_h:{width:n.call(this)+"px",cursor:"ns-resize"}},{ruler_labelv:{"-webkit-transform":"rotate(-90deg)","-moz-transform":"rotate(-90deg)","-ms-transform":"rotate(-90deg)","-o-transform":"rotate(-90deg)",filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"}},a,{rulerv_min:{width:d+"px !important"},rulerv_med:{width:c+"px !important"},rulerv_max:{width:b+"px !important"},rulerh_min:{height:d+"px !important"},rulerh_med:{height:c+"px !important"},rulerh_max:{height:b+"px !important"}})},c.prototype.createSubElements=function(){this.$el.addClass("rulers"),this.rulers_v=a("<div/>").addClass("rulers_container").addClass("rulers_v"),this.rulers_h=a("<div/>").addClass("rulers_container").addClass("rulers_h"),this.ruler=a("<div/>").addClass("ruler"),this.ruler_lab=a("<div/>").addClass("ruler_label"),this.rulertop=a("<div/>").addClass("ruler_origin"),this.mousepos=a("<div/>").addClass("ruler_mousepos"),this.guideline=a("<div/>").addClass("ruler_guideline"),this.guides=a("<div/>").attr("id","ruler_guides"),d.call(this)},c.prototype.initEvents=function(){this.$el.off(".guidesevent").on("mousedown.guidesevent",".rulers_container",f.bind(this)).on("mousedown.guidesevent",".ruler_guideline",g.bind(this)),a("body").off(".guidesevent").on("mousemove.guidesevent",e.bind(this)).on("mouseup.guidesevent",h.bind(this)).on("keydown.guidesevent",i.bind(this)),a(window).off(".rulersevent").on("scroll.rulersevent resize.rulersevent",j.bind(this))},c.prototype.afterInit=function(){j.call(this)},c}(jQuery,b),e=function(a,b){function c(a,c){this._sliding=!1,this._mousezero=0,b.call(this,a,c)}function d(a){var b=Math.floor(10*i.call(this,a))/10;return this.slider_output.text(b),this._options.callback&&this._options.callback(a,b),b}function e(b){return a(b.target).is(this.slider_output)?!0:(this.slider_handler.css("left",j.call(this,b,-(this.slider_handler.width()/2))),f.call(this,b),!1)}function f(a){return this._mousezero=this.slider_handler.position().left-k.call(this,a.pageX),this._sliding=!0,h.call(this,a),!1}function g(){return this._sliding=!1,!1}function h(a){return this._sliding&&this.setSliderPerc(j.call(this,a)/l.call(this)),!1}function i(a){var b=this._options.minValue,c=this._options.maxValue,d=this._options.stepValue;return Math.round((b+a*(c-b))/d)*d}function j(a,b){b&&(this._mousezero=b);var c,d=l.call(this);c=k.call(this,a.pageX)+this._mousezero,c=0>c?0:c>d?d:c;var e=this._options.stepValue/(this._options.maxValue-this._options.minValue)*d;return c=Math.floor((c+e/2)/e)*e}function k(a){return a-this.$el.offset().left}function l(){return this.$el.width()-this.slider_handler.width()}return c.prototype=Object.create(b.prototype),c.prototype.initOptions=function(a){this.setOptions({minValue:0,maxValue:100,initialValue:100,stepValue:1,callback:null},a);var b=this._options;b.maxValue<=b.minValue&&(b.maxValue=b.minValue+b.stepValue),b.initialValue<=b.minValue&&(b.initialValue=b.minValue),b.initialValue>=b.maxValue&&(b.initialValue=b.maxValue)},c.prototype.initStyles=function(a){this.setStyles({main:{position:"relative",width:"100px",height:"20px",background:"rgba(100,100,100,.4)"},slider_bar:{position:"absolute",width:"100%",height:"3px",background:"rgb(200,200,200)",top:"9px"},slider_handler:{position:"absolute",width:"10px",height:"20px",background:"rgb(100,100,100)",top:"0",left:"0"},slider_output:{position:"absolute",width:"34px",height:"20px",background:"#fff",top:"0",right:"-34px","text-indent":"0","text-align":"center","font-size":"12px","line-height":"20px",cursor:"default"}},a)},c.prototype.createSubElements=function(){this.$el.addClass("slider"),this.slider_bar=a("<div/>").addClass("slider_bar"),this.slider_handler=a("<div/>").addClass("slider_handler"),this.slider_output=a("<div/>").addClass("slider_output"),this.$el.append(this.slider_bar).append(this.slider_handler).append(this.slider_output)},c.prototype.initEvents=function(){var b=".slider_"+this._ID;this.$el.off(b).on("mousedown"+b,e.bind(this)).on("mousedown"+b,".slider_handler",f.bind(this)),a("body").off(b).on("mousemove"+b,h.bind(this)).on("mouseup"+b,g.bind(this))},c.prototype.afterInit=function(){this.setSliderVal(this._options.initialValue)},c.prototype.setSliderVal=function(a){var b=(a-this._options.minValue)/(this._options.maxValue-this._options.minValue);this.setSliderPerc(b)},c.prototype.setSliderPerc=function(a){var b=a*l.call(this);this.slider_handler.css("left",b),d.call(this,a)},c.prototype.getSliderVal=function(){return d.call(this,this.getSliderPerc())},c.prototype.getSliderPerc=function(){var a=this.slider_handler.css("left").replace("px","");return a/l.call(this)},c}(jQuery,b),f=function(a,b){function c(a,c){this._defaultGroupName="spacerGroup_",this._lastUsedGroup=this._defaultGroupName+"1",this._mousezero=null,this._dragging=null,this._dragged=null,this.spacersGroups=null,this.spacerObjects=null,b.call(this,a,c)}function d(a,b,c){return g.call(this,a,b,c)}function e(b){return b&&this.spacersGroups[b]?(a("#"+b).remove(),delete this.spacersGroups[b],!0):!1}function f(){return this.$el.empty(),this.spacersGroups={},!0}function g(b,c,d){b||(b=this._lastUsedGroup);var e=a("#"+b);return 0===e.length&&(e=a("<div/>").attr("id",b).addClass("spacers_group"),c||this.$el.append(e),!d&&this._options.groupCallback&&this._options.groupCallback(b)),this._lastUsedGroup=b,e}function h(){var b,c={};this.$el.find("."+this._options.spacerClass).each(function(d,e){var f=a(e);b=f.parent().attr("id"),b===this._ID&&(b="spacerGroupDefault"),c[b]||(c[b]=[]),c[b].push([parseInt(this.getSpacerType.call(this,e)),Number(f.css("top").replace("px","")),Number(f.css("left").replace("px",""))])}.bind(this)),this.spacersGroups=c}function i(){return h.call(this),JSON.stringify(this.spacersGroups)}function j(a,b,c){var d,e=JSON.parse(a);for(var f in e)e.hasOwnProperty(f)&&(b?(delete this.spacersGroups[f],d=e[f]):(d=this.spacersGroups[f],d||(d=[]),d.push.apply(d,e[f])),this.spacersGroups[f]=d);return k.call(this,c)}function k(b){var c,e,f,g,h,i=[];for(var j in this.spacersGroups)if(this.spacersGroups.hasOwnProperty(j)){g=[],e=this.spacersGroups[j],a("#"+j).remove();for(var k=0;k<e.length;k++)c="f_"+("000"+e[k][0]).substr(-3),f=this.spacerObjects[c].clone(),f.css("top",e[k][1]),f.css("left",e[k][2]),g.push(f.prop("outerHTML"));this._options.grouping?(h=d.call(this,j,!0,!0),h.html(g.join("")),b&&h.hide(),i.push(h.prop("outerHTML"))):i.push(g.join(""))}return i.join("")}function l(a,b,c){var d=j.call(this,a,b,c);this.$el.html(d)}function m(){var a,b,c,d,e="65",f=this._options.spacerMin-1,g=A.call(this,f),h=[],i=this._options.spacerColors,j=this._options.spacerSymbols,k=i.length,l=j.length,m=f,n=0;m>=k&&(m-=Math.floor(m/k)*k),h.after={position:"absolute",left:"0",color:"#fff","-khtml-opacity":"."+e,"-moz-opacity":"."+e,"-ms-filter":'"alpha(opacity='+e+')"',filter:"alpha(opacity="+e+")",opacity:"."+e};for(var o in g)g.hasOwnProperty(o)&&(b=g[o],a=z.call(this,b),c=("000"+b).substr(-3),d=this._options.spacerClass+".fs_"+c,h[d]={width:g[o]+"px",height:g[o]+"px",background:i[m]},this._globalSelectors[d]=!0,a>=k&&(h[d+":after"]={content:'"'+j[n].s+'"',"font-size":Number(b*j[n].f)+"px","line-height":Number(b*j[n].l)+"px"},this._globalSelectors[d+":after"]=!0,(a+1)%k===0&&++n>=l&&(n=l-1)),++m>=k&&(m=0));return h}function n(a){var b=Math.round(a%1*100)/100,c=.25>b?0:b>.75?1:.5;return Math.floor(a)+c}function o(a){var b={top:n(Number(a.css("top").replace("px",""))),left:n(Number(a.css("left").replace("px","")))};a.css(b)}function p(){var a=0;for(var b in this.spacersGroups)this.spacersGroups.hasOwnProperty(b)&&a++;return a}function q(a){var b=a.shiftKey?10:a.altKey?.5:1;return this._dragged&&a.keyCode>=37&&a.keyCode<=40?(this._dragged.offset({top:this._dragged.offset().top+(38===a.keyCode?-b:40===a.keyCode?b:0),left:this._dragged.offset().left+(37===a.keyCode?-b:39===a.keyCode?b:0)}),this._options.moveCallback&&this._options.moveCallback(this._dragged),!1):!0}function r(a){switch(a.type){case"mousedown":t.call(this,a);case"mousemove":v.call(this,a);break;case"mouseup":w.call(this,a)}}function s(){this.$el.css(B.call(this))}function t(b){var c=a(b.target);return this._mousezero={top:c.position().top-b.pageY+B.call(this).top,left:c.position().left-b.pageX+B.call(this).left},u.call(this,c),!1}function u(a){a.parent().append(a),this.updateGroups(),this._dragged=null,this._dragging=a}function v(a){return this._dragging?(this._dragging.offset({top:Number(a.pageY+this._mousezero.top),left:Number(a.pageX+this._mousezero.left)}),o(this._dragging),!1):!0}function w(){return this._dragged=this._dragging,this._dragged?(this._dragged.focus(),void(this._dragging&&(this._dragging=null,this.updateGroups(),this._options.moveCallback&&this._options.moveCallback(this._dragged)))):!0}function x(){for(var b,c={},d=this._options.spacerMin-1;d<this._options.spacersList.length;d++)b=("00"+this._options.spacersList[d]).substr(-3),c["f_"+b]=a("<div/>").addClass(this._options.spacerClass+" fs_"+b).attr("tabindex","");return c}function y(a,b){for(var c=1,d=1,e=0,f=[],g=1;b>=g;g++)c+=e,e=d,d=c,f.push(c);return 0>=a&&(a=1),f.splice(a-1,b-a+1)}function z(a){var b=this._options.spacersList;for(var c in b)if(b.hasOwnProperty(c)&&b[c]===a)return Number(c);return-1}function A(a,b){(!a||0>a)&&(a=0),(!b||b>this._options.spacersList.length-1)&&(b=this._options.spacersList.length-1);for(var c=[],d=a;b>=d;d++)c.push(this._options.spacersList[d]);return c}function B(){return a(this._options.reference).offset()}return c.prototype=Object.create(b.prototype),c.prototype.initOptions=function(a){this.setOptions({localStorage:"fibonacciGroups",spacerClass:"fibospacer",spacerMatch:/fibospacer|fs|_| /g,grouping:!0,moveCallback:null,groupCallback:null,spacersList:y(1,12),spacerMin:3,spacerSymbols:[{s:"•",f:2.8,l:1},{s:"★",f:1,l:1.09}],spacerColors:["#0071bc","#ed1e79","#8cc63f","#fbb03b"]},a)},c.prototype.initStyles=function(a){var b="0 0 5px 2px #222222 inset";this._selectorsMapping={spacer:"."+this._options.spacerClass,shadow:"."+this._options.spacerClass+":focus",after:"."+this._options.spacerClass+":after"},this._globalSelectors={spacer:!0,shadow:!0,after:!0},this.setStyles({main:{position:"absolute",top:B.call(this).top+"px",left:B.call(this).left+"px",width:"0",height:"0",overflow:"visible"},spacer:{position:"absolute",display:"block",cursor:"pointer",overflow:"hidden","font-family":"Arial",outline:"0"},shadow:{"-webkit-box-shadow":b,"-moz-box-shadow":b,"box-shadow":b}},m.call(this),a)},c.prototype.initEvents=function(){this.$el.off(".spacerevent").on("mousedown.spacerevent","."+this._options.spacerClass,r.bind(this)),a("body").off(".spacerevent").on("mousemove.spacerevent",r.bind(this)).on("mouseup.spacerevent",r.bind(this)).on("keydown.spacerevent",q.bind(this)),a(window).off(".spacerevent").on("scroll.spacerevent resize.spacerevent",s.bind(this))},c.prototype.afterInit=function(){this.spacersGroups={},this.spacerObjects=x.call(this)},c.prototype.addNewSpacer=function(a,b){if(-1==z.call(this,a))return console.log("WARNING: addSpacer called with unsupported spacer"),null;b||(b=this._lastUsedGroup);var c=("000"+a).substr(-3),e=this.spacerObjects["f_"+c].clone(),f=this._options.grouping?d.call(this,b):this.$el;return e&&f.append(e),e},c.prototype.dragSpacer=function(a){u.call(this,a)},c.prototype.getSpacerType=function(b){return a(b).attr("class").replace(this._options.spacerMatch,"")},c.prototype.getSpacersList=function(a){return A.call(this,a?this._options.spacerMin-1:0)},c.prototype.renameGroup=function(b,c){if(!b||!c)return!1;if(b===c)return!1;if(a("#"+c).length>0)return!1;var f=this.spacersGroups[b];if(!f)return!1;this.spacersGroups[c]=f;var g=d.call(this,c);return g.html(a("#"+b).html()),e.call(this,b),!0},c.prototype.offsetCustomGroup=function(b,c){for(var d=0;d<b.length;d++){var e=a(b[d]),f=e.offset(),g={left:f.left+Number(c.left),top:f.top+Number(c.top)};e.offset(g)}},c.prototype.offsetGroup=function(b){var c,d,e=this.spacersGroups[this._lastUsedGroup],f=a("#"+this._lastUsedGroup).find("."+this._options.spacerClass);e&&f.each(function(f,g){var h=a(g);c=Number(e[f][1]),d=Number(e[f][2]),h.css("top",c+Number(b.top)),h.css("left",d+Number(b.left))})},c.prototype.saveOffsetGroup=function(a){var b,c=this.spacersGroups[this._lastUsedGroup];if(c){for(b in c)c.hasOwnProperty(b)&&(c[b][1]=Number(c[b][1])+Number(a.top),c[b][2]=Number(c[b][2])+Number(a.left));this.spacersGroups[this._lastUsedGroup]=c}},c.prototype.selectGroup=function(a){this._lastUsedGroup=a?a:this._defaultGroupName+(p.call(this)+1)},c.prototype.updateGroups=function(){h.call(this)},c.prototype.spacersGroupLength=function(b){return a("#"+(b||this._lastUsedGroup)).find("div").length},c.prototype.setLocalStorage=function(){return localStorage.setItem(this._options.localStorage,i.call(this)),!0},c.prototype.getLocalStorage=function(a){f.call(this);var b=localStorage.getItem(this._options.localStorage);return b&&l.call(this,b,!0,a),b},c.prototype.loadSpacersFromJson=function(a,b){return a&&l.call(this,a,!0,b),a},c.prototype.getFibonacci=function(a,b){y(a,b)},c.prototype.setMouseZero=function(a){!a.top&&0!==a.top||!a.left&&0!==a.left?console.log("WARNING: setMouseZero called with wrong parameter"):this._mousezero=a},c}(jQuery,b),g=function(a,b){function c(c,d){this._spritesInfo={},this._spritesTotal=0,this._spritesLoaded=0,b.call(this,c,d),s.call(this),a(window).off(".uiSpriter").on("resize.uiSpriter",s.bind(this))}function d(){return"hidden"===this.$el.css("visibility")?!1:(this._options.visible||j(this.$el),!0)}function e(a){return(a?this._spritesLoaded:++this._spritesLoaded)<this._spritesTotal?!1:(this._options.visible||k(this.$el),this._options.callback&&this._options.callback(this._spritesInfo),!0)}function f(b,c){var d=a(this._options.reference),e=d.find("*");return console.log("calculating... (please, wait until done!)"),e.each(function(b,c){var d=a(c),e=d.css("background-image").split(",");e.forEach(function(a){var b=""===this._options.domain;if(!b&&a.indexOf(this._options.domain)>-1&&(b=!0),b&&"url"!==a.substr(0,3)&&(b=!1),b&&-1===a.indexOf("http")&&(b=!1),b){var c=g(d),e=p(d.css("padding-left"))+p(d.css("padding-right")),f=p(d.css("padding-top"))+p(d.css("padding-bottom")),h={l:c.x,t:c.y},i={w:e+d.width(),h:f+d.height()};a&&"none"!==a&&(this._spritesInfo[a]||(this._spritesInfo[a]=[]),this._spritesInfo[a].push({pos:h,size:i}))}}.bind(this))}.bind(this)),console.log("DONE!"),this._spritesTotal=o.call(this),b?(b(this._spritesInfo,c),!0):this._spritesInfo}function g(a){var b=a.css("background-image"),c=h(b),d=a.width(),e=a.height(),f=a.css("background-position").split(" "),g=f[0],i=f[1];return g="left"==g||"0%"==g?0:"center"==g||"50%"==g?-(c.width-d)/2:"right"==g||"100%"==g?-(c.width-d):parseInt(g),i="top"==i||"0%"==i?0:"center"==i||"50%"==i?-(c.height-e)/2:"bottom"==i||"100%"==i?-(c.height-e):parseInt(i),{x:-g,y:-i}}function h(b){var c=b.replace(/url\((['"])?(.*?)\1\)/gi,"$2").split(",")[0],d=a("<img/>").attr("src",c);return{width:d.prop("width"),height:d.prop("height")}}function i(b){var c,d,e,f;for(var g in b)if(b.hasOwnProperty(g)){f=this.filenameFromCss(g,!0).replace(/[.]/g,"_"),d=n(b[g]),e=a("<div/>").attr("id",f).addClass("obscurers_container"),c=l.call(this,g,e),e.append(c);for(var h in d)d.hasOwnProperty(h)&&e.append(d[h]);this.$el.append(e)}}function j(a){a.css("visibility","hidden").show()}function k(a){a.css("visibility","visible").hide()}function l(b,c){d.call(this);var f=h(b);return c.css(f),this._options.visible||k(c),e.call(this),a("<img/>").attr("src",q(b))}function m(b){var c="top:"+b.pos.t+"px; left:"+b.pos.l+"px; width:"+b.size.w+"px; height:"+b.size.h+"px;";return a("<div/>").addClass("sprite_obscurer").attr("style",c)}function n(a){var b,c,d=[];for(var e in a)a.hasOwnProperty(e)&&(b=a[e],c=m(b),d.push(c));return d}function o(){var a,b=0;for(a in this._spritesInfo)this._spritesInfo.hasOwnProperty(a)&&b++;return b}function p(a){return Number(a.replace(/px|%/g,""));
  
  }function q(a){return a.replace(/url\(|\"|\)/g,"")}function r(a){var b=a.lastIndexOf("/");return a.substr(b+1)}function s(){this.$el.width(a(window).width()).height(a(window).height())}return c.prototype=Object.create(b.prototype),c.prototype.initOptions=function(a){this.setOptions({visible:!0,opacity:"0.3",color:"#f00",border:"#0f0",image:"",domain:"",callback:null},a)},c.prototype.initStyles=function(a){var b=this._options.image&&""!==this._options.image?'url("'+this._options.image+'")':"none";this.setStyles({main:{position:"relative",display:this._options.visible?"block":"none"},obscurers_container:{position:"relative",display:"block",background:b,top:"0",left:"0","text-align":"left",border:"1px solid "+this._options.border,visibility:this._options.visible?"visible":"hidden"},sprite_obscurer:{position:"absolute",display:"block",background:this._options.color,opacity:this._options.opacity}},a)},c.prototype.filenameFromCss=function(a,b){var c=r(q(a));return b?c.replace(/.png|.jpg|.jpeg|.gif/g,""):c},c.prototype.analyze=function(){f.call(this,i.bind(this))},c.prototype.toggleSprite=function(b){var c,d,e=a("#fibo_sprites_bg");this.$el.hide(),e.show(),a(".obscurers_container").hide(),"hide_sprites"!==b&&(c=b.replace("toggle_sprite_",""),c=c.replace(/[.]/g,"_"),d=a(".obscurers_container#"+c),d.show(),this.$el.show())},c.prototype.logSpritesList=function(){var b=[];this.$el.find(".obscurers_container").each(function(c,d){b.push(a(d).attr("id"))}),console.log(b)},c}(jQuery,b),h=function(a){function b(a,b){this.$el=null,this._ID=a,this._label=b,this._gui=null,this._listeners={},this.init()}function c(a){return"none"!==a.$el.find(".vui-content").css("display")}return b.prototype={setEvents:function(){},getStyles:function(){},createContent:function(){},init:function(){if(!this.createElement(this.createContent()))throw new Error("cannot initialize panel: "+this._ID+" ("+this._label+")");this.setEvents()},createElement:function(b){if(!b)return!1;var c=this._ID+"_checkbox",d=a("<div/>").addClass("vui-panel").attr("id",this._ID),e=a("<div/>").addClass("vui-label"),f=a("<div/>").addClass("vui-content");return e.append(a("<input/>").attr("id",c).addClass("fibo_checkbox").attr("type","checkbox")),e.append(a("<label/>").attr("for",c).html(this._label)),f.append(b),this.$el=d.append(e).append(f),this.$el.find(".fibo_checkbox").on("change",function(b){this.trigger("toggle_panel",{target:this,toggle:a(b.currentTarget).is(":checked")})}.bind(this)),!0},addTo:function(a){this._gui=a},open:function(){this.$el.addClass("fibo_panel_open"),this.$el.find(".vui-label").find(".fibo_checkbox").prop("checked",!0),this.$el.find(".vui-content").slideDown()},close:function(){this.$el.removeClass("fibo_panel_open"),this.$el.find(".vui-label").find(".fibo_checkbox").prop("checked",!1),this.$el.find(".vui-content").slideUp()},toggle:function(){c(this)?this.close():this.open()},isOpen:function(){return c(this)},addListener:function(a,b,c){"function"==typeof b?this.$el.on(a,b.bind(this)):"string"==typeof b&&this.$el.on(a,b,c.bind(this))},on:function(a,b){this._listeners[a]||(this._listeners[a]=[]),this._listeners[a].push(b)},off:function(a){this._listeners[a]=null},trigger:function(a,b){this._gui&&this._gui._logEvents&&console.log("#%d : [%s] -> %s(%o)",++this._gui._logEventId,this._ID,a,b);var c=this._listeners[a];if(c)for(var d in c)c.hasOwnProperty(d)&&c[d](b,a)},fiboSelect:function(b,c,d){if(!b&&!c)return null;var e=a("<select/>").attr("id",c);d||e.append(a("<option/>").attr("disabled",!0).attr("selected",!0).val("none").text("chose a spacer"));for(var f=0;f<b.length;f++)e.append(a("<option/>").val(("00"+b[f]).substr(-3)).text(b[f]));return e},panelCheckbox:function(b,c,d){var e=b+"_checkbox",f=a("<div/>").attr("id",b).addClass("fibo_toggle"),g=a("<input/>").attr("id",e).addClass("fibo_checkbox").attr("type","checkbox").attr("checked",d),h=a("<label/>").attr("for",e).attr("title",c).html("&nbsp;");return f.append(g).append(h)}},b}(jQuery),i=function(a,b){function c(a){b.call(this,a)}return c.prototype=Object.create(b.prototype),c.prototype.createElement=function(b){return b?(this.$el=a("<div/>").attr("id",this._ID).append(b),!0):!1},c}(jQuery,h),j=function(a,b){function c(a,c){var d="fibo_group_";this._selectors={toggle:"toggle_group_",hideall:"hide_groups",tree:"groups_tree",name:d+"name",rename:d+"rename",remove:d+"delete"},b.call(this,a,c)}function d(b,c,d){var e=a("<li/>"),f=a("<label/>"),g=a("<span/>").text(d),h=a("<input/>").attr("type","radio").attr("name","groups").addClass("fibo_radio").attr("id",b).attr("checked",c);return e.append(f.append(h).append(g)),e}return c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(a("<ul/>").attr("id",this._selectors.tree)).append(a("<p/>").text("name: ").append(a("<input/>").attr("type","text").attr("id",this._selectors.name))).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.rename).val("rename")).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.remove).val("delete"));return b.children()},c.prototype.setEvents=function(){this.addListener("click","#"+this._selectors.remove,function(){this.trigger("group_remove"),this.removeGroup()}),this.addListener("click","#"+this._selectors.rename,function(){this.trigger("group_rename"),this.renameGroup()}),this.addListener("change","#"+this._selectors.tree+" input",function(a){this.showhideGroups(a)})},c.prototype.getStyles=function(){},c.prototype.newGroupAdded=function(b){var c=a("#"+this._selectors.tree),e=c.find("li");0===e.length&&c.append(d(this._selectors.hideall,!1,"none")),c.append(d(this._selectors.toggle+b,!0,b)),this.showhideGroups({currentTarget:a("#"+this._selectors.toggle+b)})},c.prototype.removeGroup=function(){var b=a("#"+this._selectors.hideall),c=a("#"+this._selectors.tree),d=c.find("li"),e=d.find("input:checked");if(0===d.length)return!1;if(e.attr("id")===this._selectors.hideall)return!1;d.find("input").attr("checked",!1),b.attr("checked",!0);var f=e.attr("id"),g=f.replace(this._selectors.toggle,"");a("#"+g).remove(),a("#"+f).closest("li").remove(),this.showhideGroups({currentTarget:b}),this._gui._components.uiSpacer.updateGroups()},c.prototype.renameGroup=function(){var b=a("#"+this._selectors.tree),c=b.find("li"),d=c.find("input:checked");if(0===c.length)return!1;if(d.attr("id")===this._selectors.hideall)return!1;var e=d.attr("id"),f=e.replace(this._selectors.toggle,""),g=a("#"+this._selectors.name).val();g=g.split(" ").join("_");var h=this._selectors.toggle+g;this._gui._components.uiSpacer.updateGroups(),this._gui._components.uiSpacer.renameGroup(f,g)?(a("#"+e).closest("li").remove(),d.attr("id",h).next().text(g)):alert("cannot rename group")},c.prototype.groupsLoaded=function(b){var c=a("#"+this._selectors.tree),e=c.find("li"),f=e.find("input:checked"),g=f.length>0?f.attr("id").replace(this._selectors.toggle,""):!1;g===this._selectors.hideall&&(g=!1),c.empty().append(d(this._selectors.hideall,!g,"none"));var h,i;for(h in b)b.hasOwnProperty(h)&&(i=b[h],c.append(d(this._selectors.toggle+i,g===i,i)));c.show(),f.length>0&&this.showhideGroups({currentTarget:f}),this.trigger("group_list_open")},c.prototype.showhideGroups=function(b){var c,d=a(b.currentTarget).attr("id"),e=a("#"+this._selectors.name);e.val(""),a(".spacers_group").hide(),d!=this._selectors.hideall&&(c=d.replace(this._selectors.toggle,""),a("#"+c).show(),e.val(c)),this.trigger("group_select",c)},c.prototype.showGroupsList=function(a){var b=JSON.parse(a),c=[];for(var d in b)b.hasOwnProperty(d)&&c.push(d);this.groupsLoaded(c)},c}(jQuery,h),k=function(a,b){function c(a,c){var d="fibo_input_";this._selectors={input:d+"text",load:d+"load",share:d+"export"},b.call(this,a,c)}return c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(a("<textarea/>").attr("id",this._selectors.input)).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.load).val("import")).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.share).val("export"));return b.children()},c.prototype.setEvents=function(){this.addListener("click","#"+this._selectors.load,function(){this.trigger("input_import",a("#"+this._selectors.input).val())}),this.addListener("click","#"+this._selectors.share,function(){this.trigger("input_export")})},c.prototype.getStyles=function(){},c}(jQuery,h),l=function(a,b){function c(a,c){var d="fibo_grp_",e=d+"sel_";this._selectors={group:e.substr(0,e.length-1),top:e+"top",left:e+"left",multi:e+"multiple",multi_p:e+"multiple_p",multi_box:e+"multiple_box"},b.call(this,a,c),this._groupSelected=[]}function d(b){var c=a(b.currentTarget),d=b.shiftKey?10:b.altKey?.5:1,e=Number(c.val());return c.val(e+(38===b.keyCode?d:40===b.keyCode?-d:0)),this.applyInfo(b),!1}function e(b){var c={top:a("#"+this._selectors.top).val(),left:a("#"+this._selectors.left).val()};this._gui._components.uiSpacer.saveOffsetGroup(c),a(b.currentTarget).val("0")}c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(a("<p/>").append(a("<span/>").text("group: ")).append(a("<span/>").attr("id",this._selectors.group))).append(a("<p/>").append(a("<span/>").text("offset top: ")).append(a("<input/>").attr("type","text").attr("id",this._selectors.top))).append(a("<p/>").append(a("<span/>").text("offset left: ")).append(a("<input/>").attr("type","text").attr("id",this._selectors.left))).append(a("<p/>").append(a("<span/>").text("spacers: ")).append(a("<span/>").text("0").attr("id",this._selectors.multi_p))).append(a("<p/>").append(a("<input/>").attr("type","checkbox").attr("id",this._selectors.multi)).append(a("<label/>").attr("for",this._selectors.multi).text("select inner group")));return b.children()},c.prototype.setEvents=function(){this.addListener("keydown","#"+this._selectors.left+", #"+this._selectors.top,function(b){d.call(this,b),this.trigger("group_offset_apply","{l:"+a("#"+this._selectors.left).val()+",t:"+a("#"+this._selectors.top).val()+"}")}),this.addListener("blur","#"+this._selectors.left+", #"+this._selectors.top,function(b){this.trigger("group_offset_save","{l:"+a("#"+this._selectors.left).val()+",t:"+a("#"+this._selectors.top).val()+"}"),e.call(this,b)}),this.addListener("change","#"+this._selectors.multi,function(b){this.trigger("group_toggle_multiple"),f.toggle(a(b.currentTarget).is(":checked"),this)}),f.bodyEventsToggle(!1)},c.prototype.getStyles=function(){},c.prototype.applyInfo=function(b){var c={top:a("#"+this._selectors.top).val(),left:a("#"+this._selectors.left).val()};this._groupSelected.length>0?(this._gui._components.uiSpacer.offsetCustomGroup(this._groupSelected,c),a(b.currentTarget).val("0")):this._gui._components.uiSpacer.offsetGroup(c)},c.prototype.selectGroup=function(b){b||(b="");var c=a("#"+b),d=c.length>0?c.find("div").length:0;a("#"+this._selectors.group).text(b),a("#"+this._selectors.multi_p).text(d)};var f={bodyEventsToggle:function(b){var c=a("body");b?c.css("cssText","cursor: crosshair !important;").on("mousedown.multiselect",this.selectStart.bind(this)).on("mousemove.multiselect",this.selectMulti.bind(this)).on("mouseup.multiselect",this.selectEnd.bind(this)):c.css("cursor","inherit").off(".multiselect")},toggle:function(b,c){this.ctx=c,this.fibos=c._gui,this.id_multibox=c._selectors.multi_box,this.id_multipar=c._selectors.multi_p,this.id_grouptxt=c._selectors.group,this.zero={top:0,left:0},this.groupSelecting=!1,this.ctx._groupSelected=[],this.bodyEventsToggle(b);var d=b?"0":this.fibos._components.uiSpacer.spacersGroupLength();a("#"+this.id_multipar).text(d)},selectStart:function(b){var c=a(b.target),d="#"+this.fibos._ID;return c.parents(d).length>0||c.is(d)?!0:(b.preventDefault(),this.groupSelecting=!0,this.zero={top:b.pageY,left:b.pageX},a("#"+this.id_multibox).remove(),void this.fibos.$el.append(a("<div/>").attr("id",this.id_multibox)))},selectMulti:function(b){if(!this.groupSelecting)return!0;var c,d,e={top:b.pageY,left:b.pageX},f={top:this.zero.top,left:this.zero.left};e.left<this.zero.left?(f.left=e.left,c=this.zero.left):c=e.left,e.top<this.zero.top?(f.top=e.top,d=this.zero.top):d=e.top;var g={width:Math.abs(c-f.left),height:Math.abs(d-f.top)};a("#"+this.id_multibox).offset(f).width(g.width).height(g.height)},selectEnd:function(){if(!this.groupSelecting)return!0;this.groupSelecting=!1;var b=a("#"+this.id_multibox);if(0!=b.length){var c=b.offset(),d={left:c.left,top:c.top,width:b.width(),height:b.height()};b.remove(),this.ctx._groupSelected=this.findSpacersInsideBox(d),a("#"+this.id_multipar).text(this.ctx._groupSelected.length)}},findSpacersInsideBox:function(b){b||(b={top:0,left:0,width:0,height:0});var c,d,e,f=[],g=a("#"+a("#"+this.id_grouptxt).text()).find("div");return g.each(function(g,h){c=a(h),d=c.offset(),e=d.left>=b.left&&d.top>=b.top&&d.left+c.width()<=b.left+b.width&&d.top+c.height()<=b.top+b.height,e&&f.push(c)}),f}};return c}(jQuery,h),m=function(a,b,c){function d(a,c,d){this._spacersList=d;var e="fibo_sel_";this._selectors={spacer:e+"spacer",left:e+"left",top:e+"top",remove:e+"delete",duplicate:e+"duplicate",opacity:e+"opacity",slider:e+"slider_container"},b.call(this,a,c),this._spacerSelected=null}function e(b){var c=b.shiftKey?10:b.altKey?.5:1,d=Number(a(b.currentTarget).val());return a(b.currentTarget).val(d+(38===b.keyCode?c:40===b.keyCode?-c:0)),this.applyInfo(),!1}return d.prototype=Object.create(b.prototype),d.prototype.createContent=function(){this.uiSlider=new c(this._selectors.opacity,{minValue:20,stepValue:10,callback:this.setOpacity.bind(this),extension:{slider_handler:{background:"rgba(200,100,100,.6)"}}});var b=a("<div/>").append(a("<p/>").text("spacer: ").append(this.fiboSelect(this._spacersList,this._selectors.spacer,!0))).append(a("<p/>").text("left: ").append(a("<input/>").attr("type","text").attr("id",this._selectors.left))).append(a("<p/>").text("top: ").append(a("<input/>").attr("type","text").attr("id",this._selectors.top))).append(a("<p/>").text("opacity: ").append(a("<div/>").attr("id",this._selectors.slider).append(this.uiSlider.$el))).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.remove).val("remove")).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.duplicate).val("duplicate"));return b.children()},d.prototype.setEvents=function(){this.addListener("keyup","#"+this._selectors.left+",#"+this._selectors.top,function(b){e.call(this,b),this.trigger("spacer_offset","{l:"+a("#"+this._selectors.left).val()+",t:"+a("#"+this._selectors.top).val()+"}")}),this.addListener("change keyup","#"+this._selectors.spacer,function(b){this.trigger("spacer_changed",a(b.currentTarget).val()),this.applyInfo()}),this.addListener("click","#"+this._selectors.remove,function(){this.trigger("spacer_delete",this._spacerSelected),this.deleteSpacer()}),this.addListener("click","#"+this._selectors.duplicate,function(){this.trigger("spacer_duplicate",this._spacerSelected),this.duplicateSpacer()})},d.prototype.getStyles=function(){},d.prototype.moveCallback=function(a){this._spacerSelected=a,this.updateInfo()},d.prototype.updateInfo=function(){var b=this.getInfo();a("#"+this._selectors.spacer).val(b.f),a("#"+this._selectors.left).val(b.l),a("#"+this._selectors.top).val(b.t),this.uiSlider.setSliderVal(100*Number(b.o))},d.prototype.applyInfo=function(){var b=this.getInfo();this._spacerSelected&&a(this._spacerSelected).removeClass("fs_"+b.f).addClass("fs_"+a("#"+this._selectors.spacer).val()).css("left",a("#"+this._selectors.left).val()+"px").css("top",a("#"+this._selectors.top).val()+"px")},d.prototype.getInfo=function(){var b={f:"",t:"",l:"",o:""};return this._spacerSelected&&(b.f=this._gui._components.uiSpacer.getSpacerType(this._spacerSelected),b.t=a(this._spacerSelected).css("top").replace("px",""),b.l=a(this._spacerSelected).css("left").replace("px",""),b.o=a(this._spacerSelected).css("opacity")),b},d.prototype.setOpacity=function(b,c){this._spacerSelected&&a(this._spacerSelected).css("opacity",c/100)},d.prototype.deleteSpacer=function(){this._spacerSelected&&a(this._spacerSelected).remove()},d.prototype.duplicateSpacer=function(){this._spacerSelected&&a(this._spacerSelected).parent().append(a(this._spacerSelected).clone()).focus()},d}(jQuery,h,e),n=function(a,b){function c(a,c){var d="fibo_sprites_";this._selectors={tree:"sprites_tree",analyze:d+"analyze"},b.call(this,a,c)}function d(b,c,d){var e=a("<li/>"),f=a("<label/>"),g=a("<span/>").text(d),h=a("<input/>").attr("type","radio").attr("name","sprites").addClass("fibo_radio").attr("id",b).attr("checked",c);return e.append(f.append(h).append(g)),e}return c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(a("<ul/>").attr("id",this._selectors.tree)).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.analyze).val("analyze"));return b.children()},c.prototype.setEvents=function(){this.addListener("click","#"+this._selectors.analyze,function(b){this.trigger("sprites_analyze"),a(b.currentTarget).remove()}),this.addListener("change","#"+this._selectors.tree+" input",function(b){this.trigger("sprites_toggle",a(b.currentTarget).attr("id"))})},c.prototype.getStyles=function(){},c.prototype.didAnalyze=function(b){var c=a("#"+this._selectors.tree).empty();c.append(d("hide_sprites",!0,"none"));var e,f,g;for(e in b)b.hasOwnProperty(e)&&(f=this._gui._components.uiSpriter.filenameFromCss(e),g=this._gui._components.uiSpriter.filenameFromCss(e,!0),c.append(d("toggle_sprite_"+g,!1,f)));c.show(),0===a("#fibo_sprites_bg").length&&a(".obscurers_container").parent().prepend('<div id="fibo_sprites_bg" style="display:none;"/>')},c}(jQuery,h),o=function(a,b){function c(a,c){var d="fibo_storage_";this._selectors={restore:d+"restore",save:d+"save"},b.call(this,a,c)}return c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.restore).val("restore")).append(a("<input/>").attr("type","button").addClass("vui-btn").attr("id",this._selectors.save).val("save"));return b.children()},c.prototype.setEvents=function(){this.addListener("click","#"+this._selectors.restore,function(){this.trigger("history_restore")}),this.addListener("click","#"+this._selectors.save,function(){this.trigger("history_save")})},c.prototype.getStyles=function(){},c}(jQuery,h),p=function(a,b){function c(a,c,d){this._spacersList=c,this._spacersObject=d;var e="fibo_clone_";this._selectors={choose:e+"select",element:e+"element"},b.call(this,a)}return c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(this.fiboSelect(this._spacersList,this._selectors.choose)).append(a("<div/>").attr("id",this._selectors.element));return b.children()},c.prototype.setEvents=function(){this.addListener("change keyup","#"+this._selectors.choose,function(b){this.trigger("clone_select",a(b.currentTarget).val()),a("#"+this._selectors.element).html(this._spacersObject["f_"+a(b.currentTarget).val()])}),this.addListener("mousedown","#"+this._selectors.element+" .fibospacer",function(b){this.trigger("clone_spacer",{pos:{top:b.pageY,left:b.pageX},$clone:a("#"+this._selectors.element),spacer:b.currentTarget})})},c.prototype.getStyles=function(){},c.prototype.toggleCloneDisplay=function(b){a("#"+this._selectors.element)[b?"show":"hide"]()},c}(jQuery,i),q=function(a,b){function c(a){var c="fibo_toggle_";this._selectors={main:c+"main",spacers:c+"spacers",overlay:c+"overlay",rulers:c+"rulers",markers:c+"markers"},b.call(this,a)}function d(b){return function(c){this.trigger(b,a(c.currentTarget).is(":checked"))}.bind(this)}return c.prototype=Object.create(b.prototype),c.prototype.createContent=function(){var b=a("<div/>").append(a("<div/>").attr("id",this._selectors.main)).append(this.panelCheckbox(this._selectors.spacers,"toggle spacers",!0)).append(this.panelCheckbox(this._selectors.overlay,"toggle overlay",!1)).append(this.panelCheckbox(this._selectors.rulers,"toggle rulers",!1)).append(this.panelCheckbox(this._selectors.markers,"toggle marker tool",!1));return b.children()},c.prototype.setEvents=function(){this.addListener("click","#"+this._selectors.main,function(){this.trigger("toggle_fibos")}),this.addListener("change","#"+this._selectors.spacers+" .fibo_checkbox",d.call(this,"toggle_spacers")),this.addListener("change","#"+this._selectors.overlay+" .fibo_checkbox",d.call(this,"toggle_overlay")),this.addListener("change","#"+this._selectors.rulers+" .fibo_checkbox",d.call(this,"toggle_rulers")),this.addListener("change","#"+this._selectors.markers+" .fibo_checkbox",d.call(this,"toggle_markers"))},c.prototype.getStyles=function(){},c.prototype.getStateOf=function(b){return this._selectors[b]?a("#"+this._selectors[b]).find(".fibo_checkbox").is(":checked"):null},c}(jQuery,i),r={alpha_pattern:"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAA3NCSVQICAjb4U/gAAAACXBIWXMAABX9AAAV/QHNcFFhAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABV0RVh0Q3JlYXRpb24gVGltZQAzMC83LzEzJXLQiAAAACpJREFUKJFj/P//PwM28ODBA6ziTFhF8YBRDcQAFlzhraCgQB0bRjUQAwCn8Qi/9sh3kAAAAABJRU5ErkJggg==",sprite_fibos:"iVBORw0KGgoAAAANSUhEUgAAABIAAABaCAYAAAC1xQZWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAV/QAAFf0BzXBRYQAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAVdEVYdENyZWF0aW9uIFRpbWUAMzAvNy8xMyVy0IgAAALQSURBVFiF7ZXPaxNREMe/T6qQwKZBo5JUL7uLBbcQjyaB9lgstbdsQU8B/4GmR/XoH9BTSVtoL5aAhkAixh5LAxaSXiQg1N2ctCWxP9K0JAQk4yEttLv7jG1WKWUH3mWG+fDezHznsWKxSLDB+vb39+3goK/dbl8yEJEtJXKe5oDsAV3hrl3hp9kFYnbV6JotFAfUO0iSJJIkyc8YA2Os5xttiaLo7+lG54Gdp0ZbdoECdoAC5XJ5u1dQVwjgiNYBOaD/BerjBSRJ4opQ13XT3v3Tje5x/ANWTi6oXC7/sIAFwNmU3DVy8muIojgA4DuAgK7r3L3k7CMHdDVBJvWfSIOIxgGEANwCQAD2AKwDyFqSiOjMOfa9SiQSKUVRKqIokiiKpChKdXFx8RMRvTbmEJEZRERPFxYWsicA45mbm0sT0bgxz0q0b4aGhl40m807Vi9wuVw/S6XSPICXp/1WxfbxIADQbDZvA7hp9P/T9u+4XK4qL8Htdu+g08GuoPV4PF7kgeLxeAHAZ6Pfao6yRPSo3W7/mpmZCTcaDR/QKfLU1NR6LBYrAPhgyjN2zTCQj9EZSADYRWcgTRBL0EXt8onWAXU37mJTVXVZ07Sxer3uYYxBEIQDSZJyGxsbzwBA1/WzeVYDGQqFtlqtljA6Ovo1FottMsYwOzv7MJvNBn0+X7VSqfiNINNiU1V1WVGUVj6ff0dEidNndXX1fTAYbKiqumzMM9VI07SxiYmJL5FIxKTw4eHh3ZGRkU1N054YYyZQrVbrn56eLllWFEA0GtUODw/7u4IAoFqt3uCB6vX6dSu/CeT1emtLS0uDPFA6nZYFQTjoCpJlOZfJZIIrKyt3jbFkMnl/bW1tUJblnDHGa//20dGRNxwOa9Fo9BsRsVQqJefz+QeCIOxZtZ+72CYnJ98eD2Q/AHg8ngNZlj8WCoXnwF8M5EXt8onWNtBv0kKv/nwGlC8AAAAASUVORK5CYII=",marker_line:""},s=function(c,d,e,f,g,i,j,k,l,m,n,o,p,q,r){function s(b,d){var e="1.7";this._ID="fibos",this._fibosTitle="FibOS",this._fibosVersion=a||"",this._logEvents=d.logEvents||!1,this._logEventId=0,delete d.logEvents,this._reference=0===c(b).length?"body":b,this._componentsOptions=d||{},this._components={},this._panels={},this.$el=null,this.$title=null,this.$background=null,this.$controls=null,this.$toggles=null,this.$panels=null,this.init(e)}function t(a){return d&&(d[a]||""===d[a])?"data:image/png;base64,"+d[a]:null}function u(a,b){if("undefined"!=typeof jQuery){var d=a,e=Number(d.split(".")[0]),f=Number(d.split(".")[1]),g=jQuery.fn.jquery,h=Number(g.split(".")[0]),i=Number(g.split(".")[1]),j=!1;e>h?j=!0:f>i&&(j=!0),j?(alert("FibOS needs jQuery 1.7.2\nWe will load it for you."),c.getScript("http://code.jquery.com/jquery-1.7.2.min.js",b)):b()}}function v(a,b,c){var d=this.$controls.offset(),e={top:d.top-a.top,left:d.left-a.left};e.top+=c.position().top+parseInt(c.css("padding-top"))+parseInt(c.css("margin-top")),e.left+=c.position().left+parseInt(c.css("padding-left"));var f=parseInt(this._components.uiSpacer.getSpacerType(b)),g=this._components.uiSpacer.addNewSpacer(f);return g?(g.offset({top:parseInt(a.top+e.top),left:parseInt(a.left+e.left)}),this._components.uiSpacer.setMouseZero(e),this._components.uiSpacer.dragSpacer(g),this._components.uiSpacer.updateGroups(),!1):!0}function w(a){var b=a.keyCode,c=a.ctrlKey?"c":a.shiftKey?"s":a.altKey?"a":"";switch(b){case 68:"a"===c&&this._panels.spacerPanel.duplicateSpacer();break;case 88:"a"===c&&this._panels.spacerPanel.deleteSpacer()}}function x(a){var b=this.$controls.offset(),d={top:c(document).scrollTop(),left:c(document).scrollLeft()},e={top:a.pageY-(b.top-d.top),left:a.pageX-(b.left-d.left)};return c("body").off(".fibos_drag").on("mousemove.fibos_drag",y.bind(this,e)).on("mouseup.fibos_drag",function(){return c("body").off(".fibos_drag"),!1}),!1}function y(a,b){var c={top:b.pageY-a.top,left:b.pageX-a.left};return this.$controls.css(c),!1}function z(a,b){a.show&&a.hide&&a[b?"show":"hide"]()}return s.prototype={init:function(a){u(a,function(){this.createStyles(),this.createElement(),this.initEvents()}.bind(this))},createStyles:function(){c("#"+this._ID+"-styles").remove();var a,d,e=c("<style/>").attr("id",this._ID+"-styles"),f=this.factory.styles.call(this);for(a in f)f.hasOwnProperty(a)&&(d="#"+this._ID,"main"!=a&&(d+=" "+a),e.append(d+" {"+b.prototype._styleObjectToString(f[a])+"}"));c("head").append(e)},createElement:function(){c("#"+this._ID).remove(),this.$el=c("<div/>").attr("id",this._ID),this.$title=c("<h1/>").text(this._fibosTitle).append(c("<small/>").text(this._fibosVersion)),this.$background=c("<div/>").attr("id","fibo_bg"),this.$controls=c("<div/>").attr("id","fibo_controls"),this.$toggles=c("<div/>").attr("id","fibo_toggles"),this.$panels=c("<div/>").attr("id","fibo_panels").append(this.$title),this.$el.append(this.$background).append(this.$controls.append(this.$toggles).append(this.$panels)),c("body").append(this.$el),this.setupComponents(),this.setupPanels()},setupComponents:function(){this._components.uiMarker=this.factory.components.uiMarker.call(this,"fibos_marker",this._componentsOptions.uiMarker),this._components.uiRuler=this.factory.components.uiRuler.call(this,"fibos_ruler",this._componentsOptions.uiRuler),this._components.uiSpacer=this.factory.components.uiSpacer.call(this,"fibos_spacers",this._componentsOptions.uiSpacer),this._components.uiSpriter=this.factory.components.uiSpriter.call(this,"fibos_spriter",this._componentsOptions.uiSpriter),this.addWidget(this._components.uiSpacer),this.addWidget(this._components.uiMarker),this.addWidget(this._components.uiRuler),this.addWidget(this._components.uiSpriter)},setupPanels:function(){var a=this._components.uiSpacer.getSpacersList(!0),b=this._components.uiSpacer.spacerObjects;this._panels.spacerPanel=new k("fibo_panel_selected","spacer selected",a),this._panels.offsetPanel=new l("fibo_panel_offset","offset group"),this._panels.groupPanel=new m("fibo_panel_groups","spacer groups"),this._panels.storagePanel=new n("fibo_panel_storage","local storage"),this._panels.inputPanel=new o("fibo_panel_input","input string"),this._panels.spritePanel=new p("fibo_panel_sprites","loaded sprites"),this.addPanel(this._panels.spacerPanel),this.addPanel(this._panels.offsetPanel),this.addPanel(this._panels.groupPanel),this.addPanel(this._panels.storagePanel),this.addPanel(this._panels.inputPanel),this.addPanel(this._panels.spritePanel),this._panels.togglesPanel=new r("fibo_extrapanel_toggles"),this._panels.selectPanel=new q("fibo_extrapanel_select",a,b),this.addPanelTo(this._panels.togglesPanel,this.$toggles),this.addPanel(this._panels.selectPanel)},initEvents:function(){c("body").off(".fibos_keys").on("keydown.fibos_keys",w.bind(this)),this.$title.off(".fibos_title").on("mousedown.fibos_title",x.bind(this)),this._panels.togglesPanel.on("toggle_fibos",function(){var a=this.$controls.hasClass("hidden");a?this.$controls.removeClass("hidden").css({left:0,top:0}):this.$controls.addClass("hidden").css({left:-1*this.$controls.width(),top:0});var b=!this.$controls.hasClass("hidden")&&this._panels.togglesPanel.getStateOf("spacers");this._panels.selectPanel.toggleCloneDisplay(b)}.bind(this)),this._panels.togglesPanel.on("toggle_overlay",function(a){z(this.$background,a)}.bind(this)),this._panels.togglesPanel.on("toggle_spacers",function(a){z(this._components.uiSpacer,a);var b=!this.$controls.hasClass("hidden")&&a;this._panels.selectPanel.toggleCloneDisplay(b)}.bind(this)),this._panels.togglesPanel.on("toggle_rulers",function(a){z(this._components.uiRuler,a)}.bind(this)),this._panels.togglesPanel.on("toggle_markers",function(a){z(this._components.uiMarker,a)}.bind(this)),this._panels.selectPanel.on("clone_spacer",function(a){v.call(this,a.pos,a.spacer,a.$clone)}.bind(this)),this._panels.groupPanel.on("group_select",function(a){this._components.uiSpacer.selectGroup(a),this._panels.offsetPanel.selectGroup(a)}.bind(this)),this._panels.groupPanel.on("group_list_open",function(){this.openPanel("groupPanel")}.bind(this)),this._panels.storagePanel.on("history_restore",function(){var a=this._components.uiSpacer.getLocalStorage(!0);this._panels.groupPanel.showGroupsList(a)}.bind(this)),this._panels.storagePanel.on("history_save",function(){this._components.uiSpacer.setLocalStorage()}.bind(this)),this._panels.inputPanel.on("input_import",function(a){this._components.uiSpacer.loadSpacersFromJson(a,!0);var b=JSON.stringify(this._components.uiSpacer.spacersGroups);this._panels.groupPanel.showGroupsList(b)}.bind(this)),this._panels.inputPanel.on("input_export",function(){var a=JSON.stringify(this._components.uiSpacer.spacersGroups);console.log(a),alert("Open your browser's console and see the export string.")}.bind(this)),this._panels.spritePanel.on("sprites_analyze",function(){this._components.uiSpriter.analyze()}.bind(this)),this._panels.spritePanel.on("sprites_toggle",function(a){this._components.uiSpriter.toggleSprite(a)}.bind(this))},addWidget:function(a){a.appendTo(this.$el)},addPanel:function(a){this.addPanelTo(a,this.$panels)},addPanelTo:function(a,b){b.append(a.$el),a.addTo(this),a.on("toggle_panel",function(a){var b=a.target,c=a.toggle;c?this.openPanel(b):this.closePanel(b)}.bind(this))},addStyle:function(){},openPanel:function(a){var b=a instanceof h?a:this._panels[a];b&&!b.isOpen()&&(this.closeAllPanels(),b.open())},closePanel:function(a){var b=a instanceof h?a:this._panels[a];b&&b.isOpen()&&b.close()},closeAllPanels:function(){for(var a in this._panels)this._panels.hasOwnProperty(a)&&this._panels[a].close()},callbacks:{uiMarker:{highlightCheck:function(){return this._panels.togglesPanel.getStateOf("markers")},fontinfoCheck:function(){return this._panels.togglesPanel.getStateOf("markers")}},uiSpacer:{moveCallback:function(a){this._panels.spacerPanel.moveCallback(a)},newGroupAdded:function(a){this._panels.groupPanel.newGroupAdded(a)}},uiSpriter:{didAnalyze:function(a){this._panels.spritePanel.didAnalyze(a)}}},factory:{components:{uiMarker:function(a,b){return b||(b={}),b.reference=this._reference,b.checkShowLines=!1,b.checkUseMarker=this.callbacks.uiMarker.highlightCheck.bind(this),b.checkUseFont=this.callbacks.uiMarker.fontinfoCheck.bind(this),b.excluded="#"+this._ID,b.markerLine=t("marker_line"),new e(a,b)},uiRuler:function(a,b){return b||(b={}),b.reference=this._reference,new f(a,b)},uiSlider:function(a,b){return b||(b={}),b.extension={slider_handler:{background:"rgba(200,100,100,.6)"}},new g(a,b)},uiSpacer:function(a,b){return b||(b={}),b.reference=this._reference,b.moveCallback=this.callbacks.uiSpacer.moveCallback.bind(this),b.groupCallback=this.callbacks.uiSpacer.newGroupAdded.bind(this),new i(a,b)},uiSpriter:function(a,b){return b||(b={}),b.reference=this._reference,b.extension={obscurers_container:{top:"auto",left:"auto",margin:"0 auto"}},b.callback=this.callbacks.uiSpriter.didAnalyze.bind(this),b.visible=!1,b.image=t("alpha_pattern"),new j(a,b)}},styles:function(){var a=t("sprite_fibos")||"",b={main:{position:"absolute",top:"0",left:"0","font-family":"Arial","text-align":"left",color:"#222","user-select":"none"},"#fibo_panels > h1":{"font-size":"18px",margin:"0 0 5px 5px",padding:"0",cursor:"move"},"#fibo_panels > h1 > small":{"font-size":"10px","font-weight":"400","margin-left":"3px"},"#fibo_bg":{background:"rgba(0,0,0,0.5)",width:"100%",height:"100%",position:"fixed"},"#fibo_controls":{position:"fixed","min-width":"180px"
  },".fibo_toggle":{background:"rgba(100,100,100,.4)","border-top":"1px solid #fff",height:"21px",position:"absolute",right:"-21px",width:"21px"},"#fibo_toggle_main":{background:"rgba(100,100,100,0.4)",height:"34px",position:"absolute",right:"-13px",width:"13px",cursor:"pointer"},"#fibo_toggle_main:hover":{background:"rgba(100,100,100,1)"},"#fibo_toggle_main:after":{content:'"«"',left:"2px",top:"5px",position:"absolute",color:"#fff"},"#fibo_controls.hidden":{display:"block",visibility:"visible"},"#fibo_controls.hidden #fibo_toggle_main:after":{content:'"»"'},"#fibo_toggle_spacers":{top:"34px"},"#fibo_toggle_overlay":{top:"55px"},"#fibo_toggle_rulers":{top:"76px"},"#fibo_toggle_markers":{top:"97px"},".fibo_checkbox":{border:"0 none",clip:"rect(0px, 0px, 0px, 0px)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"},".fibo_checkbox + label":{background:'url("'+a+'") no-repeat scroll -1px -73px transparent',display:"block","font-size":"14px","padding-left":"16px",width:"0",margin:"2px"},".fibo_checkbox:checked + label":{"background-position":"-1px -56px"},"#fibo_panels .fibo_checkbox + label":{"background-position":"-1px -21px",width:"auto",margin:"0"},"#fibo_panels .fibo_checkbox:checked + label":{"background-position":"-1px -38px"},"#fibo_panels .fibo_radio":{width:"12px",height:"12px"},"#fibo_panels":{color:"#222",background:"rgba(100,100,100,0.6)",padding:"5px"},"#fibo_panels>div":{background:"rgba(200,200,200,.6)","border-top":"1px solid rgba(200,200,200,.8)","border-bottom":"1px solid rgba(100,100,100,.8)",margin:"0",padding:"3px"},"#fibo_panels>div.fibo_panel_open":{background:"rgb(200,200,200)"},"#fibo_clone_select":{display:"block","margin-left":"2px"},"#fibo_clone_element":{position:"absolute",padding:"8px","margin-top":"9px",left:"0"},"#fibo_input_text":{display:"block",height:"55px",margin:"2px auto 5px",resize:"none",width:"92%"},"#fibo_panel_selected p":{"font-size":"12px","text-indent":"8px",margin:"3px 0"},"#fibo_sel_left, #fibo_sel_top":{display:"inline-block",width:"50px",height:"auto"},"#fibo_sel_slider_container":{margin:"3px 0 6px 8px"},"#fibo_panel_offset p":{"font-size":"12px","text-indent":"8px",margin:"3px 0"},"#fibo_grp_sel_left, #fibo_grp_sel_top":{display:"inline-block",width:"50px",height:"auto"},"#fibo_grp_sel_multiple":{"margin-left":"0"},"#fibo_grp_sel_multiple_box":{position:"absolute",border:"1px solid #777","background-color":"rgba(100,100,100,.5)"},"#fibo_panel_groups p":{"font-size":"12px","text-indent":"8px",margin:"3px 0"},"#fibo_group_name":{display:"block",width:"160px",height:"auto"},"#fibo_sprites_bg":{position:"fixed",width:"100%",height:"100%","z-index":"-1",background:"#000",opacity:"0.5"},"#sprites_tree":{"list-style":"none outside none",margin:"5px 0",padding:"0"},"#sprites_tree li label":{"font-size":"12px"},"#groups_tree":{"list-style":"none outside none",margin:"5px 0",padding:"0"},"#groups_tree li label":{"font-size":"12px"},"#fibo_input_text,#fibo_sel_left,#fibo_sel_top,#fibo_group_name,#fibo_grp_sel_left,#fibo_grp_sel_top":{overflow:"hidden",background:"transparent",border:"1px solid #777","font-size":"10px"},".vui-btn":{background:'url("'+a+'") repeat-x scroll 0 0 transparent',border:"1px solid #777",padding:"2px 5px 1px",margin:"2px","font-size":"9px","font-weight":"700","text-transform":"uppercase"},".vui-btn:hover,.vui-btn:focus":{border:"1px solid #eee"},".vui-label":{},".vui-content":{}},d={"#fibo_bg":{display:"none"},"#fibos_ruler":{display:"none"},"#fibos_spriter":{display:"none"},"#fibo_sel_spacer_multiple_p":{display:"none"},".vui-content":{display:"none"}},e={main:{"z-index":"9999"},"#fibo_bg":{"z-index":"0"},"#fibos_marker":{"z-index":"1"},"#fibos_spacers":{"z-index":"2"},"#fibos_ruler":{"z-index":"3"},"#fibos_spriter":{"z-index":"4"},"#fibo_grp_sel_multiple_box":{"z-index":"5"},"#fibo_controls":{"z-index":"10"}},f={main:{"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none"}};return c.extend(!0,b,d,e,f),b}}},s}(jQuery,r,c,d,e,f,g,m,l,j,o,k,n,p,q);return s}(),defaultOptions={logEvents:!0},fibos=new FibOS("body",defaultOptions);