!function(N,V,W,M){"use strict";V=void 0!==V&&V.Math==Math?V:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),N.fn.popup=function(x){var k,t=N(this),E=N(W),S=N(V),A=N("body"),F=t.selector||"",O=(new Date).getTime(),D=[],j=x,H="string"==typeof j,R=[].slice.call(arguments,1);return t.each(function(){var u,p,t,e,o,c=N.isPlainObject(x)?N.extend(!0,{},N.fn.popup.settings,x):N.extend({},N.fn.popup.settings),i=c.selector,d=c.className,f=c.error,g=c.metadata,n=c.namespace,r="."+c.namespace,a="module-"+n,h=N(this),s=N(c.context),l=N(c.scrollContext),m=N(c.boundary),v=c.target?N(c.target):h,b=0,w=!1,y=!1,P=this,C=h.data(a),T={initialize:function(){T.debug("Initializing",h),T.createID(),T.bind.events(),!T.exists()&&c.preserve&&T.create(),c.observeChanges&&T.observeChanges(),T.instantiate()},instantiate:function(){T.verbose("Storing instance",T),C=T,h.data(a,C)},observeChanges:function(){"MutationObserver"in V&&((t=new MutationObserver(T.event.documentChanged)).observe(W,{childList:!0,subtree:!0}),T.debug("Setting up mutation observer",t))},refresh:function(){c.popup?u=N(c.popup).eq(0):c.inline&&(u=v.nextAll(i.popup).eq(0),c.popup=u),c.popup?(u.addClass(d.loading),p=T.get.offsetParent(),u.removeClass(d.loading),c.movePopup&&T.has.popup()&&T.get.offsetParent(u)[0]!==p[0]&&(T.debug("Moving popup to the same offset parent as target"),u.detach().appendTo(p))):p=c.inline?T.get.offsetParent(v):T.has.popup()?T.get.offsetParent(u):A,p.is("html")&&p[0]!==A[0]&&(T.debug("Setting page as offset parent"),p=A),T.get.variation()&&T.set.variation()},reposition:function(){T.refresh(),T.set.position()},destroy:function(){T.debug("Destroying previous module"),t&&t.disconnect(),u&&!c.preserve&&T.removePopup(),clearTimeout(T.hideTimer),clearTimeout(T.showTimer),T.unbind.close(),T.unbind.events(),h.removeData(a)},event:{start:function(t){var e=N.isPlainObject(c.delay)?c.delay.show:c.delay;clearTimeout(T.hideTimer),y||(T.showTimer=setTimeout(T.show,e))},end:function(){var t=N.isPlainObject(c.delay)?c.delay.hide:c.delay;clearTimeout(T.showTimer),T.hideTimer=setTimeout(T.hide,t)},touchstart:function(t){y=!0,T.show()},resize:function(){T.is.visible()&&T.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==P||0").addClass(d.popup).data(g.activator,h).html(t),c.inline?(T.verbose("Inserting popup element inline",u),u.insertAfter(h)):(T.verbose("Appending popup element to body",u),u.appendTo(s)),T.refresh(),T.set.variation(),c.hoverable&&T.bind.popup(),c.onCreate.call(u,P)):0!==v.next(i.popup).length?(T.verbose("Pre-existing popup found"),c.inline=!0,c.popup=v.next(i.popup).data(g.activator,h),T.refresh(),c.hoverable&&T.bind.popup()):c.popup?(N(c.popup).data(g.activator,h),T.verbose("Used popup specified in settings"),T.refresh(),c.hoverable&&T.bind.popup()):T.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").substr(2,8),e="."+o,T.verbose("Creating unique id for element",o)},toggle:function(){T.debug("Toggling pop-up"),T.is.hidden()?(T.debug("Popup is hidden, showing pop-up"),T.unbind.close(),T.show()):(T.debug("Popup is visible, hiding pop-up"),T.hide())},show:function(t){if(t=t||function(){},T.debug("Showing pop-up",c.transition),T.is.hidden()&&(!T.is.active()||!T.is.dropdown())){if(T.exists()||T.create(),!1===c.onShow.call(u,P))return void T.debug("onShow callback returned false, cancelling popup animation");c.preserve||c.popup||T.refresh(),u&&T.set.position()&&(T.save.conditions(),c.exclusive&&T.hideAll(),T.animate.show(t))}},hide:function(t){if(t=t||function(){},T.is.visible()||T.is.animating()){if(!1===c.onHide.call(u,P))return void T.debug("onHide callback returned false, cancelling popup animation");T.remove.visible(),T.unbind.close(),T.restore.conditions(),T.animate.hide(t)}},hideAll:function(){N(i.popup).filter("."+d.popupVisible).each(function(){N(this).data(g.activator).popup("hide")})},exists:function(){return!!u&&(c.inline||c.popup?T.has.popup():1<=u.closest(s).length)},removePopup:function(){T.has.popup()&&!c.popup&&(T.debug("Removing popup",u),u.remove(),u=M,c.onRemove.call(u,P))},save:{conditions:function(){T.cache={title:h.attr("title")},T.cache.title&&h.removeAttr("title"),T.verbose("Saving original attributes",T.cache.title)}},restore:{conditions:function(){return T.cache&&T.cache.title&&(h.attr("title",T.cache.title),T.verbose("Restoring original attributes",T.cache.title)),!0}},supports:{svg:function(){return"undefined"==typeof SVGGraphicsElement}},animate:{show:function(t){t=N.isFunction(t)?t:function(){},c.transition&&N.fn.transition!==M&&h.transition("is supported")?(T.set.visible(),u.transition({animation:c.transition+" in",queue:!1,debug:c.debug,verbose:c.verbose,duration:c.duration,onComplete:function(){T.bind.close(),t.call(u,P),c.onVisible.call(u,P)}})):T.error(f.noTransition)},hide:function(t){t=N.isFunction(t)?t:function(){},T.debug("Hiding pop-up"),!1!==c.onHide.call(u,P)?c.transition&&N.fn.transition!==M&&h.transition("is supported")?u.transition({animation:c.transition+" out",queue:!1,duration:c.duration,debug:c.debug,verbose:c.verbose,onComplete:function(){T.reset(),t.call(u,P),c.onHidden.call(u,P)}}):T.error(f.noTransition):T.debug("onHide callback returned false, cancelling popup animation")}},change:{content:function(t){u.html(t)}},get:{html:function(){return h.removeData(g.html),h.data(g.html)||c.html},title:function(){return h.removeData(g.title),h.data(g.title)||c.title},content:function(){return h.removeData(g.content),h.data(g.content)||c.content||h.attr("title")},variation:function(){return h.removeData(g.variation),h.data(g.variation)||c.variation},popup:function(){return u},popupOffset:function(){return u.offset()},calculations:function(){var t,e,o=T.get.offsetParent(u),n=v[0],i=m[0]==V,r=c.inline||c.popup&&c.movePopup?v.position():v.offset(),a=i?{top:0,left:0}:m.offset(),s={},l=i?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},s={target:{element:v[0],width:v.outerWidth(),height:v.outerHeight(),top:r.top,left:r.left,margin:{}},popup:{width:u.outerWidth(),height:u.outerHeight()},parent:{width:p.outerWidth(),height:p.outerHeight()},screen:{top:a.top,left:a.left,scroll:{top:l.top,left:l.left},width:m.width(),height:m.height()}};return o.get(0)!==p.get(0)&&(e=o.offset(),s.target.top-=e.top,s.target.left-=e.left,s.parent.width=o.outerWidth(),s.parent.height=o.outerHeight()),c.setFluidWidth&&T.is.fluid()&&(s.container={width:u.parent().outerWidth()},s.popup.width=s.container.width),s.target.margin.top=c.inline?parseInt(V.getComputedStyle(n).getPropertyValue("margin-top"),10):0,s.target.margin.left=c.inline?T.is.rtl()?parseInt(V.getComputedStyle(n).getPropertyValue("margin-right"),10):parseInt(V.getComputedStyle(n).getPropertyValue("margin-left"),10):0,t=s.screen,s.boundary={top:t.top+t.scroll.top,bottom:t.top+t.scroll.top+t.height,left:t.left+t.scroll.left,right:t.left+t.scroll.left+t.width},s},id:function(){return o},startEvent:function(){return"hover"==c.on?"mouseenter":"focus"==c.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==c.on?"mouseleave":"focus"==c.on&&"blur"},distanceFromBoundary:function(t,e){var o={},n=(e=e||T.get.calculations()).popup,i=e.boundary;return t&&(o={top:t.top-i.top,left:t.left-i.left,right:i.right-(t.left+n.width),bottom:i.bottom-(t.top+n.height)},T.verbose("Distance from boundaries determined",t,o)),o},offsetParent:function(t){var e=(t!==M?t[0]:v[0]).parentNode,o=N(e);if(e)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");e&&!r&&i&&n;)e=e.parentNode,n="none"===(o=N(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0",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",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(t)?t.replace(/[&<>"'`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=N.fn.popup.settings.templates.escape;return typeof t!==M&&(typeof t.title!==M&&t.title&&(t.title=o(t.title),e+='
'+t.title+"
"),typeof t.content!==M&&t.content&&(t.content=o(t.content),e+='
'+t.content+"
")),e}}}}(jQuery,window,document);