/* * # Fomantic UI - 2.8.8 * https://github.com/fomantic/Fomantic-UI * http://fomantic-ui.com/ * * Copyright 2021 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(B,R,P,W){"use strict";B.isFunction=B.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},R=void 0!==R&&R.Math==Math?R:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),B.fn.modal=function(T){var A,e=B(this),H=B(R),D=B(P),O=B("body"),E=e.selector||"",L=(new Date).getTime(),N=[],z=T,j="string"==typeof z,q=[].slice.call(arguments,1),I=R.requestAnimationFrame||R.mozRequestAnimationFrame||R.webkitRequestAnimationFrame||R.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var o,s,e,i,n,a,c,t,r,l,d,u=B.isPlainObject(T)?B.extend(!0,{},B.fn.modal.settings,T):B.extend({},B.fn.modal.settings),m=u.selector,f=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=B(this),x=B(u.context),k=y.find(m.close),w=this,C=y.hasClass("modal")?y.data(b):W,S=!1,F="",M="";d={initialize:function(){if(y.hasClass("modal")||(d.create.modal(),B.isFunction(u.onHidden)||(u.onHidden=function(){d.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(m.title).html(d.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(m.content).html(d.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),d.has.configActions()){var s=y.find(m.actions).addClass(u.classActions);0===s.length?s=B("
",{class:f.actions+" "+(u.classActions||"")}).appendTo(y):s.empty(),u.actions.forEach(function(e){var t=e[g.icon]?'':"",n=d.helpers.escape(e[g.text]||"",u.preserveHTML),i=d.helpers.deQuote(e[g.class]||""),o=e[g.click]&&B.isFunction(e[g.click])?e[g.click]:function(){};s.append(B("",{html:t+n,class:f.button+" "+i,click:function(){!1!==o.call(w,y)&&d.hide()}}))})}d.cache={},d.verbose("Initializing dimmer",x),d.create.id(),d.create.dimmer(),u.allowMultiple&&d.create.innerDimmer(),u.centered||y.addClass("top aligned"),d.refreshModals(),d.bind.events(),u.observeChanges&&d.observeChanges(),d.instantiate(),u.autoShow&&d.show()},instantiate:function(){d.verbose("Storing instance of modal"),C=d,y.data(b,C)},create:{modal:function(){y=B("",{class:f.modal}),u.closeIcon&&(k=B("",{class:f.close}),y.append(k)),""!==u.title&&B("",{class:f.title}).appendTo(y),""!==u.content&&B("",{class:f.content}).appendTo(y),d.has.configActions()&&B("",{class:f.actions}).appendTo(y),x.append(y)},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},t=B.extend(!0,e,u.dimmerSettings);B.fn.dimmer!==W?(d.debug("Creating dimmer"),i=x.dimmer(t),u.detachable?(d.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):d.set.undetached(),n=i.dimmer("get dimmer")):d.error(p.dimmer)},id:function(){r=(Math.random().toString(16)+"000000000").substr(2,8),t="."+r,d.verbose("Creating unique id for element",r)},innerDimmer:function(){0==y.find(m.dimmer).length&&y.prepend('')}},destroy:function(){l&&l.disconnect(),d.verbose("Destroying previous modal"),y.removeData(b).off(v),H.off(t),n.off(t),k.off(v),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in R&&((l=new MutationObserver(function(e){d.debug("DOM tree modified, refreshing"),d.refresh()})).observe(w,{childList:!0,subtree:!0}),d.debug("Setting up mutation observer",l))},refresh:function(){d.remove.scrolling(),d.cacheSizes(),d.can.useFlex()||d.set.modalOffset(),d.set.screenHeight(),d.set.type()},refreshModals:function(){s=y.siblings(m.modal),o=s.add(y)},attachEvents:function(e,t){var n=B(e);t=B.isFunction(d[t])?d[t]:d.toggle,0