"use strict";var fixedtoc=function(s){var t={init:function(){fixedtocOption.scrollOffset=a(fixedtocOption.scrollOffset),fixedtocOption.fixedOffsetX=a(fixedtocOption.fixedOffsetX),fixedtocOption.fixedOffsetY=a(fixedtocOption.fixedOffsetY),fixedtocOption.contentsFixedHeight=a(fixedtocOption.contentsFixedHeight),fixedtocOption.contentsWidthInPost=a(fixedtocOption.contentsWidthInPost),fixedtocOption.contentsHeightInPost=a(fixedtocOption.contentsHeightInPost),fixedtocOption.triggerBorderWidth=e(fixedtocOption.triggerBorder),fixedtocOption.contentsBorderWidth=e(fixedtocOption.contentsBorder),fixedtocOption.triggerSize=a(fixedtocOption.triggerSize)},set:n,update:function(t,e,i){n(t,e,i)},remove:function(t){void 0!==fixedtocOption[t]&&delete fixedtocOption[t]}};function n(t,e,i){fixedtocOption[t]="int"==i?a(e):"float"==i?parseFloat(e)||0:e}function e(t){switch(t){case"thin":return 1;case"medium":return 2;case"bold":return 5;default:return 0}}var r,i={inWidgetProp:void 0,showAdminbar:function(){return fixedtocOption.showAdminbar},isQuickMin:function(){return fixedtocOption.isQuickMin},isEscMin:function(){return fixedtocOption.isEscMin},isEnterMax:function(){return fixedtocOption.isEnterMax},isNestedList:function(){return fixedtocOption.isNestedList},isColExpList:function(){return fixedtocOption.isColExpList},showColExpIcon:function(){return fixedtocOption.showColExpIcon},isAccordionList:function(){return fixedtocOption.isAccordionList},showTargetHint:function(){return!0},supportInPost:function(){return fixedtocOption.inPost},inWidget:function(){return!!fixedtocOption.inWidget&&(void 0===this.inWidgetProp&&(this.inWidgetProp=!!s("#ftwp-widget-container").length),this.inWidgetProp)},fixedWidget:function(){return!!this.inWidget()&&fixedtocOption.fixedWidget},isAutoHeightFixedToPost:function(){return 0==fixedtocOption.contentsFixedHeight},isFloat:function(){return"none"!=fixedtocOption.contentsFloatInPost},isAutoHeightInPost:function(){return 0==fixedtocOption.contentsHeightInPost},isPositionAtFixed:function(t){return-1!=fixedtocOption.fixedPosition.indexOf(t)},isDebug:function(){return 1==fixedtocOption.debug},isNotBlur:function(){var t=navigator.userAgent.toLowerCase();return-1<t.indexOf("android")||-1<t.indexOf("firefox")},isMobile:function(){return x.data.window.width<=a(fixedtocOption.mobileMaxWidth)},isClickableHeader:function(){return 1==fixedtocOption.isClickableHeader},isColExpInitMobile:function(){return 1==fixedtocOption.contentsColexpInitMobile},isSmoothScroll:function(){return 1==fixedtocOption.smoothScroll}};function a(t){return parseInt(t)||0}function o(t){if(!t.length)return 0;var e=0;return t.each(function(){var t=s(this);"fixed"==t.css("position")&&(e+=a(t.outerHeight()))}),e}function c(t){t.preventDefault()}function d(t){return a(t-2*fixedtocOption.contentsBorderWidth)}function f(t){i.isDebug()&&console.log(t)}var u,p,l,g,h,x=(p={set:function(){var t;i.isAutoHeightInPost()||fixedtocOption.contentsColexpInit?(r.container.css("position","static"),t=r.containerOuter.outerHeight(),r.container.css("position","")):t=fixedtocOption.contentsHeightInPost,r.containerOuter.css("height",t+"px"),u.containerOuterHeight=t},update:function(){function t(){r.containerOuter.css("height","auto"),r.contents.css("height","auto"),j.setAuto(),u.containerOuterHeight=r.containerOuter.outerHeight()}S.location.inPost&&(i.isAutoHeightInPost()||"collapse"==r.contents.data("colexp")?t():(r.containerOuter.css("height",fixedtocOption.contentsHeightInPost+"px"),r.contents.css("height",fixedtocOption.contentsHeightInPost+"px"),j.set(d(fixedtocOption.contentsHeightInPost)),u.containerOuterHeight=r.containerOuter.outerHeight()))}},l={set:z,updateOnResize:function(){z()},updateHeight:function(){u.ftocRectInWidget.height=E()}},{data:u={},ftocRectInWidget:l,createOnInit:function(){m(),w(),O(),fixedtocOption.fixedMenu&&C(),T(),I(),i.supportInPost()&&(p.set(),H()),W(),P(),A(),i.inWidget()&&R(),i.fixedWidget()&&(M(),l.set()),b(),f(this.data)},updateOnResize:function(){m(),w(),O(),fixedtocOption.fixedMenu&&C(),T(),I(),i.supportInPost()&&(p.update(),H()),W(),P(),A(),i.inWidget()&&R(),i.fixedWidget()&&(M(),l.updateOnResize()),b(),f(u)},updateOnScroll:function(){w(),fixedtocOption.fixedMenu&&(void 0===g&&(g=u.fixedMenuHeight),C(),g!==u.fixedMenuHeight&&(T(),I(),i.supportInPost()&&H(),W(),P(),A(),i.inWidget()&&R(),i.fixedWidget()&&(M(),l.updateOnResize()),b(),g=u.fixedMenuHeight,f(u)))},updateInPost:function(){p.update(),H(),W(),b(),P(),A()},updateOnDocumentHeightChange:function(){v(),u.document.height!=h&&(fixedtoc.reload(),h=u.document.height)},setDocumentHeight:v});function w(){u.scrollTop=r.window.scrollTop()}function m(){u.window={},u.window.width=window.innerWidth,u.window.height=window.innerHeight}function v(){u.document={},u.document.height=Math.round(r.document.height())}function O(){u.adminbarHeight=i.showAdminbar()?o(s("#wpadminbar")):0}function C(){u.fixedMenuHeight=o(s(fixedtocOption.fixedMenu))}function T(){fixedtocOption.fixedMenu?u.fixedHeight=u.adminbarHeight+u.fixedMenuHeight:u.fixedHeight=u.adminbarHeight}function I(){u.fixedOffsetTop=u.fixedHeight+fixedtocOption.fixedOffsetY}function W(){u.headingOffset=u.fixedHeight+fixedtocOption.scrollOffset}function b(){u.headingsTop=[],s.each(r.anchors,function(){var t=s(s(this).attr("href")),t=t.length?a(t.offset().top-u.headingOffset):NaN;isNaN(t)||u.headingsTop.push({headingTop:t,anchorEle:s(this)})})}function P(){u.postRect={};var t=r.postContent.offset(),e=r.postContent.outerWidth(),i=r.postContent.outerHeight();u.postRect.left=t.left,u.postRect.top=t.top,u.postRect.width=e,u.postRect.right=u.postRect.left+u.postRect.width,u.postRect.bottom=i+u.postRect.top,u.postRect.height=u.postRect.bottom-u.postRect.top}function A(){u.ftocRangeY={},i.supportInPost()?u.ftocRangeY.top=u.inPostRangeY.bottom:u.ftocRangeY.top=u.postRect.top-u.fixedHeight,"document-bottom"===fixedtocOption.disappearPoint?u.ftocRangeY.bottom=Math.round(r.document.height()):u.ftocRangeY.bottom=u.postRect.bottom-u.window.height}function H(){u.inPostRangeY={},u.inPostRangeY.top=0,u.inPostRangeY.bottom=r.containerOuter.offset().top+u.containerOuterHeight-u.fixedHeight}function R(){u.inWidgetMinWidth=u.postRect.width+r.widgetContainer.outerWidth()}function M(){u.fixedWidgetRangeY={},u.fixedWidgetRangeY.top=r.widgetContainer.offset().top-u.fixedHeight,u.fixedWidgetRangeY.bottom=u.ftocRangeY.bottom}function z(){u.ftocRectInWidget={left:r.widgetContainer.offset().left,top:u.fixedHeight,width:r.widgetContainer.outerWidth(),height:E()}}function E(){var t;return"collapse"==r.contents.data("colexp")?(r.contents.css("height","auto"),t=r.contents.outerHeight(),r.contents.css("height","")):t=window.innerHeight-u.fixedHeight,t}var _={fixedWidget:function(){return!!i.fixedWidget()&&(!!y()&&(x.data.fixedWidgetRangeY.top<=x.data.scrollTop&&x.data.fixedWidgetRangeY.bottom>x.data.scrollTop))},inWidget:y,inPost:function(){return!!i.supportInPost()&&x.data.inPostRangeY.bottom>x.data.scrollTop},fixedToPost:function(){return x.data.ftocRangeY.top<=x.data.scrollTop&&x.data.ftocRangeY.bottom>x.data.scrollTop}};function y(){return i.inWidget()&&!i.isMobile()}var k,F,S={location:k={fixedWidget:!(F=["common","hidden","fixedToPost","inPost","inWidget","fixedWidget"]),inWidget:!1,inPost:!1,fixedToPost:!1,hidden:!1},register:function(t,e){-1!=s.inArray(t,F)?(void 0!==e._construct&&r.container.on("ftoc_"+t,e._construct),"common"!=t&&void 0!==e._destruct&&r.container.on("_ftoc_"+t,e._destruct)):f("Not support this event: "+t)},updateOnResize:function(){Y("resize")},updateOnScroll:function(){Y("scroll")},init:function(){r.container.trigger("ftoc_common"),Y("init")}};function Y(o){function t(t){for(var e=F.length,i={location:t,eventType:o},n=1;n<e;n++)t!=F[n]&&r.container.trigger("_ftoc_"+F[n],i);r.container.trigger("ftoc_"+t,i)}function e(t){for(var e=1,i=F.length;e<i;e++)void 0!==t&&t==F[e]?k[t]=!0:k[F[e]]=!1}_.fixedWidget()?k.fixedWidget||(e("fixedWidget"),t("fixedWidget"),f(k)):_.inWidget()?k.inWidget||(e("inWidget"),t("inWidget"),f(k)):_.inPost()?k.inPost||(e("inPost"),t("inPost"),f(k)):_.fixedToPost()?k.fixedToPost||(e("fixedToPost"),t("fixedToPost"),f(k)):k.hidden||(e("hidden"),t("hidden"),f(k))}var D,L,N,B,Q,X,j={set:function(t){t=void 0!==t?t:r.contents.height();r.list.css("height",t-r.header.outerHeight()+"px")},setAuto:function(){r.list.css("height","auto")},unset:function(){r.list.css("height","")}};function q(t,e){var i=void 0===e?s(this):e;(e=i.parent(".ftwp-has-sub")).length&&(i.hasClass("ftwp-anchor")?Q(e,i.prev("button")):L(e,i))}function G(t,e){var i=void 0===e?s(this):e;(e=i.parent(".ftwp-item")).length&&(i.hasClass("ftwp-anchor")?N(e,i.prev("button")):(L(e,i),X(e)))}i.isColExpList()&&(L=function(t,e){t.hasClass("ftwp-collapse")?Q(t,e):t.hasClass("ftwp-expand")&&B(t,e)},N=function(t,e){X(t),t.hasClass("ftwp-has-sub")&&Q(t,e)},B=function(t,e){t.removeClass("ftwp-expand").addClass("ftwp-collapse"),e.length&&e.removeClass("ftwp-icon-expand").addClass("ftwp-icon-collapse")},Q=function(t,e){t.removeClass("ftwp-collapse").addClass("ftwp-expand"),e.length&&e.removeClass("ftwp-icon-collapse").addClass("ftwp-icon-expand")},X=function(e){r.hasSubItems.each(function(){var t=s(this);t.get(0)!=e.get(0)&&(t.find(e).length||B(t,t.children("button")))})},D={_construct:function(){i.showColExpIcon()&&i.isAccordionList()?(r.colExpIcons.on("click",G),r.container.on("ftocAfterScrollToTarget",G)):i.showColExpIcon()?(r.colExpIcons.on("click",q),r.container.on("ftocAfterScrollToTarget",q)):r.container.on("ftocAfterScrollToTarget",G),i.showColExpIcon()&&r.colExpIcons.on("mousedown",c),r.container.on("ftocAfterTargetIndicated",function(t,e){!function(t){if(i.isAccordionList())X(t.parent(".ftwp-item"));var e=t.parents(".ftwp-has-sub");if(e)e.each(function(){var t=s(this);var e=t.children("button");Q(t,e)})}(e)}),f("Activated colExpSubList().")}});var J,K,U,V=(K=!1,{_construct:function(){i.isSmoothScroll()&&(r.anchors.on("click",function(t){t.preventDefault();var i,n,o,c,e=s(t.currentTarget);t=(i=e).attr("href"),n=s(t),o=i.data("index"),void 0!==(e=x.data.headingsTop[o])&&(c=e.headingTop,e=t.substr(1),r.headings.removeClass("ftwp-heading-target"),n.attr("id",""),window.location.hash=t,n.attr("id",e),s("html, body").animate({scrollTop:c},{duration:a(fixedtocOption.scrollDuration),start:function(){K=!0}}).promise().then(function(){K=!1;var e=x.data.headingsTop[o].headingTop;c!=e&&s("html, body").animate({scrollTop:e},100,function(){var t=x.data.headingsTop[o].headingTop;e!=t&&s("html, body").animate({scrollTop:t},1,function(){})}),U(i),n.addClass("ftwp-heading-target"),r.container.trigger("ftocAfterScrollToTarget",[i,c])}))}),r.anchors.on("mousedown",c),f("Activated scrollToTarget()."))},activeCurrent:U=function(t){Z(),(J=t).addClass("ftwp-active"),(S.location.fixedToPost||S.location.fixedWidget)&&(t.is(":focus")||K||t.trigger("focus")),!i.showColExpIcon()||(t=t.prev()).length&&t.addClass("ftwp-active")},deactivateAll:function(){J=void 0,r.anchors.removeClass("ftwp-active").trigger("blur"),i.showColExpIcon()&&r.colExpIcons.removeClass("ftwp-active")},deactivatePrev:Z});function Z(){var t;J&&(J.removeClass("ftwp-active").trigger("blur"),!i.showColExpIcon()||(t=J.prev()).length&&t.removeClass("ftwp-active"))}var $,tt,et={_construct:function(){r.window.on("ftocScroll",it).on("ftocResize",it),f("Actived targetIndicator().")},start:function(){r.window.on("ftocScroll",it).on("ftocResize",it)},stop:function(){r.window.off("ftocScroll",it).off("ftocResize",it)}};function it(){var e=x.data.headingsTop,i=x.data.scrollTop;return e[0].headingTop>i||x.data.ftocRangeY.bottom<i?(void 0!==$&&V.deactivateAll(),void($=void 0)):void 0!==tt&&tt!=x.data.document.height?(t(),void f("Fixed target indicator!!")):void(void 0!==$&&$[0].headingTop<=i&&$[1].headingTop>i||t());function t(){s.each(e,function(t){return void 0===e[t+1]&&this.headingTop<=x.data.ftocRangeY.bottom?($=[this,e[t],t],tt=x.data.document.height,V.activeCurrent(this.anchorEle),r.container.trigger("ftocAfterTargetIndicated",[this.anchorEle,i]),!1):this.headingTop<=i&&e[t+1].headingTop>i?($=[this,e[t+1],t],void 0===x.data.document&&x.setDocumentHeight(),tt=x.data.document.height,V.activeCurrent(this.anchorEle),r.container.trigger("ftocAfterTargetIndicated",[this.anchorEle,i]),!1):void 0})}}var nt,ot,ct,st;nt=function(){r.list.on("scroll",ot),r.list.on("mouseleave",ct),r.document.on("click",st),r.window.on("scroll",ct)},ot=function(){r.body.addClass("ftwp-no-scroll")},ct=function(){r.body.hasClass("ftwp-no-scroll")&&(r.list.off("scroll",ot),r.body.removeClass("ftwp-no-scroll"),setTimeout(function(){r.list.on("scroll",ot)},100))},st=function(t){s.contains(r.list.get(0),t.target)||ct()};function rt(){r.body.removeClass("ftwp-no-scroll"),r.list.off("scroll",ot),r.list.off("mouseleave",ct),r.document.off("click",st),r.window.off("scroll",ct)}var at,dt,ft,ut,pt,lt,gt,ht,xt,wt={_construct:function(){r.container.addClass("ftwp-hidden-state"),f("Actived hideToc().")},_destruct:function(){r.container.removeClass("ftwp-hidden-state"),f("Deactivated hideToc().")}},mt=(at=function(t,e){return e<=t.outerWidth()},dt={set:function(){var t,e;xt.setTransformOrigin(),i.isPositionAtFixed("left")?(t=x.data.window.width-x.data.postRect.left+fixedtocOption.fixedOffsetX,e=x.data.postRect.left-fixedtocOption.fixedOffsetX,vt(r.trigger,t,e),vt(r.contents,t,e)):(t=x.data.postRect.right+fixedtocOption.fixedOffsetX,e=x.data.window.width-t,Ot(r.trigger,t,e),Ot(r.contents,t,e)),function(){if(i.isPositionAtFixed("top")){r.trigger.css("top",x.data.fixedOffsetTop+"px");r.contents.css("top",x.data.fixedOffsetTop+"px")}else if(i.isPositionAtFixed("middle"))r.contents.css("top",x.data.fixedHeight+"px");else{r.trigger.css("top","");r.contents.css("top","")}}(),ht.reset()},unset:function(){r.trigger.css({left:"",right:"",top:""}),r.contents.css({left:"",right:"",top:""}),xt.removeTransformOrigin()}},ht={reset:function(){var t=function(){var t;if(i.isAutoHeightFixedToPost())if(i.isColExpList())t=window.innerHeight;else{j.setAuto();r.contents.css("height","auto");t=r.contents.outerHeight();ft();j.unset()}else t=fixedtocOption.contentsFixedHeight;return t}(),e=i.isPositionAtFixed("middle")?x.data.window.height-x.data.fixedHeight:x.data.window.height-x.data.fixedOffsetTop,t=e<t?e:t;r.contents.css("height",t+"px");t=d(t);j.set(t)},unset:ft=function(){r.contents.css("height","")}},lt="ftwp-animate-"+fixedtocOption.inOutEffect+"-in",gt="ftwp-animate-"+fixedtocOption.inOutEffect+"-inOut",{_construct:function(){!function(){if(r.container.addClass("ftwp-fixed-to-post"),!r.container.parent().is(r.body))r.container.appendTo(r.body);if(r.minIcon.addClass("ftwp-icon-minimize"),i.isMobile())if(r.container.hasClass("ftwp-maximize"))r.container.removeClass("ftwp-maximize").addClass("ftwp-minimize")}(),dt.set(),r.window.on("ftocResize",dt.set),xt.in(),r.container.on("ftocAfterMinMax",xt.inOut),f("Actived ftocInOut().")},_destruct:function(){r.container.removeClass("ftwp-fixed-to-post"),r.minIcon.removeClass("ftwp-icon-minimize"),dt.unset(),r.window.off("ftocResize",dt.set),ht.unset(),j.unset(),xt.out(),r.container.off("ftocAfterMinMax",xt.inOut),f("Deactivated ftocInOut().")},effectInCls:(xt={inCls:lt,in:function(){r.container.addClass(lt)},inOut:function(){r.container.removeClass(lt+" "+gt),r.container.offsetWidth,r.container.addClass(gt),setTimeout(function(){r.container.removeClass(gt)},1e3)},out:function(){r.container.removeClass(lt+" "+gt)},setTransformOrigin:function(){var t,e=fixedtocOption.fixedPosition.match(/(\w+)-(\w+)/i);e&&(t=e[2],e=e[1],"left"==t?t="right":"right"==t&&(t="left"),ut="ftwp-transform-"+t+"-"+(e="middle"==e?"center":e),r.trigger.removeClass(pt).addClass(ut),r.contents.removeClass(pt).addClass(ut))},reverseTransformOrigin:function(t){pt=ut.match(/left/i)?ut.replace("left","right"):ut.replace("right","left"),t.removeClass(ut).addClass(pt)},removeTransformOrigin:function(){r.trigger.removeClass(ut+" "+pt),r.contents.removeClass(ut+" "+pt)}}).inCls});function vt(t,e,i){at(t,i)?(t.css({left:"0px",right:"auto"}),xt.reverseTransformOrigin(t)):t.css({right:e+"px",left:"auto"})}function Ot(t,e,i){at(t,i)?(t.css({right:"0px",left:"auto"}),xt.reverseTransformOrigin(t)):t.css({left:e+"px",right:"auto"})}var Ct,Tt,It=(Ct=function(){r.container.removeClass("ftwp-minimize").addClass("ftwp-maximize"),r.container.trigger("ftocAfterMinMax"),r.container.trigger("ftocAfterMaximize"),f("Maximized FTOC.")},{_construct:function(){var t=i.isClickableHeader()?r.header:r.minIcon;r.trigger.on("click",Ct),t.on("click",Tt),r.trigger.on("mousedown",c),t.on("mousedown",c),i.isQuickMin()&&r.document.on("click touchstart",Wt),i.isEscMin()&&r.document.on("keyup",bt),i.isEnterMax()&&r.document.on("keyup",Pt),f("Actived minMaxFtoc().")},_destruct:function(){var t=i.isClickableHeader()?r.header:r.minIcon;r.trigger.off("click",Ct),t.off("click",Tt),r.trigger.off("mousedown",c),t.off("mousedown",c),i.isQuickMin()&&r.document.off("click",Wt),i.isEscMin()&&r.document.off("keyup",bt),i.isEnterMax()&&r.document.off("keyup",Pt),f("Deactivated minMaxFtoc.")},isMax:function(){return!!r.container.hasClass("ftwp-maximize")},isMin:function(){return!!r.container.hasClass("ftwp-minimize")},minimize:Tt=function(){r.container.removeClass("ftwp-maximize").addClass("ftwp-minimize"),r.container.trigger("ftocAfterMinMax"),r.container.trigger("ftocAfterMinimize"),f("Minimized FTOC.")}});function Wt(t){"touchstart"==t.type&&768<x.data.window.width||r.container.hasClass("ftwp-maximize")&&!s.contains(r.container.get(0),t.target)&&Tt()}function bt(t){r.container.hasClass("ftwp-maximize")&&27==t.keyCode&&Tt()}function Pt(t){r.container.hasClass("ftwp-minimize")&&13==t.keyCode&&Ct()}var At,Ht,Rt,Mt,zt,Et,_t,yt=(Ht="ftwp-fade-trigger",Rt="ftwp-unfade-trigger",Et=function(){void 0!==At&&(clearTimeout(At),r.trigger.removeClass(Ht).addClass(Rt))},_t=function(){void 0!==At&&(zt(),Mt())},{_construct:function(){r.container.hasClass("ftwp-minimize")&&Mt(),r.trigger.on("mouseenter",Et).on("mouseleave",_t),r.container.on("ftocAfterMinimize",Mt).on("ftocAfterMaximize",zt),f("Actived fadeTrigger().")},_destruct:function(){zt(),r.trigger.off("mouseenter",kt),r.trigger.off("mouseleave",Ft),r.container.off("ftocAfterMinimize",Mt),r.container.off("ftocAfterMaximize",zt),f("Deactivated fadeTrigger().")},stop:zt=function(){void 0!==At&&(clearTimeout(At),At=void 0,r.trigger.removeClass(Ht+" "+Rt))},start:Mt=function(){void 0===At&&(setTimeout(function(){r.container.removeClass(mt.effectInCls)},500),At=setTimeout(function(){r.trigger.addClass(Ht)},fixedtocOption.fadeTriggerDuration))},restart:_t,mouseLeave:Ft});function kt(){Et()}function Ft(){_t()}var St,Yt,Dt,Lt,Nt,Bt,Qt,Xt,jt,qt,Gt,Jt,Kt,Ut,Vt,Zt,$t,te,ee,ie,ne={start:function(t){i.isNotBlur()||t&&t.length&&t.removeClass("ftwp-unblur").addClass("ftwp-blur")},stop:function(t){t&&t.length&&t.hasClass("ftwp-blur")&&(t.removeClass("ftwp-blur").addClass("ftwp-unblur"),setTimeout(function(){t.removeClass("ftwp-unblur")},500))},clear:function(t){t&&t.length&&t.removeClass("ftwp-blur ftwp-unblur")}},oe=(Yt=function(){return.6*r.window.width()<=r.contents.outerWidth()},{_construct:function(){!function(){if(St=r.container.siblings(':not("script, style")'),It.isMax()&&Yt())ne.start(St)}(),r.window.on("ftocResize",ce),r.container.on("ftocAfterMaximize",se),r.container.on("ftocAfterMinimize",re),r.container.on("ftocAfterScrollToTarget",ae),f("Actived blurBody().")},_destruct:function(){ne.clear(St),r.window.off("ftocResize",ce),r.container.off("ftocAfterMaximize",se),r.container.off("ftocAfterMinimize",re),r.container.off("ftocAfterScrollToTarget",ae),f("Deactivated blurBody().")}});function ce(){It.isMax()&&Yt()?ne.start(St):ne.stop(St)}function se(){Yt()&&ne.start(St)}function re(){ne.stop(St)}function ae(t,e){Yt()&&r.container.hasClass("ftwp-maximize")&&(It.minimize(),ne.stop(St),e.trigger("blur"))}function de(){ne.start(Lt)}function fe(){ne.stop(Lt)}function ue(t){jt()?qt(100,Qt,t):Gt(100,Bt,t)}function pe(){x.ftocRectInWidget.updateHeight(),Vt.setFixed()}function le(){x.ftocRectInWidget.updateHeight(),Vt.setFixed()}function ge(){r.container.parent().is(r.widgetContainer)||r.container.appendTo(r.widgetContainer),r.contents.css("height","auto")}function he(){Ut.init()}function xe(){r.widget.addClass("ftwp-widget-fixed");var t=x.data.ftocRectInWidget;r.contents.css({left:t.left,top:t.top,width:t.width+"px",height:t.height+"px"}),t=d(t.height),j.set(t)}function we(t){te(t)}i.fixedWidget()&&(Dt={_construct:function(){Lt=r.widget.siblings(".widget"),function(){if("expand"==r.contents.data("colexp"))ne.start(Lt)}(),r.contents.on("ftocAfterExpandContents",de),r.contents.on("ftocAfterCollapseContents",fe),f("Actived blurWidgets().")},_destruct:function(){ne.clear(Lt),r.contents.off("ftocAfterExpandContents",de),r.contents.off("ftocAfterCollapseContents",fe),f("Deactivated blurWidgets().")}}),(i.inWidget()||i.supportInPost())&&(Xt=!0,jt=function(){var t=r.contents.data("colexp");return"expand"==t||void 0===t},qt=function(t,e,i){r.list.hide(t,function(){r.minIcon.removeClass("ftwp-icon-expand").addClass("ftwp-icon-collapse"),void 0!==e&&e(i)}),r.contents.data("colexp","collapse"),r.contents.trigger("ftocAfterCollapseContents"),f("Collapsed contents.")},Gt=function(t,e,i){r.list.show(t,function(){r.minIcon.removeClass("ftwp-icon-collapse").addClass("ftwp-icon-expand"),void 0!==e&&e(i)}),r.contents.data("colexp","expand"),r.contents.trigger("ftocAfterExpandContents"),f("Expanded contents.")},Nt={construct:function(t,e){Bt=t,Qt=e,function(){if(i.isMobile()&&Xt){console.log(i.isColExpInitMobile());if(i.isColExpInitMobile())qt(0,Qt);else Gt(0,Bt);Oe.reload()}else if(jt())Gt(0,Bt);else qt(0,Qt);Xt=false}();e=i.isClickableHeader()?r.header:r.minIcon;e.on("mousedown",c),e.on("click",ue)},destruct:function(){r.list.show(0),r.minIcon.removeClass("ftwp-icon-collapse ftwp-icon-expand");var t=i.isClickableHeader()?r.header:r.minIcon;t.off("mousedown",c),t.off("click",ue)}}),i.inWidget()&&(Jt={_construct:function(){Nt.construct(),f("Actived colExpConentsInWidget().")},_destruct:function(){Nt.destruct(),f("Deactivated colExpConentsInWidget().")}}),i.fixedWidget()&&(Kt={_construct:function(){Nt.construct(pe,le),f("Actived colExpConentsInFixedWidget().")},_destruct:function(){Nt.destruct(),f("Deactivated colExpConentsInFixedWidget().")}}),i.inWidget()&&(Ut={_construct:function(){ge(),f("Actived displayInWidget().")},_destruct:function(){r.contents.css("height",""),f("Deactivated displayInWidget().")},init:ge}),i.fixedWidget()&&(Vt={_construct:function(){he(),xe(),r.window.on("ftocResize",xe),f("Actived fixedInWidget().")},_destruct:function(){he(),r.widget.removeClass("ftwp-widget-fixed"),r.contents.css({left:"",top:"",width:"",height:""}),r.window.off("ftocResize",xe),j.unset(),f("Deactivated fixedInWidget().")},setFixed:xe}),i.supportInPost()&&(ie=function(){var t;0==fixedtocOption.contentsWidthInPost&&i.isFloat()?(r.containerOuter.css("width",""),ee=r.containerOuter.outerWidth(),r.containerOuter.css("width",ee+"px")):r.containerOuter.css("width",""),i.isAutoHeightInPost()?(r.containerOuter.css("height","auto"),r.contents.css("height","auto"),j.setAuto()):(r.containerOuter.css("height",x.data.containerOuterHeight+"px"),r.contents.css("height",x.data.containerOuterHeight+"px"),t=d(x.data.containerOuterHeight),j.set(t))},Zt={_construct:function(){!function(){if(!r.container.parent().is(r.containerOuter))r.container.appendTo(r.containerOuter);ie()}(),r.window.on("ftocResize",ie),f("Actived displayInPost().")},_destruct:function(){var t;r.contents.css("height",""),j.unset(),r.window.off("ftocResize",ie),i.isAutoHeightInPost()&&(t=r.containerOuter.height(),r.containerOuter.css("height",t+"px")),f("Deactivated displayInPost().")}},te=function(t){void 0!==t&&"click"==t.type&&x.updateInPost()},$t={_construct:function(){Nt.construct(we,te),f("Actived colExpConentsInFixedWidget().")},_destruct:function(){Nt.destruct(),f("Deactivated colExpConentsInFixedWidget().")}});var me,ve,Oe=(me=function(){x.updateOnResize(),S.updateOnResize(),r.window.trigger("ftocResize")},ve=function(){x.updateOnDocumentHeightChange(),x.updateOnScroll(),S.updateOnScroll(),r.window.trigger("ftocScroll")},{option:t,onReady:function(){t.init(),(r={window:s(window),document:s(document),body:s("body"),container:s("#ftwp-container"),trigger:s("#ftwp-trigger"),contents:s("#ftwp-contents"),header:s("#ftwp-header"),minIcon:s("#ftwp-header-minimize"),list:s("#ftwp-list"),postContent:s(fixedtocOption.postContentSelector),headings:s(".ftwp-heading")}).anchors=r.list.find(".ftwp-anchor").not(".ftwp-otherpage-anchor"),i.isNestedList()&&(r.hasSubItems=r.list.find(".ftwp-has-sub")),i.showColExpIcon()&&(r.colExpIcons=r.list.find(".ftwp-icon-expand, .ftwp-icon-collapse")),i.inWidget()&&(r.widget=s(".ftwp-widget"),r.widgetContainer=s("#ftwp-widget-container")),i.supportInPost()&&(r.containerOuter=s("#ftwp-container-outer")),f(r),r.anchors.each(function(t){s(this).data("index",t)}),r.container.trigger("ftocReady"),function(){if(x.createOnInit(),i.isColExpList())S.register("common",D);if(S.register("common",V),S.register("common",et),S.register("hidden",wt),i.fixedWidget()){S.register("fixedWidget",Kt);S.register("fixedWidget",Vt);S.register("fixedWidget",Dt)}if(i.inWidget()){S.register("inWidget",Ut);S.register("inWidget",Jt)}if(i.supportInPost()){S.register("inPost",Zt);S.register("inPost",$t)}S.register("fixedToPost",mt),S.register("fixedToPost",It),S.register("fixedToPost",yt),S.register("fixedToPost",oe),S.init(),r.window.on("resize",me),r.window.on("scroll",ve)}(),setTimeout(Ce,100),f(fixedtocOption)},reload:Ce});function Ce(){f(fixedtocOption),x.updateOnResize(),S.updateOnResize(),r.window.trigger("ftocResize")}return s(document).ready(Oe.onReady),s(document).on("load",i.reload),{option:Oe.option,reload:Oe.reload}}(jQuery);