/*! DataTables Bootstrap 3 integration
 * ©2011-2015 SpryMedia Ltd - datatables.net/license
 */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function applyFormatting(){for(var a=$("table.mdc-data-table__table").children(),e=0;e<a.length;e++)if("THEAD"===a[e].tagName){for(var t=$(a[e]).children(),d=0;d<t.length;d++)if("TR"===t[d].tagName){$(t[d]).addClass("mdc-data-table__header-row");for(var l=$(t[d]).children(),n=0;n<l.length;n++)"TH"===l[n].tagName&&$(l[n]).addClass("mdc-data-table__header-cell")}}else if("TBODY"===a[e].tagName){$(a[e]).addClass("mdc-data-table__content");for(t=$(a[e]).children(),d=0;d<t.length;d++)if("TR"===t[d].tagName){$(t[d]).addClass("mdc-data-table__row");for(l=$(t[d]).children(),n=0;n<l.length;n++)"TD"===l[n].tagName&&$(l[n]).addClass("mdc-data-table__cell")}}}$.extend(!0,DataTable.defaults,{dom:"<'mdc-layout-grid'<'mdc-layout-grid__inner'<'mdc-cell mdc-layout-grid__cell--span-6'l><'mdc-cell mdc-layout-grid__cell--span-6'f>>><'mdc-layout-grid dt-table'<'mdc-layout-grid__inner'<'mdc-cell mdc-layout-grid__cell--span-12'tr>>><'mdc-layout-grid'<'mdc-layout-grid__inner'<'mdc-cell mdc-layout-grid__cell--span-4'i><'mdc-cell mdc-layout-grid__cell--span-8'p>>>",renderer:"material"}),$.extend(DataTable.ext.classes,{sTable:"mdc-data-table__table",sHeaderTH:"mdc-data-table__header-row",sWrapper:"dataTables_wrapper form-inline dt-material mdc-data-table",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"}),DataTable.ext.renderer.pageButton.material=function(c,a,s,e,o,m){function b(a,e){function t(a){a.preventDefault(),$(a.currentTarget).hasClass("disabled")||u.page()==a.data.action||u.page(a.data.action).draw("page")}for(var d,l,n,r=0,i=e.length;r<i;r++)if(l=e[r],Array.isArray(l))b(a,l);else{switch(g="",n=!1,l){case"ellipsis":g="&#x2026;",p="disabled";break;case"first":g=f.sFirst,p=l+(0<o?"":" disabled");break;case"previous":g=f.sPrevious,p=l+(0<o?"":" disabled");break;case"next":g=f.sNext,p=l+(o<m-1?"":" disabled");break;case"last":g=f.sLast,p=l+(o<m-1?"":" disabled");break;default:g=l+1,p="",n=o===l}n&&(p+=" mdc-button--raised mdc-button--colored"),g&&(d=$("<button>",{class:"mdc-button "+p,id:0===s&&"string"==typeof l?c.sTableId+"_"+l:null,"aria-controls":c.sTableId,"aria-label":_[l],"data-dt-idx":l,tabindex:c.iTabIndex,disabled:-1!==p.indexOf("disabled")}).html(g).appendTo(a),c.oApi._fnBindAction(d,{action:l},t))}}var g,p,t,u=new DataTable.Api(c),f=(c.oClasses,c.oLanguage.oPaginate),_=c.oLanguage.oAria.paginate||{};try{t=$(a).find(document.activeElement).data("dt-idx")}catch(a){}b($(a).empty().html('<div class="pagination"/>').children(),e),void 0!==t&&$(a).find("[data-dt-idx="+t+"]").trigger("focus")},$(document).on("init.dt",function(a,e){"dt"===a.namespace&&(new $.fn.dataTable.Api(e),applyFormatting())}),$(document).on("draw.dt",function(a,e){"dt"===a.namespace&&(new $.fn.dataTable.Api(e),applyFormatting())});export default DataTable;