/*!
SearchPanes 1.1.0
2019-2020 SpryMedia Ltd - datatables.net/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.getGlobal=function(e){e=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,e];for(var t=0;t").addClass(this.classes.buttonGroup),
clear:d('').addClass(this.classes.dull).addClass(this.classes.paneButton).addClass(this.classes.clearButton),container:d("
").addClass(this.classes.container).addClass(this.classes.layout+(10>c?r:r.split("-")[0]+"-9")),countButton:d('').addClass(this.classes.paneButton).addClass(this.classes.countButton),dtP:d(""+(this.colExists?d(a.column(this.colExists?this.s.index:0).header()).text():this.customPaneSettings.header||
"Custom Pane")+" | |
---|
"),lower:d("").addClass(this.classes.subRow2).addClass(this.classes.narrowButton),nameButton:d('').addClass(this.classes.paneButton).addClass(this.classes.nameButton),panesContainer:g,searchBox:d("").addClass(this.classes.paneInputButton).addClass(this.classes.search),searchButton:d('').addClass(this.classes.paneButton),searchCont:d("").addClass(this.classes.searchCont),
searchLabelCont:d("").addClass(this.classes.searchLabelCont),topRow:d("").addClass(this.classes.topRow),upper:d("").addClass(this.classes.subRow1).addClass(this.classes.narrowSearch)};this.s.displayed=!1;a=this.s.dt;this.selections=[];this.s.colOpts=this.colExists?this._getOptions():this._getBonusOptions();var e=this.s.colOpts;r=d('').addClass(this.classes.paneButton);d(r).text(a.i18n("searchPanes.clearPane","X"));this.dom.container.addClass(e.className);
this.dom.container.addClass(null!==this.customPaneSettings&&void 0!==this.customPaneSettings.className?this.customPaneSettings.className:"");this.s.name=void 0!==this.s.colOpts.name?this.s.colOpts.name:null!==this.customPaneSettings&&void 0!==this.customPaneSettings.name?this.customPaneSettings.name:this.colExists?d(a.column(this.s.index).header()).text():this.customPaneSettings.header||"Custom Pane";d(g).append(this.dom.container);var u=a.table(0).node();this.s.searchFunction=function(a,c,f,r){if(0===
k.selections.length||a.nTable!==u)return!0;a="";k.colExists&&(a=c[k.s.index],"filter"!==e.orthogonal.filter&&(a=k.s.rowData.filterMap.get(f),a instanceof d.fn.dataTable.Api&&(a=a.toArray())));return k._search(a,f)};d.fn.dataTable.ext.search.push(this.s.searchFunction);if(this.c.clear)d(r).on("click",function(){k.dom.container.find(k.classes.search).each(function(){d(this).val("");d(this).trigger("input")});k.clearPane()});a.on("draw.dtsp",function(){k._adjustTopRow()});a.on("buttons-action",function(){k._adjustTopRow()});
d(window).on("resize.dtsp",n.util.throttle(function(){k._adjustTopRow()}));a.on("column-reorder.dtsp",function(a,c,f){k.s.index=f.mapping[k.s.index]});return this}b.prototype.clearData=function(){this.s.rowData={arrayFilter:[],arrayOriginal:[],arrayTotals:[],bins:{},binsOriginal:{},binsTotal:{},filterMap:new Map,totalOptions:0}};b.prototype.clearPane=function(){this.s.dtPane.rows({selected:!0}).deselect();this.updateTable();return this};b.prototype.destroy=function(){d(this.s.dtPane).off(".dtsp");
d(this.s.dt).off(".dtsp");d(this.dom.nameButton).off(".dtsp");d(this.dom.countButton).off(".dtsp");d(this.dom.clear).off(".dtsp");d(this.dom.searchButton).off(".dtsp");d(this.dom.container).remove();for(var a=d.fn.dataTable.ext.search.indexOf(this.s.searchFunction);-1!==a;)d.fn.dataTable.ext.search.splice(a,1),a=d.fn.dataTable.ext.search.indexOf(this.s.searchFunction);void 0!==this.s.dtPane&&this.s.dtPane.destroy();this.s.listSet=!1};b.prototype.getPaneCount=function(){return void 0!==this.s.dtPane?
this.s.dtPane.rows({selected:!0}).data().toArray().length:0};b.prototype.rebuildPane=function(a,c,f,r){void 0===a&&(a=!1);void 0===c&&(c=null);void 0===f&&(f=null);void 0===r&&(r=!1);this.clearData();var g=[];this.s.serverSelect=[];var b=null;void 0!==this.s.dtPane&&(r&&(this.s.dt.page.info().serverSide?this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray():g=this.s.dtPane.rows({selected:!0}).data().toArray()),this.s.dtPane.clear().destroy(),b=d(this.dom.container).prev(),this.destroy(),
this.s.dtPane=void 0,d.fn.dataTable.ext.search.push(this.s.searchFunction));this.dom.container.removeClass(this.classes.hidden);this.s.displayed=!1;this._buildPane(g,a,c,f,b);return this};b.prototype.removePane=function(){this.s.displayed=!1;d(this.dom.container).hide()};b.prototype.setCascadeRegen=function(a){this.s.cascadeRegen=a};b.prototype.setClear=function(a){this.s.clearing=a};b.prototype.updatePane=function(a){void 0===a&&(a=!1);this.s.updating=!0;this._updateCommon(a);this.s.updating=!1};
b.prototype.updateTable=function(){this.selections=this.s.dtPane.rows({selected:!0}).data().toArray();this._searchExtras();(this.c.cascadePanes||this.c.viewTotal)&&this.updatePane()};b.prototype._setListeners=function(){var a=this,c=this.s.rowData,f;this.s.dtPane.on("select.dtsp",function(){a.s.dt.page.info().serverSide&&!a.s.updating?a.s.serverSelecting||(a.s.serverSelect=a.s.dtPane.rows({selected:!0}).data().toArray(),a.s.selectPresent=!0,a.s.dt.draw(!1)):(clearTimeout(f),d(a.dom.clear).removeClass(a.classes.dull),
a.s.selectPresent=!0,a.s.updating||a._makeSelection(),a.s.selectPresent=!1)});this.s.dtPane.on("deselect.dtsp",function(){f=setTimeout(function(){a.s.dt.page.info().serverSide&&!a.s.updating?a.s.serverSelecting||(a.s.serverSelect=a.s.dtPane.rows({selected:!0}).data().toArray(),a.s.deselect=!0,a.s.dt.draw(!1)):(a.s.deselect=!0,0===a.s.dtPane.rows({selected:!0}).data().toArray().length&&d(a.dom.clear).addClass(a.classes.dull),a._makeSelection(),a.s.deselect=!1,a.s.dt.state.save())},50)});this.s.dt.on("stateSaveParams.dtsp",
function(f,g,b){if(d.isEmptyObject(b))a.s.dtPane.state.clear();else{f=[];if(void 0!==a.s.dtPane){f=a.s.dtPane.rows({selected:!0}).data().map(function(a){return a.filter.toString()}).toArray();var r=d(a.dom.searchBox).val();var l=a.s.dtPane.order();var e=c.binsOriginal;var p=c.arrayOriginal}void 0===b.searchPanes&&(b.searchPanes={});void 0===b.searchPanes.panes&&(b.searchPanes.panes=[]);b.searchPanes.panes.push({arrayFilter:p,bins:e,id:a.s.index,order:l,searchTerm:r,selected:f})}});this.s.dtPane.on("user-select.dtsp",
function(a,c,f,b,d){d.stopPropagation()});this.s.dtPane.on("draw.dtsp",function(){a._adjustTopRow()});d(this.dom.nameButton).on("click.dtsp",function(){var c=a.s.dtPane.order()[0][1];a.s.dtPane.order([0,"asc"===c?"desc":"asc"]).draw();a.s.dt.state.save()});d(this.dom.countButton).on("click.dtsp",function(){var c=a.s.dtPane.order()[0][1];a.s.dtPane.order([1,"asc"===c?"desc":"asc"]).draw();a.s.dt.state.save()});d(this.dom.clear).on("click.dtsp",function(){a.dom.container.find("."+a.classes.search).each(function(){d(this).val("");
d(this).trigger("input")});a.clearPane()});d(this.dom.searchButton).on("click.dtsp",function(){d(a.dom.searchBox).focus()});d(this.dom.searchBox).on("input.dtsp",function(){a.s.dtPane.search(d(a.dom.searchBox).val()).draw();a.s.dt.state.save()});this.s.dt.state.save();return!0};b.prototype._addOption=function(a,c,f,r,b,l){if(Array.isArray(a)||a instanceof n.Api)if(a instanceof n.Api&&(a=a.toArray(),c=c.toArray()),a.length===c.length)for(var g=0;gd(a[0]).width()||252>d(r[0]).width())&&0!==d(a[0]).width()?(d(a[0]).addClass(this.classes.narrow),d(c[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowSearch),
d(f[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowButton)):(d(a[0]).removeClass(this.classes.narrow),d(c[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowSearch),d(f[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowButton))};b.prototype._buildPane=function(a,c,f,r,b){var g=this;void 0===a&&(a=[]);void 0===c&&(c=!1);void 0===f&&(f=null);void 0===r&&(r=null);void 0===b&&(b=null);this.selections=[];var k=this.s.dt,e=k.column(this.colExists?
this.s.index:0),u=this.s.colOpts,p=this.s.rowData,h=k.i18n("searchPanes.count","{total}"),t=k.i18n("searchPanes.countFiltered","{shown} ({total})"),q=k.state.loaded();this.s.listSet&&(q=k.state());if(this.colExists){var v=-1;if(q&&q.searchPanes&&q.searchPanes.panes)for(var m=0;mthis.c.threshold:f>u.threshold)||!0!==u.show&&1>=m)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.c.viewTotal&&0===p.arrayTotals.length?this._detailsPane():p.binsTotal=p.bins;this.dom.container.addClass(this.classes.show);this.s.displayed=!0}else if(null!==f){if(void 0!==f.tableLength)this.s.tableLength=f.tableLength,this.s.rowData.totalOptions=this.s.tableLength;else if(null===this.s.tableLength||k.rows()[0].length>this.s.tableLength)this.s.tableLength=
k.rows()[0].length,this.s.rowData.totalOptions=this.s.tableLength;c=k.column(this.s.index).dataSrc();if(void 0!==f[c])for(m=0,f=f[c];mthis.c.threshold:f>u.threshold)||!0!==u.show&&1>=m)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.s.displayed=!0}}else this.s.displayed=!0;this._displayPane();if(!this.s.listSet)this.dom.dtP.on("stateLoadParams.dt",function(a,c,f){d.isEmptyObject(k.state.loaded())&&d.each(f,function(a,c){delete f[a]})});null!==b&&0'+b+"";if(g.c.hideCount||u.hideCount)c="";return g.c.dataLength?null!==a&&a.length>g.c.dataLength?''+a.substr(0,g.c.dataLength)+"..."+c:''+a+""+c:''+a+""+c},targets:0,type:void 0!==k.settings()[0].aoColumns[this.s.index]?k.settings()[0].aoColumns[this.s.index]._sManualType:null},{className:"dtsp-countColumn "+this.classes.badgePill,
data:"total",targets:1,visible:!1}],deferRender:!0,dom:"t",info:!1,paging:m?!0:!1,scrollY:"200px",scroller:m?!0:!1,select:!0,stateSave:k.settings()[0].oFeatures.bStateSave?!0:!1},this.c.dtOpts,void 0!==u?u.dtOpts:{},null!==this.customPaneSettings&&void 0!==this.customPaneSettings.dtOpts?this.customPaneSettings.dtOpts:{}));d(this.dom.dtP).addClass(this.classes.table);d(this.dom.searchBox).attr("placeholder",void 0!==u.header?u.header:this.colExists?k.settings()[0].aoColumns[this.s.index].sTitle:this.customPaneSettings.header||
"Custom Pane");d.fn.dataTable.select.init(this.s.dtPane);d.fn.dataTable.ext.errMode=b;if(this.colExists){e=(e=e.search())?e.substr(1,e.length-2).split("|"):[];var w=0;p.arrayFilter.forEach(function(a){""===a.filter&&w++});m=0;for(b=p.arrayFilter.length;mNo Data",hideCount:!1,layout:"columns-3",name:void 0,orderable:!0,orthogonal:{display:"display",hideCount:!1,search:"filter",show:void 0,sort:"sort",threshold:.6,type:"type"},preSelect:[],threshold:.6,viewTotal:!1};return b}(),h,v,w=function(){function b(a,c,f){var d=this;void 0===f&&(f=!1);this.regenerating=!1;if(!v||!v.versionCheck||!v.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");
if(!v.select)throw Error("SearchPane requires Select");var g=new v.Api(a);this.classes=h.extend(!0,{},b.classes);this.c=h.extend(!0,{},b.defaults,c);this.dom={clearAll:h('').addClass(this.classes.clearAll),container:h("").addClass(this.classes.panes).text(g.i18n("searchPanes.loadMessage","Loading Search Panes...")),emptyMessage:h("").addClass(this.classes.emptyMessage),options:h("").addClass(this.classes.container),panes:h("").addClass(this.classes.container),
title:h("").addClass(this.classes.title),titleRow:h("").addClass(this.classes.titleRow),wrapper:h("")};this.s={colOpts:[],dt:g,filterPane:-1,panes:[],selectionList:[],serverData:{},updating:!1};if(void 0===g.settings()[0]._searchPanes)if(g.on("xhr",function(a,c,b,f){b.searchPanes&&b.searchPanes.options&&(d.s.serverData=b.searchPanes.options,d.s.serverData.tableLength=b.recordsTotal,(d.c.viewTotal||d.c.cascadePanes)&&d._serverTotals())}),g.settings()[0]._searchPanes=this,this.dom.clearAll.text(g.i18n("searchPanes.clearMessage",
"Clear All")),this._getState(),this.s.dt.settings()[0]._bInitComplete||f)this._paneDeclare(g,a,c);else g.one("preInit.dt",function(b){d._paneDeclare(g,a,c)})}b.prototype.clearSelections=function(){this.dom.container.find(this.classes.search).each(function(){h(this).val("");h(this).trigger("input")});for(var a=[],c=0,b=this.s.panes;c=this.s.dt.page.info().recordsTotal?this._startup(a):setTimeout(function(){c._startup(a)},100)};b.prototype._serverTotals=function(){for(var a=!1,c=!1,b=this.s.dt,d=0,e=this.s.panes;d