LocalCDN-Firefox-Chrome-Brave/resources/datatables/1.10.24/dataTables.searchBuilder.mi...

152 lines
71 KiB
JavaScript

/*!
SearchBuilder 1.0.1
©2020 SpryMedia Ltd - datatables.net/license/mit
DateTime picker for DataTables.net v1.0.1
©2020 SpryMedia Ltd, all rights reserved.
License: MIT datatables.net/license/mit
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(m,r,t){m instanceof String&&(m=String(m));for(var f=m.length,u=0;u<f;u++){var B=m[u];if(r.call(t,B,u,m))return{i:u,v:B}}return{i:-1,v:void 0}};$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,r,t){if(m==Array.prototype||m==Object.prototype)return m;m[r]=t.value;return m};$jscomp.getGlobal=function(m){m=["object"==typeof globalThis&&globalThis,m,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var r=0;r<m.length;++r){var t=m[r];if(t&&t.Math==Math)return t}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$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,r){var t=$jscomp.propertyToPolyfillSymbol[r];if(null==t)return m[r];t=m[t];return void 0!==t?t:m[r]};
$jscomp.polyfill=function(m,r,t,f){r&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(m,r,t,f):$jscomp.polyfillUnisolated(m,r,t,f))};$jscomp.polyfillUnisolated=function(m,r,t,f){t=$jscomp.global;m=m.split(".");for(f=0;f<m.length-1;f++){var u=m[f];if(!(u in t))return;t=t[u]}m=m[m.length-1];f=t[m];r=r(f);r!=f&&null!=r&&$jscomp.defineProperty(t,m,{configurable:!0,writable:!0,value:r})};
$jscomp.polyfillIsolated=function(m,r,t,f){var u=m.split(".");m=1===u.length;f=u[0];f=!m&&f in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var B=0;B<u.length-1;B++){var x=u[B];if(!(x in f))return;f=f[x]}u=u[u.length-1];t=$jscomp.IS_SYMBOL_NATIVE&&"es6"===t?f[u]:null;r=r(t);null!=r&&(m?$jscomp.defineProperty($jscomp.polyfills,u,{configurable:!0,writable:!0,value:r}):r!==t&&($jscomp.propertyToPolyfillSymbol[u]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(u):$jscomp.POLYFILL_PREFIX+u,u=
$jscomp.propertyToPolyfillSymbol[u],$jscomp.defineProperty(f,u,{configurable:!0,writable:!0,value:r})))};$jscomp.polyfill("Array.prototype.find",function(m){return m?m:function(r,t){return $jscomp.findInternal(this,r,t).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(m){var r=0;return function(){return r<m.length?{done:!1,value:m[r++]}:{done:!0}}};$jscomp.arrayIterator=function(m){return{next:$jscomp.arrayIteratorImpl(m)}};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(m){if(m)return m;var r=function(u,B){this.$jscomp$symbol$id_=u;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:B})};r.prototype.toString=function(){return this.$jscomp$symbol$id_};var t=0,f=function(u){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return new r("jscomp_symbol_"+(u||"")+"_"+t++,u)};return f},"es6","es3");$jscomp.initSymbolIterator=function(){};
$jscomp.polyfill("Symbol.iterator",function(m){if(m)return m;m=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),t=0;t<r.length;t++){var f=$jscomp.global[r[t]];"function"===typeof f&&"function"!=typeof f.prototype[m]&&$jscomp.defineProperty(f.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.iteratorFromArray=function(m,r){m instanceof String&&(m+="");var t=0,f={next:function(){if(t<m.length){var u=t++;return{value:r(u,m[u]),done:!1}}f.next=function(){return{done:!0,value:void 0}};return f.next()}};f[Symbol.iterator]=function(){return f};return f};
$jscomp.polyfill("Array.prototype.keys",function(m){return m?m:function(){return $jscomp.iteratorFromArray(this,function(r){return r})}},"es6","es3");$jscomp.checkStringArgs=function(m,r,t){if(null==m)throw new TypeError("The 'this' value for String.prototype."+t+" must not be null or undefined");if(r instanceof RegExp)throw new TypeError("First argument to String.prototype."+t+" must not be a regular expression");return m+""};
$jscomp.polyfill("String.prototype.startsWith",function(m){return m?m:function(r,t){var f=$jscomp.checkStringArgs(this,r,"startsWith");r+="";var u=f.length,B=r.length;t=Math.max(0,Math.min(t|0,f.length));for(var x=0;x<B&&t<u;)if(f[t++]!=r[x++])return!1;return x>=B}},"es6","es3");
$jscomp.polyfill("String.prototype.endsWith",function(m){return m?m:function(r,t){var f=$jscomp.checkStringArgs(this,r,"endsWith");r+="";void 0===t&&(t=f.length);t=Math.max(0,Math.min(t|0,f.length));for(var u=r.length;0<u&&0<t;)if(f[--t]!=r[--u])return!1;return 0>=u}},"es6","es3");
(function(){function m(c){f=c;u=c.fn.dataTable}function r(c){n=c;L=c.fn.dataTable}function t(c){w=c;J=c.fn.DataTable}(function(c){"function"===typeof define&&define.amd?define(["jquery"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,e){var g=a.moment?a.moment:a.dayjs?a.dayjs:null,k=function(d,h){this.c=c.extend(!0,{},k.defaults,h);h=this.c.classPrefix;var l=this.c.i18n;
if(!g&&"YYYY-MM-DD"!==this.c.format)throw"DateTime: Without momentjs or dayjs only the format 'YYYY-MM-DD' can be used";"string"===typeof this.c.minDate&&(this.c.minDate=new Date(this.c.minDate));"string"===typeof this.c.maxDate&&(this.c.maxDate=new Date(this.c.maxDate));l=c('<div class="'+h+'"><div class="'+h+'-date"><div class="'+h+'-title"><div class="'+h+'-iconLeft"><button>'+l.previous+'</button></div><div class="'+h+'-iconRight"><button>'+l.next+'</button></div><div class="'+h+'-label"><span></span><select class="'+
h+'-month"></select></div><div class="'+h+'-label"><span></span><select class="'+h+'-year"></select></div></div><div class="'+h+'-calendar"></div></div><div class="'+h+'-time"><div class="'+h+'-hours"></div><div class="'+h+'-minutes"></div><div class="'+h+'-seconds"></div></div><div class="'+h+'-error"></div></div>');this.dom={container:l,date:l.find("."+h+"-date"),title:l.find("."+h+"-title"),calendar:l.find("."+h+"-calendar"),time:l.find("."+h+"-time"),error:l.find("."+h+"-error"),input:c(d)};this.s=
{d:null,display:null,minutesRange:null,secondsRange:null,namespace:"dateime-"+k._instance++,parts:{date:null!==this.c.format.match(/[YMD]|L(?!T)|l/),time:null!==this.c.format.match(/[Hhm]|LT|LTS/),seconds:-1!==this.c.format.indexOf("s"),hours12:null!==this.c.format.match(/[haA]/)}};this.dom.container.append(this.dom.date).append(this.dom.time).append(this.dom.error);this.dom.date.append(this.dom.title).append(this.dom.calendar);this._constructor()};c.extend(k.prototype,{destroy:function(){this._hide(!0);
this.dom.container.off().empty();this.dom.input.off(".datetime")},errorMsg:function(d){var h=this.dom.error;d?h.html(d):h.empty();return this},hide:function(){this._hide();return this},max:function(d){this.c.maxDate="string"===typeof d?new Date(d):d;this._optionsTitle();this._setCalander();return this},min:function(d){this.c.minDate="string"===typeof d?new Date(d):d;this._optionsTitle();this._setCalander();return this},owns:function(d){return 0<c(d).parents().filter(this.dom.container).length},val:function(d,
h){if(d===e)return this.s.d;if(d instanceof Date)this.s.d=this._dateToUtc(d);else if(null===d||""===d)this.s.d=null;else if("--now"===d)this.s.d=new Date;else if("string"===typeof d)if(g){var l=g.utc(d,this.c.format,this.c.locale,this.c.strict);this.s.d=l.isValid()?l.toDate():null}else l=d.match(/(\d{4})\-(\d{2})\-(\d{2})/),this.s.d=l?new Date(Date.UTC(l[1],l[2]-1,l[3])):null;if(h||h===e)this.s.d?this._writeOutput():this.dom.input.val(d);this.s.d||(this.s.d=this._dateToUtc(new Date));this.s.display=
new Date(this.s.d.toString());this.s.display.setUTCDate(1);this._setTitle();this._setCalander();this._setTime();return this},_constructor:function(){var d=this,h=this.c.classPrefix,l=function(){d.c.onChange.call(d,d.dom.input.val(),d.s.d,d.dom.input)};this.s.parts.date||this.dom.date.css("display","none");this.s.parts.time||this.dom.time.css("display","none");this.s.parts.seconds||(this.dom.time.children("div."+h+"-seconds").remove(),this.dom.time.children("span").eq(1).remove());this._optionsTitle();
a.allan=this;"hidden"===this.dom.input.attr("type")&&(this.dom.container.addClass("inline"),this.c.attachTo="input",this.val(this.dom.input.val(),!1),this._show());this.dom.input.attr("autocomplete","off").on("focus.datetime click.datetime",function(){d.dom.container.is(":visible")||d.dom.input.is(":disabled")||(d.val(d.dom.input.val(),!1),d._show())}).on("keyup.datetime",function(){d.dom.container.is(":visible")&&d.val(d.dom.input.val(),!1)});this.dom.container.on("change","select",function(){var q=
c(this),p=q.val();q.hasClass(h+"-month")?(d._correctMonth(d.s.display,p),d._setTitle(),d._setCalander()):q.hasClass(h+"-year")?(d.s.display.setUTCFullYear(p),d._setTitle(),d._setCalander()):q.hasClass(h+"-hours")||q.hasClass(h+"-ampm")?(d.s.parts.hours12?(q=1*c(d.dom.container).find("."+h+"-hours").val(),p="pm"===c(d.dom.container).find("."+h+"-ampm").val(),d.s.d.setUTCHours(12!==q||p?p&&12!==q?q+12:q:0)):d.s.d.setUTCHours(p),d._setTime(),d._writeOutput(!0),l()):q.hasClass(h+"-minutes")?(d.s.d.setUTCMinutes(p),
d._setTime(),d._writeOutput(!0),l()):q.hasClass(h+"-seconds")&&(d.s.d.setSeconds(p),d._setTime(),d._writeOutput(!0),l());d.dom.input.focus();d._position()}).on("click",function(q){var p=d.s.d,z=q.target.nodeName.toLowerCase(),y="span"===z?q.target.parentNode:q.target;z=y.nodeName.toLowerCase();if("select"!==z)if(q.stopPropagation(),"button"===z)if(y=c(y),q=y.parent(),q.hasClass("disabled")&&!q.hasClass("range"))y.blur();else if(q.hasClass(h+"-iconLeft"))d.s.display.setUTCMonth(d.s.display.getUTCMonth()-
1),d._setTitle(),d._setCalander(),d.dom.input.focus();else if(q.hasClass(h+"-iconRight"))d._correctMonth(d.s.display,d.s.display.getUTCMonth()+1),d._setTitle(),d._setCalander(),d.dom.input.focus();else{if(y.parents("."+h+"-time").length){z=y.data("value");y=y.data("unit");if("minutes"===y){if(q.hasClass("disabled")&&q.hasClass("range")){d.s.minutesRange=z;d._setTime();return}d.s.minutesRange=null}if("seconds"===y){if(q.hasClass("disabled")&&q.hasClass("range")){d.s.secondsRange=z;d._setTime();return}d.s.secondsRange=
null}if("am"===z)if(12<=p.getUTCHours())z=p.getUTCHours()-12;else return;else if("pm"===z)if(12>p.getUTCHours())z=p.getUTCHours()+12;else return;p["hours"===y?"setUTCHours":"minutes"===y?"setUTCMinutes":"setSeconds"](z);d._setTime();d._writeOutput(!0)}else p||(p=d._dateToUtc(new Date)),p.setUTCDate(1),p.setUTCFullYear(y.data("year")),p.setUTCMonth(y.data("month")),p.setUTCDate(y.data("day")),d._writeOutput(!0),d.s.parts.time?d._setCalander():setTimeout(function(){d._hide()},10);l()}else d.dom.input.focus()})},
_compareDates:function(d,h){return this._dateToUtcString(d)===this._dateToUtcString(h)},_correctMonth:function(d,h){var l=this._daysInMonth(d.getUTCFullYear(),h),q=d.getUTCDate()>l;d.setUTCMonth(h);q&&(d.setUTCDate(l),d.setUTCMonth(h))},_daysInMonth:function(d,h){return[31,0!==d%4||0===d%100&&0!==d%400?28:29,31,30,31,30,31,31,30,31,30,31][h]},_dateToUtc:function(d){return new Date(Date.UTC(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()))},_dateToUtcString:function(d){return d.getUTCFullYear()+
"-"+this._pad(d.getUTCMonth()+1)+"-"+this._pad(d.getUTCDate())},_hide:function(d){if(d||"hidden"!==this.dom.input.attr("type"))d=this.s.namespace,this.dom.container.detach(),c(a).off("."+d),c(b).off("keydown."+d),c("div.dataTables_scrollBody").off("scroll."+d),c("div.DTE_Body_Content").off("scroll."+d),c("body").off("click."+d)},_hours24To12:function(d){return 0===d?12:12<d?d-12:d},_htmlDay:function(d){if(d.empty)return'<td class="empty"></td>';var h=["selectable"],l=this.c.classPrefix;d.disabled&&
h.push("disabled");d.today&&h.push("now");d.selected&&h.push("selected");return'<td data-day="'+d.day+'" class="'+h.join(" ")+'"><button class="'+l+"-button "+l+'-day" type="button" data-year="'+d.year+'" data-month="'+d.month+'" data-day="'+d.day+'"><span>'+d.day+"</span></button></td>"},_htmlMonth:function(d,h){var l=this._dateToUtc(new Date),q=this._daysInMonth(d,h),p=(new Date(Date.UTC(d,h,1))).getUTCDay(),z=[],y=[];0<this.c.firstDay&&(p-=this.c.firstDay,0>p&&(p+=7));for(var C=q+p,D=C;7<D;)D-=
7;C+=7-D;var E=this.c.minDate;D=this.c.maxDate;E&&(E.setUTCHours(0),E.setUTCMinutes(0),E.setSeconds(0));D&&(D.setUTCHours(23),D.setUTCMinutes(59),D.setSeconds(59));for(var v=0,A=0;v<C;v++){var G=new Date(Date.UTC(d,h,1+(v-p))),K=this.s.d?this._compareDates(G,this.s.d):!1,F=this._compareDates(G,l),N=v<p||v>=q+p,I=E&&G<E||D&&G>D,H=this.c.disableDays;Array.isArray(H)&&-1!==c.inArray(G.getUTCDay(),H)?I=!0:"function"===typeof H&&!0===H(G)&&(I=!0);y.push(this._htmlDay({day:1+(v-p),month:h,year:d,selected:K,
today:F,disabled:I,empty:N}));7===++A&&(this.c.showWeekNumber&&y.unshift(this._htmlWeekOfYear(v-p,h,d)),z.push("<tr>"+y.join("")+"</tr>"),y=[],A=0)}l=this.c.classPrefix;q=l+"-table";this.c.showWeekNumber&&(q+=" weekNumber");E&&(E=E>=new Date(Date.UTC(d,h,1,0,0,0)),this.dom.title.find("div."+l+"-iconLeft").css("display",E?"none":"block"));D&&(d=D<new Date(Date.UTC(d,h+1,1,0,0,0)),this.dom.title.find("div."+l+"-iconRight").css("display",d?"none":"block"));return'<table class="'+q+'"><thead>'+this._htmlMonthHead()+
"</thead><tbody>"+z.join("")+"</tbody></table>"},_htmlMonthHead:function(){var d=[],h=this.c.firstDay,l=this.c.i18n,q=function(z){for(z+=h;7<=z;)z-=7;return l.weekdays[z]};this.c.showWeekNumber&&d.push("<th></th>");for(var p=0;7>p;p++)d.push("<th>"+q(p)+"</th>");return d.join("")},_htmlWeekOfYear:function(d,h,l){d=new Date(l,h,d,0,0,0,0);d.setDate(d.getDate()+4-(d.getDay()||7));return'<td class="'+this.c.classPrefix+'-week">'+Math.ceil(((d-new Date(l,0,1))/864E5+1)/7)+"</td>"},_options:function(d,
h,l){l||(l=h);d=this.dom.container.find("select."+this.c.classPrefix+"-"+d);d.empty();for(var q=0,p=h.length;q<p;q++)d.append('<option value="'+h[q]+'">'+l[q]+"</option>")},_optionSet:function(d,h){var l=this.dom.container.find("select."+this.c.classPrefix+"-"+d);d=l.parent().children("span");l.val(h);h=l.find("option:selected");d.html(0!==h.length?h.text():this.c.i18n.unknown)},_optionsTime:function(d,h,l,q,p){var z=this.c.classPrefix,y=this.dom.container.find("div."+z+"-"+d),C=12===h?function(F){return F}:
this._pad;z=this.c.classPrefix;var D=z+"-table",E=this.c.i18n;if(y.length){var v="";var A=10;var G=function(F,N,I){12===h&&"number"===typeof F&&(12<=l&&(F+=12),12==F?F=0:24==F&&(F=12));var H=l===F||"am"===F&&12>l||"pm"===F&&12<=l?"selected":"";q&&-1===c.inArray(F,q)&&(H+=" disabled");I&&(H+=" "+I);return'<td class="selectable '+H+'"><button class="'+z+"-button "+z+'-day" type="button" data-unit="'+d+'" data-value="'+F+'"><span>'+N+"</span></button></td>"};if(12===h){v+="<tr>";for(p=1;6>=p;p++)v+=
G(p,C(p));v+=G("am",E.amPm[0]);v+="</tr><tr>";for(p=7;12>=p;p++)v+=G(p,C(p));v+=G("pm",E.amPm[1]);v+="</tr>";A=7}else{if(24===h){var K=0;for(A=0;4>A;A++){v+="<tr>";for(p=0;6>p;p++)v+=G(K,C(K)),K++;v+="</tr>"}}else{v+="<tr>";for(A=0;60>A;A+=10)v+=G(A,C(A),"range");p=null!==p?p:10*Math.floor(l/10);v=v+'</tr></tbody></thead><table class="'+(D+" "+D+'-nospace"><tbody><tr>');for(A=p+1;A<p+10;A++)v+=G(A,C(A));v+="</tr>"}A=6}y.empty().append('<table class="'+D+'"><thead><tr><th colspan="'+A+'">'+E[d]+"</th></tr></thead><tbody>"+
v+"</tbody></table>")}},_optionsTitle:function(){var d=this.c.i18n,h=this.c.minDate,l=this.c.maxDate;h=h?h.getFullYear():null;l=l?l.getFullYear():null;h=null!==h?h:(new Date).getFullYear()-this.c.yearRange;l=null!==l?l:(new Date).getFullYear()+this.c.yearRange;this._options("month",this._range(0,11),d.months);this._options("year",this._range(h,l))},_pad:function(d){return 10>d?"0"+d:d},_position:function(){var d="input"===this.c.attachTo?this.dom.input.position():this.dom.input.offset(),h=this.dom.container,
l=this.dom.input.outerHeight();if(h.hasClass("inline"))h.insertAfter(this.dom.input);else{this.s.parts.date&&this.s.parts.time&&550<c(a).width()?h.addClass("horizontal"):h.removeClass("horizontal");"input"===this.c.attachTo?h.css({top:d.top+l,left:d.left}).insertAfter(this.dom.input):h.css({top:d.top+l,left:d.left}).appendTo("body");var q=h.outerHeight(),p=h.outerWidth(),z=c(a).scrollTop();d.top+l+q-z>c(a).height()&&(l=d.top-q,h.css("top",0>l?0:l));p+d.left>c(a).width()&&(d=c(a).width()-p,"input"===
this.c.attachTo&&(d-=c(h).offsetParent().offset().left),h.css("left",0>d?0:d))}},_range:function(d,h,l){var q=[];for(l||(l=1);d<=h;d+=l)q.push(d);return q},_setCalander:function(){this.s.display&&this.dom.calendar.empty().append(this._htmlMonth(this.s.display.getUTCFullYear(),this.s.display.getUTCMonth()))},_setTitle:function(){this._optionSet("month",this.s.display.getUTCMonth());this._optionSet("year",this.s.display.getUTCFullYear())},_setTime:function(){var d=this,h=this.s.d,l=h?h.getUTCHours():
0,q=function(p){return d.c[p+"Available"]?d.c[p+"Available"]:d._range(0,59,d.c[p+"Increment"])};this._optionsTime("hours",this.s.parts.hours12?12:24,l,this.c.hoursAvailable);this._optionsTime("minutes",60,h?h.getUTCMinutes():0,q("minutes"),this.s.minutesRange);this._optionsTime("seconds",60,h?h.getSeconds():0,q("seconds"),this.s.secondsRange)},_show:function(){var d=this,h=this.s.namespace;this._position();c(a).on("scroll."+h+" resize."+h,function(){d._hide()});c("div.DTE_Body_Content").on("scroll."+
h,function(){d._hide()});c("div.dataTables_scrollBody").on("scroll."+h,function(){d._hide()});var l=this.dom.input[0].offsetParent;if(l!==b.body)c(l).on("scroll."+h,function(){d._hide()});c(b).on("keydown."+h,function(q){9!==q.keyCode&&27!==q.keyCode&&13!==q.keyCode||d._hide()});setTimeout(function(){c("body").on("click."+h,function(q){c(q.target).parents().filter(d.dom.container).length||q.target===d.dom.input[0]||d._hide()})},10)},_writeOutput:function(d){var h=this.s.d,l=g?g.utc(h,e,this.c.locale,
this.c.strict).format(this.c.format):h.getUTCFullYear()+"-"+this._pad(h.getUTCMonth()+1)+"-"+this._pad(h.getUTCDate());this.dom.input.val(l).trigger("change",{write:h});"hidden"===this.dom.input.attr("type")&&this.val(l,!1);d&&this.dom.input.focus()}});k.use=function(d){g=d};k._instance=0;k.defaults={attachTo:"body",classPrefix:"dt-datetime",disableDays:null,firstDay:1,format:"YYYY-MM-DD",hoursAvailable:null,i18n:{previous:"Previous",next:"Next",months:"January February March April May June July August September October November December".split(" "),
weekdays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),amPm:["am","pm"],hours:"Hour",minutes:"Minute",seconds:"Second",unknown:"-"},maxDate:null,minDate:null,minutesAvailable:null,minutesIncrement:1,strict:!0,locale:"en",onChange:function(){},secondsAvailable:null,secondsIncrement:1,showWeekNumber:!1,yearRange:25};k.version="1.0.1";a.DateTime||(a.DateTime=k);c.fn.dtDateTime=function(d){return this.each(function(){new k(this,d)})};c.fn.dataTable&&(c.fn.dataTable.DateTime=k,c.fn.DataTable.DateTime=k);return k});
var f,u,B=window.moment,x=function(){function c(a,b,e,g,k){var d=this;void 0===g&&(g=0);void 0===k&&(k=1);if(!u||!u.versionCheck||!u.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");this.classes=f.extend(!0,{},c.classes);this.c=f.extend(!0,{},c.defaults,f.fn.dataTable.ext.searchBuilder,b);b=this.c.i18n;this.s={condition:void 0,conditions:{},data:void 0,dataIdx:-1,dataPoints:[],depth:k,dt:a,filled:!1,index:g,momentFormat:!1,topGroup:e,type:"",value:[]};this.dom={buttons:f("<div/>").addClass(this.classes.buttonContainer),
condition:f("<select disabled/>").addClass(this.classes.condition).addClass(this.classes.dropDown).addClass(this.classes.italic).attr("autocomplete","hacking"),conditionTitle:f('<option value="" disabled selected hidden/>').text(this.s.dt.i18n("searchBuilder.condition",b.condition)),container:f("<div/>").addClass(this.classes.container),data:f("<select/>").addClass(this.classes.data).addClass(this.classes.dropDown).addClass(this.classes.italic),dataTitle:f('<option value="" disabled selected hidden/>').text(this.s.dt.i18n("searchBuilder.data",
b.data)),defaultValue:f("<select disabled/>").addClass(this.classes.value).addClass(this.classes.dropDown),"delete":f("<button>&times</button>").addClass(this.classes["delete"]).addClass(this.classes.button).attr("title",this.s.dt.i18n("searchBuilder.deleteTitle",b.deleteTitle)).attr("type","button"),left:f("<button><</button>").addClass(this.classes.left).addClass(this.classes.button).attr("title",this.s.dt.i18n("searchBuilder.leftTitle",b.leftTitle)).attr("type","button"),right:f("<button>></button>").addClass(this.classes.right).addClass(this.classes.button).attr("title",
this.s.dt.i18n("searchBuilder.rightTitle",b.rightTitle)).attr("type","button"),value:[f("<select disabled/>").addClass(this.classes.value).addClass(this.classes.dropDown).addClass(this.classes.italic)],valueTitle:f('<option value="--valueTitle--" selected/>').text(this.s.dt.i18n("searchBuilder.value",b.value))};if(this.c.greyscale)for(f(this.dom.data).addClass(this.classes.greyscale),f(this.dom.condition).addClass(this.classes.greyscale),f(this.dom.defaultValue).addClass(this.classes.greyscale),a=
0,e=this.dom.value;a<e.length;a++)f(e[a]).addClass(this.classes.greyscale);this.s.dt.on("draw.dtsp",function(){d._adjustCriteria()});this.s.dt.on("buttons-action",function(){d._adjustCriteria()});f(window).on("resize.dtsp",u.util.throttle(function(){d._adjustCriteria()}));this._buildCriteria();return this}c.prototype.updateArrows=function(a,b){void 0===a&&(a=!1);void 0===b&&(b=!0);f(this.dom.container).empty().append(this.dom.data).append(this.dom.condition).append(this.dom.value[0]);f(this.dom.value[0]).trigger("dtsb-inserted");
for(var e=1;e<this.dom.value.length;e++)f(this.dom.container).append(this.dom.value[e]),f(this.dom.value[e]).trigger("dtsb-inserted");1<this.s.depth&&f(this.dom.buttons).append(this.dom.left);(!1===this.c.depthLimit||this.s.depth<this.c.depthLimit)&&a?f(this.dom.buttons).append(this.dom.right):f(this.dom.right).remove();f(this.dom.buttons).append(this.dom["delete"]);f(this.dom.container).append(this.dom.buttons);b&&this._adjustCriteria()};c.prototype.destroy=function(){f(this.dom.data).off(".dtsb");
f(this.dom.condition).off(".dtsb");f(this.dom["delete"]).off(".dtsb");for(var a=0,b=this.dom.value;a<b.length;a++)f(b[a]).off(".dtsb");f(this.dom.container).remove()};c.prototype.search=function(a,b){var e=this.s.conditions[this.s.condition];if(void 0!==this.s.condition&&void 0!==e)return-1!==this.s.type.indexOf("num")&&""!==this.s.dt.settings()[0].oLanguage.sDecimal&&(a[this.s.dataIdx]=a[this.s.dataIdx].replace(this.s.dt.settings()[0].oLanguage.sDecimal,".")),a=a[this.s.dataIdx],"search"!==this.c.orthogonal.search&&
(a=this.s.dt.settings()[0],a=a.oApi._fnGetCellData(a,b,this.s.dataIdx,"string"===typeof this.c.orthogonal?this.c.orthogonal:this.c.orthogonal.search)),"array"===this.s.type&&(Array.isArray(a)||(a=[a]),a.sort()),e.search(a,this.s.value,this)};c.prototype.getDetails=function(){var a=this.s.value;if(-1!==this.s.type.indexOf("num")&&""!==this.s.dt.settings()[0].oLanguage.sDecimal)for(var b=0;b<this.s.value.length;b++)-1!==this.s.value[b].indexOf(".")&&(a[b]=this.s.value[b].replace(".",this.s.dt.settings()[0].oLanguage.sDecimal));
return{condition:this.s.condition,data:this.s.data,value:a}};c.prototype.getNode=function(){return this.dom.container};c.prototype.populate=function(){this._populateData();-1!==this.s.dataIdx&&(this._populateCondition(),void 0!==this.s.condition&&this._populateValue())};c.prototype.rebuild=function(a){var b=!1,e;this._populateData();if(void 0!==a.data){var g=this.classes.italic,k=this.dom.data;f(this.dom.data).children("option").each(function(){f(this).text()===a.data&&(f(this).attr("selected",!0),
f(k).removeClass(g),b=!0,e=f(this).val())})}if(b){this.s.data=a.data;this.s.dataIdx=e;f(this.dom.dataTitle).remove();this._populateCondition();f(this.dom.conditionTitle).remove();var d;f(this.dom.condition).children("option").each(function(){void 0!==a.condition&&f(this).val()===a.condition&&"string"===typeof a.condition&&(f(this).attr("selected",!0),d=f(this).val())});this.s.condition=d;void 0!==this.s.condition?(f(this.dom.conditionTitle).remove(),f(this.dom.condition).removeClass(this.classes.italic),
this._populateValue(a)):f(this.dom.conditionTitle).prependTo(this.dom.condition).attr("selected",!0)}};c.prototype.setListeners=function(){var a=this;f(this.dom.data).unbind("input change").on("input change",function(){f(a.dom.dataTitle).attr("selected",!1);f(a.dom.data).removeClass(a.classes.italic);a.s.dataIdx=f(a.dom.data).children("option:selected").val();a.s.data=f(a.dom.data).children("option:selected").text();a.c.orthogonal=a._getOptions().orthogonal;a._clearCondition();a._clearValue();a._populateCondition();
a.s.filled&&(a.s.filled=!1,a.s.dt.draw(),a.setListeners());a.s.dt.state.save()});f(this.dom.condition).unbind("input change").on("input change",function(){f(a.dom.conditionTitle).attr("selected",!1);f(a.dom.condition).removeClass(a.classes.italic);for(var b=f(a.dom.condition).children("option:selected").val(),e=0,g=Object.keys(a.s.conditions);e<g.length;e++)if(g[e]===b){a.s.condition=b;break}a._clearValue();a._populateValue();b=0;for(e=a.dom.value;b<e.length;b++)g=e[b],a.s.filled&&0!==f(a.dom.container).has(g).length&&
(a.s.filled=!1,a.s.dt.draw(),a.setListeners());a.s.dt.draw()})};c.prototype._adjustCriteria=function(){if(0!==f(document).has(this.dom.container).length){var a=this.dom.value[this.dom.value.length-1];if(0!==f(this.dom.container).has(a).length){var b=f(a).outerWidth(!0);a=f(a).offset().left+b;var e=f(this.dom.left).offset(),g=f(this.dom.right).offset(),k=f(this.dom["delete"]).offset(),d=0!==f(this.dom.container).has(this.dom.left).length,h=0!==f(this.dom.container).has(this.dom.right).length,l=d?e.left:
h?g.left:k.left;15>l-a||d&&e.top!==k.top||h&&g.top!==k.top?(f(this.dom.container).parent().addClass(this.classes.vertical),f(this.s.topGroup).trigger("dtsb-redrawContents")):15<l-(f(this.dom.data).offset().left+f(this.dom.data).outerWidth(!0)+f(this.dom.condition).outerWidth(!0)+b)&&(f(this.dom.container).parent().removeClass(this.classes.vertical),f(this.s.topGroup).trigger("dtsb-redrawContents"))}}};c.prototype._buildCriteria=function(){f(this.dom.data).append(this.dom.dataTitle);f(this.dom.condition).append(this.dom.conditionTitle);
f(this.dom.container).append(this.dom.data).append(this.dom.condition);for(var a=0,b=this.dom.value;a<b.length;a++){var e=b[a];f(e).append(this.dom.valueTitle);f(this.dom.container).append(e)}f(this.dom.container).append(this.dom["delete"]).append(this.dom.right);this.setListeners()};c.prototype._clearCondition=function(){f(this.dom.condition).empty();f(this.dom.conditionTitle).attr("selected",!0).attr("disabled",!0);f(this.dom.condition).prepend(this.dom.conditionTitle).prop("selectedIndex",0);this.s.conditions=
{};this.s.condition=void 0};c.prototype._clearValue=function(){if(void 0!==this.s.condition){for(var a=0,b=this.dom.value;a<b.length;a++){var e=b[a];f(e).remove()}this.dom.value=[].concat(this.s.conditions[this.s.condition].init(this,c.updateListener));f(this.dom.value[0]).insertAfter(this.dom.condition).trigger("dtsb-inserted");for(e=1;e<this.dom.value.length;e++)f(this.dom.value[e]).insertAfter(this.dom.value[e-1]).trigger("dtsb-inserted")}else{a=0;for(b=this.dom.value;a<b.length;a++)e=b[a],f(e).remove();
f(this.dom.valueTitle).attr("selected",!0);f(this.dom.defaultValue).append(this.dom.valueTitle).insertAfter(this.dom.condition)}this.s.value=[]};c.prototype._getOptions=function(){return f.extend(!0,{},c.defaults,this.s.dt.settings()[0].aoColumns[this.s.dataIdx].searchBuilder)};c.prototype._populateCondition=function(){var a=[],b=Object.keys(this.s.conditions).length;if(0===b){b=f(this.dom.data).children("option:selected").val();this.s.type=this.s.dt.columns().type().toArray()[b];null===this.s.type&&
(this.s.dt.draw(),this.setListeners(),this.s.type=this.s.dt.columns().type().toArray()[b]);f(this.dom.condition).attr("disabled",!1).empty().append(this.dom.conditionTitle).addClass(this.classes.italic);f(this.dom.conditionTitle).attr("selected",!0);b=this.s.dt.settings()[0].oLanguage.sDecimal;""!==b&&this.s.type.indexOf(b)===this.s.type.length-b.length&&(-1!==this.s.type.indexOf("num-fmt")?this.s.type=this.s.type.replace(b,""):-1!==this.s.type.indexOf("num")&&(this.s.type=this.s.type.replace(b,"")));
var e=void 0!==this.c.conditions[this.s.type]?this.c.conditions[this.s.type]:-1!==this.s.type.indexOf("moment")?this.c.conditions.moment:this.c.conditions.string;-1!==this.s.type.indexOf("moment")&&(this.s.momentFormat=this.s.type.replace(/moment\-/g,""));for(var g=0,k=Object.keys(e);g<k.length;g++){var d=k[g];null!==e[d]&&(this.s.conditions[d]=e[d],b=e[d].conditionName,"function"===typeof b&&(b=b(this.s.dt,this.c.i18n)),a.push(f("<option>",{text:b,value:d}).addClass(this.classes.option).addClass(this.classes.notItalic)))}}else if(0<
b)for(f(this.dom.condition).empty().attr("disabled",!1).addClass(this.classes.italic),e=0,g=Object.keys(this.s.conditions);e<g.length;e++)d=g[e],b=this.s.conditions[d].conditionName,"function"===typeof b&&(b=b(this.s.dt,this.c.i18n)),d=f("<option>",{text:b,value:d}).addClass(this.classes.option).addClass(this.classes.notItalic),void 0!==this.s.condition&&this.s.condition===b&&(f(d).attr("selected",!0),f(this.dom.condition).removeClass(this.classes.italic)),a.push(d);else{f(this.dom.condition).attr("disabled",
!0).addClass(this.classes.italic);return}for(b=0;b<a.length;b++)d=a[b],f(this.dom.condition).append(d);f(this.dom.condition).prop("selectedIndex",0)};c.prototype._populateData=function(){var a=this;f(this.dom.data).empty().append(this.dom.dataTitle);if(0===this.s.dataPoints.length)this.s.dt.columns().every(function(d){if(!0===a.c.columns||-1!==a.s.dt.columns(a.c.columns).indexes().toArray().indexOf(d)){for(var h=!1,l=0,q=a.s.dataPoints;l<q.length;l++)if(q[l].index===d){h=!0;break}h||(d={text:a.s.dt.settings()[0].aoColumns[d].sTitle,
index:d},a.s.dataPoints.push(d),f(a.dom.data).append(f("<option>",{text:d.text,value:d.index}).addClass(a.classes.option).addClass(a.classes.notItalic)))}});else for(var b=function(d){e.s.dt.columns().every(function(l){a.s.dt.settings()[0].aoColumns[l].sTitle===d.text&&(d.index=l)});var h=f("<option>",{text:d.text,value:d.index}).addClass(e.classes.option).addClass(e.classes.notItalic);e.s.data===d.text&&(e.s.dataIdx=d.index,f(h).attr("selected",!0),f(e.dom.data).removeClass(e.classes.italic));f(e.dom.data).append(h)},
e=this,g=0,k=this.s.dataPoints;g<k.length;g++)b(k[g])};c.prototype._populateValue=function(a){var b=this,e=this.s.filled;this.s.filled=!1;f(this.dom.defaultValue).remove();for(var g=0,k=this.dom.value;g<k.length;g++)f(k[g]).remove();g=f(this.dom.container).children();if(3<g.length)for(k=2;k<g.length-1;k++)f(g[k]).remove();void 0!==a&&this.s.dt.columns().every(function(d){b.s.dt.settings()[0].aoColumns[d].sTitle===a.data&&(b.s.dataIdx=d)});this.dom.value=[].concat(this.s.conditions[this.s.condition].init(this,
c.updateListener,void 0!==a?a.value:void 0));void 0!==a&&void 0!==a.value&&(this.s.value=a.value);f(this.dom.value[0]).insertAfter(this.dom.condition).trigger("dtsb-inserted");for(k=1;k<this.dom.value.length;k++)f(this.dom.value[k]).insertAfter(this.dom.value[k-1]).trigger("dtsb-inserted");this.s.filled=this.s.conditions[this.s.condition].isInputValid(this.dom.value,this);this.setListeners();e!==this.s.filled&&(this.s.dt.draw(),this.setListeners())};c.version="1.0.0";c.classes={button:"dtsb-button",
buttonContainer:"dtsb-buttonContainer",condition:"dtsb-condition",container:"dtsb-criteria",data:"dtsb-data","delete":"dtsb-delete",dropDown:"dtsb-dropDown",greyscale:"dtsb-greyscale",input:"dtsb-input",italic:"dtsb-italic",joiner:"dtsp-joiner",left:"dtsb-left",notItalic:"dtsb-notItalic",option:"dtsb-option",right:"dtsb-right",value:"dtsb-value",vertical:"dtsb-vertical"};c.initSelect=function(a,b,e,g){void 0===e&&(e=null);void 0===g&&(g=!1);var k=f(a.dom.data).children("option:selected").val(),d=
a.s.dt.rows().indexes().toArray(),h=a.s.dt.settings()[0],l=f("<select/>").addClass(c.classes.value).addClass(c.classes.dropDown).addClass(c.classes.italic).append(a.dom.valueTitle).on("input change",function(){f(this).removeClass(c.classes.italic);b(a,this)});a.c.greyscale&&f(l).addClass(c.classes.greyscale);for(var q=[],p=[],z=0;z<d.length;z++){var y=d[z],C=h.oApi._fnGetCellData(h,y,k,"string"===typeof a.c.orthogonal?a.c.orthogonal:a.c.orthogonal.search);C="string"===typeof C?C.replace(/[\r\n\u2028]/g,
" "):C;y=h.oApi._fnGetCellData(h,y,k,"string"===typeof a.c.orthogonal?a.c.orthogonal:a.c.orthogonal.display);"array"===a.s.type&&(C=Array.isArray(C)?C=C.sort():[C],y=Array.isArray(y)?y=y.sort():[y]);var D=function(v,A){v=f("<option>",{text:"string"===typeof A?A.replace(/(<([^>]+)>)/ig,""):A,type:Array.isArray(v)?"Array":"String",value:-1!==a.s.type.indexOf("html")&&null!==v&&"string"===typeof v?v.replace(/(<([^>]+)>)/ig,""):v}).addClass(a.classes.option).addClass(a.classes.notItalic);A=f(v).val();
-1===q.indexOf(A)&&(q.push(A),p.push(v),null!==e&&Array.isArray(e[0])&&(e[0]=e[0].sort().join(",")),null!==e&&v.val()===e[0]&&(v.attr("selected",!0),f(l).removeClass(c.classes.italic)))};if(g)for(var E=0;E<C.length;E++)D(C[E],y[E]);else D(C,y)}p.sort(function(v,A){if("string"===a.s.type||"num"===a.s.type||"html"===a.s.type||"html-num"===a.s.type)return f(v).val()<f(A).val()?-1:f(v).val()<f(A).val()?1:0;if("num-fmt"===a.s.type||"html-num-fmt"===a.s.type)return+f(v).val().replace(/[^0-9.]/g,"")<+f(A).val().replace(/[^0-9.]/g,
"")?-1:+f(v).val().replace(/[^0-9.]/g,"")<+f(A).val().replace(/[^0-9.]/g,"")?1:0});for(g=0;g<p.length;g++)k=p[g],f(l).append(k);return l};c.initSelectArray=function(a,b,e){void 0===e&&(e=null);return c.initSelect(a,b,e,!0)};c.initInput=function(a,b,e){void 0===e&&(e=null);var g=f("<input/>").addClass(c.classes.value).addClass(c.classes.input).on("input",function(){b(a,this)});a.c.greyscale&&f(g).addClass(c.classes.greyscale);null!==e&&f(g).val(e[0]);return g};c.init2Input=function(a,b,e){void 0===
e&&(e=null);var g=[f("<input/>").addClass(c.classes.value).addClass(c.classes.input).on("input",function(){b(a,this)}),f("<span>").addClass(a.classes.joiner).text(a.s.dt.i18n("searchBuilder.valueJoiner",a.c.i18n.valueJoiner)),f("<input/>").addClass(c.classes.value).addClass(c.classes.input).on("input",function(){b(a,this)})];a.c.greyscale&&(f(g[0]).addClass(c.classes.greyscale),f(g[2]).addClass(c.classes.greyscale));null!==e&&(f(g[0]).val(e[0]),f(g[2]).val(e[1]));a.s.dt.off("draw");a.s.dt.one("draw",
function(){f(a.s.topGroup).trigger("dtsb-redrawContents")});return g};c.initDate=function(a,b,e){void 0===e&&(e=null);var g=f("<input/>").addClass(c.classes.value).addClass(c.classes.input).dtDateTime({attachTo:"input",format:a.s.momentFormat?a.s.momentFormat:void 0}).on("input change",function(){b(a,this)});a.c.greyscale&&f(g).addClass(c.classes.greyscale);null!==e&&f(g).val(e[0]);return g};c.initNoValue=function(a){a.s.dt.off("draw");a.s.dt.one("draw",function(){f(a.s.topGroup).trigger("dtsb-redrawContents")})};
c.init2Date=function(a,b,e){void 0===e&&(e=null);var g=[f("<input/>").addClass(c.classes.value).addClass(c.classes.input).dtDateTime({attachTo:"input",format:a.s.momentFormat?a.s.momentFormat:void 0}).on("input change",function(){b(a,this)}),f("<span>").addClass(a.classes.joiner).text(a.s.dt.i18n("searchBuilder.valueJoiner",a.c.i18n.valueJoiner)),f("<input/>").addClass(c.classes.value).addClass(c.classes.input).dtDateTime({attachTo:"input",format:a.s.momentFormat?a.s.momentFormat:void 0}).on("input change",
function(){b(a,this)})];a.c.greyscale&&(f(g[0]).addClass(c.classes.greyscale),f(g[2]).addClass(c.classes.greyscale));null!==e&&0<e.length&&(f(g[0]).val(e[0]),f(g[2]).val(e[1]));a.s.dt.off("draw");a.s.dt.one("draw",function(){f(a.s.topGroup).trigger("dtsb-redrawContents")});return g};c.isInputValidSelect=function(a){for(var b=!0,e=0;e<a.length;e++){var g=a[e];f(g).children("option:selected").length===f(g).children("option").length-f(g).children("option."+c.classes.notItalic).length&&1===f(g).children("option:selected").length&&
f(g).children("option:selected")[0]===f(g).children("option:hidden")[0]&&(b=!1)}return b};c.isInputValidInput=function(a){for(var b=!0,e=0;e<a.length;e++){var g=a[e];f(g).is("input")&&0===f(g).val().length&&(b=!1)}return b};c.inputValueSelect=function(a){for(var b=[],e=0;e<a.length;e++){var g=a[e];if(f(g).is("select")){var k=f(g).children("option:selected").val();b.push("Array"===f(g).children("option:selected").attr("type")?k.split(",").sort():k)}}return b};c.inputValueInput=function(a){for(var b=
[],e=0;e<a.length;e++){var g=a[e];f(g).is("input")&&b.push(f(g).val())}return b};c.updateListener=function(a,b){var e=a.s.conditions[a.s.condition];a.s.filled=e.isInputValid(a.dom.value,a);a.s.value=e.inputValue(a.dom.value,a);Array.isArray(a.s.value)||(a.s.value=[a.s.value]);for(e=0;e<a.s.value.length;e++)Array.isArray(a.s.value[e])?a.s.value[e].sort():""!==a.s.dt.settings()[0].oLanguage.sDecimal&&(a.s.value[e]=a.s.value[e].replace(a.s.dt.settings()[0].oLanguage.sDecimal,"."));var g=null,k=null;
for(e=0;e<a.dom.value.length;e++)b===a.dom.value[e][0]&&(g=e,void 0!==b.selectionStart&&(k=b.selectionStart));a.s.dt.draw();null!==g&&(f(a.dom.value[g]).removeClass(a.classes.italic),f(a.dom.value[g]).focus(),null!==k&&f(a.dom.value[g])[0].setSelectionRange(k,k))};c.dateConditions={"=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.equals",b.conditions.date.equals)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=a.replace(/(\/|\-|,)/g,
"-");return a===b[0]}},"!=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.not",b.conditions.date.not)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=a.replace(/(\/|\-|,)/g,"-");return a!==b[0]}},"<":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.before",b.conditions.date.before)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=a.replace(/(\/|\-|,)/g,
"-");return a<b[0]}},">":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.after",b.conditions.date.after)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=a.replace(/(\/|\-|,)/g,"-");return a>b[0]}},between:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.between",b.conditions.date.between)},init:c.init2Date,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=a.replace(/(\/|\-|,)/g,
"-");return b[0]<b[1]?b[0]<=a&&a<=b[1]:b[1]<=a&&a<=b[0]}},"!between":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.notBetween",b.conditions.date.notBetween)},init:c.init2Date,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=a.replace(/(\/|\-|,)/g,"-");return b[0]<b[1]?!(b[0]<=a&&a<=b[1]):!(b[1]<=a&&a<=b[0])}},"null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.empty",b.conditions.date.empty)},isInputValid:function(){return!0},
init:c.initNoValue,inputValue:function(){},search:function(a){return null===a||void 0===a||0===a.length}},"!null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.date.notEmpty",b.conditions.date.notEmpty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return!(null===a||void 0===a||0===a.length)}}};c.momentDateConditions={"=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.moment.equals",b.conditions.moment.equals)},
init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b,e){return B(a,e.s.momentFormat).valueOf()===B(b[0],e.s.momentFormat).valueOf()}},"!=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.moment.not",b.conditions.moment.not)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b,e){return B(a,e.s.momentFormat).valueOf()!==B(b[0],e.s.momentFormat).valueOf()}},"<":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.moment.before",
b.conditions.moment.before)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b,e){return B(a,e.s.momentFormat).valueOf()<B(b[0],e.s.momentFormat).valueOf()}},">":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.moment.after",b.conditions.moment.after)},init:c.initDate,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b,e){return B(a,e.s.momentFormat).valueOf()>B(b[0],e.s.momentFormat).valueOf()}},between:{conditionName:function(a,
b){return a.i18n("searchBuilder.conditions.moment.between",b.conditions.moment.between)},init:c.init2Date,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b,e){a=B(a,e.s.momentFormat).valueOf();var g=B(b[0],e.s.momentFormat).valueOf();b=B(b[1],e.s.momentFormat).valueOf();return g<b?g<=a&&a<=b:b<=a&&a<=g}},"!between":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.moment.notBetween",b.conditions.moment.notBetween)},init:c.init2Date,inputValue:c.inputValueInput,
isInputValid:c.isInputValidInput,search:function(a,b,e){a=B(a,e.s.momentFormat).valueOf();var g=B(b[0],e.s.momentFormat).valueOf();b=B(b[1],e.s.momentFormat).valueOf();return g<b?!(+g<=+a&&+a<=+b):!(+b<=+a&&+a<=+g)}},"null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.moment.empty",b.conditions.moment.empty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return null===a||void 0===a||0===a.length}},"!null":{conditionName:function(a,
b){return a.i18n("searchBuilder.conditions.moment.notEmpty",b.conditions.moment.notEmpty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return!(null===a||void 0===a||0===a.length)}}};c.numConditions={"=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.equals",b.conditions.number.equals)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){return+a===+b[0]}},"!=":{conditionName:function(a,
b){return a.i18n("searchBuilder.conditions.number.not",b.conditions.number.not)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){return+a!==+b[0]}},"<":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.lt",b.conditions.number.lt)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return+a<+b[0]}},"<=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.lte",
b.conditions.number.lte)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return+a<=+b[0]}},">=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.gte",b.conditions.number.gte)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return+a>=+b[0]}},">":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.gt",b.conditions.number.gt)},init:c.initInput,inputValue:c.inputValueInput,
isInputValid:c.isInputValidInput,search:function(a,b){return+a>+b[0]}},between:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.between",b.conditions.number.between)},init:c.init2Input,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return+b[0]<+b[1]?+b[0]<=+a&&+a<=+b[1]:+b[1]<=+a&&+a<=+b[0]}},"!between":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.notBetween",b.conditions.number.notBetween)},init:c.init2Input,
inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return+b[0]<+b[1]?!(+b[0]<=+a&&+a<=+b[1]):!(+b[1]<=+a&&+a<=+b[0])}},"null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.empty",b.conditions.number.empty)},init:c.initNoValue,inputValue:function(){},isInputValid:function(){return!0},search:function(a){return null===a||void 0===a||0===a.length}},"!null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.notEmpty",
b.conditions.number.notEmpty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return!(null===a||void 0===a||0===a.length)}}};c.numFmtConditions={"=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.equals",b.conditions.number.equals)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");b=0===b[0].indexOf("-")?
"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");return+a===+b}},"!=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.not",b.conditions.number.not)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");b=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");return+a!==+b}},"<":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.lt",
b.conditions.number.lt)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");b=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");return+a<+b}},"<=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.lte",b.conditions.number.lte)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,
b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");b=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");return+a<=+b}},">=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.gte",b.conditions.number.gte)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");b=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,
""):b[0].replace(/[^0-9.]/g,"");return+a>=+b}},">":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.gt",b.conditions.number.gt)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");b=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");return+a>+b}},between:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.between",
b.conditions.number.between)},init:c.init2Input,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");var e=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");b=0===b[1].indexOf("-")?"-"+b[1].replace(/[^0-9.]/g,""):b[1].replace(/[^0-9.]/g,"");return+e<+b?+e<=+a&&+a<=+b:+b<=+a&&+a<=+e}},"!between":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.notBetween",
b.conditions.number.notBetween)},init:c.init2Input,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){a=0===a.indexOf("-")?"-"+a.replace(/[^0-9.]/g,""):a.replace(/[^0-9.]/g,"");var e=0===b[0].indexOf("-")?"-"+b[0].replace(/[^0-9.]/g,""):b[0].replace(/[^0-9.]/g,"");b=0===b[1].indexOf("-")?"-"+b[1].replace(/[^0-9.]/g,""):b[1].replace(/[^0-9.]/g,"");return+e<+b?!(+e<=+a&&+a<=+b):!(+b<=+a&&+a<=+e)}},"null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.empty",
b.conditions.number.empty)},init:c.initNoValue,inputValue:function(){},isInputValid:function(){return!0},search:function(a){return null===a||void 0===a||0===a.length}},"!null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.number.notEmpty",b.conditions.number.notEmpty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return!(null===a||void 0===a||0===a.length)}}};c.stringConditions={"=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.equals",
b.conditions.string.equals)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){return a===b[0]}},"!=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.not",b.conditions.string.not)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidInput,search:function(a,b){return a!==b[0]}},starts:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.startsWith",b.conditions.string.startsWith)},
init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return 0===a.toLowerCase().indexOf(b[0].toLowerCase())}},contains:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.contains",b.conditions.string.contains)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return-1!==a.toLowerCase().indexOf(b[0].toLowerCase())}},ends:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.endsWith",
b.conditions.string.endsWith)},init:c.initInput,inputValue:c.inputValueInput,isInputValid:c.isInputValidInput,search:function(a,b){return a.toLowerCase().endsWith(b[0].toLowerCase())}},"null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.empty",b.conditions.string.empty)},init:c.initNoValue,inputValue:function(){},isInputValid:function(){return!0},search:function(a){return null===a||void 0===a||0===a.length}},"!null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.string.notEmpty",
b.conditions.string.notEmpty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return!(null===a||void 0===a||0===a.length)}}};c.arrayConditions={contains:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.array.contains",b.conditions.array.contains)},init:c.initSelectArray,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){return-1!==a.indexOf(b[0])}},without:{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.array.without",
b.conditions.array.without)},init:c.initSelectArray,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){return-1===a.indexOf(b[0])}},"=":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.array.equals",b.conditions.array.equals)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){if(a.length===b[0].length){for(var e=0;e<a.length;e++)if(a[e]!==b[0][e])return!1;return!0}return!1}},"!=":{conditionName:function(a,
b){return a.i18n("searchBuilder.conditions.array.not",b.conditions.array.not)},init:c.initSelect,inputValue:c.inputValueSelect,isInputValid:c.isInputValidSelect,search:function(a,b){if(a.length===b[0].length){for(var e=0;e<a.length;e++)if(a[e]!==b[0][e])return!0;return!1}return!0}},"null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.array.empty",b.conditions.array.empty)},init:c.initNoValue,isInputValid:function(){return!0},inputValue:function(){},search:function(a){return null===
a||void 0===a||0===a.length}},"!null":{conditionName:function(a,b){return a.i18n("searchBuilder.conditions.array.notEmpty",b.conditions.array.notEmpty)},isInputValid:function(){return!0},init:c.initNoValue,inputValue:function(){},search:function(a){return null!==a&&void 0!==a&&0!==a.length}}};c.defaults={columns:!0,conditions:{array:c.arrayConditions,date:c.dateConditions,html:c.stringConditions,"html-num":c.numConditions,"html-num-fmt":c.numFmtConditions,moment:c.momentDateConditions,num:c.numConditions,
"num-fmt":c.numFmtConditions,string:c.stringConditions},depthLimit:!1,filterChanged:void 0,greyscale:!1,i18n:{add:"Add Condition",button:{0:"Search Builder",_:"Search Builder (%d)"},clearAll:"Clear All",condition:"Condition",data:"Data",deleteTitle:"Delete filtering rule",leftTitle:"Outdent criteria",logicAnd:"And",logicOr:"Or",rightTitle:"Indent criteria",title:{0:"Custom Search Builder",_:"Custom Search Builder (%d)"},value:"Value",valueJoiner:"and"},logic:"AND",orthogonal:{display:"display",search:"filter"},
preDefined:!1};return c}(),n,L,M=function(){function c(a,b,e,g,k,d){void 0===g&&(g=0);void 0===k&&(k=!1);void 0===d&&(d=1);if(!L||!L.versionCheck||!L.versionCheck("1.10.0"))throw Error("SearchBuilder requires DataTables 1.10 or newer");this.classes=n.extend(!0,{},c.classes);this.c=n.extend(!0,{},c.defaults,b);this.s={criteria:[],depth:d,dt:a,index:g,isChild:k,logic:void 0,opts:b,toDrop:void 0,topGroup:e};this.dom={add:n("<button/>").addClass(this.classes.add).addClass(this.classes.button).attr("type",
"button"),clear:n("<button>&times</button>").addClass(this.classes.button).addClass(this.classes.clearGroup).attr("type","button"),container:n("<div/>").addClass(this.classes.group),logic:n("<button/>").addClass(this.classes.logic).addClass(this.classes.button).attr("type","button"),logicContainer:n("<div/>").addClass(this.classes.logicContainer)};void 0===this.s.topGroup&&(this.s.topGroup=this.dom.container);this._setup();return this}c.prototype.destroy=function(){n(this.dom.add).off(".dtsb");n(this.dom.logic).off(".dtsb");
n(this.dom.container).trigger("dtsb-destroy").remove();this.s.criteria=[]};c.prototype.getDetails=function(){if(0===this.s.criteria.length)return{};for(var a={criteria:[],logic:this.s.logic},b=0,e=this.s.criteria;b<e.length;b++)a.criteria.push(e[b].criteria.getDetails());return a};c.prototype.getNode=function(){return this.dom.container};c.prototype.rebuild=function(a){if(void 0!==a.criteria&&null!==a.criteria&&0!==a.criteria.length){this.s.logic=a.logic;n(this.dom.logic).text("OR"===this.s.logic?
this.s.dt.i18n("searchBuilder.logicOr",this.c.i18n.logicOr):this.s.dt.i18n("searchBuilder.logicAnd",this.c.i18n.logicAnd));for(var b=0,e=a.criteria;b<e.length;b++)a=e[b],void 0!==a.logic?this._addPrevGroup(a):void 0===a.logic&&this._addPrevCriteria(a);b=0;for(e=this.s.criteria;b<e.length;b++)a=e[b],a.criteria instanceof x&&(a.criteria.updateArrows(1<this.s.criteria.length,!1),this._setCriteriaListeners(a.criteria))}};c.prototype.redrawContents=function(){n(this.dom.container).empty().append(this.dom.logicContainer).append(this.dom.add);
this.s.criteria.sort(function(e,g){return e.criteria.s.index<g.criteria.s.index?-1:e.criteria.s.index>g.criteria.s.index?1:0});this.setListeners();for(var a=0;a<this.s.criteria.length;a++){var b=this.s.criteria[a].criteria;b instanceof x?(this.s.criteria[a].index=a,this.s.criteria[a].criteria.s.index=a,n(this.s.criteria[a].criteria.dom.container).insertBefore(this.dom.add),this._setCriteriaListeners(b),this.s.criteria[a].criteria.rebuild(this.s.criteria[a].criteria.getDetails())):b instanceof c&&
0<b.s.criteria.length?(this.s.criteria[a].index=a,this.s.criteria[a].criteria.s.index=a,n(this.s.criteria[a].criteria.dom.container).insertBefore(this.dom.add),b.redrawContents(),this._setGroupListeners(b)):(this.s.criteria.splice(a,1),a--)}this.setupLogic()};c.prototype.search=function(a,b){return"AND"===this.s.logic?this._andSearch(a,b):"OR"===this.s.logic?this._orSearch(a,b):!0};c.prototype.setupLogic=function(){n(this.dom.logicContainer).remove();n(this.dom.clear).remove();if(1>this.s.criteria.length)this.s.isChild||
(n(this.dom.container).trigger("dtsb-destroy"),n(this.dom.container).css("margin-left",0));else{var a=n(this.dom.container).height()-2;n(this.dom.clear).height("0px");n(this.dom.logicContainer).append(this.dom.clear).width(a);n(this.dom.container).prepend(this.dom.logicContainer);this._setLogicListener();n(this.dom.container).css("margin-left",n(this.dom.logicContainer).outerHeight(!0));a=n(this.dom.logicContainer).offset();var b=a.left,e=n(this.dom.container).offset().left;b=b-(b-e)-n(this.dom.logicContainer).outerHeight(!0);
n(this.dom.logicContainer).offset({left:b});b=n(this.dom.logicContainer).next();a=a.top;b=n(b).offset().top;a-=a-b;n(this.dom.logicContainer).offset({top:a});n(this.dom.clear).outerHeight(n(this.dom.logicContainer).height());this._setClearListener()}};c.prototype.setListeners=function(){var a=this;n(this.dom.add).unbind("click");n(this.dom.add).on("click",function(){a.s.isChild||n(a.dom.container).prepend(a.dom.logicContainer);a.addCriteria();n(a.dom.container).trigger("dtsb-add");a.s.dt.state.save();
return!1});for(var b=0,e=this.s.criteria;b<e.length;b++)e[b].criteria.setListeners();this._setClearListener();this._setLogicListener()};c.prototype.addCriteria=function(a,b){void 0===a&&(a=null);void 0===b&&(b=!0);var e=null===a?this.s.criteria.length:a.s.index,g=new x(this.s.dt,this.s.opts,this.s.topGroup,e,this.s.depth);null!==a&&(g.c=a.c,g.s=a.s,g.s.depth=this.s.depth,g.classes=a.classes);g.populate();a=!1;for(var k=0;k<this.s.criteria.length;k++)0===k&&this.s.criteria[k].criteria.s.index>g.s.index?
(n(g.getNode()).insertBefore(this.s.criteria[k].criteria.dom.container),a=!0):k<this.s.criteria.length-1&&this.s.criteria[k].criteria.s.index<g.s.index&&this.s.criteria[k+1].criteria.s.index>g.s.index&&(n(g.getNode()).insertAfter(this.s.criteria[k].criteria.dom.container),a=!0);a||n(g.getNode()).insertBefore(this.dom.add);this.s.criteria.push({criteria:g,index:e});this.s.criteria=this.s.criteria.sort(function(d,h){return d.criteria.s.index-h.criteria.s.index});e=0;for(a=this.s.criteria;e<a.length;e++)k=
a[e],k.criteria instanceof x&&k.criteria.updateArrows(1<this.s.criteria.length,b);this._setCriteriaListeners(g);g.setListeners();this.setupLogic()};c.prototype.checkFilled=function(){for(var a=0,b=this.s.criteria;a<b.length;a++){var e=b[a];if(e.criteria instanceof x&&e.criteria.s.filled||e.criteria instanceof c&&e.criteria.checkFilled())return!0}return!1};c.prototype.count=function(){for(var a=0,b=0,e=this.s.criteria;b<e.length;b++){var g=e[b];g.criteria instanceof c?a+=g.criteria.count():a++}return a};
c.prototype._addPrevGroup=function(a){var b=this.s.criteria.length,e=new c(this.s.dt,this.c,this.s.topGroup,b,!0,this.s.depth+1);this.s.criteria.push({criteria:e,index:b,logic:e.s.logic});e.rebuild(a);this.s.criteria[b].criteria=e;n(this.s.topGroup).trigger("dtsb-redrawContents");this._setGroupListeners(e)};c.prototype._addPrevCriteria=function(a){var b=this.s.criteria.length,e=new x(this.s.dt,this.s.opts,this.s.topGroup,b,this.s.depth);e.populate();this.s.criteria.push({criteria:e,index:b});e.rebuild(a);
this.s.criteria[b].criteria=e;n(this.s.topGroup).trigger("dtsb-redrawContents")};c.prototype._andSearch=function(a,b){if(0===this.s.criteria.length)return!0;for(var e=0,g=this.s.criteria;e<g.length;e++){var k=g[e];if(!(k.criteria instanceof x&&!k.criteria.s.filled||k.criteria.search(a,b)))return!1}return!0};c.prototype._orSearch=function(a,b){if(0===this.s.criteria.length)return!0;for(var e=!1,g=0,k=this.s.criteria;g<k.length;g++){var d=k[g];if(d.criteria instanceof x&&d.criteria.s.filled){if(e=!0,
d.criteria.search(a,b))return!0}else if(d.criteria instanceof c&&d.criteria.checkFilled()&&(e=!0,d.criteria.search(a,b)))return!0}return!e};c.prototype._removeCriteria=function(a,b){void 0===b&&(b=!1);if(1>=this.s.criteria.length&&this.s.isChild)this.destroy();else{for(var e=void 0,g=0;g<this.s.criteria.length;g++)this.s.criteria[g].index===a.s.index&&(!b||this.s.criteria[g].criteria instanceof c)&&(e=g);void 0!==e&&this.s.criteria.splice(e,1);for(g=0;g<this.s.criteria.length;g++)this.s.criteria[g].index=
g,this.s.criteria[g].criteria.s.index=g}};c.prototype._setCriteriaListeners=function(a){var b=this;n(a.dom["delete"]).unbind("click").on("click",function(){b._removeCriteria(a);n(a.dom.container).remove();for(var e=0,g=b.s.criteria;e<g.length;e++){var k=g[e];k.criteria instanceof x&&k.criteria.updateArrows(1<b.s.criteria.length)}a.destroy();b.s.dt.draw();n(b.s.topGroup).trigger("dtsb-redrawContents");n(b.s.topGroup).trigger("dtsb-updateTitle");return!1});n(a.dom.right).unbind("click").on("click",
function(){var e=a.s.index,g=new c(b.s.dt,b.s.opts,b.s.topGroup,a.s.index,!0,b.s.depth+1);g.addCriteria(a);b.s.criteria[e].criteria=g;b.s.criteria[e].logic="AND";n(b.s.topGroup).trigger("dtsb-redrawContents");b._setGroupListeners(g);return!1});n(a.dom.left).unbind("click").on("click",function(){b.s.toDrop=new x(b.s.dt,b.s.opts,b.s.topGroup,a.s.index);b.s.toDrop.s=a.s;b.s.toDrop.c=a.c;b.s.toDrop.classes=a.classes;b.s.toDrop.populate();var e=b.s.toDrop.s.index;n(b.dom.container).trigger("dtsb-dropCriteria");
a.s.index=e;b._removeCriteria(a);n(b.s.topGroup).trigger("dtsb-redrawContents");b.s.dt.draw();return!1})};c.prototype._setClearListener=function(){var a=this;n(this.dom.clear).unbind("click").on("click",function(){if(!a.s.isChild)return n(a.dom.container).trigger("dtsb-clearContents"),!1;a.destroy();n(a.s.topGroup).trigger("dtsb-updateTitle");n(a.s.topGroup).trigger("dtsb-redrawContents");return!1})};c.prototype._setGroupListeners=function(a){var b=this;n(a.dom.add).unbind("click").on("click",function(){b.setupLogic();
n(b.dom.container).trigger("dtsb-add");return!1});n(a.dom.container).unbind("dtsb-add").on("dtsb-add",function(){b.setupLogic();n(b.dom.container).trigger("dtsb-add");return!1});n(a.dom.container).unbind("dtsb-destroy").on("dtsb-destroy",function(){b._removeCriteria(a,!0);n(a.dom.container).remove();b.setupLogic();return!1});n(a.dom.container).unbind("dtsb-dropCriteria").on("dtsb-dropCriteria",function(){var e=a.s.toDrop;e.s.index=a.s.index;e.updateArrows(1<b.s.criteria.length,!1);b.addCriteria(e,
!1);return!1});a.setListeners()};c.prototype._setup=function(){this.setListeners();n(this.dom.add).text(this.s.dt.i18n("searchBuilder.add",this.c.i18n.add));n(this.dom.logic).text("OR"===this.c.logic?this.s.dt.i18n("searchBuilder.logicOr",this.c.i18n.logicOr):this.s.dt.i18n("searchBuilder.logicAnd",this.c.i18n.logicAnd));this.s.logic="OR"===this.c.logic?"OR":"AND";this.c.greyscale&&n(this.dom.logic).addClass(this.classes.greyscale);n(this.dom.logicContainer).append(this.dom.logic).append(this.dom.clear);
this.s.isChild&&n(this.dom.container).append(this.dom.logicContainer);n(this.dom.container).append(this.dom.add)};c.prototype._setLogicListener=function(){var a=this;n(this.dom.logic).unbind("click").on("click",function(){a._toggleLogic();a.s.dt.draw();for(var b=0,e=a.s.criteria;b<e.length;b++)e[b].criteria.setListeners()})};c.prototype._toggleLogic=function(){"OR"===this.s.logic?(this.s.logic="AND",n(this.dom.logic).text(this.s.dt.i18n("searchBuilder.logicAnd",this.c.i18n.logicAnd))):"AND"===this.s.logic&&
(this.s.logic="OR",n(this.dom.logic).text(this.s.dt.i18n("searchBuilder.logicOr",this.c.i18n.logicOr)))};c.version="1.0.0";c.classes={add:"dtsb-add",button:"dtsb-button",clearGroup:"dtsb-clearGroup",greyscale:"dtsb-greyscale",group:"dtsb-group",inputButton:"dtsb-iptbtn",logic:"dtsb-logic",logicContainer:"dtsb-logicContainer"};c.defaults={columns:!0,conditions:{date:x.dateConditions,html:x.stringConditions,"html-num":x.numConditions,"html-num-fmt":x.numFmtConditions,moment:x.momentDateConditions,num:x.numConditions,
"num-fmt":x.numFmtConditions,string:x.stringConditions},depthLimit:!1,filterChanged:void 0,greyscale:!1,i18n:{add:"Add Condition",button:{0:"Search Builder",_:"Search Builder (%d)"},clearAll:"Clear All",condition:"Condition",data:"Data",deleteTitle:"Delete filtering rule",leftTitle:"Outdent criteria",logicAnd:"And",logicOr:"Or",rightTitle:"Indent criteria",title:{0:"Custom Search Builder",_:"Custom Search Builder (%d)"},value:"Value",valueJoiner:"and"},logic:"AND",orthogonal:{display:"display",search:"filter"},
preDefined:!1};return c}(),w,J,O=function(){function c(a,b){var e=this;if(!J||!J.versionCheck||!J.versionCheck("1.10.0"))throw Error("SearchBuilder requires DataTables 1.10 or newer");a=new J.Api(a);this.classes=w.extend(!0,{},c.classes);this.c=w.extend(!0,{},c.defaults,b);this.dom={clearAll:w('<button type="button">'+a.i18n("searchBuilder.clearAll",this.c.i18n.clearAll)+"</button>").addClass(this.classes.clearAll).addClass(this.classes.button).attr("type","button"),container:w("<div/>").addClass(this.classes.container),
title:w("<div/>").addClass(this.classes.title),titleRow:w("<div/>").addClass(this.classes.titleRow),topGroup:void 0};this.s={dt:a,opts:b,search:void 0,topGroup:void 0};if(void 0===a.settings()[0]._searchBuilder){a.settings()[0]._searchBuilder=this;if(this.s.dt.settings()[0]._bInitComplete)this._setUp();else a.one("init.dt",function(){e._setUp()});return this}}c.prototype.getDetails=function(){return this.s.topGroup.getDetails()};c.prototype.getNode=function(){return this.dom.container};c.prototype.rebuild=
function(a){w(this.dom.clearAll).click();if(void 0===a||null===a)return this;this.s.topGroup.rebuild(a);this.s.dt.draw();this.s.topGroup.setListeners();return this};c.prototype._applyPreDefDefaults=function(a){var b=this;void 0!==a.criteria&&void 0===a.logic&&(a.logic="AND");for(var e=function(h){void 0!==h.criteria?h=g._applyPreDefDefaults(h):g.s.dt.columns().every(function(l){b.s.dt.settings()[0].aoColumns[l].sTitle===h.data&&(h.dataIdx=l)})},g=this,k=0,d=a.criteria;k<d.length;k++)e(d[k]);return a};
c.prototype._setUp=function(a){var b=this;void 0===a&&(a=!0);this.s.topGroup=new M(this.s.dt,this.c,void 0);this._setClearListener();this.s.dt.on("stateSaveParams",function(e,g,k){k.searchBuilder=b.getDetails();k.page=b.s.dt.page()});this._build();a&&(a=this.s.dt.state.loaded(),null!==a&&void 0!==a.searchBuilder?(this.s.topGroup.rebuild(a.searchBuilder),w(this.s.topGroup.dom.container).trigger("dtsb-redrawContents"),this.s.dt.page(a.page).draw("page"),this.s.topGroup.setListeners()):!1!==this.c.preDefined&&
(this.c.preDefined=this._applyPreDefDefaults(this.c.preDefined),this.rebuild(this.c.preDefined)));this._setEmptyListener();this.s.dt.state.save()};c.prototype._updateTitle=function(a){w(this.dom.title).text(this.s.dt.i18n("searchBuilder.title",this.c.i18n.title,a))};c.prototype._build=function(){var a=this;w(this.dom.clearAll).remove();w(this.dom.container).empty();var b=this.s.topGroup.count();this._updateTitle(b);w(this.dom.titleRow).append(this.dom.title);w(this.dom.container).append(this.dom.titleRow);
this.dom.topGroup=this.s.topGroup.getNode();w(this.dom.container).append(this.dom.topGroup);this._setRedrawListener();var e=this.s.dt.table(0).node();-1===w.fn.dataTable.ext.search.indexOf(this.s.search)&&(this.s.search=function(g,k,d,h){return g.nTable!==e?!0:a.s.topGroup.search(k,d)},w.fn.dataTable.ext.search.push(this.s.search));w.fn.DataTable.Api.registerPlural("columns().type()","column().type()",function(g,k){return this.iterator("column",function(d,h){return d.aoColumns[h].sType},1)});this.s.dt.on("destroy.dt",
function(){w(a.dom.container).remove();w(a.dom.clearAll).remove();for(var g=w.fn.dataTable.ext.search.indexOf(a.s.search);-1!==g;)w.fn.dataTable.ext.search.splice(g,1),g=w.fn.dataTable.ext.search.indexOf(a.s.search)})};c.prototype._checkClear=function(){0<this.s.topGroup.s.criteria.length?(w(this.dom.clearAll).insertAfter(this.dom.title),this._setClearListener()):w(this.dom.clearAll).remove()};c.prototype._filterChanged=function(a){var b=this.c.filterChanged;"function"===typeof b&&b(a,this.s.dt.i18n("searchBuilder.button",
this.c.i18n.button,a))};c.prototype._setClearListener=function(){var a=this;w(this.dom.clearAll).unbind("click");w(this.dom.clearAll).on("click",function(){a.s.topGroup=new M(a.s.dt,a.c,void 0);a._build();a.s.dt.draw();a.s.topGroup.setListeners();w(a.dom.clearAll).remove();a._setEmptyListener();a._filterChanged(0);return!1})};c.prototype._setRedrawListener=function(){var a=this;w(this.s.topGroup.dom.container).unbind("dtsb-redrawContents");w(this.s.topGroup.dom.container).on("dtsb-redrawContents",
function(){a._checkClear();a.s.topGroup.redrawContents();a.s.topGroup.setupLogic();a._setEmptyListener();var b=a.s.topGroup.count();a._updateTitle(b);a._filterChanged(b);a.s.dt.state.save()});w(this.s.topGroup.dom.container).unbind("dtsb-clearContents");w(this.s.topGroup.dom.container).on("dtsb-clearContents",function(){a._setUp(!1);a._filterChanged(0);a.s.dt.draw()});w(this.s.topGroup.dom.container).on("dtsb-updateTitle",function(){var b=a.s.topGroup.count();a._updateTitle(b);a._filterChanged(b)})};
c.prototype._setEmptyListener=function(){var a=this;w(this.s.topGroup.dom.add).on("click",function(){a._checkClear()});w(this.s.topGroup.dom.container).on("dtsb-destroy",function(){w(a.dom.clearAll).remove()})};c.version="1.0.1";c.classes={button:"dtsb-button",clearAll:"dtsb-clearAll",container:"dtsb-searchBuilder",inputButton:"dtsb-iptbtn",title:"dtsb-title",titleRow:"dtsb-titleRow"};c.defaults={columns:!0,conditions:{date:x.dateConditions,html:x.stringConditions,"html-num":x.numConditions,"html-num-fmt":x.numFmtConditions,
moment:x.momentDateConditions,num:x.numConditions,"num-fmt":x.numFmtConditions,string:x.stringConditions},depthLimit:!1,filterChanged:void 0,greyscale:!1,i18n:{add:"Add Condition",button:{0:"Search Builder",_:"Search Builder (%d)"},clearAll:"Clear All",condition:"Condition",conditions:{array:{contains:"Contains",empty:"Empty",equals:"Equals",not:"Not",notEmpty:"Not Empty",without:"Without"},date:{after:"After",before:"Before",between:"Between",empty:"Empty",equals:"Equals",not:"Not",notBetween:"Not Between",
notEmpty:"Not Empty"},moment:{after:"After",before:"Before",between:"Between",empty:"Empty",equals:"Equals",not:"Not",notBetween:"Not Between",notEmpty:"Not Empty"},number:{between:"Between",empty:"Empty",equals:"Equals",gt:"Greater Than",gte:"Greater Than Equal To",lt:"Less Than",lte:"Less Than Equal To",not:"Not",notBetween:"Not Between",notEmpty:"Not Empty"},string:{contains:"Contains",empty:"Empty",endsWith:"Ends With",equals:"Equals",not:"Not",notEmpty:"Not Empty",startsWith:"Starts With"}},
data:"Data",deleteTitle:"Delete filtering rule",leftTitle:"Outdent criteria",logicAnd:"And",logicOr:"Or",rightTitle:"Indent criteria",title:{0:"Custom Search Builder",_:"Custom Search Builder (%d)"},value:"Value",valueJoiner:"and"},logic:"AND",orthogonal:{display:"display",search:"filter"},preDefined:!1};return c}();(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return c(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 c(b,a,a.document)}:c(window.jQuery,window,document)})(function(c,a,b){function e(k,d){k=new g.Api(k);d=d?d:k.init().searchBuilder||g.defaults.searchBuilder;return(new O(k,d)).getNode()}t(c);r(c);m(c);var g=c.fn.dataTable;c.fn.dataTable.SearchBuilder=O;c.fn.DataTable.SearchBuilder=O;c.fn.dataTable.Group=M;c.fn.DataTable.Group=M;c.fn.dataTable.Criteria=x;c.fn.DataTable.Criteria=x;a=c.fn.dataTable.Api.register;c.fn.dataTable.ext.searchBuilder=
{conditions:{}};c.fn.dataTable.ext.buttons.searchBuilder={action:function(k,d,h,l){k.stopPropagation();this.popover(l._searchBuilder.getNode(),{align:"dt-container"})},config:{},init:function(k,d,h){var l=new c.fn.dataTable.SearchBuilder(k,c.extend({filterChanged:function(q,p){k.button(d).text(p)}},h.config));k.button(d).text(h.text||k.i18n("searchBuilder.button",l.c.i18n.button,0));h._searchBuilder=l},text:null};a("searchBuilder.getDetails()",function(){return this.context[0]._searchBuilder.getDetails()});
a("searchBuilder.rebuild()",function(k){this.context[0]._searchBuilder.rebuild(k);return this});a("searchBuilder.container()",function(){return this.context[0]._searchBuilder.getNode()});c(b).on("preInit.dt.dtsp",function(k,d,h){"dt"===k.namespace&&(d.oInit.searchBuilder||g.defaults.searchBuilder)&&(d._searchBuilder||e(d))});g.ext.feature.push({cFeature:"Q",fnInit:e});g.ext.features&&g.ext.features.register("searchBuilder",e)})})();