",{class:a.actions+" "+(l.classActions||"")}).appendTo(v):s.empty(),l.actions.forEach(function(e){var t=e[d.icon]?"':"",n=P.helpers.escape(e[d.text]||"",l.preserveHTML),i=P.helpers.deQuote(e[d.class]||""),o=e[d.click]&&X(e[d.click])?e[d.click]:function(){};s.append(Q("",{html:t+n,"aria-label":(e[d.text]||e[d.icon]||"").replace(/<[^>]+(>|$)/g,""),class:a.button+" "+i,on:{click:function(){!1!==o.call(S,v)&&P.hide()}}}))})),l.delaySetup?requestAnimationFrame(P.setup.layout):P.setup.layout(),requestAnimationFrame(function(){P.setup.cache()}),"left"!==P.get.direction()&&"right"!==P.get.direction()||(P.setup.heights(),P.bind.resize()),P.bind.events(),P.observeChanges(),P.instantiate(),l.autoShow&&P.show()},instantiate:function(){P.verbose("Storing instance of module",P),A=P,v.data(p,A)},create:{flyout:function(){var e;P.verbose("Programmaticaly create flyout",b),v=Q("",{class:a.flyout,role:"dialog","aria-modal":l.dimPage}),l.closeIcon&&(m=Q("",{class:a.close,role:"button",tabindex:0,"aria-label":l.text.close}),v.append(m)),""!==l.title&&(e="_"+P.get.id()+"title",v.attr("aria-labelledby",e),Q("",{class:a.header,id:e}).appendTo(v)),""!==l.content&&(e="_"+P.get.id()+"desc",v.attr("aria-describedby",e),Q("",{class:a.content,id:e}).appendTo(v)),P.has.configActions()&&Q("",{class:a.actions}).appendTo(v),v.prependTo(b),S=v[0]},id:function(){t=(Math.random().toString(16)+"000000000").slice(2,10),s="."+t,P.verbose("Creating unique id for element",t)}},destroy:function(){i&&i.disconnect(),P.verbose("Destroying previous module for",v),v.off(g).removeData(p),m.off(s),n&&n.off(s),b.off(s),N.off(s),L.off(s)},event:{keyboard:function(e){e.which===l.keys.escape&&(l.closable?(P.debug("Escape key pressed hiding flyout"),P.hide()):P.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){P.setup.heights()},focus:function(){H=!0},click:function(e){H&&U.activeElement!==e.target&&P.is.visible()&&l.autofocus&&l.dimPage&&0===Q(U.activeElement).closest(c.flyout).length&&requestAnimationFrame(P.set.autofocus),H=!1},clickaway:function(e){var t;l.closable&&(t=0=S.scrollHeight&&(S.scrollTop=S.scrollHeight-S.offsetHeight-1)},scroll:function(e){0===Q(e.target).closest(c.flyout).length&&e.preventDefault()}},bind:{resize:function(){P.verbose("Adding resize event to window",N),N.on("resize"+s,P.event.resize)},events:function(){P.verbose("Attaching events"),v.on("click"+g,c.close,P.event.close).on("click"+g,c.approve,P.event.approve).on("click"+g,c.deny,P.event.deny),m.on("keyup"+s,P.event.closeKeyUp),N.on("focus"+s,P.event.focus),b.on("click"+s,P.event.click)},clickaway:function(){P.verbose("Adding clickaway events to context",b),b.on("click"+s,P.event.clickaway).on("touchend"+s,P.event.clickaway)},scrollLock:function(){l.scrollLock&&(P.debug("Disabling page scroll"),(E=P.has.scrollbar())&&(P.save.bodyMargin(),P.set.bodyMargin()),b.addClass(a.locked)),P.verbose("Adding events to contain flyout scroll"),L.on("touchmove"+s,P.event.touch),v.on("scroll"+g,P.event.containScroll)}},unbind:{clickaway:function(){P.verbose("Removing clickaway events from context",b),b.off(s)},scrollLock:function(){P.verbose("Removing scroll lock from page"),E&&P.restore.bodyMargin(),b.removeClass(a.locked),L.off(s),v.off("scroll"+g)}},add:{inlineCSS:function(){var e=P.cache.width||v.outerWidth(),t=P.cache.height||v.outerHeight(),n=P.is.rtl(),i=P.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(P.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="").appendTo(B),P.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){P.verbose("Adding keyboard shortcuts"),L.on("keydown"+g,P.event.keyboard)}},observeChanges:function(){"MutationObserver"in W&&((i=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n'),b.children().not(c.omitted).not(y).wrapAll(k),P.refresh()),0!==v.nextAll(c.pusher).length&&v.nextAll(c.pusher)[0]===k[0]||(P.debug("Moved flyout to correct parent element"),P.error(h.movedFlyout,S),v.detach().prependTo(b),P.refresh()),P.is.mobile()&&v.addClass(a.fullscreen),P.clear.cache(),P.set.pushable(),P.set.direction()},heights:function(){P.debug("Setting up heights",v);var e=v.children(c.header),t=v.children(c.content),n=v.children(c.actions),e=(b.height()||0)-(e.outerHeight()||0)-(n.outerHeight()||0);0":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},setting:function(e,t){if(P.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,l,e);else{if(void 0===t)return l[e];Q.isPlainObject(l[e])?Q.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,P,e);else{if(void 0===t)return P[e];P[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?P.performance.log(arguments):(P.debug=Function.prototype.bind.call(console.info,console,l.name+":"),P.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?P.performance.log(arguments):(P.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),P.verbose.apply(console,arguments)))},error:function(){l.silent||(P.error=Function.prototype.bind.call(console.error,console,l.name+":"),P.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=Date.now())-(I||t),I=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(function(){P.performance.display()},500)},display:function(){var e=l.name+":",n=0;I=!1,clearTimeout(P.performance.timer),Q.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0 .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",flyout:".ui.flyout",header:".ui.header",content:".content",actions:".actions",close:".close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},regExp:{mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedFlyout:"Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag",notFound:"There were no elements that matched the specified selector"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.extend({handler:function(){},content:"",title:""},e[0]):(X(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);return 0===Q(Q.parseHTML(n.content)).filter(".ui.input").length&&(n.content+=''),{title:n.title,content:n.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(Q(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document);