/* * # Fomantic UI - 2.9.2 * https://github.com/fomantic/Fomantic-UI * https://fomantic-ui.com/ * * Copyright 2023 Contributors * Released under the MIT license * https://opensource.org/licenses/MIT * */ !function(T,O,A){"use strict";function z(e){return"function"==typeof e&&"number"!=typeof e.nodeType}O=void 0!==O&&O.Math===Math?O:globalThis,T.fn.visibility=function(p){var h,e=T(this),x=e.selector||"",P=Date.now(),y=[],C=p,S="string"==typeof C,V=[].slice.call(arguments,1),R=e.length,k=0;return e.each(function(){var e,o,n,i=T.isPlainObject(p)?T.extend(!0,{},T.fn.visibility.settings,p):T.extend({},T.fn.visibility.settings),t=i.className,s=i.namespace,r=i.error,c=i.metadata,a="."+s,l="module-"+s,d=T(O),u=T(this),f=[O,A].indexOf(i.context)<0?T(A).find(i.context):T(i.context),v=u.data(l),b=this,g=!1,m={initialize:function(){m.debug("Initializing",i),m.setup.cache(),m.should.trackChanges()&&("image"===i.type&&m.setup.image(),"fixed"===i.type&&m.setup.fixed(),i.observeChanges&&m.observeChanges(),m.bind.events()),m.save.position(),m.is.visible()||m.error(r.visible,u),i.initialCheck&&m.checkVisibility(),m.instantiate()},instantiate:function(){m.debug("Storing instance",m),u.data(l,m),v=m},destroy:function(){m.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),d.off("load"+a,m.event.load).off("resize"+a,m.event.resize),f.off("scroll"+a,m.event.scroll).off("scrollchange"+a,m.event.scrollchange),"fixed"===i.type&&(m.resetFixed(),m.remove.placeholder()),u.off(a).removeData(l)},observeChanges:function(){"MutationObserver"in O&&(o=new MutationObserver(m.event.contextChanged),n=new MutationObserver(m.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(b,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",n))},bind:{events:function(){m.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&d.on("load"+a,m.event.load),d.on("resize"+a,m.event.resize),f.off("scroll"+a).on("scroll"+a,m.event.scroll).on("scrollchange"+a,m.event.scrollchange)}},event:{changed:function(e){m.verbose("DOM tree modified, updating visibility calculations"),m.timer=setTimeout(function(){m.verbose("DOM tree modified, updating sticky menu"),m.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===b||0=e.length&&z(o)&&o()};n--;)(s=A.createElement("img")).addEventListener("load",c),s.addEventListener("error",c),s.src=e[n],i.push(s)},enableCallbacks:function(){m.debug("Allowing callbacks to occur"),g=!1},disableCallbacks:function(){m.debug("Disabling all callbacks temporarily"),g=!0},should:{trackChanges:function(){return S?(m.debug("One time query, no need to bind events"),!1):(m.debug("Callbacks being attached"),!0)}},setup:{cache:function(){m.cache={occurred:{},screen:{},element:{}}},image:function(){var e=u.data(c.src);e&&(m.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){m.debug("Image on screen",b),m.precache(e,function(){m.set.image(e,function(){++k===R&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){m.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,p.transition||(i.transition=!1),m.create.placeholder(),m.debug("Added placeholder",e),i.onTopPassed=function(){m.debug("Element passed, adding fixed position",u),m.show.placeholder(),m.set.fixed(),i.transition&&void 0!==T.fn.transition&&u.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){m.debug("Element returned to position, removing fixed",u),m.hide.placeholder(),m.remove.fixed()}}},create:{placeholder:function(){m.verbose("Creating fixed position placeholder"),e=u.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(u)}},show:{placeholder:function(){m.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){m.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){m.verbose("Setting element to fixed position"),u.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(b)},image:function(e,o){u.attr("src",e),i.transition?void 0!==T.fn.transition?u.hasClass(t.visible)?m.debug("Transition already occurred on this image, skipping animation"):u.transition(i.transition,i.duration,o):u.fadeIn(i.duration,o):u.show()}},is:{onScreen:function(){return m.get.elementCalculations().onScreen},offScreen:function(){return m.get.elementCalculations().offScreen},visible:function(){return!(!m.cache||!m.cache.element)&&!(0===m.cache.element.width&&0===m.cache.element.offset.top)},verticallyScrollableContext:function(){var e=f[0]!==O&&f.css("overflow-y");return"auto"===e||"scroll"===e},horizontallyScrollableContext:function(){var e=f[0]!==O&&f.css("overflow-x");return"auto"===e||"scroll"===e}},refresh:function(){m.debug("Refreshing constants (width/height)"),"fixed"===i.type&&m.resetFixed(),m.reset(),m.save.position(),i.checkOnRefresh&&m.checkVisibility(),i.onRefresh.call(b)},resetFixed:function(){m.remove.fixed(),m.remove.occurred()},reset:function(){m.verbose("Resetting all cached values"),T.isPlainObject(m.cache)&&(m.cache.screen={},m.cache.element={})},checkVisibility:function(e){m.verbose("Checking visibility of element",m.cache.element),!g&&m.is.visible()&&(m.save.scroll(e),m.save.calculations(),m.passed(),m.passingReverse(),m.topVisibleReverse(),m.bottomVisibleReverse(),m.topPassedReverse(),m.bottomPassedReverse(),m.onScreen(),m.offScreen(),m.passing(),m.topVisible(),m.bottomVisible(),m.topPassed(),m.bottomPassed(),i.onUpdate&&i.onUpdate.call(b,m.get.elementCalculations()))},passed:function(e,o){var n=m.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(void 0!==e)return m.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&T.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>m.get.pixelsPassed(e)?m.execute(o,e):i.once||m.remove.occurred(o)})}},onScreen:function(e){var o=m.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(m.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.onOnScreen},offScreen:function(e){var o=m.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(m.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.onOffScreen},passing:function(e){var o=m.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(m.debug("Adding callback for passing",e),i.onPassing=e),o.passing?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.passing},topVisible:function(e){var o=m.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(m.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.topVisible},bottomVisible:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(m.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.bottomVisible},topPassed:function(e){var o=m.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(m.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.topPassed},bottomPassed:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(m.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.bottomPassed},passingReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(m.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||m.remove.occurred(t):m.get.occurred("passing")&&m.execute(n,t),void 0!==e)return!o.passing},topVisibleReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(m.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||m.remove.occurred(t):m.get.occurred("topVisible")&&m.execute(n,t),void 0===e)return!o.topVisible},bottomVisibleReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(m.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||m.remove.occurred(t):m.get.occurred("bottomVisible")&&m.execute(n,t),void 0===e)return!o.bottomVisible},topPassedReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(m.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||m.remove.occurred(t):m.get.occurred("topPassed")&&m.execute(n,t),void 0===e)return!o.onTopPassed},bottomPassedReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(m.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||m.remove.occurred(t):m.get.occurred("bottomPassed")&&m.execute(n,t),void 0===e)return!o.bottomPassed},execute:function(e,o){var n=m.get.elementCalculations(),t=m.get.screenCalculations();(e=e||!1)&&(i.continuous?(m.debug("Callback being called continuously",o,n),e.call(b,n,t)):m.get.occurred(o)||(m.debug("Conditions met",o,n),e.call(b,n,t))),m.save.occurred(o)},remove:{fixed:function(){m.debug("Removing fixed position"),u.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(b)},placeholder:function(){m.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){var o;e?void 0!==(o=m.cache.occurred)[e]&&!0===o[e]&&(m.debug("Callback can now be called again",e),m.cache.occurred[e]=!1):m.cache.occurred={}}},save:{calculations:function(){m.verbose("Saving all calculations necessary to determine positioning"),m.save.direction(),m.save.screenCalculations(),m.save.elementCalculations()},occurred:function(e){!e||void 0!==m.cache.occurred[e]&&!0===m.cache.occurred[e]||(m.verbose("Saving callback occurred",e),m.cache.occurred[e]=!0)},scroll:function(e){e=e+i.offset||f.scrollTop()+i.offset,m.cache.scroll=e},direction:function(){var e=m.get.scroll(),o=m.get.lastScroll(),e=o=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),m.cache.element=o,m.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=m.get.scroll();return m.save.direction(),m.cache.screen.top=e,m.cache.screen.bottom=e+m.cache.screen.height,m.cache.screen},screenSize:function(){m.verbose("Saving window position"),m.cache.screen={height:f.height()}},position:function(){m.save.screenSize(),m.save.elementPosition()}},get:{pixelsPassed:function(e){var o=m.get.elementCalculations();return-1