LocalCDN-Firefox-Chrome-Brave/resources/datatables/1.10.24/dataTables.searchPanes.min.jsm

113 lines
52 KiB
JavaScript

/*!
SearchPanes 1.2.2
2019-2020 SpryMedia Ltd - datatables.net/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.getGlobal=function(m){m=["object"==typeof globalThis&&globalThis,m,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var t=0;t<m.length;++t){var h=m[t];if(h&&h.Math==Math)return h}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.checkEs6ConformanceViaProxy=function(){try{var m={},t=Object.create(new $jscomp.global.Proxy(m,{get:function(h,r,v){return h==m&&"q"==r&&v==t}}));return!0===t.q}catch(h){return!1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();$jscomp.arrayIteratorImpl=function(m){var t=0;return function(){return t<m.length?{done:!1,value:m[t++]}:{done:!0}}};$jscomp.arrayIterator=function(m){return{next:$jscomp.arrayIteratorImpl(m)}};
$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(m,t,h){if(m==Array.prototype||m==Object.prototype)return m;m[t]=h.value;return m};$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;
$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(m,t){var h=$jscomp.propertyToPolyfillSymbol[t];if(null==h)return m[t];h=m[h];return void 0!==h?h:m[t]};$jscomp.polyfill=function(m,t,h,r){t&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(m,t,h,r):$jscomp.polyfillUnisolated(m,t,h,r))};
$jscomp.polyfillUnisolated=function(m,t,h,r){h=$jscomp.global;m=m.split(".");for(r=0;r<m.length-1;r++){var v=m[r];if(!(v in h))return;h=h[v]}m=m[m.length-1];r=h[m];t=t(r);t!=r&&null!=t&&$jscomp.defineProperty(h,m,{configurable:!0,writable:!0,value:t})};
$jscomp.polyfillIsolated=function(m,t,h,r){var v=m.split(".");m=1===v.length;r=v[0];r=!m&&r in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var q=0;q<v.length-1;q++){var A=v[q];if(!(A in r))return;r=r[A]}v=v[v.length-1];h=$jscomp.IS_SYMBOL_NATIVE&&"es6"===h?r[v]:null;t=t(h);null!=t&&(m?$jscomp.defineProperty($jscomp.polyfills,v,{configurable:!0,writable:!0,value:t}):t!==h&&($jscomp.propertyToPolyfillSymbol[v]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(v):$jscomp.POLYFILL_PREFIX+v,v=
$jscomp.propertyToPolyfillSymbol[v],$jscomp.defineProperty(r,v,{configurable:!0,writable:!0,value:t})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(m){if(m)return m;var t=function(v,q){this.$jscomp$symbol$id_=v;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:q})};t.prototype.toString=function(){return this.$jscomp$symbol$id_};var h=0,r=function(v){if(this instanceof r)throw new TypeError("Symbol is not a constructor");return new t("jscomp_symbol_"+(v||"")+"_"+h++,v)};return r},"es6","es3");$jscomp.initSymbolIterator=function(){};
$jscomp.polyfill("Symbol.iterator",function(m){if(m)return m;m=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),h=0;h<t.length;h++){var r=$jscomp.global[t[h]];"function"===typeof r&&"function"!=typeof r.prototype[m]&&$jscomp.defineProperty(r.prototype,m,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return m},"es6",
"es3");$jscomp.initSymbolAsyncIterator=function(){};$jscomp.iteratorPrototype=function(m){m={next:m};m[Symbol.iterator]=function(){return this};return m};$jscomp.makeIterator=function(m){var t="undefined"!=typeof Symbol&&Symbol.iterator&&m[Symbol.iterator];return t?t.call(m):$jscomp.arrayIterator(m)};$jscomp.owns=function(m,t){return Object.prototype.hasOwnProperty.call(m,t)};
$jscomp.polyfill("WeakMap",function(m){function t(){if(!m||!Object.seal)return!1;try{var a=Object.seal({}),b=Object.seal({}),c=new m([[a,2],[b,3]]);if(2!=c.get(a)||3!=c.get(b))return!1;c.delete(a);c.set(b,4);return!c.has(a)&&4==c.get(b)}catch(d){return!1}}function h(){}function r(a){var b=typeof a;return"object"===b&&null!==a||"function"===b}function v(a){if(!$jscomp.owns(a,A)){var b=new h;$jscomp.defineProperty(a,A,{value:b})}}function q(a){if(!$jscomp.ISOLATE_POLYFILLS){var b=Object[a];b&&(Object[a]=
function(c){if(c instanceof h)return c;Object.isExtensible(c)&&v(c);return b(c)})}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(m&&$jscomp.ES6_CONFORMANCE)return m}else if(t())return m;var A="$jscomp_hidden_"+Math.random();q("freeze");q("preventExtensions");q("seal");var G=0,k=function(a){this.id_=(G+=Math.random()+1).toString();if(a){a=$jscomp.makeIterator(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}};k.prototype.set=function(a,b){if(!r(a))throw Error("Invalid WeakMap key");
v(a);if(!$jscomp.owns(a,A))throw Error("WeakMap key fail: "+a);a[A][this.id_]=b;return this};k.prototype.get=function(a){return r(a)&&$jscomp.owns(a,A)?a[A][this.id_]:void 0};k.prototype.has=function(a){return r(a)&&$jscomp.owns(a,A)&&$jscomp.owns(a[A],this.id_)};k.prototype.delete=function(a){return r(a)&&$jscomp.owns(a,A)&&$jscomp.owns(a[A],this.id_)?delete a[A][this.id_]:!1};return k},"es6","es3");$jscomp.MapEntry=function(){};
$jscomp.polyfill("Map",function(m){function t(){if($jscomp.ASSUME_NO_NATIVE_MAP||!m||"function"!=typeof m||!m.prototype.entries||"function"!=typeof Object.seal)return!1;try{var k=Object.seal({x:4}),a=new m($jscomp.makeIterator([[k,"s"]]));if("s"!=a.get(k)||1!=a.size||a.get({x:4})||a.set({x:4},"t")!=a||2!=a.size)return!1;var b=a.entries(),c=b.next();if(c.done||c.value[0]!=k||"s"!=c.value[1])return!1;c=b.next();return c.done||4!=c.value[0].x||"t"!=c.value[1]||!b.next().done?!1:!0}catch(d){return!1}}
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(m&&$jscomp.ES6_CONFORMANCE)return m}else if(t())return m;var h=new WeakMap,r=function(k){this.data_={};this.head_=A();this.size=0;if(k){k=$jscomp.makeIterator(k);for(var a;!(a=k.next()).done;)a=a.value,this.set(a[0],a[1])}};r.prototype.set=function(k,a){k=0===k?0:k;var b=v(this,k);b.list||(b.list=this.data_[b.id]=[]);b.entry?b.entry.value=a:(b.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:k,value:a},b.list.push(b.entry),
this.head_.previous.next=b.entry,this.head_.previous=b.entry,this.size++);return this};r.prototype.delete=function(k){k=v(this,k);return k.entry&&k.list?(k.list.splice(k.index,1),k.list.length||delete this.data_[k.id],k.entry.previous.next=k.entry.next,k.entry.next.previous=k.entry.previous,k.entry.head=null,this.size--,!0):!1};r.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=A();this.size=0};r.prototype.has=function(k){return!!v(this,k).entry};r.prototype.get=function(k){return(k=
v(this,k).entry)&&k.value};r.prototype.entries=function(){return q(this,function(k){return[k.key,k.value]})};r.prototype.keys=function(){return q(this,function(k){return k.key})};r.prototype.values=function(){return q(this,function(k){return k.value})};r.prototype.forEach=function(k,a){for(var b=this.entries(),c;!(c=b.next()).done;)c=c.value,k.call(a,c[1],c[0],this)};r.prototype[Symbol.iterator]=r.prototype.entries;var v=function(k,a){var b=a&&typeof a;"object"==b||"function"==b?h.has(a)?b=h.get(a):
(b=""+ ++G,h.set(a,b)):b="p_"+a;var c=k.data_[b];if(c&&$jscomp.owns(k.data_,b))for(k=0;k<c.length;k++){var d=c[k];if(a!==a&&d.key!==d.key||a===d.key)return{id:b,list:c,index:k,entry:d}}return{id:b,list:c,index:-1,entry:void 0}},q=function(k,a){var b=k.head_;return $jscomp.iteratorPrototype(function(){if(b){for(;b.head!=k.head_;)b=b.previous;for(;b.next!=b.head;)return b=b.next,{done:!1,value:a(b)};b=null}return{done:!0,value:void 0}})},A=function(){var k={};return k.previous=k.next=k.head=k},G=0;
return r},"es6","es3");$jscomp.findInternal=function(m,t,h){m instanceof String&&(m=String(m));for(var r=m.length,v=0;v<r;v++){var q=m[v];if(t.call(h,q,v,m))return{i:v,v:q}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(m){return m?m:function(t,h){return $jscomp.findInternal(this,t,h).v}},"es6","es3");
$jscomp.iteratorFromArray=function(m,t){m instanceof String&&(m+="");var h=0,r={next:function(){if(h<m.length){var v=h++;return{value:t(v,m[v]),done:!1}}r.next=function(){return{done:!0,value:void 0}};return r.next()}};r[Symbol.iterator]=function(){return r};return r};$jscomp.polyfill("Array.prototype.keys",function(m){return m?m:function(){return $jscomp.iteratorFromArray(this,function(t){return t})}},"es6","es3");
$jscomp.polyfill("Array.prototype.findIndex",function(m){return m?m:function(t,h){return $jscomp.findInternal(this,t,h).i}},"es6","es3");
(function(){function m(k){h=k;r=k.fn.dataTable}function t(k){q=k;A=k.fn.dataTable}var h,r,v=function(){function k(a,b,c,d,e,g){var f=this;void 0===g&&(g=null);if(!r||!r.versionCheck||!r.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");if(!r.select)throw Error("SearchPane requires Select");a=new r.Api(a);this.classes=h.extend(!0,{},k.classes);this.c=h.extend(!0,{},k.defaults,b);this.customPaneSettings=g;this.s={cascadeRegen:!1,clearing:!1,colOpts:[],deselect:!1,displayed:!1,
dt:a,dtPane:void 0,filteringActive:!1,index:c,indexes:[],lastCascade:!1,lastSelect:!1,listSet:!1,name:void 0,redraw:!1,rowData:{arrayFilter:[],arrayOriginal:[],arrayTotals:[],bins:{},binsOriginal:{},binsTotal:{},filterMap:new Map,totalOptions:0},scrollTop:0,searchFunction:void 0,selectPresent:!1,serverSelect:[],serverSelecting:!1,showFiltered:!1,tableLength:null,updating:!1};b=a.columns().eq(0).toArray().length;this.colExists=this.s.index<b;this.c.layout=d;b=parseInt(d.split("-")[1],10);this.dom=
{buttonGroup:h("<div/>").addClass(this.classes.buttonGroup),clear:h('<button type="button">&#215;</button>').addClass(this.classes.dull).addClass(this.classes.paneButton).addClass(this.classes.clearButton),container:h("<div/>").addClass(this.classes.container).addClass(this.classes.layout+(10>b?d:d.split("-")[0]+"-9")),countButton:h('<button type="button"></button>').addClass(this.classes.paneButton).addClass(this.classes.countButton),dtP:h("<table><thead><tr><th>"+(this.colExists?h(a.column(this.colExists?
this.s.index:0).header()).text():this.customPaneSettings.header||"Custom Pane")+"</th><th/></tr></thead></table>"),lower:h("<div/>").addClass(this.classes.subRow2).addClass(this.classes.narrowButton),nameButton:h('<button type="button"></button>').addClass(this.classes.paneButton).addClass(this.classes.nameButton),panesContainer:e,searchBox:h("<input/>").addClass(this.classes.paneInputButton).addClass(this.classes.search),searchButton:h('<button type = "button" class="'+this.classes.searchIcon+'"></button>').addClass(this.classes.paneButton),
searchCont:h("<div/>").addClass(this.classes.searchCont),searchLabelCont:h("<div/>").addClass(this.classes.searchLabelCont),topRow:h("<div/>").addClass(this.classes.topRow),upper:h("<div/>").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 l=this.s.colOpts;d=h('<button type="button">X</button>').addClass(this.classes.paneButton);h(d).text(a.i18n("searchPanes.clearPane",
"X"));this.dom.container.addClass(l.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?h(a.column(this.s.index).header()).text():this.customPaneSettings.header||"Custom Pane";h(e).append(this.dom.container);var p=a.table(0).node();
this.s.searchFunction=function(n,x,z,y){if(0===f.selections.length||n.nTable!==p)return!0;n=null;f.colExists&&(n=x[f.s.index],"filter"!==l.orthogonal.filter&&(n=f.s.rowData.filterMap.get(z),n instanceof h.fn.dataTable.Api&&(n=n.toArray())));return f._search(n,z)};h.fn.dataTable.ext.search.push(this.s.searchFunction);if(this.c.clear)h(d).on("click",function(){f.dom.container.find(f.classes.search).each(function(){h(this).val("");h(this).trigger("input")});f.clearPane()});a.on("draw.dtsp",function(){f._adjustTopRow()});
a.on("buttons-action",function(){f._adjustTopRow()});h(window).on("resize.dtsp",r.util.throttle(function(){f._adjustTopRow()}));a.on("column-reorder.dtsp",function(n,x,z){f.s.index=z.mapping[f.s.index]});return this}k.prototype.clearData=function(){this.s.rowData={arrayFilter:[],arrayOriginal:[],arrayTotals:[],bins:{},binsOriginal:{},binsTotal:{},filterMap:new Map,totalOptions:0}};k.prototype.clearPane=function(){this.s.dtPane.rows({selected:!0}).deselect();this.updateTable();return this};k.prototype.destroy=
function(){h(this.s.dtPane).off(".dtsp");h(this.s.dt).off(".dtsp");h(this.dom.nameButton).off(".dtsp");h(this.dom.countButton).off(".dtsp");h(this.dom.clear).off(".dtsp");h(this.dom.searchButton).off(".dtsp");h(this.dom.container).remove();for(var a=h.fn.dataTable.ext.search.indexOf(this.s.searchFunction);-1!==a;)h.fn.dataTable.ext.search.splice(a,1),a=h.fn.dataTable.ext.search.indexOf(this.s.searchFunction);void 0!==this.s.dtPane&&this.s.dtPane.destroy();this.s.listSet=!1};k.prototype.getPaneCount=
function(){return void 0!==this.s.dtPane?this.s.dtPane.rows({selected:!0}).data().toArray().length:0};k.prototype.rebuildPane=function(a,b,c,d){void 0===a&&(a=!1);void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);this.clearData();var e=[];this.s.serverSelect=[];var g=null;void 0!==this.s.dtPane&&(d&&(this.s.dt.page.info().serverSide?this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray():e=this.s.dtPane.rows({selected:!0}).data().toArray()),this.s.dtPane.clear().destroy(),
g=h(this.dom.container).prev(),this.destroy(),this.s.dtPane=void 0,h.fn.dataTable.ext.search.push(this.s.searchFunction));this.dom.container.removeClass(this.classes.hidden);this.s.displayed=!1;this._buildPane(this.s.dt.page.info().serverSide?this.s.serverSelect:e,a,b,c,g);return this};k.prototype.removePane=function(){this.s.displayed=!1;h(this.dom.container).hide()};k.prototype.setCascadeRegen=function(a){this.s.cascadeRegen=a};k.prototype.setClear=function(a){this.s.clearing=a};k.prototype.updatePane=
function(a){void 0===a&&(a=!1);this.s.updating=!0;this._updateCommon(a);this.s.updating=!1};k.prototype.updateTable=function(){this.selections=this.s.dtPane.rows({selected:!0}).data().toArray();this._searchExtras();(this.c.cascadePanes||this.c.viewTotal)&&this.updatePane()};k.prototype._setListeners=function(){var a=this,b=this.s.rowData,c;this.s.dtPane.on("select.dtsp",function(){clearTimeout(c);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.scrollTop=h(a.s.dtPane.table().node()).parent()[0].scrollTop,a.s.selectPresent=!0,a.s.dt.draw(!1)):(h(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(){c=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&&
h(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(d,e,g){if(h.isEmptyObject(g))a.s.dtPane.state.clear();else{d=[];if(void 0!==a.s.dtPane){d=a.s.dtPane.rows({selected:!0}).data().map(function(x){return x.filter.toString()}).toArray();var f=h(a.dom.searchBox).val();var l=a.s.dtPane.order();var p=b.binsOriginal;var n=b.arrayOriginal}void 0===g.searchPanes&&(g.searchPanes={});void 0===g.searchPanes.panes&&
(g.searchPanes.panes=[]);for(e=0;e<g.searchPanes.panes.length;e++)g.searchPanes.panes[e].id===a.s.index&&(g.searchPanes.panes.splice(e,1),e--);g.searchPanes.panes.push({arrayFilter:n,bins:p,id:a.s.index,order:l,searchTerm:f,selected:d})}});this.s.dtPane.on("user-select.dtsp",function(d,e,g,f,l){l.stopPropagation()});this.s.dtPane.on("draw.dtsp",function(){a._adjustTopRow()});h(this.dom.nameButton).on("click.dtsp",function(){var d=a.s.dtPane.order()[0][1];a.s.dtPane.order([0,"asc"===d?"desc":"asc"]).draw();
a.s.dt.state.save()});h(this.dom.countButton).on("click.dtsp",function(){var d=a.s.dtPane.order()[0][1];a.s.dtPane.order([1,"asc"===d?"desc":"asc"]).draw();a.s.dt.state.save()});h(this.dom.clear).on("click.dtsp",function(){a.dom.container.find("."+a.classes.search).each(function(){h(this).val("");h(this).trigger("input")});a.clearPane()});h(this.dom.searchButton).on("click.dtsp",function(){h(a.dom.searchBox).focus()});h(this.dom.searchBox).on("input.dtsp",function(){a.s.dtPane.search(h(a.dom.searchBox).val()).draw();
a.s.dt.state.save()});this.s.dt.state.save();return!0};k.prototype._addOption=function(a,b,c,d,e,g){if(Array.isArray(a)||a instanceof r.Api)if(a instanceof r.Api&&(a=a.toArray(),b=b.toArray()),a.length===b.length)for(var f=0;f<a.length;f++)g[a[f]]?g[a[f]]++:(g[a[f]]=1,e.push({display:b[f],filter:a[f],sort:c[f],type:d[f]})),this.s.rowData.totalOptions++;else throw Error("display and filter not the same length");else"string"===typeof this.s.colOpts.orthogonal?(g[a]?g[a]++:(g[a]=1,e.push({display:b,
filter:a,sort:c,type:d})),this.s.rowData.totalOptions++):e.push({display:b,filter:a,sort:c,type:d})};k.prototype._addRow=function(a,b,c,d,e,g,f){for(var l,p=0,n=this.s.indexes;p<n.length;p++){var x=n[p];x.filter===b&&(l=x.index)}void 0===l&&(l=this.s.indexes.length,this.s.indexes.push({filter:b,index:l}));return this.s.dtPane.row.add({className:f,display:""!==a?a:!1!==this.s.colOpts.emptyMessage?this.s.colOpts.emptyMessage:this.c.emptyMessage,filter:b,index:l,shown:c,sort:""!==e?e:!1!==this.s.colOpts.emptyMessage?
this.s.colOpts.emptyMessage:this.c.emptyMessage,total:d,type:g})};k.prototype._adjustTopRow=function(){var a=this.dom.container.find("."+this.classes.subRowsContainer),b=this.dom.container.find(".dtsp-subRow1"),c=this.dom.container.find(".dtsp-subRow2"),d=this.dom.container.find("."+this.classes.topRow);(252>h(a[0]).width()||252>h(d[0]).width())&&0!==h(a[0]).width()?(h(a[0]).addClass(this.classes.narrow),h(b[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowSearch),h(c[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowButton)):
(h(a[0]).removeClass(this.classes.narrow),h(b[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowSearch),h(c[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowButton))};k.prototype._buildPane=function(a,b,c,d,e){var g=this;void 0===a&&(a=[]);void 0===b&&(b=!1);void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=null);this.selections=[];var f=this.s.dt,l=f.column(this.colExists?this.s.index:0),p=this.s.colOpts,n=this.s.rowData,x=f.i18n("searchPanes.count","{total}"),
z=f.i18n("searchPanes.countFiltered","{shown} ({total})"),y=f.state.loaded();this.s.listSet&&(y=f.state());if(this.colExists){var w=-1;if(y&&y.searchPanes&&y.searchPanes.panes)for(var u=0;u<y.searchPanes.panes.length;u++)if(y.searchPanes.panes[u].id===this.s.index){w=u;break}if((!1===p.show||void 0!==p.show&&!0!==p.show)&&-1===w)return this.dom.container.addClass(this.classes.hidden),this.s.displayed=!1;if(!0===p.show||-1!==w)this.s.displayed=!0;if(!this.s.dt.page.info().serverSide&&(null===c||null===
c.searchPanes||null===c.searchPanes.options)){if(0===n.arrayFilter.length){this._populatePane(b);this.s.rowData.totalOptions=0;this._detailsPane();if(y&&y.searchPanes&&y.searchPanes.panes&&-1===w){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}n.arrayOriginal=n.arrayTotals;n.binsOriginal=n.binsTotal}u=Object.keys(n.binsOriginal).length;b=this._uniqueRatio(u,f.rows()[0].length);if(!1===this.s.displayed&&((void 0===p.show&&null===p.threshold?b>this.c.threshold:b>p.threshold)||
!0!==p.show&&1>=u)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.c.viewTotal&&0===n.arrayTotals.length?(this.s.rowData.totalOptions=0,this._detailsPane()):n.binsTotal=n.bins;this.dom.container.addClass(this.classes.show);this.s.displayed=!0}else if(null!==c&&null!==c.searchPanes&&null!==c.searchPanes.options){if(void 0!==c.tableLength)this.s.tableLength=c.tableLength,this.s.rowData.totalOptions=this.s.tableLength;else if(null===this.s.tableLength||f.rows()[0].length>
this.s.tableLength)this.s.tableLength=f.rows()[0].length,this.s.rowData.totalOptions=this.s.tableLength;b=f.column(this.s.index).dataSrc();if(void 0!==c.searchPanes.options[b])for(u=0,b=c.searchPanes.options[b];u<b.length;u++)w=b[u],this.s.rowData.arrayFilter.push({display:w.label,filter:w.value,sort:w.label,type:w.label}),this.s.rowData.bins[w.value]=this.c.viewTotal||this.c.cascadePanes?w.count:w.total,this.s.rowData.binsTotal[w.value]=w.total;u=Object.keys(n.binsTotal).length;b=this._uniqueRatio(u,
this.s.tableLength);if(!1===this.s.displayed&&((void 0===p.show&&null===p.threshold?b>this.c.threshold:b>p.threshold)||!0!==p.show&&1>=u)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.s.rowData.arrayOriginal=this.s.rowData.arrayFilter;this.s.rowData.binsOriginal=this.s.rowData.bins;this.s.displayed=!0}}else this.s.displayed=!0;this._displayPane();if(!this.s.listSet)this.dom.dtP.on("stateLoadParams.dt",function(E,F,D){h.isEmptyObject(f.state.loaded())&&h.each(D,
function(C,I){delete D[C]})});null!==e&&0<h(this.dom.panesContainer).has(e).length?h(this.dom.container).insertAfter(e):h(this.dom.panesContainer).prepend(this.dom.container);u=h.fn.dataTable.ext.errMode;h.fn.dataTable.ext.errMode="none";e=r.Scroller;this.s.dtPane=h(this.dom.dtP).DataTable(h.extend(!0,{columnDefs:[{className:"dtsp-nameColumn",data:"display",render:function(E,F,D){if("sort"===F)return D.sort;if("type"===F)return D.type;var C;(g.s.filteringActive||g.s.showFiltered)&&g.c.viewTotal?C=
z.replace(/{total}/,D.total):C=x.replace(/{total}/,D.total);for(C=C.replace(/{shown}/,D.shown);-1!==C.indexOf("{total}");)C=C.replace(/{total}/,D.total);for(;-1!==C.indexOf("{shown}");)C=C.replace(/{shown}/,D.shown);F='<span class="'+g.classes.pill+'">'+C+"</span>";if(g.c.hideCount||p.hideCount)F="";return'<div class="'+g.classes.nameCont+'"><span title="'+("string"===typeof E&&null!==E.match(/<[^>]*>/)?E.replace(/<[^>]*>/g,""):E)+'" class="'+g.classes.name+'">'+E+"</span>"+F+"</div>"},targets:0,
type:void 0!==f.settings()[0].aoColumns[this.s.index]?f.settings()[0].aoColumns[this.s.index]._sManualType:null},{className:"dtsp-countColumn "+this.classes.badgePill,data:"shown",orderData:[1,2],targets:1,visible:!1},{data:"total",targets:2,visible:!1}],deferRender:!0,dom:"t",info:!1,language:this.s.dt.settings()[0].oLanguage,paging:e?!0:!1,scrollX:!1,scrollY:"200px",scroller:e?!0:!1,select:!0,stateSave:f.settings()[0].oFeatures.bStateSave?!0:!1},this.c.dtOpts,void 0!==p?p.dtOpts:{},void 0===this.s.colOpts.options&&
this.colExists?void 0:{createdRow:function(E,F,D){h(E).addClass(F.className)}},null!==this.customPaneSettings&&void 0!==this.customPaneSettings.dtOpts?this.customPaneSettings.dtOpts:{}));h(this.dom.dtP).addClass(this.classes.table);h(this.dom.searchBox).attr("placeholder",void 0!==p.header?p.header:this.colExists?f.settings()[0].aoColumns[this.s.index].sTitle:this.customPaneSettings.header||"Custom Pane");h.fn.dataTable.select.init(this.s.dtPane);h.fn.dataTable.ext.errMode=u;if(this.colExists){l=
(l=l.search())?l.substr(1,l.length-2).split("|"):[];var B=0;n.arrayFilter.forEach(function(E){""===E.filter&&B++});u=0;for(e=n.arrayFilter.length;u<e;u++){l=!1;w=0;for(var H=this.s.serverSelect;w<H.length;w++)b=H[w],b.filter===n.arrayFilter[u].filter&&(l=!0);if(this.s.dt.page.info().serverSide&&(!this.c.cascadePanes||this.c.cascadePanes&&0!==n.bins[n.arrayFilter[u].filter]||this.c.cascadePanes&&null!==d||l))for(l=this._addRow(n.arrayFilter[u].display,n.arrayFilter[u].filter,d?n.binsTotal[n.arrayFilter[u].filter]:
n.bins[n.arrayFilter[u].filter],this.c.viewTotal||d?String(n.binsTotal[n.arrayFilter[u].filter]):n.bins[n.arrayFilter[u].filter],n.arrayFilter[u].sort,n.arrayFilter[u].type),w=0,H=this.s.serverSelect;w<H.length;w++)b=H[w],b.filter===n.arrayFilter[u].filter&&(this.s.serverSelecting=!0,l.select(),this.s.serverSelecting=!1);else this.s.dt.page.info().serverSide||!n.arrayFilter[u]||void 0===n.bins[n.arrayFilter[u].filter]&&this.c.cascadePanes?this.s.dt.page.info().serverSide||this._addRow("",B,B,"","",
""):this._addRow(n.arrayFilter[u].display,n.arrayFilter[u].filter,n.bins[n.arrayFilter[u].filter],n.binsTotal[n.arrayFilter[u].filter],n.arrayFilter[u].sort,n.arrayFilter[u].type)}}r.select.init(this.s.dtPane);(void 0!==p.options||null!==this.customPaneSettings&&void 0!==this.customPaneSettings.options)&&this._getComparisonRows();this.s.dtPane.draw();this._adjustTopRow();this.s.listSet||(this._setListeners(),this.s.listSet=!0);for(d=0;d<a.length;d++)if(n=a[d],void 0!==n)for(u=0,e=this.s.dtPane.rows().indexes().toArray();u<
e.length;u++)l=e[u],void 0!==this.s.dtPane.row(l).data()&&n.filter===this.s.dtPane.row(l).data().filter&&(this.s.dt.page.info().serverSide?(this.s.serverSelecting=!0,this.s.dtPane.row(l).select(),this.s.serverSelecting=!1):this.s.dtPane.row(l).select());this.s.dt.page.info().serverSide&&this.s.dtPane.search(h(this.dom.searchBox).val()).draw();if(y&&y.searchPanes&&y.searchPanes.panes&&(null===c||1===c.draw))for(this.c.cascadePanes||this._reloadSelect(y),c=0,y=y.searchPanes.panes;c<y.length;c++)a=y[c],
a.id===this.s.index&&(h(this.dom.searchBox).val(a.searchTerm),h(this.dom.searchBox).trigger("input"),this.s.dtPane.order(a.order).draw());this.s.dt.state.save();return!0};k.prototype._detailsPane=function(){var a=this.s.dt;this.s.rowData.arrayTotals=[];this.s.rowData.binsTotal={};var b=this.s.dt.settings()[0];a=a.rows().indexes();if(!this.s.dt.page.info().serverSide)for(var c=0;c<a.length;c++)this._populatePaneArray(a[c],this.s.rowData.arrayTotals,b,this.s.rowData.binsTotal)};k.prototype._displayPane=
function(){var a=this.dom.container,b=this.s.colOpts,c=parseInt(this.c.layout.split("-")[1],10);h(this.dom.topRow).empty();h(this.dom.dtP).empty();h(this.dom.topRow).addClass(this.classes.topRow);3<c&&h(this.dom.container).addClass(this.classes.smallGap);h(this.dom.topRow).addClass(this.classes.subRowsContainer);h(this.dom.upper).appendTo(this.dom.topRow);h(this.dom.lower).appendTo(this.dom.topRow);h(this.dom.searchCont).appendTo(this.dom.upper);h(this.dom.buttonGroup).appendTo(this.dom.lower);(!1===
this.c.dtOpts.searching||void 0!==b.dtOpts&&!1===b.dtOpts.searching||!this.c.controls||!b.controls||null!==this.customPaneSettings&&void 0!==this.customPaneSettings.dtOpts&&void 0!==this.customPaneSettings.dtOpts.searching&&!this.customPaneSettings.dtOpts.searching)&&h(this.dom.searchBox).attr("disabled","disabled").removeClass(this.classes.paneInputButton).addClass(this.classes.disabledButton);h(this.dom.searchBox).appendTo(this.dom.searchCont);this._searchContSetup();this.c.clear&&this.c.controls&&
b.controls&&h(this.dom.clear).appendTo(this.dom.buttonGroup);this.c.orderable&&b.orderable&&this.c.controls&&b.controls&&h(this.dom.nameButton).appendTo(this.dom.buttonGroup);!this.c.hideCount&&!b.hideCount&&this.c.orderable&&b.orderable&&this.c.controls&&b.controls&&h(this.dom.countButton).appendTo(this.dom.buttonGroup);h(this.dom.topRow).prependTo(this.dom.container);h(a).append(this.dom.dtP);h(a).show()};k.prototype._getBonusOptions=function(){return h.extend(!0,{},k.defaults,{orthogonal:{threshold:null},
threshold:null},void 0!==this.c?this.c:{})};k.prototype._getComparisonRows=function(){var a=this.s.colOpts;a=void 0!==a.options?a.options:null!==this.customPaneSettings&&void 0!==this.customPaneSettings.options?this.customPaneSettings.options:void 0;if(void 0!==a){var b=this.s.dt.rows({search:"applied"}).data().toArray(),c=this.s.dt.rows({search:"applied"}),d=this.s.dt.rows().data().toArray(),e=this.s.dt.rows(),g=[];this.s.dtPane.clear();for(var f=0;f<a.length;f++){var l=a[f],p=""!==l.label?l.label:
this.c.emptyMessage,n=l.className,x=p,z="function"===typeof l.value?l.value:[],y=0,w=p,u=0;if("function"===typeof l.value){for(var B=0;B<b.length;B++)l.value.call(this.s.dt,b[B],c[0][B])&&y++;for(B=0;B<d.length;B++)l.value.call(this.s.dt,d[B],e[0][B])&&u++;"function"!==typeof z&&z.push(l.filter)}(!this.c.cascadePanes||this.c.cascadePanes&&0!==y)&&g.push(this._addRow(x,z,y,u,w,p,n))}return g}};k.prototype._getOptions=function(){return h.extend(!0,{},k.defaults,{emptyMessage:!1,orthogonal:{threshold:null},
threshold:null},this.s.dt.settings()[0].aoColumns[this.s.index].searchPanes)};k.prototype._makeSelection=function(){this.updateTable();this.s.updating=!0;this.s.dt.draw();this.s.updating=!1};k.prototype._populatePane=function(a){void 0===a&&(a=!1);var b=this.s.dt;this.s.rowData.arrayFilter=[];this.s.rowData.bins={};var c=this.s.dt.settings()[0];if(!this.s.dt.page.info().serverSide){var d=0;for(a=(!this.c.cascadePanes&&!this.c.viewTotal||this.s.clearing||a?b.rows().indexes():b.rows({search:"applied"}).indexes()).toArray();d<
a.length;d++)this._populatePaneArray(a[d],this.s.rowData.arrayFilter,c)}};k.prototype._populatePaneArray=function(a,b,c,d){void 0===d&&(d=this.s.rowData.bins);var e=this.s.colOpts;if("string"===typeof e.orthogonal)c=c.oApi._fnGetCellData(c,a,this.s.index,e.orthogonal),this.s.rowData.filterMap.set(a,c),this._addOption(c,c,c,c,b,d);else{var g=c.oApi._fnGetCellData(c,a,this.s.index,e.orthogonal.search);null===g&&(g="");"string"===typeof g&&(g=g.replace(/<[^>]*>/g,""));this.s.rowData.filterMap.set(a,
g);d[g]?d[g]++:(d[g]=1,this._addOption(g,c.oApi._fnGetCellData(c,a,this.s.index,e.orthogonal.display),c.oApi._fnGetCellData(c,a,this.s.index,e.orthogonal.sort),c.oApi._fnGetCellData(c,a,this.s.index,e.orthogonal.type),b,d));this.s.rowData.totalOptions++}};k.prototype._reloadSelect=function(a){if(void 0!==a){for(var b,c=0;c<a.searchPanes.panes.length;c++)if(a.searchPanes.panes[c].id===this.s.index){b=c;break}if(void 0!==b){c=this.s.dtPane;var d=c.rows({order:"index"}).data().map(function(f){return null!==
f.filter?f.filter.toString():null}).toArray(),e=0;for(a=a.searchPanes.panes[b].selected;e<a.length;e++){b=a[e];var g=-1;null!==b&&(g=d.indexOf(b.toString()));-1<g&&(this.s.serverSelecting=!0,c.row(g).select(),this.s.serverSelecting=!1)}}}};k.prototype._search=function(a,b){for(var c=this.s.colOpts,d=this.s.dt,e=0,g=this.selections;e<g.length;e++){var f=g[e];"string"===typeof f.filter&&(f.filter=f.filter.replaceAll("&amp;","&"));if(Array.isArray(a)){if(-1!==a.indexOf(f.filter))return!0}else if("function"===
typeof f.filter)if(f.filter.call(d,d.row(b).data(),b)){if("or"===c.combiner)return!0}else{if("and"===c.combiner)return!1}else if(a===f.filter||("string"!==typeof a||0!==a.length)&&a==f.filter||null===f.filter&&"string"===typeof a&&""===a)return!0}return"and"===c.combiner?!0:!1};k.prototype._searchContSetup=function(){this.c.controls&&this.s.colOpts.controls&&h(this.dom.searchButton).appendTo(this.dom.searchLabelCont);!1===this.c.dtOpts.searching||!1===this.s.colOpts.dtOpts.searching||null!==this.customPaneSettings&&
void 0!==this.customPaneSettings.dtOpts&&void 0!==this.customPaneSettings.dtOpts.searching&&!this.customPaneSettings.dtOpts.searching||h(this.dom.searchLabelCont).appendTo(this.dom.searchCont)};k.prototype._searchExtras=function(){var a=this.s.updating;this.s.updating=!0;var b=this.s.dtPane.rows({selected:!0}).data().pluck("filter").toArray(),c=b.indexOf(!1!==this.s.colOpts.emptyMessage?this.s.colOpts.emptyMessage:this.c.emptyMessage),d=h(this.s.dtPane.table().container());-1<c&&(b[c]="");0<b.length?
d.addClass(this.classes.selected):0===b.length&&d.removeClass(this.classes.selected);this.s.updating=a};k.prototype._uniqueRatio=function(a,b){return 0<b&&(0<this.s.rowData.totalOptions&&!this.s.dt.page.info().serverSide||this.s.dt.page.info().serverSide&&0<this.s.tableLength)?a/this.s.rowData.totalOptions:1};k.prototype._updateCommon=function(a){void 0===a&&(a=!1);if(!(this.s.dt.page.info().serverSide||void 0===this.s.dtPane||this.s.filteringActive&&!this.c.cascadePanes&&!0!==a||!0===this.c.cascadePanes&&
!0===this.s.selectPresent||this.s.lastSelect&&this.s.lastCascade)){var b=this.s.colOpts,c=this.s.dtPane.rows({selected:!0}).data().toArray();a=h(this.s.dtPane.table().node()).parent()[0].scrollTop;var d=this.s.rowData;this.s.dtPane.clear();if(this.colExists){0===d.arrayFilter.length?this._populatePane():this.c.cascadePanes&&this.s.dt.rows().data().toArray().length===this.s.dt.rows({search:"applied"}).data().toArray().length?(d.arrayFilter=d.arrayOriginal,d.bins=d.binsOriginal):(this.c.viewTotal||
this.c.cascadePanes)&&this._populatePane();this.c.viewTotal?this._detailsPane():d.binsTotal=d.bins;this.c.viewTotal&&!this.c.cascadePanes&&(d.arrayFilter=d.arrayTotals);for(var e=function(p){if(p&&(void 0!==d.bins[p.filter]&&0!==d.bins[p.filter]&&g.c.cascadePanes||!g.c.cascadePanes||g.s.clearing)){var n=g._addRow(p.display,p.filter,g.c.viewTotal?void 0!==d.bins[p.filter]?d.bins[p.filter]:0:d.bins[p.filter],g.c.viewTotal?String(d.binsTotal[p.filter]):d.bins[p.filter],p.sort,p.type),x=c.findIndex(function(z){return z.filter===
p.filter});-1!==x&&(n.select(),c.splice(x,1))}},g=this,f=0,l=d.arrayFilter;f<l.length;f++)e(l[f])}if(void 0!==b.searchPanes&&void 0!==b.searchPanes.options||void 0!==b.options||null!==this.customPaneSettings&&void 0!==this.customPaneSettings.options)for(e=function(p){var n=c.findIndex(function(x){if(x.display===p.data().display)return!0});-1!==n&&(p.select(),c.splice(n,1))},f=0,l=this._getComparisonRows();f<l.length;f++)b=l[f],e(b);for(e=0;e<c.length;e++)b=c[e],b=this._addRow(b.display,b.filter,0,
this.c.viewTotal?b.total:0,b.display,b.display),this.s.updating=!0,b.select(),this.s.updating=!1;this.s.dtPane.draw();this.s.dtPane.table().node().parentNode.scrollTop=a}};k.version="1.1.0";k.classes={buttonGroup:"dtsp-buttonGroup",buttonSub:"dtsp-buttonSub",clear:"dtsp-clear",clearAll:"dtsp-clearAll",clearButton:"clearButton",container:"dtsp-searchPane",countButton:"dtsp-countButton",disabledButton:"dtsp-disabledButton",dull:"dtsp-dull",hidden:"dtsp-hidden",hide:"dtsp-hide",layout:"dtsp-",name:"dtsp-name",
nameButton:"dtsp-nameButton",nameCont:"dtsp-nameCont",narrow:"dtsp-narrow",paneButton:"dtsp-paneButton",paneInputButton:"dtsp-paneInputButton",pill:"dtsp-pill",search:"dtsp-search",searchCont:"dtsp-searchCont",searchIcon:"dtsp-searchIcon",searchLabelCont:"dtsp-searchButtonCont",selected:"dtsp-selected",smallGap:"dtsp-smallGap",subRow1:"dtsp-subRow1",subRow2:"dtsp-subRow2",subRowsContainer:"dtsp-subRowsContainer",title:"dtsp-title",topRow:"dtsp-topRow"};k.defaults={cascadePanes:!1,clear:!0,combiner:"or",
controls:!0,container:function(a){return a.table().container()},dtOpts:{},emptyMessage:"<i>No Data</i>",hideCount:!1,layout:"columns-3",name:void 0,orderable:!0,orthogonal:{display:"display",filter:"filter",hideCount:!1,search:"filter",show:void 0,sort:"sort",threshold:.6,type:"type"},preSelect:[],threshold:.6,viewTotal:!1};return k}(),q,A,G=function(){function k(a,b,c){var d=this;void 0===c&&(c=!1);this.regenerating=!1;if(!A||!A.versionCheck||!A.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");
if(!A.select)throw Error("SearchPane requires Select");var e=new A.Api(a);this.classes=q.extend(!0,{},k.classes);this.c=q.extend(!0,{},k.defaults,b);this.dom={clearAll:q('<button type="button">Clear All</button>').addClass(this.classes.clearAll),container:q("<div/>").addClass(this.classes.panes).text(e.i18n("searchPanes.loadMessage","Loading Search Panes...")),emptyMessage:q("<div/>").addClass(this.classes.emptyMessage),options:q("<div/>").addClass(this.classes.container),panes:q("<div/>").addClass(this.classes.container),
title:q("<div/>").addClass(this.classes.title),titleRow:q("<div/>").addClass(this.classes.titleRow),wrapper:q("<div/>")};this.s={colOpts:[],dt:e,filterCount:0,filterPane:-1,page:0,panes:[],selectionList:[],serverData:{},stateRead:!1,updating:!1};if(void 0===e.settings()[0]._searchPanes){this._getState();if(this.s.dt.page.info().serverSide)e.on("preXhr.dt",function(g,f,l){void 0===l.searchPanes&&(l.searchPanes={});g=0;for(f=d.s.selectionList;g<f.length;g++){var p=f[g],n=d.s.dt.column(p.index).dataSrc();
void 0===l.searchPanes[n]&&(l.searchPanes[n]={});for(var x=0;x<p.rows.length;x++)l.searchPanes[n][x]=p.rows[x].filter}});e.on("xhr",function(g,f,l,p){l&&l.searchPanes&&l.searchPanes.options&&(d.s.serverData=l,d.s.serverData.tableLength=l.recordsTotal,d._serverTotals())});e.settings()[0]._searchPanes=this;this.dom.clearAll.text(e.i18n("searchPanes.clearMessage","Clear All"));if(this.s.dt.settings()[0]._bInitComplete||c)this._paneDeclare(e,a,b);else e.one("preInit.dt",function(g){d._paneDeclare(e,a,
b)});return this}}k.prototype.clearSelections=function(){this.dom.container.find(this.classes.search).each(function(){q(this).val("");q(this).trigger("input")});for(var a=[],b=0,c=this.s.panes;b<c.length;b++){var d=c[b];void 0!==d.s.dtPane&&a.push(d.clearPane())}this.s.dt.draw();return a};k.prototype.getNode=function(){return this.dom.container};k.prototype.rebuild=function(a,b){void 0===a&&(a=!1);void 0===b&&(b=!1);q(this.dom.emptyMessage).remove();var c=[];!1===a&&q(this.dom.panes).empty();for(var d=
0,e=this.s.panes;d<e.length;d++){var g=e[d];if(!1===a||g.s.index===a)g.clearData(),c.push(g.rebuildPane(void 0!==this.s.selectionList[this.s.selectionList.length-1]?g.s.index===this.s.selectionList[this.s.selectionList.length-1].index:!1,this.s.dt.page.info().serverSide?this.s.serverData:void 0,null,b)),q(this.dom.panes).append(g.dom.container)}this.s.dt.page.info().serverSide||this.s.dt.draw();this.c.cascadePanes||this.c.viewTotal?this.redrawPanes(!0):this._updateSelection();this._updateFilterCount();
this._attachPaneContainer();this.s.dt.draw();return 1===c.length?c[0]:c};k.prototype.redrawPanes=function(a){void 0===a&&(a=!1);var b=this.s.dt;if(!this.s.updating&&!this.s.dt.page.info().serverSide){var c=!0,d=this.s.filterPane;if(b.rows({search:"applied"}).data().toArray().length===b.rows().data().toArray().length)c=!1;else if(this.c.viewTotal)for(var e=0,g=this.s.panes;e<g.length;e++){var f=g[e];if(void 0!==f.s.dtPane){var l=f.s.dtPane.rows({selected:!0}).data().toArray().length;if(0===l)for(var p=
0,n=this.s.selectionList;p<n.length;p++){var x=n[p];x.index===f.s.index&&0!==x.rows.length&&(l=x.rows.length)}0<l&&-1===d?d=f.s.index:0<l&&(d=null)}}g=void 0;e=[];if(this.regenerating){g=-1;1===e.length&&(g=e[0].index);a=0;for(e=this.s.panes;a<e.length;a++)if(f=e[a],void 0!==f.s.dtPane){b=!0;f.s.filteringActive=!0;if(-1!==d&&null!==d&&d===f.s.index||!1===c||f.s.index===g)b=!1,f.s.filteringActive=!1;f.updatePane(b?c:b)}this._updateFilterCount()}else{l=0;for(p=this.s.panes;l<p.length;l++)if(f=p[l],
f.s.selectPresent){this.s.selectionList.push({index:f.s.index,rows:f.s.dtPane.rows({selected:!0}).data().toArray(),protect:!1});b.state.save();break}else f.s.deselect&&(g=f.s.index,n=f.s.dtPane.rows({selected:!0}).data().toArray(),0<n.length&&this.s.selectionList.push({index:f.s.index,rows:n,protect:!0}));if(0<this.s.selectionList.length)for(b=this.s.selectionList[this.s.selectionList.length-1].index,l=0,p=this.s.panes;l<p.length;l++)f=p[l],f.s.lastSelect=f.s.index===b;for(f=0;f<this.s.selectionList.length;f++)if(this.s.selectionList[f].index!==
g||!0===this.s.selectionList[f].protect){b=!1;for(l=f+1;l<this.s.selectionList.length;l++)this.s.selectionList[l].index===this.s.selectionList[f].index&&(b=!0);b||(e.push(this.s.selectionList[f]),this.s.selectionList[f].protect=!1)}g=-1;1===e.length&&(g=e[0].index);l=0;for(p=this.s.panes;l<p.length;l++)if(f=p[l],void 0!==f.s.dtPane){b=!0;f.s.filteringActive=!0;if(-1!==d&&null!==d&&d===f.s.index||!1===c||f.s.index===g)b=!1,f.s.filteringActive=!1;f.updatePane(b?c:!1)}this._updateFilterCount();if(0<
e.length&&(e.length<this.s.selectionList.length||a))for(this._cascadeRegen(e),b=e[e.length-1].index,d=0,a=this.s.panes;d<a.length;d++)f=a[d],f.s.lastSelect=f.s.index===b;else if(0<e.length)for(f=0,a=this.s.panes;f<a.length;f++)if(e=a[f],void 0!==e.s.dtPane){b=!0;e.s.filteringActive=!0;if(-1!==d&&null!==d&&d===e.s.index||!1===c)b=!1,e.s.filteringActive=!1;e.updatePane(b?c:b)}}c||(this.s.selectionList=[])}};k.prototype._attach=function(){var a=this;q(this.dom.container).removeClass(this.classes.hide);
q(this.dom.titleRow).removeClass(this.classes.hide);q(this.dom.titleRow).remove();q(this.dom.title).appendTo(this.dom.titleRow);this.c.clear&&(q(this.dom.clearAll).appendTo(this.dom.titleRow),q(this.dom.clearAll).on("click.dtsps",function(){a.clearSelections()}));q(this.dom.titleRow).appendTo(this.dom.container);for(var b=0,c=this.s.panes;b<c.length;b++)q(c[b].dom.container).appendTo(this.dom.panes);q(this.dom.panes).appendTo(this.dom.container);0===q("div."+this.classes.container).length&&q(this.dom.container).prependTo(this.s.dt);
return this.dom.container};k.prototype._attachExtras=function(){q(this.dom.container).removeClass(this.classes.hide);q(this.dom.titleRow).removeClass(this.classes.hide);q(this.dom.titleRow).remove();q(this.dom.title).appendTo(this.dom.titleRow);this.c.clear&&q(this.dom.clearAll).appendTo(this.dom.titleRow);q(this.dom.titleRow).appendTo(this.dom.container);return this.dom.container};k.prototype._attachMessage=function(){try{var a=this.s.dt.i18n("searchPanes.emptyPanes","No SearchPanes")}catch(b){a=
null}if(null===a)q(this.dom.container).addClass(this.classes.hide),q(this.dom.titleRow).removeClass(this.classes.hide);else return q(this.dom.container).removeClass(this.classes.hide),q(this.dom.titleRow).addClass(this.classes.hide),q(this.dom.emptyMessage).text(a),this.dom.emptyMessage.appendTo(this.dom.container),this.dom.container};k.prototype._attachPaneContainer=function(){for(var a=0,b=this.s.panes;a<b.length;a++)if(!0===b[a].s.displayed)return this._attach();return this._attachMessage()};k.prototype._cascadeRegen=
function(a){this.regenerating=!0;var b=-1;1===a.length&&(b=a[0].index);for(var c=0,d=this.s.panes;c<d.length;c++){var e=d[c];e.setCascadeRegen(!0);e.setClear(!0);(void 0!==e.s.dtPane&&e.s.index===b||void 0!==e.s.dtPane)&&e.clearPane();e.setClear(!1)}this._makeCascadeSelections(a);this.s.selectionList=a;a=0;for(b=this.s.panes;a<b.length;a++)e=b[a],e.setCascadeRegen(!1);this.regenerating=!1};k.prototype._checkMessage=function(){for(var a=0,b=this.s.panes;a<b.length;a++)if(!0===b[a].s.displayed)return;
return this._attachMessage()};k.prototype._getState=function(){var a=this.s.dt.state.loaded();a&&a.searchPanes&&void 0!==a.searchPanes.selectionList&&(this.s.selectionList=a.searchPanes.selectionList)};k.prototype._makeCascadeSelections=function(a){for(var b=0;b<a.length;b++)for(var c=function(f){if(f.s.index===a[b].index&&void 0!==f.s.dtPane){b===a.length-1&&(f.s.lastCascade=!0);0<f.s.dtPane.rows({selected:!0}).data().toArray().length&&void 0!==f.s.dtPane&&(f.setClear(!0),f.clearPane(),f.setClear(!1));
for(var l=function(x){f.s.dtPane.rows().every(function(z){void 0!==f.s.dtPane.row(z).data()&&void 0!==x&&f.s.dtPane.row(z).data().filter===x.filter&&f.s.dtPane.row(z).select()})},p=0,n=a[b].rows;p<n.length;p++)l(n[p]);d._updateFilterCount();f.s.lastCascade=!1}},d=this,e=0,g=this.s.panes;e<g.length;e++)c(g[e]);this.s.dt.state.save()};k.prototype._paneDeclare=function(a,b,c){var d=this;a.columns(0<this.c.columns.length?this.c.columns:void 0).eq(0).each(function(l){d.s.panes.push(new v(b,c,l,d.c.layout,
d.dom.panes))});for(var e=a.columns().eq(0).toArray().length,g=this.c.panes.length,f=0;f<g;f++)this.s.panes.push(new v(b,c,e+f,this.c.layout,this.dom.panes,this.c.panes[f]));if(0<this.c.order.length)for(e=this.c.order.map(function(l,p,n){return d._findPane(l)}),this.dom.panes.empty(),this.s.panes=e,e=0,g=this.s.panes;e<g.length;e++)this.dom.panes.append(g[e].dom.container);this.s.dt.settings()[0]._bInitComplete?this._startup(a):this.s.dt.settings()[0].aoInitComplete.push({fn:function(){d._startup(a)}})};
k.prototype._findPane=function(a){for(var b=0,c=this.s.panes;b<c.length;b++){var d=c[b];if(a===d.s.name)return d}};k.prototype._serverTotals=function(){for(var a=!1,b=!1,c=this.s.dt,d=0,e=this.s.panes;d<e.length;d++){var g=e[d];if(g.s.selectPresent){this.s.selectionList.push({index:g.s.index,rows:g.s.dtPane.rows({selected:!0}).data().toArray(),protect:!1});c.state.save();g.s.selectPresent=!1;a=!0;break}else g.s.deselect&&(b=g.s.dtPane.rows({selected:!0}).data().toArray(),0<b.length&&this.s.selectionList.push({index:g.s.index,
rows:b,protect:!0}),b=a=!0)}if(a){c=[];for(d=0;d<this.s.selectionList.length;d++){g=!1;for(e=d+1;e<this.s.selectionList.length;e++)this.s.selectionList[e].index===this.s.selectionList[d].index&&(g=!0);if(!g){e=!1;a=0;for(var f=this.s.panes;a<f.length;a++)g=f[a],g.s.index===this.s.selectionList[d].index&&0<g.s.dtPane.rows({selected:!0}).data().toArray().length&&(e=!0);e&&c.push(this.s.selectionList[d])}}this.s.selectionList=c}else this.s.selectionList=[];c=-1;if(b&&1===this.s.selectionList.length)for(b=
0,d=this.s.panes;b<d.length;b++)g=d[b],g.s.lastSelect=!1,g.s.deselect=!1,void 0!==g.s.dtPane&&0<g.s.dtPane.rows({selected:!0}).data().toArray().length&&(c=g.s.index);else if(0<this.s.selectionList.length)for(b=this.s.selectionList[this.s.selectionList.length-1].index,d=0,e=this.s.panes;d<e.length;d++)g=e[d],g.s.lastSelect=g.s.index===b,g.s.deselect=!1;else if(0===this.s.selectionList.length)for(b=0,d=this.s.panes;b<d.length;b++)g=d[b],g.s.lastSelect=!1,g.s.deselect=!1;q(this.dom.panes).empty();b=
0;for(d=this.s.panes;b<d.length;b++)g=d[b],g.s.lastSelect?g._setListeners():g.rebuildPane(void 0,this.s.dt.page.info().serverSide?this.s.serverData:void 0,g.s.index===c?!0:null,!0),q(this.dom.panes).append(g.dom.container),void 0!==g.s.dtPane&&(q(g.s.dtPane.table().node()).parent()[0].scrollTop=g.s.scrollTop,q.fn.dataTable.select.init(g.s.dtPane));this.s.dt.page.info().serverSide||this.s.dt.draw()};k.prototype._startup=function(a){var b=this;q(this.dom.container).text("");this._attachExtras();q(this.dom.container).append(this.dom.panes);
q(this.dom.panes).empty();var c=this.s.dt.state.loaded();if(this.c.viewTotal&&!this.c.cascadePanes&&null!==c&&void 0!==c&&void 0!==c.searchPanes&&void 0!==c.searchPanes.panes){for(var d=!1,e=0,g=c.searchPanes.panes;e<g.length;e++){var f=g[e];if(0<f.selected.length){d=!0;break}}if(d)for(d=0,e=this.s.panes;d<e.length;d++)f=e[d],f.s.showFiltered=!0}d=0;for(e=this.s.panes;d<e.length;d++)f=e[d],f.rebuildPane(void 0,0<Object.keys(this.s.serverData).length?this.s.serverData:void 0),q(this.dom.panes).append(f.dom.container);
this.s.dt.page.info().serverSide||this.s.dt.draw();this.s.stateRead||null===c||void 0===c||(this.s.dt.page(c.start/this.s.dt.page.len()),this.s.dt.draw("page"));this.s.stateRead=!0;if(this.c.viewTotal&&!this.c.cascadePanes)for(c=0,d=this.s.panes;c<d.length;c++)f=d[c],f.updatePane();this._updateFilterCount();this._checkMessage();a.on("preDraw.dtsps",function(){b._updateFilterCount();!b.c.cascadePanes&&!b.c.viewTotal||b.s.dt.page.info().serverSide?b._updateSelection():b.redrawPanes();b.s.filterPane=
-1});this.s.dt.on("stateSaveParams.dtsp",function(l,p,n){void 0===n.searchPanes&&(n.searchPanes={});n.searchPanes.selectionList=b.s.selectionList});if(this.s.dt.page.info().serverSide)a.off("page"),a.on("page",function(){b.s.page=b.s.dt.page()}),a.off("preXhr.dt"),a.on("preXhr.dt",function(l,p,n){void 0===n.searchPanes&&(n.searchPanes={});p=l=0;for(var x=b.s.panes;p<x.length;p++){var z=x[p],y=b.s.dt.column(z.s.index).dataSrc();void 0===n.searchPanes[y]&&(n.searchPanes[y]={});if(void 0!==z.s.dtPane){z=
z.s.dtPane.rows({selected:!0}).data().toArray();for(var w=0;w<z.length;w++)n.searchPanes[y][w]=z[w].filter,l++}}b.c.viewTotal&&b._prepViewTotal();0<l&&(l!==b.s.filterCount?(n.start=0,b.s.page=0):n.start=b.s.page*b.s.dt.page.len(),b.s.dt.page(b.s.page),b.s.filterCount=l)});else a.on("preXhr.dt",function(l,p,n){l=0;for(p=b.s.panes;l<p.length;l++)p[l].clearData()});this.s.dt.on("xhr",function(l,p,n,x){var z=!1;if(!b.s.dt.page.info().serverSide)b.s.dt.one("preDraw",function(){if(!z){var y=b.s.dt.page();
z=!0;q(b.dom.panes).empty();for(var w=0,u=b.s.panes;w<u.length;w++){var B=u[w];B.clearData();B.rebuildPane(void 0!==b.s.selectionList[b.s.selectionList.length-1]?B.s.index===b.s.selectionList[b.s.selectionList.length-1].index:!1,void 0,void 0,!0);q(b.dom.panes).append(B.dom.container)}b.s.dt.page.info().serverSide||b.s.dt.draw();b.c.cascadePanes||b.c.viewTotal?b.redrawPanes(b.c.cascadePanes):b._updateSelection();b._checkMessage();b.s.dt.one("draw",function(){b.s.dt.page(y).draw(!1)})}})});c=0;for(d=
this.s.panes;c<d.length;c++)if(f=d[c],void 0!==f&&void 0!==f.s.dtPane&&(void 0!==f.s.colOpts.preSelect&&0<f.s.colOpts.preSelect.length||null!==f.customPaneSettings&&void 0!==f.customPaneSettings.preSelect&&0<f.customPaneSettings.preSelect.length)){e=f.s.dtPane.rows().data().toArray().length;for(g=0;g<e;g++)(-1!==f.s.colOpts.preSelect.indexOf(f.s.dtPane.cell(g,0).data())||null!==f.customPaneSettings&&void 0!==f.customPaneSettings.preSelect&&-1!==f.customPaneSettings.preSelect.indexOf(f.s.dtPane.cell(g,
0).data()))&&f.s.dtPane.row(g).select();f.updateTable()}if(void 0!==this.s.selectionList&&0<this.s.selectionList.length)for(c=this.s.selectionList[this.s.selectionList.length-1].index,d=0,e=this.s.panes;d<e.length;d++)f=e[d],f.s.lastSelect=f.s.index===c;0<this.s.selectionList.length&&this.c.cascadePanes&&this._cascadeRegen(this.s.selectionList);this._updateFilterCount();a.on("destroy.dtsps",function(){for(var l=0,p=b.s.panes;l<p.length;l++)p[l].destroy();a.off(".dtsps");q(b.dom.clearAll).off(".dtsps");
q(b.dom.container).remove();b.clearSelections()});if(this.c.clear)q(this.dom.clearAll).on("click.dtsps",function(){b.clearSelections()});a.settings()[0]._searchPanes=this};k.prototype._prepViewTotal=function(){for(var a=this.s.filterPane,b=!1,c=0,d=this.s.panes;c<d.length;c++){var e=d[c];if(void 0!==e.s.dtPane){var g=e.s.dtPane.rows({selected:!0}).data().toArray().length;0<g&&-1===a?(a=e.s.index,b=!0):0<g&&(a=null)}}c=0;for(d=this.s.panes;c<d.length;c++)if(e=d[c],void 0!==e.s.dtPane&&(e.s.filteringActive=
!0,-1!==a&&null!==a&&a===e.s.index||!1===b))e.s.filteringActive=!1};k.prototype._updateFilterCount=function(){for(var a=0,b=0,c=this.s.panes;b<c.length;b++){var d=c[b];void 0!==d.s.dtPane&&(a+=d.getPaneCount())}b=this.s.dt.i18n("searchPanes.title","Filters Active - %d",a);q(this.dom.title).text(b);void 0!==this.c.filterChanged&&"function"===typeof this.c.filterChanged&&this.c.filterChanged.call(this.s.dt,a)};k.prototype._updateSelection=function(){this.s.selectionList=[];for(var a=0,b=this.s.panes;a<
b.length;a++){var c=b[a];void 0!==c.s.dtPane&&this.s.selectionList.push({index:c.s.index,rows:c.s.dtPane.rows({selected:!0}).data().toArray(),protect:!1})}this.s.dt.state.save()};k.version="1.2.2";k.classes={clear:"dtsp-clear",clearAll:"dtsp-clearAll",container:"dtsp-searchPanes",emptyMessage:"dtsp-emptyMessage",hide:"dtsp-hidden",panes:"dtsp-panesContainer",search:"dtsp-search",title:"dtsp-title",titleRow:"dtsp-titleRow"};k.defaults={cascadePanes:!1,clear:!0,container:function(a){return a.table().container()},
columns:[],filterChanged:void 0,layout:"columns-3",order:[],panes:[],viewTotal:!1};return k}();(function(k){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return k(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net")(a,b).$);return k(b,a,a.document)}:k(window.jQuery,window,document)})(function(k,a,b){function c(e,g){void 0===g&&(g=!1);e=new d.Api(e);var f=e.init().searchPanes||
d.defaults.searchPanes;return(new G(e,f,g)).getNode()}m(k);t(k);var d=k.fn.dataTable;k.fn.dataTable.SearchPanes=G;k.fn.DataTable.SearchPanes=G;k.fn.dataTable.SearchPane=v;k.fn.DataTable.SearchPane=v;a=k.fn.dataTable.Api.register;a("searchPanes()",function(){return this});a("searchPanes.clearSelections()",function(){return this.iterator("table",function(e){e._searchPanes&&e._searchPanes.clearSelections()})});a("searchPanes.rebuildPane()",function(e,g){return this.iterator("table",function(f){f._searchPanes&&
f._searchPanes.rebuild(e,g)})});a("searchPanes.container()",function(){var e=this.context[0];return e._searchPanes?e._searchPanes.getNode():null});k.fn.dataTable.ext.buttons.searchPanesClear={text:"Clear Panes",action:function(e,g,f,l){g.searchPanes.clearSelections()}};k.fn.dataTable.ext.buttons.searchPanes={action:function(e,g,f,l){e.stopPropagation();this.popover(l._panes.getNode(),{align:"dt-container"});l._panes.rebuild(void 0,!0)},config:{},init:function(e,g,f){var l=new k.fn.dataTable.SearchPanes(e,
k.extend({filterChanged:function(n){e.button(g).text(e.i18n("searchPanes.collapse",{0:"SearchPanes",_:"SearchPanes (%d)"},n))}},f.config)),p=e.i18n("searchPanes.collapse","SearchPanes",0);e.button(g).text(p);f._panes=l},text:"Search Panes"};k(b).on("preInit.dt.dtsp",function(e,g,f){"dt"===e.namespace&&(g.oInit.searchPanes||d.defaults.searchPanes)&&(g._searchPanes||c(g,!0))});d.ext.feature.push({cFeature:"P",fnInit:c});d.ext.features&&d.ext.features.register("searchPanes",c)})})();