!function(e){function t(t,r){var l=e(t);this.el={$table:l},this.ev={touchstart:!1},this.env={},this.timeout={},this.options=e.extend(!0,{},this.default_options,"object"==typeof r?r:{}),this.namespace=Math.floor(1e5*Math.random()+1),this.options.height&&!this.options.force_sticky_outer_heading?this.options._sticky_outer_heading=!1:this.options.force_sticky_outer_heading&&(this.options._sticky_outer_heading=!0),l.trigger("before_freeze_table_build",this),this.build(),l.trigger("after_freeze_table_build",this)}e.fn.freezeTable=function(t,r){return this.each((function(){var r=e(this);if(!r.hasClass("frzTbl-clone-table"))return"destroy"==t?(r.data("freezeTable")&&r.data("freezeTable").destroy(),!0):r.data("freezeTable")?"resize"==t?(r.data("freezeTable").table_resize_handler(),!0):"pause"==t?(r.data("freezeTable").pause=!0,!0):"unpause"==t?(r.data("freezeTable").pause=!1,!0):void 0:(r.data("freezeTable",new e.FreezeTable(this,t)),!0)}))},e.FreezeTable=t,t.prototype.default_options={left:0,right:0,heading:0,offset:0,wrapperWidth:0,wrapperHeight:0,tableWidth:!1,grab_and_scroll:0,grab_and_scroll_click_selectors:!1,captureScroll:!1,force_sticky_outer_heading:!1,_sticky_outer_heading:!0},t.prototype.build=function(){this.el.$table.addClass("frzTbl-table"),this.tpl=e("#freeze-table-template").html(),this.insert_heading_in_template(),this.toggle_shadow_columns_in_template(),e(this.tpl).insertBefore(this.el.$table).attr("data-freeze-table-namespace",this.namespace).find(".frzTbl-table-placeholder").replaceWith(this.el.$table),this.build_element_store(),this.freeze_columns(),this.scroll_hijack(),this.grab_and_scroll(),this.el.$window.on("resize.ft"+this.namespace,e.proxy(this,"table_resize_handler","*window resize from "+this.namespace+"*")),this.update_env({windowWidth:e(window).width(),windowHeight:e(window).height(),heading_row_cells_width:this.get_heading_row_cells_width(),first_row_cells_width:this.get_first_row_cells_width(),breakpoint:this.current_breakpoint()}),this.attach_resize_observers(),this._table_resize_handler(),this.el.$wrapper.addClass("frzTbl--init")},t.prototype.scroll_hijack=function(){this.el.$window.on("scroll",e.proxy(this,"page_scroll")),this.page_scroll({target:document}),this.el.$wrapper.on("wheel",e.proxy(this,"wrapper_wheel")),this.el.$wrapper.on("touchstart touchmove touchend",e.proxy(this,"wrapper_touch")),this.el.$scrollOverlay.on("wheel scroll",e.proxy(this,"scrollOverlay_wheel"));var t=[this.el.$scrollOverlay,this.el.$tableWrapper,this.el.$fixedHeadingWrapper];e.each(t,(function(e,t){t[0].scrollTop=0,t[0].scrollLeft=0}))},t.prototype.build_element_store=function(){this.el.$window=e(window),this.el.$wrapper=this.el.$table.closest(".frzTbl"),this.el.$scrollOverlay=this.el.$wrapper.children(".frzTbl-scroll-overlay"),this.el.$scrollOverlayInner=this.el.$scrollOverlay.children(".frzTbl-scroll-overlay__inner"),this.el.$contentWrapper=this.el.$wrapper.children(".frzTbl-content-wrapper"),this.el.$frozenColumnsWrapper=this.el.$contentWrapper.children(".frzTbl-frozen-columns-wrapper"),this.el.$frozenColumnsLeft=this.el.$frozenColumnsWrapper.children(".frzTbl-frozen-columns-wrapper__columns--left"),this.el.$frozenColumnsLeftSticky=this.el.$frozenColumnsLeft.children(".frzTbl-top-sticky"),this.el.$frozenColumnsRight=this.el.$frozenColumnsWrapper.children(".frzTbl-frozen-columns-wrapper__columns--right"),this.el.$frozenColumnsRightSticky=this.el.$frozenColumnsRight.children(".frzTbl-top-sticky"),this.el.$fixedHeadingWrapperOuter=this.el.$contentWrapper.children(".frzTbl-fixed-heading-wrapper-outer"),this.el.$fixedHeadingWrapper=this.el.$fixedHeadingWrapperOuter.children(".frzTbl-fixed-heading-wrapper"),this.el.$fixedHeadingLeftColumn=this.el.$fixedHeadingWrapperOuter.children(".frzTbl-fixed-heading-wrapper__columns--left"),this.el.$fixedHeadingRightColumn=this.el.$fixedHeadingWrapperOuter.children(".frzTbl-fixed-heading-wrapper__columns--right"),this.el.$fixedHeadingInner=this.el.$fixedHeadingWrapper.children(".frzTbl-fixed-heading-wrapper__inner"),this.el.$headingRowCells=this.el.$table.find("> thead > .wcpt-heading-row:last-child > .wcpt-heading"),this.el.$firstRowCells=this.el.$table.find("> tbody > .wcpt-row:first-child > .wcpt-cell"),this.el.$tableWrapper=this.el.$contentWrapper.children(".frzTbl-table-wrapper"),this.el.$tableInner=this.el.$tableWrapper.children(".frzTbl-table-wrapper__inner"),this.el.$tableWrapperSticky=this.el.$tableInner.children(".frzTbl-top-sticky")},t.prototype.grab_and_scroll=function(){var t=this,r=t.el.$wrapper,l=e("body");r.off("mousedown.freeze_table.grab_and_scroll"),l.off("mousemove.freeze_table.grab_and_scroll_"+t.namespace),l.off("mousemove.freeze_table.grab_and_scroll_"+t.namespace),e("img, a",r).off("dragstart.freeze_table.grab_and_scroll_"+t.namespace),r.removeClass("frzTbl--grab-and-scroll frzTbl--grab-and-scroll--grabbing"),this.get_breakpoint_options().grab_and_scroll&&(t.grab_and_scroll__grabbed=!1,t.grab_and_scroll__last_clientX=!1,t.grab_and_scroll__last_pos_x=!1,t.grab_and_scroll__last_clientY=!1,t.grab_and_scroll__last_pos_y=!1,t.grab_and_scroll__$el=!1,r.addClass("frzTbl--grab-and-scroll"),r.on("mousedown.freeze_table.grab_and_scroll",(function(i){3!==i.which&&"SELECT"!=i.target.tagName&&(t.grab_and_scroll__grabbed=!0,t.grab_and_scroll__first_clientX=i.clientX,t.grab_and_scroll__first_clientY=i.clientY,t.grab_and_scroll__last_clientX=i.clientX,t.grab_and_scroll__last_clientY=i.clientY,t.grab_and_scroll__$el=e(i.target).parentsUntil(r),t.grab_and_scroll__$el__ev_handler_attached=!1,r.addClass("frzTbl--grab-and-scroll--grabbing"),t.el.$table.trigger("freeze_table__grab_and_scroll__start"),l.one("mouseup",(function(){t.grab_and_scroll__grabbed=!1,r.removeClass("frzTbl--grab-and-scroll--grabbing"),t.el.$table.trigger("freeze_table__grab_and_scroll__stop"),t.timeout.grab_and_scroll=setTimeout((function(){t.grab_and_scroll__$el.off("click.freeze_table.grab_and_scroll_"+t.namespace)}),1)})))})),l.on("mousemove.freeze_table.grab_and_scroll_"+t.namespace,(function(e){if(t.grab_and_scroll__grabbed){var r=e.clientX-t.grab_and_scroll__last_clientX;t.grab_and_scroll__last_pos_x+=parseFloat(r),t.horizontal_scroll(-r),t.grab_and_scroll__last_clientX=e.clientX;var l=e.clientY-t.grab_and_scroll__last_clientY;t.grab_and_scroll__last_pos_y+=parseFloat(l),t.vertical_scroll(-l),t.grab_and_scroll__last_clientY=e.clientY,(Math.abs(t.grab_and_scroll__last_clientX-t.grab_and_scroll__first_clientX)>2||Math.abs(t.grab_and_scroll__last_clientY-t.grab_and_scroll__first_clientY)>2)&&!t.grab_and_scroll__$el__ev_handler_attached&&(t.grab_and_scroll__$el.one("click.freeze_table.grab_and_scroll_"+t.namespace,(function(e){e.preventDefault(),e.stopPropagation()})),t.grab_and_scroll__$el__ev_handler_attached=!0),t.el.$table.trigger("freeze_table__grab_and_scroll__dragging")}})),e("img, a",r).on("dragstart.freeze_table.grab_and_scroll_"+t.namespace,(function(e){e.preventDefault()})))},t.prototype.insert_heading_in_template=function(){if(this.get_breakpoint_options().heading){var e=this.clone_table();e.find("tbody").remove(),this.tpl=this.tpl.replace(/{{heading}}/g,e[0].outerHTML)}else this.tpl=this.tpl.replace(/{{heading}}/g,"")},t.prototype.toggle_shadow_columns_in_template=function(){["left","right"].forEach((e=>{var t=new RegExp(`{{hide-${e}-column}}`,"g");(settings=this.get_breakpoint_options()[e])?this.tpl=this.tpl.replace(t,""):this.tpl=this.tpl.replace(t,"frzTbl-frozen-columns-wrapper__columns--empty")}))},t.prototype.resize_freeze_heading=function(){var t=this.get_breakpoint_options(),r=t.offset?t.offset:0,l=this.el.$table.children("thead")[0].getBoundingClientRect().height,i=parseInt(this.el.$table.css("border-top-width")),s=parseInt(this.el.$table.find("> thead > tr").css("border-bottom-width"));isNaN(r)&&("string"==typeof r?r=e(r).height():"object"==typeof r&&(r=r.height())),i%2&&--i,i*=.5,this.el.$fixedHeadingWrapperOuter.css({height:l+i+s,top:parseFloat(r)+"px"}),t._sticky_outer_heading?this.el.$fixedHeadingWrapperOuter.show():this.el.$fixedHeadingWrapperOuter.hide(),t.heading||this.el.$fixedHeadingWrapperOuter.css({position:"relative",top:0}),this.el.$wrapper.parents().each((function(){var t=e(this),r=t.css("overflow");r&&"visible"!==r&&t.addClass("frzTbl-force-parent-overlow-visible")}))},t.prototype.freeze_columns=function(){var t=this.get_breakpoint_options();this.el.$css||(this.el.$css=e(``),e("head").append(this.el.$css));var r="",l="",i="";["left","right"].forEach((s=>{if(t[s]){for(var a=1,o=parseInt(t[s]),n=[],h="left"==s?"nth-child":"nth-last-child",_=0;a;){var c=`[data-freeze-table-namespace="${this.namespace}"]`,p=`${c} .wcpt-cell:${h}(${a})`,d=`${c} .wcpt-heading:${h}(${a})`,b=`${p}, ${d}`;if(n.push(b),_&&(l+=` ${b} { ${s}: ${_}px; } `),_+=e(`${c} .wcpt-table > tbody > .wcpt-row:first-child > .wcpt-cell:${h}(${a})`)[0].getBoundingClientRect().width,i+=` \n ${p}:after, \n ${d}:after { \n position: absolute; \n content: ''; \n width: 100%; \n height: 100%; \n left: 0; \n top: 0; \n display: block; \n border: inherit; \n pointer-events: none;\n }\n .frzTbl--scrolled-to-${s}-edge${p}:after, \n .frzTbl--scrolled-to-${s}-edge${d}:after {\n display: none;\n }\n `,!(a tbody > tr > td:nth-child(${i})`,r)[0].getBoundingClientRect().width,--i;this.el.$frozenColumnsLeft.width(l)}if(t.right){for(l=0,i=t.right;i;)l+=e(`> tbody > tr > td:nth-last-child(${i})`,r)[0].getBoundingClientRect().width,--i;this.el.$frozenColumnsRight.width(l)}},t.prototype.clone_table=function(){var t=this.el.$table.clone();return t.css({width:"","min-width":""}).addClass("frzTbl-clone-table"),e("> tbody > tr > td, > thead > tr > th",t).each((function(){var t=e(this);t.attr({"data-index":t.index()})})),t},t.prototype.resize_clone_cells=function(){var t=this.el.$table,r=this.get_clone_tables(),l=e("> tbody > tr > td, > thead > tr > th",r),i=[];l.each((function(){var r=e(this),l=r.parent(),s="> "+(l.parent().is("thead")?"thead":"tbody")+" > tr:nth-child("+(l.index()+1)+") > *:nth-child("+(parseInt(r.attr("data-index"))+1)+")",a=e(s,t);i.push({width:a[0].getBoundingClientRect().width,rowOuterHeight:a.parent()[0].getBoundingClientRect().height})})),l.each((function(t){var r=e(this);r.css({width:i[t].width,minWidth:i[t].width}),r.parent().outerHeight(i[t].rowOuterHeight)}));this.el.$table.children("thead")[0].getBoundingClientRect().height;var s=parseInt(this.el.$table.css("border-top-width"));s%2&&--s,s*=.5},t.prototype.get_clone_tables=function(){var t=this.el.$table,r=e();return e.each(this.el,(function(l,i){var s=i.children().filter((function(){return e(this).is("table")&&this!==t[0]}));r=r.add(s)})),r},t.prototype.page_scroll=function(e){e.target===document&&(this.el.$table[0].getBoundingClientRect().top>=0?this.el.$wrapper.addClass("frzTbl--scrolled-to-top"):this.el.$wrapper.removeClass("frzTbl--scrolled-to-top"))},t.prototype.wrapper_wheel=function(t){if(t.originalEvent.deltaY&&(!t.originalEvent.deltaX||Math.abs(t.originalEvent.deltaY/t.originalEvent.deltaX)>.1)&&!this.get_breakpoint_options().wrapperHeight)return!0;var r=this.el.$wrapper,l="frzTbl--scrolling";r.addClass(l),clearTimeout(this.timeout.scroll_clear),this.timeout.scroll_clear=setTimeout((function(){r.removeClass(l)}),300),t.preventDefault(),this.options.captureScroll&&this.options.wrapperHeight||(this.el.$scrollOverlay[0].scrollHeight==this.el.$scrollOverlay.height()||t.originalEvent.deltaY>0&&this.el.$scrollOverlay[0].scrollTop+this.el.$scrollOverlay.height()==this.el.$scrollOverlayInner.height()||t.originalEvent.deltaY<0&&!this.el.$scrollOverlay[0].scrollTop)&&(e("html")[0].scrollTop+=t.originalEvent.deltaY,e("body")[0].scrollTop+=t.originalEvent.deltaY)},t.prototype.wrapper_touch=function(e){if("touchstart"==e.type&&this.el.$scrollOverlay.stop(!0),"touchmove"==e.type&&!1!==this.ev.prevClientX){var t=this.ev.prevClientX-e.originalEvent.touches[0].clientX,r={originalEvent:{deltaX:t,deltaY:this.ev.prevClientY-e.originalEvent.touches[0].clientY}};this.scrollOverlay_wheel(r),Math.abs(t)>5?this.ev.animScroll=20*t+this.el.$scrollOverlay[0].scrollLeft:this.ev.animScroll=!1}"touchend"==e.type?(this.ev.animScroll&&(this.el.$scrollOverlay.animate({scrollLeft:this.ev.animScroll},{specialEasing:{scrollLeft:"FreezeTable_easeOutQuad"}}),this.ev.animScroll=!1),this.ev.prevClientX=!1,this.ev.prevClientY=!1):(this.ev.prevClientX=e.originalEvent.touches[0].clientX,this.ev.prevClientY=e.originalEvent.touches[0].clientY)},t.prototype.scrollOverlay_wheel=function(e){var t=e.originalEvent.deltaX||0;e.originalEvent.deltaY;this.horizontal_scroll(t)},t.prototype.horizontal_scroll=function(e,t){var r=this.el.$scrollOverlay,l=this.layout_memory.scrollTop,i=this.layout_memory.scrollLeft,s=this.layout_memory.scrollOverlayWidth,a=this.layout_memory.scrollOverlayInnerWidth;e||(e=0),t||(t=0),0==e&&0==t&&(e=r[0].scrollLeft-this.layout_memory.scrollLeft),l+=t,(i+=e)<0&&(i=0),i+s+1>a&&(i=a-s),this.layout_memory.scrollTop=l,this.layout_memory.scrollLeft=i,r[0].scrollTop=l,r[0].scrollLeft=i,this.el.$tableWrapper[0].scrollLeft=i,this.el.$fixedHeadingWrapper[0].scrollLeft=i,this.el.$wrapper.removeClass("frzTbl--scrolled-to-left-edge frzTbl--scrolled-to-right-edge"),i||this.el.$wrapper.addClass("frzTbl--scrolled-to-left-edge"),i+s>=a&&this.el.$wrapper.addClass("frzTbl--scrolled-to-right-edge")},t.prototype.vertical_scroll=function(t){e("html")[0].scrollTop+=t,e("body")[0].scrollTop+=t},t.prototype.get_breakpoint_options=function(){var t=this.get_options(),r=this.current_breakpoint();return r?e.extend(!0,{},this.default_options,t.breakpoint[r]):t},t.prototype.get_options=function(){return e.extend(!0,{},this.options)},t.prototype.table_resize_handler=function(t){var r=e.proxy(this,"_table_resize_handler");clearTimeout(this.timeout.table_resize_handler),this.timeout.table_resize_handler=setTimeout(r,100)},t.prototype.table_resize_required=function(){return!!(this.has_heading_width_changed()||this.has_column_width_changed()||this.has_table_height_changed())},t.prototype.has_heading_width_changed=function(){if(!this.env.heading_row_cells_width)return!0;var t=this,r=!1;return this.el.$headingRowCells.each((function(l){e(this).width()!==t.env.heading_row_cells_width[l]&&(r=!0)})),r},t.prototype.has_column_width_changed=function(){if(!this.env.first_row_cells_width)return!0;var t=this,r=!1;return this.el.$firstRowCells.each((function(l){e(this).width()!==t.env.first_row_cells_width[l]&&(r=!0)})),r},t.prototype.has_table_height_changed=function(){return!this.env.tableHeight||this.env.tableHeight!==this.el.$table.height()},t.prototype._table_resize_handler=function(){this.pause||(this.crossed_breakpoint()?this.reload():this.table_resize_required()&&(this.manage_overflow(),this.resize_clone_cells(),this.resize_column_shadows(),this.resize_freeze_heading(),1>Math.abs(this.el.$wrapper.innerWidth()-this.el.$table.outerWidth())&&this.el.$wrapper.addClass("frzTbl--scrolled-to-left-edge frzTbl--scrolled-to-right-edge"),this.update_env({wrapperWidth:this.el.$wrapper.width(),wrapperHeight:this.el.$wrapper.height(),tableWidth:this.el.$table.width(),tableHeight:this.el.$table.height()})))},t.prototype.manage_overflow=function(){if(this.manage_overflow_required()){this.reset_overflow();var e=this.el.$scrollOverlay[0].scrollLeft;this.controlled_overflow_qualified()?this.apply_controlled_overflow():this.unrestricted_overflow_qualified()?this.apply_unrestricted_overflow():this.apply_normal_overflow(),this.antiscroll(),this.el.$scrollOverlay[0].scrollLeft=e}else this.resize_wrapper_and_scroll_to_table()},t.prototype.manage_overflow_required=function(){return!(!jQuery.isEmptyObject(this.env)&&this.env.wrapperWidth===this.el.$wrapper.width()&&this.env.tableWidth===this.el.$table.width())},t.prototype.reset_overflow=function(){this.el.$wrapper.removeClass("frzTbl--controlled-overflow frzTbl--unrestricted-overflow"),this.el.$table.css({"min-width":""}),this.el.$scrollOverlayInner.css({height:"",width:""}),this.el.$wrapper.css({height:""}),this.el.$tableInner.removeClass("frzTbl-table-wrapper__inner--deflate")},t.prototype.controlled_overflow_qualified=function(){var e=this.get_parsed_user_forced_table_width();return!!(e&&e>this.el.$tableWrapper.width())},t.prototype.apply_controlled_overflow=function(){this.el.$wrapper.addClass("frzTbl--controlled-overflow");var e=this.get_parsed_user_forced_table_width();this.el.$table.css({width:e});var t=this.el.$table.outerHeight();this.resize_wrapper_and_scroll_to_table({width:e,height:t})},t.prototype.get_parsed_user_forced_table_width=function(){var e=this.get_breakpoint_options(),t=!!e.tableWidth&&e.tableWidth,r=this.el.$wrapper.width();if(t&&("px"==(t=t.replaceAll(/\s/g,"")).slice(-2)&&(t=t.slice(0,-2)),"+"===t.charAt(0))){var l=t.substring(1);t=!isNaN(l)&&parseInt(t.substring(1))+r}return t},t.prototype.unrestricted_overflow_qualified=function(){var e=this.get_breakpoint_options();return!(!e.left&&!e.right)},t.prototype.apply_unrestricted_overflow=function(){this.el.$wrapper.addClass("frzTbl--unrestricted-overflow"),this.el.$tableInner.addClass("frzTbl-table-wrapper__inner--unrestrict-table-wrapper");var e=Math.max(this.el.$table.outerWidth(),this.el.$wrapper.innerWidth());table_height=this.el.$table.outerHeight(),e>this.el.$wrapper.width()&&++e,this.el.$tableInner.removeClass("frzTbl-table-wrapper__inner--unrestrict-table-wrapper"),this.el.$table.css({"min-width":e}),this.resize_wrapper_and_scroll_to_table({width:e,height:table_height})},t.prototype.apply_normal_overflow=function(){this.el.$wrapper.addClass("frzTbl--normal-overflow"),this.el.$tableInner.addClass("frzTbl-table-wrapper__inner--deflate");var e=this.el.$table.outerWidth();table_height=this.el.$table.outerHeight(),this.resize_wrapper_and_scroll_to_table({width:e,height:table_height})},t.prototype.resize_wrapper_and_scroll_to_table=function(e){e||(e={}),e.height||(e.height=this.el.$table.outerHeight()),e.width||(e.width=this.el.$table.outerWidth()),this.el.$scrollOverlayInner.css({height:e.height,width:e.width}),this.el.$wrapper.css({height:e.height})},t.prototype.attach_resize_observers=function(t){var r=this;r.resize_observers||(r.resize_observers={table_observer:new ResizeObserver((()=>{r.table_resize_handler("*table resize*")})),heading_row_cells_observer:new ResizeObserver((()=>{r.table_resize_handler("*heading row cells resize*")})),first_row_cells_observer:new ResizeObserver((()=>{r.table_resize_handler("*first row cells resize*")}))}),r.resize_observers.table_observer.observe(this.el.$table[0]),e("> thead > tr:last-child > th",this.el.$table).each((function(){r.resize_observers.heading_row_cells_observer.observe(this)})),e("> tbody > tr:first-child > td",this.el.$table).each((function(){r.resize_observers.first_row_cells_observer.observe(this)}))},t.prototype.disconnect_resize_observers=function(){for(var e in this.resize_observers)Object.hasOwn(this.resize_observers,e)&&this.resize_observers[e].disconnect()},t.prototype.antiscroll=function(){var e=this.el.$scrollOverlay;this.layout_memory={scrollTop:e[0].scrollTop=0,scrollLeft:e[0].scrollLeft=0,scrollOverlayWidth:e.width(),scrollOverlayInnerWidth:this.el.$scrollOverlayInner.width()},this.el.$wrapper.antiscroll(),this.el.$wrapper.children("> .frzTbl-antiscroll-control-wrap").remove().end().children(".antiscroll-scrollbar-horizontal").wrap('
'),this.el.$table.width()-this.el.$wrapper.width()<5?this.el.$wrapper.addClass("frzTbl--hide-antiscroll"):this.el.$wrapper.removeClass("frzTbl--show-antiscroll")},t.prototype.crossed_breakpoint=function(){return this.current_breakpoint()!==this.env.breakpoint},t.prototype.update_env=function(t){this.env=e.extend(!0,{},this.env,t)},t.prototype.get_heading_row_cells_width=function(){var t=[];return this.el.$headingRowCells.each((function(r){t.push(e(this).width())})),t},t.prototype.get_first_row_cells_width=function(){var t=[];return this.el.$firstRowCells.each((function(r){t.push(e(this).width())})),t},t.prototype.current_breakpoint=function(){var t=this.get_options(),r=!1,l=e(window).width();return!!t.breakpoint&&(e.each(t.breakpoint,(function(e,t){if((e=parseInt(e))