/*!
   Copyright 2009-2021 SpryMedia Ltd.

 This source file is free software, available under the following license:
   MIT license - http://datatables.net/license/mit

 This source file is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.

 For details please refer to: http://www.datatables.net
 KeyTable 2.6.0
 ©2009-2021 SpryMedia Ltd - datatables.net/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(b){var h=0;return function(){return h<b.length?{done:!1,value:b[h++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$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(b,h,k){if(b==Array.prototype||b==Object.prototype)return b;b[h]=k.value;return b};$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var h=0;h<b.length;++h){var k=b[h];if(k&&k.Math==Math)return k}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(b,h){var k=$jscomp.propertyToPolyfillSymbol[h];if(null==k)return b[h];k=b[k];return void 0!==k?k:b[h]};
$jscomp.polyfill=function(b,h,k,n){h&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,h,k,n):$jscomp.polyfillUnisolated(b,h,k,n))};$jscomp.polyfillUnisolated=function(b,h,k,n){k=$jscomp.global;b=b.split(".");for(n=0;n<b.length-1;n++){var m=b[n];if(!(m in k))return;k=k[m]}b=b[b.length-1];n=k[b];h=h(n);h!=n&&null!=h&&$jscomp.defineProperty(k,b,{configurable:!0,writable:!0,value:h})};
$jscomp.polyfillIsolated=function(b,h,k,n){var m=b.split(".");b=1===m.length;n=m[0];n=!b&&n in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var u=0;u<m.length-1;u++){var w=m[u];if(!(w in n))return;n=n[w]}m=m[m.length-1];k=$jscomp.IS_SYMBOL_NATIVE&&"es6"===k?n[m]:null;h=h(k);null!=h&&(b?$jscomp.defineProperty($jscomp.polyfills,m,{configurable:!0,writable:!0,value:h}):h!==k&&($jscomp.propertyToPolyfillSymbol[m]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(m):$jscomp.POLYFILL_PREFIX+m,m=
$jscomp.propertyToPolyfillSymbol[m],$jscomp.defineProperty(n,m,{configurable:!0,writable:!0,value:h})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(b){if(b)return b;var h=function(m,u){this.$jscomp$symbol$id_=m;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:u})};h.prototype.toString=function(){return this.$jscomp$symbol$id_};var k=0,n=function(m){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return new h("jscomp_symbol_"+(m||"")+"_"+k++,m)};return n},"es6","es3");$jscomp.initSymbolIterator=function(){};
$jscomp.polyfill("Symbol.iterator",function(b){if(b)return b;b=Symbol("Symbol.iterator");for(var h="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),k=0;k<h.length;k++){var n=$jscomp.global[h[k]];"function"===typeof n&&"function"!=typeof n.prototype[b]&&$jscomp.defineProperty(n.prototype,b,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return b},"es6",
"es3");$jscomp.initSymbolAsyncIterator=function(){};$jscomp.iteratorPrototype=function(b){b={next:b};b[Symbol.iterator]=function(){return this};return b};$jscomp.iteratorFromArray=function(b,h){b instanceof String&&(b+="");var k=0,n={next:function(){if(k<b.length){var m=k++;return{value:h(m,b[m]),done:!1}}n.next=function(){return{done:!0,value:void 0}};return n.next()}};n[Symbol.iterator]=function(){return n};return n};
$jscomp.polyfill("Array.prototype.keys",function(b){return b?b:function(){return $jscomp.iteratorFromArray(this,function(h){return h})}},"es6","es3");
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(h){return b(h,window,document)}):"object"===typeof exports?module.exports=function(h,k){h||(h=window);k&&k.fn.dataTable||(k=require("datatables.net")(h,k).$);return b(k,h,h.document)}:b(jQuery,window,document)})(function(b,h,k,n){var m=b.fn.dataTable,u=0,w=0,t=function(a,c){if(!m.versionCheck||!m.versionCheck("1.10.8"))throw"KeyTable requires DataTables 1.10.8 or newer";this.c=b.extend(!0,{},m.defaults.keyTable,
t.defaults,c);this.s={dt:new m.Api(a),enable:!0,focusDraw:!1,waitingForDraw:!1,lastFocus:null,namespace:".keyTable-"+u++,tabInput:null};this.dom={};a=this.s.dt.settings()[0];if(c=a.keytable)return c;a.keytable=this;this._constructor()};b.extend(t.prototype,{blur:function(){this._blur()},enable:function(a){this.s.enable=a},enabled:function(){return this.s.enable},focus:function(a,c){this._focus(this.s.dt.cell(a,c))},focused:function(a){if(!this.s.lastFocus)return!1;var c=this.s.lastFocus.cell.index();
return a.row===c.row&&a.column===c.column},_constructor:function(){this._tabInput();var a=this,c=this.s.dt,e=b(c.table().node()),d=this.s.namespace,g=!1;"static"===e.css("position")&&e.css("position","relative");b(c.table().body()).on("click"+d,"th, td",function(f){if(!1!==a.s.enable){var q=c.cell(this);q.any()&&a._focus(q,null,!1,f)}});b(k).on("keydown"+d,function(f){g||a._key(f)});if(this.c.blurable)b(k).on("mousedown"+d,function(f){b(f.target).parents(".dataTables_filter").length&&a._blur();b(f.target).parents().filter(c.table().container()).length||
b(f.target).parents("div.DTE").length||b(f.target).parents("div.editor-datetime").length||b(f.target).parents("div.dt-datetime").length||b(f.target).parents().filter(".DTFC_Cloned").length||a._blur()});if(this.c.editor){var p=this.c.editor;p.on("open.keyTableMain",function(f,q,r){"inline"!==q&&a.s.enable&&(a.enable(!1),p.one("close"+d,function(){a.enable(!0)}))});if(this.c.editOnFocus)c.on("key-focus"+d+" key-refocus"+d,function(f,q,r,v){a._editor(null,v,!0)});c.on("key"+d,function(f,q,r,v,x){a._editor(r,
x,!1)});b(c.table().body()).on("dblclick"+d,"th, td",function(f){!1!==a.s.enable&&c.cell(this).any()&&(a.s.lastFocus&&this!==a.s.lastFocus.cell.node()||a._editor(null,f,!0))});p.on("preSubmit",function(){g=!0}).on("preSubmitCancelled",function(){g=!1}).on("submitComplete",function(){g=!1})}if(c.settings()[0].oFeatures.bStateSave)c.on("stateSaveParams"+d,function(f,q,r){r.keyTable=a.s.lastFocus?a.s.lastFocus.cell.index():null});c.on("column-visibility"+d,function(f){a._tabInput()});c.on("draw"+d,function(f){a._tabInput();
if(!a.s.focusDraw&&a.s.lastFocus){var q=a.s.lastFocus.relative,r=c.page.info(),v=q.row+r.start;0!==r.recordsDisplay&&(v>=r.recordsDisplay&&(v=r.recordsDisplay-1),a._focus(v,q.column,!0,f))}});this.c.clipboard&&this._clipboard();c.on("destroy"+d,function(){a._blur(!0);c.off(d);b(c.table().body()).off("click"+d,"th, td").off("dblclick"+d,"th, td");b(k).off("mousedown"+d).off("keydown"+d).off("copy"+d).off("paste"+d)});var l=c.state.loaded();if(l&&l.keyTable)c.one("init",function(){var f=c.cell(l.keyTable);
f.any()&&f.focus()});else this.c.focus&&c.cell(this.c.focus).focus()},_blur:function(a){if(this.s.enable&&this.s.lastFocus){var c=this.s.lastFocus.cell;b(c.node()).removeClass(this.c.className);this.s.lastFocus=null;a||(this._updateFixedColumns(c.index().column),this._emitEvent("key-blur",[this.s.dt,c]))}},_clipboard:function(){var a=this.s.dt,c=this,e=this.s.namespace;h.getSelection&&(b(k).on("copy"+e,function(d){d=d.originalEvent;var g=h.getSelection().toString(),p=c.s.lastFocus;!g&&p&&(d.clipboardData.setData("text/plain",
p.cell.render(c.c.clipboardOrthogonal)),d.preventDefault())}),b(k).on("paste"+e,function(d){d=d.originalEvent;var g=c.s.lastFocus,p=k.activeElement,l=c.c.editor,f;!g||p&&"body"!==p.nodeName.toLowerCase()||(d.preventDefault(),h.clipboardData&&h.clipboardData.getData?f=h.clipboardData.getData("Text"):d.clipboardData&&d.clipboardData.getData&&(f=d.clipboardData.getData("text/plain")),l?l.inline(g.cell.index()).set(l.displayed()[0],f).submit():(g.cell.data(f),a.draw(!1)))}))},_columns:function(){var a=
this.s.dt,c=a.columns(this.c.columns).indexes(),e=[];a.columns(":visible").every(function(d){-1!==c.indexOf(d)&&e.push(d)});return e},_editor:function(a,c,e){if(this.s.lastFocus&&"draw"!==c.type){var d=this,g=this.s.dt,p=this.c.editor,l=this.s.lastFocus.cell,f=this.s.namespace+"e"+w++;if(!(b("div.DTE",l.node()).length||null!==a&&(0<=a&&9>=a||11===a||12===a||14<=a&&31>=a||112<=a&&123>=a||127<=a&&159>=a))){c.stopPropagation();13===a&&c.preventDefault();var q=function(){p.one("open"+f,function(){p.off("cancelOpen"+
f);e||b("div.DTE_Field_InputControl input, div.DTE_Field_InputControl textarea").select();g.keys.enable(e?"tab-only":"navigation-only");g.on("key-blur.editor",function(r,v,x){p.displayed()&&x.node()===l.node()&&p.submit()});e&&b(g.table().container()).addClass("dtk-focus-alt");p.on("preSubmitCancelled"+f,function(){setTimeout(function(){d._focus(l,null,!1)},50)});p.on("submitUnsuccessful"+f,function(){d._focus(l,null,!1)});p.one("close"+f,function(){g.keys.enable(!0);g.off("key-blur.editor");p.off(f);
b(g.table().container()).removeClass("dtk-focus-alt");d.s.returnSubmit&&d._emitEvent("key-return-submit",[g,l])})}).one("cancelOpen"+f,function(){p.off(f)}).inline(l.index())};13===a?(e=!0,b(k).one("keyup",function(){q()})):q()}}},_emitEvent:function(a,c){this.s.dt.iterator("table",function(e,d){b(e.nTable).triggerHandler(a,c)})},_focus:function(a,c,e,d){var g=this,p=this.s.dt,l=p.page.info(),f=this.s.lastFocus;d||(d=null);if(this.s.enable){if("number"!==typeof a){if(!a.any())return;var q=a.index();
c=q.column;a=p.rows({filter:"applied",order:"applied"}).indexes().indexOf(q.row);if(0>a)return;l.serverSide&&(a+=l.start)}if(-1!==l.length&&(a<l.start||a>=l.start+l.length))this.s.focusDraw=!0,this.s.waitingForDraw=!0,p.one("draw",function(){g.s.focusDraw=!1;g.s.waitingForDraw=!1;g._focus(a,c,n,d)}).page(Math.floor(a/l.length)).draw(!1);else if(-1!==b.inArray(c,this._columns())){l.serverSide&&(a-=l.start);l=p.cells(null,c,{search:"applied",order:"applied"}).flatten();l=p.cell(l[a]);if(f){if(f.node===
l.node()){this._emitEvent("key-refocus",[this.s.dt,l,d||null]);return}this._blur()}this._removeOtherFocus();f=b(l.node());f.addClass(this.c.className);this._updateFixedColumns(c);if(e===n||!0===e)this._scroll(b(h),b(k.body),f,"offset"),e=p.table().body().parentNode,e!==p.table().header().parentNode&&(e=b(e.parentNode),this._scroll(e,e,f,"position"));this.s.lastFocus={cell:l,node:l.node(),relative:{row:p.rows({page:"current"}).indexes().indexOf(l.index().row),column:l.index().column}};this._emitEvent("key-focus",
[this.s.dt,l,d||null]);p.state.save()}}},_key:function(a){if(this.s.waitingForDraw)a.preventDefault();else{var c=this.s.enable;this.s.returnSubmit="navigation-only"!==c&&"tab-only"!==c||13!==a.keyCode?!1:!0;var e=!0===c||"navigation-only"===c;if(c&&(!(0===a.keyCode||a.ctrlKey||a.metaKey||a.altKey)||a.ctrlKey&&a.altKey)){var d=this.s.lastFocus;if(d)if(this.s.dt.cell(d.node).any()){d=this.s.dt;var g=this.s.dt.settings()[0].oScroll.sY?!0:!1;if(!this.c.keys||-1!==b.inArray(a.keyCode,this.c.keys))switch(a.keyCode){case 9:this._shift(a,
a.shiftKey?"left":"right",!0);break;case 27:this.s.blurable&&!0===c&&this._blur();break;case 33:case 34:e&&!g&&(a.preventDefault(),d.page(33===a.keyCode?"previous":"next").draw(!1));break;case 35:case 36:e&&(a.preventDefault(),c=d.cells({page:"current"}).indexes(),e=this._columns(),this._focus(d.cell(c[35===a.keyCode?c.length-1:e[0]]),null,!0,a));break;case 37:e&&this._shift(a,"left");break;case 38:e&&this._shift(a,"up");break;case 39:e&&this._shift(a,"right");break;case 40:e&&this._shift(a,"down");
break;case 113:if(this.c.editor){this._editor(null,a,!0);break}default:!0===c&&this._emitEvent("key",[d,a.keyCode,this.s.lastFocus.cell,a])}}else this.s.lastFocus=null}}},_removeOtherFocus:function(){var a=this.s.dt.table().node();b.fn.dataTable.tables({api:!0}).iterator("table",function(c){this.table().node()!==a&&this.cell.blur()})},_scroll:function(a,c,e,d){var g=e[d](),p=e.outerHeight(),l=e.outerWidth(),f=c.scrollTop(),q=c.scrollLeft(),r=a.height();a=a.width();"position"===d&&(g.top+=parseInt(e.closest("table").css("top"),
10));g.top<f&&c.scrollTop(g.top);g.left<q&&c.scrollLeft(g.left);g.top+p>f+r&&p<r&&c.scrollTop(g.top+p-r);g.left+l>q+a&&l<a&&c.scrollLeft(g.left+l-a)},_shift:function(a,c,e){var d=this.s.dt,g=d.page.info(),p=g.recordsDisplay,l=this._columns(),f=this.s.lastFocus;if(f){var q=f.cell;q&&(f=d.rows({filter:"applied",order:"applied"}).indexes().indexOf(q.index().row),g.serverSide&&(f+=g.start),d=d.columns(l).indexes().indexOf(q.index().column),g=f,f=l[d],"right"===c?d>=l.length-1?(g++,f=l[0]):f=l[d+1]:"left"===
c?0===d?(g--,f=l[l.length-1]):f=l[d-1]:"up"===c?g--:"down"===c&&g++,0<=g&&g<p&&-1!==b.inArray(f,l)?(a&&a.preventDefault(),this._focus(g,f,!0,a)):e&&this.c.blurable?this._blur():a&&a.preventDefault())}},_tabInput:function(){var a=this,c=this.s.dt,e=null!==this.c.tabIndex?this.c.tabIndex:c.settings()[0].iTabIndex;-1!=e&&(this.s.tabInput||(e=b('<div><input type="text" tabindex="'+e+'"/></div>').css({position:"absolute",height:1,width:0,overflow:"hidden"}),e.children().on("focus",function(d){var g=c.cell(":eq(0)",
a._columns(),{page:"current"});g.any()&&a._focus(g,null,!0,d)}),this.s.tabInput=e),(e=this.s.dt.cell(":eq(0)","0:visible",{page:"current",order:"current"}).node())&&b(e).prepend(this.s.tabInput))},_updateFixedColumns:function(a){var c=this.s.dt,e=c.settings()[0];if(e._oFixedColumns){var d=e.aoColumns.length-e._oFixedColumns.s.iRightColumns;(a<e._oFixedColumns.s.iLeftColumns||a>=d)&&c.fixedColumns().update()}}});t.defaults={blurable:!0,className:"focus",clipboard:!0,clipboardOrthogonal:"display",columns:"",
editor:null,editOnFocus:!1,focus:null,keys:null,tabIndex:null};t.version="2.6.0";b.fn.dataTable.KeyTable=t;b.fn.DataTable.KeyTable=t;m.Api.register("cell.blur()",function(){return this.iterator("table",function(a){a.keytable&&a.keytable.blur()})});m.Api.register("cell().focus()",function(){return this.iterator("cell",function(a,c,e){a.keytable&&a.keytable.focus(c,e)})});m.Api.register("keys.disable()",function(){return this.iterator("table",function(a){a.keytable&&a.keytable.enable(!1)})});m.Api.register("keys.enable()",
function(a){return this.iterator("table",function(c){c.keytable&&c.keytable.enable(a===n?!0:a)})});m.Api.register("keys.enabled()",function(a){a=this.context;return a.length?a[0].keytable?a[0].keytable.enabled():!1:!1});m.Api.register("keys.move()",function(a){return this.iterator("table",function(c){c.keytable&&c.keytable._shift(null,a,!1)})});m.ext.selector.cell.push(function(a,c,e){c=c.focused;a=a.keytable;var d=[];if(!a||c===n)return e;for(var g=0,p=e.length;g<p;g++)(!0===c&&a.focused(e[g])||
!1===c&&!a.focused(e[g]))&&d.push(e[g]);return d});b(k).on("preInit.dt.dtk",function(a,c,e){"dt"===a.namespace&&(a=c.oInit.keys,e=m.defaults.keys,a||e)&&(e=b.extend({},e,a),!1!==a&&new t(c,e))});return t});
