!function(n,t,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),n.fn.dimmer=function(t){var r,f=n(this),e=+new Date,u=[],o=arguments[0],s="string"==typeof o,h=[].slice.call(arguments,1);return f.each(function(){var a,v,c,l=n.isPlainObject(t)?n.extend(!0,{},n.fn.dimmer.settings,t):n.extend({},n.fn.dimmer.settings),w=l.selector,nt=l.namespace,y=l.className,rt=l.error,b="."+nt,g="module-"+nt,tt=f.selector||"",it="ontouchstart"in i.documentElement?"touchstart":"click",p=n(this),k=this,d=p.data(g);c={preinitialize:function(){c.is.dimmer()?(v=p.parent(),a=p):(v=p,a=c.has.dimmer()?l.dimmerName?v.find(w.dimmer).filter("."+l.dimmerName):v.find(w.dimmer):c.create(),c.set.variation())},initialize:function(){c.debug("Initializing dimmer",l),c.bind.events(),c.set.dimmable(),c.instantiate()},instantiate:function(){c.verbose("Storing instance of module",c),d=c,p.data(g,d)},destroy:function(){c.verbose("Destroying previous module",a),c.unbind.events(),c.remove.variation(),v.off(b)},bind:{events:function(){"hover"==l.on?v.on("mouseenter"+b,c.show).on("mouseleave"+b,c.hide):"click"==l.on&&v.on(it+b,c.toggle),c.is.page()&&(c.debug("Setting as a page dimmer",v),c.set.pageDimmer()),c.is.closable()&&(c.verbose("Adding dimmer close event",a),v.on(it+b,w.dimmer,c.event.click))}},unbind:{events:function(){p.removeData(g),v.off(b)}},event:{click:function(t){c.verbose("Determining if event occured on dimmer",t),(0===a.find(t.target).length||n(t.target).is(w.content))&&(c.hide(),t.stopImmediatePropagation())}},addContent:function(t){var i=n(t);c.debug("Add content to dimmer",i),i.parent()[0]!==a[0]&&i.detach().appendTo(a)},create:function(){var t=n(l.template.dimmer());return l.dimmerName&&(c.debug("Creating named dimmer",l.dimmerName),t.addClass(l.dimmerName)),t.appendTo(v),t},show:function(t){t=n.isFunction(t)?t:function(){},c.debug("Showing dimmer",a,l),c.is.dimmed()&&!c.is.animating()||!c.is.enabled()?c.debug("Dimmer is already shown or disabled"):(c.animate.show(t),l.onShow.call(k),l.onChange.call(k))},hide:function(t){t=n.isFunction(t)?t:function(){},c.is.dimmed()||c.is.animating()?(c.debug("Hiding dimmer",a),c.animate.hide(t),l.onHide.call(k),l.onChange.call(k)):c.debug("Dimmer is not visible")},toggle:function(){c.verbose("Toggling dimmer visibility",a),c.is.dimmed()?c.hide():c.show()},animate:{show:function(t){t=n.isFunction(t)?t:function(){},l.useCSS&&void 0!==n.fn.transition&&a.transition("is supported")?("auto"!==l.opacity&&c.set.opacity(),a.transition({animation:l.transition+" in",queue:!1,duration:c.get.duration(),useFailSafe:!0,onStart:function(){c.set.dimmed()},onComplete:function(){c.set.active(),t()}})):(c.verbose("Showing dimmer animation with javascript"),c.set.dimmed(),"auto"==l.opacity&&(l.opacity=.8),a.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(c.get.duration(),l.opacity,function(){a.removeAttr("style"),c.set.active(),t()}))},hide:function(t){t=n.isFunction(t)?t:function(){},l.useCSS&&void 0!==n.fn.transition&&a.transition("is supported")?(c.verbose("Hiding dimmer with css"),a.transition({animation:l.transition+" out",queue:!1,duration:c.get.duration(),useFailSafe:!0,onStart:function(){c.remove.dimmed()},onComplete:function(){c.remove.active(),t()}})):(c.verbose("Hiding dimmer with javascript"),c.remove.dimmed(),a.stop().fadeOut(c.get.duration(),function(){c.remove.active(),a.removeAttr("style"),t()}))}},get:{dimmer:function(){return a},duration:function(){return"object"==typeof l.duration?c.is.active()?l.duration.hide:l.duration.show:l.duration}},has:{dimmer:function(){return l.dimmerName?p.find(w.dimmer).filter("."+l.dimmerName).length>0:p.find(w.dimmer).length>0}},is:{active:function(){return a.hasClass(y.active)},animating:function(){return a.is(":animated")||a.hasClass(y.animating)},closable:function(){return"auto"==l.closable?"hover"!=l.on:l.closable},dimmer:function(){return p.hasClass(y.dimmer)},dimmable:function(){return p.hasClass(y.dimmable)},dimmed:function(){return v.hasClass(y.dimmed)},disabled:function(){return v.hasClass(y.disabled)},enabled:function(){return!c.is.disabled()},page:function(){return v.is("body")},pageDimmer:function(){return a.hasClass(y.pageDimmer)}},can:{show:function(){return!a.hasClass(y.disabled)}},set:{opacity:function(n){var i=a.css("background-color"),t=i.split(","),r=t&&3==t.length,u=t&&4==t.length;n=0===l.opacity?0:l.opacity||n,r||u?(t[3]=n+")",i=t.join(",")):i="rgba(0, 0, 0, "+n+")",c.debug("Setting opacity to",n),a.css("background-color",i)},active:function(){a.addClass(y.active)},dimmable:function(){v.addClass(y.dimmable)},dimmed:function(){v.addClass(y.dimmed)},pageDimmer:function(){a.addClass(y.pageDimmer)},disabled:function(){a.addClass(y.disabled)},variation:function(n){(n=n||l.variation)&&a.addClass(n)}},remove:{active:function(){a.removeClass(y.active)},dimmed:function(){v.removeClass(y.dimmed)},disabled:function(){a.removeClass(y.disabled)},variation:function(n){(n=n||l.variation)&&a.removeClass(n)}},setting:function(t,i){if(c.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,l,t);else{if(void 0===i)return l[t];n.isPlainObject(l[t])?n.extend(!0,l[t],i):l[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,c,t);else{if(void 0===i)return c[t];c[t]=i}},debug:function(){!l.silent&&l.debug&&(l.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,l.name+":"),c.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),c.verbose.apply(console,arguments)))},error:function(){l.silent||(c.error=Function.prototype.bind.call(console.error,console,l.name+":"),c.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;l.performance&&(t=+new Date,r=e||t,i=t-r,e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:k,"Execution Time":i})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,500)},display:function(){var t=l.name+":",i=0;e=!1,clearTimeout(c.performance.timer),n.each(u,function(n,t){i+=t["Execution Time"]}),t+=" "+i+"ms",tt&&(t+=" '"+tt+"'"),f.length>1&&(t+=" ("+f.length+")"),(void 0!==console.group||void 0!==console.table)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),u=[]}},invoke:function(t,i,u){var s,e,o,f=d;return i=i||h,u=k||u,"string"==typeof t&&void 0!==f&&(t=t.split(/[\. ]/),s=t.length-1,n.each(t,function(i,r){var u=i!=s?r+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[u])&&i!=s)f=f[u];else{if(void 0!==f[u])return e=f[u],!1;if(!n.isPlainObject(f[r])||i==s)return void 0!==f[r]?(e=f[r],!1):(c.error(rt.method,t),!1);f=f[r]}})),n.isFunction(e)?o=e.apply(u,i):void 0!==e&&(o=e),n.isArray(r)?r.push(o):void 0!==r?r=[r,o]:void 0!==o&&(r=o),e}},c.preinitialize(),s?(void 0===d&&c.initialize(),c.invoke(o)):(void 0!==d&&d.invoke("destroy"),c.initialize())}),void 0!==r?r:this},n.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return n("<div />").attr("class","ui dimmer")}}}}(jQuery,window,document),function(n,t,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),n.fn.modal=function(r){var u,h=n(this),c=n(t),o=n(i),e=n("body"),l=h.selector||"",s=+new Date,f=[],a=arguments[0],v="string"==typeof a,y=[].slice.call(arguments,1),p=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return h.each(function(){var yt,ft,st,k,ot,ut,ht,at,h,w=n.isPlainObject(r)?n.extend(!0,{},n.fn.modal.settings,r):n.extend({},n.fn.modal.settings),tt=w.selector,d=w.className,vt=w.namespace,et=w.error,nt="."+vt,ct="module-"+vt,b=n(this),lt=n(w.context),pt=b.find(tt.close),g=this,it=b.data(ct),rt=!1;h={initialize:function(){h.verbose("Initializing dimmer",lt),h.create.id(),h.create.dimmer(),h.refreshModals(),h.bind.events(),w.observeChanges&&h.observeChanges(),h.instantiate()},instantiate:function(){h.verbose("Storing instance of modal"),it=h,b.data(ct,it)},create:{dimmer:function(){var i={debug:w.debug,dimmerName:"modals",duration:{show:w.duration,hide:w.duration}},t=n.extend(!0,i,w.dimmerSettings);if(w.inverted&&(t.variation=void 0!==t.variation?t.variation+" inverted":"inverted"),void 0===n.fn.dimmer)return void h.error(et.dimmer);h.debug("Creating dimmer with settings",t),k=lt.dimmer(t),w.detachable?(h.verbose("Modal is detachable, moving content into dimmer"),k.dimmer("add content",b)):h.set.undetached(),w.blurring&&k.addClass(d.blurring),ot=k.dimmer("get dimmer")},id:function(){ht=(Math.random().toString(16)+"000000000").substr(2,8),ut="."+ht,h.verbose("Creating unique id for element",ht)}},destroy:function(){h.verbose("Destroying previous modal"),b.removeData(ct).off(nt),c.off(ut),ot.off(ut),pt.off(nt),lt.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&(at=new MutationObserver(function(){h.debug("DOM tree modified, refreshing"),h.refresh()}),at.observe(g,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",at))},refresh:function(){h.remove.scrolling(),h.cacheSizes(),h.set.screenHeight(),h.set.type(),h.set.position()},refreshModals:function(){ft=b.siblings(tt.modal),yt=ft.add(b)},attachEvents:function(t,i){var r=n(t);i=n.isFunction(h[i])?h[i]:h.toggle,r.length>0?(h.debug("Attaching modal events to element",t,i),r.off(nt).on("click"+nt,i)):h.error(et.notFound,t)},bind:{events:function(){h.verbose("Attaching events"),b.on("click"+nt,tt.close,h.event.close).on("click"+nt,tt.approve,h.event.approve).on("click"+nt,tt.deny,h.event.deny),c.on("resize"+ut,h.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){if(rt||!1===w.onApprove.call(g,n(this)))return void h.verbose("Approve callback returned false cancelling hide");rt=!0,h.hide(function(){rt=!1})},deny:function(){if(rt||!1===w.onDeny.call(g,n(this)))return void h.verbose("Deny callback returned false cancelling hide");rt=!0,h.hide(function(){rt=!1})},close:function(){h.hide()},click:function(t){var r=n(t.target),u=r.closest(tt.modal).length>0,f=n.contains(i.documentElement,t.target);!u&&f&&(h.debug("Dimmer clicked, hiding all modals"),h.is.active()&&(h.remove.clickaway(),w.allowMultiple?h.hide():h.hideAll()))},debounce:function(n,t){clearTimeout(h.timer),h.timer=setTimeout(n,t)},keyboard:function(n){27==n.which&&(w.closable?(h.debug("Escape key pressed hiding modal"),h.hide()):h.debug("Escape key pressed, but closable is set to false"),n.preventDefault())},resize:function(){k.dimmer("is active")&&p(h.refresh)}},toggle:function(){h.is.active()||h.is.animating()?h.hide():h.show()},show:function(t){t=n.isFunction(t)?t:function(){},h.refreshModals(),h.showModal(t)},hide:function(t){t=n.isFunction(t)?t:function(){},h.refreshModals(),h.hideModal(t)},showModal:function(t){t=n.isFunction(t)?t:function(){},h.is.animating()||!h.is.active()?(h.showDimmer(),h.cacheSizes(),h.set.position(),h.set.screenHeight(),h.set.type(),h.set.clickaway(),!w.allowMultiple&&h.others.active()?h.hideOthers(h.showModal):(w.onShow.call(g),w.transition&&void 0!==n.fn.transition&&b.transition("is supported")?(h.debug("Showing modal with css animations"),b.transition({debug:w.debug,animation:w.transition+" in",queue:w.queue,duration:w.duration,useFailSafe:!0,onComplete:function(){w.onVisible.apply(g),w.keyboardShortcuts&&h.add.keyboardShortcuts(),h.save.focus(),h.set.active(),w.autofocus&&h.set.autofocus(),t()}})):h.error(et.noTransition))):h.debug("Modal is already visible")},hideModal:function(t,i){if(t=n.isFunction(t)?t:function(){},h.debug("Hiding modal"),!1===w.onHide.call(g,n(this)))return void h.verbose("Hide callback returned false cancelling hide");(h.is.animating()||h.is.active())&&(w.transition&&void 0!==n.fn.transition&&b.transition("is supported")?(h.remove.active(),b.transition({debug:w.debug,animation:w.transition+" out",queue:w.queue,duration:w.duration,useFailSafe:!0,onStart:function(){h.others.active()||i||h.hideDimmer(),w.keyboardShortcuts&&h.remove.keyboardShortcuts()},onComplete:function(){w.onHidden.call(g),h.restore.focus(),t()}})):h.error(et.noTransition))},showDimmer:function(){k.dimmer("is animating")||!k.dimmer("is active")?(h.debug("Showing dimmer"),k.dimmer("show")):h.debug("Dimmer already visible")},hideDimmer:function(){if(!k.dimmer("is animating")&&!k.dimmer("is active"))return void h.debug("Dimmer is not visible cannot hide");k.dimmer("hide",function(){h.remove.clickaway(),h.remove.screenHeight()})},hideAll:function(t){var i=yt.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){},i.length>0&&(h.debug("Hiding all visible modals"),h.hideDimmer(),i.modal("hide modal",t))},hideOthers:function(t){var i=ft.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){},i.length>0&&(h.debug("Hiding other modals",ft),i.modal("hide modal",t,!0))},others:{active:function(){return ft.filter("."+d.active).length>0},animating:function(){return ft.filter("."+d.animating).length>0}},add:{keyboardShortcuts:function(){h.verbose("Adding keyboard shortcuts"),o.on("keyup"+nt,h.event.keyboard)}},save:{focus:function(){st=n(i.activeElement).blur()}},restore:{focus:function(){st&&st.length>0&&st.focus()}},remove:{active:function(){b.removeClass(d.active)},clickaway:function(){w.closable&&ot.off("click"+ut)},bodyStyle:function(){""===e.attr("style")&&(h.verbose("Removing style attribute"),e.removeAttr("style"))},screenHeight:function(){h.debug("Removing page height"),e.css("height","")},keyboardShortcuts:function(){h.verbose("Removing keyboard shortcuts"),o.off("keyup"+nt)},scrolling:function(){k.removeClass(d.scrolling),b.removeClass(d.scrolling)}},cacheSizes:function(){var r=b.outerHeight();void 0!==h.cache&&0===r||(h.cache={pageHeight:n(i).outerHeight(),height:r+w.offset,contextHeight:"body"==w.context?n(t).height():k.height()}),h.debug("Caching modal and container sizes",h.cache)},can:{fit:function(){return h.cache.height+2*w.padding<h.cache.contextHeight}},is:{active:function(){return b.hasClass(d.active)},animating:function(){return b.transition("is supported")?b.transition("is animating"):b.is(":visible")},scrolling:function(){return k.hasClass(d.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){var n=b.find("[tabindex], :input").filter(":visible"),t=n.filter("[autofocus]"),i=t.length>0?t.first():n.first();i.length>0&&i.focus()},clickaway:function(){w.closable&&ot.on("click"+ut,h.event.click)},screenHeight:function(){h.can.fit()?e.css("height",""):(h.debug("Modal is taller than page content, resizing page height"),e.css("height",h.cache.height+2*w.padding))},active:function(){b.addClass(d.active)},scrolling:function(){k.addClass(d.scrolling),b.addClass(d.scrolling)},type:function(){h.can.fit()?(h.verbose("Modal fits on screen"),h.others.active()||h.others.animating()||h.remove.scrolling()):(h.verbose("Modal cannot fit on screen setting to scrolling"),h.set.scrolling())},position:function(){h.verbose("Centering modal on page",h.cache),h.can.fit()?b.css({top:"",marginTop:-h.cache.height/2}):b.css({marginTop:"",top:o.scrollTop()})},undetached:function(){k.addClass(d.undetached)}},setting:function(t,i){if(h.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,w,t);else{if(void 0===i)return w[t];n.isPlainObject(w[t])?n.extend(!0,w[t],i):w[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,h,t);else{if(void 0===i)return h[t];h[t]=i}},debug:function(){!w.silent&&w.debug&&(w.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,w.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!w.silent&&w.verbose&&w.debug&&(w.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),h.verbose.apply(console,arguments)))},error:function(){w.silent||(h.error=Function.prototype.bind.call(console.error,console,w.name+":"),h.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;w.performance&&(t=+new Date,r=s||t,i=t-r,s=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=w.name+":",i=0;s=!1,clearTimeout(h.performance.timer),n.each(f,function(n,t){i+=t["Execution Time"]}),t+=" "+i+"ms",l&&(t+=" '"+l+"'"),(void 0!==console.group||void 0!==console.table)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,i,r){var s,e,o,f=it;return i=i||y,r=g||r,"string"==typeof t&&void 0!==f&&(t=t.split(/[\. ]/),s=t.length-1,n.each(t,function(i,r){var u=i!=s?r+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[u])&&i!=s)f=f[u];else{if(void 0!==f[u])return e=f[u],!1;if(!n.isPlainObject(f[r])||i==s)return void 0!==f[r]&&(e=f[r],!1);f=f[r]}})),n.isFunction(e)?o=e.apply(r,i):void 0!==e&&(o=e),n.isArray(u)?u.push(o):void 0!==u?u=[u,o]:void 0!==o&&(u=o),e}},v?(void 0===it&&h.initialize(),h.invoke(a)):(void 0!==it&&it.invoke("destroy"),h.initialize())}),void 0!==u?u:this},n.fn.modal.settings={name:"Modal",namespace:"modal",silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(n,t,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),n.fn.transition=function(){var r,f=n(this),s=f.selector||"",e=+new Date,u=[],h=arguments,c=h[0],l=[].slice.call(arguments,1),o="string"==typeof c;return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame,f.each(function(t){var v,k,tt,p,g,b,nt,d,a,y=n(this),w=this;a={initialize:function(){v=a.get.settings.apply(w,h),p=v.className,tt=v.error,g=v.metadata,d="."+v.namespace,nt="module-"+v.namespace,k=y.data(nt)||a,b=a.get.animationEndEvent(),o&&(o=a.invoke(c)),!1===o&&(a.verbose("Converted arguments into settings object",v),v.interval?a.delay(v.animate):a.animate(),a.instantiate())},instantiate:function(){a.verbose("Storing instance of module",a),k=a,y.data(nt,k)},destroy:function(){a.verbose("Destroying previous module for",w),y.removeData(nt)},refresh:function(){a.verbose("Refreshing display type on next animation"),delete a.displayType},forceRepaint:function(){a.verbose("Forcing element repaint");var t=y.parent(),n=y.next();0===n.length?y.detach().appendTo(t):y.detach().insertBefore(n)},repaint:function(){a.verbose("Repainting element"),w.offsetWidth},delay:function(n){var u,i,r=a.get.animationDirection();r||(r=a.can.transition()?a.get.direction():"static"),n=void 0!==n?n:v.interval,u="auto"==v.reverse&&r==p.outward,i=u||1==v.reverse?(f.length-t)*v.interval:t*v.interval,a.debug("Delaying animation by",i),setTimeout(a.animate,i)},animate:function(n){if(v=n||v,!a.is.supported())return a.error(tt.support),!1;if(a.debug("Preparing animation",v.animation),a.is.animating()){if(v.queue)return!v.allowRepeats&&a.has.direction()&&a.is.occurring()&&!0!==a.queuing?a.debug("Animation is currently occurring, preventing queueing same animation",v.animation):a.queue(v.animation),!1;if(!v.allowRepeats&&a.is.occurring())return a.debug("Animation is already occurring, will not execute repeated animation",v.animation),!1;a.debug("New animation started, completing previous early",v.animation),k.complete()}a.can.animate()?a.set.animating(v.animation):a.error(tt.noAnimation,v.animation,w)},reset:function(){a.debug("Resetting animation to beginning conditions"),a.remove.animationCallbacks(),a.restore.conditions(),a.remove.animating()},queue:function(n){a.debug("Queueing animation of",n),a.queuing=!0,y.one(b+".queue"+d,function(){a.queuing=!1,a.repaint(),a.animate.apply(this,v)})},complete:function(){a.debug("Animation complete",v.animation),a.remove.completeCallback(),a.remove.failSafe(),a.is.looping()||(a.is.outward()?(a.verbose("Animation is outward, hiding element"),a.restore.conditions(),a.hide()):a.is.inward()?(a.verbose("Animation is outward, showing element"),a.restore.conditions(),a.show()):(a.verbose("Static animation completed"),a.restore.conditions(),v.onComplete.call(w)))},force:{visible:function(){var t=y.attr("style"),i=a.get.userStyle(),n=a.get.displayType(),r=i+"display: "+n+" !important;",u=y.css("display"),f=void 0===t||""===t;u!==n?(a.verbose("Overriding default display to show element",n),y.attr("style",r)):f&&y.removeAttr("style")},hidden:function(){var n=y.attr("style"),t=y.css("display"),i=void 0===n||""===n;"none"===t||a.is.hidden()?i&&y.removeAttr("style"):(a.verbose("Overriding default display to hide element"),y.css("display","none"))}},has:{direction:function(t){var i=!1;return t=t||v.animation,"string"==typeof t&&(t=t.split(" "),n.each(t,function(n,t){t!==p.inward&&t!==p.outward||(i=!0)})),i},inlineDisplay:function(){var t=y.attr("style")||"";return n.isArray(t.match(/display.*?;/,""))}},set:{animating:function(n){var t;a.remove.completeCallback(),n=n||v.animation,t=a.get.animationClass(n),a.save.animation(t),a.force.visible(),a.remove.hidden(),a.remove.direction(),a.start.animation(t)},duration:function(n,t){t=t||v.duration,((t="number"==typeof t?t+"ms":t)||0===t)&&(a.verbose("Setting animation duration",t),y.css({"animation-duration":t}))},direction:function(n){n=n||a.get.direction(),n==p.inward?a.set.inward():a.set.outward()},looping:function(){a.debug("Transition set to loop"),y.addClass(p.looping)},hidden:function(){y.addClass(p.transition).addClass(p.hidden)},inward:function(){a.debug("Setting direction to inward"),y.removeClass(p.outward).addClass(p.inward)},outward:function(){a.debug("Setting direction to outward"),y.removeClass(p.inward).addClass(p.outward)},visible:function(){y.addClass(p.transition).addClass(p.visible)}},start:{animation:function(n){n=n||a.get.animationClass(),a.debug("Starting tween",n),y.addClass(n).one(b+".complete"+d,a.complete),v.useFailSafe&&a.add.failSafe(),a.set.duration(v.duration),v.onStart.call(w)}},save:{animation:function(n){a.cache||(a.cache={}),a.cache.animation=n},displayType:function(n){"none"!==n&&y.data(g.displayType,n)},transitionExists:function(t,i){n.fn.transition.exists[t]=i,a.verbose("Saving existence of transition",t,i)}},restore:{conditions:function(){var n=a.get.currentAnimation();n&&(y.removeClass(n),a.verbose("Removing animation class",a.cache)),a.remove.duration()}},add:{failSafe:function(){var n=a.get.duration();a.timer=setTimeout(function(){y.triggerHandler(b)},n+v.failSafeDelay),a.verbose("Adding fail safe timer",a.timer)}},remove:{animating:function(){y.removeClass(p.animating)},animationCallbacks:function(){a.remove.queueCallback(),a.remove.completeCallback()},queueCallback:function(){y.off(".queue"+d)},completeCallback:function(){y.off(".complete"+d)},display:function(){y.css("display","")},direction:function(){y.removeClass(p.inward).removeClass(p.outward)},duration:function(){y.css("animation-duration","")},failSafe:function(){a.verbose("Removing fail safe timer",a.timer),a.timer&&clearTimeout(a.timer)},hidden:function(){y.removeClass(p.hidden)},visible:function(){y.removeClass(p.visible)},looping:function(){a.debug("Transitions are no longer looping"),a.is.looping()&&(a.reset(),y.removeClass(p.looping))},transition:function(){y.removeClass(p.visible).removeClass(p.hidden)}},get:{settings:function(t,i,r){return"object"==typeof t?n.extend(!0,{},n.fn.transition.settings,t):"function"==typeof r?n.extend({},n.fn.transition.settings,{animation:t,onComplete:r,duration:i}):"string"==typeof i||"number"==typeof i?n.extend({},n.fn.transition.settings,{animation:t,duration:i}):"object"==typeof i?n.extend({},n.fn.transition.settings,i,{animation:t}):"function"==typeof i?n.extend({},n.fn.transition.settings,{animation:t,onComplete:i}):n.extend({},n.fn.transition.settings,{animation:t})},animationClass:function(n){var t=n||v.animation,i=a.can.transition()&&!a.has.direction()?a.get.direction()+" ":"";return p.animating+" "+p.transition+" "+i+t},currentAnimation:function(){return!(!a.cache||void 0===a.cache.animation)&&a.cache.animation},currentDirection:function(){return a.is.inward()?p.inward:p.outward},direction:function(){return a.is.hidden()||!a.is.visible()?p.inward:p.outward},animationDirection:function(t){var i;return t=t||v.animation,"string"==typeof t&&(t=t.split(" "),n.each(t,function(n,t){t===p.inward?i=p.inward:t===p.outward&&(i=p.outward)})),i||!1},duration:function(n){return n=n||v.duration,!1===n&&(n=y.css("animation-duration")||0),"string"==typeof n?n.indexOf("ms")>-1?parseFloat(n):1e3*parseFloat(n):n},displayType:function(n){return n=void 0===n||n,v.displayType?v.displayType:(n&&void 0===y.data(g.displayType)&&a.can.transition(!0),y.data(g.displayType))},userStyle:function(n){return n=n||y.attr("style")||"",n.replace(/display.*?;/,"")},transitionExists:function(t){return n.fn.transition.exists[t]},animationStartEvent:function(){var n,r=i.createElement("div"),t={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(n in t)if(void 0!==r.style[n])return t[n];return!1},animationEndEvent:function(){var n,r=i.createElement("div"),t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(n in t)if(void 0!==r.style[n])return t[n];return!1}},can:{transition:function(t){var o,h,r,f,c,e,i=v.animation,s=a.get.transitionExists(i),u=a.get.displayType(!1);if(void 0===s||t){if(a.verbose("Determining whether animation exists"),o=y.attr("class"),h=y.prop("tagName"),r=n("<"+h+" />").addClass(o).insertAfter(y),f=r.addClass(i).removeClass(p.inward).removeClass(p.outward).addClass(p.animating).addClass(p.transition).css("animationName"),c=r.addClass(p.inward).css("animationName"),u||(u=r.attr("class",o).removeAttr("style").removeClass(p.hidden).removeClass(p.visible).show().css("display"),a.verbose("Determining final display state",u),a.save.displayType(u)),r.remove(),f!=c)a.debug("Direction exists for animation",i),e=!0;else{if("none"==f||!f)return void a.debug("No animation defined in css",i);a.debug("Static animation found",i,u),e=!1}a.save.transitionExists(i,e)}return void 0!==s?s:e},animate:function(){return void 0!==a.can.transition()}},is:{animating:function(){return y.hasClass(p.animating)},inward:function(){return y.hasClass(p.inward)},outward:function(){return y.hasClass(p.outward)},looping:function(){return y.hasClass(p.looping)},occurring:function(n){return n=n||v.animation,n="."+n.replace(" ","."),y.filter(n).length>0},visible:function(){return y.is(":visible")},hidden:function(){return"hidden"===y.css("visibility")},supported:function(){return!1!==b}},hide:function(){a.verbose("Hiding element"),a.is.animating()&&a.reset(),w.blur(),a.remove.display(),a.remove.visible(),a.set.hidden(),a.force.hidden(),v.onHide.call(w),v.onComplete.call(w)},show:function(n){a.verbose("Showing element",n),a.remove.hidden(),a.set.visible(),a.force.visible(),v.onShow.call(w),v.onComplete.call(w)},toggle:function(){a.is.visible()?a.hide():a.show()},stop:function(){a.debug("Stopping current animation"),y.triggerHandler(b)},stopAll:function(){a.debug("Stopping all animation"),a.remove.queueCallback(),y.triggerHandler(b)},clear:{queue:function(){a.debug("Clearing animation queue"),a.remove.queueCallback()}},enable:function(){a.verbose("Starting animation"),y.removeClass(p.disabled)},disable:function(){a.debug("Stopping animation"),y.addClass(p.disabled)},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(void 0===i)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else{if(void 0===i)return a[t];a[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,v.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),a.verbose.apply(console,arguments)))},error:function(){v.silent||(a.error=Function.prototype.bind.call(console.error,console,v.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;v.performance&&(t=+new Date,r=e||t,i=t-r,e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:w,"Execution Time":i})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=v.name+":",i=0;e=!1,clearTimeout(a.performance.timer),n.each(u,function(n,t){i+=t["Execution Time"]}),t+=" "+i+"ms",s&&(t+=" '"+s+"'"),f.length>1&&(t+=" ("+f.length+")"),(void 0!==console.group||void 0!==console.table)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),u=[]}},invoke:function(t,i,u){var s,e,o,f=k;return i=i||l,u=w||u,"string"==typeof t&&void 0!==f&&(t=t.split(/[\. ]/),s=t.length-1,n.each(t,function(i,r){var u=i!=s?r+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[u])&&i!=s)f=f[u];else{if(void 0!==f[u])return e=f[u],!1;if(!n.isPlainObject(f[r])||i==s)return void 0!==f[r]&&(e=f[r],!1);f=f[r]}})),n.isFunction(e)?o=e.apply(u,i):void 0!==e&&(o=e),n.isArray(r)?r.push(o):void 0!==r?r=[r,o]:void 0!==o&&(r=o),void 0!==e&&e}},a.initialize()}),void 0!==r?r:this},n.fn.transition.exists={},n.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(n,t,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),n.fn.checkbox=function(r){var u,o=n(this),s=o.selector||"",e=+new Date,f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var it,o,a=n.extend(!0,{},n.fn.checkbox.settings,r),w=a.className,et=a.namespace,b=a.selector,ft=a.error,k="."+et,rt="module-"+et,y=n(this),g=n(this).children(b.label),v=n(this).children(b.input),p=v[0],tt=!1,nt=!1,d=y.data(rt),ut=this;o={initialize:function(){o.verbose("Initializing checkbox",a),o.create.label(),o.bind.events(),o.set.tabbable(),o.hide.input(),o.observeChanges(),o.instantiate(),o.setup()},instantiate:function(){o.verbose("Storing instance of module",o),d=o,y.data(rt,o)},destroy:function(){o.verbose("Destroying module"),o.unbind.events(),o.show.input(),y.removeData(rt)},fix:{reference:function(){y.is(b.input)&&(o.debug("Behavior called on <input> adjusting invoked element"),y=y.closest(b.checkbox),o.refresh())}},setup:function(){o.set.initialLoad(),o.is.indeterminate()?(o.debug("Initial value is indeterminate"),o.indeterminate()):o.is.checked()?(o.debug("Initial value is checked"),o.check()):(o.debug("Initial value is unchecked"),o.uncheck()),o.remove.initialLoad()},refresh:function(){g=y.children(b.label),v=y.children(b.input),p=v[0]},hide:{input:function(){o.verbose("Modifying <input> z-index to be unselectable"),v.addClass(w.hidden)}},show:{input:function(){o.verbose("Modifying <input> z-index to be selectable"),v.removeClass(w.hidden)}},observeChanges:function(){"MutationObserver"in t&&(it=new MutationObserver(function(){o.debug("DOM tree modified, updating selector cache"),o.refresh()}),it.observe(ut,{childList:!0,subtree:!0}),o.debug("Setting up mutation observer",it))},attachEvents:function(t,i){var r=n(t);i=n.isFunction(o[i])?o[i]:o.toggle,r.length>0?(o.debug("Attaching checkbox events to element",t,i),r.on("click"+k,i)):o.error(ft.notFound)},event:{click:function(t){var i=n(t.target);return i.is(b.input)?void o.verbose("Using default check action on initialized checkbox"):i.is(b.link)?void o.debug("Clicking link inside checkbox, skipping toggle"):(o.toggle(),v.focus(),void t.preventDefault())},keydown:function(n){var t=n.which,i={enter:13,space:32,escape:27};t==i.escape?(o.verbose("Escape key pressed blurring field"),v.blur(),nt=!0):n.ctrlKey||t!=i.space&&t!=i.enter?nt=!1:(o.verbose("Enter/space key pressed, toggling checkbox"),o.toggle(),nt=!0)},keyup:function(n){nt&&n.preventDefault()}},check:function(){o.should.allowCheck()&&(o.debug("Checking checkbox",v),o.set.checked(),o.should.ignoreCallbacks()||(a.onChecked.call(p),a.onChange.call(p)))},uncheck:function(){o.should.allowUncheck()&&(o.debug("Unchecking checkbox"),o.set.unchecked(),o.should.ignoreCallbacks()||(a.onUnchecked.call(p),a.onChange.call(p)))},indeterminate:function(){if(o.should.allowIndeterminate())return void o.debug("Checkbox is already indeterminate");o.debug("Making checkbox indeterminate"),o.set.indeterminate(),o.should.ignoreCallbacks()||(a.onIndeterminate.call(p),a.onChange.call(p))},determinate:function(){if(o.should.allowDeterminate())return void o.debug("Checkbox is already determinate");o.debug("Making checkbox determinate"),o.set.determinate(),o.should.ignoreCallbacks()||(a.onDeterminate.call(p),a.onChange.call(p))},enable:function(){if(o.is.enabled())return void o.debug("Checkbox is already enabled");o.debug("Enabling checkbox"),o.set.enabled(),a.onEnable.call(p),a.onEnabled.call(p)},disable:function(){if(o.is.disabled())return void o.debug("Checkbox is already disabled");o.debug("Disabling checkbox"),o.set.disabled(),a.onDisable.call(p),a.onDisabled.call(p)},get:{radios:function(){var t=o.get.name();return n('input[name="'+t+'"]').closest(b.checkbox)},otherRadios:function(){return o.get.radios().not(y)},name:function(){return v.attr("name")}},is:{initialLoad:function(){return tt},radio:function(){return v.hasClass(w.radio)||"radio"==v.attr("type")},indeterminate:function(){return void 0!==v.prop("indeterminate")&&v.prop("indeterminate")},checked:function(){return void 0!==v.prop("checked")&&v.prop("checked")},disabled:function(){return void 0!==v.prop("disabled")&&v.prop("disabled")},enabled:function(){return!o.is.disabled()},determinate:function(){return!o.is.indeterminate()},unchecked:function(){return!o.is.checked()}},should:{allowCheck:function(){return o.is.determinate()&&o.is.checked()&&!o.should.forceCallbacks()?(o.debug("Should not allow check, checkbox is already checked"),!1):!1!==a.beforeChecked.apply(p)||(o.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return o.is.determinate()&&o.is.unchecked()&&!o.should.forceCallbacks()?(o.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!1!==a.beforeUnchecked.apply(p)||(o.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return o.is.indeterminate()&&!o.should.forceCallbacks()?(o.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!1!==a.beforeIndeterminate.apply(p)||(o.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return o.is.determinate()&&!o.should.forceCallbacks()?(o.debug("Should not allow determinate, checkbox is already determinate"),!1):!1!==a.beforeDeterminate.apply(p)||(o.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return o.is.initialLoad()&&a.fireOnInit},ignoreCallbacks:function(){return tt&&!a.fireOnInit}},can:{change:function(){return!(y.hasClass(w.disabled)||y.hasClass(w.readOnly)||v.prop("disabled")||v.prop("readonly"))},uncheck:function(){return"boolean"==typeof a.uncheckable?a.uncheckable:!o.is.radio()}},set:{initialLoad:function(){tt=!0},checked:function(){if(o.verbose("Setting class to checked"),y.removeClass(w.indeterminate).addClass(w.checked),o.is.radio()&&o.uncheckOthers(),!o.is.indeterminate()&&o.is.checked())return void o.debug("Input is already checked, skipping input property change");o.verbose("Setting state to checked",p),v.prop("indeterminate",!1).prop("checked",!0),o.trigger.change()},unchecked:function(){if(o.verbose("Removing checked class"),y.removeClass(w.indeterminate).removeClass(w.checked),!o.is.indeterminate()&&o.is.unchecked())return void o.debug("Input is already unchecked");o.debug("Setting state to unchecked"),v.prop("indeterminate",!1).prop("checked",!1),o.trigger.change()},indeterminate:function(){if(o.verbose("Setting class to indeterminate"),y.addClass(w.indeterminate),o.is.indeterminate())return void o.debug("Input is already indeterminate, skipping input property change");o.debug("Setting state to indeterminate"),v.prop("indeterminate",!0),o.trigger.change()},determinate:function(){if(o.verbose("Removing indeterminate class"),y.removeClass(w.indeterminate),o.is.determinate())return void o.debug("Input is already determinate, skipping input property change");o.debug("Setting state to determinate"),v.prop("indeterminate",!1)},disabled:function(){if(o.verbose("Setting class to disabled"),y.addClass(w.disabled),o.is.disabled())return void o.debug("Input is already disabled, skipping input property change");o.debug("Setting state to disabled"),v.prop("disabled","disabled"),o.trigger.change()},enabled:function(){if(o.verbose("Removing disabled class"),y.removeClass(w.disabled),o.is.enabled())return void o.debug("Input is already enabled, skipping input property change");o.debug("Setting state to enabled"),v.prop("disabled",!1),o.trigger.change()},tabbable:function(){o.verbose("Adding tabindex to checkbox"),void 0===v.attr("tabindex")&&v.attr("tabindex",0)}},remove:{initialLoad:function(){tt=!1}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=v[0];t&&(o.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},create:{label:function(){v.prevAll(b.label).length>0?(v.prev(b.label).detach().insertAfter(v),o.debug("Moving existing label",g)):o.has.label()||(g=n("<label>").insertAfter(v),o.debug("Creating label",g))}},has:{label:function(){return g.length>0}},bind:{events:function(){o.verbose("Attaching checkbox events"),y.on("click"+k,o.event.click).on("keydown"+k,b.input,o.event.keydown).on("keyup"+k,b.input,o.event.keyup)}},unbind:{events:function(){o.debug("Removing events"),y.off(k)}},uncheckOthers:function(){var n=o.get.otherRadios();o.debug("Unchecking other radios",n),n.removeClass(w.checked)},toggle:function(){if(!o.can.change())return void(o.is.radio()||o.debug("Checkbox is read-only or disabled, ignoring toggle"));o.is.indeterminate()||o.is.unchecked()?(o.debug("Currently unchecked"),o.check()):o.is.checked()&&o.can.uncheck()&&(o.debug("Currently checked"),o.uncheck())},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(void 0===i)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(void 0===i)return o[t];o[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;a.performance&&(t=+new Date,r=e||t,i=t-r,e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ut,"Execution Time":i})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1,clearTimeout(o.performance.timer),n.each(f,function(n,t){i+=t["Execution Time"]}),t+=" "+i+"ms",s&&(t+=" '"+s+"'"),(void 0!==console.group||void 0!==console.table)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,i,r){var h,e,s,f=d;return i=i||l,r=ut||r,"string"==typeof t&&void 0!==f&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,r){var u=i!=h?r+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[u])&&i!=h)f=f[u];else{if(void 0!==f[u])return e=f[u],!1;if(!n.isPlainObject(f[r])||i==h)return void 0!==f[r]?(e=f[r],!1):(o.error(ft.method,t),!1);f=f[r]}})),n.isFunction(e)?s=e.apply(r,i):void 0!==e&&(s=e),n.isArray(u)?u.push(s):void 0!==u?u=[u,s]:void 0!==s&&(u=s),e}},c?(void 0===d&&o.initialize(),o.invoke(h)):(void 0!==d&&d.invoke("destroy"),o.initialize())}),void 0!==u?u:this},n.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(n,t,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),n.fn.popup=function(r){var u,c=n(this),o=n(i),e=n(t),s=n("body"),l=c.selector||"",h=+new Date,f=[],a=arguments[0],v="string"==typeof a,y=[].slice.call(arguments,1);return c.each(function(){var w,tt,ot,it,ct,c,p=n.isPlainObject(r)?n.extend(!0,{},n.fn.popup.settings,r):n.extend({},n.fn.popup.settings),et=p.selector,d=p.className,st=p.error,g=p.metadata,wt=p.namespace,rt="."+p.namespace,at="module-"+wt,b=n(this),yt=n(p.context),pt=n(p.scrollContext),ht=n(p.boundary),nt=p.target?n(p.target):b,lt=0,ut=!1,vt=!1,k=this,ft=b.data(at);c={initialize:function(){c.debug("Initializing",b),c.createID(),c.bind.events(),!c.exists()&&p.preserve&&c.create(),p.observeChanges&&c.observeChanges(),c.instantiate()},instantiate:function(){c.verbose("Storing instance",c),ft=c,b.data(at,ft)},observeChanges:function(){"MutationObserver"in t&&(ot=new MutationObserver(c.event.documentChanged),ot.observe(i,{childList:!0,subtree:!0}),c.debug("Setting up mutation observer",ot))},refresh:function(){p.popup?w=n(p.popup).eq(0):p.inline&&(w=nt.nextAll(et.popup).eq(0),p.popup=w),p.popup?(w.addClass(d.loading),tt=c.get.offsetParent(),w.removeClass(d.loading),p.movePopup&&c.has.popup()&&c.get.offsetParent(w)[0]!==tt[0]&&(c.debug("Moving popup to the same offset parent as activating element"),w.detach().appendTo(tt))):tt=p.inline?c.get.offsetParent(nt):c.has.popup()?c.get.offsetParent(w):s,tt.is("html")&&tt[0]!==s[0]&&(c.debug("Setting page as offset parent"),tt=s),c.get.variation()&&c.set.variation()},reposition:function(){c.refresh(),c.set.position()},destroy:function(){c.debug("Destroying previous module"),ot&&ot.disconnect(),w&&!p.preserve&&c.removePopup(),clearTimeout(c.hideTimer),clearTimeout(c.showTimer),c.unbind.close(),c.unbind.events(),b.removeData(at)},event:{start:function(){var i=n.isPlainObject(p.delay)?p.delay.show:p.delay;clearTimeout(c.hideTimer),vt||(c.showTimer=setTimeout(c.show,i))},end:function(){var t=n.isPlainObject(p.delay)?p.delay.hide:p.delay;clearTimeout(c.showTimer),c.hideTimer=setTimeout(c.hide,t)},touchstart:function(){vt=!0,c.show()},resize:function(){c.is.visible()&&c.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==k||n(t).find(k).length>0)&&(c.debug("Element removed from DOM, tearing down events"),c.destroy())})})},hideGracefully:function(t){var r=n(t.target),u=n.contains(i.documentElement,t.target),f=r.closest(et.popup).length>0;t&&!f&&u?(c.debug("Click occurred outside popup hiding popup"),c.hide()):c.debug("Click was inside popup, keeping popup open")}},create:function(){var t=c.get.html(),i=c.get.title(),r=c.get.content();t||r||i?(c.debug("Creating pop-up html"),t||(t=p.templates.popup({title:i,content:r})),w=n("<div/>").addClass(d.popup).data(g.activator,b).html(t),p.inline?(c.verbose("Inserting popup element inline",w),w.insertAfter(b)):(c.verbose("Appending popup element to body",w),w.appendTo(yt)),c.refresh(),c.set.variation(),p.hoverable&&c.bind.popup(),p.onCreate.call(w,k)):0!==nt.next(et.popup).length?(c.verbose("Pre-existing popup found"),p.inline=!0,p.popup=nt.next(et.popup).data(g.activator,b),c.refresh(),p.hoverable&&c.bind.popup()):p.popup?(n(p.popup).data(g.activator,b),c.verbose("Used popup specified in settings"),c.refresh(),p.hoverable&&c.bind.popup()):c.debug("No content specified skipping display",k)},createID:function(){ct=(Math.random().toString(16)+"000000000").substr(2,8),it="."+ct,c.verbose("Creating unique id for element",ct)},toggle:function(){c.debug("Toggling pop-up"),c.is.hidden()?(c.debug("Popup is hidden, showing pop-up"),c.unbind.close(),c.show()):(c.debug("Popup is visible, hiding pop-up"),c.hide())},show:function(n){if(n=n||function(){},c.debug("Showing pop-up",p.transition),c.is.hidden()&&(!c.is.active()||!c.is.dropdown())){if(c.exists()||c.create(),!1===p.onShow.call(w,k))return void c.debug("onShow callback returned false, cancelling popup animation");p.preserve||p.popup||c.refresh(),w&&c.set.position()&&(c.save.conditions(),p.exclusive&&c.hideAll(),c.animate.show(n))}},hide:function(n){if(n=n||function(){},c.is.visible()||c.is.animating()){if(!1===p.onHide.call(w,k))return void c.debug("onHide callback returned false, cancelling popup animation");c.remove.visible(),c.unbind.close(),c.restore.conditions(),c.animate.hide(n)}},hideAll:function(){n(et.popup).filter("."+d.visible).each(function(){n(this).data(g.activator).popup("hide")})},exists:function(){return!!w&&(p.inline||p.popup?c.has.popup():w.closest(yt).length>=1)},removePopup:function(){c.has.popup()&&!p.popup&&(c.debug("Removing popup",w),w.remove(),w=void 0,p.onRemove.call(w,k))},save:{conditions:function(){c.cache={title:b.attr("title")},c.cache.title&&b.removeAttr("title"),c.verbose("Saving original attributes",c.cache.title)}},restore:{conditions:function(){return c.cache&&c.cache.title&&(b.attr("title",c.cache.title),c.verbose("Restoring original attributes",c.cache.title)),!0}},supports:{svg:function(){return void 0===typeof SVGGraphicsElement}},animate:{show:function(t){t=n.isFunction(t)?t:function(){},p.transition&&void 0!==n.fn.transition&&b.transition("is supported")?(c.set.visible(),w.transition({animation:p.transition+" in",queue:!1,debug:p.debug,verbose:p.verbose,duration:p.duration,onComplete:function(){c.bind.close(),t.call(w,k),p.onVisible.call(w,k)}})):c.error(st.noTransition)},hide:function(t){if(t=n.isFunction(t)?t:function(){},c.debug("Hiding pop-up"),!1===p.onHide.call(w,k))return void c.debug("onHide callback returned false, cancelling popup animation");p.transition&&void 0!==n.fn.transition&&b.transition("is supported")?w.transition({animation:p.transition+" out",queue:!1,duration:p.duration,debug:p.debug,verbose:p.verbose,onComplete:function(){c.reset(),t.call(w,k),p.onHidden.call(w,k)}}):c.error(st.noTransition)}},change:{content:function(n){w.html(n)}},get:{html:function(){return b.removeData(g.html),b.data(g.html)||p.html},title:function(){return b.removeData(g.title),b.data(g.title)||p.title},content:function(){return b.removeData(g.content),b.data(g.content)||b.attr("title")||p.content},variation:function(){return b.removeData(g.variation),b.data(g.variation)||p.variation},popup:function(){return w},popupOffset:function(){return w.offset()},calculations:function(){var n,r=nt[0],u=ht[0]==t,f=p.inline||p.popup&&p.movePopup?nt.position():nt.offset(),o=u?{top:0,left:0}:ht.offset(),i={},s=u?{top:e.scrollTop(),left:e.scrollLeft()}:{top:0,left:0};return i={target:{element:nt[0],width:nt.outerWidth(),height:nt.outerHeight(),top:f.top,left:f.left,margin:{}},popup:{width:w.outerWidth(),height:w.outerHeight()},parent:{width:tt.outerWidth(),height:tt.outerHeight()},screen:{top:o.top,left:o.left,scroll:{top:s.top,left:s.left},width:ht.width(),height:ht.height()}},p.setFluidWidth&&c.is.fluid()&&(i.container={width:w.parent().outerWidth()},i.popup.width=i.container.width),i.target.margin.top=p.inline?parseInt(t.getComputedStyle(r).getPropertyValue("margin-top"),10):0,i.target.margin.left=p.inline?c.is.rtl()?parseInt(t.getComputedStyle(r).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(r).getPropertyValue("margin-left"),10):0,n=i.screen,i.boundary={top:n.top+n.scroll.top,bottom:n.top+n.scroll.top+n.height,left:n.left+n.scroll.left,right:n.left+n.scroll.left+n.width},i},id:function(){return ct},startEvent:function(){return"hover"==p.on?"mouseenter":"focus"==p.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==p.on?"mouseleave":"focus"==p.on&&"blur"},distanceFromBoundary:function(n,t){var r,i,u={};return t=t||c.get.calculations(),r=t.popup,i=t.boundary,n&&(u={top:n.top-i.top,left:n.left-i.left,right:i.right-(n.left+r.width),bottom:i.bottom-(n.top+r.height)},c.verbose("Distance from boundaries determined",n,u)),u},offsetParent:function(t){var o=void 0!==t?t[0]:b[0],r=o.parentNode,i=n(r);if(r)for(var u="none"===i.css("transform"),f="static"===i.css("position"),e=i.is("html");r&&!e&&f&&u;)r=r.parentNode,i=n(r),u="none"===i.css("transform"),f="static"===i.css("position"),e=i.is("html");return i&&i.length>0?i:n()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(n){var r=n.split(" "),i=r[0],u=r[1],o={top:"bottom",bottom:"top",left:"right",right:"left"},s={left:"center",center:"right",right:"left"},h={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"},l="top"==i||"bottom"==i,f=!1,e=!1,t=!1;return ut||(c.verbose("All available positions available"),ut=c.get.positions()),c.debug("Recording last position tried",n),ut[n]=!0,"opposite"===p.prefer&&(t=[o[i],u],t=t.join(" "),f=!0===ut[t],c.debug("Trying opposite strategy",t)),"adjacent"===p.prefer&&l&&(t=[i,s[u]],t=t.join(" "),e=!0===ut[t],c.debug("Trying adjacent strategy",t)),(e||f)&&(c.debug("Using backup position",t),t=h[n]),t}},set:{position:function(n,t){if(0===nt.length||0===w.length)return void c.error(st.notFound);var r,u,i,o,e,f,s,h;if(t=t||c.get.calculations(),n=n||b.data(g.position)||p.position,r=b.data(g.offset)||p.offset,u=p.distanceAway,i=t.target,o=t.popup,e=t.parent,0===i.width&&0===i.height&&!c.is.svg(i.element))return c.debug("Popup target is hidden, no action taken"),!1;switch(p.inline&&(c.debug("Adding margin to calculation",i.margin),"left center"==n||"right center"==n?(r+=i.margin.top,u+=-i.margin.left):"top left"==n||"top center"==n||"top right"==n?(r+=i.margin.left,u-=i.margin.top):(r+=i.margin.left,u+=i.margin.top)),c.debug("Determining popup position from calculations",n,t),c.is.rtl()&&(n=n.replace(/left|right/g,function(n){return"left"==n?"right":"left"}),c.debug("RTL: Popup position updated",n)),lt==p.maxSearchDepth&&"string"==typeof p.lastResort&&(n=p.lastResort),n){case"top left":f={top:"auto",bottom:e.height-i.top+u,left:i.left+r,right:"auto"};break;case"top center":f={bottom:e.height-i.top+u,left:i.left+i.width/2-o.width/2+r,top:"auto",right:"auto"};break;case"top right":f={bottom:e.height-i.top+u,right:e.width-i.left-i.width-r,top:"auto",left:"auto"};break;case"left center":f={top:i.top+i.height/2-o.height/2+r,right:e.width-i.left+u,left:"auto",bottom:"auto"};break;case"right center":f={top:i.top+i.height/2-o.height/2+r,left:i.left+i.width+u,bottom:"auto",right:"auto"};break;case"bottom left":f={top:i.top+i.height+u,left:i.left+r,bottom:"auto",right:"auto"};break;case"bottom center":f={top:i.top+i.height+u,left:i.left+i.width/2-o.width/2+r,bottom:"auto",right:"auto"};break;case"bottom right":f={top:i.top+i.height+u,right:e.width-i.left-i.width-r,left:"auto",bottom:"auto"}}if(void 0===f&&c.error(st.invalidPosition,n),c.debug("Calculated popup positioning values",f),w.css(f).removeClass(d.position).addClass(n).addClass(d.loading),s=c.get.popupOffset(),h=c.get.distanceFromBoundary(s,t),c.is.offstage(h,n)){if(c.debug("Position is outside viewport",n),lt<p.maxSearchDepth)return lt++,n=c.get.nextPosition(n),c.debug("Trying new position",n),!!w&&c.set.position(n,t);if(!p.lastResort)return c.debug("Popup could not find a position to display",w),c.error(st.cannotPlace,k),c.remove.attempts(),c.remove.loading(),c.reset(),p.onUnplaceable.call(w,k),!1;c.debug("No position found, showing with last position")}return c.debug("Position is on stage",n),c.remove.attempts(),c.remove.loading(),p.setFluidWidth&&c.is.fluid()&&c.set.fluidWidth(t),!0},fluidWidth:function(n){n=n||c.get.calculations(),c.debug("Automatically setting element width to parent width",n.parent.width),w.css("width",n.container.width)},variation:function(n){(n=n||c.get.variation())&&c.has.popup()&&(c.verbose("Adding variation to popup",n),w.addClass(n))},visible:function(){b.addClass(d.visible)}},remove:{loading:function(){w.removeClass(d.loading)},variation:function(n){(n=n||c.get.variation())&&(c.verbose("Removing variation",n),w.removeClass(n))},visible:function(){b.removeClass(d.visible)},attempts:function(){c.verbose("Resetting all searched positions"),lt=0,ut=!1}},bind:{events:function(){c.debug("Binding popup events to module"),"click"==p.on&&b.on("click"+rt,c.toggle),"hover"==p.on&&b.on("touchstart"+rt,c.event.touchstart),c.get.startEvent()&&b.on(c.get.startEvent()+rt,c.event.start).on(c.get.endEvent()+rt,c.event.end),p.target&&c.debug("Target set to element",nt),e.on("resize"+it,c.event.resize)},popup:function(){c.verbose("Allowing hover events on popup to prevent closing"),w&&c.has.popup()&&w.on("mouseenter"+rt,c.event.start).on("mouseleave"+rt,c.event.end)},close:function(){(!0===p.hideOnScroll||"auto"==p.hideOnScroll&&"click"!=p.on)&&pt.one(c.get.scrollEvent()+it,c.event.hideGracefully),"hover"==p.on&&vt&&(c.verbose("Binding popup close event to document"),o.on("touchstart"+it,function(n){c.verbose("Touched away from popup"),c.event.hideGracefully.call(k,n)})),"click"==p.on&&p.closable&&(c.verbose("Binding popup close event to document"),o.on("click"+it,function(n){c.verbose("Clicked away from popup"),c.event.hideGracefully.call(k,n)}))}},unbind:{events:function(){e.off(it),b.off(rt)},close:function(){o.off(it),pt.off(it)}},has:{popup:function(){return w&&w.length>0}},is:{offstage:function(t,i){var r=[];return n.each(t,function(n,t){t<-p.jitter&&(c.debug("Position exceeds allowable distance from edge",n,t,i),r.push(n))}),r.length>0},svg:function(n){return c.supports.svg()&&n instanceof SVGGraphicsElement},active:function(){return b.hasClass(d.active)},animating:function(){return void 0!==w&&w.hasClass(d.animating)},fluid:function(){return void 0!==w&&w.hasClass(d.fluid)},visible:function(){return void 0!==w&&w.hasClass(d.visible)},dropdown:function(){return b.hasClass(d.dropdown)},hidden:function(){return!c.is.visible()},rtl:function(){return"rtl"==b.css("direction")}},reset:function(){c.remove.visible(),p.preserve?void 0!==n.fn.transition&&w.transition("remove transition"):c.removePopup()},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,p,t);else{if(void 0===i)return p[t];p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,c,t);else{if(void 0===i)return c[t];c[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,p.name+":"),c.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),c.verbose.apply(console,arguments)))},error:function(){p.silent||(c.error=Function.prototype.bind.call(console.error,console,p.name+":"),c.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;p.performance&&(t=+new Date,r=h||t,i=t-r,h=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:k,"Execution Time":i})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,500)},display:function(){var t=p.name+":",i=0;h=!1,clearTimeout(c.performance.timer),n.each(f,function(n,t){i+=t["Execution Time"]}),t+=" "+i+"ms",l&&(t+=" '"+l+"'"),(void 0!==console.group||void 0!==console.table)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,i,r){var s,e,o,f=ft;return i=i||y,r=k||r,"string"==typeof t&&void 0!==f&&(t=t.split(/[\. ]/),s=t.length-1,n.each(t,function(i,r){var u=i!=s?r+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[u])&&i!=s)f=f[u];else{if(void 0!==f[u])return e=f[u],!1;if(!n.isPlainObject(f[r])||i==s)return void 0!==f[r]&&(e=f[r],!1);f=f[r]}})),n.isFunction(e)?o=e.apply(r,i):void 0!==e&&(o=e),n.isArray(u)?u.push(o):void 0!==u?u=[u,o]:void 0!==o&&(u=o),e}},v?(void 0===ft&&c.initialize(),c.invoke(a)):(void 0!==ft&&ft.invoke("destroy"),c.initialize())}),void 0!==u?u:this},n.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:t,addTouchEvents:!0,position:"top left",variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:t,prefer:"opposite",lastResort:!1,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(n){var t=/[&<>"'`]/g,i=/[&<>"'`]/,r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},u=function(n){return r[n]};return i.test(n)?n.replace(t,u):n},popup:function(t){var i="",r=n.fn.popup.settings.templates.escape;return void 0!==typeof t&&(void 0!==typeof t.title&&t.title&&(t.title=r(t.title),i+='<div class="header">'+t.title+"</div>"),void 0!==typeof t.content&&t.content&&(t.content=r(t.content),i+='<div class="content">'+t.content+"</div>")),i}}}}(jQuery,window,document),function(n,t,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),n.fn.dropdown=function(r){var u,f=n(this),e=n(i),l=f.selector||"",s="ontouchstart"in i.documentElement,h=+new Date,o=[],c=arguments[0],a="string"==typeof c,v=[].slice.call(arguments,1);return f.each(function(y){var ri,yt,bt,ct,gt,ht,pt,p,w=n.isPlainObject(r)?n.extend(!0,{},n.fn.dropdown.settings,r):n.extend({},n.fn.dropdown.settings),b=w.className,lt=w.message,si=w.fields,ft=w.keys,it=w.metadata,ei=w.namespace,ni=w.regExp,k=w.selector,st=w.error,ii=w.templates,nt="."+ei,ti="module-"+ei,d=n(this),dt=n(w.context),ot=d.find(k.text),ut=d.find(k.search),kt=d.find(k.sizer),rt=d.find(k.input),oi=d.find(k.icon),wt=d.prev().find(k.text).length>0?d.prev().find(k.text):d.prev(),g=d.children(k.menu),tt=g.find(k.item),vt=!1,ui=!1,fi=!1,et=this,at=d.data(ti);p={initialize:function(){p.debug("Initializing dropdown",w),p.is.alreadySetup()?p.setup.reference():(p.setup.layout(),p.refreshData(),p.save.defaults(),p.restore.selected(),p.create.id(),p.bind.events(),p.observeChanges(),p.instantiate())},instantiate:function(){p.verbose("Storing instance of dropdown",p),at=p,d.data(ti,p)},destroy:function(){p.verbose("Destroying previous dropdown",d),p.remove.tabbable(),d.off(nt).removeData(ti),g.off(nt),e.off(ct),p.disconnect.menuObserver(),p.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(ht=new MutationObserver(p.event.select.mutation),pt=new MutationObserver(p.event.menu.mutation),p.debug("Setting up mutation observer",ht,pt),p.observe.select(),p.observe.menu())},disconnect:{menuObserver:function(){pt&&pt.disconnect()},selectObserver:function(){ht&&ht.disconnect()}},observe:{select:function(){p.has.input()&&ht.observe(rt[0],{childList:!0,subtree:!0})},menu:function(){p.has.menu()&&pt.observe(g[0],{childList:!0,subtree:!0})}},create:{id:function(){gt=(Math.random().toString(16)+"000000000").substr(2,8),ct="."+gt,p.verbose("Creating unique id for element",gt)},userChoice:function(t){var r,i,u;return!!(t=t||p.get.userValues())&&(t=n.isArray(t)?t:[t],n.each(t,function(t,f){!1===p.get.item(f)&&(u=w.templates.addition(p.add.variables(lt.addResult,f)),i=n("<div />").html(u).attr("data-"+it.value,f).attr("data-"+it.text,f).addClass(b.addition).addClass(b.item),w.hideAdditions&&i.addClass(b.hidden),r=void 0===r?i:r.add(i),p.verbose("Creating user choices for value",f,i))}),r)},userLabels:function(){var i=p.get.userValues();i&&(p.debug("Adding user labels",i),n.each(i,function(n,t){p.verbose("Adding custom user value"),p.add.label(t,t)}))},menu:function(){g=n("<div />").addClass(b.menu).appendTo(d)},sizer:function(){kt=n("<span />").addClass(b.sizer).insertAfter(ut)}},search:function(n){n=void 0!==n?n:p.get.query(),p.verbose("Searching for query",n),p.has.minCharacters(n)?p.filter(n):p.hide()},select:{firstUnfiltered:function(){p.verbose("Selecting first non-filtered element"),p.remove.selectedItem(),tt.not(k.unselectable).not(k.addition+k.hidden).eq(0).addClass(b.selected)},nextAvailable:function(n){n=n.eq(0);var t=n.nextAll(k.item).not(k.unselectable).eq(0),i=n.prevAll(k.item).not(k.unselectable).eq(0);t.length>0?(p.verbose("Moving selection to",t),t.addClass(b.selected)):(p.verbose("Moving selection to",i),i.addClass(b.selected))}},setup:{api:function(){var n={debug:w.debug,urlData:{value:p.get.value(),query:p.get.query()},on:!1};p.verbose("First request, initializing API"),d.api(n)},layout:function(){d.is("select")&&(p.setup.select(),p.setup.returnedObject()),p.has.menu()||p.create.menu(),p.is.search()&&!p.has.search()&&(p.verbose("Adding search input"),ut=n("<input />").addClass(b.search).prop("autocomplete","off").insertBefore(ot)),p.is.multiple()&&p.is.searchSelection()&&!p.has.sizer()&&p.create.sizer(),w.allowTab&&p.set.tabbable()},select:function(){var t=p.get.selectValues();p.debug("Dropdown initialized on a select",t),d.is("select")&&(rt=d),rt.parent(k.dropdown).length>0?(p.debug("UI dropdown already exists. Creating dropdown menu only"),d=rt.closest(k.dropdown),p.has.menu()||p.create.menu(),g=d.children(k.menu),p.setup.menu(t)):(p.debug("Creating entire dropdown from select"),d=n("<div />").attr("class",rt.attr("class")).addClass(b.selection).addClass(b.dropdown).html(ii.dropdown(t)).insertBefore(rt),rt.hasClass(b.multiple)&&!1===rt.prop("multiple")&&(p.error(st.missingMultiple),rt.prop("multiple",!0)),rt.is("[multiple]")&&p.set.multiple(),rt.prop("disabled")&&(p.debug("Disabling dropdown"),d.addClass(b.disabled)),rt.removeAttr("class").detach().prependTo(d)),p.refresh()},menu:function(n){g.html(ii.menu(n,si)),tt=g.find(k.item)},reference:function(){p.debug("Dropdown behavior was called on select, replacing with closest dropdown"),d=d.parent(k.dropdown),p.refresh(),p.setup.returnedObject(),a&&(at=p,p.invoke(c))},returnedObject:function(){var n=f.slice(0,y),t=f.slice(y+1);f=n.add(d).add(t)}},refresh:function(){p.refreshSelectors(),p.refreshData()},refreshItems:function(){tt=g.find(k.item)},refreshSelectors:function(){p.verbose("Refreshing selector cache"),ot=d.find(k.text),ut=d.find(k.search),rt=d.find(k.input),oi=d.find(k.icon),wt=d.prev().find(k.text).length>0?d.prev().find(k.text):d.prev(),g=d.children(k.menu),tt=g.find(k.item)},refreshData:function(){p.verbose("Refreshing cached metadata"),tt.removeData(it.text).removeData(it.value)},clearData:function(){p.verbose("Clearing metadata"),tt.removeData(it.text).removeData(it.value),d.removeData(it.defaultText).removeData(it.defaultValue).removeData(it.placeholderText)},toggle:function(){p.verbose("Toggling menu visibility"),p.is.active()?p.hide():p.show()},show:function(t){if(t=n.isFunction(t)?t:function(){},!p.can.show()&&p.is.remote()&&(p.debug("No API results retrieved, searching before show"),p.queryRemote(p.get.query(),p.show)),p.can.show()&&!p.is.active()){if(p.debug("Showing dropdown"),!p.has.message()||p.has.maxSelections()||p.has.allResultsFiltered()||p.remove.message(),p.is.allFiltered())return!0;!1!==w.onShow.call(et)&&p.animate.show(function(){p.can.click()&&p.bind.intent(),p.has.menuSearch()&&p.focusSearch(),p.set.visible(),t.call(et)})}},hide:function(t){t=n.isFunction(t)?t:function(){},p.is.active()&&(p.debug("Hiding dropdown"),!1!==w.onHide.call(et)&&p.animate.hide(function(){p.remove.visible(),t.call(et)}))},hideOthers:function(){p.verbose("Finding other dropdowns to hide"),f.not(d).has(k.menu+"."+b.visible).dropdown("hide")},hideMenu:function(){p.verbose("Hiding menu  instantaneously"),p.remove.active(),p.remove.visible(),g.transition("hide")},hideSubMenus:function(){var n=g.children(k.item).find(k.menu);p.verbose("Hiding sub menus",n),n.transition("hide")},bind:{events:function(){s&&p.bind.touchEvents(),p.bind.keyboardEvents(),p.bind.inputEvents(),p.bind.mouseEvents()},touchEvents:function(){p.debug("Touch device detected binding additional touch events"),p.is.searchSelection()||p.is.single()&&d.on("touchstart"+nt,p.event.test.toggle),g.on("touchstart"+nt,k.item,p.event.item.mouseenter)},keyboardEvents:function(){p.verbose("Binding keyboard events"),d.on("keydown"+nt,p.event.keydown),p.has.search()&&d.on(p.get.inputEvent()+nt,k.search,p.event.input),p.is.multiple()&&e.on("keydown"+ct,p.event.document.keydown)},inputEvents:function(){p.verbose("Binding input change events"),d.on("change"+nt,k.input,p.event.change)},mouseEvents:function(){p.verbose("Binding mouse events"),p.is.multiple()&&d.on("click"+nt,k.label,p.event.label.click).on("click"+nt,k.remove,p.event.remove.click),p.is.searchSelection()?(d.on("mousedown"+nt,p.event.mousedown).on("mouseup"+nt,p.event.mouseup).on("mousedown"+nt,k.menu,p.event.menu.mousedown).on("mouseup"+nt,k.menu,p.event.menu.mouseup).on("click"+nt,k.icon,p.event.icon.click).on("focus"+nt,k.search,p.event.search.focus).on("click"+nt,k.search,p.event.search.focus).on("blur"+nt,k.search,p.event.search.blur).on("click"+nt,k.text,p.event.text.focus),p.is.multiple()&&d.on("click"+nt,p.event.click)):("click"==w.on?d.on("click"+nt,k.icon,p.event.icon.click).on("click"+nt,p.event.test.toggle):"hover"==w.on?d.on("mouseenter"+nt,p.delay.show).on("mouseleave"+nt,p.delay.hide):d.on(w.on+nt,p.toggle),d.on("mousedown"+nt,p.event.mousedown).on("mouseup"+nt,p.event.mouseup).on("focus"+nt,p.event.focus),p.has.menuSearch()?d.on("blur"+nt,k.search,p.event.search.blur):d.on("blur"+nt,p.event.blur)),g.on("mouseenter"+nt,k.item,p.event.item.mouseenter).on("mouseleave"+nt,k.item,p.event.item.mouseleave).on("click"+nt,k.item,p.event.item.click)},intent:function(){p.verbose("Binding hide intent event to document"),s&&e.on("touchstart"+ct,p.event.test.touch).on("touchmove"+ct,p.event.test.touch),e.on("click"+ct,p.event.test.hide)}},unbind:{intent:function(){p.verbose("Removing hide intent event from document"),s&&e.off("touchstart"+ct).off("touchmove"+ct),e.off("click"+ct)}},filter:function(n){var t=void 0!==n?n:p.get.query(),i=function(){p.is.multiple()&&p.filterActive(),p.select.firstUnfiltered(),p.has.allResultsFiltered()?w.onNoResults.call(et,t)?w.allowAdditions?w.hideAdditions&&(p.verbose("User addition with no menu, setting empty style"),p.set.empty(),p.hideMenu()):(p.verbose("All items filtered, showing message",t),p.add.message(lt.noResults)):(p.verbose("All items filtered, hiding dropdown",t),p.hideMenu()):(p.remove.empty(),p.remove.message()),w.allowAdditions&&p.add.userSuggestion(n),p.is.searchSelection()&&p.can.show()&&p.is.focusedOnSearch()&&p.show()};w.useLabels&&p.has.maxSelections()||(w.apiSettings?p.can.useAPI()?p.queryRemote(t,function(){w.filterRemoteData&&p.filterItems(t),i()}):p.error(st.noAPI):(p.filterItems(t),i()))},queryRemote:function(t,i){var r={errorDuration:!1,cache:"local",throttle:w.throttle,urlData:{query:t},onError:function(){p.add.message(lt.serverError),i()},onFailure:function(){p.add.message(lt.serverError),i()},onSuccess:function(n){p.remove.message(),p.setup.menu({values:n[si.remoteValues]}),i()}};d.api("get request")||p.setup.api(),r=n.extend(!0,{},r,w.apiSettings),d.api("setting",r).api("query")},filterItems:function(t){var r=void 0!==t?t:p.get.query(),i=null,f=p.escape.string(r),u=new RegExp("^"+f,"igm");p.has.query()&&(i=[],p.verbose("Searching for matching values",r),tt.each(function(){var t,f,e=n(this);return("both"==w.match||"text"==w.match)&&((t=String(p.get.choiceText(e,!1)),-1!==t.search(u))||"exact"===w.fullTextSearch&&p.exactSearch(r,t)||!0===w.fullTextSearch&&p.fuzzySearch(r,t))?(i.push(this),!0):("both"==w.match||"value"==w.match)&&((f=String(p.get.choiceValue(e,t)),-1!==f.search(u))||"exact"===w.fullTextSearch&&p.exactSearch(r,f)||!0===w.fullTextSearch&&p.fuzzySearch(r,f))?(i.push(this),!0):void 0})),p.debug("Showing only matched items",r),p.remove.filteredItem(),i&&tt.not(i).addClass(b.filtered)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(n=n.toLowerCase(),t=t.toLowerCase(),u>r)return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},exactSearch:function(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),t.indexOf(n)>-1},filterActive:function(){w.useLabels&&tt.filter("."+b.active).addClass(b.filtered)},focusSearch:function(n){p.has.search()&&!p.is.focusedOnSearch()&&(n?(d.off("focus"+nt,k.search),ut.focus(),d.on("focus"+nt,k.search,p.event.search.focus)):ut.focus())},forceSelection:function(){var t=tt.not(b.filtered).filter("."+b.selected).eq(0),i=tt.not(b.filtered).filter("."+b.active).eq(0),n=t.length>0?t:i;if(n.length>0&&!p.is.multiple())return p.debug("Forcing partial selection to selected item",n),void p.event.item.click.call(n,{},!0);w.allowAdditions?(p.set.selected(p.get.query()),p.remove.searchTerm()):p.remove.searchTerm()},event:{change:function(){fi||(p.debug("Input changed, updating selection"),p.set.selected())},focus:function(){w.showOnFocus&&!vt&&p.is.hidden()&&!yt&&p.show()},blur:function(){yt=i.activeElement===this,vt||yt||(p.remove.activeLabel(),p.hide())},mousedown:function(){p.is.searchSelection()?bt=!0:vt=!0},mouseup:function(){p.is.searchSelection()?bt=!1:vt=!1},click:function(t){n(t.target).is(d)&&(p.is.focusedOnSearch()?p.show():p.focusSearch())},search:{focus:function(){vt=!0,p.is.multiple()&&p.remove.activeLabel(),w.showOnFocus&&p.search()},blur:function(){yt=i.activeElement===this,p.is.searchSelection()&&!bt&&(ui||yt||(w.forceSelection&&p.forceSelection(),p.hide())),bt=!1}},icon:{click:function(){p.toggle()}},text:{focus:function(){vt=!0,p.focusSearch()}},input:function(){(p.is.multiple()||p.is.searchSelection())&&p.set.filtered(),clearTimeout(p.timer),p.timer=setTimeout(p.search,w.delay.search)},label:{click:function(t){var i=n(this),u=d.find(k.label),r=u.filter("."+b.active),f=i.nextAll("."+b.active),e=i.prevAll("."+b.active),o=f.length>0?i.nextUntil(f).add(r).add(i):i.prevUntil(e).add(r).add(i);t.shiftKey?(r.removeClass(b.active),o.addClass(b.active)):t.ctrlKey?i.toggleClass(b.active):(r.removeClass(b.active),i.addClass(b.active)),w.onLabelSelect.apply(this,u.filter("."+b.active))}},remove:{click:function(){var t=n(this).parent();t.hasClass(b.active)?p.remove.activeLabels():p.remove.activeLabels(t)}},test:{toggle:function(n){var t=p.is.multiple()?p.show:p.toggle;p.is.bubbledLabelClick(n)||p.is.bubbledIconClick(n)||p.determine.eventOnElement(n,t)&&n.preventDefault()},touch:function(n){p.determine.eventOnElement(n,function(){"touchstart"==n.type?p.timer=setTimeout(function(){p.hide()},w.delay.touch):"touchmove"==n.type&&clearTimeout(p.timer)}),n.stopPropagation()},hide:function(n){p.determine.eventInModule(n,p.hide)}},select:{mutation:function(){p.debug("<select> modified, recreating menu"),p.setup.select()}},menu:{mutation:function(t){var i=t[0],u=n(i.addedNodes?i.addedNodes[0]:!1),f=n(i.removedNodes?i.removedNodes[0]:!1),r=u.add(f),e=r.is(k.addition)||r.closest(k.addition).length>0,o=r.is(k.message)||r.closest(k.message).length>0;e||o?(p.debug("Updating item selector cache"),p.refreshItems()):(p.debug("Menu modified, updating selector cache"),p.refresh())},mousedown:function(){ui=!0},mouseup:function(){ui=!1}},item:{mouseenter:function(t){var u=n(t.target),r=n(this),i=r.children(k.menu),f=r.siblings(k.item).children(k.menu),e=i.length>0;!(i.find(u).length>0)&&e&&(clearTimeout(p.itemTimer),p.itemTimer=setTimeout(function(){p.verbose("Showing sub-menu",i),n.each(f,function(){p.animate.hide(!1,n(this))}),p.animate.show(!1,i)},w.delay.show),t.preventDefault())},mouseleave:function(){var i=n(this).children(k.menu);i.length>0&&(clearTimeout(p.itemTimer),p.itemTimer=setTimeout(function(){p.verbose("Hiding sub-menu",i),p.animate.hide(!1,i)},w.delay.hide))},click:function(t,r){var u=n(this),o=n(t?t.target:""),f=u.find(k.menu),e=p.get.choiceText(u),s=p.get.choiceValue(u,e),h=f.length>0,c=f.find(o).length>0;p.has.menuSearch()&&n(i.activeElement).blur(),c||h&&!w.allowCategorySelection||(p.is.searchSelection()&&(w.allowAdditions&&p.remove.userAddition(),p.remove.searchTerm(),p.is.focusedOnSearch()||1==r||p.focusSearch(!0)),w.useLabels||(p.remove.filteredItem(),p.set.scrollPosition(u)),p.determine.selectAction.call(this,e,s))}},document:{keydown:function(n){var u=n.which;if(p.is.inObject(u,ft)){var i=d.find(k.label),t=i.filter("."+b.active),o=(t.data(it.value),i.index(t)),a=i.length,r=t.length>0,s=t.length>1,v=0===o,h=o+1==a,e=p.is.searchSelection(),f=p.is.focusedOnSearch(),c=p.is.focused(),l=f&&0===p.get.caretPosition();if(e&&!r&&!f)return;u==ft.leftArrow?!c&&!l||r?r&&(n.shiftKey?p.verbose("Adding previous label to selection"):(p.verbose("Selecting previous label"),i.removeClass(b.active)),v&&!s?t.addClass(b.active):t.prev(k.siblingLabel).addClass(b.active).end(),n.preventDefault()):(p.verbose("Selecting previous label"),i.last().addClass(b.active)):u==ft.rightArrow?(c&&!r&&i.first().addClass(b.active),r&&(n.shiftKey?p.verbose("Adding next label to selection"):(p.verbose("Selecting next label"),i.removeClass(b.active)),h?e?f?i.removeClass(b.active):p.focusSearch():s?t.next(k.siblingLabel).addClass(b.active):t.addClass(b.active):t.next(k.siblingLabel).addClass(b.active),n.preventDefault())):u==ft.deleteKey||u==ft.backspace?r?(p.verbose("Removing active labels"),h&&e&&!f&&p.focusSearch(),t.last().next(k.siblingLabel).addClass(b.active),p.remove.activeLabels(t),n.preventDefault()):l&&!r&&u==ft.backspace&&(p.verbose("Removing last label on input backspace"),t=i.last().addClass(b.active),p.remove.activeLabels(t)):t.removeClass(b.active)}}},keydown:function(n){var t=n.which;if(p.is.inObject(t,ft)){var r,s=tt.not(k.unselectable).filter("."+b.selected).eq(0),a=g.children("."+b.active).eq(0),i=s.length>0?s:a,v=i.length>0?i.siblings(":not(."+b.filtered+")").addBack():g.children(":not(."+b.filtered+")"),e=i.children(k.menu),u=i.closest(k.menu),h=u.hasClass(b.visible)||u.hasClass(b.animating)||u.parent(k.menu).length>0,c=e.length>0,f=i.length>0,l=i.not(k.unselectable).length>0,o=t==ft.delimiter&&w.allowAdditions&&p.is.multiple(),y=w.allowAdditions&&w.hideAdditions&&(t==ft.enter||o)&&l;if(y&&(p.verbose("Selecting item from keyboard shortcut",i),p.event.item.click.call(i,n),p.is.searchSelection()&&p.remove.searchTerm()),p.is.visible()){if((t==ft.enter||o)&&(t==ft.enter&&f&&c&&!w.allowCategorySelection?(p.verbose("Pressed enter on unselectable category, opening sub menu"),t=ft.rightArrow):l&&(p.verbose("Selecting item from keyboard shortcut",i),p.event.item.click.call(i,n),p.is.searchSelection()&&p.remove.searchTerm()),n.preventDefault()),f&&(t==ft.leftArrow&&u[0]!==g[0]&&(p.verbose("Left key pressed, closing sub-menu"),p.animate.hide(!1,u),i.removeClass(b.selected),u.closest(k.item).addClass(b.selected),n.preventDefault()),t==ft.rightArrow&&c&&(p.verbose("Right key pressed, opening sub-menu"),p.animate.show(!1,e),i.removeClass(b.selected),e.find(k.item).eq(0).addClass(b.selected),n.preventDefault())),t==ft.upArrow){if(r=f&&h?i.prevAll(k.item+":not("+k.unselectable+")").eq(0):tt.eq(0),v.index(r)<0)return p.verbose("Up key pressed but reached top of current menu"),void n.preventDefault();p.verbose("Up key pressed, changing active item"),i.removeClass(b.selected),r.addClass(b.selected),p.set.scrollPosition(r),w.selectOnKeydown&&p.is.single()&&p.set.selectedItem(r),n.preventDefault()}if(t==ft.downArrow){if(r=f&&h?r=i.nextAll(k.item+":not("+k.unselectable+")").eq(0):tt.eq(0),0===r.length)return p.verbose("Down key pressed but reached bottom of current menu"),void n.preventDefault();p.verbose("Down key pressed, changing active item"),tt.removeClass(b.selected),r.addClass(b.selected),p.set.scrollPosition(r),w.selectOnKeydown&&p.is.single()&&p.set.selectedItem(r),n.preventDefault()}t==ft.pageUp&&(p.scrollPage("up"),n.preventDefault()),t==ft.pageDown&&(p.scrollPage("down"),n.preventDefault()),t==ft.escape&&(p.verbose("Escape key pressed, closing dropdown"),p.hide())}else o&&n.preventDefault(),t!=ft.downArrow||p.is.visible()||(p.verbose("Down key pressed, showing dropdown"),p.select.firstUnfiltered(),p.show(),n.preventDefault())}else p.has.search()||p.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=rt[0];t&&(p.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},determine:{selectAction:function(t,i){p.verbose("Determining action",w.action),n.isFunction(p.action[w.action])?(p.verbose("Triggering preset action",w.action,t,i),p.action[w.action].call(et,t,i,this)):n.isFunction(w.action)?(p.verbose("Triggering user action",w.action,t,i),w.action.call(et,t,i,this)):p.error(st.action,w.action)},eventInModule:function(t,r){var u=n(t.target),f=u.closest(i.documentElement).length>0,e=u.closest(d).length>0;return r=n.isFunction(r)?r:function(){},f&&!e?(p.verbose("Triggering event",r),r(),!0):(p.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,r){var u=n(t.target),f=u.closest(k.siblingLabel),e=i.body.contains(t.target),o=0===d.find(f).length,s=0===u.closest(g).length;return r=n.isFunction(r)?r:function(){},e&&o&&s?(p.verbose("Triggering event",r),r(),!0):(p.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,i,r){if(i=void 0!==i?i:t,p.can.activate(n(r))){if(p.set.selected(i,n(r)),p.is.multiple()&&!p.is.allFiltered())return;p.hideAndClear()}},select:function(t,i,r){if(i=void 0!==i?i:t,p.can.activate(n(r))){if(p.set.value(i,n(r)),p.is.multiple()&&!p.is.allFiltered())return;p.hideAndClear()}},combo:function(t,i,r){i=void 0!==i?i:t,p.set.selected(i,n(r)),p.hideAndClear()},hide:function(n,t){p.set.value(t,n),p.hideAndClear()}},get:{id:function(){return gt},defaultText:function(){return d.data(it.defaultText)},defaultValue:function(){return d.data(it.defaultValue)},placeholderText:function(){return d.data(it.placeholderText)||""},text:function(){return ot.text()},query:function(){return n.trim(ut.val())},searchWidth:function(n){return n=void 0!==n?n:ut.val(),kt.text(n),Math.ceil(kt.width()+1)},selectionCount:function(){var t=p.get.values();return p.is.multiple()?n.isArray(t)?t.length:0:""!==p.get.value()?1:0},transition:function(n){return"auto"==w.transition?p.is.upward(n)?"slide up":"slide down":w.transition},userValues:function(){var t=p.get.values();return!!t&&(t=n.isArray(t)?t:[t],n.grep(t,function(n){return!1===p.get.item(n)}))},uniqueArray:function(t){return n.grep(t,function(i,r){return n.inArray(i,t)===r})},caretPosition:function(){var n,r,t=ut.get(0);return"selectionStart"in t?t.selectionStart:i.selection?(t.focus(),n=i.selection.createRange(),r=n.text.length,n.moveStart("character",-t.value.length),n.text.length-r):void 0},value:function(){var t=rt.length>0?rt.val():d.data(it.value),i=n.isArray(t)&&1===t.length&&""===t[0];return void 0===t||i?"":t},values:function(){var n=p.get.value();return""===n?"":!p.has.selectInput()&&p.is.multiple()?"string"==typeof n?n.split(w.delimiter):"":n},remoteValues:function(){var t=p.get.values(),i=!1;return t&&("string"==typeof t&&(t=[t]),n.each(t,function(n,t){var r=p.read.remoteData(t);p.verbose("Restoring value from session data",r,t),r&&(i||(i={}),i[t]=r)})),i},choiceText:function(t,i){if(i=void 0!==i?i:w.preserveHTML,t)return t.find(k.menu).length>0&&(p.verbose("Retrieving text of element with sub-menu"),t=t.clone(),t.find(k.menu).remove(),t.find(k.menuIcon).remove()),void 0!==t.data(it.text)?t.data(it.text):i?n.trim(t.html()):n.trim(t.text())},choiceValue:function(t,i){return i=i||p.get.choiceText(t),!!t&&(void 0!==t.data(it.value)?String(t.data(it.value)):"string"==typeof i?n.trim(i.toLowerCase()):String(i))},inputEvent:function(){var n=ut[0];return!!n&&(void 0!==n.oninput?"input":void 0!==n.onpropertychange?"propertychange":"keyup")},selectValues:function(){var t={};return t.values=[],d.find("option").each(function(){var i=n(this),r=i.html(),f=i.attr("disabled"),u=void 0!==i.attr("value")?i.attr("value"):r;"auto"===w.placeholder&&""===u?t.placeholder=r:t.values.push({name:r,value:u,disabled:f})}),w.placeholder&&"auto"!==w.placeholder&&(p.debug("Setting placeholder value to",w.placeholder),t.placeholder=w.placeholder),w.sortSelect?(t.values.sort(function(n,t){return n.name>t.name?1:-1}),p.debug("Retrieved and sorted values from select",t)):p.debug("Retrieved values from select",t),t},activeItem:function(){return tt.filter("."+b.active)},selectedItem:function(){var n=tt.not(k.unselectable).filter("."+b.selected);return n.length>0?n:tt.eq(0)},itemWithAdditions:function(n){var t=p.get.item(n),i=p.create.userChoice(n);return i&&i.length>0&&(t=t.length>0?t.add(i):i),t},item:function(t,i){var f,u,r=!1;return t=void 0!==t?t:void 0!==p.get.values()?p.get.values():p.get.text(),f=u?t.length>0:void 0!==t&&null!==t,u=p.is.multiple()&&n.isArray(t),i=""===t||0===t||i||!1,f&&tt.each(function(){var f=n(this),o=p.get.choiceText(f),e=p.get.choiceValue(f,o);if(null!==e&&void 0!==e)if(u)-1===n.inArray(String(e),t)&&-1===n.inArray(o,t)||(r=r?r.add(f):f);else if(i){if(p.verbose("Ambiguous dropdown value using strict type check",f,t),e===t||o===t)return r=f,!0}else if(String(e)==String(t)||o==t)return p.verbose("Found select item by value",e,t),r=f,!0}),r}},check:{maxSelections:function(n){return!w.maxSelections||(n=void 0!==n?n:p.get.selectionCount(),n>=w.maxSelections?(p.debug("Maximum selection count reached"),w.useLabels&&(tt.addClass(b.filtered),p.add.message(lt.maxSelections)),!0):(p.verbose("No longer at maximum selection count"),p.remove.message(),p.remove.filteredItem(),p.is.searchSelection()&&p.filterItems(),!1))}},restore:{defaults:function(){p.clear(),p.restore.defaultText(),p.restore.defaultValue()},defaultText:function(){var n=p.get.defaultText();n===p.get.placeholderText?(p.debug("Restoring default placeholder text",n),p.set.placeholderText(n)):(p.debug("Restoring default text",n),p.set.text(n))},placeholderText:function(){p.set.placeholderText()},defaultValue:function(){var n=p.get.defaultValue();void 0!==n&&(p.debug("Restoring default value",n),""!==n?(p.set.value(n),p.set.selected()):(p.remove.activeItem(),p.remove.selectedItem()))},labels:function(){w.allowAdditions&&(w.useLabels||(p.error(st.labels),w.useLabels=!0),p.debug("Restoring selected values"),p.create.userLabels()),p.check.maxSelections()},selected:function(){p.restore.values(),p.is.multiple()?(p.debug("Restoring previously selected values and labels"),p.restore.labels()):p.debug("Restoring previously selected values")},values:function(){p.set.initialLoad(),w.apiSettings&&w.saveRemoteData&&p.get.remoteValues()?p.restore.remoteValues():p.set.selected(),p.remove.initialLoad()},remoteValues:function(){var t=p.get.remoteValues();p.debug("Recreating selected from session data",t),t&&(p.is.single()?n.each(t,function(n,t){p.set.text(t)}):n.each(t,function(n,t){p.add.label(n,t)}))}},read:{remoteData:function(n){var i;return void 0===t.Storage?void p.error(st.noStorage):void 0!==(i=sessionStorage.getItem(n))&&i}},save:{defaults:function(){p.save.defaultText(),p.save.placeholderText(),p.save.defaultValue()},defaultValue:function(){var n=p.get.value();p.verbose("Saving default value as",n),d.data(it.defaultValue,n)},defaultText:function(){var n=p.get.text();p.verbose("Saving default text as",n),d.data(it.defaultText,n)},placeholderText:function(){var n;!1!==w.placeholder&&ot.hasClass(b.placeholder)&&(n=p.get.text(),p.verbose("Saving placeholder text as",n),d.data(it.placeholderText,n))},remoteData:function(n,i){if(void 0===t.Storage)return void p.error(st.noStorage);p.verbose("Saving remote data to session storage",i,n),sessionStorage.setItem(i,n)}},clear:function(){p.is.multiple()&&w.useLabels?p.remove.labels():(p.remove.activeItem(),p.remove.selectedItem()),p.set.placeholderText(),p.clearValue()},clearValue:function(){p.set.value("")},scrollPage:function(n,t){var h,r,u,f=t||p.get.selectedItem(),e=f.closest(k.menu),l=e.outerHeight(),c=e.scrollTop(),s=tt.eq(0).outerHeight(),o=Math.floor(l/s),a=(e.prop("scrollHeight"),"up"==n?c-s*o:c+s*o),i=tt.not(k.unselectable);u="up"==n?i.index(f)-o:i.index(f)+o,h="up"==n?u>=0:u<i.length,r=h?i.eq(u):"up"==n?i.first():i.last(),r.length>0&&(p.debug("Scrolling page",n,r),f.removeClass(b.selected),r.addClass(b.selected),w.selectOnKeydown&&p.is.single()&&p.set.selectedItem(r),e.scrollTop(a))},set:{filtered:function(){var n=p.is.multiple(),i=p.is.searchSelection(),r=n&&i,t=i?p.get.query():"",u="string"==typeof t&&t.length>0,f=p.get.searchWidth(),e=""!==t;n&&u&&(p.verbose("Adjusting input width",f,w.glyphWidth),ut.css("width",f)),u||r&&e?(p.verbose("Hiding placeholder text"),ot.addClass(b.filtered)):(!n||r&&!e)&&(p.verbose("Showing placeholder text"),ot.removeClass(b.filtered))},empty:function(){d.addClass(b.empty)},loading:function(){d.addClass(b.loading)},placeholderText:function(n){n=n||p.get.placeholderText(),p.debug("Setting placeholder text",n),p.set.text(n),ot.addClass(b.placeholder)},tabbable:function(){p.is.searchSelection()?(p.debug("Added tabindex to searchable dropdown"),ut.val("").attr("tabindex",0),g.attr("tabindex",-1)):(p.debug("Added tabindex to dropdown"),void 0===d.attr("tabindex")&&(d.attr("tabindex",0),g.attr("tabindex",-1)))},initialLoad:function(){p.verbose("Setting initial load"),ri=!0},activeItem:function(n){w.allowAdditions&&n.filter(k.addition).length>0?n.addClass(b.filtered):n.addClass(b.active)},partialSearch:function(n){var t=p.get.query().length;ut.val(n.substr(0,t))},scrollPosition:function(n,t){var i,e,r,f,o,u,s,h,c;n=n||p.get.selectedItem(),i=n.closest(k.menu),e=n&&n.length>0,t=void 0!==t&&t,n&&i.length>0&&e&&(f=n.position().top,i.addClass(b.loading),u=i.scrollTop(),o=i.offset().top,f=n.offset().top,r=u-o+f,t||(s=i.height(),c=u+s<r+5,h=r-5<u),p.debug("Scrolling to active item",r),(t||h||c)&&i.scrollTop(r),i.removeClass(b.loading))},text:function(n){"select"!==w.action&&("combo"==w.action?(p.debug("Changing combo button text",n,wt),w.preserveHTML?wt.html(n):wt.text(n)):(n!==p.get.placeholderText()&&ot.removeClass(b.placeholder),p.debug("Changing text",n,ot),ot.removeClass(b.filtered),w.preserveHTML?ot.html(n):ot.text(n)))},selectedItem:function(n){var t=p.get.choiceValue(n),i=p.get.choiceText(n,!1),r=p.get.choiceText(n,!0);p.debug("Setting user selection to item",n),p.remove.activeItem(),p.set.partialSearch(i),p.set.activeItem(n),p.set.selected(t,n),p.set.text(r)},selectedLetter:function(t){var u,r=tt.filter("."+b.selected),f=r.length>0&&p.has.firstLetter(r,t),i=!1;f&&(u=r.nextAll(tt).eq(0),p.has.firstLetter(u,t)&&(i=u)),i||tt.each(function(){if(p.has.firstLetter(n(this),t))return i=n(this),!1}),i&&(p.verbose("Scrolling to next value with letter",t),p.set.scrollPosition(i),r.removeClass(b.selected),i.addClass(b.selected),w.selectOnKeydown&&p.is.single()&&p.set.selectedItem(i))},direction:function(n){"auto"==w.direction?p.is.onScreen(n)?p.remove.upward(n):p.set.upward(n):"upward"==w.direction&&p.set.upward(n)},upward:function(n){(n||d).addClass(b.upward)},value:function(n,t,i){var r=p.escape.value(n),e=rt.length>0,u=(p.has.value(n),p.get.values()),f=void 0!==n?String(n):n;if(e){if(!w.allowReselection&&f==u&&(p.verbose("Skipping value update already same value",n,u),!p.is.initialLoad()))return;p.is.single()&&p.has.selectInput()&&p.can.extendSelect()&&(p.debug("Adding user option",n),p.add.optionValue(n)),p.debug("Updating input value",r,u),fi=!0,rt.val(r),!1===w.fireOnInit&&p.is.initialLoad()?p.debug("Input native change event ignored on initial load"):p.trigger.change(),fi=!1}else p.verbose("Storing value in metadata",r,rt),r!==u&&d.data(it.value,f);!1===w.fireOnInit&&p.is.initialLoad()?p.verbose("No callback on initial load",w.onChange):w.onChange.call(et,n,t,i)},active:function(){d.addClass(b.active)},multiple:function(){d.addClass(b.multiple)},visible:function(){d.addClass(b.visible)},exactly:function(n,t){p.debug("Setting selected to exact values"),p.clear(),p.set.selected(n,t)},selected:function(t,i){var r=p.is.multiple();(i=w.allowAdditions?i||p.get.itemWithAdditions(t):i||p.get.item(t))&&(p.debug("Setting selected menu item to",i),p.is.multiple()&&p.remove.searchWidth(),p.is.single()?(p.remove.activeItem(),p.remove.selectedItem()):w.useLabels&&p.remove.selectedItem(),i.each(function(){var t=n(this),u=p.get.choiceText(t),f=p.get.choiceValue(t,u),e=t.hasClass(b.filtered),o=t.hasClass(b.active),s=t.hasClass(b.addition),h=r&&1==i.length;r?!o||s?(w.apiSettings&&w.saveRemoteData&&p.save.remoteData(u,f),w.useLabels?(p.add.value(f,u,t),p.add.label(f,u,h),p.set.activeItem(t),p.filterActive(),p.select.nextAvailable(i)):(p.add.value(f,u,t),p.set.text(p.add.variables(lt.count)),p.set.activeItem(t))):e||(p.debug("Selected active value, removing label"),p.remove.selected(f)):(w.apiSettings&&w.saveRemoteData&&p.save.remoteData(u,f),p.set.text(u),p.set.value(f,u,t),t.addClass(b.active).addClass(b.selected))}))}},add:{label:function(t,i,r){var u,e=p.is.searchSelection()?ut:ot,f=p.escape.value(t);if(u=n("<a />").addClass(b.label).attr("data-"+it.value,f).html(ii.label(f,i)),u=w.onLabelCreate.call(u,f,i),p.has.label(t))return void p.debug("Label already exists, skipping",f);w.label.variation&&u.addClass(w.label.variation),!0===r?(p.debug("Animating in label",u),u.addClass(b.hidden).insertBefore(e).transition(w.label.transition,w.label.duration)):(p.debug("Adding selection label",u),u.insertBefore(e))},message:function(t){var i=g.children(k.message),r=w.templates.message(p.add.variables(t));i.length>0?i.html(r):i=n("<div/>").html(r).addClass(b.message).appendTo(g)},optionValue:function(t){var i=p.escape.value(t);rt.find('option[value="'+p.escape.string(i)+'"]').length>0||(p.disconnect.selectObserver(),p.is.single()&&(p.verbose("Removing previous user addition"),rt.find("option."+b.addition).remove()),n("<option/>").prop("value",i).addClass(b.addition).html(t).appendTo(rt),p.verbose("Adding user addition as an <option>",t),p.observe.select())},userSuggestion:function(n){var i,t=g.children(k.addition),r=p.get.item(n),u=r&&r.not(k.addition).length,f=t.length>0;if(!w.useLabels||!p.has.maxSelections()){if(""===n||u)return void t.remove();f?(t.data(it.value,n).data(it.text,n).attr("data-"+it.value,n).attr("data-"+it.text,n).removeClass(b.filtered),w.hideAdditions||(i=w.templates.addition(p.add.variables(lt.addResult,n)),t.html(i)),p.verbose("Replacing user suggestion with new value",t)):(t=p.create.userChoice(n),t.prependTo(g),p.verbose("Adding item choice to menu corresponding with user choice addition",t)),w.hideAdditions&&!p.is.allFiltered()||t.addClass(b.selected).siblings().removeClass(b.selected),p.refreshItems()}},variables:function(n,t){var i,r,u=-1!==n.search("{count}"),f=-1!==n.search("{maxCount}"),e=-1!==n.search("{term}");return p.verbose("Adding templated variables to message",n),u&&(i=p.get.selectionCount(),n=n.replace("{count}",i)),f&&(i=p.get.selectionCount(),n=n.replace("{maxCount}",w.maxSelections)),e&&(r=t||p.get.query(),n=n.replace("{term}",r)),n},value:function(t,i,r){var u,f=p.get.values();if(""===t)return void p.debug("Cannot select blank values from multiselect");n.isArray(f)?(u=f.concat([t]),u=p.get.uniqueArray(u)):u=[t],p.has.selectInput()?p.can.extendSelect()&&(p.debug("Adding value to select",t,u,rt),p.add.optionValue(t)):(u=u.join(w.delimiter),p.debug("Setting hidden input to delimited value",u,rt)),!1===w.fireOnInit&&p.is.initialLoad()?p.verbose("Skipping onadd callback on initial load",w.onAdd):w.onAdd.call(et,t,i,r),p.set.value(u,t,i,r),p.check.maxSelections()}},remove:{active:function(){d.removeClass(b.active)},activeLabel:function(){d.find(k.label).removeClass(b.active)},empty:function(){d.removeClass(b.empty)},loading:function(){d.removeClass(b.loading)},initialLoad:function(){ri=!1},upward:function(n){(n||d).removeClass(b.upward)},visible:function(){d.removeClass(b.visible)},activeItem:function(){tt.removeClass(b.active)},filteredItem:function(){w.useLabels&&p.has.maxSelections()||(w.useLabels&&p.is.multiple()?tt.not("."+b.active).removeClass(b.filtered):tt.removeClass(b.filtered),p.remove.empty())},optionValue:function(n){var i=p.escape.value(n),t=rt.find('option[value="'+p.escape.string(i)+'"]');t.length>0&&t.hasClass(b.addition)&&(ht&&(ht.disconnect(),p.verbose("Temporarily disconnecting mutation observer")),t.remove(),p.verbose("Removing user addition as an <option>",i),ht&&ht.observe(rt[0],{childList:!0,subtree:!0}))},message:function(){g.children(k.message).remove()},searchWidth:function(){ut.css("width","")},searchTerm:function(){p.verbose("Cleared search term"),ut.val(""),p.set.filtered()},userAddition:function(){tt.filter(k.addition).remove()},selected:function(t,i){if(!(i=w.allowAdditions?i||p.get.itemWithAdditions(t):i||p.get.item(t)))return!1;i.each(function(){var t=n(this),i=p.get.choiceText(t),r=p.get.choiceValue(t,i);p.is.multiple()?w.useLabels?(p.remove.value(r,i,t),p.remove.label(r)):(p.remove.value(r,i,t),0===p.get.selectionCount()?p.set.placeholderText():p.set.text(p.add.variables(lt.count))):p.remove.value(r,i,t),t.removeClass(b.filtered).removeClass(b.active),w.useLabels&&t.removeClass(b.selected)})},selectedItem:function(){tt.removeClass(b.selected)},value:function(n,t,i){var r,u=p.get.values();p.has.selectInput()?(p.verbose("Input is <select> removing selected option",n),r=p.remove.arrayValue(n,u),p.remove.optionValue(n)):(p.verbose("Removing from delimited values",n),r=p.remove.arrayValue(n,u),r=r.join(w.delimiter)),!1===w.fireOnInit&&p.is.initialLoad()?p.verbose("No callback on initial load",w.onRemove):w.onRemove.call(et,n,t,i),p.set.value(r,t,i),p.check.maxSelections()},arrayValue:function(t,i){return n.isArray(i)||(i=[i]),i=n.grep(i,function(n){return t!=n}),p.verbose("Removed value from delimited string",t,i),i},label:function(n){var r=d.find(k.label),i=r.filter("[data-"+it.value+'="'+p.escape.string(n)+'"]');p.verbose("Removing label",i),i.remove()},activeLabels:function(n){n=n||d.find(k.label).filter("."+b.active),p.verbose("Removing active label selections",n),p.remove.labels(n)},labels:function(t){t=t||d.find(k.label),p.verbose("Removing labels",t),t.each(function(){var r=n(this),t=r.data(it.value),i=void 0!==t?String(t):t,u=p.is.userValue(i);if(!1===w.onLabelRemove.call(r,t))return void p.debug("Label remove callback cancelled removal");p.remove.message(),u?(p.remove.value(i),p.remove.label(i)):p.remove.selected(i)})},tabbable:function(){p.is.searchSelection()?(p.debug("Searchable dropdown initialized"),ut.removeAttr("tabindex"),g.removeAttr("tabindex")):(p.debug("Simple selection dropdown initialized"),d.removeAttr("tabindex"),g.removeAttr("tabindex"))}},has:{menuSearch:function(){return p.has.search()&&ut.closest(g).length>0},search:function(){return ut.length>0},sizer:function(){return kt.length>0},selectInput:function(){return rt.is("select")},minCharacters:function(n){return!w.minCharacters||(n=void 0!==n?String(n):String(p.get.query()),n.length>=w.minCharacters)},firstLetter:function(n,t){var i,r;return!(!n||0===n.length||"string"!=typeof t)&&(i=p.get.choiceText(n,!1),t=t.toLowerCase(),r=String(i).charAt(0).toLowerCase(),t==r)},input:function(){return rt.length>0},items:function(){return tt.length>0},menu:function(){return g.length>0},message:function(){return 0!==g.children(k.message).length},label:function(n){var t=p.escape.value(n);return d.find(k.label).filter("[data-"+it.value+'="'+p.escape.string(t)+'"]').length>0},maxSelections:function(){return w.maxSelections&&p.get.selectionCount()>=w.maxSelections},allResultsFiltered:function(){var n=tt.not(k.addition);return n.filter(k.unselectable).length===n.length},userSuggestion:function(){return g.children(k.addition).length>0},query:function(){return""!==p.get.query()},value:function(t){var i=p.get.values();return!!(n.isArray(i)?i&&-1!==n.inArray(t,i):i==t)}},is:{active:function(){return d.hasClass(b.active)},bubbledLabelClick:function(t){return n(t.target).is("select, input")&&d.closest("label").length>0},bubbledIconClick:function(t){return n(t.target).closest(oi).length>0},alreadySetup:function(){return d.is("select")&&d.parent(k.dropdown).length>0&&0===d.prev().length},animating:function(n){return n?n.transition&&n.transition("is animating"):g.transition&&g.transition("is animating")},disabled:function(){return d.hasClass(b.disabled)},focused:function(){return i.activeElement===d[0]},focusedOnSearch:function(){return i.activeElement===ut[0]},allFiltered:function(){return(p.is.multiple()||p.has.search())&&!(0==w.hideAdditions&&p.has.userSuggestion())&&!p.has.message()&&p.has.allResultsFiltered()},hidden:function(n){return!p.is.visible(n)},initialLoad:function(){return ri},onScreen:function(n){var t,r=n||g,u=!0,i={};return r.addClass(b.loading),t={context:{scrollTop:dt.scrollTop(),height:dt.outerHeight()},menu:{offset:r.offset(),height:r.outerHeight()}},p.is.verticallyScrollableContext()&&(t.menu.offset.top+=t.context.scrollTop),i={above:t.context.scrollTop<=t.menu.offset.top-t.menu.height,below:t.context.scrollTop+t.context.height>=t.menu.offset.top+t.menu.height},i.below?(p.verbose("Dropdown can fit in context downward",i),u=!0):i.below||i.above?(p.verbose("Dropdown cannot fit below, opening upward",i),u=!1):(p.verbose("Dropdown cannot fit in either direction, favoring downward",i),u=!0),r.removeClass(b.loading),u},inObject:function(t,i){var r=!1;return n.each(i,function(n,i){if(i==t)return r=!0,!0}),r},multiple:function(){return d.hasClass(b.multiple)},remote:function(){return w.apiSettings&&p.can.useAPI()},single:function(){return!p.is.multiple()},selectMutation:function(t){var i=!1;return n.each(t,function(t,r){if(r.target&&n(r.target).is("select"))return i=!0,!0}),i},search:function(){return d.hasClass(b.search)},searchSelection:function(){return p.has.search()&&1===ut.parent(k.dropdown).length},selection:function(){return d.hasClass(b.selection)},userValue:function(t){return-1!==n.inArray(t,p.get.userValues())},upward:function(n){return(n||d).hasClass(b.upward)},visible:function(n){return n?n.hasClass(b.visible):g.hasClass(b.visible)},verticallyScrollableContext:function(){var n=dt.get(0)!==t&&dt.css("overflow-y");return"auto"==n||"scroll"==n}},can:{activate:function(n){return!!w.useLabels||!p.has.maxSelections()||!(!p.has.maxSelections()||!n.hasClass(b.active))},click:function(){return s||"click"==w.on},extendSelect:function(){return w.allowAdditions||w.apiSettings},show:function(){return!p.is.disabled()&&(p.has.items()||p.has.message())},useAPI:function(){return void 0!==n.fn.api}},animate:{show:function(t,i){var u,r=i||g,f=i?function(){}:function(){p.hideSubMenus(),p.hideOthers(),p.set.active()};t=n.isFunction(t)?t:function(){},p.verbose("Doing menu show animation",r),p.set.direction(i),u=p.get.transition(i),p.is.selection()&&p.set.scrollPosition(p.get.selectedItem(),!0),(p.is.hidden(r)||p.is.animating(r))&&("none"==u?(f(),r.transition("show"),t.call(et)):void 0!==n.fn.transition&&d.transition("is supported")?r.transition({animation:u+" in",debug:w.debug,verbose:w.verbose,duration:w.duration,queue:!0,onStart:f,onComplete:function(){t.call(et)}}):p.error(st.noTransition,u))},hide:function(t,i){var r=i||g,u=(i?w.duration:w.duration,i?function(){}:function(){p.can.click()&&p.unbind.intent(),p.remove.active()}),f=p.get.transition(i);t=n.isFunction(t)?t:function(){},(p.is.visible(r)||p.is.animating(r))&&(p.verbose("Doing menu hide animation",r),"none"==f?(u(),r.transition("hide"),t.call(et)):void 0!==n.fn.transition&&d.transition("is supported")?r.transition({animation:f+" out",duration:w.duration,debug:w.debug,verbose:w.verbose,queue:!0,onStart:u,onComplete:function(){"auto"==w.direction&&p.remove.upward(i),t.call(et)}}):p.error(st.transition))}},hideAndClear:function(){p.remove.searchTerm(),p.has.maxSelections()||(p.has.search()?p.hide(function(){p.remove.filteredItem()}):p.hide())},delay:{show:function(){p.verbose("Delaying show event to ensure user intent"),clearTimeout(p.timer),p.timer=setTimeout(p.show,w.delay.show)},hide:function(){p.verbose("Delaying hide event to ensure user intent"),clearTimeout(p.timer),p.timer=setTimeout(p.hide,w.delay.hide)}},escape:{value:function(t){var i=n.isArray(t),r="string"==typeof t,f=!r&&!i,e=r&&-1!==t.search(ni.quote),u=[];return f||!e?t:(p.debug("Encoding quote values for use in select",t),i?(n.each(t,function(n,t){u.push(t.replace(ni.quote,"&quot;"))}),u):t.replace(ni.quote,"&quot;"))},string:function(n){return n=String(n),n.replace(ni.escape,"\\$&")}},setting:function(t,i){if(p.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,w,t);else{if(void 0===i)return w[t];n.isPlainObject(w[t])?n.extend(!0,w[t],i):w[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,p,t);else{if(void 0===i)return p[t];p[t]=i}},debug:function(){!w.silent&&w.debug&&(w.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,w.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!w.silent&&w.verbose&&w.debug&&(w.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),p.verbose.apply(console,arguments)))},error:function(){w.silent||(p.error=Function.prototype.bind.call(console.error,console,w.name+":"),p.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;w.performance&&(t=+new Date,r=h||t,i=t-r,h=t,o.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:et,"Execution Time":i})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var t=w.name+":",i=0;h=!1,clearTimeout(p.performance.timer),n.each(o,function(n,t){i+=t["Execution Time"]}),t+=" "+i+"ms",l&&(t+=" '"+l+"'"),(void 0!==console.group||void 0!==console.table)&&o.length>0&&(console.groupCollapsed(t),console.table?console.table(o):n.each(o,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),o=[]}},invoke:function(t,i,r){var s,e,o,f=at;return i=i||v,r=et||r,"string"==typeof t&&void 0!==f&&(t=t.split(/[\. ]/),s=t.length-1,n.each(t,function(i,r){var u=i!=s?r+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[u])&&i!=s)f=f[u];else{if(void 0!==f[u])return e=f[u],!1;if(!n.isPlainObject(f[r])||i==s)return void 0!==f[r]?(e=f[r],!1):(p.error(st.method,t),!1);f=f[r]}})),n.isFunction(e)?o=e.apply(r,i):void 0!==e&&(o=e),n.isArray(u)?u.push(o):void 0!==u?u=[u,o]:void 0!==o&&(u=o),e}},a?(void 0===at&&p.initialize(),p.invoke(c)):(void 0!==at&&at.invoke("destroy"),p.initialize())}),void 0!==u?u:f},n.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(){},onAdd:function(){},onRemove:function(){},onLabelSelect:function(){},onLabelCreate:function(){return n(this)},onLabelRemove:function(){return!0},onNoResults:function(){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",value:"value",text:"text"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},n.fn.dropdown.settings.templates={dropdown:function(t){var r=t.placeholder||!1,i=(t.values,"");return i+='<i class="dropdown icon"></i>',i+=t.placeholder?'<div class="default text">'+r+"</div>":'<div class="text"></div>',i+='<div class="menu">',n.each(t.values,function(n,t){i+=t.disabled?'<div class="disabled item" data-value="'+t.value+'">'+t.name+"</div>":'<div class="item" data-value="'+t.value+'">'+t.name+"</div>"}),i+="</div>"},menu:function(t,i){var u=t[i.values]||{},r="";return n.each(u,function(n,t){var u=t[i.text]?'data-text="'+t[i.text]+'"':"",f=t[i.disabled]?"disabled ":"";r+='<div class="'+f+'item" data-value="'+t[i.value]+'"'+u+">",r+=t[i.name],r+="</div>"}),r},label:function(n,t){return t+'<i class="delete icon"></i>'},message:function(n){return n},addition:function(n){return n}}}(jQuery,window,document)