!function(R,P,K,W){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeofe&&"number"!=typeofe.nodeType},P=void0!==P&&P.Math==Math?P:"undefined"!=typeofself&&self.Math==Math?self:Function("return this")(),R.fn.modal=function(T){varD,e=R(this),H=R(P),O=R(K),E=R("body"),L=e.selector||"",I=(newDate).getTime(),N=[],z=T,j="string"==typeofz,q=[].slice.call(arguments,1),B=P.requestAnimationFrame||P.mozRequestAnimationFrame||P.webkitRequestAnimationFrame||P.msRequestAnimationFrame||function(e){setTimeout(e,0)};returne.each(function(){vart,o,s,e,i,n,a,c,r,l,d,u=R.isPlainObject(T)?R.extend(!0,{},R.fn.modal.settings,T):R.extend({},R.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=R(this),x=[P,K].indexOf(u.context)<0?R(K).find(u.context):R(u.context),k=y.find(f.closeIcon),w=this,C=y.hasClass("modal")?y.data(b):W,S=!1,F="",M="",A={initialize:function(){vars;A.create.id(),y.hasClass("modal")||(A.create.modal(),R.isFunction(u.onHidden)||(u.onHidden=function(){A.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(A.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(A.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),A.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=R("<div/>",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):s.empty(),u.actions.forEach(function(e){vart=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+A.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=A.helpers.escape(e[g.text]||"",u.preserveHTML),i=A.helpers.deQuote(e[g.class]||""),o=e[g.click]&&R.isFunction(e[g.click])?e[g.click]:function(){};s.append(R("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,click:function(){vare=R(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(w,y)||A.hide()}}))})),A.cache={},A.verbose("Initializing dimmer",x),A.create.dimmer(),u.allowMultiple&&A.create.innerDimmer(),u.centered||y.addClass("top aligned"),A.refreshModals(),A.refreshInputs(),A.bind.events(),A.observeChanges(),A.instantiate(),u.autoShow&&A.show()},instantiate:function(){A.verbose("Storing instance of modal"),C=A,y.data(b,C)},create:{modal:function(){vare;y=R("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(k=R("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(k)),""!==u.title&&(e="_"+A.get.id()+"title",y.attr("aria-labelledby",e),R("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+A.get.id()+"desc",y.attr("aria-describedby",e),R("<div/>",{class:m.content,id:e}).appendTo(y)),A.has.configActions()&&R("<div/>",{class:m.actions}).appendTo(y),x.append(y)},dimmer:function(){vare={debug:u.debug,dimmerName:"modals"},e=R.extend(!0,e,u.dimmerSettings);R.fn.dimmer===W?A.error(p.dimmer):(A.debug("Creating dimmer"),i=x.dimmer(e),u.detachable?(A.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):A.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),r="."+l,A.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&R("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),A.verbose("Destroying previous modal"),y.removeData(b).off(v),H.off(r),n.off(r),k.off(r),t&&t.off(r),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"inP&&((d=newMutationObserver(function(e){u.observeChanges&&(A.debug("DOM tree modified, refreshing"),A.refresh()),A.refreshInputs()})).observe(w,{childList:!0,subtree:!0}),A.debug("Setting up mutation observer",d))},refresh:function(){A.remove.scrolling(),A.cacheSizes(),A.can.useFlex()||A.set.modalOffset(),A.set.screenHeight(),A.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){t&&t.off("keydown"+r),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return0===R(this).c