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