text: /**
   * baserjs - v0.8.0 r263
   * update: 2015-08-19
   * Author: baserCMS Users Community [https://github.com/baserproject/]
   * Github: https://github.com/baserproject/baserjs
   * License: Licensed under the MIT License
   */
  
  
  (function(){"use strict";var a,b,c=this,d="document"in c,e="process"in c;if(d?b=a=c.jQuery:e&&(b=a=require("jquery")),!d)throw new Error("baserJS requires a window with a document");!function(b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):b(a)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(arguments.length>1&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setMilliseconds(k.getMilliseconds()+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b)}}),function(b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b:b(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});var f;!function(a){var b;!function(a){var b=function(){function a(){}return a.UID=function(a){var b=Math.floor(1e8*Math.random());a||(a=(new Date).valueOf());var c=b+a,d="uid-"+c.toString(24);return d},a.hyphenDelimited=function(a){for(var b=a.replace(/[A-Z]/g,function(a){return" "+a.toLowerCase()}).split(/[^a-z0-9]+/gi),c=[],d=0,e=b.length;e>d;d++)b[d]&&c.push(b[d].toLowerCase());return c.join("-")},a.snakeCase=function(b){return a.hyphenDelimited(b).replace(/-/g,"_")},a.camelCase=function(b,c){void 0===c&&(c=!1);var d=a.hyphenDelimited(b);return c&&/^[a-z]/.test(d)&&(d="-"+d),d.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})},a.isFalsy=function(a){a=a.toLowerCase();var b=/^\s*(?:false|null|undefined|0|0?(?:\.0+)?)?\s*$/i;return b.test(a)},a.divide=function(a,b){var c,d,e=a.split(b);return e&&(c=e.shift(),e.length&&(d=e.join(b))),[c,d]},a}();a.String=b}(b=a.utility||(a.utility={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b=function(){function a(){}return a.indexOf=function(a,b){for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},a.remove=function(a,b){return a.splice(b,1),a},a}();a.Array=b}(b=a.utility||(a.utility={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b=function(){function a(){}return a.random=function(a,b){void 0===a&&(a=1),void 0===b&&(b=0);var c=Math.random(),d=Math.min(a,b),e=Math.max(a,b);return c*(e-d)+d},a.sam=function(a){for(var b=0,c=0,d=a.length;d>c;c++)b+=a[c];return b},a.split=function(a,b,c){void 0===c&&(c=!1),a=Math.floor(a),b=Math.floor(b);var d=Math.floor(a/b),e=a%b,f=e,g=[],h=b;if(!(0>=b))for(;h--;)f>0||0>e&&0===f?g.push(d+1):g.push(d),f-=0>e?-1:1;return c?{result:g,commonNumber:d,addtion:e}:g},a}();a.Mathematics=b}(b=a.utility||(a.utility={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b;!function(a){var b=function(){function b(){}return b.prototype.on=function(c,d){var e;e="string"==typeof c?c.split(/\s+/g):c;for(var f=0,g=e.length;g>f;f++){var h=new a.EventHandler(this,e[f],d);b.eventHandlers[h.id]=h,b.types[e[f]]||(b.types[e[f]]=[]),b.types[e[f]].push(h)}return this},b.prototype.off=function(a){var c;c="string"==typeof a?a.split(/\s+/g):a;for(var d=0,e=c.length;e>d;d++)delete b.types[c[d]];return this},b.prototype.trigger=function(c,d,e){void 0===d&&(d=[]);var f,g,h;if(e=e||this,b.types[c])for(f=b.types[c].slice();f.length&&(g=f.shift(),g.context!==this||(h=new a.DispacheEvent(c),g.handler.apply(e,[h].concat(d)),!h.isImmediatePropagationStopped())););return this},b.eventHandlers={},b.types={},b}();a.EventDispacher=b}(b=a.event||(a.event={}))}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b;!function(a){var b=function(){function a(a){this._isImmediatePropagationStopped=!1,this.type=a}return a.prototype.isImmediatePropagationStopped=function(){return this._isImmediatePropagationStopped},a.prototype.stopImmediatePropagation=function(){this._isImmediatePropagationStopped=!0},a}();a.DispacheEvent=b}(b=a.event||(a.event={}))}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(b){var c;!function(b){var c=function(){function b(b,c,d){this.context=b,this.id=a.utility.String.UID(),this.type=c,this.handler=d}return b}();b.EventHandler=c}(c=b.event||(b.event={}))}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(c){var d;!function(c){function d(b){var c=["always","done","fail","pipe","progress","promise","state","then"];if(b instanceof a)return!!b.promise;for(;c.length;)if(!(c.shift()in Object(b)))return!1;return!0}var e=function(){function a(a){this._tasks=[],this._index=0,this._iterator=0,this._promise=null,this._resolver=null,this._waitingTime=0,this._waitTimer=0,this._toExit=!1;for(var b=0,c=a.length;c>b;b++)this._tasks.push(new g(a[b]))}return a.prototype.act=function(a,c){var e=this;void 0===c&&(c=!1);var f=this._tasks[this._index],g=f.act(this,this._iterator,a);return d(g)?this._promise=g.promise():(this._resolver=b.Deferred(),this._waitTimer=setTimeout(function(){e._resolver.resolve(g)},this._waitingTime),this._promise=this._resolver.promise()),this._promise.done(function(a){clearTimeout(e._waitTimer),e._promise=null,e._resolver=null,e._waitTimer=null,e._waitingTime=0,e._index+=1,e._iterator+=1,!e._toExit&&(e._index<e._tasks.length||c)&&(e._index>=e._tasks.length&&c&&(e._index=0),e.act(a,c))}).fail(function(){clearTimeout(e._waitTimer),e._promise=null,e._resolver=null,e._waitTimer=null,e._waitingTime=0}),this},a.prototype.loop=function(a){return this.act(a,!0)},a.prototype.exit=function(){return this._toExit=!0,this._resolver&&this._resolver.reject(),this},a.prototype.wait=function(a){this._waitingTime=a},a}();c.Sequence=e;var f,g=function(){function a(a){this.status=f.yet,this._func=a}return a.prototype.act=function(a,b,c){var d=this._func.call(a,b,c);return this.status=f.done,d},a}();!function(a){a[a.done=0]="done",a[a.yet=1]="yet"}(f||(f={}))}(d=c.ui||(c.ui={}))}(f||(f={}));var f;!function(a){var c;!function(c){var d=function(){function c(a){this.protocol=a.protocol,this.host=a.host,this.hostname=a.hostname,this.port=a.port,this.pathname=a.pathname,this.search=a.search,this.hash=a.hash,this.update()}return c.parseQueryString=function(c){var d,e={};return c&&(d=c.split(/&/g),b.each(d,function(b,c){var d=a.utility.String.divide(c,"="),f=d[0],g=d[1];f&&(/\[\]$/.test(f)?(f=f.replace(/\[\]$/,""),e[f]&&e[f].push?e[f].push(g):e[f]=[g]):e[f]=g)})),e},c.prototype.update=function(){return this.origin=this.protocol+"//"+this.host,this.path=this.pathname+this.search+this.hash,this.href=this.origin+this.path,this.query=this.search.replace(/^\?/,""),this.params=c.parseQueryString(this.query),this},c.prototype.addParam=function(a,c){var d=this,e="";return"string"!=typeof c&&c?b.each(c,function(b,c){void 0!==c&&(e="="+c),d.search?d.search+="&"+a+"[]"+e:d.search="?"+a+"[]"+e}):(void 0!==c&&(e="="+c),this.search?this.search+="&"+a+e:this.search="?"+a+e),this.update(),this},c.prototype.removeParam=function(a){return this.search=this.search.replace(new RegExp(a+"(?:\\[\\])?(?:=[^&]*)?(&|$)","g"),""),this.update(),this},c.prototype.toString=function(){return this.update(),this.href},c}();c.Locational=d}(c=a.ui||(a.ui={}))}(f||(f={}));var f,g=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c};!function(a){var c;!function(a){var c=function(c){function d(){var a=this;c.call(this),this.resizeEndInterval=100,this.scrollEndInterval=100,this.isResize=!1,this.isScroll=!1;var d,e=b(window);e.on("resize",function(b){a.isResize||a.trigger("resizestart"),a.isResize=!0,a.trigger("resize"),window.clearTimeout(d),d=window.setTimeout(function(){a.isResize=!1,a.trigger("resize"),a.trigger("resizeend")},a.resizeEndInterval)});var f;e.on("scroll",function(b){a.isScroll||a.trigger("scrollstart"),a.isScroll=!0,a.trigger("scroll"),window.clearTimeout(f),f=window.setTimeout(function(){a.isScroll=!1,a.trigger("scroll"),a.trigger("scrollend")},a.resizeEndInterval)})}return g(d,c),d.jumpTo=function(a,b){void 0===b&&(b=!1);var c;c="string"==typeof a?a:a.href,b?window.open(c,null):window.location.href=c},d.getUA=function(){var a=navigator.userAgent,b={iOS:!1,android:/android/i.test(a),iPad:/ipad/i.test(a),iPhone:/iphone/i.test(a),iPod:/ipod/i.test(a),safari:/safari/i.test(a),chrome:/crios|chrome/i.test(a)};return b.iOS=b.iPad||b.iPhone||b.iPod||!1,b.chrome&&(b.safari=!1),b},d.inheritParams=function(c){var d=b("a, area").filter("[href]"),e=new a.Locational(location);if(c in e.params){var f=c,g=e.params[c];d.each(function(b,c){var d=c,h=new a.Locational(d);e.host===h.host&&(h.addParam(f,g),d.href=h.href)})}},d.browser=new d,d.spec={isTouchable:"ontouchstart"in window,ua:d.getUA()},d}(a.event.EventDispacher);a.Browser=c}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b=function(b){function c(c,d){var e=this;b.call(this),this.currentPoint=0,this.breakPoints=[],this._values={},this._setBreakPoints(c),a.Browser.browser.on("resizeend",function(){for(var a,b,c=0,f=e.breakPoints.length,g=window.document.documentElement.clientWidth;f>c;c++)if(a=e.breakPoints[c],a>=g){e.currentPoint!==a&&(e.currentPoint=a,b=e._values[a+""],d&&d(b,a,g),e.trigger("breakpoint",[b,a,g],e),e.trigger("breakpoint:"+a,[b,g],e));break}})}return g(c,b),c.prototype._setBreakPoints=function(a){var b,c,d;for(b in a)a.hasOwnProperty(b)&&(c=parseFloat(b),c>=1&&(this.breakPoints.push(c),d=a[b],this._values[c+""]=d));this.breakPoints.sort(function(a,b){return a-b})},c.prototype.add=function(a){this._setBreakPoints(a)},c}(a.event.EventDispacher);a.BreakPoints=b}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c=function(){function a(){this.timerId=null,this.interval=13,this._onProgress=null,this.now()}return a.prototype.valueOf=function(){return this.datetime.valueOf()},a.prototype.now=function(){return this.datetime=new Date,this.valueOf()},a.prototype.start=function(a){this.now();this.stop();return this},a.prototype.stop=function(){return clearTimeout(this.timerId),this.timerId=null,this},a.prototype.wait=function(a,b,c){var d=this;return null==c&&(c=this),this.stop(),this.timerId=window.setTimeout(function(){d.stop(),b.call(c)},a),this},a.prototype.progress=function(a){return b.isFunction(a)&&(this._onProgress=a),this},a.wait=function(b,c,d){return(new a).wait(b,c,d)},a}();a.Timer=c}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b=function(){function a(a){this.callback=a}return a.prototype.start=function(b){var c,d=this;b=b||this,"requestAnimationFrame"in window?this.requestId=requestAnimationFrame(function(){cancelAnimationFrame(d.requestId),d.callback.call(b),d.start(b)}):(c=1e3/a.FRAME_RATE,this.requestId=window.setTimeout(function(){window.clearTimeout(d.requestId),d.callback.call(b),d.start(b)},c))},a.prototype.stop=function(){"cancelAnimationFrame"in window?cancelAnimationFrame(this.requestId):window.clearTimeout(this.requestId)},a.FRAME_RATE=60,a}();a.AnimationFrames=b}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c=function(){function c(){this.timer=new a.Timer}return c.prototype.to=function(d,e){var f,g,h,i,j,k,l,m,n,o,p=this,q=0;if(this.options=e||{},q+=this.options.offset||0,this.options.wheelCancel&&b(document).on("mousewheel",function(){p.isScroll&&(p._finish(),b.isFunction(p.options.onScrollCancel)&&p.options.onScrollCancel.call(p,new b.Event("scrollcancel")))}),"number"==typeof d)q+=d||0,this.targetX=0,this.targetY=q;else{if(!d)return o=b(window.location.hash),o.length&&a.Timer.wait(c.delayWhenURLHashTarget,function(){window.scrollTo(0,0),p.to(o,{offset:q})}),this;if(o=b(d),!o.length)return this;for(f=o[0],g=0,h=0;f;)g+=f.offsetLeft,h+=f.offsetTop,f=f.offsetParent;k=document.documentElement.clientWidth,l=document.documentElement.clientHeight,i=document.documentElement.scrollWidth,j=document.documentElement.scrollHeight,m=Math.max(k,i),n=Math.max(l,j),this.targetX=Math.min(g,m)+q,this.targetY=Math.min(h,n)+q}return this.isScroll||(this.isScroll=!0,b.isFunction(this.options.onScrollStart)&&this.options.onScrollStart.call(this,new b.Event("scrollstart")),this._scroll()),this},c.prototype._scroll=function(){var a=this._getX(),d=this._getY(),e=(this.targetX-a)/c.speed,f=(this.targetY-d)/c.speed,g=Math.floor(a+e),h=Math.floor(d+f);Math.abs(e)<1&&Math.abs(f)<1||this.prevX===a&&this.prevY===d?(window.scrollTo(this.targetX,this.targetY),this._finish(),b.isFunction(this.options.onScrollEnd)&&this.options.onScrollEnd.call(this,new b.Event("scrollend"))):(window.scrollTo(g,h),this.prevX=a,this.prevY=d,b.isFunction(this.options.onScrollProgress)&&this.options.onScrollProgress.call(this,new b.Event("scrollprogress")),this.timer.wait(c.interval,this._scroll,this))},c.prototype._getX=function(){return void 0!==window.pageXOffset?window.pageXOffset:document.documentElement.scrollLeft||document.body.scrollLeft},c.prototype._getY=function(){return void 0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop||document.body.scrollTop},c.prototype._finish=function(){this.isScroll=!1,this.prevX=null,this.prevY=null,this.timer.stop()},c.speed=4,c.interval=20,c.delayWhenURLHashTarget=30,c}();a.Scroll=c}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(c){var d;!function(d){!function(a){a[a.HYPHEN_DELIMITED=0]="HYPHEN_DELIMITED",a[a.SNAKE_CASE=1]="SNAKE_CASE",a[a.CAMEL_CASE=2]="CAMEL_CASE"}(d.ElementClassNameCase||(d.ElementClassNameCase={}));var e=d.ElementClassNameCase;!function(a){a[a.HYPHEN=0]="HYPHEN",a[a.DOUBLE_HYPHEN=1]="DOUBLE_HYPHEN",a[a.UNDERSCORE=2]="UNDERSCORE",a[a.DOUBLE_UNDERSCORE=3]="DOUBLE_UNDERSCORE",a[a.CAMEL_CASE=4]="CAMEL_CASE"}(d.ClassNameSeparatorForBEM||(d.ClassNameSeparatorForBEM={}));var f=d.ClassNameSeparatorForBEM,h="-",i="--",j="_",k="__",l=function(c){function d(b){if(c.call(this),this.name="",this._elementized=!1,b.data("bc-element"))return"console"in window&&console.warn("This element is elementized of baserJS."),void(this._elementized=!0);b.data("bc-element",this),this.$el=b;var e=[],f=[];this.$el.each(function(b,c){var d=c.id||a.utility.String.UID(),g=c.getAttribute("name");c.id=d,e.push(d),f.push(g)}),this.id=e.join(" "),this.name=f.join(" "),this.addClass(d.classNameElementCommon)}return g(d,c),d.createClassName=function(b,c,g){void 0===c&&(c=""),void 0===g&&(g="");var l,m,n,o,p="";switch(d.classNameDefaultCase){case e.HYPHEN_DELIMITED:m=h,b=a.utility.String.hyphenDelimited(b),c=a.utility.String.hyphenDelimited(c),g=a.utility.String.hyphenDelimited(g);break;case e.SNAKE_CASE:m=j,b=a.utility.String.snakeCase(b),c=a.utility.String.snakeCase(c),g=a.utility.String.snakeCase(g);break;case e.CAMEL_CASE:m="",b=a.utility.String.camelCase(b,!0),c=a.utility.String.camelCase(c),g=a.utility.String.camelCase(g)}switch(d.classNameDefaultSeparatorForElement){case f.HYPHEN:n=h;break;case f.DOUBLE_HYPHEN:n=i;break;case f.UNDERSCORE:n=j;break;case f.DOUBLE_UNDERSCORE:n=k;break;case f.CAMEL_CASE:n=""}switch(d.classNameDefaultSeparatorForModifier){case f.HYPHEN:o=h;break;case f.DOUBLE_HYPHEN:o=i;break;case f.UNDERSCORE:o=j;break;case f.DOUBLE_UNDERSCORE:o=k;break;case f.CAMEL_CASE:o=""}return d.classNameDefaultPrefix&&(l=d.classNameDefaultPrefix,l=l.replace(/^[^a-z_-]/i,""),l=l.replace(/[^a-z0-9_-]+/gi,""),l=l.replace(/^--+/,"-"),p+=l),p+=m+b,c&&(p+=n+c),g&&(p+=o+g),p},d.getBoolAttr=function(b,c){var d=b.prop(c);if(d===!0)return!0;var e=b.attr(c);return void 0===e?!1:""===e?!0:!a.utility.String.isFalsy(e)},d.addClassTo=function(a,b,c,e){void 0===c&&(c=""),void 0===e&&(e="");var f=d.createClassName(b,c,e);a.addClass(f)},d.removeClassFrom=function(a,b,c,e){void 0===c&&(c=""),void 0===e&&(e="");var f=d.createClassName(b,c,e);a.removeClass(f)},d.removeCSSPropertyFromDOMElement=function(a,b){var c=b.style,d=c;c&&(c.removeProperty?c.removeProperty(a):d.removeAttribute&&d.removeAttribute(a))},d.removeCSSProperty=function(a,b){b.each(function(b,c){d.removeCSSPropertyFromDOMElement(a,c)})},d.prototype.addClass=function(a,b,c){void 0===b&&(b=""),void 0===c&&(c="");var e=d.createClassName(a,b,c);this.$el.addClass(e)},d.prototype.getBoolAttr=function(a){return d.getBoolAttr(this.$el,a)},d.prototype.mergeOptions=function(a,c){var d,e={},f={};for(d in a)if(a.hasOwnProperty(d)){switch(d){case"id":case"class":break;default:e[d]=this.$el.attr(d)}f[d]=this.$el.data(d)}return b.extend({},a,c,f,e)},d.classNameDefaultPrefix="-bc",d.classNameElementCommon="element",d.classNameDefaultCase=e.HYPHEN_DELIMITED,d.classNameDefaultSeparatorForElement=f.DOUBLE_UNDERSCORE,d.classNameDefaultSeparatorForModifier=f.DOUBLE_HYPHEN,d}(c.event.EventDispacher);d.Element=l}(d=c.element||(c.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c;!function(a){var c=function(c){function d(a,e){c.call(this,a),this.hasFocus=!1,this._elementized||a[0].querySelector&&(this._config=b.extend({},d.defaultOption,e),this._setClassName(),this._asignLabel(),this._setLabelText(),this._createWrapper(),this._createPsuedoElements(),this._bindEvents(),this.defaultValue=this.$el.val(),this.setDisabled(a.prop("disabled")),this._onblur(),d.elements.push(this))}return g(d,c),d.prototype._setClassName=function(){this.addClass(d.classNameFormElementCommon)},d.prototype._setLabelText=function(){var a=this,c=this.$label.contents(),d=b(),e=b(),f=!0;this._config.label?(this.$label.prepend(this._config.label),this.labelBeforeText=this._config.label,this.labelAfterText=""):(c.each(function(c,g){return g===a.$el[0]?void(f=!1):void(f?d=d.add(b(g)):e=e.add(b(g)))}),d.text(function(a,c){return b.trim(c)}),e.text(function(a,c){return b.trim(c)}),this.labelBeforeText=d.text()||this.$el.attr("title")||"",this.labelAfterText=e.text()||"",this.labelBeforeText&&this.$label.prepend(d),this.labelAfterText&&this.$label.append(e)),this.label=this.labelBeforeText+this.labelAfterText},d.prototype._asignLabel=function(){var c,e;this.hasLabelByForAttr=!1,c=this.$el.closest("label"),e=!!c.length,this.isWrappedByLabel=e,e||(c=b('label[for="'+this.id+'"]'),e=!!c.length,this.hasLabelByForAttr=e),this._config.autoLabeling&&!e&&(c=b("<"+this._config.labelTag.toLowerCase()+" />"),c.insertAfter(this.$el),this._config.labelClass&&c.addClass(this._config.labelClass),"label"===this._config.labelTag.toLowerCase()&&c.attr("for",this.id)),a.Element.addClassTo(c,d.classNameFormElementCommon),a.Element.addClassTo(c,d.classNameFormElementCommon,d.classNameLabel),this.$label=c},d.prototype._createWrapper=function(){var c="<span />",e=b(c);a.Element.addClassTo(e,d.classNameFormElementCommon),a.Element.addClassTo(e,d.classNameWrapper),this.isWrappedByLabel?(this.$label.wrapAll(e),this.$wrapper=this.$label.parent("span")):this.hasLabelByForAttr?(this.$el.wrapAll(e),this.$wrapper=this.$el.parent("span")):(this.$el.add(this.$label).wrapAll(e),this.$wrapper=this.$el.parent("span"))},d.prototype._createPsuedoElements=function(){},d.prototype._bindEvents=function(){var a=this;this.$el.on("focus.bcFormElement",function(){a.disabled||a._onfocus()}),this.$el.on("blur.bcFormElement",function(){a._onblur()}),this.$el.on("change.bcFormElement",function(b,c){c&&c.isSilent?a._onSilentChange():a.trigger("change",null,a)})},d.prototype._onSilentChange=function(){},d.prototype._onfocus=function(){this.hasFocus=!0,a.Element.addClassTo(this.$el,d.classNameFormElementCommon,"",d.classNameStateFocus),a.Element.addClassTo(this.$label,d.classNameFormElementCommon,d.classNameLabel,d.classNameStateFocus),a.Element.addClassTo(this.$wrapper,d.classNameWrapper,"",d.classNameStateFocus),a.Element.removeClassFrom(this.$el,d.classNameFormElementCommon,"",d.classNameStateBlur),a.Element.removeClassFrom(this.$label,d.classNameFormElementCommon,d.classNameLabel,d.classNameStateBlur),a.Element.removeClassFrom(this.$wrapper,d.classNameWrapper,"",d.classNameStateBlur)},d.prototype._onblur=function(){this.hasFocus=!1,a.Element.addClassTo(this.$el,d.classNameFormElementCommon,"",d.classNameStateBlur),a.Element.addClassTo(this.$label,d.classNameFormElementCommon,d.classNameLabel,d.classNameStateBlur),a.Element.addClassTo(this.$wrapper,d.classNameWrapper,"",d.classNameStateBlur),a.Element.removeClassFrom(this.$el,d.classNameFormElementCommon,"",d.classNameStateFocus),a.Element.removeClassFrom(this.$label,d.classNameFormElementCommon,d.classNameLabel,d.classNameStateFocus),a.Element.removeClassFrom(this.$wrapper,d.classNameWrapper,"",d.classNameStateFocus)},d.prototype._fireChangeEvent=function(a){void 0===a&&(a=!1);var b,c;a?this.$el.trigger("change.bcFormElement",[{isSilent:!0}]):"createEvent"in document?(b=document.createEvent("Event"),b.initEvent("change",!0,!0),this.$el[0].dispatchEvent(b)):(c=this.$el[0],c.fireEvent("onchange"))},d.prototype.setValue=function(a,b){void 0===b&&(b=!1);var c=String(a),d=this.$el.val();this.disabled||d===c||(this.$el.val(c),this._fireChangeEvent(b))},d.prototype.setDisabled=function(b){this.disabled=b,this.$el.prop("disabled",b),this.disabled?(a.Element.addClassTo(this.$el,d.classNameFormElementCommon,"",d.classNameStateDisabled),a.Element.addClassTo(this.$label,d.classNameFormElementCommon,d.classNameLabel,d.classNameStateDisabled),a.Element.addClassTo(this.$wrapper,d.classNameWrapper,"",d.classNameStateDisabled)):(a.Element.removeClassFrom(this.$el,d.classNameFormElementCommon,"",d.classNameStateDisabled),a.Element.removeClassFrom(this.$label,d.classNameFormElementCommon,d.classNameLabel,d.classNameStateDisabled),a.Element.removeClassFrom(this.$wrapper,d.classNameWrapper,"",d.classNameStateDisabled))},d.defaultOption={label:"",labelTag:"label",labelClass:"",autoLabeling:!0},d.classNameFormElementCommon="form-element",d.classNameWrapper="wrapper",d.classNameLabel="label",d.classNameStateFocus="focus",d.classNameStateBlur="blur",d.classNameStateDisabled="disabled",d.elements=[],d}(a.Element);a.FormElement=c}(c=a.element||(a.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c;!function(a){var c=function(c){function d(a,e){c.call(this,a,b.extend({},d.defaultOption,e)),this.placeholder="",this._elementized||a[0].querySelector&&(this.placeholder=this.$el.attr("placeholder")||"",this.hasPlaceholder=!!this.placeholder,this._update())}return g(d,c),d.prototype._setClassName=function(){c.prototype._setClassName.call(this),this.addClass(d.classNameTextField)},d.prototype._createWrapper=function(){c.prototype._createWrapper.call(this),a.Element.addClassTo(this.$wrapper,d.classNameTextField+"-"+a.FormElement.classNameWrapper)},d.prototype._bindEvents=function(){var a=this;c.prototype._bindEvents.call(this),b(document).on("keyup.bcTextField-"+this.id,function(b){a.hasFocus&&a._update()}),d.supportPlaceholder||(this.$el.on("focus.bcTextField click.bcTextField",function(){a._equalPlaceholder()&&a._msCaretMoveToTop()}),b(document).on("keydown.bcTextField-"+this.id,function(b){a.hasFocus&&a._equalPlaceholder()&&a.$el.val("")}))},d.prototype._update=function(){var a=this.$el.val()||"",b=!a;d.supportPlaceholder?b?this._setStateUninputted():this._setStateInputted():this._equalPlaceholder()?this._setStateUninputted():b?(this._setStateUninputted(),this._setPlaceholderValue()):this._setStateInputted()},d.prototype._setStateInputted=function(){this.isEmpty=!1,a.Element.removeClassFrom(this.$el,a.FormElement.classNameFormElementCommon,"",d.classNameStateUninput),a.Element.removeClassFrom(this.$label,a.FormElement.classNameFormElementCommon,a.FormElement.classNameLabel,d.classNameStateUninput),a.Element.removeClassFrom(this.$wrapper,a.FormElement.classNameWrapper,"",d.classNameStateUninput)},d.prototype._setStateUninputted=function(){this.isEmpty=!0,a.Element.addClassTo(this.$el,a.FormElement.classNameFormElementCommon,"",d.classNameStateUninput),a.Element.addClassTo(this.$label,a.FormElement.classNameFormElementCommon,a.FormElement.classNameLabel,d.classNameStateUninput),a.Element.addClassTo(this.$wrapper,a.FormElement.classNameWrapper,"",d.classNameStateUninput)},d.prototype._equalPlaceholder=function(){var a=this.$el.val()||"";return this.placeholder===a},d.prototype._setPlaceholderValue=function(){this.$el.val(this.placeholder),this._msCaretMoveToTop()},d.prototype._msCaretMoveToTop=function(){var a=this.$el[0],b=a.createTextRange();b.collapse(),b.moveStart("character",0),b.moveEnd("character",0),b.select()},d.defaultOption={},d.classNameTextField="form-text-field",d.classNameStateUninput="uninput",d.supportPlaceholder=void 0!==b("<input />").prop("placeholder"),d}(a.FormElement);a.TextField=c}(c=a.element||(a.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c;!function(c){var d=function(d){function e(a,c){d.call(this,a,b.extend({},e.defaultOption,c)),this._elementized||a[0].querySelector&&this._update()}return g(e,d),e.prototype._setClassName=function(){d.prototype._setClassName.call(this),this.addClass(e.classNameSelect)},e.prototype._createWrapper=function(){d.prototype._createWrapper.call(this),c.Element.addClassTo(this.$wrapper,e.classNameSelect+"-"+c.FormElement.classNameWrapper)},e.prototype._createPsuedoElements=function(){var d=this;this.$pseudo=b("<a />"),this.$pseudo.attr("href","#"),this.$pseudo.insertAfter(this.$el),c.Element.addClassTo(this.$pseudo,c.FormElement.classNameFormElementCommon),c.Element.addClassTo(this.$pseudo,e.classNamePseudoSelect),this.$selected=b("<span />"),this.$selected.appendTo(this.$pseudo),c.Element.addClassTo(this.$selected,c.FormElement.classNameFormElementCommon),c.Element.addClassTo(this.$selected,e.classNamePseudoSelect,e.classNamePseudoSelectedDisplay),this._config.useDefaultOptionList||(this.$options=b("<ul />"),this.$options.appendTo(this.$pseudo),c.Element.addClassTo(this.$options,c.FormElement.classNameFormElementCommon),c.Element.addClassTo(this.$options,e.classNamePseudoSelect,e.classNameSelectOptionList),this.$el.find("option").each(function(a,f){var g=b(f),h=g.val(),i=g.text(),j=b("<li />");j.appendTo(d.$options),j.data("value",h),j.text(i),c.Element.addClassTo(j,c.FormElement.classNameFormElementCommon),c.Element.addClassTo(j,e.classNameSelectOptionList,e.classNameSelectOption)})),a.Browser.spec.isTouchable&&(a.Browser.spec.ua.iPhone||a.Browser.spec.ua.iPod?(this.addClass(e.classNameOsIOs),c.Element.addClassTo(this.$wrapper,e.classNameOsIOs),c.Element.addClassTo(this.$label,e.classNameOsIOs)):a.Browser.spec.ua.android&&(this.addClass(e.classNameOsAndroid),c.Element.addClassTo(this.$wrapper,e.classNameOsAndroid),c.Element.addClassTo(this.$label,e.classNameOsAndroid))),this._config.useDefaultOptionList&&(this.addClass(e.classNameUseDefaultOptionList),c.Element.addClassTo(this.$wrapper,e.classNameUseDefaultOptionList),c.Element.addClassTo(this.$label,e.classNameUseDefaultOptionList))},e.prototype._bindEvents=function(){var a=this;d.prototype._bindEvents.call(this),this.$el.on("change.bcSelect",function(){a._update()}),this.$pseudo.on("click.bcSelect","li",function(c){var d=b(c.target),e=d.index();a._onblur(),a.setIndex(e),c.stopPropagation(),c.preventDefault()}),this.$pseudo.on("click.bcSelect",function(a){a.preventDefault()}),this._config.useDefaultOptionList?this.$pseudo.removeAttr("href"):this._psuedoFocusEvent()},e.prototype._onSilentChange=function(){this._update()},e.prototype._scrollToSelectedPosition=function(){var a,c,d,e;this.$options&&(a=this.$options.find("li"),this.$el.find("option").each(function(d,e){var f=b(e),g=f.prop("selected");g&&(c=a.eq(d))}),this.$options.scrollTop(0),d=c.offset(),e=this.$options.offset(),d&&e&&this.$options.scrollTop(d.top-e.top))},e.prototype._psuedoFocusEvent=function(){var a=this;this.$el.off("focus.bcFormElement"),this.$el.off("blur.bcFormElement"),this.$el.on("focus.bcSelect",function(b){a.disabled||a.$pseudo.focus(),b.stopPropagation(),b.preventDefault()}),b(document).on("click.bcSelect",function(b){a._onblur()}),b(document).on("focusin",function(b){a._onblur()}),this.$pseudo.on("focus.bcSelect",function(b){a.disabled?a.$pseudo.blur():a._onfocus(),b.stopPropagation()}).on("click.bcSelect",function(b){a.disabled||a._onfocus(),b.stopPropagation(),b.preventDefault()}),this.$label.on("click.bcSelect focus.bcSelect",function(a){a.stopPropagation()}),this._bindKeybordEvent()},e.prototype._bindKeybordEvent=function(){var a=this;b(document).on("keydown",function(b){if(a.hasFocus)switch(b.keyCode){case 38:a.prev(!0),a._scrollToSelectedPosition(),b.preventDefault();break;case 40:a.next(!0),a._scrollToSelectedPosition(),b.preventDefault();break;case 13:a._currentIndex!==a.getIndex()&&a._fireChangeEvent(),a._onblur(),b.preventDefault()}})},e.prototype._onfocus=function(){this.hasFocus||(b(document).triggerHandler("click.bcSelect"),d.prototype._onfocus.call(this),c.Element.addClassTo(this.$pseudo,e.classNamePseudoSelect,"",c.FormElement.classNameStateFocus),c.Element.removeClassFrom(this.$pseudo,e.classNamePseudoSelect,"",c.FormElement.classNameStateBlur),this._scrollToSelectedPosition(),this._currentIndex=this.getIndex())},e.prototype._onblur=function(){
  this.$pseudo&&(d.prototype._onblur.call(this),c.Element.addClassTo(this.$pseudo,e.classNamePseudoSelect,"",c.FormElement.classNameStateBlur),c.Element.removeClassFrom(this.$pseudo,e.classNamePseudoSelect,"",c.FormElement.classNameStateFocus))},e.prototype.update=function(){return this._update(),this},e.prototype._update=function(){var a,d,f=this;a=this.$el.find(":selected"),this.$options&&(d=this.$options.find("li")),this.$el.find("option").each(function(a,g){var h,i,j,k=b(g);h=k.prop("selected"),i=k.prop("disabled"),h&&f.$selected.text(k.text()),f.$options&&(j=d.eq(a),j.attr("aria-selected",""+h),j.attr("aria-disabled",""+i),h?(c.Element.addClassTo(j,e.classNameSelectOptionList,e.classNameSelectOption,e.classNameStateSelected),c.Element.removeClassFrom(j,e.classNameSelectOptionList,e.classNameSelectOption,e.classNameStateUnselected)):(c.Element.addClassTo(j,e.classNameSelectOptionList,e.classNameSelectOption,e.classNameStateUnselected),c.Element.removeClassFrom(j,e.classNameSelectOptionList,e.classNameSelectOption,e.classNameStateSelected)),i?c.Element.addClassTo(j,e.classNameSelectOptionList,e.classNameSelectOption,e.classNameStateDisabled):c.Element.removeClassFrom(j,e.classNameSelectOptionList,e.classNameSelectOption,e.classNameStateDisabled))})},e.prototype.setValue=function(a){var b=String(a),c=this.$el.find('option[value="'+b+'"]');c.length&&!c.prop("selected")&&(c.prop("selected",!0),this._fireChangeEvent())},e.prototype.setIndex=function(a,b){void 0===b&&(b=!1);var c=this.$el.find("option").eq(a);!c.length||c.prop("selected")||c.prop("disabled")||(c.prop("selected",!0),this._fireChangeEvent(b))},e.prototype.getIndex=function(){var a=0;return this.$el.find("option").each(function(c,d){var e=b(d);e.prop("selected")&&(a=e.index())}),a},e.prototype.next=function(a){var b=this.getIndex(),c=this.$el.find("option").length,d=b+1;this.setIndex(Math.min(d,c),a)},e.prototype.prev=function(a){var b=this.getIndex(),c=b-1;this.setIndex(Math.max(c,0),a)},e.prototype.setDisabled=function(a){d.prototype.setDisabled.call(this,a),this.disabled?this.$pseudo.attr("tabindex",-1):this.$pseudo.removeAttr("tabindex")},e.defaultOption={useDefaultOptionList:a.Browser.spec.isTouchable&&a.Browser.spec.ua.iPhone||a.Browser.spec.ua.iPod||a.Browser.spec.ua.android},e.classNameSelect="form-select",e.classNamePseudoSelect="pseudo-select",e.classNamePseudoSelectedDisplay="selected-display",e.classNameSelectOptionList="option-list",e.classNameSelectOption="item",e.classNameOsIOs="os-i-os",e.classNameOsAndroid="os-android",e.classNameUseDefaultOptionList="use-default-option-list",e.classNameStateSelected="selected",e.classNameStateUnselected="unselected",e}(c.FormElement);c.Select=d}(c=a.element||(a.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c;!function(a){var c=function(c){function d(a,e){var f=this;c.call(this,a,b.extend({},d.defaultOption,e)),this._elementized||a[0].querySelector&&(this._checkedClass=this._config.checkedClass,this.checked=this.$el.prop("checked"),this.defaultChecked=this.$el.prop("defaultChecked"),this._update(),this.$el.on("change.bcCheckableElement",function(){f._onchenge()}))}return g(d,c),d.prototype.update=function(){this.$el.prop("checked")!==this.checked&&this._update()},d.prototype._onchenge=function(){this.checked=!this.checked,this._update()},d.prototype._update=function(){var b=this.$el.prop("checked");this.$el.attr("aria-checked",""+b),b?(this.$el.addClass(this._checkedClass),this.$label.addClass(this._checkedClass),this.$wrapper.addClass(this._checkedClass),a.Element.addClassTo(this.$el,a.FormElement.classNameFormElementCommon,"",d.classNameStateChecked),a.Element.addClassTo(this.$label,a.FormElement.classNameFormElementCommon,a.FormElement.classNameLabel,d.classNameStateChecked),a.Element.addClassTo(this.$wrapper,a.FormElement.classNameWrapper,"",d.classNameStateChecked),a.Element.removeClassFrom(this.$el,a.FormElement.classNameFormElementCommon,"",d.classNameStateUnchecked),a.Element.removeClassFrom(this.$label,a.FormElement.classNameFormElementCommon,a.FormElement.classNameLabel,d.classNameStateUnchecked),a.Element.removeClassFrom(this.$wrapper,a.FormElement.classNameWrapper,"",d.classNameStateUnchecked)):(this.$el.removeClass(this._checkedClass),this.$label.removeClass(this._checkedClass),this.$wrapper.removeClass(this._checkedClass),a.Element.addClassTo(this.$el,a.FormElement.classNameFormElementCommon,"",d.classNameStateUnchecked),a.Element.addClassTo(this.$label,a.FormElement.classNameFormElementCommon,a.FormElement.classNameLabel,d.classNameStateUnchecked),a.Element.addClassTo(this.$wrapper,a.FormElement.classNameWrapper,"",d.classNameStateUnchecked),a.Element.removeClassFrom(this.$el,a.FormElement.classNameFormElementCommon,"",d.classNameStateChecked),a.Element.removeClassFrom(this.$label,a.FormElement.classNameFormElementCommon,a.FormElement.classNameLabel,d.classNameStateChecked),a.Element.removeClassFrom(this.$wrapper,a.FormElement.classNameWrapper,"",d.classNameStateChecked)),this.checked=b},d.defaultOption={checkedClass:""},d.classNameStateChecked="checked",d.classNameStateUnchecked="unchecked",d}(a.FormElement);a.CheckableElement=c}(c=a.element||(a.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b;!function(a){var b=function(b){function c(d,e){b.call(this,d,e),this._elementized||d[0].querySelector&&(this.addClass(c.classNameRadio),a.Element.addClassTo(this.$label,c.classNameRadio,a.FormElement.classNameLabel),a.Element.addClassTo(this.$wrapper,c.classNameRadio+"-"+a.FormElement.classNameWrapper),a.RadioGroup.groups[this.name]||(a.RadioGroup.groups[this.name]=new a.RadioGroup(this.name)),a.RadioGroup.groups[this.name].add(this))}return g(c,b),c.prototype._onchenge=function(){b.prototype._onchenge.call(this),a.RadioGroup.groups[this.name].update(this)},c.classNameRadio="form-radio",c}(a.CheckableElement);a.Radio=b}(b=a.element||(a.element={}))}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b;!function(a){var b=function(b){function c(d,e){b.call(this,d,e),this._elementized||d[0].querySelector&&(this.addClass(c.classNameCheckbox),a.Element.addClassTo(this.$label,c.classNameCheckbox,a.FormElement.classNameLabel),a.Element.addClassTo(this.$wrapper,c.classNameCheckbox+"-"+a.FormElement.classNameWrapper))}return g(c,b),c.classNameCheckbox="form-checkbox",c}(a.CheckableElement);a.Checkbox=b}(b=a.element||(a.element={}))}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var b;!function(a){var b;!function(a){var b=function(){function a(a){this.radioButtons=[],this.name=a}return a.prototype.add=function(a){for(var b=0,c=this.radioButtons.length;c>b;b++)if(this.radioButtons[b]===a)return;this.radioButtons.push(a)},a.prototype.update=function(a){for(var b=0,c=this.radioButtons.length;c>b;b++)this.radioButtons[b]!==a&&this.radioButtons[b].update()},a.groups={},a}();a.RadioGroup=b}(b=a.element||(a.element={}))}(b=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(c){var d;!function(d){var e=function(e){function f(b,d,g){var h=this;void 0===d&&(d=0),e.call(this,b),f.boot();var i=this.$el.data(f.DATA_KEY_ID);i&&this.destroy(),i=a.utility.String.UID(),this.$el.data(f.DATA_KEY_ID,i),this.$el.data(f.DATA_KEY,this),f.groups[i]=this;var j;j="number"==typeof d?{Infinity:d}:d,this._columns=new c.BreakPoints(j,function(a,b,c){h._currentColumn=a,h._align()}),this._callback=g,this._align(),this.on("realign",function(){h._align()})}return g(f,e),f.createChar=function(){var a=b("<del>M</del>").css({display:"block",visibility:"hidden",position:"absolute",padding:0,top:0,zIndex:-1});a.appendTo("body"),f.dummyCharElement=a[0],f.currentFontSize=f.dummyCharElement.offsetHeight},f.isChanged=function(){return f.currentFontSize===f.dummyCharElement.offsetHeight?!1:(f.currentFontSize=f.dummyCharElement.offsetHeight,!0)},f.observerForFontSize=function(){f.isChanged()&&f.reAlign()},f.reAlign=function(){var a;for(a in f.groups)f.groups[a].trigger("realign")},f.boot=function(){var a;f.isBooted||(a=b(window),a.on("load",f.reAlign),c.Browser.browser.on("resizeend",f.reAlign),f.isBooted=!0,f.createChar(),f.watchTimer=window.setInterval(f.observerForFontSize,f.watchInterval))},f.prototype._align=function(){var a,c,e,f,g=this,h=this.$el.length-1;this._currentColumn||(this._currentColumn=this.$el.length),this.$el.each(function(i,j){var k,l,m,n=!1;if(d.Element.removeCSSPropertyFromDOMElement("height",j),e=i%g._currentColumn,0===e&&(a=[]),k=a[e]=b(j),f=k.height(),(0===e||f>c)&&(c=f),i===h||e===g._currentColumn-1)for(m=a.length,l=0;m>l;l++)a[l]&&(b.isFunction(g._callback)&&(n=!g._callback(c,f,g)),n||a[l].height(c))})},f.prototype.destroy=function(){this.$el.each(function(a,c){var d=b(c),e=d.data(f.DATA_KEY_ID);d.removeData(f.DATA_KEY_ID),e in f.groups&&delete f.groups[e]})},f.DATA_KEY="bc-box",f.DATA_KEY_ID=f.DATA_KEY+"-id",f.watchInterval=1e3,f.isBooted=!1,f.groups={},f}(d.Element);d.AlignedBoxes=e}(d=c.element||(c.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c;!function(a){var c=function(a){function c(d,e){a.call(this,d),this._elementized||d[0].querySelector&&(this.$el.addClass(c.className),"google"in window&&google.maps?(this.mapOption=b.extend({},e),this._init()):console&&console.warn&&console.warn('ReferenceError: "//maps.google.com/maps/api/js" を先に読み込む必要があります。'),c.maps.push(this),d.data(c.className,this))}return g(c,a),c.prototype._init=function(){var a=this;this.mapOption=b.extend(this.mapOption,{zoom:this.$el.data("zoom"),fitBounds:this.$el.data("fit-bounds")}),this.markerBounds=new google.maps.LatLngBounds;var d=this.$el.data("lat")||c.defaultLat,e=this.$el.data("lng")||c.defaultLng,f=this.$el.data("address")||"";f?c.getLatLngByAddress(f,function(b,c){a._render(b,c)}):this._render(d,e)},c.prototype._render=function(a,c){var e=this;this.$coordinates=this.$coordinates||this.$el.find("[data-lat][data-lng], [data-address]").detach(),this.$coordinates.length<=0&&(this.$coordinates=this.$el);var f=[];this.$coordinates.each(function(a,b){var c=new d(b,e);f.push(c)}),this.mapOption=b.extend({zoom:14,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.HYBRID,google.maps.MapTypeId.ROADMAP]},scrollwheel:!1,center:new google.maps.LatLng(a,c),styles:null},this.mapOption),this.info=new google.maps.InfoWindow({disableAutoPan:!0}),this.gmap=new google.maps.Map(this.$el[0],b.extend({},this.mapOption,{fitBounds:google.maps.Map.prototype.fitBounds})),b.each(f,function(a,b){b.markTo(function(a){e.mapOption.fitBounds&&(e.markerBounds.extend(a.position),e.gmap.fitBounds(e.markerBounds))})})},c.prototype.reload=function(a){this.mapOption=a?b.extend({},a):this.mapOption,this._init()},c.getLatLngByAddress=function(a,b){var c=new google.maps.Geocoder;c.geocode({address:a},function(c,d){var e,f;switch(d){case google.maps.GeocoderStatus.OK:e=c[0].geometry.location.lat(),f=c[0].geometry.location.lng();break;case google.maps.GeocoderStatus.INVALID_REQUEST:case google.maps.GeocoderStatus.ZERO_RESULTS:case google.maps.GeocoderStatus.OVER_QUERY_LIMIT:console&&console.warn&&console.warn('ReferenceError: "'+a+'は不正な住所のだったため結果を返すことができませんでした。"');break;case google.maps.GeocoderStatus.ERROR:case google.maps.GeocoderStatus.UNKNOWN_ERROR:console&&console.warn&&console.warn('Error: "エラーが発生しました。"')}b(e,f)})},c.defaultLat=35.681382,c.defaultLng=139.766084,c.className="-bc-map-element",c.maps=[],c}(a.Element);a.Map=c;var d=function(){function a(a,d){var e=this;this.$el=b(a),this._map=d;var f=this.$el.data("address"),g=b.Deferred();f?c.getLatLngByAddress(f,function(a,b){e.lat=a,e.lng=b,e.position=new google.maps.LatLng(e.lat,e.lng),g.resolve()}):(this.lat=this.$el.data("lat"),this.lng=this.$el.data("lng"),this.position=new google.maps.LatLng(this.lat,this.lng),g.resolve()),this._promiseLatLng=g.promise()}return a.prototype.markTo=function(a){var b=this;this._promiseLatLng.done(function(){b._markTo(),a&&a(b)})},a.prototype._markTo=function(){var a=this;this.title=this.$el.attr("title")||this.$el.data("title")||this.$el.find("h1,h2,h3,h4,h5,h6").text()||null,this.icon=this.$el.data("icon")||null,this.marker=new google.maps.Marker({position:this.position,title:this.title,icon:this.icon,map:this._map.gmap}),this._map.$coordinates!==this._map.$el&&google.maps.event.addListener(this.marker,"click",function(){a.openInfoWindow()})},a.prototype.openInfoWindow=function(){this._map.info.setContent(this.$el[0]),this._map.info.open(this._map.gmap,this.marker),this.marker.setZIndex(google.maps.Marker.MAX_ZINDEX+1);var a=this._map.info.getContent(),c=this._map.gmap.getProjection(),d=c.fromLatLngToPoint(this.position),e=Math.pow(2,this._map.gmap.getZoom()),f=b(a).height(),g=(d.y*e-f)/e,h=new google.maps.Point(d.x,g),i=c.fromPointToLatLng(h);this._map.gmap.panTo(i)},a}()}(c=a.element||(a.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){var c;!function(a){var c;!function(a){var c=function(c){function d(a,b){c.call(this,a),this.isEmbeded=!1,this._elementized||a[0].querySelector&&this._init(b)&&(d.movies.push(this),this.$el.addClass(d.className),a.data(d.className,this))}return g(d,c),d.prototype._init=function(a){var c=this,e="file:"===location.protocol?"http:":"",f={rel:!1,autoplay:!0,stopOnInactive:!1,controls:!1,loop:!0,showinfo:!1,mute:!1,id:"",width:400,height:300,index:0,startSeconds:0,suggestedQuality:"default"};this.movieOption=this.mergeOptions(f,a),this.$el.empty(),this.movieId=this.movieOption.id.split(/\s*,\s*/);var g=b('<iframe frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>'),h=b.param({version:3,rel:this.movieOption.rel?1:0,autoplay:this.movieOption.autoplay?1:0,controls:this.movieOption.controls?1:0,disablekb:1,iv_load_policy:3,loop:this.movieOption.loop?1:0,modestbranding:1,showinfo:this.movieOption.showinfo?1:0,wmode:"transparent",enablejsapi:1}),i=this.movieId[this.movieOption.index],j=e+d.PLAYER_URL+i+"?"+h;g.prop("src",j);var k=this.id+"-Player";g.prop("id",k),g.css({position:"relative",display:"block",width:"100%",height:"100%"}),g.appendTo(this.$el),this.movieOption.width&&(g.width(this.movieOption.width),g.data("width",this.movieOption.width)),this.movieOption.height&&(g.height(this.movieOption.height),g.data("height",this.movieOption.height)),b.getScript(e+d.API_URL);var l;return l=window.setInterval(function(){!c.player&&"YT"in window&&YT.Player&&c._createPlayer(k),c.player&&c.player.pauseVideo&&c.player.playVideo&&(window.clearInterval(l),c._onEmbeded())},300),!0},d.prototype._createPlayer=function(a){var b=this;this.player=new YT.Player(a,{events:{onStateChange:function(a){switch(a.data){case-1:b.trigger("unstarted",[b.player]);var c=b.player.getPlaylistIndex();b.currentCueIndex!==c&&b.trigger("changecue",[b.player]),b.currentCueIndex=c;break;case YT.PlayerState.BUFFERING:b.trigger("buffering",[b.player]);break;case YT.PlayerState.CUED:b.trigger("cued",[b.player]);break;case YT.PlayerState.ENDED:b.trigger("ended",[b.player]),b.movieId.length>1&&b.movieOption.loop&&b.currentCueIndex===b.movieId.length-1?b.player.playVideoAt(0):b.movieOption.loop&&b.player.playVideo();break;case YT.PlayerState.PAUSED:b.trigger("paused",[b.player]);break;case YT.PlayerState.PLAYING:b.trigger("playing",[b.player]),b.currentCueIndex=b.player.getPlaylistIndex();break;default:"console"in window&&console.warn("YouTube Player state is unknown.")}}}})},d.prototype._onEmbeded=function(){var a=this;this.isEmbeded=!0,this._isMuted=this.player.isMuted(),this.movieOption.mute&&this.mute(),this.movieOption.stopOnInactive&&b(window).on("blur",function(){a.player.pauseVideo()}).on("focus",function(){a.player.playVideo()});var c=this.player;this.movieId.length>=2&&(this.movieOption.autoplay?c.loadPlaylist(this.movieId,this.movieOption.index,this.movieOption.startSeconds,this.movieOption.suggestedQuality):c.cuePlaylist(this.movieId,this.movieOption.index,this.movieOption.startSeconds,this.movieOption.suggestedQuality)),this.$el.trigger("embeddedyoutubeplay",[this.player]),this.trigger("embeded",[this.player])},d.prototype.reload=function(a){this._init(a)},d.prototype.mute=function(){this.player.mute(),this._isMuted=!0,this.trigger("onmute",[this.player])},d.prototype.unMute=function(){this.player.unMute(),this._isMuted=!1,this.trigger("onunmute",[this.player])},d.prototype.muteController=function(c,d){var e=this,f={eventType:"click",mutedClass:"is-muted",unmutedClass:"is-unmuted",baseClass:"youtube-mute-ctrl"},g=b.extend(f,d);a.Element.addClassTo(c,g.baseClass);var h=function(){e._isMuted?(a.Element.addClassTo(c,g.baseClass,"",g.mutedClass),a.Element.removeClassFrom(c,g.baseClass,"",g.unmutedClass)):(a.Element.addClassTo(c,g.baseClass,"",g.unmutedClass),a.Element.removeClassFrom(c,g.baseClass,"",g.mutedClass))},i=function(){c.on(g.eventType,function(a){e._isMuted?e.unMute():e.mute(),h()}),h()};this.on("onmute onunmute",function(){h()}),this.isEmbeded?i():this.on("embeded",function(a,b){e.off(a.type),i()})},d.className="-bc-youtube-element",d.PLAYER_URL="//www.youtube.com/embed/",d.API_URL="//www.youtube.com/player_api",d.movies=[],d}(a.Element);a.Youtube=c}(c=a.element||(a.element={}))}(c=a.ui||(a.ui={}))}(f||(f={}));var f;!function(a){function c(c){return this.each(function(d,e){var f=b(e),g=f.data(a.ui.element.Youtube.className);g?g.reload(c):new a.ui.element.Youtube(f,c)})}b.fn.bcYoutube=c}(f||(f={}));var f;!function(a){function c(c){return this.on("click",function(d){var e,f,g,h,i=b(this),j=i.attr("href"),k=new a.ui.Scroll;if(j){if(c&&b.isPlainObject(c.keywords))for(e in c.keywords)if(c.keywords.hasOwnProperty(e)&&(f=c.keywords[e],e===j))return k.to(f,c),void d.preventDefault();if(g=i.prop("href"),h=location.protocol+"//"+location.host+location.pathname+location.search,j=g.replace(h,""),"#top"===j)return k.to(0,c),void d.preventDefault();try{if(f=b(j),f.length)return k.to(f,c),void d.preventDefault()}catch(l){}}})}b.fn.bcScrollTo=c}(f||(f={})),b.bcScrollTo=function(a,b){var c=new f.ui.Scroll;c.to(a,b)};var f;!function(a){function c(c){return this.each(function(d,e){var f=b(e);new a.ui.element.Radio(f,c)})}b.fn.bcRadio=c}(f||(f={}));var f;!function(a){function c(c){return this.each(function(d,e){var f=b(e);new a.ui.element.Checkbox(f,c)})}b.fn.bcCheckbox=c}(f||(f={}));var f;!function(a){function c(c){return this.each(function(d,e){var f=b(e);if("string"==typeof c)switch(c){case"update":var g=f.data("bc-element");g.update()}else new a.ui.element.Select(f,c)})}b.fn.bcSelect=c}(f||(f={}));var f;!function(a){function c(c){return this.each(function(d,e){var f=b(e),g=f.data(a.ui.element.Map.className);g?g.reload(c):new a.ui.element.Map(f,c)})}b.fn.bcMaps=c}(f||(f={}));var f;!function(a){function c(c,d,e){void 0===c&&(c=0);var f,g,h;if("string"==typeof c)switch(f=c){case"destroy":h=this.data(a.ui.element.AlignedBoxes.DATA_KEY),h.destroy()}else{g=c;var i;d?(i=this.find(d),i.length&&this.each(function(){var c=b(this).find(d);new a.ui.element.AlignedBoxes(c,g,e)})):new a.ui.element.AlignedBoxes(this,g,e)}return this}b.fn.bcBoxAlignHeight=c}(f||(f={})),b.fn.bcBoxLink=function(){return this.on("click",function(a){var c,d=b(this),e=d.find("a, area").eq(0),g=e.prop("href");e.length&&g&&(c="_blank"===e.prop("target"),f.ui.Browser.jumpTo(g,c),a.preventDefault())}),this};var f;!function(a){var c=function(a){var c=b.extend({pattern:/_off(\.(?:[a-z0-9]{1,6}))$/i,replace:"_on$1",dataPrefix:"-bc-rollover-",ignore:"",filter:null,stopOnTouch:!0},a),d=(b(document),c.dataPrefix+"off"),e=c.dataPrefix+"on";return this.each(function(a,f){var g,h,i,j=f.nodeName.toLowerCase(),k=b(f).not(c.ignore);(k.length&&"img"===j||"input"===j&&"image"===k.prop("type"))&&(g=!0,b.isFunction(c.filter)?g=!!c.filter.call(f):c.filter&&(g=!!k.filter(c.filter).length),g&&(h=k.attr("src"),h.match(c.pattern)&&(i=h.replace(c.pattern,c.replace),k.data(d,h),k.data(e,i))))}),this.on("mouseenter",function(a){var d,f=b(this);return c.stopOnTouch&&f.data("-bc-is-touchstarted")?(f.data("-bc-is-touchstarted",!1),!0):(d=f.data(e),f.prop("src",d),!0)}),this.on("mouseleave",function(a){var e,f=b(this);return c.stopOnTouch&&f.data("-bc-is-touchstarted")?(f.data("-bc-is-touchstarted",!1),!0):(e=f.data(d),f.prop("src",e),!0)}),c.stopOnTouch&&this.on("touchstart",function(a){var c=b(this);return c.data("-bc-is-touchstarted",!0),!0}),this};b.fn.bcRollover=c}(f||(f={}));var f;!function(a){var c=function(a){var c=b.extend({close:300,open:300,opacity:.6,target:null,stopOnTouch:!0},a);return this.each(function(a,d){var e,f=b(d);e=c.target?f.find(c.target):f,f.on("mouseenter",function(a){return c.stopOnTouch&&f.data("-bc-is-touchstarted")?(f.data("-bc-is-touchstarted",!1),!0):(e.stop(!0,!1).fadeTo(c.close,c.opacity),!0)}),f.on("mouseleave",function(a){return c.stopOnTouch&&f.data("-bc-is-touchstarted")?(f.data("-bc-is-touchstarted",!1),!0):(e.stop(!0,!1).fadeTo(c.open,1),!0)}),c.stopOnTouch&&f.on("touchstart",function(a){return f.data("-bc-is-touchstarted",!0),!0})}),this};b.fn.bcShy=c}(f||(f={}));var f;!function(a){var c=function(a){var c=b.extend({close:50,open:200,opacity:.4,target:null,stopOnTouch:!0},a);return this.each(function(a,d){var e,f=b(d);e=c.target?f.find(c.target):f,f.on("mouseenter",function(a){return c.stopOnTouch&&f.data("-bc-is-touchstarted")?(f.data("-bc-is-touchstarted",!1),!0):(e.stop(!0,!1).fadeTo(c.close,c.opacity).fadeTo(c.open,1),!0)}),c.stopOnTouch&&f.on("touchstart",function(a){return f.data("-bc-is-touchstarted",!0),!0})}),this};b.fn.bcWink=c}(f||(f={}));var f;!function(a){var c=function(c,d){var e="splited-list",f="nth",g="item",h=b.extend({dataKey:"-bc-split-list-index",splitChildren:!0},d);return this.each(function(d,i){var j,k=b(i),l=k.find(">ul");h.splitChildren?(j=l.find("li").detach(),j.find("ul").remove()):j=l.find(">li").detach();var d,m,n,o,p,q=j.length,r=a.utility.Mathematics.split(q,c),s=j.toArray();for(d=0;c>d;d++){for(n=r[d],o=b("<ul></ul>"),a.ui.element.Element.addClassTo(o,e),a.ui.element.Element.addClassTo(o,e,"",f+c),o.appendTo(k),m=0;n>m;m++)p=b(s.shift()),p.appendTo(o),p.data(h.dataKey,d),a.ui.element.Element.addClassTo(p,e,g),a.ui.element.Element.addClassTo(p,e,g,f+d);o=null}l.remove()}),this};b.fn.bcSplitList=c}(f||(f={}));var f;!function(a){function c(a){return this.each(function(c,d){var e=b(d),f=[],g=e.find("img");g.length?(g.hide(),g.each(function(){var a=b.Deferred(),c=new Image;c.onload=function(){a.resolve(),c.onload=null,c=null},c.src=this.src,f.push(a.promise())}),b.when.apply(b,f).done(function(){g.show(),a.call(d)})):a.call(d)})}b.fn.bcImageLoaded=c}(f||(f={}));var f;!function(a){function c(c){return this.each(function(d,e){var f=b.extend({align:"center",valign:"center",size:"contain",child:">*:first",outer:!1},c),g=b(e),h=g.find(f.child),i=+(g.data("width")||h.data("width")||h.attr("width")||h.width())||400,j=+(g.data("height")||h.data("height")||h.attr("height")||h.height())||300,k=i/j,l=g.css("position");("static"===l||""===l||null==l)&&g.css("position","relative"),h.css({position:"absolute",top:0,left:0});var m={},n=function(){var a,b,c,d;switch(f.outer?(a=g.outerWidth(),b=g.outerHeight()):(a=g.width(),b=g.height()),c=a/b,f.size){case"contain":d=c>1?i>1&&c>k?a/i:b/j:j>1&&k>c?b/j:a/i;break;case"cover":d=c>1?i>1&&c>k?b/j:a/i:j>1&&k>c?a/i:b/j;break;default:return}var e,h=i*d,l=j*d;switch(f.valign){case"top":e=0;break;case"bottom":e=b-l;break;case"center":default:e=b/2-l/2}var n;switch(f.align){case"left":n=0;break;case"right":n=a-h;break;case"center":default:n=a/2-h/2}var o="none";m={width:h,height:l,maxWidth:o,minWidth:0,maxHeight:o,minHeight:0,top:e,left:n}};n(),h.css(m);var o=new a.ui.AnimationFrames(function(){h.css(m)});a.ui.Browser.browser.on("resizestart",function(){o.start()}).on("resize",function(){n()}).on("resizeend",function(){o.stop()}),o.start(),a.ui.Timer.wait(300,function(){o.stop()})})}b.fn.bcBackground=c}(f||(f={}));var f;!function(a){function c(){var c=b(window);return this.each(function(a,d){var e=b(d),f=+e.data("width"),g=+e.data("height"),h=f/g;c.on("resize",function(){var a=e.width();e.css({width:"100%",height:a/h})}).trigger("resize")}),a.ui.Timer.wait(30,function(){c.trigger("resize")}),this}b.fn.bcKeepAspectRatio=c}(f||(f={})),e?module.exports=f:c.baser=f}).call((this||0).self||global);
  //# sourceMappingURL=baser.min.js.map