/*! StateRestore 1.4.1
* © SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;
(function () {
'use strict';
var $$2;
var dataTable$1;
function setJQuery$1(jq) {
$$2 = jq;
dataTable$1 = jq.fn.dataTable;
}
var StateRestore = /** @class */ (function () {
function StateRestore(settings, opts, identifier, state, isPreDefined, successCallback) {
if (state === void 0) { state = undefined; }
if (isPreDefined === void 0) { isPreDefined = false; }
if (successCallback === void 0) { successCallback = function () { return null; }; }
// Check that the required version of DataTables is included
if (!dataTable$1 || !dataTable$1.versionCheck || !dataTable$1.versionCheck('1.10.0')) {
throw new Error('StateRestore requires DataTables 1.10 or newer');
}
// Check that Select is included
// eslint-disable-next-line no-extra-parens
if (!dataTable$1.Buttons) {
throw new Error('StateRestore requires Buttons');
}
var table = new dataTable$1.Api(settings);
this.classes = $$2.extend(true, {}, StateRestore.classes);
// Get options from user
this.c = $$2.extend(true, {}, StateRestore.defaults, opts);
this.s = {
dt: table,
identifier: identifier,
isPreDefined: isPreDefined,
savedState: null,
tableId: state && state.stateRestore ? state.stateRestore.tableId : undefined
};
this.dom = {
background: $$2('
'),
closeButton: $$2('×
'),
confirmation: $$2(''),
confirmationButton: $$2('