!function(i){"function"==typeof define&&define.amd?define(["jquery","dataTables"],function(t){return i(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("dataTables")(t,e).$),i(e,t,t.document)}:i(jQuery,window,document)}(function(_,r,d,w){"use strict";function a(t,e){var i=this;if(this instanceof a){e!==w&&!0!==e||(e={});var o=_.fn.dataTable.camelToHungarian,o=(o&&(o(a.defaults,a.defaults,!0),o(a.defaults,e)),new _.fn.dataTable.Api(t).settings()[0]);if(this.s={dt:o,iTableColumns:o.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[],rtl:"rtl"===_(o.nTable).css("direction")},this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}},o._oFixedColumns)throw"FixedColumns already initialised on this table";o._oFixedColumns=this,o._bInitComplete?this._fnConstruct(e):o.oApi._fnCallbackReg(o,"aoInitComplete",function(){i._fnConstruct(e)},"FixedColumns")}else alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.")}var e,l=_.fn.dataTable;return _.extend(a.prototype,{fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnColCalc(),this._fnGridLayout(),this.fnUpdate()},fnRecalculateHeight:function(t){delete t._DTTC_iHeight,t.style.height="auto"},fnSetRowHeight:function(t,e){t.style.height=e+"px"},fnGetPosition:function(t){var e,i,o=this.s.dt.oInstance;return _(t).parents(".DTFC_Cloned").length?"tr"===t.nodeName.toLowerCase()?(i=_(t).index(),o.fnGetPosition(_("tr",this.s.dt.nTBody)[i])):(e=_(t).index(),i=_(t.parentNode).index(),[o.fnGetPosition(_("tr",this.s.dt.nTBody)[i]),e,o.oApi._fnVisibleToColumnIndex(this.s.dt,e)]):o.fnGetPosition(t)},_fnConstruct:function(t){var e,i,o,l,n,s=this;"function"!=typeof this.s.dt.oInstance.fnVersionCheck||!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0")?alert("FixedColumns "+a.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation"):""===this.s.dt.oScroll.sX?this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled"):(this.s=_.extend(!0,this.s,a.defaults,t),t=this.s.dt.oClasses,this.dom.grid.dt=_(this.s.dt.nTable).parents("div."+t.sScrollWrapper)[0],this.dom.scroller=_("div."+t.sScrollBody,this.dom.grid.dt)[0],this._fnColCalc(),this._fnGridSetup(),i=!1,_(this.s.dt.nTableWrapper).on("mousedown.DTFC",function(){i=!0,_(d).one("mouseup",function(){i=!1})}),_(this.dom.scroller).on("mouseover.DTFC touchstart.DTFC",function(){i||(e="main")}).on("scroll.DTFC",function(t){"main"===(e=!e&&t.originalEvent?"main":e)&&(0<s.s.iLeftColumns&&(s.dom.grid.left.liner.scrollTop=s.dom.scroller.scrollTop),0<s.s.iRightColumns)&&(s.dom.grid.right.liner.scrollTop=s.dom.scroller.scrollTop)}),o="onwheel"in d.createElement("div")?"wheel.DTFC":"mousewheel.DTFC",0<s.s.iLeftColumns&&_(s.dom.grid.left.liner).on("mouseover.DTFC touchstart.DTFC",function(){i||(e="left")}).on("scroll.DTFC",function(t){"left"===(e=!e&&t.originalEvent?"left":e)&&(s.dom.scroller.scrollTop=s.dom.grid.left.liner.scrollTop,0<s.s.iRightColumns)&&(s.dom.grid.right.liner.scrollTop=s.dom.grid.left.liner.scrollTop)}).on(o,function(t){t="wheel"===t.type?-t.originalEvent.deltaX:t.originalEvent.wheelDeltaX;s.dom.scroller.scrollLeft-=t}),0<s.s.iRightColumns&&_(s.dom.grid.right.liner).on("mouseover.DTFC touchstart.DTFC",function(){i||(e="right")}).on("scroll.DTFC",function(t){"right"===(e=!e&&t.originalEvent?"right":e)&&(s.dom.scroller.scrollTop=s.dom.grid.right.liner.scrollTop,0<s.s.iLeftColumns)&&(s.dom.grid.left.liner.scrollTop=s.dom.grid.right.liner.scrollTop)}).on(o,function(t){t="wheel"===t.type?-t.originalEvent.deltaX:t.originalEvent.wheelDeltaX;s.dom.scroller.scrollLeft-=t}),_(r).on("resize.DTFC",function(){s._fnGridLayout.call(s)}),l=!0,(n=_(this.s.dt.nTable)).on("draw.dt.DTFC",function(){s._fnColCalc(),s._fnDraw.call(s,l),l=!1}).on("column-sizing.dt.DTFC",function(){s._fnColCalc(),s._fnGridLayout(s)}).on("column-visibility.dt.DTFC",function(t,e,i,o,l){l!==w&&!l||(s._fnColCalc(),s._fnGridLayout(s),s._fnDraw(!0))}).on("select.dt.DTFC deselect.dt.DTFC",function(t,e,i,o){"dt"===t.namespace&&s._fnDraw(!1)}).on("destroy.dt.DTFC",function(){n.off(".DTFC"),_(s.dom.scroller).off(".DTFC"),_(r).off(".DTFC"),_(s.s.dt.nTableWrapper).off(".DTFC"),_(s.dom.grid.left.liner).off(".DTFC "+o),_(s.dom.grid.left.wrapper).remove(),_(s.dom.grid.right.liner).off(".DTFC "+o),_(s.dom.grid.right.wrapper).remove()}),this._fnGridLayout(),this.s.dt.oInstance.fnDraw(!1))},_fnColCalc:function(){var l=this,n=0,s=0;this.s.aiInnerWidths=[],this.s.aiOuterWidths=[],_.each(this.s.dt.aoColumns,function(t,e){var i,o,e=_(e.nTh);e.filter(":visible").length?(o=e.outerWidth(),0===l.s.aiOuterWidths.length&&(o+="string"==typeof(i=_(l.s.dt.nTable).css("border-left-width"))?1:parseInt(i,10)),l.s.aiOuterWidths.length===l.s.dt.aoColumns.length-1&&(o+="string"==typeof(i=_(l.s.dt.nTable).css("border-right-width"))?1:parseInt(i,10)),l.s.aiOuterWidths.push(o),l.s.aiInnerWidths.push(e.width()),t<l.s.iLeftColumns&&(n+=o),l.s.iTableColumns-l.s.iRightColumns<=t&&(s+=o)):(l.s.aiInnerWidths.push(0),l.s.aiOuterWidths.push(0))}),this.s.iLeftWidth=n,this.s.iRightWidth=s},_fnGridSetup:function(){var t,e=this._fnDTOverflow(),i=(this.dom.body=this.s.dt.nTable,this.dom.header=this.s.dt.nTHead.parentNode,this.dom.header.parentNode.parentNode.style.position="relative",_('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;"><div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_LeftBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll; overflow-x:hidden"></div></div><div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div><div class="DTFC_RightWrapper" style="position:absolute; top:0; right:0;"><div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightHeadBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div><div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_RightBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightFootBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div></div></div>')[0]),o=i.childNodes[0],l=i.childNodes[1];this.dom.grid.dt.parentNode.insertBefore(i,this.dom.grid.dt),i.appendChild(this.dom.grid.dt),this.dom.grid.wrapper=i,0<this.s.iLeftColumns&&(this.dom.grid.left.wrapper=o,this.dom.grid.left.head=o.childNodes[0],this.dom.grid.left.body=o.childNodes[1],this.dom.grid.left.liner=_("div.DTFC_LeftBodyLiner",i)[0],i.appendChild(o)),0<this.s.iRightColumns&&(this.dom.grid.right.wrapper=l,this.dom.grid.right.head=l.childNodes[0],this.dom.grid.right.body=l.childNodes[1],this.dom.grid.right.liner=_("div.DTFC_RightBodyLiner",i)[0],l.style.right=e.bar+"px",(t=_("div.DTFC_RightHeadBlocker",i)[0]).style.width=e.bar+"px",t.style.right=-e.bar+"px",this.dom.grid.right.headBlock=t,(t=_("div.DTFC_RightFootBlocker",i)[0]).style.width=e.bar+"px",t.style.right=-e.bar+"px",this.dom.grid.right.footBlock=t,i.appendChild(l)),this.s.dt.nTFoot&&(this.dom.footer=this.s.dt.nTFoot.parentNode,0<this.s.iLeftColumns&&(this.dom.grid.left.foot=o.childNodes[2]),0<this.s.iRightColumns)&&(this.dom.grid.right.foot=l.childNodes[2]),this.s.rtl&&_("div.DTFC_RightHeadBlocker",i).css({left:-e.bar+"px",right:""})},_fnGridLayout:function(){function t(t,e){s.bar?(!i._firefoxScrollError()||34<_(t).height())&&(t.style.width=e+s.bar+"px"):(t.style.width=e+20+"px",t.style.paddingRight="20px",t.style.boxSizing="border-box")}var e,i=this,o=this.dom.grid,l=(_(o.wrapper).width(),_(this.s.dt.nTable.parentNode).outerHeight()),n=_(this.s.dt.nTable.parentNode.parentNode).outerHeight(),s=this._fnDTOverflow(),r=this.s.iLeftWidth,d=this.s.iRightWidth,a="rtl"===_(this.dom.body).css("direction");s.x&&(l-=s.bar),o.wrapper.style.height=n+"px",0<this.s.iLeftColumns&&((e=o.left.wrapper).style.width=r+"px",e.style.height="1px",a?(e.style.left="",e.style.right=0):(e.style.left=0,e.style.right=""),o.left.body.style.height=l+"px",o.left.foot&&(o.left.foot.style.top=(s.x?s.bar:0)+"px"),t(o.left.liner,r),o.left.liner.style.height=l+"px"),0<this.s.iRightColumns&&((e=o.right.wrapper).style.width=d+"px",e.style.height="1px",this.s.rtl?(e.style.left=s.y?s.bar+"px":0,e.style.right=""):(e.style.left="",e.style.right=s.y?s.bar+"px":0),o.right.body.style.height=l+"px",o.right.foot&&(o.right.foot.style.top=(s.x?s.bar:0)+"px"),t(o.right.liner,d),o.right.liner.style.height=l+"px",o.right.headBlock.style.display=s.y?"block":"none",o.right.footBlock.style.display=s.y?"block":"none")},_fnDTOverflow:function(){var t=this.s.dt.nTable,e=t.parentNode,i={x:!1,y:!1,bar:this.s.dt.oScroll.iBarWidth};return t.offsetWidth>e.clientWidth&&(i.x=!0),t.offsetHeight>e.clientHeight&&(i.y=!0),i},_fnDraw:function(t){this._fnGridLayout(),this._fnCloneLeft(t),this._fnCloneRight(t),null!==this.s.fnDrawCallback&&this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right),_(this).trigger("draw.dtfc",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(t){if(!(this.s.iRightColumns<=0)){for(var e=[],i=this.s.iTableColumns-this.s.iRightColumns;i<this.s.iTableColumns;i++)this.s.dt.aoColumns[i].bVisible&&e.push(i);this._fnClone(this.dom.clone.right,this.dom.grid.right,e,t)}},_fnCloneLeft:function(t){if(!(this.s.iLeftColumns<=0)){for(var e=[],i=0;i<this.s.iLeftColumns;i++)this.s.dt.aoColumns[i].bVisible&&e.push(i);this._fnClone(this.dom.clone.left,this.dom.grid.left,e,t)}},_fnCopyLayout:function(t,e,i){for(var o=[],l=[],n=[],s=0,r=t.length;s<r;s++){var d=[];d.nTr=_(t[s].nTr).clone(i,!1)[0];for(var a,h,f=0,u=this.s.iTableColumns;f<u;f++)-1!==_.inArray(f,e)&&(-1===(a=_.inArray(t[s][f].cell,n))?(h=_(t[s][f].cell).clone(i,!1)[0],l.push(h),n.push(t[s][f].cell),d.push({cell:h,unique:t[s][f].unique})):d.push({cell:l[a],unique:t[s][f].unique}));o.push(d)}return o},_fnClone:function(t,e,l,i){var o,n,s,r,d,a,h,f,u=this,c=this.s.dt;if(i){for(_(t.header).remove(),t.header=_(this.dom.header).clone(!0,!1)[0],t.header.className+=" DTFC_Cloned",t.header.style.width="100%",e.head.appendChild(t.header),y=this._fnCopyLayout(c.aoHeader,l,!0),(h=_(">thead",t.header)).empty(),o=0,n=y.length;o<n;o++)h[0].appendChild(y[o].nTr);c.oApi._fnDrawHead(c,y,!0)}else for(y=this._fnCopyLayout(c.aoHeader,l,!1),c.oApi._fnDetectHeader(f=[],_(">thead",t.header)[0]),o=0,n=y.length;o<n;o++)for(s=0,r=y[o].length;s<r;s++)f[o][s].cell.className=y[o][s].cell.className,_("span.DataTables_sort_icon",f[o][s].cell).each(function(){this.className=_("span.DataTables_sort_icon",y[o][s].cell)[0].className});this._fnEqualiseHeights("thead",this.dom.header,t.header),"auto"==this.s.sHeightMatch&&_(">tbody>tr",u.dom.body).css("height","auto"),null!==t.body&&(_(t.body).remove(),t.body=null),t.body=_(this.dom.body).clone(!0)[0],t.body.className+=" DTFC_Cloned",t.body.style.paddingBottom=c.oScroll.iBarWidth+"px",t.body.style.marginBottom=2*c.oScroll.iBarWidth+"px",null!==t.body.getAttribute("id")&&t.body.removeAttribute("id"),_(">thead>tr",t.body).empty(),_(">tfoot",t.body).remove();var p=_("tbody",t.body)[0];if(_(p).empty(),0<c.aiDisplay.length){for(var g=_(">thead>tr",t.body)[0],m=0;m<l.length;m++){d=l[m],(a=_(c.aoColumns[d].nTh).clone(!0)[0]).innerHTML="";var C=a.style;C.paddingTop="0",C.paddingBottom="0",C.borderTopWidth="0",C.borderBottomWidth="0",C.height=0,C.width=u.s.aiInnerWidths[d]+"px",g.appendChild(a)}_(">tbody>tr",u.dom.body).each(function(t){var e=!1===u.s.dt.oFeatures.bServerSide?u.s.dt.aiDisplay[u.s.dt._iDisplayStart+t]:t,i=u.s.dt.aoData[e].anCells||_(this).children("td, th"),o=this.cloneNode(!1);for(o.removeAttribute("id"),o.setAttribute("data-dt-row",e),m=0;m<l.length;m++)d=l[m],0<i.length&&((a=_(i[d]).clone(!0,!0)[0]).setAttribute("data-dt-row",e),a.setAttribute("data-dt-column",m),o.appendChild(a));p.appendChild(o)})}else _(">tbody>tr",u.dom.body).each(function(t){(a=this.cloneNode(!0)).className+=" DTFC_NoData",_("td",a).html(""),p.appendChild(a)});if(t.body.style.width="100%",t.body.style.margin="0",t.body.style.padding="0",c.oScroller!==w&&(v=c.oScroller.dom.force,e.forcer?e.forcer.style.height=v.style.height:(e.forcer=v.cloneNode(!0),e.liner.appendChild(e.forcer))),e.liner.appendChild(t.body),this._fnEqualiseHeights("tbody",u.dom.body,t.body),null!==c.nTFoot){if(i){null!==t.footer&&t.footer.parentNode.removeChild(t.footer),t.footer=_(this.dom.footer).clone(!0,!0)[0],t.footer.className+=" DTFC_Cloned",t.footer.style.width="100%",e.foot.appendChild(t.footer);var y=this._fnCopyLayout(c.aoFooter,l,!0),b=_(">tfoot",t.footer);for(b.empty(),o=0,n=y.length;o<n;o++)b[0].appendChild(y[o].nTr);c.oApi._fnDrawHead(c,y,!0)}else{y=this._fnCopyLayout(c.aoFooter,l,!1);var T=[];for(c.oApi._fnDetectHeader(T,_(">tfoot",t.footer)[0]),o=0,n=y.length;o<n;o++)for(s=0,r=y[o].length;s<r;s++)T[o][s].cell.className=y[o][s].cell.className}this._fnEqualiseHeights("tfoot",this.dom.footer,t.footer)}var v=c.oApi._fnGetUniqueThs(c,_(">thead",t.header)[0]);_(v).each(function(t){d=l[t],this.style.width=u.s.aiInnerWidths[d]+"px"}),null!==u.s.dt.nTFoot&&(v=c.oApi._fnGetUniqueThs(c,_(">tfoot",t.footer)[0]),_(v).each(function(t){d=l[t],this.style.width=u.s.aiInnerWidths[d]+"px"}))},_fnGetTrNodes:function(t){for(var e=[],i=0,o=t.childNodes.length;i<o;i++)"TR"==t.childNodes[i].nodeName.toUpperCase()&&e.push(t.childNodes[i]);return e},_fnEqualiseHeights:function(t,e,i){if("none"!=this.s.sHeightMatch||"thead"===t||"tfoot"===t){for(var o,l,n=e.getElementsByTagName(t)[0],i=i.getElementsByTagName(t)[0],t=_(">"+t+">tr:eq(0)",e).children(":first"),s=(t.outerHeight(),t.height(),this._fnGetTrNodes(n)),r=this._fnGetTrNodes(i),d=[],a=0,h=r.length;a<h;a++)l=(o=s[a].offsetHeight)<(l=r[a].offsetHeight)?l:o,"semiauto"==this.s.sHeightMatch&&(s[a]._DTTC_iHeight=l),d.push(l);for(a=0,h=r.length;a<h;a++)r[a].style.height=d[a]+"px",s[a].style.height=d[a]+"px"}},_firefoxScrollError:function(){var t;return e===w&&(t=_("<div/>").css({position:"absolute",top:0,left:0,height:10,width:50,overflow:"scroll"}).appendTo("body"),e=t[0].clientWidth===t[0].offsetWidth&&0!==this._fnDTOverflow().bar,t.remove()),e}}),a.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sHeightMatch:"semiauto"},a.version="3.2.2",l.Api.register("fixedColumns()",function(){return this}),l.Api.register("fixedColumns().update()",function(){return this.iterator("table",function(t){t._oFixedColumns&&t._oFixedColumns.fnUpdate()})}),l.Api.register("fixedColumns().relayout()",function(){return this.iterator("table",function(t){t._oFixedColumns&&t._oFixedColumns.fnRedrawLayout()})}),l.Api.register("rows().recalcHeight()",function(){return this.iterator("row",function(t,e){t._oFixedColumns&&t._oFixedColumns.fnRecalculateHeight(this.row(e).node())})}),l.Api.register("fixedColumns().rowIndex()",function(t){return(t=_(t)).parents(".DTFC_Cloned").length?this.rows({page:"current"}).indexes()[t.index()]:this.row(t).index()}),l.Api.register("fixedColumns().cellIndex()",function(t){var e,i;return(t=_(t)).parents(".DTFC_Cloned").length?(e=t.parent().index(),e=this.rows({page:"current"}).indexes()[e],i=t.parents(".DTFC_LeftWrapper").length?t.index():this.columns().flatten().length-this.context[0]._oFixedColumns.s.iRightColumns+t.index(),{row:e,column:this.column.index("toData",i),columnVisible:i}):this.cell(t).index()}),_(d).on("init.dt.fixedColumns",function(t,e){var i,o;"dt"===t.namespace&&(t=e.oInit.fixedColumns,i=l.defaults.fixedColumns,t||i)&&(o=_.extend({},t,i),!1!==t)&&new a(e,o)}),_.fn.dataTable.FixedColumns=a,_.fn.DataTable.FixedColumns=a});