!function(t,e,o,n){"use strict";e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),t.fn.popup=function(i){var r,a=t(this),s=t(o),l=t(e),p=t("body"),u=a.selector||"",c=(new Date).getTime(),d=[],f=arguments[0],g="string"==typeof f,h=[].slice.call(arguments,1);return a.each(function(){var a,m,v,b,w,y,P=t.isPlainObject(i)?t.extend(!0,{},t.fn.popup.settings,i):t.extend({},t.fn.popup.settings),C=P.selector,T=P.className,x=P.error,k=P.metadata,E=P.namespace,S="."+P.namespace,A="module-"+E,F=t(this),O=t(P.context),D=t(P.scrollContext),j=t(P.boundary),H=P.target?t(P.target):F,R=0,N=!1,V=!1,W=this,M=F.data(A);y={initialize:function(){y.debug("Initializing",F),y.createID(),y.bind.events(),!y.exists()&&P.preserve&&y.create(),P.observeChanges&&y.observeChanges(),y.instantiate()},instantiate:function(){y.verbose("Storing instance",y),M=y,F.data(A,M)},observeChanges:function(){"MutationObserver"in e&&((v=new MutationObserver(y.event.documentChanged)).observe(o,{childList:!0,subtree:!0}),y.debug("Setting up mutation observer",v))},refresh:function(){P.popup?a=t(P.popup).eq(0):P.inline&&(a=H.nextAll(C.popup).eq(0),P.popup=a),P.popup?(a.addClass(T.loading),m=y.get.offsetParent(),a.removeClass(T.loading),P.movePopup&&y.has.popup()&&y.get.offsetParent(a)[0]!==m[0]&&(y.debug("Moving popup to the same offset parent as target"),a.detach().appendTo(m))):m=P.inline?y.get.offsetParent(H):y.has.popup()?y.get.offsetParent(a):p,m.is("html")&&m[0]!==p[0]&&(y.debug("Setting page as offset parent"),m=p),y.get.variation()&&y.set.variation()},reposition:function(){y.refresh(),y.set.position()},destroy:function(){y.debug("Destroying previous module"),v&&v.disconnect(),a&&!P.preserve&&y.removePopup(),clearTimeout(y.hideTimer),clearTimeout(y.showTimer),y.unbind.close(),y.unbind.events(),F.removeData(A)},event:{start:function(e){var o=t.isPlainObject(P.delay)?P.delay.show:P.delay;clearTimeout(y.hideTimer),V||(y.showTimer=setTimeout(y.show,o))},end:function(){var e=t.isPlainObject(P.delay)?P.delay.hide:P.delay;clearTimeout(y.showTimer),y.hideTimer=setTimeout(y.hide,e)},touchstart:function(t){V=!0,y.show()},resize:function(){y.is.visible()&&y.set.position()},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==W||t(e).find(W).length>0)&&(y.debug("Element removed from DOM, tearing down events"),y.destroy())})})},hideGracefully:function(e){var n=t(e.target),i=t.contains(o.documentElement,e.target),r=n.closest(C.popup).length>0;e&&!r&&i?(y.debug("Click occurred outside popup hiding popup"),y.hide()):y.debug("Click was inside popup, keeping popup open")}},create:function(){var e=y.get.html(),o=y.get.title(),n=y.get.content();e||n||o?(y.debug("Creating pop-up html"),e||(e=P.templates.popup({title:o,content:n})),a=t("
").addClass(T.popup).data(k.activator,F).html(e),P.inline?(y.verbose("Inserting popup element inline",a),a.insertAfter(F)):(y.verbose("Appending popup element to body",a),a.appendTo(O)),y.refresh(),y.set.variation(),P.hoverable&&y.bind.popup(),P.onCreate.call(a,W)):0!==H.next(C.popup).length?(y.verbose("Pre-existing popup found"),P.inline=!0,P.popup=H.next(C.popup).data(k.activator,F),y.refresh(),P.hoverable&&y.bind.popup()):P.popup?(t(P.popup).data(k.activator,F),y.verbose("Used popup specified in settings"),y.refresh(),P.hoverable&&y.bind.popup()):y.debug("No content specified skipping display",W)},createID:function(){w=(Math.random().toString(16)+"000000000").substr(2,8),b="."+w,y.verbose("Creating unique id for element",w)},toggle:function(){y.debug("Toggling pop-up"),y.is.hidden()?(y.debug("Popup is hidden, showing pop-up"),y.unbind.close(),y.show()):(y.debug("Popup is visible, hiding pop-up"),y.hide())},show:function(t){if(t=t||function(){},y.debug("Showing pop-up",P.transition),y.is.hidden()&&(!y.is.active()||!y.is.dropdown())){if(y.exists()||y.create(),!1===P.onShow.call(a,W))return void y.debug("onShow callback returned false, cancelling popup animation");P.preserve||P.popup||y.refresh(),a&&y.set.position()&&(y.save.conditions(),P.exclusive&&y.hideAll(),y.animate.show(t))}},hide:function(t){if(t=t||function(){},y.is.visible()||y.is.animating()){if(!1===P.onHide.call(a,W))return void y.debug("onHide callback returned false, cancelling popup animation");y.remove.visible(),y.unbind.close(),y.restore.conditions(),y.animate.hide(t)}},hideAll:function(){t(C.popup).filter("."+T.popupVisible).each(function(){t(this).data(k.activator).popup("hide")})},exists:function(){return!!a&&(P.inline||P.popup?y.has.popup():a.closest(O).length>=1)},removePopup:function(){y.has.popup()&&!P.popup&&(y.debug("Removing popup",a),a.remove(),a=n,P.onRemove.call(a,W))},save:{conditions:function(){y.cache={title:F.attr("title")},y.cache.title&&F.removeAttr("title"),y.verbose("Saving original attributes",y.cache.title)}},restore:{conditions:function(){return y.cache&&y.cache.title&&(F.attr("title",y.cache.title),y.verbose("Restoring original attributes",y.cache.title)),!0}},supports:{svg:function(){return"undefined"==typeof SVGGraphicsElement}},animate:{show:function(e){e=t.isFunction(e)?e:function(){},P.transition&&t.fn.transition!==n&&F.transition("is supported")?(y.set.visible(),a.transition({animation:P.transition+" in",queue:!1,debug:P.debug,verbose:P.verbose,duration:P.duration,onComplete:function(){y.bind.close(),e.call(a,W),P.onVisible.call(a,W)}})):y.error(x.noTransition)},hide:function(e){e=t.isFunction(e)?e:function(){},y.debug("Hiding pop-up"),!1!==P.onHide.call(a,W)?P.transition&&t.fn.transition!==n&&F.transition("is supported")?a.transition({animation:P.transition+" out",queue:!1,duration:P.duration,debug:P.debug,verbose:P.verbose,onComplete:function(){y.reset(),e.call(a,W),P.onHidden.call(a,W)}}):y.error(x.noTransition):y.debug("onHide callback returned false, cancelling popup animation")}},change:{content:function(t){a.html(t)}},get:{html:function(){return F.removeData(k.html),F.data(k.html)||P.html},title:function(){return F.removeData(k.title),F.data(k.title)||P.title},content:function(){return F.removeData(k.content),F.data(k.content)||P.content||F.attr("title")},variation:function(){return F.removeData(k.variation),F.data(k.variation)||P.variation},popup:function(){return a},popupOffset:function(){return a.offset()},calculations:function(){var t,o=y.get.offsetParent(a),n=H[0],i=j[0]==e,r=P.inline||P.popup&&P.movePopup?H.position():H.offset(),s=i?{top:0,left:0}:j.offset(),p={},u=i?{top:l.scrollTop(),left:l.scrollLeft()}:{top:0,left:0};if(p={target:{element:H[0],width:H.outerWidth(),height:H.outerHeight(),top:r.top,left:r.left,margin:{}},popup:{width:a.outerWidth(),height:a.outerHeight()},parent:{width:m.outerWidth(),height:m.outerHeight()},screen:{top:s.top,left:s.left,scroll:{top:u.top,left:u.left},width:j.width(),height:j.height()}},o.get(0)!==m.get(0)){var c=o.offset();p.target.top-=c.top,p.target.left-=c.left,p.parent.width=o.outerWidth(),p.parent.height=o.outerHeight()}return P.setFluidWidth&&y.is.fluid()&&(p.container={width:a.parent().outerWidth()},p.popup.width=p.container.width),p.target.margin.top=P.inline?parseInt(e.getComputedStyle(n).getPropertyValue("margin-top"),10):0,p.target.margin.left=P.inline?y.is.rtl()?parseInt(e.getComputedStyle(n).getPropertyValue("margin-right"),10):parseInt(e.getComputedStyle(n).getPropertyValue("margin-left"),10):0,t=p.screen,p.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},p},id:function(){return w},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(t,e){var o,n,i={};return o=(e=e||y.get.calculations()).popup,n=e.boundary,t&&(i={top:t.top-n.top,left:t.left-n.left,right:n.right-(t.left+o.width),bottom:n.bottom-(t.top+o.height)},y.verbose("Distance from boundaries determined",t,i)),i},offsetParent:function(e){var o=(e!==n?e[0]:H[0]).parentNode,i=t(o);if(o)for(var r="none"===i.css("transform"),a="static"===i.css("position"),s=i.is("body");o&&!s&&a&&r;)o=o.parentNode,r="none"===(i=t(o)).css("transform"),a="static"===i.css("position"),s=i.is("body");return i&&i.length>0?i:t()},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(t){var e=t.split(" "),o=e[0],n=e[1],i="top"==o||"bottom"==o,r=!1,a=!1,s=!1;return N||(y.verbose("All available positions available"),N=y.get.positions()),y.debug("Recording last position tried",t),N[t]=!0,"opposite"===P.prefer&&(s=(s=[{top:"bottom",bottom:"top",left:"right",right:"left"}[o],n]).join(" "),r=!0===N[s],y.debug("Trying opposite strategy",s)),"adjacent"===P.prefer&&i&&(s=(s=[o,{left:"center",center:"right",right:"left"}[n]]).join(" "),a=!0===N[s],y.debug("Trying adjacent strategy",s)),(a||r)&&(y.debug("Using backup position",s),s={"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"}[t]),s}},set:{position:function(t,e){if(0!==H.length&&0!==a.length){var o,i,r,s,l,p,u,c;if(e=e||y.get.calculations(),t=t||F.data(k.position)||P.position,o=F.data(k.offset)||P.offset,i=P.distanceAway,r=e.target,s=e.popup,l=e.parent,y.should.centerArrow(e)&&(y.verbose("Adjusting offset to center arrow on small target element"),"top left"!=t&&"bottom left"!=t||(o+=r.width/2,o-=P.arrowPixelsFromEdge),"top right"!=t&&"bottom right"!=t||(o-=r.width/2,o+=P.arrowPixelsFromEdge)),0===r.width&&0===r.height&&!y.is.svg(r.element))return y.debug("Popup target is hidden, no action taken"),!1;switch(P.inline&&(y.debug("Adding margin to calculation",r.margin),"left center"==t||"right center"==t?(o+=r.margin.top,i+=-r.margin.left):"top left"==t||"top center"==t||"top right"==t?(o+=r.margin.left,i-=r.margin.top):(o+=r.margin.left,i+=r.margin.top)),y.debug("Determining popup position from calculations",t,e),y.is.rtl()&&(t=t.replace(/left|right/g,function(t){return"left"==t?"right":"left"}),y.debug("RTL: Popup position updated",t)),R==P.maxSearchDepth&&"string"==typeof P.lastResort&&(t=P.lastResort),t){case"top left":p={top:"auto",bottom:l.height-r.top+i,left:r.left+o,right:"auto"};break;case"top center":p={bottom:l.height-r.top+i,left:r.left+r.width/2-s.width/2+o,top:"auto",right:"auto"};break;case"top right":p={bottom:l.height-r.top+i,right:l.width-r.left-r.width-o,top:"auto",left:"auto"};break;case"left center":p={top:r.top+r.height/2-s.height/2+o,right:l.width-r.left+i,left:"auto",bottom:"auto"};break;case"right center":p={top:r.top+r.height/2-s.height/2+o,left:r.left+r.width+i,bottom:"auto",right:"auto"};break;case"bottom left":p={top:r.top+r.height+i,left:r.left+o,bottom:"auto",right:"auto"};break;case"bottom center":p={top:r.top+r.height+i,left:r.left+r.width/2-s.width/2+o,bottom:"auto",right:"auto"};break;case"bottom right":p={top:r.top+r.height+i,right:l.width-r.left-r.width-o,left:"auto",bottom:"auto"}}if(p===n&&y.error(x.invalidPosition,t),y.debug("Calculated popup positioning values",p),a.css(p).removeClass(T.position).addClass(t).addClass(T.loading),u=y.get.popupOffset(),c=y.get.distanceFromBoundary(u,e),y.is.offstage(c,t)){if(y.debug("Position is outside viewport",t),R