dbgate-web 6.5.0 → 6.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/build/bundle.js
CHANGED
|
@@ -13,7 +13,7 @@ var app=function(){"use strict";function _mergeNamespaces(e,t){return t.forEach(
|
|
|
13
13
|
Version 1.10.0
|
|
14
14
|
https://localforage.github.io/localForage
|
|
15
15
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
16
|
-
*/module=localforage$1,module.exports=function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof commonjsRequire&&commonjsRequire;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){var n=t[a][1][e];return r(n||e)}),u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof commonjsRequire&&commonjsRequire,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(e,t,n){(function(e){var n,o,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var i=0,a=new r(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;o=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}o=!1}function d(e){1!==l.push(e)||o||n()}t.exports=d}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==r&&m(this,e)}function u(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){o((function(){var o;try{o=t(n)}catch(t){return i.reject(e,t)}o===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,o)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function m(e,t){var n=!1;function o(t){n||(n=!0,i.reject(e,t))}function r(t){n||(n=!0,i.resolve(e,t))}function a(){t(r,o)}var s=f(a);"error"===s.status&&o(s.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function h(e){return e instanceof this?e:i.resolve(new this(r),e)}function g(e){var t=new this(r);return i.reject(t,e)}function _(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,o=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,l=new this(r);++c<n;)u(e[c],c);return l;function u(e,r){function c(e){a[r]=e,++s!==n||o||(o=!0,i.resolve(l,a))}t.resolve(e).then(c,(function(e){o||(o=!0,i.reject(l,e))}))}}function $(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,o=!1;if(!n)return this.resolve([]);for(var a=-1,s=new this(r);++a<n;)c(e[a]);return s;function c(e){t.resolve(e).then((function(e){o||(o=!0,i.resolve(s,e))}),(function(e){o||(o=!0,i.reject(s,e))}))}}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(r);return this.state!==c?d(n,this.state===s?e:t,this.outcome):this.queue.push(new u(n,e,t)),n},u.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){i.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=f(p,t);if("error"===n.status)return i.reject(e,n.value);var o=n.value;if(o)m(e,o);else{e.state=s,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,o=e.queue.length;++n<o;)e.queue[n].callRejected(t);return e},l.resolve=h,l.reject=g,l.all=_,l.race=$},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var a=i();function s(){try{if(!a||!a.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function c(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(r){if("TypeError"!==r.name)throw r;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),o=0;o<e.length;o+=1)n.append(e[o]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var l=Promise;function u(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function d(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function p(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function m(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",h=void 0,g={},_=Object.prototype.toString,$="readonly",b="readwrite";function y(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),r=0;r<t;r++)o[r]=e.charCodeAt(r);return n}function v(e){return new l((function(t){var n=e.transaction(f,b),o=c([""]);n.objectStore(f).put(o,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function x(e){return"boolean"==typeof h?l.resolve(h):v(e).then((function(e){return h=e}))}function w(e){var t=g[e.name],n={};n.promise=new l((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function C(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function k(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function S(e,t){return new l((function(n,o){if(g[e.name]=g[e.name]||L(),e.db){if(!t)return n(e.db);w(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var i=a.open.apply(a,r);t&&(i.onupgradeneeded=function(t){var n=i.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),o(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},n(t),C(e)}}))}function T(e){return S(e,!1)}function E(e){return S(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,r=e.version>e.db.version;if(o&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function O(e){return new l((function(t,n){var o=new FileReader;o.onerror=n,o.onloadend=function(n){var o=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:o,type:e.type})},o.readAsBinaryString(e)}))}function N(e){return c([y(atob(e.data))],{type:e.type})}function I(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return d(n,e,e),n}function M(e){w(e);for(var t=g[e.name],n=t.forages,o=0;o<n.length;o++){var r=n[o];r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null)}return e.db=null,T(e).then((function(t){return e.db=t,A(e)?E(e):t})).then((function(o){e.db=t.db=o;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=o})).catch((function(t){throw k(e,t),t}))}function R(e,t,n,o){void 0===o&&(o=1);try{var r=e.db.transaction(e.storeName,t);n(null,r)}catch(r){if(o>0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return l.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((function(){return M(e).then((function(){R(e,t,n,o-1)}))})).catch(n);n(r)}}function L(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function F(e){var t=this,n={db:null};if(e)for(var o in e)n[o]=e[o];var r=g[n.name];r||(r=L(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var i=[];function a(){return l.resolve()}for(var s=0;s<r.forages.length;s++){var c=r.forages[s];c!==t&&i.push(c._initReady().catch(a))}var u=r.forages.slice(0);return l.all(i).then((function(){return n.db=r.db,T(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?E(n):e})).then((function(e){n.db=r.db=e,t._dbInfo=n;for(var o=0;o<u.length;o++){var i=u[o];i!==t&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}}))}function P(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){R(n._dbInfo,$,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),I(e)&&(e=N(e)),t(e)},a.onerror=function(){o(a.error)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function j(e,t){var n=this,o=new l((function(t,o){n.ready().then((function(){R(n._dbInfo,$,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var n=a.result;if(n){var o=n.value;I(o)&&(o=N(o));var r=e(o,n.key,s++);void 0!==r?t(r):n.continue()}else t()},a.onerror=function(){o(a.error)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function B(e,t,n){var o=this;e=p(e);var r=new l((function(n,r){var i;o.ready().then((function(){return i=o._dbInfo,"[object Blob]"===_.call(t)?x(i.db).then((function(e){return e?t:O(t)})):t})).then((function(t){R(o._dbInfo,b,(function(i,a){if(i)return r(i);try{var s=a.objectStore(o._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=c.error?c.error:c.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return u(r,n),r}function q(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){R(n._dbInfo,b,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){o(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function W(e){var t=this,n=new l((function(e,n){t.ready().then((function(){R(t._dbInfo,b,(function(o,r){if(o)return n(o);try{var i=r.objectStore(t._dbInfo.storeName).clear();r.oncomplete=function(){e()},r.onabort=r.onerror=function(){var e=i.error?i.error:i.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return u(n,e),n}function z(e){var t=this,n=new l((function(e,n){t.ready().then((function(){R(t._dbInfo,$,(function(o,r){if(o)return n(o);try{var i=r.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return u(n,e),n}function U(e,t){var n=this,o=new l((function(t,o){e<0?t(null):n.ready().then((function(){R(n._dbInfo,$,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName),s=!1,c=a.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},c.onerror=function(){o(c.error)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function H(e){var t=this,n=new l((function(e,n){t.ready().then((function(){R(t._dbInfo,$,(function(o,r){if(o)return n(o);try{var i=r.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return u(n,e),n}function V(e,t){t=m.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var o,r=this;if(e.name){var i=e.name===n.name&&r._dbInfo.db?l.resolve(r._dbInfo.db):T(e).then((function(t){var n=g[e.name],o=n.forages;n.db=t;for(var r=0;r<o.length;r++)o[r]._dbInfo.db=t;return t}));o=e.storeName?i.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;w(e);var o=g[e.name],r=o.forages;t.close();for(var i=0;i<r.length;i++){var s=r[i];s._dbInfo.db=null,s._dbInfo.version=n}var c=new l((function(t,o){var r=a.open(e.name,n);r.onerror=function(e){r.result.close(),o(e)},r.onupgradeneeded=function(){r.result.deleteObjectStore(e.storeName)},r.onsuccess=function(){var e=r.result;e.close(),t(e)}}));return c.then((function(e){o.db=e;for(var t=0;t<r.length;t++){var n=r[t];n._dbInfo.db=e,C(n._dbInfo)}})).catch((function(t){throw(k(e,t)||l.resolve()).catch((function(){})),t}))}})):i.then((function(t){w(e);var n=g[e.name],o=n.forages;t.close();for(var r=0;r<o.length;r++)o[r]._dbInfo.db=null;var i=new l((function(t,n){var o=a.deleteDatabase(e.name);o.onerror=function(){var e=o.result;e&&e.close(),n(o.error)},o.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},o.onsuccess=function(){var e=o.result;e&&e.close(),t(e)}}));return i.then((function(e){n.db=e;for(var t=0;t<o.length;t++)C(o[t]._dbInfo)})).catch((function(t){throw(k(e,t)||l.resolve()).catch((function(){})),t}))}))}else o=l.reject("Invalid arguments");return u(o,t),o}var G={_driver:"asyncStorage",_initStorage:F,_support:s(),iterate:j,getItem:P,setItem:B,removeItem:q,clear:W,length:z,key:U,keys:H,dropInstance:V};function K(){return"function"==typeof openDatabase}var Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,J="__lfsc__:",X=J.length,ee="arbf",te="blob",ne="si08",oe="ui08",re="uic8",ie="si16",ae="si32",se="ur16",ce="ui32",le="fl32",ue="fl64",de=X+ee.length,pe=Object.prototype.toString;function me(e){var t,n,o,r,i,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),u=new Uint8Array(l);for(t=0;t<s;t+=4)n=Y.indexOf(e[t]),o=Y.indexOf(e[t+1]),r=Y.indexOf(e[t+2]),i=Y.indexOf(e[t+3]),u[c++]=n<<2|o>>4,u[c++]=(15&o)<<4|r>>2,u[c++]=(3&r)<<6|63&i;return l}function fe(e){var t,n=new Uint8Array(e),o="";for(t=0;t<n.length;t+=3)o+=Y[n[t]>>2],o+=Y[(3&n[t])<<4|n[t+1]>>4],o+=Y[(15&n[t+1])<<2|n[t+2]>>6],o+=Y[63&n[t+2]];return n.length%3==2?o=o.substring(0,o.length-1)+"=":n.length%3==1&&(o=o.substring(0,o.length-2)+"=="),o}function he(e,t){var n="";if(e&&(n=pe.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===pe.call(e.buffer))){var o,r=J;e instanceof ArrayBuffer?(o=e,r+=ee):(o=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=oe:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ie:"[object Uint16Array]"===n?r+=se:"[object Int32Array]"===n?r+=ae:"[object Uint32Array]"===n?r+=ce:"[object Float32Array]"===n?r+=le:"[object Float64Array]"===n?r+=ue:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(o))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=Q+e.type+"~"+fe(this.result);t(J+te+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}}function ge(e){if(e.substring(0,X)!==J)return JSON.parse(e);var t,n=e.substring(de),o=e.substring(X,de);if(o===te&&Z.test(n)){var r=n.match(Z);t=r[1],n=n.substring(r[0].length)}var i=me(n);switch(o){case ee:return i;case te:return c([i],{type:t});case ne:return new Int8Array(i);case oe:return new Uint8Array(i);case re:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case se:return new Uint16Array(i);case ae:return new Int32Array(i);case ce:return new Uint32Array(i);case le:return new Float32Array(i);case ue:return new Float64Array(i);default:throw new Error("Unkown type: "+o)}}var _e={serialize:he,deserialize:ge,stringToBuffer:me,bufferToString:fe};function $e(e,t,n,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,o)}function be(e){var t=this,n={db:null};if(e)for(var o in e)n[o]="string"!=typeof e[o]?e[o].toString():e[o];var r=new l((function(e,o){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return o(e)}n.db.transaction((function(r){$e(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){o(t)}))}),o)}));return n.serializer=_e,r}function ye(e,t,n,o,r,i){e.executeSql(n,o,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?i(e,a):$e(e,t,(function(){e.executeSql(n,o,r,i)}),i)}),i):i(e,a)}),i)}function ve(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var o=n.rows.length?n.rows.item(0).value:null;o&&(o=r.serializer.deserialize(o)),t(o)}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function xe(e,t){var n=this,o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"SELECT * FROM "+r.storeName,[],(function(n,o){for(var i=o.rows,a=i.length,s=0;s<a;s++){var c=i.item(s),l=c.value;if(l&&(l=r.serializer.deserialize(l)),void 0!==(l=e(l,c.key,s+1)))return void t(l)}t()}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function we(e,t,n,o){var r=this;e=p(e);var i=new l((function(i,a){r.ready().then((function(){void 0===t&&(t=null);var s=t,c=r._dbInfo;c.serializer.serialize(t,(function(t,l){l?a(l):c.db.transaction((function(n){ye(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){i(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(o>0)return void i(we.apply(r,[e,s,n,o-1]));a(t)}}))}))})).catch(a)}));return u(i,n),i}function Ce(e,t,n){return we.apply(this,[e,t,n,1])}function ke(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function Se(e){var t=this,n=new l((function(e,n){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){ye(t,o,"DELETE FROM "+o.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,e),n}function Te(e){var t=this,n=new l((function(e,n){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){ye(t,o,"SELECT COUNT(key) as c FROM "+o.storeName,[],(function(t,n){var o=n.rows.item(0).c;e(o)}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,e),n}function Ee(e,t){var n=this,o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var o=n.rows.length?n.rows.item(0).key:null;t(o)}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function Ae(e){var t=this,n=new l((function(e,n){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){ye(t,o,"SELECT key FROM "+o.storeName,[],(function(t,n){for(var o=[],r=0;r<n.rows.length;r++)o.push(n.rows.item(r).key);e(o)}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,e),n}function Oe(e){return new l((function(t,n){e.transaction((function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,o){for(var r=[],i=0;i<o.rows.length;i++)r.push(o.rows.item(i).name);t({db:e,storeNames:r})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}function Ne(e,t){t=m.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var o,r=this;return o=e.name?new l((function(t){var o;o=e.name===n.name?r._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:o,storeNames:[e.storeName]}):t(Oe(o))})).then((function(e){return new l((function(t,n){e.db.transaction((function(o){function r(e){return new l((function(t,n){o.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var i=[],a=0,s=e.storeNames.length;a<s;a++)i.push(r(e.storeNames[a]));l.all(i).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):l.reject("Invalid arguments"),u(o,t),o}var Ie={_driver:"webSQLStorage",_initStorage:be,_support:K(),iterate:xe,getItem:ve,setItem:Ce,removeItem:ke,clear:Se,length:Te,key:Ee,keys:Ae,dropInstance:Ne};function De(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function Me(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Re(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Le(){return!Re()||localStorage.length>0}function Fe(e){var t=this,n={};if(e)for(var o in e)n[o]=e[o];return n.keyPrefix=Me(e,t._defaultConfig),Le()?(t._dbInfo=n,n.serializer=_e,l.resolve()):l.reject()}function Pe(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var o=localStorage.key(n);0===o.indexOf(e)&&localStorage.removeItem(o)}}));return u(n,e),n}function je(e,t){var n=this;e=p(e);var o=n.ready().then((function(){var t=n._dbInfo,o=localStorage.getItem(t.keyPrefix+e);return o&&(o=t.serializer.deserialize(o)),o}));return u(o,t),o}function Be(e,t){var n=this,o=n.ready().then((function(){for(var t=n._dbInfo,o=t.keyPrefix,r=o.length,i=localStorage.length,a=1,s=0;s<i;s++){var c=localStorage.key(s);if(0===c.indexOf(o)){var l=localStorage.getItem(c);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,c.substring(r),a++)))return l}}}));return u(o,t),o}function qe(e,t){var n=this,o=n.ready().then((function(){var t,o=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(o.keyPrefix.length)),t}));return u(o,t),o}function We(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,o=[],r=0;r<n;r++){var i=localStorage.key(r);0===i.indexOf(e.keyPrefix)&&o.push(i.substring(e.keyPrefix.length))}return o}));return u(n,e),n}function ze(e){var t=this.keys().then((function(e){return e.length}));return u(t,e),t}function Ue(e,t){var n=this;e=p(e);var o=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return u(o,t),o}function He(e,t,n){var o=this;e=p(e);var r=o.ready().then((function(){void 0===t&&(t=null);var n=t;return new l((function(r,i){var a=o._dbInfo;a.serializer.serialize(t,(function(t,o){if(o)i(o);else try{localStorage.setItem(a.keyPrefix+e,t),r(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return u(r,n),r}function Ve(e,t){if(t=m.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var o,r=this;return o=e.name?new l((function(t){e.storeName?t(Me(e,r._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):l.reject("Invalid arguments"),u(o,t),o}var Ge={_driver:"localStorageWrapper",_initStorage:Fe,_support:De(),iterate:Be,getItem:je,setItem:He,removeItem:Ue,clear:Pe,length:ze,key:qe,keys:We,dropInstance:Ve},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ye=function(e,t){for(var n=e.length,o=0;o<n;){if(Ke(e[o],t))return!0;o++}return!1},Qe=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ze={},Je={},Xe={INDEXEDDB:G,WEBSQL:Ie,LOCALSTORAGE:Ge},et=[Xe.INDEXEDDB._driver,Xe.WEBSQL._driver,Xe.LOCALSTORAGE._driver],tt=["dropInstance"],nt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),ot={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function rt(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function it(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(Qe(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var at=function(){function e(t){for(var n in r(this,e),Xe)if(Xe.hasOwnProperty(n)){var o=Xe[n],i=o._driver;this[n]=i,Ze[i]||this.defineDriver(o)}this._defaultConfig=it({},ot),this._config=it({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":o(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var o=new l((function(t,n){try{var o=e._driver,r=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(r);for(var i=nt.concat("_initStorage"),a=0,s=i.length;a<s;a++){var c=i[a];if((!Ye(tt,c)||e[c])&&"function"!=typeof e[c])return void n(r)}var d=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=l.reject(t);return u(n,arguments[arguments.length-1]),n}},n=0,o=tt.length;n<o;n++){var r=tt[n];e[r]||(e[r]=t(r))}};d();var p=function(n){Ze[o]&&console.info("Redefining LocalForage driver: "+o),Ze[o]=e,Je[o]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(p,n):p(!!e._support):p(!0)}catch(e){n(e)}}));return d(o,t,n),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var o=Ze[e]?l.resolve(Ze[e]):l.reject(new Error("Driver not found."));return d(o,t,n),o},e.prototype.getSerializer=function(e){var t=l.resolve(_e);return d(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return d(n,e,e),n},e.prototype.setDriver=function(e,t,n){var o=this;Qe(e)||(e=[e]);var r=this._getSupportedDrivers(e);function i(){o._config.driver=o.driver()}function a(e){return o._extend(e),i(),o._ready=o._initStorage(o._config),o._ready}function s(e){return function(){var t=0;function n(){for(;t<e.length;){var r=e[t];return t++,o._dbInfo=null,o._ready=null,o.getDriver(r).then(a).catch(n)}i();var s=new Error("No available storage method found.");return o._driverSet=l.reject(s),o._driverSet}return n()}}var c=null!==this._driverSet?this._driverSet.catch((function(){return l.resolve()})):l.resolve();return this._driverSet=c.then((function(){var e=r[0];return o._dbInfo=null,o._ready=null,o.getDriver(e).then((function(e){o._driver=e._driver,i(),o._wrapLibraryMethodsWithReady(),o._initDriver=s(r)}))})).catch((function(){i();var e=new Error("No available storage method found.");return o._driverSet=l.reject(e),o._driverSet})),d(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!Je[e]},e.prototype._extend=function(e){it(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var r=e[n];this.supports(r)&&t.push(r)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=nt.length;e<t;e++)rt(this,nt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),st=new at;t.exports=st},{3:3}]},{},[4])(4);var localforage=localforage$1.exports;let isInvalidated=!1;function invalidateCommands(){return __awaiter$h(this,void 0,void 0,(function*(){isInvalidated||(isInvalidated=!0,yield tick(),isInvalidated=!1,commands.update((e=>{let t=null;for(const n of Object.values(e)){if(n.isGroupCommand)continue;const{testEnabled:o}=n;let r=n.enabled;o&&(r=o()),r!=n.enabled&&(t||(t=Object.assign({},e)),t[n.id].enabled=r)}if(t){const e=Object.values(t);for(const t of e){if(!t.isGroupCommand)continue;const n=e.filter((e=>e.group==t.group&&!e.isGroupCommand&&e.enabled));t.enabled=n.length>0}}return t||e})))}))}let isInvalidatedDefinitions=!1;function invalidateCommandDefinitions(){return __awaiter$h(this,void 0,void 0,(function*(){isInvalidatedDefinitions||(isInvalidatedDefinitions=!0,yield tick(),isInvalidatedDefinitions=!1,commands.update((e=>{let t=Object.assign({},e);const n=Object.values(t);for(const e of n){if(!e.isGroupCommand)continue;const t=n.filter((t=>t.group==e.group&&!t.isGroupCommand));for(const n of t)n.keyTextFromGroup=e.keyText}return t})),invalidateCommands())}))}class ElectronApi{constructor(){this.ipcRenderer=getIpcRenderer()}send(e,t=null){this.ipcRenderer.send(e,t)}showOpenDialog(e){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke("showOpenDialog",e)}))}showSaveDialog(e){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke("showSaveDialog",e)}))}showItemInFolder(e){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke("showItemInFolder",e)}))}openExternal(e){return __awaiter$h(this,void 0,void 0,(function*(){yield this.ipcRenderer.invoke("openExternal",e)}))}invoke(e,t){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke(e,t)}))}addEventListener(e,t){this.ipcRenderer.on(e,t)}removeEventListener(e,t){this.ipcRenderer.removeListener(e,t)}}function getIpcRenderer(){if(window.require){const e=window.require("electron");return null==e?void 0:e.ipcRenderer}return null}function isElectronAvailable(){return!!getIpcRenderer()}const apiInstance=isElectronAvailable()?new ElectronApi:null;function getElectron(){return apiInstance}function isAdminPage(){return"admin"==window.dbgate_page}function isOneOfPage(...e){return e.includes(window.dbgate_page)}function getOpenedTabsStorageName(){return isAdminPage()?"adminOpenedTabs":"openedTabs"}let apiUrl=null;try{apiUrl=void 0}catch(_a){}function resolveApi(){return apiUrl||(window.location.origin+window.location.pathname).replace(/\/[a-zA-Z-]+\.html$/,"").replace(/\/*$/,"")}function resolveApiHeaders(){const e={},t=localStorage.getItem(isOneOfPage("admin","admin-license")?"adminAccessToken":"accessToken");return t&&(e.Authorization=`Bearer ${t}`),e}let lastSnackbarId=0;function showSnackbar(e){lastSnackbarId+=1;const t=lastSnackbarId.toString();return openedSnackbars.update((n=>[...n,Object.assign(Object.assign({},e),{id:t})])),t}function showSnackbarSuccess(e){showSnackbar({message:e,icon:"img ok",allowClose:!0,autoClose:!0})}function showSnackbarInfo(e){showSnackbar({message:e,icon:"img info",allowClose:!0,autoClose:!0})}function showSnackbarError(e){showSnackbar({message:e,icon:"img error",allowClose:!0,autoClose:!0})}function closeSnackbar(e){openedSnackbars.update((t=>t.filter((t=>t.id!=e))))}function updateSnackbarProgressMessage(e,t){openedSnackbars.update((n=>n.map((n=>n.id===e?Object.assign(Object.assign({},n),{progressMessage:t}):n))))}function isProApp(){return!1}function isOauthCallback$1(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("state");return t&&n&&n.startsWith("dbg-oauth:")&&n==sessionStorage.getItem("oauthState")}function isDbLoginCallback(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("state");return t&&n&&n.startsWith("dbg-dblogin:")&&n==localStorage.getItem("dbloginState")}function isDbLoginAuthCallback(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("state");return t&&n&&n.startsWith("dbg-dblogin:")&&n==sessionStorage.getItem("dbloginAuthState")}function handleOauthCallback(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("sid");if(isOauthCallback$1()){const[e,o,r]=sessionStorage.getItem("oauthState").split(":");return sessionStorage.removeItem("oauthState"),apiCall("auth/oauth-token",{code:t,amoid:r,redirectUri:location.origin+location.pathname,sid:n}).then((e=>{const{accessToken:t,error:n,errorMessage:o}=e;t?(console.log("Settings access token from OAUTH"),localStorage.setItem("accessToken",t),internalRedirectTo("/")):(console.log("Error when processing OAUTH callback",n||o),internalRedirectTo(`/not-logged.html?error=${n||o}`))})),!0}if(isDbLoginCallback()){const[e,o,r]=localStorage.getItem("dbloginState").split(":");return localStorage.removeItem("dbloginState"),apiCall("connections/dblogin-token",{code:t,conid:r,strmid:o,sid:n,redirectUri:location.origin+location.pathname}).then((e=>{e.success?window.close():e.error?internalRedirectTo(`/error.html?error=${encodeURIComponent(e.error)}`):internalRedirectTo("/error.html")})),!0}if(isDbLoginAuthCallback()){const[e,o,r,i]=sessionStorage.getItem("dbloginAuthState").split(":");return sessionStorage.removeItem("dbloginAuthState"),apiCall("connections/dblogin-auth-token",{code:t,conid:r,redirectUri:location.origin+location.pathname,amoid:i,sid:n}).then((e=>{e.accessToken?(localStorage.setItem("accessToken",e.accessToken),internalRedirectTo("/")):e.error?internalRedirectTo(`/error.html?error=${encodeURIComponent(e.error)}`):internalRedirectTo("/error.html")})),!0}return!1}function handleAuthOnStartup(e){return __awaiter$h(this,void 0,void 0,(function*(){const t=window.dbgate_page;"error"!=t&&(function(){if(e.configurationError)return internalRedirectTo("/error.html"),!0}()||"set-admin-password"!=t&&(function(){if(e.isAdminPasswordMissing)return internalRedirectTo("/set-admin-password.html"),!0}()||"login"!=t&&"admin-login"!=t&&"not-logged"!=t&&("admin"==getAuthCategory(e)?!e.isInvalidToken&&localStorage.getItem("adminAccessToken")||redirectToAdminLogin():"token"!=getAuthCategory(e)||!e.isInvalidToken&&localStorage.getItem("accessToken")||redirectToLogin(e))))}))}function redirectToAdminLogin(){return __awaiter$h(this,void 0,void 0,(function*(){internalRedirectTo("/admin-login.html")}))}function redirectToLogin(e=null,t=!1){return __awaiter$h(this,void 0,void 0,(function*(){if(e||(enableApi(),e=yield getConfig()),"token"!=getAuthCategory(e));else{if(!t){const e=window.dbgate_page;if("login"==e||"admin-login"==e||"not-logged"==e)return}internalRedirectTo("/login.html")}}))}function internalRedirectTo(e){const t=location.pathname.lastIndexOf("/"),n=t>=0?location.pathname.substring(0,t)+e:e;location.replace(n)}function doLogout(){return __awaiter$h(this,void 0,void 0,(function*(){enableApi();const e=yield getConfig(),t=getAuthCategory(e);"admin"==t?(localStorage.removeItem("adminAccessToken"),internalRedirectTo("/admin-login.html?is-admin=true")):"token"==t?(localStorage.removeItem("accessToken"),e.logoutUrl?window.location.href=e.logoutUrl:internalRedirectTo("/not-logged.html")):"basic"==t&&(window.location.href="config/logout")}))}function showModal(e,t={}){const n=v1_1$6();openedModals.update((o=>[...o,{component:e,modalId:n,props:t}])),invalidateCommands()}function closeModal(e){openedModals.update((t=>t.filter((t=>t.modalId!=e)))),invalidateCommands()}function closeCurrentModal(){openedModals.update((e=>e.slice(0,e.length-1))),invalidateCommands()}function getActiveModalId(){var e;const t=get_store_value(openedModals);return null===(e=t[t.length-1])||void 0===e?void 0:e.modalId}function create_fragment$5$(e){let t,n,o,r=[{type:e[0]},{value:e[2]},{title:e[3]},e[8]],i={};for(let e=0;e<r.length;e+=1)i=assign(i,r[e]);return{c(){t=element("input"),set_attributes(t,i),toggle_class(t,"disabled",e[1]),toggle_class(t,"skipWidth",e[4]),toggle_class(t,"outline",e[5]),toggle_class(t,"svelte-y2a7di",!0)},m(r,a){insert(r,t,a),"value"in i&&(t.value=i.value),t.autofocus&&t.focus(),e[10](t),n||(o=listen(t,"click",e[7]),n=!0)},p(e,[n]){set_attributes(t,i=get_spread_update(r,[1&n&&{type:e[0]},4&n&&t.value!==e[2]&&{value:e[2]},8&n&&{title:e[3]},256&n&&e[8]])),"value"in i&&(t.value=i.value),toggle_class(t,"disabled",e[1]),toggle_class(t,"skipWidth",e[4]),toggle_class(t,"outline",e[5]),toggle_class(t,"svelte-y2a7di",!0)},i:noop$2,o:noop$2,d(r){r&&detach(t),e[10](null),n=!1,o()}}}function instance$5V(e,t,n){const o=["type","disabled","value","title","skipWidth","outline","getBoundingClientRect"];let r=compute_rest_props(t,o);const i=createEventDispatcher();let a,{type:s="button"}=t,{disabled:c=!1}=t,{value:l}=t,{title:u=null}=t,{skipWidth:d=!1}=t,{outline:p=!1}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(8,r=compute_rest_props(t,o)),"type"in e&&n(0,s=e.type),"disabled"in e&&n(1,c=e.disabled),"value"in e&&n(2,l=e.value),"title"in e&&n(3,u=e.title),"skipWidth"in e&&n(4,d=e.skipWidth),"outline"in e&&n(5,p=e.outline)},[s,c,l,u,d,p,a,function(){c||i("click")},r,function(){return a.getBoundingClientRect()},function(e){binding_callbacks[e?"unshift":"push"]((()=>{a=e,n(6,a)}))}]}class FormStyledButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$5V,create_fragment$5$,safe_not_equal,{type:0,disabled:1,value:2,title:3,skipWidth:4,outline:5,getBoundingClientRect:9})}get getBoundingClientRect(){return this.$$.ctx[9]}}function runCommand(e){const t=getCommands()[e];if(t){if(!t.enabled)return;t.isGroupCommand?runGroupCommand(t.group):t.onClick?t.onClick():t.getSubCommands&&visibleCommandPalette.set(t)}}function runGroupCommand(e){const t=getCommands(),n=Object.values(t).find((t=>t.group==e&&!t.isGroupCommand&&t.enabled));n&&n.onClick&&n.onClick()}function findCommand(e){return getCommands()[e]}function getAsArray(e){return _.isArray(e)?e:null!=e?[e]:[]}let isContextMenuSupressed=!1;function registerMenu(...e){setContext("componentContextMenu",[getContext("componentContextMenu"),...e])}function supressContextMenu(){isContextMenuSupressed=!0}function contextMenu(e,t=[]){const n=e=>__awaiter$h(this,void 0,void 0,(function*(){if(e.preventDefault(),e.stopPropagation(),!isContextMenuSupressed&&(yield invalidateCommands(),t)){const n=e.pageX,o=e.pageY;currentDropDownMenu.set({left:n,top:o,items:t,targetElement:e.target})}})),o=()=>{isContextMenuSupressed=!1};if("__no_menu"!=t)return e.addEventListener("contextmenu",n),e.addEventListener("mousedown",o),{destroy(){e.removeEventListener("contextmenu",n),e.removeEventListener("mousedown",o)},update(e){t=e}}}function doExtractMenuItems(e,t,n){if(_.isFunction(e))doExtractMenuItems(e(n),t,n);else if(_.isArray(e))for(const o of e)doExtractMenuItems(o,t,n);else _.isPlainObject(e)&&!e._skip&&t.push(e)}function processTags(e){const t=[],n=[];for(const t of e.filter((e=>e.tag)))n.push(Object.assign(Object.assign({},t),{tags:getAsArray(t.tag)}));for(const o of e.filter((e=>!e.tag)))if(o.placeTag){const e=getAsArray(o.placeTag);for(let o=0;o<n.length;){const r=n[o];_.intersection(e,r.tags).length>0?(n.splice(o,1),t.push(r)):o++}}else t.push(o);return t.push(...n),t}function extractMenuItems(e,t=null){let n=[];return doExtractMenuItems(e,n,t),n=processTags(n),n}function mapItem(e,t){if(e.command){const n=t[e.command];return n?{text:e.text||n.menuName||n.toolbarName||n.name,keyText:n.keyText||n.keyTextFromGroup||n.disableHandleKeyText,onClick:()=>{n.isGroupCommand?runGroupCommand(n.group):n.getSubCommands?visibleCommandPalette.set(n):n.onClick&&n.onClick()},disabled:!n.enabled,hideDisabled:e.hideDisabled}:null}return e}function filterMenuItems(e){const t=[];let n=!1,o=!1;for(const r of e.filter((e=>!e.disabled||!e.hideDisabled)))r.divider?o&&(n=!0):(n&&t.push({divider:!0}),n=!1,o=!0,t.push(r));return t}function getContextMenu(){return getContext("componentContextMenu")}function prepareMenuItems(e,t,n){const o=extractMenuItems(e,t);return filterMenuItems(_.compact(o.map((e=>mapItem(e,n)))))}function openWebLink(e,t=!1){var n,o;const r=getElectron();if(r&&!t)r.send("open-link",e);else if(t){const t=500,r=650,i=null!==(n=window.screenLeft)&&void 0!==n?n:window.screenX,a=null!==(o=window.screenTop)&&void 0!==o?o:window.screenY,s=[`width=${t}`,`height=${r}`,`left=${i+(window.outerWidth-t)/2}`,`top=${a+(window.outerHeight-r)/2}`,"scrollbars=yes","resizable=yes","noopener","noreferrer"];window.open(e,"dbgateCloudLoginPopup",s.join(","))}else window.open(e,"_blank")}function create_fragment$5_(e){let t,n,o,r,i;const a=e[6].default,s=create_slot(a,e,e[5],null);let c=[e[4]],l={};for(let e=0;e<c.length;e+=1)l=assign(l,c[e]);return{c(){t=element("a"),s&&s.c(),set_attributes(t,l),toggle_class(t,"svelte-1gj6vtf",!0)},m(a,c){insert(a,t,c),s&&s.m(t,null),o=!0,r||(i=[listen(t,"click",e[7]),action_destroyer(n=contextMenu.call(null,t,e[2]))],r=!0)},p(e,[r]){s&&s.p&&(!o||32&r)&&update_slot_base(s,a,e,e[5],o?get_slot_changes(a,e[5],r,null):get_all_dirty_from_scope(e[5]),null),set_attributes(t,l=get_spread_update(c,[16&r&&e[4]])),n&&is_function(n.update)&&4&r&&n.update.call(null,e[2]),toggle_class(t,"svelte-1gj6vtf",!0)},i(e){o||(transition_in(s,e),o=!0)},o(e){transition_out(s,e),o=!1},d(e){e&&detach(t),s&&s.d(e),r=!1,run_all(i)}}}function instance$5U(e,t,n){const o=["href","onClick","menu","internalRedirect"];let r=compute_rest_props(t,o),{$$slots:i={},$$scope:a}=t,{href:s}=t,{onClick:c}=t,{menu:l="__no_menu"}=t,{internalRedirect:u}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(4,r=compute_rest_props(t,o)),"href"in e&&n(0,s=e.href),"onClick"in e&&n(1,c=e.onClick),"menu"in e&&n(2,l=e.menu),"internalRedirect"in e&&n(3,u=e.internalRedirect),"$$scope"in e&&n(5,a=e.$$scope)},[s,c,l,u,r,a,i,e=>{c?c(e):u?internalRedirectTo(u):openWebLink(s)}]}class Link$1 extends SvelteComponent{constructor(e){super(),init(this,e,instance$5U,create_fragment$5_,safe_not_equal,{href:0,onClick:1,menu:2,internalRedirect:3})}}function create_else_block$1a(e){let t,n,o,r,i,a,s,c=[e[4]],l={};for(let e=0;e<c.length;e+=1)l=assign(l,c[e]);let u=[{class:"label"},e[4]],d={};for(let e=0;e<u.length;e+=1)d=assign(d,u[e]);const p=e[6].default,m=create_slot(p,e,e[5],null);return{c(){t=element("div"),n=element("span"),o=text$1(e[1]),r=space(),m&&m.c(),set_attributes(n,l),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0),set_attributes(t,d),toggle_class(t,"svelte-2e9efj",!0)},m(c,l){insert(c,t,l),append(t,n),append(n,o),insert(c,r,l),m&&m.m(c,l),i=!0,a||(s=[listen(n,"click",(function(){is_function(e[4].onClick)&&e[4].onClick.apply(this,arguments)})),listen(t,"click",(function(){is_function(e[4].onClick)&&e[4].onClick.apply(this,arguments)}))],a=!0)},p(r,a){e=r,(!i||2&a)&&set_data_maybe_contenteditable(o,e[1],l.contenteditable),set_attributes(n,l=get_spread_update(c,[16&a&&e[4]])),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0),set_attributes(t,d=get_spread_update(u,[{class:"label"},16&a&&e[4]])),toggle_class(t,"svelte-2e9efj",!0),m&&m.p&&(!i||32&a)&&update_slot_base(m,p,e,e[5],i?get_slot_changes(p,e[5],a,null):get_all_dirty_from_scope(e[5]),null)},i(e){i||(transition_in(m,e),i=!0)},o(e){transition_out(m,e),i=!1},d(e){e&&detach(t),e&&detach(r),m&&m.d(e),a=!1,run_all(s)}}}function create_if_block$2v(e){let t,n,o,r,i,a;const s=e[6].default,c=create_slot(s,e,e[5],null);let l=[e[4],{class:"checkLabel"}],u={};for(let e=0;e<l.length;e+=1)u=assign(u,l[e]);return{c(){c&&c.c(),t=space(),n=element("span"),o=text$1(e[1]),set_attributes(n,u),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0)},m(s,l){c&&c.m(s,l),insert(s,t,l),insert(s,n,l),append(n,o),r=!0,i||(a=listen(n,"click",(function(){is_function(e[4].onClick)&&e[4].onClick.apply(this,arguments)})),i=!0)},p(t,i){e=t,c&&c.p&&(!r||32&i)&&update_slot_base(c,s,e,e[5],r?get_slot_changes(s,e[5],i,null):get_all_dirty_from_scope(e[5]),null),(!r||2&i)&&set_data_maybe_contenteditable(o,e[1],u.contenteditable),set_attributes(n,u=get_spread_update(l,[16&i&&e[4],{class:"checkLabel"}])),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0)},i(e){r||(transition_in(c,e),r=!0)},o(e){transition_out(c,e),r=!1},d(e){c&&c.d(e),e&&detach(t),e&&detach(n),i=!1,a()}}}function create_fragment$5Z(e){let t,n,o,r;const i=[create_if_block$2v,create_else_block$1a],a=[];function s(e,t){return"checkbox"==e[0]?0:1}return n=s(e),o=a[n]=i[n](e),{c(){t=element("div"),o.c(),attr(t,"class","largeFormMarker svelte-2e9efj"),toggle_class(t,"noMargin",e[2])},m(e,o){insert(e,t,o),a[n].m(t,null),r=!0},p(e,[c]){let l=n;n=s(e),n===l?a[n].p(e,c):(group_outros(),transition_out(a[l],1,1,(()=>{a[l]=null})),check_outros(),o=a[n],o?o.p(e,c):(o=a[n]=i[n](e),o.c()),transition_in(o,1),o.m(t,null)),(!r||4&c)&&toggle_class(t,"noMargin",e[2])},i(e){r||(transition_in(o),r=!0)},o(e){transition_out(o),r=!1},d(e){e&&detach(t),a[n].d()}}}function instance$5T(e,t,n){let{$$slots:o={},$$scope:r}=t,{type:i}=t,{label:a}=t,{noMargin:s=!1}=t,{disabled:c=!1}=t,{labelProps:l={}}=t;return e.$$set=e=>{"type"in e&&n(0,i=e.type),"label"in e&&n(1,a=e.label),"noMargin"in e&&n(2,s=e.noMargin),"disabled"in e&&n(3,c=e.disabled),"labelProps"in e&&n(4,l=e.labelProps),"$$scope"in e&&n(5,r=e.$$scope)},[i,a,s,c,l,r,o]}class FormFieldTemplateLarge extends SvelteComponent{constructor(e){super(),init(this,e,instance$5T,create_fragment$5Z,safe_not_equal,{type:0,label:1,noMargin:2,disabled:3,labelProps:4})}}function createRef(e){return{value:e,initValue:e,set(e){this.value=e},reset(){this.value=this.initValue},get(){return this.value},update(e){this.value=e(this.value)}}}var keycodes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pauseBreak:19,capsLock:20,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40,insert:45,delete:46,n0:48,n1:49,n2:50,n3:51,n4:52,n5:53,n6:54,n7:55,n8:56,n9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftWindowKey:91,rightWindowKey:93,numPad0:96,numPad1:97,numPad2:98,numPad3:99,numPad4:100,numPad5:101,numPad6:102,numPad7:103,numPad8:104,numPad9:105,numPadAdd:107,numPadSub:109,multiply:106,add:107,subtract:109,decimalPoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f12:123,numLock:144,scrollLock:145,semiColon:186,equalSign:187,comma:188,dash:189,period:190,forwardSlash:191,graveAccent:192,openBracket:219,backSlash:220,closeBracket:221,singleQuote:222};function create_fragment$5Y(e){let t,n,o;const r=e[4].default,i=create_slot(r,e,e[3],null);return{c(){i&&i.c()},m(r,a){i&&i.m(r,a),t=!0,n||(o=listen(window,"keydown",e[0]),n=!0)},p(e,[n]){i&&i.p&&(!t||8&n)&&update_slot_base(i,r,e,e[3],t?get_slot_changes(r,e[3],n,null):get_all_dirty_from_scope(e[3]),null)},i(e){t||(transition_in(i,e),t=!0)},o(e){transition_out(i,e),t=!1},d(e){i&&i.d(e),n=!1,o()}}}const contextKey$1="formProviderContextKey";function getFormContext(){return getContext(contextKey$1)}function instance$5S(e,t,n){let{$$slots:o={},$$scope:r}=t,{values:i}=t,{template:a=FormFieldTemplateLarge}=t;const s={values:i,template:a,setFieldValue:(e,t)=>{i.update((n=>Object.assign(Object.assign({},n),{[e]:t})))},submitActionRef:createRef(null)};return setContext(contextKey$1,s),e.$$set=e=>{"values"in e&&n(1,i=e.values),"template"in e&&n(2,a=e.template),"$$scope"in e&&n(3,r=e.$$scope)},[function(e){e.keyCode==keycodes.enter&&s.submitActionRef.get()&&(e.preventDefault(),s.submitActionRef.get()(i))},i,a,r,o]}class FormProviderCore extends SvelteComponent{constructor(e){super(),init(this,e,instance$5S,create_fragment$5Y,safe_not_equal,{values:1,template:2})}}function create_fragment$5X(e){let t,n,o,r,i;return{c(){t=element("span"),attr(t,"class",n=null_to_empty(e[5][e[0]]||e[0])+" svelte-1p2qnn1"),attr(t,"title",e[1]),attr(t,"style",e[4]),attr(t,"data-testid",o=e[6]["data-testid"]),toggle_class(t,"padLeft",e[2]),toggle_class(t,"padRight",e[3])},m(n,o){insert(n,t,o),r||(i=listen(t,"click",e[7]),r=!0)},p(e,[r]){1&r&&n!==(n=null_to_empty(e[5][e[0]]||e[0])+" svelte-1p2qnn1")&&attr(t,"class",n),2&r&&attr(t,"title",e[1]),16&r&&attr(t,"style",e[4]),64&r&&o!==(o=e[6]["data-testid"])&&attr(t,"data-testid",o),5&r&&toggle_class(t,"padLeft",e[2]),9&r&&toggle_class(t,"padRight",e[3])},i:noop$2,o:noop$2,d(e){e&&detach(t),r=!1,i()}}}function getNumberIcon(e){switch(e){case 1:return"mdi mdi-numeric-1-circle";case 2:return"mdi mdi-numeric-2-circle";case 3:return"mdi mdi-numeric-3-circle";case 4:return"mdi mdi-numeric-4-circle";case 5:return"mdi mdi-numeric-5-circle";case 6:return"mdi mdi-numeric-6-circle";case 7:return"mdi mdi-numeric-7-circle";case 8:return"mdi mdi-numeric-8-circle";case 9:return"mdi mdi-numeric-9-circle"}return e>9?"mdi mdi-numeric-9-plus-circle":null}function instance$5R(e,t,n){let{icon:o}=t,{title:r=null}=t,{padLeft:i=!1}=t,{padRight:a=!1}=t,{style:s=null}=t;return e.$$set=e=>{n(6,t=assign(assign({},t),exclude_internal_props(e))),"icon"in e&&n(0,o=e.icon),"title"in e&&n(1,r=e.title),"padLeft"in e&&n(2,i=e.padLeft),"padRight"in e&&n(3,a=e.padRight),"style"in e&&n(4,s=e.style)},t=exclude_internal_props(t),[o,r,i,a,s,{"icon minus-box":"mdi mdi-minus-box-outline","icon plus-box":"mdi mdi-plus-box-outline","icon plus-thick":"mdi mdi-plus-thick","icon minus-thick":"mdi mdi-minus-thick","icon invisible-box":"mdi mdi-minus-box-outline icon-invisible","icon cloud-upload":"mdi mdi-cloud-upload","icon cloud":"mdi mdi-cloud","icon cloud-public":"mdi mdi-cloud-search","icon cloud-private":"mdi mdi-cloud-key","icon import":"mdi mdi-application-import","icon export":"mdi mdi-application-export","icon new-connection":"mdi mdi-database-plus","icon tables":"mdi mdi-table-multiple","icon favorite":"mdi mdi-star","icon share":"mdi mdi-share-variant","icon add":"mdi mdi-plus-circle","icon minus":"mdi mdi-minus-circle","icon connection":"mdi mdi-connection","icon cell-data":"mdi mdi-details","icon sql-generator":"mdi mdi-cog-transfer","icon keyboard":"mdi mdi-keyboard-settings","icon settings":"mdi mdi-cog","icon users":"mdi mdi-account-multiple","icon role":"mdi mdi-account-group","icon admin":"mdi mdi-security","icon auth":"mdi mdi-account-key","icon version":"mdi mdi-ticket-confirmation","icon pin":"mdi mdi-pin","icon pin-outline":"mdi mdi-pin-outline","icon arrange":"mdi mdi-arrange-send-to-back","icon app":"mdi mdi-layers-triple","icon open-in-new":"mdi mdi-open-in-new","icon add-folder":"mdi mdi-folder-plus-outline","icon add-column":"mdi mdi-table-column-plus-after","icon parameter":"mdi mdi-at","icon trigger":"mdi mdi-lightning-bolt","icon scheduler-event":"mdi mdi-calendar-blank","icon arrow-link":"mdi mdi-arrow-top-right-thick","icon reset":"mdi mdi-cancel","icon window-restore":"mdi mdi-window-restore","icon window-maximize":"mdi mdi-window-maximize","icon window-close":"mdi mdi-window-close","icon window-minimize":"mdi mdi-window-minimize","img dbgate":"mdi mdi-database color-icon-gold","icon columns":"mdi mdi-view-column","icon columns-outline":"mdi mdi-view-column-outline","icon locked-database-mode":"mdi mdi-database-lock","icon unlocked-database-mode":"mdi mdi-database-eye","icon database":"mdi mdi-database","icon server":"mdi mdi-server","icon table":"mdi mdi-table","icon form":"mdi mdi-form-select","icon archive":"mdi mdi-archive","icon file":"mdi mdi-file","icon loading":"mdi mdi-loading mdi-spin","icon close":"mdi mdi-close","icon unsaved":"mdi mdi-record","icon stop":"mdi mdi-close-octagon","icon play":"mdi mdi-play","icon play-stop":"mdi mdi-stop","icon pause":"mdi mdi-pause","icon filter":"mdi mdi-filter","icon filter-off":"mdi mdi-filter-off","icon reload":"mdi mdi-reload","icon refresh":"mdi mdi-refresh","icon undo":"mdi mdi-undo","icon redo":"mdi mdi-redo","icon save":"mdi mdi-content-save","icon account":"mdi mdi-account","icon sql-file":"mdi mdi-file","icon web":"mdi mdi-web","icon home":"mdi mdi-home","icon query-design":"mdi mdi-vector-polyline-edit","icon form":"mdi mdi-form-select","icon history":"mdi mdi-history","icon structure":"mdi mdi-tools","icon square":"mdi mdi-square","icon data-deploy":"mdi mdi-database-settings","icon cloud-account":"mdi mdi-account-remove-outline","icon cloud-account-connected":"mdi mdi-account-check-outline","icon edit":"mdi mdi-pencil","icon delete":"mdi mdi-delete","icon arrow-up":"mdi mdi-arrow-up","icon arrow-down":"mdi mdi-arrow-down","icon arrow-left":"mdi mdi-arrow-left","icon arrow-begin":"mdi mdi-arrow-collapse-left","icon arrow-end":"mdi mdi-arrow-collapse-right","icon arrow-right":"mdi mdi-arrow-right","icon arrow-left-bold":"mdi mdi-arrow-left-bold","icon arrow-right-bold":"mdi mdi-arrow-right-bold","icon triple-left":"mdi mdi-chevron-triple-left","icon triple-right":"mdi mdi-chevron-triple-right","icon triple-up":"mdi mdi-chevron-triple-up","icon triple-down":"mdi mdi-chevron-triple-down","icon format-code":"mdi mdi-code-tags-check","icon show-wizard":"mdi mdi-comment-edit","icon disconnected":"mdi mdi-lan-disconnect","icon theme":"mdi mdi-brightness-6","icon error":"mdi mdi-close-circle","icon ok":"mdi mdi-check-circle","icon check":"mdi mdi-check","icon markdown":"mdi mdi-application","icon preview":"mdi mdi-file-find","icon eye":"mdi mdi-eye","icon check-all":"mdi mdi-check-all","icon checkbox-blank":"mdi mdi-checkbox-blank-outline","icon checkbox-marked":"mdi mdi-checkbox-marked-outline","icon dots-horizontal":"mdi mdi-dots-horizontal","icon dots-vertical":"mdi mdi-dots-vertical","icon add":"mdi mdi-plus-circle","icon json":"mdi mdi-code-json","icon lock":"mdi mdi-lock","icon custom-join":"mdi mdi-arrow-left-right-bold","icon parent-filter":"mdi mdi-home-alert","icon parent-filter-outline":"mdi mdi-home-alert-outline","icon download":"mdi mdi-download","icon text":"mdi mdi-text","icon ai":"mdi mdi-head-lightbulb","icon wait":"mdi mdi-timer-sand","icon more":"mdi mdi-more","icon copy":"mdi mdi-content-copy","icon run":"mdi mdi-play","icon chevron-down":"mdi mdi-chevron-down","icon chevron-left":"mdi mdi-chevron-left","icon chevron-right":"mdi mdi-chevron-right","icon chevron-up":"mdi mdi-chevron-up","icon chevron-double-down":"mdi mdi-chevron-double-down","icon chevron-double-left":"mdi mdi-chevron-double-left","icon chevron-double-right":"mdi mdi-chevron-double-right","icon chevron-double-up":"mdi mdi-chevron-double-up","icon menu-right":"mdi mdi-menu-right","icon plugin":"mdi mdi-toy-brick","icon menu":"mdi mdi-menu","icon add-column":"mdi mdi-table-column-plus-after","icon add-key":"mdi mdi-key-plus","icon report":"mdi mdi-file-chart","icon swap":"mdi mdi-swap-horizontal-bold","icon deploy":"mdi mdi-content-save-move","icon compare":"mdi mdi-compare","icon no-color":"mdi mdi-format-color-marker-cancel","icon palette":"mdi mdi-palette","icon split":"mdi mdi-view-split-vertical","icon num-0":"mdi mdi-numeric-0-circle","icon num-1":"mdi mdi-numeric-1-circle","icon num-2":"mdi mdi-numeric-2-circle","icon num-3":"mdi mdi-numeric-3-circle","icon num-4":"mdi mdi-numeric-4-circle","icon num-5":"mdi mdi-numeric-5-circle","icon num-6":"mdi mdi-numeric-6-circle","icon num-7":"mdi mdi-numeric-7-circle","icon num-8":"mdi mdi-numeric-8-circle","icon num-9":"mdi mdi-numeric-9-circle","icon num-9-plus":"mdi mdi-numeric-9-plus-circle","icon num-0-outline":"mdi mdi-numeric-0-circle-outline","icon num-1-outline":"mdi mdi-numeric-1-circle-outline","icon num-2-outline":"mdi mdi-numeric-2-circle-outline","icon num-3-outline":"mdi mdi-numeric-3-circle-outline","icon num-4-outline":"mdi mdi-numeric-4-circle-outline","icon num-5-outline":"mdi mdi-numeric-5-circle-outline","icon num-6-outline":"mdi mdi-numeric-6-circle-outline","icon num-7-outline":"mdi mdi-numeric-7-circle-outline","icon num-8-outline":"mdi mdi-numeric-8-circle-outline","icon num-9-outline":"mdi mdi-numeric-9-circle-outline","icon num-9-plus-outline":"mdi mdi-numeric-9-plus-circle-outline","icon type-string":"mdi mdi-code-string","icon type-object":"mdi mdi-code-braces-box","icon type-array":"mdi mdi-code-array","icon type-number":"mdi mdi-pound-box","icon type-boolean":"mdi mdi-code-equal","icon type-date":"mdi mdi-alpha-d-box","icon type-objectid":"mdi mdi-alpha-i-box","icon type-null":"mdi mdi-code-equal","icon type-unknown":"mdi mdi-help-box","icon equal":"mdi mdi-equal","icon not-equal":"mdi mdi-not-equal-variant","icon at":"mdi mdi-at","icon expand-all":"mdi mdi-expand-all","icon collapse-all":"mdi mdi-collapse-all","icon transaction":"mdi mdi-code-json","icon commit":"mdi mdi-check-circle","icon rollback":"mdi mdi-close-circle","icon autocommit-on":"mdi mdi-check-circle","icon autocommit-off":"mdi mdi-check-circle-outline","icon premium":"mdi mdi-star","icon upload":"mdi mdi-upload","icon limit":"mdi mdi-car-speed-limiter","img ok":"mdi mdi-check-circle color-icon-green","img ok-inv":"mdi mdi-check-circle color-icon-inv-green","img alert":"mdi mdi-alert-circle color-icon-blue","img error":"mdi mdi-close-circle color-icon-red","img error-inv":"mdi mdi-close-circle color-icon-inv-red","img warn":"mdi mdi-alert color-icon-gold","img info":"mdi mdi-information color-icon-blue","img debug":"mdi mdi-monitor color-icon-green","img circular":"mdi mdi-circular-saw color-icon-red","img archive":"mdi mdi-table color-icon-gold","img archive-folder":"mdi mdi-database-outline color-icon-green","img zipfile":"mdi mdi-zip-box color-icon-gold","img autoincrement":"mdi mdi-numeric-1-box-multiple-outline","img column":"mdi mdi-table-column","img server":"mdi mdi-server color-icon-blue","img primary-key":"mdi mdi-key-star color-icon-yellow","img foreign-key":"mdi mdi-key-link","img sql-file":"mdi mdi-file","img anyfile":"mdi mdi-file-question color-icon-red","img shell":"mdi mdi-flash color-icon-blue","img chart":"mdi mdi-chart-bar color-icon-magenta","img markdown":"mdi mdi-application color-icon-red","img preview":"mdi mdi-file-find color-icon-red","img favorite":"mdi mdi-star color-icon-yellow","img query-design":"mdi mdi-vector-polyline-edit color-icon-red","img diagram":"mdi mdi-graph color-icon-blue","img yaml":"mdi mdi-code-brackets color-icon-red","img compare":"mdi mdi-compare color-icon-red","img app":"mdi mdi-layers-triple color-icon-magenta","img app-command":"mdi mdi-flash color-icon-green","img app-query":"mdi mdi-view-comfy color-icon-magenta","img connection":"mdi mdi-connection color-icon-blue","img profiler":"mdi mdi-gauge color-icon-blue","img users":"mdi mdi-account-multiple color-icon-blue","img role":"mdi mdi-account-group color-icon-blue","img admin":"mdi mdi-security color-icon-blue","img auth":"mdi mdi-account-key color-icon-blue","img cloud-connection":"mdi mdi-cloud-lock color-icon-blue","img add":"mdi mdi-plus-circle color-icon-green","img minus":"mdi mdi-minus-circle color-icon-red","img equal":"mdi mdi-equal","img changed":"mdi mdi-file-edit color-icon-yellow","img free-table":"mdi mdi-table color-icon-green","img macro":"mdi mdi-hammer-wrench","img json":"mdi mdi-code-json icon-magenta","img database":"mdi mdi-database color-icon-gold","img sqlite-database":"mdi mdi-database color-icon-blue","img table":"mdi mdi-table color-icon-blue","img raw-table":"mdi mdi-table-large color-icon-blue","img collection":"mdi mdi-table color-icon-red","img query-data":"mdi mdi-table color-icon-yellow","img view":"mdi mdi-table color-icon-magenta","img raw-view":"mdi mdi-table-large color-icon-magenta","img procedure":"mdi mdi-cog color-icon-blue","img function":"mdi mdi-function-variant","img table-structure":"mdi mdi-tools color-icon-blue","img view-structure":"mdi mdi-tools color-icon-magenta","img sort-asc":"mdi mdi-sort-alphabetical-ascending color-icon-green","img sort-desc":"mdi mdi-sort-alphabetical-descending color-icon-green","img map":"mdi mdi-map color-icon-blue","img reference":"mdi mdi-link-box","img link":"mdi mdi-link","img filter":"mdi mdi-filter","img group":"mdi mdi-group","img perspective":"mdi mdi-eye color-icon-yellow","img parent-filter":"mdi mdi-home-alert color-icon-yellow","img folder":"mdi mdi-folder color-icon-yellow","img type-string":"mdi mdi-alphabetical color-icon-blue","img type-hash":"mdi mdi-pound color-icon-blue","img type-set":"mdi mdi-format-list-bulleted color-icon-blue","img type-list":"mdi mdi-format-list-numbered color-icon-blue","img type-zset":"mdi mdi-format-list-checks color-icon-blue","img type-stream":"mdi mdi-view-stream color-icon-blue","img type-binary":"mdi mdi-file color-icon-blue","img type-rejson":"mdi mdi-color-json color-icon-blue","img keydb":"mdi mdi-key color-icon-blue","img replicator":"mdi mdi-content-duplicate color-icon-green","img import":"mdi mdi-database-import color-icon-green","img export":"mdi mdi-database-export color-icon-green","img transform":"mdi mdi-rotate-orbit color-icon-blue","img tip":"mdi mdi-lightbulb-on color-icon-yellow","img filter-active":"mdi mdi-filter-cog color-icon-blue","img db-backup":"mdi mdi-database-export color-icon-yellow","img db-restore":"mdi mdi-database-import color-icon-red","img settings":"mdi mdi-cog color-icon-blue","img data-deploy":"mdi mdi-database-settings color-icon-green"},t,function(t){bubble.call(this,e,t)}]}class FontIcon extends SvelteComponent{constructor(e){super(),init(this,e,instance$5R,create_fragment$5X,safe_not_equal,{icon:0,title:1,padLeft:2,padRight:3,style:4})}}function create_fragment$5W(e){let t,n,o,r,i,a;const s=e[8].default,c=create_slot(s,e,e[7],null);return{c(){t=element("div"),n=element("div"),c&&c.c(),attr(n,"class","inner svelte-1dacrl4"),attr(t,"class","outer buttonLike svelte-1dacrl4"),attr(t,"title",e[3]),attr(t,"data-testid",o=e[5]["data-testid"]),toggle_class(t,"disabled",e[0]),toggle_class(t,"square",e[1]),toggle_class(t,"narrow",e[2])},m(o,s){insert(o,t,s),append(t,n),c&&c.m(n,null),e[10](t),r=!0,i||(a=listen(t,"click",e[9]),i=!0)},p(e,[n]){c&&c.p&&(!r||128&n)&&update_slot_base(c,s,e,e[7],r?get_slot_changes(s,e[7],n,null):get_all_dirty_from_scope(e[7]),null),(!r||8&n)&&attr(t,"title",e[3]),(!r||32&n&&o!==(o=e[5]["data-testid"]))&&attr(t,"data-testid",o),(!r||1&n)&&toggle_class(t,"disabled",e[0]),(!r||2&n)&&toggle_class(t,"square",e[1]),(!r||4&n)&&toggle_class(t,"narrow",e[2])},i(e){r||(transition_in(c,e),r=!0)},o(e){transition_out(c,e),r=!1},d(n){n&&detach(t),c&&c.d(n),e[10](null),i=!1,a()}}}function instance$5Q(e,t,n){let o,{$$slots:r={},$$scope:i}=t,{disabled:a=!1}=t,{square:s=!1}=t,{narrow:c=!1}=t,{title:l=null}=t;return e.$$set=e=>{n(5,t=assign(assign({},t),exclude_internal_props(e))),"disabled"in e&&n(0,a=e.disabled),"square"in e&&n(1,s=e.square),"narrow"in e&&n(2,c=e.narrow),"title"in e&&n(3,l=e.title),"$$scope"in e&&n(7,i=e.$$scope)},t=exclude_internal_props(t),[a,s,c,l,o,t,function(){return o.getBoundingClientRect()},i,r,function(t){bubble.call(this,e,t)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(4,o)}))}]}class InlineButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$5Q,create_fragment$5W,safe_not_equal,{disabled:0,square:1,narrow:2,title:3,getBoundingClientRect:6})}get getBoundingClientRect(){return this.$$.ctx[6]}}function create_fragment$5V(e){let t,n,o,r=[{type:"text"},e[3],{autocomplete:e[2]}],i={};for(let e=0;e<r.length;e+=1)i=assign(i,r[e]);return{c(){t=element("input"),set_attributes(t,i)},m(r,i){insert(r,t,i),t.autofocus&&t.focus(),set_input_value(t,e[0]),e[10](t),n||(o=[listen(t,"input",e[9]),listen(t,"change",e[5]),listen(t,"input",e[6]),listen(t,"click",e[7]),listen(t,"keydown",e[8])],n=!0)},p(e,[n]){set_attributes(t,i=get_spread_update(r,[{type:"text"},8&n&&e[3],4&n&&{autocomplete:e[2]}])),1&n&&t.value!==e[0]&&set_input_value(t,e[0])},i:noop$2,o:noop$2,d(r){r&&detach(t),e[10](null),n=!1,run_all(o)}}}function instance$5P(e,t,n){const o=["value","focused","domEditor","autocomplete"];let r=compute_rest_props(t,o),{value:i}=t,{focused:a=!1}=t,{domEditor:s}=t,{autocomplete:c="new-password"}=t;return a&&onMount((()=>s.focus())),e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(3,r=compute_rest_props(t,o)),"value"in e&&n(0,i=e.value),"focused"in e&&n(4,a=e.focused),"domEditor"in e&&n(1,s=e.domEditor),"autocomplete"in e&&n(2,c=e.autocomplete)},[i,s,c,r,a,function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(){i=this.value,n(0,i)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{s=e,n(1,s)}))}]}class TextField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5P,create_fragment$5V,safe_not_equal,{value:0,focused:4,domEditor:1,autocomplete:2})}}function create_if_block$2u(e){let t,n;return t=new InlineButton({props:{disabled:e[1],$$slots:{default:[create_default_slot$2b]},$$scope:{ctx:e}}}),t.$on("click",e[12]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};2&n&&(o.disabled=e[1]),8192&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot$2b(e){let t,n;return t=new FontIcon({props:{icon:"icon eye"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5U(e){let t,n,o,r;const i=[e[8],{disabled:e[1]},{value:e[5]?"":e[3]},{placeholder:e[5]?"(Password is encrypted)":void 0},{type:e[5]||e[4]?"text":"password"}];let a={};for(let e=0;e<i.length;e+=1)a=assign(a,i[e]);n=new TextField({props:a}),n.$on("change",e[10]),n.$on("input",e[11]);let s=!e[5]&&create_if_block$2u(e);return{c(){t=element("div"),create_component(n.$$.fragment),o=space(),s&&s.c(),attr(t,"class","flex")},m(e,i){insert(e,t,i),mount_component(n,t,null),append(t,o),s&&s.m(t,null),r=!0},p(e,[o]){const r=314&o?get_spread_update(i,[256&o&&get_spread_object(e[8]),2&o&&{disabled:e[1]},40&o&&{value:e[5]?"":e[3]},32&o&&{placeholder:e[5]?"(Password is encrypted)":void 0},48&o&&{type:e[5]||e[4]?"text":"password"}]):{};n.$set(r),e[5]?s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros()):s?(s.p(e,o),32&o&&transition_in(s,1)):(s=create_if_block$2u(e),s.c(),transition_in(s,1),s.m(t,null))},i(e){r||(transition_in(n.$$.fragment,e),transition_in(s),r=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(s),r=!1},d(e){e&&detach(t),destroy_component(n),s&&s.d()}}}function instance$5O(e,t,n){let o,r;const i=["name","disabled","saveOnInput"];let a,s=compute_rest_props(t,i),{name:c}=t,{disabled:l=!1}=t,{saveOnInput:u=!1}=t;const{values:d,setFieldValue:p}=getFormContext();component_subscribe(e,d,(e=>n(9,a=e)));let m=!1;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(8,s=compute_rest_props(t,i)),"name"in e&&n(0,c=e.name),"disabled"in e&&n(1,l=e.disabled),"saveOnInput"in e&&n(2,u=e.saveOnInput)},e.$$.update=()=>{513&e.$$.dirty&&n(3,o=a[c]),8&e.$$.dirty&&n(5,r=o&&o.startsWith("crypt:"))},[c,l,u,o,m,r,d,p,s,a,e=>p(c,e.target.value),e=>{u&&p(c,e.target.value)},()=>n(4,m=!m)]}class FormPasswordFieldRaw extends SvelteComponent{constructor(e){super(),init(this,e,instance$5O,create_fragment$5U,safe_not_equal,{name:0,disabled:1,saveOnInput:2})}}function create_default_slot$2a(e){let t,n;const o=[{name:e[1]},e[4]];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormPasswordFieldRaw({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=18&n?get_spread_update(o,[2&n&&{name:e[1]},16&n&&get_spread_object(e[4])]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5T(e){let t,n,o;const r=[{type:"text"},{label:e[0]},e[2]];var i=e[3];function a(e){let t={$$slots:{default:[create_default_slot$2a]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=5&o?get_spread_update(r,[r[0],1&o&&{label:e[0]},4&o&&get_spread_object(e[2])]):{};if(50&o&&(s.$$scope={dirty:o,ctx:e}),i!==(i=e[3])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5N(e,t,n){const o=["label","name","templateProps"];let r=compute_rest_props(t,o),{label:i}=t,{name:a}=t,{templateProps:s={}}=t;const{template:c}=getFormContext();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(4,r=compute_rest_props(t,o)),"label"in e&&n(0,i=e.label),"name"in e&&n(1,a=e.name),"templateProps"in e&&n(2,s=e.templateProps)},[i,a,s,c,r]}class FormPasswordField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5N,create_fragment$5T,safe_not_equal,{label:0,name:1,templateProps:2})}}function create_fragment$5S(e){let t,n;const o=[{type:"submit"},{disabled:e[0]},e[3]];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormStyledButton({props:r}),t.$on("click",e[2]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=9&n?get_spread_update(o,[o[0],1&n&&{disabled:e[0]},8&n&&get_spread_object(e[3])]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5M(e,t,n){let o,{disabled:r=!1}=t;const i=createEventDispatcher(),{submitActionRef:a}=getFormContext(),{values:s}=getFormContext();function c(){i("click",o)}return component_subscribe(e,s,(e=>n(4,o=e))),a.set((()=>{r||c()})),e.$$set=e=>{n(3,t=assign(assign({},t),exclude_internal_props(e))),"disabled"in e&&n(0,r=e.disabled)},t=exclude_internal_props(t),[r,s,c,t]}class FormSubmit extends SvelteComponent{constructor(e){super(),init(this,e,instance$5M,create_fragment$5S,safe_not_equal,{disabled:0})}}function create_fragment$5R(e){let t,n;const o=[e[6],{value:e[3][e[0]]??e[1]}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new TextField({props:r}),t.$on("input",e[7]),t.$on("input",e[8]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=75&n?get_spread_update(o,[64&n&&get_spread_object(e[6]),11&n&&{value:e[3][e[0]]??e[1]}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5L(e,t,n){const o=["name","defaultValue","saveOnInput"];let r,i=compute_rest_props(t,o),{name:a}=t,{defaultValue:s}=t,{saveOnInput:c=!1}=t;const{values:l,setFieldValue:u}=getFormContext();component_subscribe(e,l,(e=>n(3,r=e)));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(6,i=compute_rest_props(t,o)),"name"in e&&n(0,a=e.name),"defaultValue"in e&&n(1,s=e.defaultValue),"saveOnInput"in e&&n(2,c=e.saveOnInput)},[a,s,c,r,l,u,i,e=>u(a,e.target.value),e=>{c&&u(a,e.target.value)}]}class FormTextFieldRaw extends SvelteComponent{constructor(e){super(),init(this,e,instance$5L,create_fragment$5R,safe_not_equal,{name:0,defaultValue:1,saveOnInput:2})}}function create_default_slot$29(e){let t,n;const o=[{name:e[1]},e[5],{focused:e[3]}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormTextFieldRaw({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=42&n?get_spread_update(o,[2&n&&{name:e[1]},32&n&&get_spread_object(e[5]),8&n&&{focused:e[3]}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5Q(e){let t,n,o;const r=[{type:"text"},{label:e[0]},e[2]];var i=e[4];function a(e){let t={$$slots:{default:[create_default_slot$29]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=5&o?get_spread_update(r,[r[0],1&o&&{label:e[0]},4&o&&get_spread_object(e[2])]):{};if(106&o&&(s.$$scope={dirty:o,ctx:e}),i!==(i=e[4])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5K(e,t,n){const o=["label","name","templateProps","focused"];let r=compute_rest_props(t,o),{label:i}=t,{name:a}=t,{templateProps:s={}}=t,{focused:c=!1}=t;const{template:l}=getFormContext();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(5,r=compute_rest_props(t,o)),"label"in e&&n(0,i=e.label),"name"in e&&n(1,a=e.name),"templateProps"in e&&n(2,s=e.templateProps),"focused"in e&&n(3,c=e.focused)},[i,a,s,c,l,r]}class FormTextField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5K,create_fragment$5Q,safe_not_equal,{label:0,name:1,templateProps:2,focused:3})}}function create_default_slot$28(e){let t;const n=e[3].default,o=create_slot(n,e,e[4],null);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||16&r)&&update_slot_base(o,n,e,e[4],t?get_slot_changes(n,e[4],r,null):get_all_dirty_from_scope(e[4]),null)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_fragment$5P(e){let t,n;return t=new FormProviderCore({props:{values:e[1],template:e[0],$$slots:{default:[create_default_slot$28]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.template=e[0]),16&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5J(e,t,n){let{$$slots:o={},$$scope:r}=t,{initialValues:i={}}=t,{template:a=FormFieldTemplateLarge}=t;const s=writable(i);return e.$$set=e=>{"initialValues"in e&&n(2,i=e.initialValues),"template"in e&&n(0,a=e.template),"$$scope"in e&&n(4,r=e.$$scope)},[a,s,i,o,r]}class FormProvider extends SvelteComponent{constructor(e){super(),init(this,e,instance$5J,create_fragment$5P,safe_not_equal,{initialValues:2,template:0})}}function clickOutside(e){const t=t=>{!e||e.contains(t.target)||t.defaultPrevented||e.dispatchEvent(new CustomEvent("clickOutside"))};return document.addEventListener("mousedown",t,!0),{destroy(){document.removeEventListener("mousedown",t,!0)}}}const get_footer_slot_changes=e=>({}),get_footer_slot_context=e=>({}),get_header_slot_changes=e=>({}),get_header_slot_context=e=>({});function create_if_block_1$1w(e){let t,n,o,r,i,a,s,c;const l=e[9].header,u=create_slot(l,e,e[8],get_header_slot_context);return i=new FontIcon({props:{icon:"icon close"}}),{c(){t=element("div"),n=element("div"),u&&u.c(),o=space(),r=element("div"),create_component(i.$$.fragment),attr(r,"class","close svelte-1k8vlpo"),attr(t,"class","header svelte-1k8vlpo"),toggle_class(t,"fullScreen",e[0])},m(l,d){insert(l,t,d),append(t,n),u&&u.m(n,null),append(t,o),append(t,r),mount_component(i,r,null),a=!0,s||(c=listen(r,"click",e[3]),s=!0)},p(e,n){u&&u.p&&(!a||256&n)&&update_slot_base(u,l,e,e[8],a?get_slot_changes(l,e[8],n,get_header_slot_changes):get_all_dirty_from_scope(e[8]),get_header_slot_context),(!a||1&n)&&toggle_class(t,"fullScreen",e[0])},i(e){a||(transition_in(u,e),transition_in(i.$$.fragment,e),a=!0)},o(e){transition_out(u,e),transition_out(i.$$.fragment,e),a=!1},d(e){e&&detach(t),u&&u.d(e),destroy_component(i),s=!1,c()}}}function create_if_block$2t(e){let t,n;const o=e[9].footer,r=create_slot(o,e,e[8],get_footer_slot_context);return{c(){t=element("div"),r&&r.c(),attr(t,"class","footer svelte-1k8vlpo"),toggle_class(t,"fullScreen",e[0])},m(e,o){insert(e,t,o),r&&r.m(t,null),n=!0},p(e,i){r&&r.p&&(!n||256&i)&&update_slot_base(r,o,e,e[8],n?get_slot_changes(o,e[8],i,get_footer_slot_changes):get_all_dirty_from_scope(e[8]),get_footer_slot_context),(!n||1&i)&&toggle_class(t,"fullScreen",e[0])},i(e){n||(transition_in(r,e),n=!0)},o(e){transition_out(r,e),n=!1},d(e){e&&detach(t),r&&r.d(e)}}}function create_fragment$5O(e){let t,n,o,r,i,a,s,c,l=e[6].header&&create_if_block_1$1w(e);const u=e[9].default,d=create_slot(u,e,e[8],null);let p=e[6].footer&&create_if_block$2t(e);return{c(){t=element("div"),n=element("div"),l&&l.c(),o=space(),r=element("div"),d&&d.c(),i=space(),p&&p.c(),attr(r,"class","content svelte-1k8vlpo"),toggle_class(r,"noPadding",e[1]),toggle_class(r,"fullScreen",e[0]),attr(n,"class","window svelte-1k8vlpo"),attr(n,"data-testid","ModalBase_window"),toggle_class(n,"fullScreen",e[0]),toggle_class(n,"simple",e[2]),attr(t,"id","myModal"),attr(t,"class","bglayer svelte-1k8vlpo")},m(u,m){insert(u,t,m),append(t,n),l&&l.m(n,null),append(n,o),append(n,r),d&&d.m(r,null),append(n,i),p&&p.m(n,null),a=!0,s||(c=[listen(window,"keydown",e[5]),action_destroyer(clickOutside.call(null,n)),listen(n,"clickOutside",e[4])],s=!0)},p(e,[t]){e[6].header?l?(l.p(e,t),64&t&&transition_in(l,1)):(l=create_if_block_1$1w(e),l.c(),transition_in(l,1),l.m(n,o)):l&&(group_outros(),transition_out(l,1,1,(()=>{l=null})),check_outros()),d&&d.p&&(!a||256&t)&&update_slot_base(d,u,e,e[8],a?get_slot_changes(u,e[8],t,null):get_all_dirty_from_scope(e[8]),null),(!a||2&t)&&toggle_class(r,"noPadding",e[1]),(!a||1&t)&&toggle_class(r,"fullScreen",e[0]),e[6].footer?p?(p.p(e,t),64&t&&transition_in(p,1)):(p=create_if_block$2t(e),p.c(),transition_in(p,1),p.m(n,null)):p&&(group_outros(),transition_out(p,1,1,(()=>{p=null})),check_outros()),(!a||1&t)&&toggle_class(n,"fullScreen",e[0]),(!a||4&t)&&toggle_class(n,"simple",e[2])},i(e){a||(transition_in(l),transition_in(d,e),transition_in(p),a=!0)},o(e){transition_out(l),transition_out(d,e),transition_out(p),a=!1},d(e){e&&detach(t),l&&l.d(),d&&d.d(e),p&&p.d(),s=!1,run_all(c)}}}function instance$5I(e,t,n){let o;component_subscribe(e,currentDropDownMenu,(e=>n(10,o=e)));let{$$slots:r={},$$scope:i}=t;const a=compute_slots(r);let{fullScreen:s=!1}=t,{noPadding:c=!1}=t,{simple:l=!1}=t,{modalId:u}=t;function d(){u==getActiveModalId()&&closeModal(u)}return onMount((()=>{const e=document.activeElement;return()=>{e&&e.focus()}})),e.$$set=e=>{"fullScreen"in e&&n(0,s=e.fullScreen),"noPadding"in e&&n(1,c=e.noPadding),"simple"in e&&n(2,l=e.simple),"modalId"in e&&n(7,u=e.modalId),"$$scope"in e&&n(8,i=e.$$scope)},[s,c,l,d,function(){o||d()},function(e){e.keyCode==keycodes.escape&&d()},a,u,i,r]}class ModalBase extends SvelteComponent{constructor(e){super(),init(this,e,instance$5I,create_fragment$5O,safe_not_equal,{fullScreen:0,noPadding:1,simple:2,modalId:7})}}function create_else_block$19(e){let t,n,o,r,i,a,s;return o=new FontIcon({props:{icon:"img error"}}),{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=element("div"),a=text$1(e[1]),attr(n,"class","icon svelte-1a6igp5"),attr(i,"data-testid","ErrorMessageModal_message"),attr(t,"class","wrapper svelte-1a6igp5")},m(e,c){insert(e,t,c),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),append(i,a),s=!0},p(e,t){(!s||2&t)&&set_data(a,e[1])},i(e){s||(transition_in(o.$$.fragment,e),s=!0)},o(e){transition_out(o.$$.fragment,e),s=!1},d(e){e&&detach(t),destroy_component(o)}}}function create_if_block$2s(e){let t,n;return{c(){t=element("pre"),n=text$1(e[1]),attr(t,"class","svelte-1a6igp5")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){2&t&&set_data(n,e[1])},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_default_slot_1$1q(e){let t,n,o,r;const i=[create_if_block$2s,create_else_block$19],a=[];function s(e,t){return e[2]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_header_slot$F(e){let t,n;return{c(){t=element("div"),n=text$1(e[0]),attr(t,"slot","header")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){1&t&&set_data(n,e[0])},d(e){e&&detach(t)}}}function create_footer_slot$D(e){let t,n,o;return n=new FormSubmit({props:{value:"Close","data-testid":"ErrorMessageModal_closeButton"}}),n.$on("click",closeCurrentModal),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"slot","footer")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_default_slot$27(e){let t,n;const o=[e[3]];let r={$$slots:{footer:[create_footer_slot$D],header:[create_header_slot$F],default:[create_default_slot_1$1q]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=8&n?get_spread_update(o,[get_spread_object(e[3])]):{};23&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5N(e){let t,n;return t=new FormProvider({props:{$$slots:{default:[create_default_slot$27]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};31&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5H(e,t,n){const o=["title","message","showAsCode"];let r=compute_rest_props(t,o),{title:i="Error"}=t,{message:a}=t,{showAsCode:s=!1}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(3,r=compute_rest_props(t,o)),"title"in e&&n(0,i=e.title),"message"in e&&n(1,a=e.message),"showAsCode"in e&&n(2,s=e.showAsCode)},[i,a,s,r]}class ErrorMessageModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5H,create_fragment$5N,safe_not_equal,{title:0,message:1,showAsCode:2})}}let compiled=null;function hasPermission(e){return lib$5.testPermission(e,compiled)}function subscribePermissionCompiler(){useConfig().subscribe((e=>{if(!e)return;const{permissions:t}=e;compiled=lib$5.compilePermissions(t)}))}function setConfigForPermissions(e){compiled=lib$5.compilePermissions((null==e?void 0:e.permissions)||[])}const doServerPing=e=>{const t=getCurrentConfig(),n=[...e];t.storageDatabase&&hasPermission("internal-storage")&&n.push("__storage"),n.push(...getVolatileConnections()),t.singleConnection&&n.push(t.singleConnection._id),apiCall("server-connections/ping",{conidArray:_.compact(n),strmid:strmid})},doDatabasePing=e=>{const t=_.get(e,"name"),n=_.get(e,"connection._id");n&&t&&apiCall("database-connections/ping",{conid:n,database:t})};let openedConnectionsHandle=null,currentDatabaseHandle=null;function subscribeConnectionPingers(){openedConnectionsWithTemporary.subscribe((e=>{doServerPing(e),openedConnectionsHandle&&window.clearInterval(openedConnectionsHandle),openedConnectionsHandle=window.setInterval((()=>doServerPing(e)),2e4)})),currentDatabase.subscribe((e=>{doDatabasePing(e),currentDatabaseHandle&&window.clearInterval(currentDatabaseHandle),currentDatabaseHandle=window.setInterval((()=>doDatabasePing(e)),2e4)}))}function callServerPing(){const e=getOpenedConnections();doServerPing(e)}function create_if_block_2$11(e){let t,n,o,r;return n=new FontIcon({props:{icon:"icon loading"}}),{c(){t=element("div"),create_component(n.$$.fragment),o=text$1(" Testing connection")},m(e,i){insert(e,t,i),mount_component(n,t,null),append(t,o),r=!0},i(e){r||(transition_in(n.$$.fragment,e),r=!0)},o(e){transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block_1$1v(e){let t,n,o,r,i,a,s,c,l=e[1].error+"";return o=new FontIcon({props:{icon:"img error"}}),s=new Link$1({props:{onClick:e[14],$$slots:{default:[create_default_slot_2$J]},$$scope:{ctx:e}}}),{c(){t=element("div"),n=text$1("Connect failed: "),create_component(o.$$.fragment),r=space(),i=text$1(l),a=space(),create_component(s.$$.fragment),attr(t,"class","error-result")},m(e,l){insert(e,t,l),append(t,n),mount_component(o,t,null),append(t,r),append(t,i),append(t,a),mount_component(s,t,null),c=!0},p(e,t){(!c||2&t)&&l!==(l=e[1].error+"")&&set_data(i,l);const n={};2&t&&(n.onClick=e[14]),1048576&t&&(n.$$scope={dirty:t,ctx:e}),s.$set(n)},i(e){c||(transition_in(o.$$.fragment,e),transition_in(s.$$.fragment,e),c=!0)},o(e){transition_out(o.$$.fragment,e),transition_out(s.$$.fragment,e),c=!1},d(e){e&&detach(t),destroy_component(o),destroy_component(s)}}}function create_default_slot_2$J(e){let t;return{c(){t=text$1("Show detail")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_default_slot_1$1p(e){let t,n,o,r,i,a,s,c,l;t=new FormTextField({props:{label:"Connection",name:"connectionLabel",disabled:!0}}),o=new FormTextField({props:{label:"Username",name:"user",autocomplete:"username",disabled:"askPassword"==e[3],focused:"askUser"==e[3],saveOnInput:!0,"data-testid":"DatabaseLoginModal_username"}}),i=new FormPasswordField({props:{label:"Password",name:"password",autocomplete:"current-password",focused:"askPassword"==e[3],saveOnInput:!0,"data-testid":"DatabaseLoginModal_password"}});let u=e[0]&&create_if_block_2$11(),d=!e[0]&&e[1]&&"error"==e[1].msgtype&&create_if_block_1$1v(e);return{c(){create_component(t.$$.fragment),n=space(),create_component(o.$$.fragment),r=space(),create_component(i.$$.fragment),a=space(),u&&u.c(),s=space(),d&&d.c(),c=empty()},m(e,p){mount_component(t,e,p),insert(e,n,p),mount_component(o,e,p),insert(e,r,p),mount_component(i,e,p),insert(e,a,p),u&&u.m(e,p),insert(e,s,p),d&&d.m(e,p),insert(e,c,p),l=!0},p(e,t){const n={};8&t&&(n.disabled="askPassword"==e[3]),8&t&&(n.focused="askUser"==e[3]),o.$set(n);const r={};8&t&&(r.focused="askPassword"==e[3]),i.$set(r),e[0]?u?1&t&&transition_in(u,1):(u=create_if_block_2$11(),u.c(),transition_in(u,1),u.m(s.parentNode,s)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros()),!e[0]&&e[1]&&"error"==e[1].msgtype?d?(d.p(e,t),3&t&&transition_in(d,1)):(d=create_if_block_1$1v(e),d.c(),transition_in(d,1),d.m(c.parentNode,c)):d&&(group_outros(),transition_out(d,1,1,(()=>{d=null})),check_outros())},i(e){l||(transition_in(t.$$.fragment,e),transition_in(o.$$.fragment,e),transition_in(i.$$.fragment,e),transition_in(u),transition_in(d),l=!0)},o(e){transition_out(t.$$.fragment,e),transition_out(o.$$.fragment,e),transition_out(i.$$.fragment,e),transition_out(u),transition_out(d),l=!1},d(e){destroy_component(t,e),e&&detach(n),destroy_component(o,e),e&&detach(r),destroy_component(i,e),e&&detach(a),u&&u.d(e),e&&detach(s),d&&d.d(e),e&&detach(c)}}}function create_header_slot$E(e){let t,n,o;return{c(){t=text$1("Database Log In ("),n=text$1(e[2]),o=text$1(")")},m(e,r){insert(e,t,r),insert(e,n,r),insert(e,o,r)},p(e,t){4&t&&set_data(n,e[2])},d(e){e&&detach(t),e&&detach(n),e&&detach(o)}}}function create_else_block$18(e){let t,n;return t=new FormSubmit({props:{value:"Connect","data-testid":"DatabaseLoginModal_connect"}}),t.$on("click",e[6]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block$2r(e){let t,n;return t=new FormStyledButton({props:{value:"Stop connecting","data-testid":"DatabaseLoginModal_stop"}}),t.$on("click",e[5]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_footer_slot$C(e){let t,n,o,r,i;const a=[create_if_block$2r,create_else_block$18],s=[];function c(e,t){return e[0]?0:1}return t=c(e),n=s[t]=a[t](e),r=new FormStyledButton({props:{value:"Close","data-testid":"DatabaseLoginModal_close"}}),r.$on("click",closeCurrentModal),{c(){n.c(),o=space(),create_component(r.$$.fragment)},m(e,n){s[t].m(e,n),insert(e,o,n),mount_component(r,e,n),i=!0},p(e,r){let i=t;t=c(e),t===i?s[t].p(e,r):(group_outros(),transition_out(s[i],1,1,(()=>{s[i]=null})),check_outros(),n=s[t],n?n.p(e,r):(n=s[t]=a[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){i||(transition_in(n),transition_in(r.$$.fragment,e),i=!0)},o(e){transition_out(n),transition_out(r.$$.fragment,e),i=!1},d(e){s[t].d(e),e&&detach(o),destroy_component(r,e)}}}function create_default_slot$26(e){let t,n;const o=[e[7],{simple:!0}];let r={$$slots:{footer:[create_footer_slot$C],header:[create_header_slot$E],default:[create_default_slot_1$1p]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=128&n?get_spread_update(o,[get_spread_object(e[7]),o[1]]):{};1048591&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5M(e){let t,n;return t=new FormProviderCore({props:{values:e[4],$$slots:{default:[create_default_slot$26]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};1048719&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}let currentModalConid=null;function isDatabaseLoginVisible(){return!!currentModalConid}function instance$5G(e,t,n){let o;const r=["conid","passwordMode","testedConnection","onConnect","onCancel"];let i,a=compute_rest_props(t,r);var s,c=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let{conid:l}=t,{passwordMode:u}=t,{testedConnection:d}=t,{onConnect:p=null}=t,{onCancel:m=null}=t;const f=writable({});let h,g,$;component_subscribe(e,f,(e=>n(17,i=e)));const b=createRef(0);let y,v=!1;currentModalConid=l,onMount((()=>c(void 0,void 0,void 0,(function*(){h=d||(yield getConnectionInfo({conid:l})),"askPassword"==o&&set_store_value(f,i=Object.assign(Object.assign({},i),{user:h.user,connectionLabel:lib$5.getConnectionLabel(h)}),i),"askUser"==o&&set_store_value(f,i=Object.assign(Object.assign({},i),{connectionLabel:lib$5.getConnectionLabel(h)}),i);const e=(h.engine||"").match(/^([^@]*)@/);n(2,y=e?e[1]:h.engine)})))),onDestroy((()=>{currentModalConid=null,v||(m&&m(),openedConnections.update((e=>_.without(e,l))))}));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(7,a=compute_rest_props(t,r)),"conid"in e&&n(8,l=e.conid),"passwordMode"in e&&n(9,u=e.passwordMode),"testedConnection"in e&&n(10,d=e.testedConnection),"onConnect"in e&&n(11,p=e.onConnect),"onCancel"in e&&n(12,m=e.onCancel)},e.$$.update=()=>{9728&e.$$.dirty&&n(3,o=null!==n(13,s=null==d?void 0:d.passwordMode)&&void 0!==s?s:u)},[g,$,y,o,f,function(){b.update((e=>e+1)),n(0,g=!1)},function(e){return c(this,void 0,void 0,(function*(){if(v=!0,p)return p(Object.assign(Object.assign({},d),{user:"askUser"==o?i.user:d.user,password:i.password})),void closeCurrentModal();n(0,g=!0),b.update((e=>e+1));const e=b.get(),t=yield apiCall("connections/save-volatile",{conid:l,user:i.user,password:i.password,test:!0});b.get()==e&&(n(0,g=!1),"connected"==t.msgtype?(setVolatileConnectionRemapping(l,t._id),yield callServerPing(),dispatchCacheChange({key:"server-status-changed"}),batchDispatchCacheTriggers((e=>e.conid==l)),closeCurrentModal()):n(1,$=t))}))},a,l,u,d,p,m,s,()=>showModal(ErrorMessageModal,{message:$.detail,showAsCode:!0,title:"Database connection error"})]}class DatabaseLoginModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5G,create_fragment$5M,safe_not_equal,{conid:8,passwordMode:9,testedConnection:10,onConnect:11,onCancel:12})}}function get_each_context$Y(e,t,n){const o=e.slice();return o[5]=t[n],o}function create_if_block_1$1u(e){let t;return{c(){t=text$1("download\n and")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_each_block$Y(e){let t,n,o=e[5]+"";return{c(){t=element("li"),n=text$1(o)},m(e,o){insert(e,t,o),append(t,n)},p(e,t){2&t&&o!==(o=e[5]+"")&&set_data(n,o)},d(e){e&&detach(t)}}}function create_default_slot_1$1o(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f,h,g,_,$,b;o=new FontIcon({props:{icon:"img error"}});let y=create_if_block_1$1u(),v=e[1]||[],x=[];for(let t=0;t<v.length;t+=1)x[t]=create_each_block$Y(get_each_context$Y(e,v,t));return{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=element("div"),a=element("p"),s=text$1("Cloud operation ended with error:"),c=element("br"),l=space(),u=text$1(e[0]),d=space(),p=element("p"),m=text$1("This is a limitation of the free version of DbGate. To continue using cloud operations, please "),y&&y.c(),f=text$1(" purchase DbGate Premium."),h=space(),g=element("p"),g.textContent="Free version limit:",_=space(),$=element("ul");for(let e=0;e<x.length;e+=1)x[e].c();attr(n,"class","icon svelte-fcnirv"),attr(i,"data-testid","LicenseLimitMessageModal_message"),attr(t,"class","wrapper svelte-fcnirv")},m(e,v){insert(e,t,v),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),append(i,a),append(a,s),append(a,c),append(a,l),append(a,u),append(i,d),append(i,p),append(p,m),y&&y.m(p,null),append(p,f),append(i,h),append(i,g),append(i,_),append(i,$);for(let e=0;e<x.length;e+=1)x[e]&&x[e].m($,null);b=!0},p(e,t){if((!b||1&t)&&set_data(u,e[0]),2&t){let n;for(v=e[1]||[],n=0;n<v.length;n+=1){const o=get_each_context$Y(e,v,n);x[n]?x[n].p(o,t):(x[n]=create_each_block$Y(o),x[n].c(),x[n].m($,null))}for(;n<x.length;n+=1)x[n].d(1);x.length=v.length}},i(e){b||(transition_in(o.$$.fragment,e),b=!0)},o(e){transition_out(o.$$.fragment,e),b=!1},d(e){e&&detach(t),destroy_component(o),y&&y.d(),destroy_each(x,e)}}}function create_header_slot$D(e){let t;return{c(){t=element("div"),t.textContent="License limit error",attr(t,"slot","header")},m(e,n){insert(e,t,n)},p:noop$2,d(e){e&&detach(t)}}}function create_if_block$2q(e){let t,n;return t=new FormStyledButton({props:{value:"Download DbGate Premium",skipWidth:!0}}),t.$on("click",e[3]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_footer_slot$B(e){let t,n,o,r,i,a;n=new FormSubmit({props:{value:"Close","data-testid":"LicenseLimitMessageModal_closeButton"}}),n.$on("click",closeCurrentModal);let s=create_if_block$2q(e);return i=new FormStyledButton({props:{value:"Purchase DbGate Premium",skipWidth:!0}}),i.$on("click",e[4]),{c(){t=element("div"),create_component(n.$$.fragment),o=space(),s&&s.c(),r=space(),create_component(i.$$.fragment),attr(t,"slot","footer")},m(e,c){insert(e,t,c),mount_component(n,t,null),append(t,o),s&&s.m(t,null),append(t,r),mount_component(i,t,null),a=!0},p(e,t){s.p(e,t)},i(e){a||(transition_in(n.$$.fragment,e),transition_in(s),transition_in(i.$$.fragment,e),a=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(s),transition_out(i.$$.fragment,e),a=!1},d(e){e&&detach(t),destroy_component(n),s&&s.d(),destroy_component(i)}}}function create_default_slot$25(e){let t,n;const o=[e[2]];let r={$$slots:{footer:[create_footer_slot$B],header:[create_header_slot$D],default:[create_default_slot_1$1o]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=4&n?get_spread_update(o,[get_spread_object(e[2])]):{};259&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5L(e){let t,n;return t=new FormProvider({props:{$$slots:{default:[create_default_slot$25]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};263&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5F(e,t,n){const o=["message","licenseLimits"];let r=compute_rest_props(t,o),{message:i}=t,{licenseLimits:a}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(2,r=compute_rest_props(t,o)),"message"in e&&n(0,i=e.message),"licenseLimits"in e&&n(1,a=e.licenseLimits)},[i,a,r,()=>openWebLink("https://dbgate.io/download/"),()=>openWebLink("https://dbgate.io/purchase/premium/")]}class LicenseLimitMessageModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5F,create_fragment$5L,safe_not_equal,{message:0,licenseLimits:1})}}const strmid=v1_1$6();let eventSource,apiLogging=!1,apiDisabled=!1;const disabledOnOauth=isOauthCallback$1(),volatileConnectionMapStore=writable({}),volatileConnectionMapInvStore=writable({});let volatileConnectionMapValue={};volatileConnectionMapStore.subscribe((e=>{volatileConnectionMapValue=e}));let volatileConnectionMapInvValue={};function disableApi(){apiDisabled=!0}function enableApi(){apiDisabled=!1}function setVolatileConnectionRemapping(e,t){volatileConnectionMapStore.update((n=>Object.assign(Object.assign({},n),{[e]:t}))),volatileConnectionMapInvStore.update((n=>Object.assign(Object.assign({},n),{[t]:e})))}function removeVolatileMapping(e){const t=volatileConnectionMapValue[e];t&&(volatileConnectionMapStore.update((t=>_.omit(t,e))),volatileConnectionMapInvStore.update((e=>_.omit(e,t))))}function wantEventSource(){eventSource||(eventSource=new EventSource(`${resolveApi()}/stream?strmid=${strmid}`))}function processApiResponse(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){if(null==n?void 0:n.missingCredentials){if(n.detail.redirectToDbLogin){const e=yield apiCall("connections/volatile-dblogin-from-auth",{conid:n.detail.conid});if(e)return setVolatileConnectionRemapping(n.detail.conid,e._id),yield callServerPing(),dispatchCacheChange({key:"server-status-changed"}),batchDispatchCacheTriggers((e=>e.conid==n.detail.conid)),null;const t=`dbg-dblogin:${strmid}:${n.detail.conid}`;if(localStorage.setItem("dbloginState",t),getElectron()){openWebLink((yield apiCall("connections/dblogin-app",{conid:n.detail.conid,state:t})).url)}else openWebLink(`connections/dblogin-web?conid=${n.detail.conid}&state=${encodeURIComponent(t)}&redirectUri=${location.origin+location.pathname}`)}else isDatabaseLoginVisible()||showModal(DatabaseLoginModal,n.detail);return null}return(null==n?void 0:n.apiErrorMessage)?((null==n?void 0:n.apiErrorIsLicenseLimit)?showModal(LicenseLimitMessageModal,{message:n.apiErrorMessage,licenseLimits:n.apiErrorLimitedLicenseLimits}):showSnackbarError("API error:"+(null==n?void 0:n.apiErrorMessage)),{errorMessage:n.apiErrorMessage}):n}))}function transformApiArgs(e){return _.mapValues(e,((e,t)=>"conid"==t&&e&&volatileConnectionMapValue[e]?volatileConnectionMapValue[e]:"conidArray"==t&&_.isArray(e)?e.map((e=>volatileConnectionMapValue[e]||e)):e))}function transformApiArgsInv(e){return _.mapValues(e,((e,t)=>"conid"==t&&e&&volatileConnectionMapInvValue[e]?volatileConnectionMapInvValue[e]:"conidArray"==t&&_.isArray(e)?e.map((e=>volatileConnectionMapInvValue[e]||e)):e))}function apiCall(e,t=void 0,n=void 0){return __awaiter$h(this,void 0,void 0,(function*(){if(apiLogging&&console.log(">>> API CALL",e,t),!(null==n?void 0:n.skipDisableChecks)){if(apiDisabled)return void console.log("API disabled!!",e);if(disabledOnOauth&&"auth/oauth-token"!=e)return void console.log("API disabled because oauth callback!!",e)}t=transformApiArgs(t);const o=getElectron();if(o){const n=yield o.invoke(e.replace("/","-"),t);return yield processApiResponse(e,t,n)}{const n=yield fetch(`${resolveApi()}/${e}`,{method:"POST",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json"},resolveApiHeaders()),body:JSON.stringify(t,lib$5.serializeJsTypesReplacer)});if(401==n.status&&!apiDisabled){const t=window.dbgate_page;if(disableApi(),console.log("Disabling API",e),"login"!=t&&"admin-login"!=t&&"not-logged"!=t){const e=yield apiCall("config/get",{},{skipDisableChecks:!0});yield handleAuthOnStartup(e)}return}const o=yield n.json();return yield processApiResponse(e,t,o)}}))}volatileConnectionMapInvStore.subscribe((e=>{volatileConnectionMapInvValue=e}));const apiHandlers=new WeakMap;function apiOn(e,t){const n=getElectron();if(n){if(!apiHandlers.has(t)){const n=(n,o)=>{apiLogging&&console.log("@@@ API EVENT",e,o),t(o)};apiHandlers.set(t,n)}n.addEventListener(e,apiHandlers.get(t))}else{if(wantEventSource(),!apiHandlers.has(t)){const n=n=>{const o=JSON.parse(n.data);apiLogging&&console.log("@@@ API EVENT",e,o),t(o)};apiHandlers.set(t,n)}eventSource.addEventListener(e,apiHandlers.get(t))}}function apiOff(e,t){const n=getElectron();apiHandlers.has(t)&&(n?n.removeEventListener(e,apiHandlers.get(t)):(wantEventSource(),eventSource.removeEventListener(e,apiHandlers.get(t))))}function useApiCall(e,t,n){const o=writable(n);return apiCall(e,t).then((e=>{o.set(e)})),o}function getVolatileConnections(){return Object.values(volatileConnectionMapValue)}function installNewVolatileConnectionListener(){apiOn("got-volatile-token",(({savedConId:e,volatileConId:t})=>__awaiter$h(this,void 0,void 0,(function*(){setVolatileConnectionRemapping(e,t),yield callServerPing(),dispatchCacheChange({key:"server-status-changed"}),batchDispatchCacheTriggers((t=>t.conid==e))}))))}function installNewCloudTokenListener(){apiOn("got-cloud-token",(e=>__awaiter$h(this,void 0,void 0,(function*(){console.log("HOLDER",e),cloudSigninTokenHolder.set(e)}))))}function getAuthCategory(e){return e.isBasicAuth?"basic":isOneOfPage("admin","admin-license")&&e.isAdminLoginForm?"admin":getElectron()?"electron":"token"}function refreshPublicCloudFiles(e=!1){sessionStorage.getItem("publicCloudFilesLoaded")&&!e||(apiCall("cloud/refresh-public-files",{isRefresh:!!sessionStorage.getItem("publicCloudFilesLoaded")}),sessionStorage.setItem("publicCloudFilesLoaded","true"))}function enableApiLog(){apiLogging=!0,console.log("API loggin enabled")}function disableApiLog(){apiLogging=!1,console.log("API loggin disabled")}window.enableApiLog=enableApiLog,window.disableApiLog=disableApiLog;var jsonify={},at,ch,escapee={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},text;function error$1(e){throw{name:"SyntaxError",message:e,at:at,text:text}}function next(e){return e&&e!==ch&&error$1("Expected '"+e+"' instead of '"+ch+"'"),ch=text.charAt(at),at+=1,ch}function number(){var e,t="";for("-"===ch&&(t="-",next("-"));ch>="0"&&ch<="9";)t+=ch,next();if("."===ch)for(t+=".";next()&&ch>="0"&&ch<="9";)t+=ch;if("e"===ch||"E"===ch)for(t+=ch,next(),"-"!==ch&&"+"!==ch||(t+=ch,next());ch>="0"&&ch<="9";)t+=ch,next();return e=Number(t),isFinite(e)||error$1("Bad number"),e}function string(){var e,t,n,o="";if('"'===ch)for(;next();){if('"'===ch)return next(),o;if("\\"===ch)if(next(),"u"===ch){for(n=0,t=0;t<4&&(e=parseInt(next(),16),isFinite(e));t+=1)n=16*n+e;o+=String.fromCharCode(n)}else{if("string"!=typeof escapee[ch])break;o+=escapee[ch]}else o+=ch}error$1("Bad string")}function white(){for(;ch&&ch<=" ";)next()}function word(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null;default:error$1("Unexpected '"+ch+"'")}}function array(){var e=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),e;for(;ch;){if(e.push(value()),white(),"]"===ch)return next("]"),e;next(","),white()}}error$1("Bad array")}function object(){var e,t={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),t;for(;ch;){if(e=string(),white(),next(":"),Object.prototype.hasOwnProperty.call(t,e)&&error$1('Duplicate key "'+e+'"'),t[e]=value(),white(),"}"===ch)return next("}"),t;next(","),white()}}error$1("Bad object")}function value(){switch(white(),ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}}var parse$3=function(e,t){var n;return text=e,at=0,ch=" ",n=value(),white(),ch&&error$1("Syntax error"),"function"==typeof t?function e(n,o){var r,i,a=n[o];if(a&&"object"==typeof a)for(r in value)Object.prototype.hasOwnProperty.call(a,r)&&(void 0===(i=e(a,r))?delete a[r]:a[r]=i);return t.call(n,o,a)}({"":n},""):n},escapable=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str$1(e,t){var n,o,r,i,a,s=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(i=c.length,n=0;n<i;n+=1)a[n]=str$1(n,c)||"null";return r=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,r}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;n<i;n+=1)"string"==typeof(o=rep[n])&&(r=str$1(o,c))&&a.push(quote(o)+(gap?": ":":")+r);else for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(r=str$1(o,c))&&a.push(quote(o)+(gap?": ":":")+r);return r=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,r}}var stringify$1=function(e,t,n){var o;if(gap="",indent="","number"==typeof n)for(o=0;o<n;o+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str$1("",{"":e})};jsonify.parse=parse$3,jsonify.stringify=stringify$1;var toString={}.toString,isarray=Array.isArray||function(e){return"[object Array]"==toString.call(e)},toStr$2=Object.prototype.toString,isArguments=function(e){var t=toStr$2.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===toStr$2.call(e.callee)),n},keysShim$1;if(!Object.keys){var has=Object.prototype.hasOwnProperty,toStr$1=Object.prototype.toString,isArgs$1=isArguments,isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call((function(){}),"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(e){var t=e.constructor;return t&&t.prototype===e},excludedKeys={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!excludedKeys["$"+e]&&has.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{equalsConstructorPrototype(window[e])}catch(e){return!0}}catch(e){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(e){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(e);try{return equalsConstructorPrototype(e)}catch(e){return!1}};keysShim$1=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===toStr$1.call(e),o=isArgs$1(e),r=t&&"[object String]"===toStr$1.call(e),i=[];if(!t&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var a=hasProtoEnumBug&&n;if(r&&e.length>0&&!has.call(e,0))for(var s=0;s<e.length;++s)i.push(String(s));if(o&&e.length>0)for(var c=0;c<e.length;++c)i.push(String(c));else for(var l in e)a&&"prototype"===l||!has.call(e,l)||i.push(String(l));if(hasDontEnumBug)for(var u=equalsConstructorPrototypeIfNotBuggy(e),d=0;d<dontEnums.length;++d)u&&"constructor"===dontEnums[d]||!has.call(e,dontEnums[d])||i.push(dontEnums[d]);return i}}var implementation$2=keysShim$1,slice=Array.prototype.slice,isArgs=isArguments,origKeys=Object.keys,keysShim=origKeys?function(e){return origKeys(e)}:implementation$2,originalKeys=Object.keys;keysShim.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return isArgs(e)?originalKeys(slice.call(e)):originalKeys(e)})}else Object.keys=keysShim;return Object.keys||keysShim};var objectKeys$1=keysShim,callBind$2={exports:{}},ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max$3=Math.max,funcType="[object Function]",concatty=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var r=0;r<t.length;r+=1)n[r+e.length]=t[r];return n},slicy=function(e,t){for(var n=[],o=t||0,r=0;o<e.length;o+=1,r+=1)n[r]=e[o];return n},joiny=function(e,t){for(var n="",o=0;o<e.length;o+=1)n+=e[o],o+1<e.length&&(n+=t);return n},implementation$1=function(e){var t=this;if("function"!=typeof t||toStr.apply(t)!==funcType)throw new TypeError(ERROR_MESSAGE+t);for(var n,o=slicy(arguments,1),r=max$3(0,t.length-o.length),i=[],a=0;a<r;a++)i[a]="$"+a;if(n=Function("binder","return function ("+joiny(i,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var r=t.apply(this,concatty(o,arguments));return Object(r)===r?r:this}return t.apply(e,concatty(o,arguments))})),t.prototype){var s=function(){};s.prototype=t.prototype,n.prototype=new s,s.prototype=null}return n},implementation=implementation$1,functionBind=Function.prototype.bind||implementation,esErrors=Error,_eval=EvalError,range=RangeError,ref=ReferenceError,syntax=SyntaxError,type$1=TypeError,uri=URIError,shams=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(e,t);if(42!==r.value||!0!==r.enumerable)return!1}return!0},origSymbol="undefined"!=typeof Symbol&&Symbol,hasSymbolSham=shams,hasSymbols$1=function(){return"function"==typeof origSymbol&&("function"==typeof Symbol&&("symbol"==typeof origSymbol("foo")&&("symbol"==typeof Symbol("bar")&&hasSymbolSham())))},test={__proto__:null,foo:{}},$Object=Object,hasProto$1=function(){return{__proto__:test}.foo===test.foo&&!(test instanceof $Object)},call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind$1=functionBind,hasown=bind$1.call(call,$hasOwn),undefined$1,$Error=esErrors,$EvalError=_eval,$RangeError=range,$ReferenceError=ref,$SyntaxError$1=syntax,$TypeError$2=type$1,$URIError=uri,$Function=Function,getEvalledConstructor=function(e){try{return $Function('"use strict"; return ('+e+").constructor;")()}catch(e){}},$gOPD$1=Object.getOwnPropertyDescriptor;if($gOPD$1)try{$gOPD$1({},"")}catch(e){$gOPD$1=null}var throwTypeError=function(){throw new $TypeError$2},ThrowTypeError=$gOPD$1?function(){try{return throwTypeError}catch(e){try{return $gOPD$1(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,hasSymbols=hasSymbols$1(),hasProto=hasProto$1(),getProto=Object.getPrototypeOf||(hasProto?function(e){return e.__proto__}:null),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined$1,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined$1:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined$1:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined$1:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined$1:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined$1:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined$1:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined$1:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":"object"==typeof JSON?JSON:undefined$1,"%Map%":"undefined"==typeof Map?undefined$1:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined$1,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined$1:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined$1:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined$1,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined$1:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined$1:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined$1:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined$1:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined$1:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined$1:WeakSet};if(getProto)try{null.error}catch(e){var errorProto=getProto(getProto(e));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function e(t){var n;if("%AsyncFunction%"===t)n=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===t)n=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var r=e("%AsyncGenerator%");r&&getProto&&(n=getProto(r.prototype))}return INTRINSICS[t]=n,n},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(e){var t=$strSlice(e,0,1),n=$strSlice(e,-1);if("%"===t&&"%"!==n)throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(e,rePropName,(function(e,t,n,r){o[o.length]=n?$replace(r,reEscapeChar,"$1"):t||e})),o},getBaseIntrinsic=function(e,t){var n,o=e;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(n=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var r=INTRINSICS[o];if(r===needsEval&&(r=doEval(o)),void 0===r&&!t)throw new $TypeError$2("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:r}}throw new $SyntaxError$1("intrinsic "+e+" does not exist!")},getIntrinsic=function(e,t){if("string"!=typeof e||0===e.length)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new $TypeError$2('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,e))throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=stringToPath(e),o=n.length>0?n[0]:"",r=getBaseIntrinsic("%"+o+"%",t),i=r.name,a=r.value,s=!1,c=r.alias;c&&(o=c[0],$spliceApply(n,$concat([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var d=n[l],p=$strSlice(d,0,1),m=$strSlice(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new $SyntaxError$1("property names with quotes must have matching quotes");if("constructor"!==d&&u||(s=!0),hasOwn(INTRINSICS,i="%"+(o+="."+d)+"%"))a=INTRINSICS[i];else if(null!=a){if(!(d in a)){if(!t)throw new $TypeError$2("base intrinsic for "+e+" exists, but the property is not available.");return}if($gOPD$1&&l+1>=n.length){var f=$gOPD$1(a,d);a=(u=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:a[d]}else u=hasOwn(a,d),a=a[d];u&&!s&&(INTRINSICS[i]=a)}}return a},GetIntrinsic$3=getIntrinsic,$defineProperty$2=GetIntrinsic$3("%Object.defineProperty%",!0)||!1;if($defineProperty$2)try{$defineProperty$2({},"a",{value:1})}catch(e){$defineProperty$2=!1}var esDefineProperty=$defineProperty$2,GetIntrinsic$2=getIntrinsic,$gOPD=GetIntrinsic$2("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch(e){$gOPD=null}var gopd$1=$gOPD,$defineProperty$1=esDefineProperty,$SyntaxError=syntax,$TypeError$1=type$1,gopd=gopd$1,defineDataProperty=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new $TypeError$1("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new $TypeError$1("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,a=arguments.length>6&&arguments[6],s=!!gopd&&gopd(e,t);if($defineProperty$1)$defineProperty$1(e,t,{configurable:null===i&&s?s.configurable:!i,enumerable:null===o&&s?s.enumerable:!o,value:n,writable:null===r&&s?s.writable:!r});else{if(!a&&(o||r||i))throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}},$defineProperty=esDefineProperty,hasPropertyDescriptors=function(){return!!$defineProperty};hasPropertyDescriptors.hasArrayLengthDefineBug=function(){if(!$defineProperty)return null;try{return 1!==$defineProperty([],"length",{value:1}).length}catch(e){return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors,GetIntrinsic$1=getIntrinsic,define=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD=gopd$1,$TypeError=type$1,$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(e,t){if("function"!=typeof e)throw new $TypeError("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||$floor(t)!==t)throw new $TypeError("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in e&&gOPD){var i=gOPD(e,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(r=!1)}return(o||r||!n)&&(hasDescriptors?define(e,"length",t,!0,!0):define(e,"length",t)),e};!function(e){var t=functionBind,n=getIntrinsic,o=setFunctionLength,r=type$1,i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||t.call(a,i),c=esDefineProperty,l=n("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new r("a function is required");var n=s(t,a,arguments);return o(n,1+l(0,e.length-(arguments.length-1)),!0)};var u=function(){return s(t,i,arguments)};c?c(e.exports,"apply",{value:u}):e.exports.apply=u}(callBind$2);var GetIntrinsic=getIntrinsic,callBind$1=callBind$2.exports,$indexOf=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$1=function(e,t){var n=GetIntrinsic(e,!!t);return"function"==typeof n&&$indexOf(e,".prototype.")>-1?callBind$1(n):n},jsonStringify=("undefined"!=typeof JSON?JSON:jsonify).stringify,isArray=isarray,objectKeys=objectKeys$1,callBind=callBind$2.exports,callBound=callBound$1,$join=callBound("Array.prototype.join"),$push=callBound("Array.prototype.push"),strRepeat=function(e,t){for(var n="",o=0;o<e;o+=1)n+=t;return n},defaultReplacer=function(e,t,n){return n},jsonStableStringify=function(e){var t=arguments.length>1?arguments[1]:void 0,n=t&&t.space||"";"number"==typeof n&&(n=strRepeat(n," "));var o=!!t&&"boolean"==typeof t.cycles&&t.cycles,r=t&&t.replacer?callBind(t.replacer):defaultReplacer,i="function"==typeof t?t:t&&t.cmp,a=i&&function(e){var t=i.length>2&&function(t){return e[t]};return function(n,o){return i({key:n,value:e[n]},{key:o,value:e[o]},t?{__proto__:null,get:t}:void 0)}},s=[];return function e(t,i,c,l){var u=n?"\n"+strRepeat(l,n):"",d=n?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=r(t,i,c))){if("object"!=typeof c||null===c)return jsonStringify(c);if(isArray(c)){for(var p=[],m=0;m<c.length;m++){var f=e(c,m,c[m],l+1)||jsonStringify(null);$push(p,u+n+f)}return"["+$join(p,",")+u+"]"}if(-1!==s.indexOf(c)){if(o)return jsonStringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}$push(s,c);var h=objectKeys(c).sort(a&&a(c));for(p=[],m=0;m<h.length;m++){var g=e(c,i=h[m],c[i],l+1);if(g){var _=jsonStringify(i)+d+g;$push(p,u+n+_)}}return s.splice(s.indexOf(c),1),"{"+$join(p,",")+u+"}"}}({"":e},"",e,0)};const cachedByKey={},cachedPromisesByKey={},cachedKeysByReloadTrigger={},subscriptionsByReloadTrigger={},cacheGenerationByKey={};let cacheGeneration=0;function cacheGet(e){return cachedByKey[e]}function addCacheKeyToReloadTrigger(e,t){for(const n of getAsArray(t)){const t=jsonStableStringify(n);t in cachedKeysByReloadTrigger||(cachedKeysByReloadTrigger[t]=[]),cachedKeysByReloadTrigger[t].push(e)}}function cacheSet(e,t,n,o){cachedByKey[e]=t,addCacheKeyToReloadTrigger(e,n),delete cachedPromisesByKey[e],cacheGenerationByKey[e]=o}function cacheClean(e){cacheGeneration+=1;for(const t of getAsArray(e)){const e=jsonStableStringify(transformApiArgsInv(t)),n=cachedKeysByReloadTrigger[e];if(n)for(const e of n)delete cachedByKey[e],delete cachedPromisesByKey[e],cacheGenerationByKey[e]=cacheGeneration;delete cachedKeysByReloadTrigger[e]}}function getCachedPromise(e,t,n){if(t in cachedPromisesByKey)return cachedPromisesByKey[t];const o=n();return cachedPromisesByKey[t]=o,addCacheKeyToReloadTrigger(t,e),o}function acquireCacheGeneration(){return cacheGeneration+=1,cacheGeneration}function getCacheGenerationForKey(e){return cacheGenerationByKey[e]||0}function loadCachedValue(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){const o=cacheGet(t);if(o)return o;{const o=acquireCacheGeneration();try{const r=yield getCachedPromise(e,t,n);return getCacheGenerationForKey(t)>o?cacheGet(t)||r:(cacheSet(t,r,e,o),r)}catch(r){console.error("Error when using cached promise",r),cacheClean(e);const i=yield n();return cacheSet(t,i,e,o),i}}}))}function subscribeCacheChange(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){for(const t of getAsArray(e)){const e=jsonStableStringify(t);subscriptionsByReloadTrigger[e]||(subscriptionsByReloadTrigger[e]=[]),subscriptionsByReloadTrigger[e].push(n)}}))}function unsubscribeCacheChange(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){for(const t of getAsArray(e)){const e=jsonStableStringify(t);subscriptionsByReloadTrigger[e]&&(subscriptionsByReloadTrigger[e]=subscriptionsByReloadTrigger[e].filter((e=>e!=n))),0==subscriptionsByReloadTrigger[e].length&&delete subscriptionsByReloadTrigger[e]}}))}function dispatchCacheChange(e){cacheClean(e);for(const t of getAsArray(e)){const e=jsonStableStringify(transformApiArgsInv(t));if(subscriptionsByReloadTrigger[e])for(const t of subscriptionsByReloadTrigger[e])t()}}function batchDispatchCacheTriggers(e){for(const t in subscriptionsByReloadTrigger){const n=JSON.parse(t);e(n)&&dispatchCacheChange(n)}}apiOn("changed-cache",(e=>dispatchCacheChange(e)));const cache={};function getLocalStorage(e,t=void 0){if(e in cache)return cache[e];const n=localStorage.getItem(e);if(n)try{const t=JSON.parse(n);return cache[e]=t,t}catch(e){return t}return t}function setLocalStorage(e,t){localStorage.setItem(e,JSON.stringify(t)),delete cache[e]}function removeLocalStorage(e){localStorage.removeItem(e),delete cache[e]}const databaseInfoLoader=({conid:e,database:t,modelTransFile:n})=>({url:"database-connections/structure",params:{conid:e,database:t,modelTransFile:n},reloadTrigger:{key:"database-structure-changed",conid:e,database:t},transform:lib$5.extendDatabaseInfo}),schemaListLoader=({conid:e,database:t})=>({url:"database-connections/schema-list",params:{conid:e,database:t},reloadTrigger:{key:"schema-list-changed",conid:e,database:t}}),connectionInfoLoader=({conid:e})=>({url:"connections/get",params:{conid:e},reloadTrigger:{key:"connection-list-changed"}}),configLoader=()=>({url:"config/get",params:{},reloadTrigger:{key:"config-changed"}}),settingsLoader=()=>({url:"config/get-settings",params:{},reloadTrigger:{key:"settings-changed"}}),platformInfoLoader=()=>({url:"config/platform-info",params:{},reloadTrigger:{key:"platform-info-changed"}}),favoritesLoader=()=>({url:"files/favorites",params:{},reloadTrigger:{key:"files-changed-favorites"}}),databaseStatusLoader=({conid:e,database:t})=>({url:"database-connections/status",params:{conid:e,database:t},reloadTrigger:{key:"database-status-changed",conid:e,database:t}}),databaseListLoader=({conid:e})=>({url:"server-connections/list-databases",params:{conid:e},reloadTrigger:{key:"database-list-changed",conid:e},onLoaded:t=>{(null==t?void 0:t.length)>0&&setLocalStorage(`database_list_${e}`,t)},errorValue:[]}),databaseServerVersionLoader=({conid:e,database:t})=>({url:"database-connections/server-version",params:{conid:e,database:t},reloadTrigger:{key:"database-server-version-changed",conid:e,database:t}}),archiveFoldersLoader=()=>({url:"archive/folders",params:{},reloadTrigger:{key:"archive-folders-changed"}}),archiveFilesLoader=({folder:e})=>({url:"archive/files",params:{folder:e},reloadTrigger:{key:"archive-files-changed",folder:e}}),appFoldersLoader=()=>({url:"apps/folders",params:{},reloadTrigger:{key:"app-folders-changed"}}),appFilesLoader=({folder:e})=>({url:"apps/files",params:{folder:e},reloadTrigger:{key:"app-files-changed",app:e}}),usedAppsLoader=({conid:e,database:t})=>({url:"apps/get-used-apps",params:{},reloadTrigger:{key:"used-apps-changed"}}),serverStatusLoader=()=>({url:"server-connections/server-status",params:{},reloadTrigger:{key:"server-status-changed"}}),connectionListLoader=()=>({url:"connections/list",params:{},reloadTrigger:{key:"connection-list-changed"}}),installedPluginsLoader=()=>({url:"plugins/installed",params:{},reloadTrigger:{key:"installed-plugins-changed"}}),filesLoader=({folder:e})=>({url:"files/list",params:{folder:e},reloadTrigger:{key:"files-changed",folder:e}}),authTypesLoader=({engine:e})=>({url:"plugins/auth-types",params:{engine:e},reloadTrigger:{key:"installed-plugins-changed"},errorValue:null}),publicCloudFilesLoader=()=>({url:"cloud/public-files",params:{},reloadTrigger:{key:"public-cloud-changed"}}),cloudContentListLoader=()=>({url:"cloud/content-list",params:{},reloadTrigger:{key:"cloud-content-changed"}});function getCore(e,t){return __awaiter$h(this,void 0,void 0,(function*(){const{url:n,params:o,reloadTrigger:r,transform:i,onLoaded:a,errorValue:s}=e(t),c=jsonStableStringify(Object.assign({url:n},o));return yield loadCachedValue(r,c,(function(){return __awaiter$h(this,void 0,void 0,(function*(){const e=yield apiCall(n,o);if((null==e?void 0:e.errorMessage)&&void 0!==s)return a&&a(s),s;const t=(i||(e=>e))(e);return a&&a(t),t}))}))}))}function useCore(e,t){const{url:n,params:o,reloadTrigger:r,transform:i,onLoaded:a}=e(t),s=jsonStableStringify(Object.assign({url:n},o));let c=0;return{subscribe:n=>{function o(){return __awaiter$h(this,void 0,void 0,(function*(){const o=yield getCore(e,t);c>0&&n(o)}))}return c+=1,o(),r?(subscribeCacheChange(r,s,o),()=>{c-=1,unsubscribeCacheChange(r,s,o)}):()=>{c-=1}}}}function getDatabaseInfo(e){return getCore(databaseInfoLoader,e)}function useDatabaseInfo(e){return useCore(databaseInfoLoader,e)}function getDbCore(e,t=void 0){return __awaiter$h(this,void 0,void 0,(function*(){const n=yield getDatabaseInfo(e);return n?n[t||e.objectTypeField].find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName)):null}))}function useDbCore(e,t=void 0){const n=useDatabaseInfo(e);return n?derived(n,(n=>{if(!n)return null;if(!_.isArray(t))return n[t||e.objectTypeField].find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName));for(const o of t){const t=n[o||e.objectTypeField].find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName));if(t)return t}})):null}function getTableInfo(e){return getDbCore(e,"tables")}function useTableInfo(e){return useDbCore(e,"tables")}function useViewInfo(e){return useDbCore(e,["views","matviews"])}function useCollectionInfo(e){return useDbCore(e,"collections")}function getSqlObjectInfo(e){return getDbCore(e)}function getConnectionInfo(e){return getCore(connectionInfoLoader,e)}function useConnectionInfo(e){return useCore(connectionInfoLoader,e)}function useDatabaseStatus(e){return useCore(databaseStatusLoader,e)}function useDatabaseList(e){return useCore(databaseListLoader,e)}function useDatabaseServerVersion(e){return useCore(databaseServerVersionLoader,e)}function useServerStatus(){return useCore(serverStatusLoader,{})}function getConnectionList(){return getCore(connectionListLoader,{})}function useConnectionList(){return useCore(connectionListLoader,{})}function getConfig(){return getCore(configLoader,{})}function useConfig(){return useCore(configLoader,{})}function getSettings(){return getCore(settingsLoader,{})}function useSettings(){return useCore(settingsLoader,{})}function usePlatformInfo(){return useCore(platformInfoLoader,{})}function useArchiveFiles(e){return useCore(archiveFilesLoader,e)}function useArchiveFolders(e={}){return useCore(archiveFoldersLoader,e)}function useAppFiles(e){return useCore(appFilesLoader,e)}function useAppFolders(e={}){return useCore(appFoldersLoader,e)}function getUsedApps(e={}){return getCore(usedAppsLoader,e)}function useUsedApps(e={}){return useCore(usedAppsLoader,e)}function useInstalledPlugins(e={}){return useCore(installedPluginsLoader,e)}function useFiles(e){return useCore(filesLoader,e)}function useFavorites(e={}){return useCore(favoritesLoader,e)}function useAuthTypes(e){return useCore(authTypesLoader,e)}function getSchemaList(e){return getCore(schemaListLoader,e)}function useSchemaList(e){return useCore(schemaListLoader,e)}function usePublicCloudFiles(e={}){return useCore(publicCloudFilesLoader,e)}function useCloudContentList(e={}){return useCore(cloudContentListLoader,e)}const darkModeMediaQuery=window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null,systemThemeStore=writable((null==darkModeMediaQuery?void 0:darkModeMediaQuery.matches)?"theme-dark":"theme-light");function getSystemTheme(){return(null==darkModeMediaQuery?void 0:darkModeMediaQuery.matches)?"theme-dark":"theme-light"}function writableWithStorage(e,t,n){const o=localStorage.getItem(t),r=writable(o?lib$5.safeJsonParse(o,e,!0):e);return r.subscribe((e=>{n&&n(e)?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(e))})),r}function writableWithForage(e,t,n){const o=writable(e);return o.subscribe((e=>{localforage.setItem(t,e)})),localforage.getItem(t).then((r=>{if(null==r){const n=localStorage.getItem(t);if(n){localStorage.removeItem(t);const r=lib$5.safeJsonParse(n,e,!0);localforage.setItem(t,r),o.set(r)}}else o.set(n?n(r):r)})),o}function writableSettingsValue(e,t){const n=derived(useSettings(),(n=>{var o;return null!==(o=(n||{})[t])&&void 0!==o?o:e}));return Object.assign(Object.assign({},n),{set:e=>apiCall("config/update-settings",{[t]:e}),update:n=>__awaiter$h(this,void 0,void 0,(function*(){var o;const r=yield getSettings(),i=n(null!==(o=r[t])&&void 0!==o?o:e);apiCall("config/update-settings",{[t]:i})}))})}function subscribeCssVariable(e,t,n){e.subscribe((e=>document.documentElement.style.setProperty(n,t(e))))}darkModeMediaQuery&&darkModeMediaQuery.addEventListener("change",(e=>{systemThemeStore.set(e.matches?"theme-dark":"theme-light")}));const selectedWidget=writableWithStorage(isAdminPage()?"admin":"database",isAdminPage()?"selectedAdminWidget":"selectedWidget"),lockedDatabaseMode=writableWithStorage(!1,"lockedDatabaseMode"),visibleWidgetSideBar=writableWithStorage(!0,"visibleWidgetSideBar"),visibleSelectedWidget=derived([selectedWidget,visibleWidgetSideBar],(([e,t])=>t?e:null)),emptyConnectionGroupNames=writableWithStorage([],"emptyConnectionGroupNames"),collapsedConnectionGroupNames=writableWithStorage([],"collapsedConnectionGroupNames"),openedConnections=writable([]),temporaryOpenedConnections=writable([]),openedSingleDatabaseConnections=writable([]),expandedConnections=writable([]),currentDatabase=writableWithStorage(null,"currentDatabase"),openedTabs=writableWithForage([],getOpenedTabsStorageName(),(e=>[...e||[]])),copyRowsFormat=writableWithStorage("textWithoutHeaders","copyRowsFormat"),extensions=writable(null),visibleCommandPalette=writable(null),commands=writable({}),currentTheme=getElectron()?writableSettingsValue(null,"currentTheme"):writableWithStorage(null,"currentTheme",(e=>null==e)),currentEditorTheme=getElectron()?writableSettingsValue(null,"currentEditorTheme"):writableWithStorage(null,"currentEditorTheme"),currentEditorKeybindigMode=getElectron()?writableSettingsValue(null,"currentEditorKeybindigMode"):writableWithStorage(null,"currentEditorKeybindigMode"),currentEditorWrapEnabled=getElectron()?writableSettingsValue(!1,"currentEditorWrapEnabled"):writableWithStorage(!1,"currentEditorWrapEnabled"),currentEditorFontSize=getElectron()?writableSettingsValue(null,"currentEditorFontSize"):writableWithStorage(null,"currentEditorFontSize"),currentEditorFont=writableSettingsValue(null,"editor.fontFamily");writableSettingsValue(!1,"ai.allowSendModels");const activeTabId=derived([openedTabs],(([e])=>{var t;return null===(t=e.find((e=>e.selected)))||void 0===t?void 0:t.tabid})),activeTab=derived([openedTabs],(([e])=>e.find((e=>e.selected)))),recentDatabases=writableWithStorage([],"recentDatabases"),pinnedDatabases=writableWithStorage([],"pinnedDatabases"),pinnedTables=writableWithStorage([],"pinnedTables"),commandsSettings=writable({}),allResultsInOneTabDefault=writableWithStorage(!1,"allResultsInOneTabDefault"),commandsCustomized=derived([commands,commandsSettings],(([e,t])=>_.mapValues(e,((e,n)=>Object.assign(Object.assign({},e),t[n]))))),appUpdateStatus=writable(null),appUpdaterActive=writable(!1),draggingTab=writable(null),draggingTabTarget=writable(null),draggingDbGroup=writable(null),draggingDbGroupTarget=writable(null),visibleToolbar=writable(!1),leftPanelWidth=writableWithStorage(300,"leftPanelWidth"),currentDropDownMenu=writable(null),openedModals=writable([]),draggedPinnedObject=writable(null),openedSnackbars=writable([]);readable(null,(()=>{}));const currentArchive=writableWithStorage("default","currentArchive"),currentApplication=writableWithStorage(null,"currentApplication"),isFileDragActive=writable(!1),selectedCellsCallback=writable(null),loadingPluginStore=writable({loaded:!1,loadingPackageName:null}),activeDbKeysStore=writableWithStorage({},"activeDbKeysStore"),appliedCurrentSchema=writable(null),loadingSchemaLists=writable({}),lastUsedDefaultActions=writableWithStorage({},"lastUsedDefaultActions"),selectedDatabaseObjectAppObject=writable(null),focusedConnectionOrDatabase=writable(null),focusedTreeDbKey=writable(null),cloudSigninTokenHolder=writableSettingsValue(null,"cloudSigninTokenHolder"),cloudConnectionsStore=writable({}),DEFAULT_OBJECT_SEARCH_SETTINGS={pureName:!0,schemaName:!1,columnName:!1,columnDataType:!1,tableComment:!0,columnComment:!1,sqlObjectText:!1,tableEngine:!1},DEFAULT_CONNECTION_SEARCH_SETTINGS={displayName:!0,server:!0,user:!1,engine:!1,database:!0},databaseObjectAppObjectSearchSettings=writableWithStorage(DEFAULT_OBJECT_SEARCH_SETTINGS,"databaseObjectAppObjectSearchSettings2"),connectionAppObjectSearchSettings=writableWithStorage(DEFAULT_CONNECTION_SEARCH_SETTINGS,"connectionAppObjectSearchSettings2");let currentThemeValue=null;currentTheme.subscribe((e=>{currentThemeValue=e}));const getCurrentTheme=()=>currentThemeValue,currentThemeDefinition=derived([currentTheme,extensions,systemThemeStore],(([e,t,n])=>{var o;const r=null!=e?e:n;return null===(o=null==t?void 0:t.themes)||void 0===o?void 0:o.find((e=>e.themeClassName==r))}));currentThemeDefinition.subscribe((e=>{(null==e?void 0:e.themeType)&&getCurrentTheme()?localStorage.setItem("currentThemeType",null==e?void 0:e.themeType):localStorage.removeItem("currentThemeType")}));const openedConnectionsWithTemporary=derived([openedConnections,temporaryOpenedConnections,openedSingleDatabaseConnections],(([e,t,n])=>_.uniq([...e,...t.map((e=>e.conid)),...n])));let nativeMenuOnStartup=null;const visibleTitleBar=derived(useSettings(),(e=>!!getElectron()&&(!!e&&(null==nativeMenuOnStartup&&(nativeMenuOnStartup=!!e["app.useNativeMenu"]),!e["app.fullscreen"]&&!nativeMenuOnStartup)))),alignDataGridNumbersToRight=derived(useSettings(),(e=>!!(null==e?void 0:e["dataGrid.alignNumbersRight"]))),visibleHamburgerMenuWidget=derived(useSettings(),(e=>!getElectron()||!!e&&!!e["app.fullscreen"]));subscribeCssVariable(visibleSelectedWidget,(e=>e?1:0),"--dim-visible-left-panel"),subscribeCssVariable(leftPanelWidth,(e=>`${e}px`),"--dim-left-panel-width"),subscribeCssVariable(visibleTitleBar,(e=>e?1:0),"--dim-visible-titlebar"),subscribeCssVariable(lockedDatabaseMode,(e=>e?0:1),"--dim-visible-tabs-databases"),subscribeCssVariable(alignDataGridNumbersToRight,(e=>e?"right":"left"),"--data-grid-numbers-align");let activeTabIdValue=null;activeTabId.subscribe((e=>{activeTabIdValue=e,invalidateCommands()}));const getActiveTabId=()=>activeTabIdValue;let visibleCommandPaletteValue=null;visibleCommandPalette.subscribe((e=>{visibleCommandPaletteValue=e,invalidateCommands()}));const getVisibleCommandPalette=()=>visibleCommandPaletteValue;let visibleToolbarValue=null;visibleToolbar.subscribe((e=>{visibleToolbarValue=e,invalidateCommands()}));const getVisibleToolbar=()=>visibleToolbarValue;let openedTabsValue=null;openedTabs.subscribe((e=>{openedTabsValue=e,invalidateCommands()}));const getOpenedTabs=()=>openedTabsValue;let commandsValue=null;commands.subscribe((e=>{commandsValue=e;const t=getElectron();t&&t.send("update-commands",JSON.stringify(e))}));const getCommands=()=>commandsValue;let activeTabValue=null;activeTab.subscribe((e=>{activeTabValue=e}));const getActiveTab=()=>activeTabValue;let currentConfigValue=null;const getCurrentConfig=()=>currentConfigValue;let recentDatabasesValue=null;recentDatabases.subscribe((e=>{recentDatabasesValue=e}));const getRecentDatabases=()=>_.compact(recentDatabasesValue);pinnedDatabases.subscribe((e=>{}));let lockedDatabaseModeValue=null;lockedDatabaseMode.subscribe((e=>{lockedDatabaseModeValue=e}));const getLockedDatabaseMode=()=>lockedDatabaseModeValue;let currentDatabaseValue=null;currentDatabase.subscribe((e=>{var t,n;currentDatabaseValue=e,(null===(t=null==e?void 0:e.connection)||void 0===t?void 0:t._id)&&((null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n.singleDatabase)?openedSingleDatabaseConnections.update((t=>{var n;return _.uniq([...t,null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n._id])})):(openedConnections.update((t=>{var n;return _.uniq([...t,null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n._id])})),expandedConnections.update((t=>{var n;return _.uniq([...t,null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n._id])})))),invalidateCommands()}));const getCurrentDatabase=()=>currentDatabaseValue;let currentSettingsValue=null;const getCurrentSettings=()=>currentSettingsValue||{};let extensionsValue=null;extensions.subscribe((e=>{extensionsValue=e}));const getExtensions=()=>extensionsValue;let openedConnectionsValue=null;openedConnections.subscribe((e=>{openedConnectionsValue=e}));const getOpenedConnections=()=>openedConnectionsValue;function subscribeApiDependendStores(){useSettings().subscribe((e=>{currentSettingsValue=e,commandsSettings.set((e||{}).commands||{}),invalidateCommands()})),useConfig().subscribe((e=>{currentConfigValue=e,invalidateCommands(),e.singleDbConnection&&switchCurrentDatabase(e.singleDbConnection)}))}let currentArchiveValue=null;currentArchive.subscribe((e=>{currentArchiveValue=e}));const getCurrentArchive=()=>currentArchiveValue;let appUpdaterActiveValue=!1;appUpdaterActive.subscribe((e=>{appUpdaterActiveValue=e}));const getAppUpdaterActive=()=>appUpdaterActiveValue;let appliedCurrentSchemaValue=null;appliedCurrentSchema.subscribe((e=>{appliedCurrentSchemaValue=e}));const getAppliedCurrentSchema=()=>appliedCurrentSchemaValue;let selectedDatabaseObjectAppObjectValue=null;selectedDatabaseObjectAppObject.subscribe((e=>{selectedDatabaseObjectAppObjectValue=e}));const getSelectedDatabaseObjectAppObject=()=>selectedDatabaseObjectAppObjectValue;let openedModalsValue=[];openedModals.subscribe((e=>{openedModalsValue=e}));const getOpenedModals=()=>openedModalsValue;let focusedConnectionOrDatabaseValue=null;focusedConnectionOrDatabase.subscribe((e=>{focusedConnectionOrDatabaseValue=e}));const getFocusedConnectionOrDatabase=()=>focusedConnectionOrDatabaseValue;let openedSingleDatabaseConnectionsValue=[];openedSingleDatabaseConnections.subscribe((e=>{openedSingleDatabaseConnectionsValue=e}));const getOpenedSingleDatabaseConnections=()=>openedSingleDatabaseConnectionsValue;let lastUsedDefaultActionsValue={};lastUsedDefaultActions.subscribe((e=>{lastUsedDefaultActionsValue=e}));const getLastUsedDefaultActions=()=>lastUsedDefaultActionsValue;let databaseObjectAppObjectSearchSettingsValue=Object.assign({},DEFAULT_OBJECT_SEARCH_SETTINGS);databaseObjectAppObjectSearchSettings.subscribe((e=>{databaseObjectAppObjectSearchSettingsValue=e}));const getDatabaseObjectAppObjectSearchSettings=()=>databaseObjectAppObjectSearchSettingsValue;let connectionAppObjectSearchSettingsValue=Object.assign({},DEFAULT_CONNECTION_SEARCH_SETTINGS);connectionAppObjectSearchSettings.subscribe((e=>{connectionAppObjectSearchSettingsValue=e}));const getConnectionAppObjectSearchSettings=()=>connectionAppObjectSearchSettingsValue;let focusedTreeDbKeyValue=null;focusedTreeDbKey.subscribe((e=>{focusedTreeDbKeyValue=e}));const getFocusedTreeDbKey=()=>focusedTreeDbKeyValue;let cloudConnectionsStoreValue={};cloudConnectionsStore.subscribe((e=>{cloudConnectionsStoreValue=e}));const getCloudConnectionsStore=()=>cloudConnectionsStoreValue,currentActiveCloudTags=derived(currentDatabase,(e=>{var t;if(!e||!e.connection)return[];const n=null===(t=e.connection)||void 0===t?void 0:t.engine,[o,r]=n.split("@"),i=[o],a=[...i];return i.includes("mariadb")&&a.push("mysql"),i.includes("mysql")&&a.push("mariadb"),i.includes("cockroach")&&a.push("postgres"),i.includes("libsql")&&a.push("sqlite"),a}));function sleep(e){return new Promise((t=>window.setTimeout((()=>t(null)),e)))}function changeTab(e,t){openedTabs.update((n=>n.map((n=>n.tabid==e?t(n):n))))}function markTabUnsaved(e){getOpenedTabs().find((t=>t.tabid==e)).unsaved||openedTabs.update((t=>t.map((t=>t.tabid==e?Object.assign(Object.assign({},t),{unsaved:!0,tabPreviewMode:!1}):t))))}function markTabSaved(e){openedTabs.update((t=>t.map((t=>t.tabid==e?Object.assign(Object.assign({},t),{unsaved:!1}):t))))}function setSelectedTabFunc(e,t,n={}){return[...(e||[]).filter((e=>e.tabid!=t)).map((e=>Object.assign(Object.assign({},e),{selected:!1,focused:!1}))),...(e||[]).filter((e=>e.tabid==t)).map((e=>Object.assign(Object.assign(Object.assign({},e),{selected:!0,focused:!1}),n)))]}function setSelectedTab(e){openedTabs.update((t=>setSelectedTabFunc(t,e)))}function getObjectTypeFieldLabel(e,t){var n;return"matviews"==e?"Materialized Views":"collections"==e?null!==(n=_.startCase(null==t?void 0:t.collectionPluralLabel))&&void 0!==n?n:"Collections/Containers":_.startCase(e)}function isMac(){var e;return((null===navigator||void 0===navigator?void 0:navigator.platform)||(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||"unknown").toUpperCase().indexOf("MAC")>=0}function formatKeyText(e){return isMac()?e.replace(/CtrlOrCommand\+/g,"⌘ ").replace(/Shift\+/g,"⇧ ").replace(/Alt\+/g,"⌥ ").replace(/Command\+/g,"⌘ ").replace(/Ctrl\+/g,"⌃ ").replace(/Backspace/g,"⌫ "):e.replace(/CtrlOrCommand\+/g,"Ctrl+")}function resolveKeyText(e){return isMac()?e.replace(/CtrlOrCommand\+/g,"Command+"):e.replace(/CtrlOrCommand\+/g,"Ctrl+")}function isCtrlOrCommandKey(e){return isMac()?e.metaKey:e.ctrlKey}function loadSchemaList(e,t){return __awaiter$h(this,void 0,void 0,(function*(){try{loadingSchemaLists.update((n=>Object.assign(Object.assign({},n),{[`${e}::${t}`]:!0})));const n=yield getSchemaList({conid:e,database:t});return n.errorMessage?(showSnackbarError(`Error loading schemas: ${n.errorMessage}`),void console.error("Error loading schemas",n.errorMessage)):n}finally{loadingSchemaLists.update((n=>_.omit(n,[`${e}::${t}`])))}}))}function switchCurrentDatabase(e){var t;return __awaiter$h(this,void 0,void 0,(function*(){if((null===(t=null==e?void 0:e.connection)||void 0===t?void 0:t.useSeparateSchemas)&&!lib$5.isCompositeDbName(e.name)){const t=e.connection._id,n=e.name,o=`selected-schema-${t}-${n}`,r=localStorage.getItem(o),i=yield loadSchemaList(t,n);if(!i)return;const a=lib$5.findEngineDriver(e.connection,getExtensions()),s=lib$5.findDefaultSchema(i,null==a?void 0:a.dialect,r);currentDatabase.set(Object.assign(Object.assign({},e),{name:`${e.name}::${s}`}))}else currentDatabase.set(e)}))}function getKeyTextFromEvent(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.metaKey&&(t+="Command+"),e.shiftKey&&(t+="Shift+"),e.altKey&&(t+="Alt+"),t+=e.key,t}function create_fragment$5K(e){let t,n;return{c:noop$2,m(e,o){t||(n=listen(window,"keydown",handleCommandKeyDown),t=!0)},p:noop$2,i:noop$2,o:noop$2,d(e){t=!1,n()}}}function handleCommandKeyDown(e){const t=getKeyTextFromEvent(e),n=get_store_value(commandsCustomized);let o=Object.values(n).filter((e=>e.keyText&&resolveKeyText(e.keyText).toLowerCase().split("|").map((e=>e.trim())).includes(t.toLowerCase())&&(null==e.disableHandleKeyText||!resolveKeyText(e.disableHandleKeyText).toLowerCase().split("|").map((e=>e.trim())).includes(t.toLowerCase()))));if(o.length>0&&o.find((e=>!e.systemCommand))&&(e.preventDefault(),e.stopPropagation()),o.length>1&&o.find((e=>e.systemCommand))&&o.find((e=>!e.systemCommand))&&(o=o.filter((e=>!e.systemCommand))),o.every((e=>e.systemCommand)))return;const r=o.filter((e=>e.enabled&&!e.isGroupCommand));if(r.length>1&&console.log("Warning, multiple commands mapped to",t,r),1==r.length){const e=r[0];return void(e.onClick?e.onClick():e.getSubCommands&&visibleCommandPalette.set(e))}const i=o.filter((e=>e.enabled&&e.isGroupCommand));if(i.length>1&&console.log("Warning, multiple commands mapped to",t,i),1==i.length){runGroupCommand(i[0].group)}}window.__changeCurrentTheme=e=>currentTheme.set(e);class CommandListener extends SvelteComponent{constructor(e){super(),init(this,e,null,create_fragment$5K,safe_not_equal,{})}}var MapShim=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,o){return e[0]===t&&(n=o,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(t,n){var o=e(this.__entries__,t);~o?this.__entries__[o][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,o=e(n,t);~o&&n.splice(o,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,o=this.__entries__;n<o.length;n++){var r=o[n];e.call(t,r[1],r[0])}},t}()}(),isBrowser="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,global$1="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),requestAnimationFrame$1="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(global$1):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},trailingTimeout=2;function throttle(e,t){var n=!1,o=!1,r=0;function i(){n&&(n=!1,e()),o&&s()}function a(){requestAnimationFrame$1(i)}function s(){var e=Date.now();if(n){if(e-r<trailingTimeout)return;o=!0}else n=!0,o=!1,setTimeout(a,t);r=e}return s}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported="undefined"!=typeof MutationObserver,ResizeObserverController=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){isBrowser&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){isBrowser&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,o=transitionKeys.some((function(e){return!!~n.indexOf(e)}));o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),defineConfigurable=function(e,t){for(var n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},getWindowOf=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+toFloat(e["border-"+n+"-width"])}),0)}function getPaddings(e){for(var t={},n=0,o=["top","right","bottom","left"];n<o.length;n++){var r=o[n],i=e["padding-"+r];t[r]=toFloat(i)}return t}function getSVGContentRect(e){var t=e.getBBox();return createRectInit(0,0,t.width,t.height)}function getHTMLElementContentRect(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return emptyRect;var o=getWindowOf(e).getComputedStyle(e),r=getPaddings(o),i=r.left+r.right,a=r.top+r.bottom,s=toFloat(o.width),c=toFloat(o.height);if("border-box"===o.boxSizing&&(Math.round(s+i)!==t&&(s-=getBordersSize(o,"left","right")+i),Math.round(c+a)!==n&&(c-=getBordersSize(o,"top","bottom")+a)),!isDocumentElement(e)){var l=Math.round(s+i)-t,u=Math.round(c+a)-n;1!==Math.abs(l)&&(s-=l),1!==Math.abs(u)&&(c-=u)}return createRectInit(r.left,r.top,s,c)}var isSVGGraphicsElement="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof getWindowOf(e).SVGGraphicsElement}:function(e){return e instanceof getWindowOf(e).SVGElement&&"function"==typeof e.getBBox};function isDocumentElement(e){return e===getWindowOf(e).document.documentElement}function getContentRect(e){return isBrowser?isSVGGraphicsElement(e)?getSVGContentRect(e):getHTMLElementContentRect(e):emptyRect}function createReadOnlyRect(e){var t=e.x,n=e.y,o=e.width,r=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(i.prototype);return defineConfigurable(a,{x:t,y:n,width:o,height:r,top:n,right:t+o,bottom:r+n,left:t}),a}function createRectInit(e,t,n,o){return{x:e,y:t,width:n,height:o}}var ResizeObservation=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=getContentRect(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),ResizeObserverEntry=function(e,t){var n=createReadOnlyRect(t);defineConfigurable(this,{target:e,contentRect:n})},ResizeObserverSPI=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new MapShim,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new ResizeObservation(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new ResizeObserverEntry(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),observers="undefined"!=typeof WeakMap?new WeakMap:new MapShim,ResizeObserver$1=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ResizeObserverController.getInstance(),o=new ResizeObserverSPI(t,n,this);observers.set(this,o)};["observe","unobserve","disconnect"].forEach((function(e){ResizeObserver$1.prototype[e]=function(){var t;return(t=observers.get(this))[e].apply(t,arguments)}}));var index=void 0!==global$1.ResizeObserver?global$1.ResizeObserver:ResizeObserver$1;function resizeObserver(e,t){const n=()=>{const t=e.getBoundingClientRect();e.dispatchEvent(new CustomEvent("resize",{detail:{width:t.width,height:t.height}}))};let o=null;function r(){t&&!o&&(o=new index((()=>{n()})),o.observe(e)),!t&&o&&(o.disconnect(),o=null)}return r(),t&&n(),{destroy(){o&&(o.disconnect(),o=null)},update(e){t=e,r()}}}function create_default_slot$24(e){let t,n;return t=new FontIcon({props:{icon:"icon chevron-down"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5J(e){let t,n,o,r,i,a,s,c,l;return a=new InlineButton({props:{square:!0,$$slots:{default:[create_default_slot$24]},$$scope:{ctx:e}}}),{c(){t=element("div"),n=element("table"),o=element("tr"),r=element("td"),i=text$1("title\n "),create_component(a.$$.fragment),attr(r,"class","svelte-pa7e1d"),attr(t,"class","svelte-pa7e1d")},m(u,d){insert(u,t,d),append(t,n),append(n,o),append(o,r),append(r,i),mount_component(a,r,null),s=!0,c||(l=[action_destroyer(resizeObserver.call(null,r,!0)),listen(r,"resize",e[1])],c=!0)},p(e,[t]){const n={};4&t&&(n.$$scope={dirty:t,ctx:e}),a.$set(n)},i(e){s||(transition_in(a.$$.fragment,e),s=!0)},o(e){transition_out(a.$$.fragment,e),s=!1},d(e){e&&detach(t),destroy_component(a),c=!1,run_all(l)}}}const dataGridRowHeight=writable(0);function instance$5E(e,t,n){let o,r=noop$2;component_subscribe(e,dataGridRowHeight,(e=>n(0,o=e))),e.$$.on_destroy.push((()=>r()));return e.$$.update=()=>{1&e.$$.dirty&&console.log("dataGridRowHeight",o)},[o,e=>{set_store_value(dataGridRowHeight,o=e.detail.height+1,o)}]}class DataGridRowHeightMeter extends SvelteComponent{constructor(e){super(),init(this,e,instance$5E,create_fragment$5J,safe_not_equal,{})}}function create_else_block$17(e){let t,n,o,r,i,a;return o=new FontIcon({props:{icon:"icon loading"}}),{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=text$1(e[0]),attr(n,"class","spinner svelte-1s05410"),attr(t,"class","container svelte-1s05410")},m(e,s){insert(e,t,s),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),a=!0},p(e,t){(!a||1&t)&&set_data(i,e[0])},i(e){a||(transition_in(o.$$.fragment,e),a=!0)},o(e){transition_out(o.$$.fragment,e),a=!1},d(e){e&&detach(t),destroy_component(o)}}}function create_if_block$2p(e){let t,n,o,r,i,a,s,c;return i=new FontIcon({props:{icon:"icon loading"}}),{c(){t=element("div"),n=element("div"),o=element("div"),r=element("div"),create_component(i.$$.fragment),a=space(),s=text$1(e[0]),attr(r,"class","spinner svelte-1s05410"),attr(o,"class","container svelte-1s05410"),attr(n,"class","box svelte-1s05410"),attr(t,"class","wrapper svelte-1s05410")},m(e,l){insert(e,t,l),append(t,n),append(n,o),append(o,r),mount_component(i,r,null),append(o,a),append(o,s),c=!0},p(e,t){(!c||1&t)&&set_data(s,e[0])},i(e){c||(transition_in(i.$$.fragment,e),c=!0)},o(e){transition_out(i.$$.fragment,e),c=!1},d(e){e&&detach(t),destroy_component(i)}}}function create_fragment$5I(e){let t,n,o,r;const i=[create_if_block$2p,create_else_block$17],a=[];function s(e,t){return e[1]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,[r]){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function instance$5D(e,t,n){let{message:o}=t,{wrapper:r=!1}=t;return e.$$set=e=>{"message"in e&&n(0,o=e.message),"wrapper"in e&&n(1,r=e.wrapper)},[o,r]}class LoadingInfo extends SvelteComponent{constructor(e){super(),init(this,e,instance$5D,create_fragment$5I,safe_not_equal,{message:0,wrapper:1})}}const jsonlFormat={storageType:"jsonl",extension:"jsonl",extensions:["jsonl","ndjson"],name:"JSON lines/NDJSON",readerFunc:"jsonLinesReader",writerFunc:"jsonLinesWriter"},jsonFormat={storageType:"json",extension:"json",name:"JSON",readerFunc:"jsonReader",writerFunc:"jsonWriter",args:[{type:"select",name:"jsonStyle",label:"JSON style",options:[{name:"Array",value:""},{name:"Object",value:"object"}],apiName:"jsonStyle"},{type:"text",name:"keyField",label:'Key field (only for "Object" style)',apiName:"keyField"},{type:"text",name:"rootField",label:"Root field",apiName:"rootField"}]},sqlFormat={storageType:"sql",extension:"sql",name:"SQL",writerFunc:"sqlDataWriter"},jsonlQuickExport={label:"JSON lines/NDJSON",extension:"jsonl",createWriter:e=>({functionName:"jsonLinesWriter",props:{fileName:e}})},jsonQuickExport={label:"JSON",extension:"json",createWriter:e=>({functionName:"jsonWriter",props:{fileName:e}})},sqlQuickExport={label:"SQL",extension:"sql",createWriter:(e,t)=>({functionName:"sqlDataWriter",props:{fileName:e,dataName:t}})};function buildFileFormats(e){const t=[jsonlFormat,jsonFormat,sqlFormat];for(const{content:n}of e){const{fileFormats:e}=n;e&&t.push(...e)}return t}function buildQuickExports(e){const t=[jsonQuickExport,jsonlQuickExport,sqlQuickExport];for(const{content:n}of e)n.quickExports&&t.push(...n.quickExports);return t}function findFileFormat(e,t){return e.fileFormats.find((e=>e.storageType==t))}function getFileFormatDirections(e){if(!e)return[];const t=[];return e.readerFunc&&t.push("source"),e.writerFunc&&t.push("target"),t}function getDefaultFileFormat(e){return e.fileFormats.find((e=>"csv"==e.storageType))||jsonlFormat}const themeClassName$1="theme-light",themeName$1="Light",themeType$1="light";class ThemeLight extends SvelteComponent{constructor(e){super(),init(this,e,null,null,safe_not_equal,{})}}var light=Object.freeze({__proto__:null,default:ThemeLight,themeClassName:themeClassName$1,themeName:themeName$1,themeType:themeType$1});const themeClassName="theme-dark",themeName="Dark",themeType="dark";class ThemeDark extends SvelteComponent{constructor(e){super(),init(this,e,null,null,safe_not_equal,{})}}var dark=Object.freeze({__proto__:null,default:ThemeDark,themeClassName:themeClassName,themeName:themeName,themeType:themeType});function buildThemes(e){const t=[light,dark];for(const{content:n}of e){const{themes:e}=n;e&&t.push(...e)}return t}var __awaiter$g=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};function loadPlugins(pluginsDict,installedPlugins){return __awaiter$g(this,void 0,void 0,(function*(){window.DBGATE_PACKAGES={"dbgate-tools":dbgateTools,"dbgate-sqltree":sqlTree},window.DBGATE_TOOLS=dbgateTools;const newPlugins={};for(const installed of installedPlugins||[])if(!_.keys(pluginsDict).includes(installed.name)){console.log("Loading module",installed.name),loadingPluginStore.set({loaded:!1,loadingPackageName:installed.name});const resp=yield apiCall("plugins/script",{packageName:installed.name}),module=eval(`${resp}; plugin`);console.log("Loaded plugin",module);const moduleContent=module.__esModule?module.default:module;newPlugins[installed.name]=moduleContent}return installedPlugins&&loadingPluginStore.set({loaded:!0,loadingPackageName:null}),newPlugins}))}function buildDrivers(e){const t=[];for(const{content:n}of e)n.drivers&&t.push(...n.drivers);return t}function filterByEdition(e){return e.filter((e=>!e.premiumOnly||isProApp()))}function buildExtensions(e){return{plugins:e,fileFormats:filterByEdition(buildFileFormats(e)),themes:filterByEdition(buildThemes(e)),drivers:filterByEdition(buildDrivers(e)),quickExports:filterByEdition(buildQuickExports(e))}}function instance$5C(e,t,n){let o,r,i;component_subscribe(e,extensions,(e=>n(4,r=e))),this&&this.__awaiter;let a={};const s=useInstalledPlugins();return component_subscribe(e,s,(e=>n(3,i=e))),e.$$.update=()=>{10&e.$$.dirty&&loadPlugins(a,i).then((e=>{_.isEmpty(e)||n(1,a=_.pick(Object.assign(Object.assign({},a),e),i.map((e=>e.name))))})),10&e.$$.dirty&&n(2,o=(i||[]).map((e=>({packageName:e.name,manifest:e,content:a[e.name]}))).filter((e=>e.content))),4&e.$$.dirty&&set_store_value(extensions,r=buildExtensions(o),r)},[s,a,o,i]}class PluginsProvider extends SvelteComponent{constructor(e){super(),init(this,e,instance$5C,null,safe_not_equal,{})}}var lib$1={},GridDisplay$1={},GridConfig={};function createGridConfig(){return{hiddenColumns:[],expandedColumns:[],addedColumns:[],filters:{},columnWidths:{},sort:[],focusedColumns:null,grouping:{},formFilterColumns:[]}}function createGridCache(){return{refreshTime:(new Date).getTime()}}Object.defineProperty(GridConfig,"__esModule",{value:!0}),GridConfig.createGridCache=GridConfig.createGridConfig=void 0,GridConfig.createGridConfig=createGridConfig,GridConfig.createGridCache=createGridCache;var lib={},parseFilter$1={},parsimmon_umd_min={exports:{}};!function(e,t){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function o(e){if(!(this instanceof o))return new o(e);this._=e}var r=o.prototype;function i(e,t){for(var n=0;n<e;n++)t(n)}function a(e,t,n){return function(e,t){i(t.length,(function(n){e(t[n],n,t)}))}((function(n,o,r){t=e(t,n,o,r)}),n),t}function s(e,t){return a((function(t,n,o,r){return t.concat([e(n,o,r)])}),[],t)}function c(e,t){var n={v:0,buf:t};return i(e,(function(){var e;n={v:n.v<<1|(e=n.buf,e[0]>>7),buf:function(e){var t=a((function(e,t,n,o){return e.concat(n===o.length-1?Buffer.from([t,0]).readUInt16BE(0):o.readUInt16BE(n))}),[],e);return Buffer.from(s((function(e){return(e<<1&65535)>>8}),t))}(n.buf)}})),n}function l(){return"undefined"!=typeof Buffer}function u(){if(!l())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function d(e){u();var t=a((function(e,t){return e+t}),0,e);if(t%8!=0)throw new Error("The bits ["+e.join(", ")+"] add up to "+t+" which is not an even number of bytes; the total should be divisible by 8");var n,r=t/8,i=(n=function(e){return e>48},a((function(e,t){return e||(n(t)?t:e)}),null,e));if(i)throw new Error(i+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o((function(t,n){var o=r+n;return o>t.length?x(n,r.toString()+" bytes"):v(o,a((function(e,t){var n=c(t,e.buf);return{coll:e.coll.concat(n.v),buf:n.buf}}),{coll:[],buf:t.slice(n,o)},e).coll)}))}function p(e,t){return new o((function(n,o){return u(),o+t>n.length?x(o,t+" bytes for "+e):v(o+t,n.slice(o,o+t))}))}function m(e,t){if("number"!=typeof(n=t)||Math.floor(n)!==n||t<0||t>6)throw new Error(e+" requires integer length in range [0, 6].");var n}function f(e){return m("uintBE",e),p("uintBE("+e+")",e).map((function(t){return t.readUIntBE(0,e)}))}function h(e){return m("uintLE",e),p("uintLE("+e+")",e).map((function(t){return t.readUIntLE(0,e)}))}function g(e){return m("intBE",e),p("intBE("+e+")",e).map((function(t){return t.readIntBE(0,e)}))}function _(e){return m("intLE",e),p("intLE("+e+")",e).map((function(t){return t.readIntLE(0,e)}))}function $(e){return e instanceof o}function b(e){return"[object Array]"==={}.toString.call(e)}function y(e){return l()&&Buffer.isBuffer(e)}function v(e,t){return{status:!0,index:e,value:t,furthest:-1,expected:[]}}function x(e,t){return b(t)||(t=[t]),{status:!1,index:-1,value:null,furthest:e,expected:t}}function w(e,t){if(!t)return e;if(e.furthest>t.furthest)return e;var n=e.furthest===t.furthest?function(e,t){if(function(){if(void 0!==o._supportsSet)return o._supportsSet;var e="undefined"!=typeof Set;return o._supportsSet=e,e}()&&Array.from){for(var n=new Set(e),r=0;r<t.length;r++)n.add(t[r]);var i=Array.from(n);return i.sort(),i}for(var a={},s=0;s<e.length;s++)a[e[s]]=!0;for(var c=0;c<t.length;c++)a[t[c]]=!0;var l=[];for(var u in a)({}).hasOwnProperty.call(a,u)&&l.push(u);return l.sort(),l}(e.expected,t.expected):t.expected;return{status:e.status,index:e.index,value:e.value,furthest:t.furthest,expected:n}}var C={};function k(e,t){if(y(e))return{offset:t,line:-1,column:-1};e in C||(C[e]={});for(var n=C[e],o=0,r=0,i=0,a=t;a>=0;){if(a in n){o=n[a].line,0===i&&(i=n[a].lineStart);break}("\n"===e.charAt(a)||"\r"===e.charAt(a)&&"\n"!==e.charAt(a+1))&&(r++,0===i&&(i=a+1)),a--}var s=o+r,c=t-i;return n[t]={line:s,lineStart:i},{offset:t,line:s+1,column:c+1}}function S(e){if(!$(e))throw new Error("not a parser: "+e)}function T(e,t){return"string"==typeof e?e.charAt(t):e[t]}function E(e){if("number"!=typeof e)throw new Error("not a number: "+e)}function A(e){if("function"!=typeof e)throw new Error("not a function: "+e)}function O(e){if("string"!=typeof e)throw new Error("not a string: "+e)}var N=2,I=3,D=8,M=5*D,R=4*D,L=" ";function F(e,t){return new Array(t+1).join(e)}function P(e,t,n){var o=t-e.length;return o<=0?e:F(n,o)+e}function j(e,t,n,o){return{from:e-t>0?e-t:0,to:e+n>o?o:e+n}}function B(e,t){var n,o,r,i,c,l=t.index,u=l.offset,d=1;if(u===e.length)return"Got the end of the input";if(y(e)){var p=u-u%D,m=u-p,f=j(p,M,R+D,e.length),h=s((function(e){return s((function(e){return P(e.toString(16),2,"0")}),e)}),function(e,t){var n=e.length,o=[],r=0;if(n<=t)return[e.slice()];for(var i=0;i<n;i++)o[r]||o.push([]),o[r].push(e[i]),(i+1)%t==0&&r++;return o}(e.slice(f.from,f.to).toJSON().data,D));i=function(e){return 0===e.from&&1===e.to?{from:e.from,to:e.to}:{from:e.from/D,to:Math.floor(e.to/D)}}(f),o=p/D,n=3*m,m>=4&&(n+=1),d=2,r=s((function(e){return e.length<=4?e.join(" "):e.slice(0,4).join(" ")+" "+e.slice(4).join(" ")}),h),(c=(8*(i.to>0?i.to-1:i.to)).toString(16).length)<2&&(c=2)}else{var g=e.split(/\r\n|[\n\r\u2028\u2029]/);n=l.column-1,o=l.line-1,i=j(o,N,I,g.length),r=g.slice(i.from,i.to),c=i.to.toString().length}var _=o-i.from;return y(e)&&(c=(8*(i.to>0?i.to-1:i.to)).toString(16).length)<2&&(c=2),a((function(t,o,r){var a,s=r===_,l=s?"> ":L;return a=y(e)?P((8*(i.from+r)).toString(16),c,"0"):P((i.from+r+1).toString(),c," "),[].concat(t,[l+a+" | "+o],s?[L+F(" ",c)+" | "+P("",n," ")+F("^",d)]:[])}),[],r).join("\n")}function q(e,t){return["\n","-- PARSING FAILED "+F("-",50),"\n\n",B(e,t),"\n\n",(n=t.expected,1===n.length?"Expected:\n\n"+n[0]:"Expected one of the following: \n\n"+n.join(", ")),"\n"].join("");var n}function W(e){return void 0!==e.flags?e.flags:[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.unicode?"u":"",e.sticky?"y":""].join("")}function z(){for(var e=[].slice.call(arguments),t=e.length,n=0;n<t;n+=1)S(e[n]);return o((function(n,o){for(var r,i=new Array(t),a=0;a<t;a+=1){if(!(r=w(e[a]._(n,o),r)).status)return r;i[a]=r.value,o=r.index}return w(v(o,i),r)}))}function U(){var e=[].slice.call(arguments);if(0===e.length)throw new Error("seqMap needs at least one argument");var t=e.pop();return A(t),z.apply(null,e).map((function(e){return t.apply(null,e)}))}function H(){var e=[].slice.call(arguments),t=e.length;if(0===t)return Z("zero alternates");for(var n=0;n<t;n+=1)S(e[n]);return o((function(t,n){for(var o,r=0;r<e.length;r+=1)if((o=w(e[r]._(t,n),o)).status)return o;return o}))}function V(e,t){return G(e,t).or(Q([]))}function G(e,t){return S(e),S(t),U(e,t.then(e).many(),(function(e,t){return[e].concat(t)}))}function K(e){O(e);var t="'"+e+"'";return o((function(n,o){var r=o+e.length,i=n.slice(o,r);return i===e?v(r,i):x(o,t)}))}function Y(e,t){!function(e){if(!(e instanceof RegExp))throw new Error("not a regexp: "+e);for(var t=W(e),n=0;n<t.length;n++){var o=t.charAt(n);if("i"!==o&&"m"!==o&&"u"!==o&&"s"!==o)throw new Error('unsupported regexp flag "'+o+'": '+e)}}(e),arguments.length>=2?E(t):t=0;var n=function(e){return RegExp("^(?:"+e.source+")",W(e))}(e),r=""+e;return o((function(e,o){var i=n.exec(e.slice(o));if(i){if(0<=t&&t<=i.length){var a=i[0],s=i[t];return v(o+a.length,s)}return x(o,"valid match group (0 to "+i.length+") in "+r)}return x(o,r)}))}function Q(e){return o((function(t,n){return v(n,e)}))}function Z(e){return o((function(t,n){return x(n,e)}))}function J(e){if($(e))return o((function(t,n){var o=e._(t,n);return o.index=n,o.value="",o}));if("string"==typeof e)return J(K(e));if(e instanceof RegExp)return J(Y(e));throw new Error("not a string, regexp, or parser: "+e)}function X(e){return S(e),o((function(t,n){var o=e._(t,n),r=t.slice(n,o.index);return o.status?x(n,'not "'+r+'"'):v(n,null)}))}function ee(e){return A(e),o((function(t,n){var o=T(t,n);return n<t.length&&e(o)?v(n+1,o):x(n,"a character/byte matching "+e)}))}function te(e,t){arguments.length<2&&(t=e,e=void 0);var n=o((function(e,o){return n._=t()._,n._(e,o)}));return e?n.desc(e):n}function ne(){return Z("fantasy-land/empty")}r.parse=function(e){if("string"!=typeof e&&!y(e))throw new Error(".parse must be called with a string or Buffer as its argument");var t,n=this.skip(ae)._(e,0);return t=n.status?{status:!0,value:n.value}:{status:!1,index:k(e,n.furthest),expected:n.expected},delete C[e],t},r.tryParse=function(e){var t=this.parse(e);if(t.status)return t.value;var n=q(e,t),o=new Error(n);throw o.type="ParsimmonError",o.result=t,o},r.assert=function(e,t){return this.chain((function(n){return e(n)?Q(n):Z(t)}))},r.or=function(e){return H(this,e)},r.trim=function(e){return this.wrap(e,e)},r.wrap=function(e,t){return U(e,this,t,(function(e,t){return t}))},r.thru=function(e){return e(this)},r.then=function(e){return S(e),z(this,e).map((function(e){return e[1]}))},r.many=function(){var e=this;return o((function(t,n){for(var o=[],r=void 0;;){if(!(r=w(e._(t,n),r)).status)return w(v(n,o),r);if(n===r.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");n=r.index,o.push(r.value)}}))},r.tieWith=function(e){return O(e),this.map((function(t){if(function(e){if(!b(e))throw new Error("not an array: "+e)}(t),t.length){O(t[0]);for(var n=t[0],o=1;o<t.length;o++)O(t[o]),n+=e+t[o];return n}return""}))},r.tie=function(){return this.tieWith("")},r.times=function(e,t){var n=this;return arguments.length<2&&(t=e),E(e),E(t),o((function(o,r){for(var i=[],a=void 0,s=void 0,c=0;c<e;c+=1){if(s=w(a=n._(o,r),s),!a.status)return s;r=a.index,i.push(a.value)}for(;c<t&&(s=w(a=n._(o,r),s),a.status);c+=1)r=a.index,i.push(a.value);return w(v(r,i),s)}))},r.result=function(e){return this.map((function(){return e}))},r.atMost=function(e){return this.times(0,e)},r.atLeast=function(e){return U(this.times(e),this.many(),(function(e,t){return e.concat(t)}))},r.map=function(e){A(e);var t=this;return o((function(n,o){var r=t._(n,o);return r.status?w(v(r.index,e(r.value)),r):r}))},r.contramap=function(e){A(e);var t=this;return o((function(n,o){var r=t.parse(e(n.slice(o)));return r.status?v(o+n.length,r.value):r}))},r.promap=function(e,t){return A(e),A(t),this.contramap(e).map(t)},r.skip=function(e){return z(this,e).map((function(e){return e[0]}))},r.mark=function(){return U(oe,this,oe,(function(e,t,n){return{start:e,value:t,end:n}}))},r.node=function(e){return U(oe,this,oe,(function(t,n,o){return{name:e,value:n,start:t,end:o}}))},r.sepBy=function(e){return V(this,e)},r.sepBy1=function(e){return G(this,e)},r.lookahead=function(e){return this.skip(J(e))},r.notFollowedBy=function(e){return this.skip(X(e))},r.desc=function(e){b(e)||(e=[e]);var t=this;return o((function(n,o){var r=t._(n,o);return r.status||(r.expected=e),r}))},r.fallback=function(e){return this.or(Q(e))},r.ap=function(e){return U(e,this,(function(e,t){return e(t)}))},r.chain=function(e){var t=this;return o((function(n,o){var r=t._(n,o);return r.status?w(e(r.value)._(n,r.index),r):r}))},r.concat=r.or,r.empty=ne,r.of=Q,r["fantasy-land/ap"]=r.ap,r["fantasy-land/chain"]=r.chain,r["fantasy-land/concat"]=r.concat,r["fantasy-land/empty"]=r.empty,r["fantasy-land/of"]=r.of,r["fantasy-land/map"]=r.map;var oe=o((function(e,t){return v(t,k(e,t))})),re=o((function(e,t){return t>=e.length?x(t,"any character/byte"):v(t+1,T(e,t))})),ie=o((function(e,t){return v(e.length,e.slice(t))})),ae=o((function(e,t){return t<e.length?x(t,"EOF"):v(t,null)})),se=Y(/[0-9]/).desc("a digit"),ce=Y(/[0-9]*/).desc("optional digits"),le=Y(/[a-z]/i).desc("a letter"),ue=Y(/[a-z]*/i).desc("optional letters"),de=Y(/\s*/).desc("optional whitespace"),pe=Y(/\s+/).desc("whitespace"),me=K("\r"),fe=K("\n"),he=K("\r\n"),ge=H(he,fe,me).desc("newline"),_e=H(ge,ae);o.all=ie,o.alt=H,o.any=re,o.cr=me,o.createLanguage=function(e){var t={};for(var n in e)({}).hasOwnProperty.call(e,n)&&function(n){t[n]=te((function(){return e[n](t)}))}(n);return t},o.crlf=he,o.custom=function(e){return o(e(v,x))},o.digit=se,o.digits=ce,o.empty=ne,o.end=_e,o.eof=ae,o.fail=Z,o.formatError=q,o.index=oe,o.isParser=$,o.lazy=te,o.letter=le,o.letters=ue,o.lf=fe,o.lookahead=J,o.makeFailure=x,o.makeSuccess=v,o.newline=ge,o.noneOf=function(e){return ee((function(t){return e.indexOf(t)<0})).desc("none of '"+e+"'")},o.notFollowedBy=X,o.of=Q,o.oneOf=function(e){for(var t=e.split(""),n=0;n<t.length;n++)t[n]="'"+t[n]+"'";return ee((function(t){return e.indexOf(t)>=0})).desc(t)},o.optWhitespace=de,o.Parser=o,o.range=function(e,t){return ee((function(n){return e<=n&&n<=t})).desc(e+"-"+t)},o.regex=Y,o.regexp=Y,o.sepBy=V,o.sepBy1=G,o.seq=z,o.seqMap=U,o.seqObj=function(){for(var e,t={},n=0,r=(e=arguments,Array.prototype.slice.call(e)),i=r.length,a=0;a<i;a+=1){var s=r[a];if(!$(s)){if(b(s)&&2===s.length&&"string"==typeof s[0]&&$(s[1])){var c=s[0];if(Object.prototype.hasOwnProperty.call(t,c))throw new Error("seqObj: duplicate key "+c);t[c]=!0,n++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(0===n)throw new Error("seqObj expects at least one named parser, found zero");return o((function(e,t){for(var n,o={},a=0;a<i;a+=1){var s,c;if(b(r[a])?(s=r[a][0],c=r[a][1]):(s=null,c=r[a]),!(n=w(c._(e,t),n)).status)return n;s&&(o[s]=n.value),t=n.index}return w(v(t,o),n)}))},o.string=K,o.succeed=Q,o.takeWhile=function(e){return A(e),o((function(t,n){for(var o=n;o<t.length&&e(T(t,o));)o++;return v(o,t.slice(n,o))}))},o.test=ee,o.whitespace=pe,o["fantasy-land/empty"]=ne,o["fantasy-land/of"]=Q,o.Binary={bitSeq:d,bitSeqObj:function(e){u();var t={},n=0,o=s((function(e){if(b(e)){var o=e;if(2!==o.length)throw new Error("["+o.join(", ")+"] should be length 2, got length "+o.length);if(O(o[0]),E(o[1]),Object.prototype.hasOwnProperty.call(t,o[0]))throw new Error("duplicate key in bitSeqObj: "+o[0]);return t[o[0]]=!0,n++,o}return E(e),[null,e]}),e);if(n<1)throw new Error("bitSeqObj expects at least one named pair, got ["+e.join(", ")+"]");var r=s((function(e){return e[0]}),o);return d(s((function(e){return e[1]}),o)).map((function(e){return a((function(e,t){return null!==t[0]&&(e[t[0]]=t[1]),e}),{},s((function(t,n){return[t,e[n]]}),r))}))},byte:function(e){if(u(),E(e),e>255)throw new Error("Value specified to byte constructor ("+e+"=0x"+e.toString(16)+") is larger in value than a single byte.");var t=(e>15?"0x":"0x0")+e.toString(16);return o((function(n,o){var r=T(n,o);return r===e?v(o+1,r):x(o,t)}))},buffer:function(e){return p("buffer",e).map((function(e){return Buffer.from(e)}))},encodedString:function(e,t){return p("string",t).map((function(t){return t.toString(e)}))},uintBE:f,uint8BE:f(1),uint16BE:f(2),uint32BE:f(4),uintLE:h,uint8LE:h(1),uint16LE:h(2),uint32LE:h(4),intBE:g,int8BE:g(1),int16BE:g(2),int32BE:g(4),intLE:_,int8LE:_(1),int16LE:_(2),int32LE:_(4),floatBE:p("floatBE",4).map((function(e){return e.readFloatBE(0)})),floatLE:p("floatLE",4).map((function(e){return e.readFloatLE(0)})),doubleBE:p("doubleBE",8).map((function(e){return e.readDoubleBE(0)})),doubleLE:p("doubleLE",8).map((function(e){return e.readDoubleLE(0)}))},e.exports=o}])}(parsimmon_umd_min);var moment$1={exports:{}};!function(e,t){e.exports=function(){var t,n;function o(){return t.apply(null,arguments)}function r(e){t=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var n,o=[],r=e.length;for(n=0;n<r;++n)o.push(t(e[n],n));return o}function m(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,n,o){return Kn(e,t,n,o,!0).utc()}function h(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(e){return null==e._pf&&(e._pf=h()),e._pf}function _(e){var t=null,o=!1,r=e._d&&!isNaN(e._d.getTime());return r&&(t=g(e),o=n.call(t.parsedDateParts,(function(e){return null!=e})),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o),e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?r:(e._isValid=r,e._isValid)}function $(e){var t=f(NaN);return null!=e?m(g(t),e):g(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),o=n.length>>>0;for(t=0;t<o;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var b=o.momentProperties=[],y=!1;function v(e,t){var n,o,r,i=b.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)l(r=t[o=b[n]])||(e[o]=r);return e}function x(e){v(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,o.updateOffset(this),y=!1)}function w(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function C(e){!1===o.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return m((function(){if(null!=o.deprecationHandler&&o.deprecationHandler(null,e),n){var r,i,a,c=[],l=arguments.length;for(i=0;i<l;i++){if(r="","object"==typeof arguments[i]){for(a in r+="\n["+i+"] ",arguments[0])s(arguments[0],a)&&(r+=a+": "+arguments[0][a]+", ");r=r.slice(0,-2)}else r=arguments[i];c.push(r)}C(e+"\nArguments: "+Array.prototype.slice.call(c).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var S,T={};function E(e,t){null!=o.deprecationHandler&&o.deprecationHandler(e,t),T[e]||(C(t),T[e]=!0)}function A(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e){var t,n;for(n in e)s(e,n)&&(A(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function N(e,t){var n,o=m({},e);for(n in t)s(t,n)&&(a(e[n])&&a(t[n])?(o[n]={},m(o[n],e[n]),m(o[n],t[n])):null!=t[n]?o[n]=t[n]:delete o[n]);for(n in e)s(e,n)&&!s(t,n)&&a(e[n])&&(o[n]=m({},o[n]));return o}function I(e){null!=e&&this.set(e)}o.suppressDeprecationWarnings=!1,o.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var D={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function M(e,t,n){var o=this._calendar[e]||this._calendar.sameElse;return A(o)?o.call(t,n):o}function R(e,t,n){var o=""+Math.abs(e),r=t-o.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},j={};function B(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(j[e]=r),t&&(j[t[0]]=function(){return R(r.apply(this,arguments),t[1],t[2])}),n&&(j[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function q(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(L);for(t=0,n=o.length;t<n;t++)j[o[t]]?o[t]=j[o[t]]:o[t]=q(o[t]);return function(t){var r,i="";for(r=0;r<n;r++)i+=A(o[r])?o[r].call(t,e):o[r];return i}}function z(e,t){return e.isValid()?(t=U(t,e.localeData()),P[t]=P[t]||W(t),P[t](e)):e.localeData().invalidDate()}function U(e,t){var n=5;function o(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,o),F.lastIndex=0,n-=1;return e}var H={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var G="Invalid date";function K(){return this._invalidDate}var Y="%d",Q=/\d{1,2}/;function Z(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function X(e,t,n,o){var r=this._relativeTime[n];return A(r)?r(e,t,n,o):r.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var te={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"==typeof e?te[e]||te[e.toLowerCase()]:void 0}function oe(e){var t,n,o={};for(n in e)s(e,n)&&(t=ne(n))&&(o[t]=e[n]);return o}var re={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ie(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:re[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}var ae,se=/\d/,ce=/\d\d/,le=/\d{3}/,ue=/\d{4}/,de=/[+-]?\d{6}/,pe=/\d\d?/,me=/\d\d\d\d?/,fe=/\d\d\d\d\d\d?/,he=/\d{1,3}/,ge=/\d{1,4}/,_e=/[+-]?\d{1,6}/,$e=/\d+/,be=/[+-]?\d+/,ye=/Z|[+-]\d\d:?\d\d/gi,ve=/Z|[+-]\d\d(?::?\d\d)?/gi,xe=/[+-]?\d+(\.\d{1,3})?/,we=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ce=/^[1-9]\d?/,ke=/^([1-9]\d|\d)/;function Se(e,t,n){ae[e]=A(t)?t:function(e,o){return e&&n?n:t}}function Te(e,t){return s(ae,e)?ae[e](t._strict,t._locale):new RegExp(Ee(e))}function Ee(e){return Ae(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,o,r){return t||n||o||r})))}function Ae(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Oe(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ne(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Oe(t)),n}ae={};var Ie={};function De(e,t){var n,o,r=t;for("string"==typeof e&&(e=[e]),u(t)&&(r=function(e,n){n[t]=Ne(e)}),o=e.length,n=0;n<o;n++)Ie[e[n]]=r}function Me(e,t){De(e,(function(e,n,o,r){o._w=o._w||{},t(e,o._w,o,r)}))}function Re(e,t,n){null!=t&&s(Ie,e)&&Ie[e](t,n._a,n,e)}function Le(e){return e%4==0&&e%100!=0||e%400==0}var Fe=0,Pe=1,je=2,Be=3,qe=4,We=5,ze=6,Ue=7,He=8;function Ve(e){return Le(e)?366:365}B("Y",0,0,(function(){var e=this.year();return e<=9999?R(e,4):"+"+e})),B(0,["YY",2],0,(function(){return this.year()%100})),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),Se("Y",be),Se("YY",pe,ce),Se("YYYY",ge,ue),Se("YYYYY",_e,de),Se("YYYYYY",_e,de),De(["YYYYY","YYYYYY"],Fe),De("YYYY",(function(e,t){t[Fe]=2===e.length?o.parseTwoDigitYear(e):Ne(e)})),De("YY",(function(e,t){t[Fe]=o.parseTwoDigitYear(e)})),De("Y",(function(e,t){t[Fe]=parseInt(e,10)})),o.parseTwoDigitYear=function(e){return Ne(e)+(Ne(e)>68?1900:2e3)};var Ge,Ke=Qe("FullYear",!0);function Ye(){return Le(this.year())}function Qe(e,t){return function(n){return null!=n?(Je(this,e,n),o.updateOffset(this,t),this):Ze(this,e)}}function Ze(e,t){if(!e.isValid())return NaN;var n=e._d,o=e._isUTC;switch(t){case"Milliseconds":return o?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return o?n.getUTCSeconds():n.getSeconds();case"Minutes":return o?n.getUTCMinutes():n.getMinutes();case"Hours":return o?n.getUTCHours():n.getHours();case"Date":return o?n.getUTCDate():n.getDate();case"Day":return o?n.getUTCDay():n.getDay();case"Month":return o?n.getUTCMonth():n.getMonth();case"FullYear":return o?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Je(e,t,n){var o,r,i,a,s;if(e.isValid()&&!isNaN(n)){switch(o=e._d,r=e._isUTC,t){case"Milliseconds":return void(r?o.setUTCMilliseconds(n):o.setMilliseconds(n));case"Seconds":return void(r?o.setUTCSeconds(n):o.setSeconds(n));case"Minutes":return void(r?o.setUTCMinutes(n):o.setMinutes(n));case"Hours":return void(r?o.setUTCHours(n):o.setHours(n));case"Date":return void(r?o.setUTCDate(n):o.setDate(n));case"FullYear":break;default:return}i=n,a=e.month(),s=29!==(s=e.date())||1!==a||Le(i)?s:28,r?o.setUTCFullYear(i,a,s):o.setFullYear(i,a,s)}}function Xe(e){return A(this[e=ne(e)])?this[e]():this}function et(e,t){if("object"==typeof e){var n,o=ie(e=oe(e)),r=o.length;for(n=0;n<r;n++)this[o[n].unit](e[o[n].unit])}else if(A(this[e=ne(e)]))return this[e](t);return this}function tt(e,t){return(e%t+t)%t}function nt(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=tt(t,12);return e+=(t-n)/12,1===n?Le(e)?29:28:31-n%7%2}Ge=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},B("M",["MM",2],"Mo",(function(){return this.month()+1})),B("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),B("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),Se("M",pe,Ce),Se("MM",pe,ce),Se("MMM",(function(e,t){return t.monthsShortRegex(e)})),Se("MMMM",(function(e,t){return t.monthsRegex(e)})),De(["M","MM"],(function(e,t){t[Pe]=Ne(e)-1})),De(["MMM","MMMM"],(function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[Pe]=r:g(n).invalidMonth=e}));var ot="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),rt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),it=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,at=we,st=we;function ct(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||it).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function lt(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[it.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ut(e,t,n){var o,r,i,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;o<12;++o)i=f([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=Ge.call(this._shortMonthsParse,a))?r:null:-1!==(r=Ge.call(this._longMonthsParse,a))?r:null:"MMM"===t?-1!==(r=Ge.call(this._shortMonthsParse,a))||-1!==(r=Ge.call(this._longMonthsParse,a))?r:null:-1!==(r=Ge.call(this._longMonthsParse,a))||-1!==(r=Ge.call(this._shortMonthsParse,a))?r:null}function dt(e,t,n){var o,r,i;if(this._monthsParseExact)return ut.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;o<12;o++){if(r=f([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function pt(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Ne(t);else if(!u(t=e.localeData().monthsParse(t)))return e;var n=t,o=e.date();return o=o<29?o:Math.min(o,nt(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,o):e._d.setMonth(n,o),e}function mt(e){return null!=e?(pt(this,e),o.updateOffset(this,!0),this):Ze(this,"Month")}function ft(){return nt(this.year(),this.month())}function ht(e){return this._monthsParseExact?(s(this,"_monthsRegex")||_t.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=at),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(e){return this._monthsParseExact?(s(this,"_monthsRegex")||_t.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=st),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function _t(){function e(e,t){return t.length-e.length}var t,n,o,r,i=[],a=[],s=[];for(t=0;t<12;t++)n=f([2e3,t]),o=Ae(this.monthsShort(n,"")),r=Ae(this.months(n,"")),i.push(o),a.push(r),s.push(r),s.push(o);i.sort(e),a.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function $t(e,t,n,o,r,i,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,o,r,i,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,o,r,i,a),s}function bt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function yt(e,t,n){var o=7+t-n;return-(7+bt(e,0,o).getUTCDay()-t)%7+o-1}function vt(e,t,n,o,r){var i,a,s=1+7*(t-1)+(7+n-o)%7+yt(e,o,r);return s<=0?a=Ve(i=e-1)+s:s>Ve(e)?(i=e+1,a=s-Ve(e)):(i=e,a=s),{year:i,dayOfYear:a}}function xt(e,t,n){var o,r,i=yt(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?o=a+wt(r=e.year()-1,t,n):a>wt(e.year(),t,n)?(o=a-wt(e.year(),t,n),r=e.year()+1):(r=e.year(),o=a),{week:o,year:r}}function wt(e,t,n){var o=yt(e,t,n),r=yt(e+1,t,n);return(Ve(e)-o+r)/7}function Ct(e){return xt(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),Se("w",pe,Ce),Se("ww",pe,ce),Se("W",pe,Ce),Se("WW",pe,ce),Me(["w","ww","W","WW"],(function(e,t,n,o){t[o.substr(0,1)]=Ne(e)}));var kt={dow:0,doy:6};function St(){return this._week.dow}function Tt(){return this._week.doy}function Et(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=xt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Ot(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Nt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function It(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),B("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),B("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),Se("d",pe),Se("e",pe),Se("E",pe),Se("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Se("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Se("dddd",(function(e,t){return t.weekdaysRegex(e)})),Me(["dd","ddd","dddd"],(function(e,t,n,o){var r=n._locale.weekdaysParse(e,o,n._strict);null!=r?t.d=r:g(n).invalidWeekday=e})),Me(["d","e","E"],(function(e,t,n,o){t[o]=Ne(e)}));var Dt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Mt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Lt=we,Ft=we,Pt=we;function jt(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?It(n,this._week.dow):e?n[e.day()]:n}function Bt(e){return!0===e?It(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function qt(e){return!0===e?It(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Wt(e,t,n){var o,r,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)i=f([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=Ge.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=Ge.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=Ge.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=Ge.call(this._weekdaysParse,a))||-1!==(r=Ge.call(this._shortWeekdaysParse,a))||-1!==(r=Ge.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=Ge.call(this._shortWeekdaysParse,a))||-1!==(r=Ge.call(this._weekdaysParse,a))||-1!==(r=Ge.call(this._minWeekdaysParse,a))?r:null:-1!==(r=Ge.call(this._minWeekdaysParse,a))||-1!==(r=Ge.call(this._weekdaysParse,a))||-1!==(r=Ge.call(this._shortWeekdaysParse,a))?r:null}function zt(e,t,n){var o,r,i;if(this._weekdaysParseExact)return Wt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(r=f([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[o]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(n&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(n&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!n&&this._weekdaysParse[o].test(e))return o}}function Ut(e){if(!this.isValid())return null!=e?this:NaN;var t=Ze(this,"Day");return null!=e?(e=Ot(e,this.localeData()),this.add(e-t,"d")):t}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Vt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Nt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Gt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Lt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Kt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ft),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Yt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Pt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qt(){function e(e,t){return t.length-e.length}var t,n,o,r,i,a=[],s=[],c=[],l=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),o=Ae(this.weekdaysMin(n,"")),r=Ae(this.weekdaysShort(n,"")),i=Ae(this.weekdays(n,"")),a.push(o),s.push(r),c.push(i),l.push(o),l.push(r),l.push(i);a.sort(e),s.sort(e),c.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Zt(){return this.hours()%12||12}function Jt(){return this.hours()||24}function Xt(e,t){B(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function en(e,t){return t._meridiemParse}function tn(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Zt),B("k",["kk",2],0,Jt),B("hmm",0,0,(function(){return""+Zt.apply(this)+R(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+Zt.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+R(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)})),Xt("a",!0),Xt("A",!1),Se("a",en),Se("A",en),Se("H",pe,ke),Se("h",pe,Ce),Se("k",pe,Ce),Se("HH",pe,ce),Se("hh",pe,ce),Se("kk",pe,ce),Se("hmm",me),Se("hmmss",fe),Se("Hmm",me),Se("Hmmss",fe),De(["H","HH"],Be),De(["k","kk"],(function(e,t,n){var o=Ne(e);t[Be]=24===o?0:o})),De(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),De(["h","hh"],(function(e,t,n){t[Be]=Ne(e),g(n).bigHour=!0})),De("hmm",(function(e,t,n){var o=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o)),g(n).bigHour=!0})),De("hmmss",(function(e,t,n){var o=e.length-4,r=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o,2)),t[We]=Ne(e.substr(r)),g(n).bigHour=!0})),De("Hmm",(function(e,t,n){var o=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o))})),De("Hmmss",(function(e,t,n){var o=e.length-4,r=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o,2)),t[We]=Ne(e.substr(r))}));var nn=/[ap]\.?m?\.?/i,on=Qe("Hours",!0);function rn(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var an,sn={calendar:D,longDateFormat:H,invalidDate:G,ordinal:Y,dayOfMonthOrdinalParse:Q,relativeTime:J,months:ot,monthsShort:rt,week:kt,weekdays:Dt,weekdaysMin:Rt,weekdaysShort:Mt,meridiemParse:nn},cn={},ln={};function un(e,t){var n,o=Math.min(e.length,t.length);for(n=0;n<o;n+=1)if(e[n]!==t[n])return n;return o}function dn(e){return e?e.toLowerCase().replace("_","-"):e}function pn(e){for(var t,n,o,r,i=0;i<e.length;){for(t=(r=dn(e[i]).split("-")).length,n=(n=dn(e[i+1]))?n.split("-"):null;t>0;){if(o=fn(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&un(r,n)>=t-1)break;t--}i++}return an}function mn(e){return!(!e||!e.match("^[^/\\\\]*$"))}function fn(t){var n=null;if(void 0===cn[t]&&e&&e.exports&&mn(t))try{n=an._abbr,commonjsRequire("./locale/"+t),hn(n)}catch(e){cn[t]=null}return cn[t]}function hn(e,t){var n;return e&&((n=l(t)?$n(e):gn(e,t))?an=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),an._abbr}function gn(e,t){if(null!==t){var n,o=sn;if(t.abbr=e,null!=cn[e])E("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])o=cn[t.parentLocale]._config;else{if(null==(n=fn(t.parentLocale)))return ln[t.parentLocale]||(ln[t.parentLocale]=[]),ln[t.parentLocale].push({name:e,config:t}),null;o=n._config}return cn[e]=new I(N(o,t)),ln[e]&&ln[e].forEach((function(e){gn(e.name,e.config)})),hn(e),cn[e]}return delete cn[e],null}function _n(e,t){if(null!=t){var n,o,r=sn;null!=cn[e]&&null!=cn[e].parentLocale?cn[e].set(N(cn[e]._config,t)):(null!=(o=fn(e))&&(r=o._config),t=N(r,t),null==o&&(t.abbr=e),(n=new I(t)).parentLocale=cn[e],cn[e]=n),hn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?(cn[e]=cn[e].parentLocale,e===hn()&&hn(e)):null!=cn[e]&&delete cn[e]);return cn[e]}function $n(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return an;if(!i(e)){if(t=fn(e))return t;e=[e]}return pn(e)}function bn(){return S(cn)}function yn(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[Pe]<0||n[Pe]>11?Pe:n[je]<1||n[je]>nt(n[Fe],n[Pe])?je:n[Be]<0||n[Be]>24||24===n[Be]&&(0!==n[qe]||0!==n[We]||0!==n[ze])?Be:n[qe]<0||n[qe]>59?qe:n[We]<0||n[We]>59?We:n[ze]<0||n[ze]>999?ze:-1,g(e)._overflowDayOfYear&&(t<Fe||t>je)&&(t=je),g(e)._overflowWeeks&&-1===t&&(t=Ue),g(e)._overflowWeekday&&-1===t&&(t=He),g(e).overflow=t),e}var vn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wn=/Z|[+-]\d\d(?::?\d\d)?/,Cn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Sn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,En={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function An(e){var t,n,o,r,i,a,s=e._i,c=vn.exec(s)||xn.exec(s),l=Cn.length,u=kn.length;if(c){for(g(e).iso=!0,t=0,n=l;t<n;t++)if(Cn[t][1].exec(c[1])){r=Cn[t][0],o=!1!==Cn[t][2];break}if(null==r)return void(e._isValid=!1);if(c[3]){for(t=0,n=u;t<n;t++)if(kn[t][1].exec(c[3])){i=(c[2]||" ")+kn[t][0];break}if(null==i)return void(e._isValid=!1)}if(!o&&null!=i)return void(e._isValid=!1);if(c[4]){if(!wn.exec(c[4]))return void(e._isValid=!1);a="Z"}e._f=r+(i||"")+(a||""),qn(e)}else e._isValid=!1}function On(e,t,n,o,r,i){var a=[Nn(e),rt.indexOf(t),parseInt(n,10),parseInt(o,10),parseInt(r,10)];return i&&a.push(parseInt(i,10)),a}function Nn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dn(e,t,n){return!e||Mt.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(g(n).weekdayMismatch=!0,n._isValid=!1,!1)}function Mn(e,t,n){if(e)return En[e];if(t)return 0;var o=parseInt(n,10),r=o%100;return(o-r)/100*60+r}function Rn(e){var t,n=Tn.exec(In(e._i));if(n){if(t=On(n[4],n[3],n[2],n[5],n[6],n[7]),!Dn(n[1],t,e))return;e._a=t,e._tzm=Mn(n[8],n[9],n[10]),e._d=bt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function Ln(e){var t=Sn.exec(e._i);null===t?(An(e),!1===e._isValid&&(delete e._isValid,Rn(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:o.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Fn(e,t,n){return null!=e?e:null!=t?t:n}function Pn(e){var t=new Date(o.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function jn(e){var t,n,o,r,i,a=[];if(!e._d){for(o=Pn(e),e._w&&null==e._a[je]&&null==e._a[Pe]&&Bn(e),null!=e._dayOfYear&&(i=Fn(e._a[Fe],o[Fe]),(e._dayOfYear>Ve(i)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=bt(i,0,e._dayOfYear),e._a[Pe]=n.getUTCMonth(),e._a[je]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=o[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Be]&&0===e._a[qe]&&0===e._a[We]&&0===e._a[ze]&&(e._nextDay=!0,e._a[Be]=0),e._d=(e._useUTC?bt:$t).apply(null,a),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Be]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(g(e).weekdayMismatch=!0)}}function Bn(e){var t,n,o,r,i,a,s,c,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,a=4,n=Fn(t.GG,e._a[Fe],xt(Yn(),1,4).year),o=Fn(t.W,1),((r=Fn(t.E,1))<1||r>7)&&(c=!0)):(i=e._locale._week.dow,a=e._locale._week.doy,l=xt(Yn(),i,a),n=Fn(t.gg,e._a[Fe],l.year),o=Fn(t.w,l.week),null!=t.d?((r=t.d)<0||r>6)&&(c=!0):null!=t.e?(r=t.e+i,(t.e<0||t.e>6)&&(c=!0)):r=i),o<1||o>wt(n,i,a)?g(e)._overflowWeeks=!0:null!=c?g(e)._overflowWeekday=!0:(s=vt(n,o,r,i,a),e._a[Fe]=s.year,e._dayOfYear=s.dayOfYear)}function qn(e){if(e._f!==o.ISO_8601)if(e._f!==o.RFC_2822){e._a=[],g(e).empty=!0;var t,n,r,i,a,s,c,l=""+e._i,u=l.length,d=0;for(c=(r=U(e._f,e._locale).match(L)||[]).length,t=0;t<c;t++)i=r[t],(n=(l.match(Te(i,e))||[])[0])&&((a=l.substr(0,l.indexOf(n))).length>0&&g(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),d+=n.length),j[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),Re(i,n,e)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=u-d,l.length>0&&g(e).unusedInput.push(l),e._a[Be]<=12&&!0===g(e).bigHour&&e._a[Be]>0&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[Be]=Wn(e._locale,e._a[Be],e._meridiem),null!==(s=g(e).era)&&(e._a[Fe]=e._locale.erasConvertYear(s,e._a[Fe])),jn(e),yn(e)}else Rn(e);else An(e)}function Wn(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((o=e.isPM(n))&&t<12&&(t+=12),o||12!==t||(t=0),t):t}function zn(e){var t,n,o,r,i,a,s=!1,c=e._f.length;if(0===c)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<c;r++)i=0,a=!1,t=v({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],qn(t),_(t)&&(a=!0),i+=g(t).charsLeftOver,i+=10*g(t).unusedTokens.length,g(t).score=i,s?i<o&&(o=i,n=t):(null==o||i<o||a)&&(o=i,n=t,a&&(s=!0));m(e,n||t)}function Un(e){if(!e._d){var t=oe(e._i),n=void 0===t.day?t.date:t.day;e._a=p([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),jn(e)}}function Hn(e){var t=new x(yn(Vn(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Vn(e){var t=e._i,n=e._f;return e._locale=e._locale||$n(e._l),null===t||void 0===n&&""===t?$({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new x(yn(t)):(d(t)?e._d=t:i(n)?zn(e):n?qn(e):Gn(e),_(e)||(e._d=null),e))}function Gn(e){var t=e._i;l(t)?e._d=new Date(o.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?Ln(e):i(t)?(e._a=p(t.slice(0),(function(e){return parseInt(e,10)})),jn(e)):a(t)?Un(e):u(t)?e._d=new Date(t):o.createFromInputFallback(e)}function Kn(e,t,n,o,r){var s={};return!0!==t&&!1!==t||(o=t,t=void 0),!0!==n&&!1!==n||(o=n,n=void 0),(a(e)&&c(e)||i(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=n,s._i=e,s._f=t,s._strict=o,Hn(s)}function Yn(e,t,n,o){return Kn(e,t,n,o,!1)}o.createFromInputFallback=k("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),o.ISO_8601=function(){},o.RFC_2822=function(){};var Qn=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Yn.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:$()})),Zn=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Yn.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:$()}));function Jn(e,t){var n,o;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Yn();for(n=t[0],o=1;o<t.length;++o)t[o].isValid()&&!t[o][e](n)||(n=t[o]);return n}function Xn(){return Jn("isBefore",[].slice.call(arguments,0))}function eo(){return Jn("isAfter",[].slice.call(arguments,0))}var to=function(){return Date.now?Date.now():+new Date},no=["year","quarter","month","week","day","hour","minute","second","millisecond"];function oo(e){var t,n,o=!1,r=no.length;for(t in e)if(s(e,t)&&(-1===Ge.call(no,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<r;++n)if(e[no[n]]){if(o)return!1;parseFloat(e[no[n]])!==Ne(e[no[n]])&&(o=!0)}return!0}function ro(){return this._isValid}function io(){return Ao(NaN)}function ao(e){var t=oe(e),n=t.year||0,o=t.quarter||0,r=t.month||0,i=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=oo(t),this._milliseconds=+u+1e3*l+6e4*c+1e3*s*60*60,this._days=+a+7*i,this._months=+r+3*o+12*n,this._data={},this._locale=$n(),this._bubble()}function so(e){return e instanceof ao}function co(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function lo(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&Ne(e[o])!==Ne(t[o]))&&a++;return a+i}function uo(e,t){B(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+R(~~(e/60),2)+t+R(~~e%60,2)}))}uo("Z",":"),uo("ZZ",""),Se("Z",ve),Se("ZZ",ve),De(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=mo(ve,e)}));var po=/([\+\-]|\d\d)/gi;function mo(e,t){var n,o,r=(t||"").match(e);return null===r?null:0===(o=60*(n=((r[r.length-1]||[])+"").match(po)||["-",0,0])[1]+Ne(n[2]))?0:"+"===n[0]?o:-o}function fo(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(w(e)||d(e)?e.valueOf():Yn(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),o.updateOffset(n,!1),n):Yn(e).local()}function ho(e){return-Math.round(e._d.getTimezoneOffset())}function go(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=mo(ve,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=ho(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Mo(this,Ao(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,o.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:ho(this)}function _o(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function $o(e){return this.utcOffset(0,e)}function bo(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(ho(this),"m")),this}function yo(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=mo(ye,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function vo(e){return!!this.isValid()&&(e=e?Yn(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function xo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function wo(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=Vn(t))._a?(e=t._isUTC?f(t._a):Yn(t._a),this._isDSTShifted=this.isValid()&&lo(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Co(){return!!this.isValid()&&!this._isUTC}function ko(){return!!this.isValid()&&this._isUTC}function So(){return!!this.isValid()&&this._isUTC&&0===this._offset}o.updateOffset=function(){};var To=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Eo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ao(e,t){var n,o,r,i=e,a=null;return so(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(a=To.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:Ne(a[je])*n,h:Ne(a[Be])*n,m:Ne(a[qe])*n,s:Ne(a[We])*n,ms:Ne(co(1e3*a[ze]))*n}):(a=Eo.exec(e))?(n="-"===a[1]?-1:1,i={y:Oo(a[2],n),M:Oo(a[3],n),w:Oo(a[4],n),d:Oo(a[5],n),h:Oo(a[6],n),m:Oo(a[7],n),s:Oo(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=Io(Yn(i.from),Yn(i.to)),(i={}).ms=r.milliseconds,i.M=r.months),o=new ao(i),so(e)&&s(e,"_locale")&&(o._locale=e._locale),so(e)&&s(e,"_isValid")&&(o._isValid=e._isValid),o}function Oo(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function No(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Io(e,t){var n;return e.isValid()&&t.isValid()?(t=fo(t,e),e.isBefore(t)?n=No(e,t):((n=No(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Do(e,t){return function(n,o){var r;return null===o||isNaN(+o)||(E(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=o,o=r),Mo(this,Ao(n,o),e),this}}function Mo(e,t,n,r){var i=t._milliseconds,a=co(t._days),s=co(t._months);e.isValid()&&(r=null==r||r,s&&pt(e,Ze(e,"Month")+s*n),a&&Je(e,"Date",Ze(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&o.updateOffset(e,a||s))}Ao.fn=ao.prototype,Ao.invalid=io;var Ro=Do(1,"add"),Lo=Do(-1,"subtract");function Fo(e){return"string"==typeof e||e instanceof String}function Po(e){return w(e)||d(e)||Fo(e)||u(e)||Bo(e)||jo(e)||null==e}function jo(e){var t,n,o=a(e)&&!c(e),r=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],l=i.length;for(t=0;t<l;t+=1)n=i[t],r=r||s(e,n);return o&&r}function Bo(e){var t=i(e),n=!1;return t&&(n=0===e.filter((function(t){return!u(t)&&Fo(e)})).length),t&&n}function qo(e){var t,n,o=a(e)&&!c(e),r=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<i.length;t+=1)n=i[t],r=r||s(e,n);return o&&r}function Wo(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function zo(e,t){1===arguments.length&&(arguments[0]?Po(arguments[0])?(e=arguments[0],t=void 0):qo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Yn(),r=fo(n,this).startOf("day"),i=o.calendarFormat(this,r)||"sameElse",a=t&&(A(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,Yn(n)))}function Uo(){return new x(this)}function Ho(e,t){var n=w(e)?e:Yn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function Vo(e,t){var n=w(e)?e:Yn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function Go(e,t,n,o){var r=w(e)?e:Yn(e),i=w(t)?t:Yn(t);return!!(this.isValid()&&r.isValid()&&i.isValid())&&("("===(o=o||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===o[1]?this.isBefore(i,n):!this.isAfter(i,n))}function Ko(e,t){var n,o=w(e)?e:Yn(e);return!(!this.isValid()||!o.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function Yo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Zo(e,t,n){var o,r,i;if(!this.isValid())return NaN;if(!(o=fo(e,this)).isValid())return NaN;switch(r=6e4*(o.utcOffset()-this.utcOffset()),t=ne(t)){case"year":i=Jo(this,o)/12;break;case"month":i=Jo(this,o);break;case"quarter":i=Jo(this,o)/3;break;case"second":i=(this-o)/1e3;break;case"minute":i=(this-o)/6e4;break;case"hour":i=(this-o)/36e5;break;case"day":i=(this-o-r)/864e5;break;case"week":i=(this-o-r)/6048e5;break;default:i=this-o}return n?i:Oe(i)}function Jo(e,t){if(e.date()<t.date())return-Jo(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(n,"months");return-(n+(t-o<0?(t-o)/(o-e.clone().add(n-1,"months")):(t-o)/(e.clone().add(n+1,"months")-o)))||0}function Xo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function er(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?z(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(n,"Z")):z(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function tr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,o,r="moment",i="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",o=i+'[")]',this.format(e+t+n+o)}function nr(e){e||(e=this.isUtc()?o.defaultFormatUtc:o.defaultFormat);var t=z(this,e);return this.localeData().postformat(t)}function or(e,t){return this.isValid()&&(w(e)&&e.isValid()||Yn(e).isValid())?Ao({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rr(e){return this.from(Yn(),e)}function ir(e,t){return this.isValid()&&(w(e)&&e.isValid()||Yn(e).isValid())?Ao({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ar(e){return this.to(Yn(),e)}function sr(e){var t;return void 0===e?this._locale._abbr:(null!=(t=$n(e))&&(this._locale=t),this)}o.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",o.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var cr=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function lr(){return this._locale}var ur=1e3,dr=60*ur,pr=60*dr,mr=3506328*pr;function fr(e,t){return(e%t+t)%t}function hr(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-mr:new Date(e,t,n).valueOf()}function gr(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-mr:Date.UTC(e,t,n)}function _r(e){var t,n;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gr:hr,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fr(t+(this._isUTC?0:this.utcOffset()*dr),pr);break;case"minute":t=this._d.valueOf(),t-=fr(t,dr);break;case"second":t=this._d.valueOf(),t-=fr(t,ur)}return this._d.setTime(t),o.updateOffset(this,!0),this}function $r(e){var t,n;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gr:hr,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=pr-fr(t+(this._isUTC?0:this.utcOffset()*dr),pr)-1;break;case"minute":t=this._d.valueOf(),t+=dr-fr(t,dr)-1;break;case"second":t=this._d.valueOf(),t+=ur-fr(t,ur)-1}return this._d.setTime(t),o.updateOffset(this,!0),this}function br(){return this._d.valueOf()-6e4*(this._offset||0)}function yr(){return Math.floor(this.valueOf()/1e3)}function vr(){return new Date(this.valueOf())}function xr(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function wr(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Cr(){return this.isValid()?this.toISOString():null}function kr(){return _(this)}function Sr(){return m({},g(this))}function Tr(){return g(this).overflow}function Er(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ar(e,t){var n,r,i,a=this._eras||$n("en")._eras;for(n=0,r=a.length;n<r;++n)switch("string"==typeof a[n].since&&(i=o(a[n].since).startOf("day"),a[n].since=i.valueOf()),typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=o(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf()}return a}function Or(e,t,n){var o,r,i,a,s,c=this.eras();for(e=e.toUpperCase(),o=0,r=c.length;o<r;++o)if(i=c[o].name.toUpperCase(),a=c[o].abbr.toUpperCase(),s=c[o].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return c[o];break;case"NNNN":if(i===e)return c[o];break;case"NNNNN":if(s===e)return c[o]}else if([i,a,s].indexOf(e)>=0)return c[o]}function Nr(e,t){var n=e.since<=e.until?1:-1;return void 0===t?o(e.since).year():o(e.since).year()+(t-e.offset)*n}function Ir(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),o[e].since<=n&&n<=o[e].until)return o[e].name;if(o[e].until<=n&&n<=o[e].since)return o[e].name}return""}function Dr(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),o[e].since<=n&&n<=o[e].until)return o[e].narrow;if(o[e].until<=n&&n<=o[e].since)return o[e].narrow}return""}function Mr(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),o[e].since<=n&&n<=o[e].until)return o[e].abbr;if(o[e].until<=n&&n<=o[e].since)return o[e].abbr}return""}function Rr(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-o(i[e].since).year())*n+i[e].offset;return this.year()}function Lr(e){return s(this,"_erasNameRegex")||zr.call(this),e?this._erasNameRegex:this._erasRegex}function Fr(e){return s(this,"_erasAbbrRegex")||zr.call(this),e?this._erasAbbrRegex:this._erasRegex}function Pr(e){return s(this,"_erasNarrowRegex")||zr.call(this),e?this._erasNarrowRegex:this._erasRegex}function jr(e,t){return t.erasAbbrRegex(e)}function Br(e,t){return t.erasNameRegex(e)}function qr(e,t){return t.erasNarrowRegex(e)}function Wr(e,t){return t._eraYearOrdinalRegex||$e}function zr(){var e,t,n,o,r,i=[],a=[],s=[],c=[],l=this.eras();for(e=0,t=l.length;e<t;++e)n=Ae(l[e].name),o=Ae(l[e].abbr),r=Ae(l[e].narrow),a.push(n),i.push(o),s.push(r),c.push(n),c.push(o),c.push(r);this._erasRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}function Ur(e,t){B(0,[e,e.length],0,t)}function Hr(e){return Zr.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Vr(e){return Zr.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Gr(){return wt(this.year(),1,4)}function Kr(){return wt(this.isoWeekYear(),1,4)}function Yr(){var e=this.localeData()._week;return wt(this.year(),e.dow,e.doy)}function Qr(){var e=this.localeData()._week;return wt(this.weekYear(),e.dow,e.doy)}function Zr(e,t,n,o,r){var i;return null==e?xt(this,o,r).year:(t>(i=wt(e,o,r))&&(t=i),Jr.call(this,e,t,n,o,r))}function Jr(e,t,n,o,r){var i=vt(e,t,n,o,r),a=bt(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Xr(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),Se("N",jr),Se("NN",jr),Se("NNN",jr),Se("NNNN",Br),Se("NNNNN",qr),De(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,o){var r=n._locale.erasParse(e,o,n._strict);r?g(n).era=r:g(n).invalidEra=e})),Se("y",$e),Se("yy",$e),Se("yyy",$e),Se("yyyy",$e),Se("yo",Wr),De(["y","yy","yyy","yyyy"],Fe),De(["yo"],(function(e,t,n,o){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Fe]=n._locale.eraYearOrdinalParse(e,r):t[Fe]=parseInt(e,10)})),B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Ur("gggg","weekYear"),Ur("ggggg","weekYear"),Ur("GGGG","isoWeekYear"),Ur("GGGGG","isoWeekYear"),Se("G",be),Se("g",be),Se("GG",pe,ce),Se("gg",pe,ce),Se("GGGG",ge,ue),Se("gggg",ge,ue),Se("GGGGG",_e,de),Se("ggggg",_e,de),Me(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,o){t[o.substr(0,2)]=Ne(e)})),Me(["gg","GG"],(function(e,t,n,r){t[r]=o.parseTwoDigitYear(e)})),B("Q",0,"Qo","quarter"),Se("Q",se),De("Q",(function(e,t){t[Pe]=3*(Ne(e)-1)})),B("D",["DD",2],"Do","date"),Se("D",pe,Ce),Se("DD",pe,ce),Se("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),De(["D","DD"],je),De("Do",(function(e,t){t[je]=Ne(e.match(pe)[0])}));var ei=Qe("Date",!0);function ti(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),Se("DDD",he),Se("DDDD",le),De(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=Ne(e)})),B("m",["mm",2],0,"minute"),Se("m",pe,ke),Se("mm",pe,ce),De(["m","mm"],qe);var ni=Qe("Minutes",!1);B("s",["ss",2],0,"second"),Se("s",pe,ke),Se("ss",pe,ce),De(["s","ss"],We);var oi,ri,ii=Qe("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Se("S",he,se),Se("SS",he,ce),Se("SSS",he,le),oi="SSSS";oi.length<=9;oi+="S")Se(oi,$e);function ai(e,t){t[ze]=Ne(1e3*("0."+e))}for(oi="S";oi.length<=9;oi+="S")De(oi,ai);function si(){return this._isUTC?"UTC":""}function ci(){return this._isUTC?"Coordinated Universal Time":""}ri=Qe("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var li=x.prototype;function ui(e){return Yn(1e3*e)}function di(){return Yn.apply(null,arguments).parseZone()}function pi(e){return e}li.add=Ro,li.calendar=zo,li.clone=Uo,li.diff=Zo,li.endOf=$r,li.format=nr,li.from=or,li.fromNow=rr,li.to=ir,li.toNow=ar,li.get=Xe,li.invalidAt=Tr,li.isAfter=Ho,li.isBefore=Vo,li.isBetween=Go,li.isSame=Ko,li.isSameOrAfter=Yo,li.isSameOrBefore=Qo,li.isValid=kr,li.lang=cr,li.locale=sr,li.localeData=lr,li.max=Zn,li.min=Qn,li.parsingFlags=Sr,li.set=et,li.startOf=_r,li.subtract=Lo,li.toArray=xr,li.toObject=wr,li.toDate=vr,li.toISOString=er,li.inspect=tr,"undefined"!=typeof Symbol&&null!=Symbol.for&&(li[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),li.toJSON=Cr,li.toString=Xo,li.unix=yr,li.valueOf=br,li.creationData=Er,li.eraName=Ir,li.eraNarrow=Dr,li.eraAbbr=Mr,li.eraYear=Rr,li.year=Ke,li.isLeapYear=Ye,li.weekYear=Hr,li.isoWeekYear=Vr,li.quarter=li.quarters=Xr,li.month=mt,li.daysInMonth=ft,li.week=li.weeks=Et,li.isoWeek=li.isoWeeks=At,li.weeksInYear=Yr,li.weeksInWeekYear=Qr,li.isoWeeksInYear=Gr,li.isoWeeksInISOWeekYear=Kr,li.date=ei,li.day=li.days=Ut,li.weekday=Ht,li.isoWeekday=Vt,li.dayOfYear=ti,li.hour=li.hours=on,li.minute=li.minutes=ni,li.second=li.seconds=ii,li.millisecond=li.milliseconds=ri,li.utcOffset=go,li.utc=$o,li.local=bo,li.parseZone=yo,li.hasAlignedHourOffset=vo,li.isDST=xo,li.isLocal=Co,li.isUtcOffset=ko,li.isUtc=So,li.isUTC=So,li.zoneAbbr=si,li.zoneName=ci,li.dates=k("dates accessor is deprecated. Use date instead.",ei),li.months=k("months accessor is deprecated. Use month instead",mt),li.years=k("years accessor is deprecated. Use year instead",Ke),li.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_o),li.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",wo);var mi=I.prototype;function fi(e,t,n,o){var r=$n(),i=f().set(o,t);return r[n](i,e)}function hi(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return fi(e,t,n,"month");var o,r=[];for(o=0;o<12;o++)r[o]=fi(e,o,n,"month");return r}function gi(e,t,n,o){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var r,i=$n(),a=e?i._week.dow:0,s=[];if(null!=n)return fi(t,(n+a)%7,o,"day");for(r=0;r<7;r++)s[r]=fi(t,(r+a)%7,o,"day");return s}function _i(e,t){return hi(e,t,"months")}function $i(e,t){return hi(e,t,"monthsShort")}function bi(e,t,n){return gi(e,t,n,"weekdays")}function yi(e,t,n){return gi(e,t,n,"weekdaysShort")}function vi(e,t,n){return gi(e,t,n,"weekdaysMin")}mi.calendar=M,mi.longDateFormat=V,mi.invalidDate=K,mi.ordinal=Z,mi.preparse=pi,mi.postformat=pi,mi.relativeTime=X,mi.pastFuture=ee,mi.set=O,mi.eras=Ar,mi.erasParse=Or,mi.erasConvertYear=Nr,mi.erasAbbrRegex=Fr,mi.erasNameRegex=Lr,mi.erasNarrowRegex=Pr,mi.months=ct,mi.monthsShort=lt,mi.monthsParse=dt,mi.monthsRegex=gt,mi.monthsShortRegex=ht,mi.week=Ct,mi.firstDayOfYear=Tt,mi.firstDayOfWeek=St,mi.weekdays=jt,mi.weekdaysMin=qt,mi.weekdaysShort=Bt,mi.weekdaysParse=zt,mi.weekdaysRegex=Gt,mi.weekdaysShortRegex=Kt,mi.weekdaysMinRegex=Yt,mi.isPM=tn,mi.meridiem=rn,hn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Ne(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),o.lang=k("moment.lang is deprecated. Use moment.locale instead.",hn),o.langData=k("moment.langData is deprecated. Use moment.localeData instead.",$n);var xi=Math.abs;function wi(){var e=this._data;return this._milliseconds=xi(this._milliseconds),this._days=xi(this._days),this._months=xi(this._months),e.milliseconds=xi(e.milliseconds),e.seconds=xi(e.seconds),e.minutes=xi(e.minutes),e.hours=xi(e.hours),e.months=xi(e.months),e.years=xi(e.years),this}function Ci(e,t,n,o){var r=Ao(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function ki(e,t){return Ci(this,e,t,1)}function Si(e,t){return Ci(this,e,t,-1)}function Ti(e){return e<0?Math.floor(e):Math.ceil(e)}function Ei(){var e,t,n,o,r,i=this._milliseconds,a=this._days,s=this._months,c=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*Ti(Oi(s)+a),a=0,s=0),c.milliseconds=i%1e3,e=Oe(i/1e3),c.seconds=e%60,t=Oe(e/60),c.minutes=t%60,n=Oe(t/60),c.hours=n%24,a+=Oe(n/24),s+=r=Oe(Ai(a)),a-=Ti(Oi(r)),o=Oe(s/12),s%=12,c.days=a,c.months=s,c.years=o,this}function Ai(e){return 4800*e/146097}function Oi(e){return 146097*e/4800}function Ni(e){if(!this.isValid())return NaN;var t,n,o=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+o/864e5,n=this._months+Ai(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Oi(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Ii(e){return function(){return this.as(e)}}var Di=Ii("ms"),Mi=Ii("s"),Ri=Ii("m"),Li=Ii("h"),Fi=Ii("d"),Pi=Ii("w"),ji=Ii("M"),Bi=Ii("Q"),qi=Ii("y"),Wi=Di;function zi(){return Ao(this)}function Ui(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function Hi(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vi=Hi("milliseconds"),Gi=Hi("seconds"),Ki=Hi("minutes"),Yi=Hi("hours"),Qi=Hi("days"),Zi=Hi("months"),Ji=Hi("years");function Xi(){return Oe(this.days()/7)}var ea=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function oa(e,t,n,o){var r=Ao(e).abs(),i=ea(r.as("s")),a=ea(r.as("m")),s=ea(r.as("h")),c=ea(r.as("d")),l=ea(r.as("M")),u=ea(r.as("w")),d=ea(r.as("y")),p=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||a<=1&&["m"]||a<n.m&&["mm",a]||s<=1&&["h"]||s<n.h&&["hh",s]||c<=1&&["d"]||c<n.d&&["dd",c];return null!=n.w&&(p=p||u<=1&&["w"]||u<n.w&&["ww",u]),(p=p||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,p[3]=+e>0,p[4]=o,na.apply(null,p)}function ra(e){return void 0===e?ea:"function"==typeof e&&(ea=e,!0)}function ia(e,t){return void 0!==ta[e]&&(void 0===t?ta[e]:(ta[e]=t,"s"===e&&(ta.ss=t-1),!0))}function aa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,o,r=!1,i=ta;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(i=Object.assign({},ta,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),o=oa(this,!r,i,n=this.localeData()),r&&(o=n.pastFuture(+this,o)),n.postformat(o)}var sa=Math.abs;function ca(e){return(e>0)-(e<0)||+e}function la(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,o,r,i,a,s,c=sa(this._milliseconds)/1e3,l=sa(this._days),u=sa(this._months),d=this.asSeconds();return d?(e=Oe(c/60),t=Oe(e/60),c%=60,e%=60,n=Oe(u/12),u%=12,o=c?c.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",i=ca(this._months)!==ca(d)?"-":"",a=ca(this._days)!==ca(d)?"-":"",s=ca(this._milliseconds)!==ca(d)?"-":"",r+"P"+(n?i+n+"Y":"")+(u?i+u+"M":"")+(l?a+l+"D":"")+(t||e||c?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(c?s+o+"S":"")):"P0D"}var ua=ao.prototype;return ua.isValid=ro,ua.abs=wi,ua.add=ki,ua.subtract=Si,ua.as=Ni,ua.asMilliseconds=Di,ua.asSeconds=Mi,ua.asMinutes=Ri,ua.asHours=Li,ua.asDays=Fi,ua.asWeeks=Pi,ua.asMonths=ji,ua.asQuarters=Bi,ua.asYears=qi,ua.valueOf=Wi,ua._bubble=Ei,ua.clone=zi,ua.get=Ui,ua.milliseconds=Vi,ua.seconds=Gi,ua.minutes=Ki,ua.hours=Yi,ua.days=Qi,ua.weeks=Xi,ua.months=Zi,ua.years=Ji,ua.humanize=aa,ua.toISOString=la,ua.toString=la,ua.toJSON=la,ua.locale=sr,ua.localeData=lr,ua.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",la),ua.lang=cr,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Se("x",be),Se("X",xe),De("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),De("x",(function(e,t,n){n._d=new Date(Ne(e))})),
|
|
16
|
+
*/module=localforage$1,module.exports=function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof commonjsRequire&&commonjsRequire;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){var n=t[a][1][e];return r(n||e)}),u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof commonjsRequire&&commonjsRequire,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(e,t,n){(function(e){var n,o,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var i=0,a=new r(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;o=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}o=!1}function d(e){1!==l.push(e)||o||n()}t.exports=d}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==r&&m(this,e)}function u(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){o((function(){var o;try{o=t(n)}catch(t){return i.reject(e,t)}o===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,o)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function m(e,t){var n=!1;function o(t){n||(n=!0,i.reject(e,t))}function r(t){n||(n=!0,i.resolve(e,t))}function a(){t(r,o)}var s=f(a);"error"===s.status&&o(s.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function h(e){return e instanceof this?e:i.resolve(new this(r),e)}function g(e){var t=new this(r);return i.reject(t,e)}function _(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,o=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,l=new this(r);++c<n;)u(e[c],c);return l;function u(e,r){function c(e){a[r]=e,++s!==n||o||(o=!0,i.resolve(l,a))}t.resolve(e).then(c,(function(e){o||(o=!0,i.reject(l,e))}))}}function $(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,o=!1;if(!n)return this.resolve([]);for(var a=-1,s=new this(r);++a<n;)c(e[a]);return s;function c(e){t.resolve(e).then((function(e){o||(o=!0,i.resolve(s,e))}),(function(e){o||(o=!0,i.reject(s,e))}))}}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(r);return this.state!==c?d(n,this.state===s?e:t,this.outcome):this.queue.push(new u(n,e,t)),n},u.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){i.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=f(p,t);if("error"===n.status)return i.reject(e,n.value);var o=n.value;if(o)m(e,o);else{e.state=s,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,o=e.queue.length;++n<o;)e.queue[n].callRejected(t);return e},l.resolve=h,l.reject=g,l.all=_,l.race=$},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var a=i();function s(){try{if(!a||!a.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function c(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(r){if("TypeError"!==r.name)throw r;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),o=0;o<e.length;o+=1)n.append(e[o]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var l=Promise;function u(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function d(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function p(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function m(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",h=void 0,g={},_=Object.prototype.toString,$="readonly",b="readwrite";function y(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),r=0;r<t;r++)o[r]=e.charCodeAt(r);return n}function v(e){return new l((function(t){var n=e.transaction(f,b),o=c([""]);n.objectStore(f).put(o,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function x(e){return"boolean"==typeof h?l.resolve(h):v(e).then((function(e){return h=e}))}function w(e){var t=g[e.name],n={};n.promise=new l((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function C(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function k(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function S(e,t){return new l((function(n,o){if(g[e.name]=g[e.name]||L(),e.db){if(!t)return n(e.db);w(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var i=a.open.apply(a,r);t&&(i.onupgradeneeded=function(t){var n=i.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),o(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},n(t),C(e)}}))}function T(e){return S(e,!1)}function E(e){return S(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,r=e.version>e.db.version;if(o&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function O(e){return new l((function(t,n){var o=new FileReader;o.onerror=n,o.onloadend=function(n){var o=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:o,type:e.type})},o.readAsBinaryString(e)}))}function N(e){return c([y(atob(e.data))],{type:e.type})}function I(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return d(n,e,e),n}function M(e){w(e);for(var t=g[e.name],n=t.forages,o=0;o<n.length;o++){var r=n[o];r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null)}return e.db=null,T(e).then((function(t){return e.db=t,A(e)?E(e):t})).then((function(o){e.db=t.db=o;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=o})).catch((function(t){throw k(e,t),t}))}function R(e,t,n,o){void 0===o&&(o=1);try{var r=e.db.transaction(e.storeName,t);n(null,r)}catch(r){if(o>0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return l.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((function(){return M(e).then((function(){R(e,t,n,o-1)}))})).catch(n);n(r)}}function L(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function F(e){var t=this,n={db:null};if(e)for(var o in e)n[o]=e[o];var r=g[n.name];r||(r=L(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var i=[];function a(){return l.resolve()}for(var s=0;s<r.forages.length;s++){var c=r.forages[s];c!==t&&i.push(c._initReady().catch(a))}var u=r.forages.slice(0);return l.all(i).then((function(){return n.db=r.db,T(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?E(n):e})).then((function(e){n.db=r.db=e,t._dbInfo=n;for(var o=0;o<u.length;o++){var i=u[o];i!==t&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}}))}function P(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){R(n._dbInfo,$,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),I(e)&&(e=N(e)),t(e)},a.onerror=function(){o(a.error)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function j(e,t){var n=this,o=new l((function(t,o){n.ready().then((function(){R(n._dbInfo,$,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var n=a.result;if(n){var o=n.value;I(o)&&(o=N(o));var r=e(o,n.key,s++);void 0!==r?t(r):n.continue()}else t()},a.onerror=function(){o(a.error)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function B(e,t,n){var o=this;e=p(e);var r=new l((function(n,r){var i;o.ready().then((function(){return i=o._dbInfo,"[object Blob]"===_.call(t)?x(i.db).then((function(e){return e?t:O(t)})):t})).then((function(t){R(o._dbInfo,b,(function(i,a){if(i)return r(i);try{var s=a.objectStore(o._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=c.error?c.error:c.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return u(r,n),r}function q(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){R(n._dbInfo,b,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){o(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function W(e){var t=this,n=new l((function(e,n){t.ready().then((function(){R(t._dbInfo,b,(function(o,r){if(o)return n(o);try{var i=r.objectStore(t._dbInfo.storeName).clear();r.oncomplete=function(){e()},r.onabort=r.onerror=function(){var e=i.error?i.error:i.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return u(n,e),n}function z(e){var t=this,n=new l((function(e,n){t.ready().then((function(){R(t._dbInfo,$,(function(o,r){if(o)return n(o);try{var i=r.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return u(n,e),n}function U(e,t){var n=this,o=new l((function(t,o){e<0?t(null):n.ready().then((function(){R(n._dbInfo,$,(function(r,i){if(r)return o(r);try{var a=i.objectStore(n._dbInfo.storeName),s=!1,c=a.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},c.onerror=function(){o(c.error)}}catch(e){o(e)}}))})).catch(o)}));return u(o,t),o}function H(e){var t=this,n=new l((function(e,n){t.ready().then((function(){R(t._dbInfo,$,(function(o,r){if(o)return n(o);try{var i=r.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return u(n,e),n}function V(e,t){t=m.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var o,r=this;if(e.name){var i=e.name===n.name&&r._dbInfo.db?l.resolve(r._dbInfo.db):T(e).then((function(t){var n=g[e.name],o=n.forages;n.db=t;for(var r=0;r<o.length;r++)o[r]._dbInfo.db=t;return t}));o=e.storeName?i.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;w(e);var o=g[e.name],r=o.forages;t.close();for(var i=0;i<r.length;i++){var s=r[i];s._dbInfo.db=null,s._dbInfo.version=n}var c=new l((function(t,o){var r=a.open(e.name,n);r.onerror=function(e){r.result.close(),o(e)},r.onupgradeneeded=function(){r.result.deleteObjectStore(e.storeName)},r.onsuccess=function(){var e=r.result;e.close(),t(e)}}));return c.then((function(e){o.db=e;for(var t=0;t<r.length;t++){var n=r[t];n._dbInfo.db=e,C(n._dbInfo)}})).catch((function(t){throw(k(e,t)||l.resolve()).catch((function(){})),t}))}})):i.then((function(t){w(e);var n=g[e.name],o=n.forages;t.close();for(var r=0;r<o.length;r++)o[r]._dbInfo.db=null;var i=new l((function(t,n){var o=a.deleteDatabase(e.name);o.onerror=function(){var e=o.result;e&&e.close(),n(o.error)},o.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},o.onsuccess=function(){var e=o.result;e&&e.close(),t(e)}}));return i.then((function(e){n.db=e;for(var t=0;t<o.length;t++)C(o[t]._dbInfo)})).catch((function(t){throw(k(e,t)||l.resolve()).catch((function(){})),t}))}))}else o=l.reject("Invalid arguments");return u(o,t),o}var G={_driver:"asyncStorage",_initStorage:F,_support:s(),iterate:j,getItem:P,setItem:B,removeItem:q,clear:W,length:z,key:U,keys:H,dropInstance:V};function K(){return"function"==typeof openDatabase}var Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,J="__lfsc__:",X=J.length,ee="arbf",te="blob",ne="si08",oe="ui08",re="uic8",ie="si16",ae="si32",se="ur16",ce="ui32",le="fl32",ue="fl64",de=X+ee.length,pe=Object.prototype.toString;function me(e){var t,n,o,r,i,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),u=new Uint8Array(l);for(t=0;t<s;t+=4)n=Y.indexOf(e[t]),o=Y.indexOf(e[t+1]),r=Y.indexOf(e[t+2]),i=Y.indexOf(e[t+3]),u[c++]=n<<2|o>>4,u[c++]=(15&o)<<4|r>>2,u[c++]=(3&r)<<6|63&i;return l}function fe(e){var t,n=new Uint8Array(e),o="";for(t=0;t<n.length;t+=3)o+=Y[n[t]>>2],o+=Y[(3&n[t])<<4|n[t+1]>>4],o+=Y[(15&n[t+1])<<2|n[t+2]>>6],o+=Y[63&n[t+2]];return n.length%3==2?o=o.substring(0,o.length-1)+"=":n.length%3==1&&(o=o.substring(0,o.length-2)+"=="),o}function he(e,t){var n="";if(e&&(n=pe.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===pe.call(e.buffer))){var o,r=J;e instanceof ArrayBuffer?(o=e,r+=ee):(o=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=oe:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ie:"[object Uint16Array]"===n?r+=se:"[object Int32Array]"===n?r+=ae:"[object Uint32Array]"===n?r+=ce:"[object Float32Array]"===n?r+=le:"[object Float64Array]"===n?r+=ue:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(o))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=Q+e.type+"~"+fe(this.result);t(J+te+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}}function ge(e){if(e.substring(0,X)!==J)return JSON.parse(e);var t,n=e.substring(de),o=e.substring(X,de);if(o===te&&Z.test(n)){var r=n.match(Z);t=r[1],n=n.substring(r[0].length)}var i=me(n);switch(o){case ee:return i;case te:return c([i],{type:t});case ne:return new Int8Array(i);case oe:return new Uint8Array(i);case re:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case se:return new Uint16Array(i);case ae:return new Int32Array(i);case ce:return new Uint32Array(i);case le:return new Float32Array(i);case ue:return new Float64Array(i);default:throw new Error("Unkown type: "+o)}}var _e={serialize:he,deserialize:ge,stringToBuffer:me,bufferToString:fe};function $e(e,t,n,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,o)}function be(e){var t=this,n={db:null};if(e)for(var o in e)n[o]="string"!=typeof e[o]?e[o].toString():e[o];var r=new l((function(e,o){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return o(e)}n.db.transaction((function(r){$e(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){o(t)}))}),o)}));return n.serializer=_e,r}function ye(e,t,n,o,r,i){e.executeSql(n,o,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?i(e,a):$e(e,t,(function(){e.executeSql(n,o,r,i)}),i)}),i):i(e,a)}),i)}function ve(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var o=n.rows.length?n.rows.item(0).value:null;o&&(o=r.serializer.deserialize(o)),t(o)}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function xe(e,t){var n=this,o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"SELECT * FROM "+r.storeName,[],(function(n,o){for(var i=o.rows,a=i.length,s=0;s<a;s++){var c=i.item(s),l=c.value;if(l&&(l=r.serializer.deserialize(l)),void 0!==(l=e(l,c.key,s+1)))return void t(l)}t()}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function we(e,t,n,o){var r=this;e=p(e);var i=new l((function(i,a){r.ready().then((function(){void 0===t&&(t=null);var s=t,c=r._dbInfo;c.serializer.serialize(t,(function(t,l){l?a(l):c.db.transaction((function(n){ye(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){i(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(o>0)return void i(we.apply(r,[e,s,n,o-1]));a(t)}}))}))})).catch(a)}));return u(i,n),i}function Ce(e,t,n){return we.apply(this,[e,t,n,1])}function ke(e,t){var n=this;e=p(e);var o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function Se(e){var t=this,n=new l((function(e,n){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){ye(t,o,"DELETE FROM "+o.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,e),n}function Te(e){var t=this,n=new l((function(e,n){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){ye(t,o,"SELECT COUNT(key) as c FROM "+o.storeName,[],(function(t,n){var o=n.rows.item(0).c;e(o)}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,e),n}function Ee(e,t){var n=this,o=new l((function(t,o){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){ye(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var o=n.rows.length?n.rows.item(0).key:null;t(o)}),(function(e,t){o(t)}))}))})).catch(o)}));return u(o,t),o}function Ae(e){var t=this,n=new l((function(e,n){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){ye(t,o,"SELECT key FROM "+o.storeName,[],(function(t,n){for(var o=[],r=0;r<n.rows.length;r++)o.push(n.rows.item(r).key);e(o)}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,e),n}function Oe(e){return new l((function(t,n){e.transaction((function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,o){for(var r=[],i=0;i<o.rows.length;i++)r.push(o.rows.item(i).name);t({db:e,storeNames:r})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}function Ne(e,t){t=m.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var o,r=this;return o=e.name?new l((function(t){var o;o=e.name===n.name?r._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:o,storeNames:[e.storeName]}):t(Oe(o))})).then((function(e){return new l((function(t,n){e.db.transaction((function(o){function r(e){return new l((function(t,n){o.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var i=[],a=0,s=e.storeNames.length;a<s;a++)i.push(r(e.storeNames[a]));l.all(i).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):l.reject("Invalid arguments"),u(o,t),o}var Ie={_driver:"webSQLStorage",_initStorage:be,_support:K(),iterate:xe,getItem:ve,setItem:Ce,removeItem:ke,clear:Se,length:Te,key:Ee,keys:Ae,dropInstance:Ne};function De(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function Me(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Re(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Le(){return!Re()||localStorage.length>0}function Fe(e){var t=this,n={};if(e)for(var o in e)n[o]=e[o];return n.keyPrefix=Me(e,t._defaultConfig),Le()?(t._dbInfo=n,n.serializer=_e,l.resolve()):l.reject()}function Pe(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var o=localStorage.key(n);0===o.indexOf(e)&&localStorage.removeItem(o)}}));return u(n,e),n}function je(e,t){var n=this;e=p(e);var o=n.ready().then((function(){var t=n._dbInfo,o=localStorage.getItem(t.keyPrefix+e);return o&&(o=t.serializer.deserialize(o)),o}));return u(o,t),o}function Be(e,t){var n=this,o=n.ready().then((function(){for(var t=n._dbInfo,o=t.keyPrefix,r=o.length,i=localStorage.length,a=1,s=0;s<i;s++){var c=localStorage.key(s);if(0===c.indexOf(o)){var l=localStorage.getItem(c);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,c.substring(r),a++)))return l}}}));return u(o,t),o}function qe(e,t){var n=this,o=n.ready().then((function(){var t,o=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(o.keyPrefix.length)),t}));return u(o,t),o}function We(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,o=[],r=0;r<n;r++){var i=localStorage.key(r);0===i.indexOf(e.keyPrefix)&&o.push(i.substring(e.keyPrefix.length))}return o}));return u(n,e),n}function ze(e){var t=this.keys().then((function(e){return e.length}));return u(t,e),t}function Ue(e,t){var n=this;e=p(e);var o=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return u(o,t),o}function He(e,t,n){var o=this;e=p(e);var r=o.ready().then((function(){void 0===t&&(t=null);var n=t;return new l((function(r,i){var a=o._dbInfo;a.serializer.serialize(t,(function(t,o){if(o)i(o);else try{localStorage.setItem(a.keyPrefix+e,t),r(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return u(r,n),r}function Ve(e,t){if(t=m.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var o,r=this;return o=e.name?new l((function(t){e.storeName?t(Me(e,r._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):l.reject("Invalid arguments"),u(o,t),o}var Ge={_driver:"localStorageWrapper",_initStorage:Fe,_support:De(),iterate:Be,getItem:je,setItem:He,removeItem:Ue,clear:Pe,length:ze,key:qe,keys:We,dropInstance:Ve},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ye=function(e,t){for(var n=e.length,o=0;o<n;){if(Ke(e[o],t))return!0;o++}return!1},Qe=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ze={},Je={},Xe={INDEXEDDB:G,WEBSQL:Ie,LOCALSTORAGE:Ge},et=[Xe.INDEXEDDB._driver,Xe.WEBSQL._driver,Xe.LOCALSTORAGE._driver],tt=["dropInstance"],nt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),ot={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function rt(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function it(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(Qe(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var at=function(){function e(t){for(var n in r(this,e),Xe)if(Xe.hasOwnProperty(n)){var o=Xe[n],i=o._driver;this[n]=i,Ze[i]||this.defineDriver(o)}this._defaultConfig=it({},ot),this._config=it({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":o(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var o=new l((function(t,n){try{var o=e._driver,r=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(r);for(var i=nt.concat("_initStorage"),a=0,s=i.length;a<s;a++){var c=i[a];if((!Ye(tt,c)||e[c])&&"function"!=typeof e[c])return void n(r)}var d=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=l.reject(t);return u(n,arguments[arguments.length-1]),n}},n=0,o=tt.length;n<o;n++){var r=tt[n];e[r]||(e[r]=t(r))}};d();var p=function(n){Ze[o]&&console.info("Redefining LocalForage driver: "+o),Ze[o]=e,Je[o]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(p,n):p(!!e._support):p(!0)}catch(e){n(e)}}));return d(o,t,n),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var o=Ze[e]?l.resolve(Ze[e]):l.reject(new Error("Driver not found."));return d(o,t,n),o},e.prototype.getSerializer=function(e){var t=l.resolve(_e);return d(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return d(n,e,e),n},e.prototype.setDriver=function(e,t,n){var o=this;Qe(e)||(e=[e]);var r=this._getSupportedDrivers(e);function i(){o._config.driver=o.driver()}function a(e){return o._extend(e),i(),o._ready=o._initStorage(o._config),o._ready}function s(e){return function(){var t=0;function n(){for(;t<e.length;){var r=e[t];return t++,o._dbInfo=null,o._ready=null,o.getDriver(r).then(a).catch(n)}i();var s=new Error("No available storage method found.");return o._driverSet=l.reject(s),o._driverSet}return n()}}var c=null!==this._driverSet?this._driverSet.catch((function(){return l.resolve()})):l.resolve();return this._driverSet=c.then((function(){var e=r[0];return o._dbInfo=null,o._ready=null,o.getDriver(e).then((function(e){o._driver=e._driver,i(),o._wrapLibraryMethodsWithReady(),o._initDriver=s(r)}))})).catch((function(){i();var e=new Error("No available storage method found.");return o._driverSet=l.reject(e),o._driverSet})),d(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!Je[e]},e.prototype._extend=function(e){it(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var r=e[n];this.supports(r)&&t.push(r)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=nt.length;e<t;e++)rt(this,nt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),st=new at;t.exports=st},{3:3}]},{},[4])(4);var localforage=localforage$1.exports;let isInvalidated=!1;function invalidateCommands(){return __awaiter$h(this,void 0,void 0,(function*(){isInvalidated||(isInvalidated=!0,yield tick(),isInvalidated=!1,commands.update((e=>{let t=null;for(const n of Object.values(e)){if(n.isGroupCommand)continue;const{testEnabled:o}=n;let r=n.enabled;o&&(r=o()),r!=n.enabled&&(t||(t=Object.assign({},e)),t[n.id].enabled=r)}if(t){const e=Object.values(t);for(const t of e){if(!t.isGroupCommand)continue;const n=e.filter((e=>e.group==t.group&&!e.isGroupCommand&&e.enabled));t.enabled=n.length>0}}return t||e})))}))}let isInvalidatedDefinitions=!1;function invalidateCommandDefinitions(){return __awaiter$h(this,void 0,void 0,(function*(){isInvalidatedDefinitions||(isInvalidatedDefinitions=!0,yield tick(),isInvalidatedDefinitions=!1,commands.update((e=>{let t=Object.assign({},e);const n=Object.values(t);for(const e of n){if(!e.isGroupCommand)continue;const t=n.filter((t=>t.group==e.group&&!t.isGroupCommand));for(const n of t)n.keyTextFromGroup=e.keyText}return t})),invalidateCommands())}))}class ElectronApi{constructor(){this.ipcRenderer=getIpcRenderer()}send(e,t=null){this.ipcRenderer.send(e,t)}showOpenDialog(e){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke("showOpenDialog",e)}))}showSaveDialog(e){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke("showSaveDialog",e)}))}showItemInFolder(e){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke("showItemInFolder",e)}))}openExternal(e){return __awaiter$h(this,void 0,void 0,(function*(){yield this.ipcRenderer.invoke("openExternal",e)}))}invoke(e,t){return __awaiter$h(this,void 0,void 0,(function*(){return yield this.ipcRenderer.invoke(e,t)}))}addEventListener(e,t){this.ipcRenderer.on(e,t)}removeEventListener(e,t){this.ipcRenderer.removeListener(e,t)}}function getIpcRenderer(){if(window.require){const e=window.require("electron");return null==e?void 0:e.ipcRenderer}return null}function isElectronAvailable(){return!!getIpcRenderer()}const apiInstance=isElectronAvailable()?new ElectronApi:null;function getElectron(){return apiInstance}function isAdminPage(){return"admin"==window.dbgate_page}function isOneOfPage(...e){return e.includes(window.dbgate_page)}function getOpenedTabsStorageName(){return isAdminPage()?"adminOpenedTabs":"openedTabs"}let apiUrl=null;try{apiUrl=void 0}catch(_a){}function resolveApi(){return apiUrl||(window.location.origin+window.location.pathname).replace(/\/[a-zA-Z-]+\.html$/,"").replace(/\/*$/,"")}function resolveApiHeaders(){const e={},t=localStorage.getItem(isOneOfPage("admin","admin-license")?"adminAccessToken":"accessToken");return t&&(e.Authorization=`Bearer ${t}`),e}let lastSnackbarId=0;function showSnackbar(e){lastSnackbarId+=1;const t=lastSnackbarId.toString();return openedSnackbars.update((n=>[...n,Object.assign(Object.assign({},e),{id:t})])),t}function showSnackbarSuccess(e){showSnackbar({message:e,icon:"img ok",allowClose:!0,autoClose:!0})}function showSnackbarInfo(e){showSnackbar({message:e,icon:"img info",allowClose:!0,autoClose:!0})}function showSnackbarError(e){showSnackbar({message:e,icon:"img error",allowClose:!0,autoClose:!0})}function closeSnackbar(e){openedSnackbars.update((t=>t.filter((t=>t.id!=e))))}function updateSnackbarProgressMessage(e,t){openedSnackbars.update((n=>n.map((n=>n.id===e?Object.assign(Object.assign({},n),{progressMessage:t}):n))))}function isProApp(){return!1}function isOauthCallback$1(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("state");return t&&n&&n.startsWith("dbg-oauth:")&&n==sessionStorage.getItem("oauthState")}function isDbLoginCallback(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("state");return t&&n&&n.startsWith("dbg-dblogin:")&&n==localStorage.getItem("dbloginState")}function isDbLoginAuthCallback(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("state");return t&&n&&n.startsWith("dbg-dblogin:")&&n==sessionStorage.getItem("dbloginAuthState")}function handleOauthCallback(){const e=new URLSearchParams(location.search),t=e.get("code"),n=e.get("sid");if(isOauthCallback$1()){const[e,o,r]=sessionStorage.getItem("oauthState").split(":");return sessionStorage.removeItem("oauthState"),apiCall("auth/oauth-token",{code:t,amoid:r,redirectUri:location.origin+location.pathname,sid:n}).then((e=>{const{accessToken:t,error:n,errorMessage:o}=e;t?(console.log("Settings access token from OAUTH"),localStorage.setItem("accessToken",t),internalRedirectTo("/")):(console.log("Error when processing OAUTH callback",n||o),internalRedirectTo(`/not-logged.html?error=${n||o}`))})),!0}if(isDbLoginCallback()){const[e,o,r]=localStorage.getItem("dbloginState").split(":");return localStorage.removeItem("dbloginState"),apiCall("connections/dblogin-token",{code:t,conid:r,strmid:o,sid:n,redirectUri:location.origin+location.pathname}).then((e=>{e.success?window.close():e.error?internalRedirectTo(`/error.html?error=${encodeURIComponent(e.error)}`):internalRedirectTo("/error.html")})),!0}if(isDbLoginAuthCallback()){const[e,o,r,i]=sessionStorage.getItem("dbloginAuthState").split(":");return sessionStorage.removeItem("dbloginAuthState"),apiCall("connections/dblogin-auth-token",{code:t,conid:r,redirectUri:location.origin+location.pathname,amoid:i,sid:n}).then((e=>{e.accessToken?(localStorage.setItem("accessToken",e.accessToken),internalRedirectTo("/")):e.error?internalRedirectTo(`/error.html?error=${encodeURIComponent(e.error)}`):internalRedirectTo("/error.html")})),!0}return!1}function handleAuthOnStartup(e){return __awaiter$h(this,void 0,void 0,(function*(){const t=window.dbgate_page;"error"!=t&&(function(){if(e.configurationError)return internalRedirectTo("/error.html"),!0}()||"set-admin-password"!=t&&(function(){if(e.isAdminPasswordMissing)return internalRedirectTo("/set-admin-password.html"),!0}()||"login"!=t&&"admin-login"!=t&&"not-logged"!=t&&("admin"==getAuthCategory(e)?!e.isInvalidToken&&localStorage.getItem("adminAccessToken")||redirectToAdminLogin():"token"!=getAuthCategory(e)||!e.isInvalidToken&&localStorage.getItem("accessToken")||redirectToLogin(e))))}))}function redirectToAdminLogin(){return __awaiter$h(this,void 0,void 0,(function*(){internalRedirectTo("/admin-login.html")}))}function redirectToLogin(e=null,t=!1){return __awaiter$h(this,void 0,void 0,(function*(){if(e||(enableApi(),e=yield getConfig()),"token"!=getAuthCategory(e));else{if(!t){const e=window.dbgate_page;if("login"==e||"admin-login"==e||"not-logged"==e)return}internalRedirectTo("/login.html")}}))}function internalRedirectTo(e){const t=location.pathname.lastIndexOf("/"),n=t>=0?location.pathname.substring(0,t)+e:e;location.replace(n)}function doLogout(){return __awaiter$h(this,void 0,void 0,(function*(){enableApi();const e=yield getConfig(),t=getAuthCategory(e);"admin"==t?(localStorage.removeItem("adminAccessToken"),internalRedirectTo("/admin-login.html?is-admin=true")):"token"==t?(localStorage.removeItem("accessToken"),e.logoutUrl?window.location.href=e.logoutUrl:internalRedirectTo("/not-logged.html")):"basic"==t&&(window.location.href="config/logout")}))}function showModal(e,t={}){const n=v1_1$6();openedModals.update((o=>[...o,{component:e,modalId:n,props:t}])),invalidateCommands()}function closeModal(e){openedModals.update((t=>t.filter((t=>t.modalId!=e)))),invalidateCommands()}function closeCurrentModal(){openedModals.update((e=>e.slice(0,e.length-1))),invalidateCommands()}function getActiveModalId(){var e;const t=get_store_value(openedModals);return null===(e=t[t.length-1])||void 0===e?void 0:e.modalId}function create_fragment$5$(e){let t,n,o,r=[{type:e[0]},{value:e[2]},{title:e[3]},e[8]],i={};for(let e=0;e<r.length;e+=1)i=assign(i,r[e]);return{c(){t=element("input"),set_attributes(t,i),toggle_class(t,"disabled",e[1]),toggle_class(t,"skipWidth",e[4]),toggle_class(t,"outline",e[5]),toggle_class(t,"svelte-y2a7di",!0)},m(r,a){insert(r,t,a),"value"in i&&(t.value=i.value),t.autofocus&&t.focus(),e[10](t),n||(o=listen(t,"click",e[7]),n=!0)},p(e,[n]){set_attributes(t,i=get_spread_update(r,[1&n&&{type:e[0]},4&n&&t.value!==e[2]&&{value:e[2]},8&n&&{title:e[3]},256&n&&e[8]])),"value"in i&&(t.value=i.value),toggle_class(t,"disabled",e[1]),toggle_class(t,"skipWidth",e[4]),toggle_class(t,"outline",e[5]),toggle_class(t,"svelte-y2a7di",!0)},i:noop$2,o:noop$2,d(r){r&&detach(t),e[10](null),n=!1,o()}}}function instance$5V(e,t,n){const o=["type","disabled","value","title","skipWidth","outline","getBoundingClientRect"];let r=compute_rest_props(t,o);const i=createEventDispatcher();let a,{type:s="button"}=t,{disabled:c=!1}=t,{value:l}=t,{title:u=null}=t,{skipWidth:d=!1}=t,{outline:p=!1}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(8,r=compute_rest_props(t,o)),"type"in e&&n(0,s=e.type),"disabled"in e&&n(1,c=e.disabled),"value"in e&&n(2,l=e.value),"title"in e&&n(3,u=e.title),"skipWidth"in e&&n(4,d=e.skipWidth),"outline"in e&&n(5,p=e.outline)},[s,c,l,u,d,p,a,function(){c||i("click")},r,function(){return a.getBoundingClientRect()},function(e){binding_callbacks[e?"unshift":"push"]((()=>{a=e,n(6,a)}))}]}class FormStyledButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$5V,create_fragment$5$,safe_not_equal,{type:0,disabled:1,value:2,title:3,skipWidth:4,outline:5,getBoundingClientRect:9})}get getBoundingClientRect(){return this.$$.ctx[9]}}function runCommand(e){const t=getCommands()[e];if(t){if(!t.enabled)return;t.isGroupCommand?runGroupCommand(t.group):t.onClick?t.onClick():t.getSubCommands&&visibleCommandPalette.set(t)}}function runGroupCommand(e){const t=getCommands(),n=Object.values(t).find((t=>t.group==e&&!t.isGroupCommand&&t.enabled));n&&n.onClick&&n.onClick()}function findCommand(e){return getCommands()[e]}function getAsArray(e){return _.isArray(e)?e:null!=e?[e]:[]}let isContextMenuSupressed=!1;function registerMenu(...e){setContext("componentContextMenu",[getContext("componentContextMenu"),...e])}function supressContextMenu(){isContextMenuSupressed=!0}function contextMenu(e,t=[]){const n=e=>__awaiter$h(this,void 0,void 0,(function*(){if(e.preventDefault(),e.stopPropagation(),!isContextMenuSupressed&&(yield invalidateCommands(),t)){const n=e.pageX,o=e.pageY;currentDropDownMenu.set({left:n,top:o,items:t,targetElement:e.target})}})),o=()=>{isContextMenuSupressed=!1};if("__no_menu"!=t)return e.addEventListener("contextmenu",n),e.addEventListener("mousedown",o),{destroy(){e.removeEventListener("contextmenu",n),e.removeEventListener("mousedown",o)},update(e){t=e}}}function doExtractMenuItems(e,t,n){if(_.isFunction(e))doExtractMenuItems(e(n),t,n);else if(_.isArray(e))for(const o of e)doExtractMenuItems(o,t,n);else _.isPlainObject(e)&&!e._skip&&t.push(e)}function processTags(e){const t=[],n=[];for(const t of e.filter((e=>e.tag)))n.push(Object.assign(Object.assign({},t),{tags:getAsArray(t.tag)}));for(const o of e.filter((e=>!e.tag)))if(o.placeTag){const e=getAsArray(o.placeTag);for(let o=0;o<n.length;){const r=n[o];_.intersection(e,r.tags).length>0?(n.splice(o,1),t.push(r)):o++}}else t.push(o);return t.push(...n),t}function extractMenuItems(e,t=null){let n=[];return doExtractMenuItems(e,n,t),n=processTags(n),n}function mapItem(e,t){if(e.command){const n=t[e.command];return n?{text:e.text||n.menuName||n.toolbarName||n.name,keyText:n.keyText||n.keyTextFromGroup||n.disableHandleKeyText,onClick:()=>{n.isGroupCommand?runGroupCommand(n.group):n.getSubCommands?visibleCommandPalette.set(n):n.onClick&&n.onClick()},disabled:!n.enabled,hideDisabled:e.hideDisabled}:null}return e}function filterMenuItems(e){const t=[];let n=!1,o=!1;for(const r of e.filter((e=>!e.disabled||!e.hideDisabled)))r.divider?o&&(n=!0):(n&&t.push({divider:!0}),n=!1,o=!0,t.push(r));return t}function getContextMenu(){return getContext("componentContextMenu")}function prepareMenuItems(e,t,n){const o=extractMenuItems(e,t);return filterMenuItems(_.compact(o.map((e=>mapItem(e,n)))))}function openWebLink(e,t=!1){var n,o;const r=getElectron();if(r)r.send("open-link",e);else if(t){const t=500,r=650,i=null!==(n=window.screenLeft)&&void 0!==n?n:window.screenX,a=null!==(o=window.screenTop)&&void 0!==o?o:window.screenY,s=[`width=${t}`,`height=${r}`,`left=${i+(window.outerWidth-t)/2}`,`top=${a+(window.outerHeight-r)/2}`,"scrollbars=yes","resizable=yes","noopener","noreferrer"];window.open(e,"dbgateCloudLoginPopup",s.join(","))}else window.open(e,"_blank")}function create_fragment$5_(e){let t,n,o,r,i;const a=e[6].default,s=create_slot(a,e,e[5],null);let c=[e[4]],l={};for(let e=0;e<c.length;e+=1)l=assign(l,c[e]);return{c(){t=element("a"),s&&s.c(),set_attributes(t,l),toggle_class(t,"svelte-1gj6vtf",!0)},m(a,c){insert(a,t,c),s&&s.m(t,null),o=!0,r||(i=[listen(t,"click",e[7]),action_destroyer(n=contextMenu.call(null,t,e[2]))],r=!0)},p(e,[r]){s&&s.p&&(!o||32&r)&&update_slot_base(s,a,e,e[5],o?get_slot_changes(a,e[5],r,null):get_all_dirty_from_scope(e[5]),null),set_attributes(t,l=get_spread_update(c,[16&r&&e[4]])),n&&is_function(n.update)&&4&r&&n.update.call(null,e[2]),toggle_class(t,"svelte-1gj6vtf",!0)},i(e){o||(transition_in(s,e),o=!0)},o(e){transition_out(s,e),o=!1},d(e){e&&detach(t),s&&s.d(e),r=!1,run_all(i)}}}function instance$5U(e,t,n){const o=["href","onClick","menu","internalRedirect"];let r=compute_rest_props(t,o),{$$slots:i={},$$scope:a}=t,{href:s}=t,{onClick:c}=t,{menu:l="__no_menu"}=t,{internalRedirect:u}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(4,r=compute_rest_props(t,o)),"href"in e&&n(0,s=e.href),"onClick"in e&&n(1,c=e.onClick),"menu"in e&&n(2,l=e.menu),"internalRedirect"in e&&n(3,u=e.internalRedirect),"$$scope"in e&&n(5,a=e.$$scope)},[s,c,l,u,r,a,i,e=>{c?c(e):u?internalRedirectTo(u):openWebLink(s)}]}class Link$1 extends SvelteComponent{constructor(e){super(),init(this,e,instance$5U,create_fragment$5_,safe_not_equal,{href:0,onClick:1,menu:2,internalRedirect:3})}}function create_else_block$1a(e){let t,n,o,r,i,a,s,c=[e[4]],l={};for(let e=0;e<c.length;e+=1)l=assign(l,c[e]);let u=[{class:"label"},e[4]],d={};for(let e=0;e<u.length;e+=1)d=assign(d,u[e]);const p=e[6].default,m=create_slot(p,e,e[5],null);return{c(){t=element("div"),n=element("span"),o=text$1(e[1]),r=space(),m&&m.c(),set_attributes(n,l),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0),set_attributes(t,d),toggle_class(t,"svelte-2e9efj",!0)},m(c,l){insert(c,t,l),append(t,n),append(n,o),insert(c,r,l),m&&m.m(c,l),i=!0,a||(s=[listen(n,"click",(function(){is_function(e[4].onClick)&&e[4].onClick.apply(this,arguments)})),listen(t,"click",(function(){is_function(e[4].onClick)&&e[4].onClick.apply(this,arguments)}))],a=!0)},p(r,a){e=r,(!i||2&a)&&set_data_maybe_contenteditable(o,e[1],l.contenteditable),set_attributes(n,l=get_spread_update(c,[16&a&&e[4]])),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0),set_attributes(t,d=get_spread_update(u,[{class:"label"},16&a&&e[4]])),toggle_class(t,"svelte-2e9efj",!0),m&&m.p&&(!i||32&a)&&update_slot_base(m,p,e,e[5],i?get_slot_changes(p,e[5],a,null):get_all_dirty_from_scope(e[5]),null)},i(e){i||(transition_in(m,e),i=!0)},o(e){transition_out(m,e),i=!1},d(e){e&&detach(t),e&&detach(r),m&&m.d(e),a=!1,run_all(s)}}}function create_if_block$2v(e){let t,n,o,r,i,a;const s=e[6].default,c=create_slot(s,e,e[5],null);let l=[e[4],{class:"checkLabel"}],u={};for(let e=0;e<l.length;e+=1)u=assign(u,l[e]);return{c(){c&&c.c(),t=space(),n=element("span"),o=text$1(e[1]),set_attributes(n,u),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0)},m(s,l){c&&c.m(s,l),insert(s,t,l),insert(s,n,l),append(n,o),r=!0,i||(a=listen(n,"click",(function(){is_function(e[4].onClick)&&e[4].onClick.apply(this,arguments)})),i=!0)},p(t,i){e=t,c&&c.p&&(!r||32&i)&&update_slot_base(c,s,e,e[5],r?get_slot_changes(s,e[5],i,null):get_all_dirty_from_scope(e[5]),null),(!r||2&i)&&set_data_maybe_contenteditable(o,e[1],u.contenteditable),set_attributes(n,u=get_spread_update(l,[16&i&&e[4],{class:"checkLabel"}])),toggle_class(n,"disabled",e[3]),toggle_class(n,"svelte-2e9efj",!0)},i(e){r||(transition_in(c,e),r=!0)},o(e){transition_out(c,e),r=!1},d(e){c&&c.d(e),e&&detach(t),e&&detach(n),i=!1,a()}}}function create_fragment$5Z(e){let t,n,o,r;const i=[create_if_block$2v,create_else_block$1a],a=[];function s(e,t){return"checkbox"==e[0]?0:1}return n=s(e),o=a[n]=i[n](e),{c(){t=element("div"),o.c(),attr(t,"class","largeFormMarker svelte-2e9efj"),toggle_class(t,"noMargin",e[2])},m(e,o){insert(e,t,o),a[n].m(t,null),r=!0},p(e,[c]){let l=n;n=s(e),n===l?a[n].p(e,c):(group_outros(),transition_out(a[l],1,1,(()=>{a[l]=null})),check_outros(),o=a[n],o?o.p(e,c):(o=a[n]=i[n](e),o.c()),transition_in(o,1),o.m(t,null)),(!r||4&c)&&toggle_class(t,"noMargin",e[2])},i(e){r||(transition_in(o),r=!0)},o(e){transition_out(o),r=!1},d(e){e&&detach(t),a[n].d()}}}function instance$5T(e,t,n){let{$$slots:o={},$$scope:r}=t,{type:i}=t,{label:a}=t,{noMargin:s=!1}=t,{disabled:c=!1}=t,{labelProps:l={}}=t;return e.$$set=e=>{"type"in e&&n(0,i=e.type),"label"in e&&n(1,a=e.label),"noMargin"in e&&n(2,s=e.noMargin),"disabled"in e&&n(3,c=e.disabled),"labelProps"in e&&n(4,l=e.labelProps),"$$scope"in e&&n(5,r=e.$$scope)},[i,a,s,c,l,r,o]}class FormFieldTemplateLarge extends SvelteComponent{constructor(e){super(),init(this,e,instance$5T,create_fragment$5Z,safe_not_equal,{type:0,label:1,noMargin:2,disabled:3,labelProps:4})}}function createRef(e){return{value:e,initValue:e,set(e){this.value=e},reset(){this.value=this.initValue},get(){return this.value},update(e){this.value=e(this.value)}}}var keycodes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pauseBreak:19,capsLock:20,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40,insert:45,delete:46,n0:48,n1:49,n2:50,n3:51,n4:52,n5:53,n6:54,n7:55,n8:56,n9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftWindowKey:91,rightWindowKey:93,numPad0:96,numPad1:97,numPad2:98,numPad3:99,numPad4:100,numPad5:101,numPad6:102,numPad7:103,numPad8:104,numPad9:105,numPadAdd:107,numPadSub:109,multiply:106,add:107,subtract:109,decimalPoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f12:123,numLock:144,scrollLock:145,semiColon:186,equalSign:187,comma:188,dash:189,period:190,forwardSlash:191,graveAccent:192,openBracket:219,backSlash:220,closeBracket:221,singleQuote:222};function create_fragment$5Y(e){let t,n,o;const r=e[4].default,i=create_slot(r,e,e[3],null);return{c(){i&&i.c()},m(r,a){i&&i.m(r,a),t=!0,n||(o=listen(window,"keydown",e[0]),n=!0)},p(e,[n]){i&&i.p&&(!t||8&n)&&update_slot_base(i,r,e,e[3],t?get_slot_changes(r,e[3],n,null):get_all_dirty_from_scope(e[3]),null)},i(e){t||(transition_in(i,e),t=!0)},o(e){transition_out(i,e),t=!1},d(e){i&&i.d(e),n=!1,o()}}}const contextKey$1="formProviderContextKey";function getFormContext(){return getContext(contextKey$1)}function instance$5S(e,t,n){let{$$slots:o={},$$scope:r}=t,{values:i}=t,{template:a=FormFieldTemplateLarge}=t;const s={values:i,template:a,setFieldValue:(e,t)=>{i.update((n=>Object.assign(Object.assign({},n),{[e]:t})))},submitActionRef:createRef(null)};return setContext(contextKey$1,s),e.$$set=e=>{"values"in e&&n(1,i=e.values),"template"in e&&n(2,a=e.template),"$$scope"in e&&n(3,r=e.$$scope)},[function(e){e.keyCode==keycodes.enter&&s.submitActionRef.get()&&(e.preventDefault(),s.submitActionRef.get()(i))},i,a,r,o]}class FormProviderCore extends SvelteComponent{constructor(e){super(),init(this,e,instance$5S,create_fragment$5Y,safe_not_equal,{values:1,template:2})}}function create_fragment$5X(e){let t,n,o,r,i;return{c(){t=element("span"),attr(t,"class",n=null_to_empty(e[5][e[0]]||e[0])+" svelte-1p2qnn1"),attr(t,"title",e[1]),attr(t,"style",e[4]),attr(t,"data-testid",o=e[6]["data-testid"]),toggle_class(t,"padLeft",e[2]),toggle_class(t,"padRight",e[3])},m(n,o){insert(n,t,o),r||(i=listen(t,"click",e[7]),r=!0)},p(e,[r]){1&r&&n!==(n=null_to_empty(e[5][e[0]]||e[0])+" svelte-1p2qnn1")&&attr(t,"class",n),2&r&&attr(t,"title",e[1]),16&r&&attr(t,"style",e[4]),64&r&&o!==(o=e[6]["data-testid"])&&attr(t,"data-testid",o),5&r&&toggle_class(t,"padLeft",e[2]),9&r&&toggle_class(t,"padRight",e[3])},i:noop$2,o:noop$2,d(e){e&&detach(t),r=!1,i()}}}function getNumberIcon(e){switch(e){case 1:return"mdi mdi-numeric-1-circle";case 2:return"mdi mdi-numeric-2-circle";case 3:return"mdi mdi-numeric-3-circle";case 4:return"mdi mdi-numeric-4-circle";case 5:return"mdi mdi-numeric-5-circle";case 6:return"mdi mdi-numeric-6-circle";case 7:return"mdi mdi-numeric-7-circle";case 8:return"mdi mdi-numeric-8-circle";case 9:return"mdi mdi-numeric-9-circle"}return e>9?"mdi mdi-numeric-9-plus-circle":null}function instance$5R(e,t,n){let{icon:o}=t,{title:r=null}=t,{padLeft:i=!1}=t,{padRight:a=!1}=t,{style:s=null}=t;return e.$$set=e=>{n(6,t=assign(assign({},t),exclude_internal_props(e))),"icon"in e&&n(0,o=e.icon),"title"in e&&n(1,r=e.title),"padLeft"in e&&n(2,i=e.padLeft),"padRight"in e&&n(3,a=e.padRight),"style"in e&&n(4,s=e.style)},t=exclude_internal_props(t),[o,r,i,a,s,{"icon minus-box":"mdi mdi-minus-box-outline","icon plus-box":"mdi mdi-plus-box-outline","icon plus-thick":"mdi mdi-plus-thick","icon minus-thick":"mdi mdi-minus-thick","icon invisible-box":"mdi mdi-minus-box-outline icon-invisible","icon cloud-upload":"mdi mdi-cloud-upload","icon cloud":"mdi mdi-cloud","icon cloud-public":"mdi mdi-cloud-search","icon cloud-private":"mdi mdi-cloud-key","icon import":"mdi mdi-application-import","icon export":"mdi mdi-application-export","icon new-connection":"mdi mdi-database-plus","icon tables":"mdi mdi-table-multiple","icon favorite":"mdi mdi-star","icon share":"mdi mdi-share-variant","icon add":"mdi mdi-plus-circle","icon minus":"mdi mdi-minus-circle","icon connection":"mdi mdi-connection","icon cell-data":"mdi mdi-details","icon sql-generator":"mdi mdi-cog-transfer","icon keyboard":"mdi mdi-keyboard-settings","icon settings":"mdi mdi-cog","icon users":"mdi mdi-account-multiple","icon role":"mdi mdi-account-group","icon admin":"mdi mdi-security","icon auth":"mdi mdi-account-key","icon version":"mdi mdi-ticket-confirmation","icon pin":"mdi mdi-pin","icon pin-outline":"mdi mdi-pin-outline","icon arrange":"mdi mdi-arrange-send-to-back","icon app":"mdi mdi-layers-triple","icon open-in-new":"mdi mdi-open-in-new","icon add-folder":"mdi mdi-folder-plus-outline","icon add-column":"mdi mdi-table-column-plus-after","icon parameter":"mdi mdi-at","icon trigger":"mdi mdi-lightning-bolt","icon scheduler-event":"mdi mdi-calendar-blank","icon arrow-link":"mdi mdi-arrow-top-right-thick","icon reset":"mdi mdi-cancel","icon window-restore":"mdi mdi-window-restore","icon window-maximize":"mdi mdi-window-maximize","icon window-close":"mdi mdi-window-close","icon window-minimize":"mdi mdi-window-minimize","img dbgate":"mdi mdi-database color-icon-gold","icon columns":"mdi mdi-view-column","icon columns-outline":"mdi mdi-view-column-outline","icon locked-database-mode":"mdi mdi-database-lock","icon unlocked-database-mode":"mdi mdi-database-eye","icon database":"mdi mdi-database","icon server":"mdi mdi-server","icon table":"mdi mdi-table","icon form":"mdi mdi-form-select","icon archive":"mdi mdi-archive","icon file":"mdi mdi-file","icon loading":"mdi mdi-loading mdi-spin","icon close":"mdi mdi-close","icon unsaved":"mdi mdi-record","icon stop":"mdi mdi-close-octagon","icon play":"mdi mdi-play","icon play-stop":"mdi mdi-stop","icon pause":"mdi mdi-pause","icon filter":"mdi mdi-filter","icon filter-off":"mdi mdi-filter-off","icon reload":"mdi mdi-reload","icon refresh":"mdi mdi-refresh","icon undo":"mdi mdi-undo","icon redo":"mdi mdi-redo","icon save":"mdi mdi-content-save","icon account":"mdi mdi-account","icon sql-file":"mdi mdi-file","icon web":"mdi mdi-web","icon home":"mdi mdi-home","icon query-design":"mdi mdi-vector-polyline-edit","icon form":"mdi mdi-form-select","icon history":"mdi mdi-history","icon structure":"mdi mdi-tools","icon square":"mdi mdi-square","icon data-deploy":"mdi mdi-database-settings","icon cloud-account":"mdi mdi-account-remove-outline","icon cloud-account-connected":"mdi mdi-account-check-outline","icon edit":"mdi mdi-pencil","icon delete":"mdi mdi-delete","icon arrow-up":"mdi mdi-arrow-up","icon arrow-down":"mdi mdi-arrow-down","icon arrow-left":"mdi mdi-arrow-left","icon arrow-begin":"mdi mdi-arrow-collapse-left","icon arrow-end":"mdi mdi-arrow-collapse-right","icon arrow-right":"mdi mdi-arrow-right","icon arrow-left-bold":"mdi mdi-arrow-left-bold","icon arrow-right-bold":"mdi mdi-arrow-right-bold","icon triple-left":"mdi mdi-chevron-triple-left","icon triple-right":"mdi mdi-chevron-triple-right","icon triple-up":"mdi mdi-chevron-triple-up","icon triple-down":"mdi mdi-chevron-triple-down","icon format-code":"mdi mdi-code-tags-check","icon show-wizard":"mdi mdi-comment-edit","icon disconnected":"mdi mdi-lan-disconnect","icon theme":"mdi mdi-brightness-6","icon error":"mdi mdi-close-circle","icon ok":"mdi mdi-check-circle","icon check":"mdi mdi-check","icon markdown":"mdi mdi-application","icon preview":"mdi mdi-file-find","icon eye":"mdi mdi-eye","icon check-all":"mdi mdi-check-all","icon checkbox-blank":"mdi mdi-checkbox-blank-outline","icon checkbox-marked":"mdi mdi-checkbox-marked-outline","icon dots-horizontal":"mdi mdi-dots-horizontal","icon dots-vertical":"mdi mdi-dots-vertical","icon add":"mdi mdi-plus-circle","icon json":"mdi mdi-code-json","icon lock":"mdi mdi-lock","icon custom-join":"mdi mdi-arrow-left-right-bold","icon parent-filter":"mdi mdi-home-alert","icon parent-filter-outline":"mdi mdi-home-alert-outline","icon download":"mdi mdi-download","icon text":"mdi mdi-text","icon ai":"mdi mdi-head-lightbulb","icon wait":"mdi mdi-timer-sand","icon more":"mdi mdi-more","icon copy":"mdi mdi-content-copy","icon run":"mdi mdi-play","icon chevron-down":"mdi mdi-chevron-down","icon chevron-left":"mdi mdi-chevron-left","icon chevron-right":"mdi mdi-chevron-right","icon chevron-up":"mdi mdi-chevron-up","icon chevron-double-down":"mdi mdi-chevron-double-down","icon chevron-double-left":"mdi mdi-chevron-double-left","icon chevron-double-right":"mdi mdi-chevron-double-right","icon chevron-double-up":"mdi mdi-chevron-double-up","icon menu-right":"mdi mdi-menu-right","icon plugin":"mdi mdi-toy-brick","icon menu":"mdi mdi-menu","icon add-column":"mdi mdi-table-column-plus-after","icon add-key":"mdi mdi-key-plus","icon report":"mdi mdi-file-chart","icon swap":"mdi mdi-swap-horizontal-bold","icon deploy":"mdi mdi-content-save-move","icon compare":"mdi mdi-compare","icon no-color":"mdi mdi-format-color-marker-cancel","icon palette":"mdi mdi-palette","icon split":"mdi mdi-view-split-vertical","icon num-0":"mdi mdi-numeric-0-circle","icon num-1":"mdi mdi-numeric-1-circle","icon num-2":"mdi mdi-numeric-2-circle","icon num-3":"mdi mdi-numeric-3-circle","icon num-4":"mdi mdi-numeric-4-circle","icon num-5":"mdi mdi-numeric-5-circle","icon num-6":"mdi mdi-numeric-6-circle","icon num-7":"mdi mdi-numeric-7-circle","icon num-8":"mdi mdi-numeric-8-circle","icon num-9":"mdi mdi-numeric-9-circle","icon num-9-plus":"mdi mdi-numeric-9-plus-circle","icon num-0-outline":"mdi mdi-numeric-0-circle-outline","icon num-1-outline":"mdi mdi-numeric-1-circle-outline","icon num-2-outline":"mdi mdi-numeric-2-circle-outline","icon num-3-outline":"mdi mdi-numeric-3-circle-outline","icon num-4-outline":"mdi mdi-numeric-4-circle-outline","icon num-5-outline":"mdi mdi-numeric-5-circle-outline","icon num-6-outline":"mdi mdi-numeric-6-circle-outline","icon num-7-outline":"mdi mdi-numeric-7-circle-outline","icon num-8-outline":"mdi mdi-numeric-8-circle-outline","icon num-9-outline":"mdi mdi-numeric-9-circle-outline","icon num-9-plus-outline":"mdi mdi-numeric-9-plus-circle-outline","icon type-string":"mdi mdi-code-string","icon type-object":"mdi mdi-code-braces-box","icon type-array":"mdi mdi-code-array","icon type-number":"mdi mdi-pound-box","icon type-boolean":"mdi mdi-code-equal","icon type-date":"mdi mdi-alpha-d-box","icon type-objectid":"mdi mdi-alpha-i-box","icon type-null":"mdi mdi-code-equal","icon type-unknown":"mdi mdi-help-box","icon equal":"mdi mdi-equal","icon not-equal":"mdi mdi-not-equal-variant","icon at":"mdi mdi-at","icon expand-all":"mdi mdi-expand-all","icon collapse-all":"mdi mdi-collapse-all","icon transaction":"mdi mdi-code-json","icon commit":"mdi mdi-check-circle","icon rollback":"mdi mdi-close-circle","icon autocommit-on":"mdi mdi-check-circle","icon autocommit-off":"mdi mdi-check-circle-outline","icon premium":"mdi mdi-star","icon upload":"mdi mdi-upload","icon limit":"mdi mdi-car-speed-limiter","img ok":"mdi mdi-check-circle color-icon-green","img ok-inv":"mdi mdi-check-circle color-icon-inv-green","img alert":"mdi mdi-alert-circle color-icon-blue","img error":"mdi mdi-close-circle color-icon-red","img error-inv":"mdi mdi-close-circle color-icon-inv-red","img warn":"mdi mdi-alert color-icon-gold","img info":"mdi mdi-information color-icon-blue","img debug":"mdi mdi-monitor color-icon-green","img circular":"mdi mdi-circular-saw color-icon-red","img archive":"mdi mdi-table color-icon-gold","img archive-folder":"mdi mdi-database-outline color-icon-green","img zipfile":"mdi mdi-zip-box color-icon-gold","img autoincrement":"mdi mdi-numeric-1-box-multiple-outline","img column":"mdi mdi-table-column","img server":"mdi mdi-server color-icon-blue","img primary-key":"mdi mdi-key-star color-icon-yellow","img foreign-key":"mdi mdi-key-link","img sql-file":"mdi mdi-file","img anyfile":"mdi mdi-file-question color-icon-red","img shell":"mdi mdi-flash color-icon-blue","img chart":"mdi mdi-chart-bar color-icon-magenta","img markdown":"mdi mdi-application color-icon-red","img preview":"mdi mdi-file-find color-icon-red","img favorite":"mdi mdi-star color-icon-yellow","img query-design":"mdi mdi-vector-polyline-edit color-icon-red","img diagram":"mdi mdi-graph color-icon-blue","img yaml":"mdi mdi-code-brackets color-icon-red","img compare":"mdi mdi-compare color-icon-red","img app":"mdi mdi-layers-triple color-icon-magenta","img app-command":"mdi mdi-flash color-icon-green","img app-query":"mdi mdi-view-comfy color-icon-magenta","img connection":"mdi mdi-connection color-icon-blue","img profiler":"mdi mdi-gauge color-icon-blue","img users":"mdi mdi-account-multiple color-icon-blue","img role":"mdi mdi-account-group color-icon-blue","img admin":"mdi mdi-security color-icon-blue","img auth":"mdi mdi-account-key color-icon-blue","img cloud-connection":"mdi mdi-cloud-lock color-icon-blue","img add":"mdi mdi-plus-circle color-icon-green","img minus":"mdi mdi-minus-circle color-icon-red","img equal":"mdi mdi-equal","img changed":"mdi mdi-file-edit color-icon-yellow","img free-table":"mdi mdi-table color-icon-green","img macro":"mdi mdi-hammer-wrench","img json":"mdi mdi-code-json icon-magenta","img database":"mdi mdi-database color-icon-gold","img sqlite-database":"mdi mdi-database color-icon-blue","img table":"mdi mdi-table color-icon-blue","img raw-table":"mdi mdi-table-large color-icon-blue","img collection":"mdi mdi-table color-icon-red","img query-data":"mdi mdi-table color-icon-yellow","img view":"mdi mdi-table color-icon-magenta","img raw-view":"mdi mdi-table-large color-icon-magenta","img procedure":"mdi mdi-cog color-icon-blue","img function":"mdi mdi-function-variant","img table-structure":"mdi mdi-tools color-icon-blue","img view-structure":"mdi mdi-tools color-icon-magenta","img sort-asc":"mdi mdi-sort-alphabetical-ascending color-icon-green","img sort-desc":"mdi mdi-sort-alphabetical-descending color-icon-green","img map":"mdi mdi-map color-icon-blue","img reference":"mdi mdi-link-box","img link":"mdi mdi-link","img filter":"mdi mdi-filter","img group":"mdi mdi-group","img perspective":"mdi mdi-eye color-icon-yellow","img parent-filter":"mdi mdi-home-alert color-icon-yellow","img folder":"mdi mdi-folder color-icon-yellow","img type-string":"mdi mdi-alphabetical color-icon-blue","img type-hash":"mdi mdi-pound color-icon-blue","img type-set":"mdi mdi-format-list-bulleted color-icon-blue","img type-list":"mdi mdi-format-list-numbered color-icon-blue","img type-zset":"mdi mdi-format-list-checks color-icon-blue","img type-stream":"mdi mdi-view-stream color-icon-blue","img type-binary":"mdi mdi-file color-icon-blue","img type-rejson":"mdi mdi-color-json color-icon-blue","img keydb":"mdi mdi-key color-icon-blue","img replicator":"mdi mdi-content-duplicate color-icon-green","img import":"mdi mdi-database-import color-icon-green","img export":"mdi mdi-database-export color-icon-green","img transform":"mdi mdi-rotate-orbit color-icon-blue","img tip":"mdi mdi-lightbulb-on color-icon-yellow","img filter-active":"mdi mdi-filter-cog color-icon-blue","img db-backup":"mdi mdi-database-export color-icon-yellow","img db-restore":"mdi mdi-database-import color-icon-red","img settings":"mdi mdi-cog color-icon-blue","img data-deploy":"mdi mdi-database-settings color-icon-green"},t,function(t){bubble.call(this,e,t)}]}class FontIcon extends SvelteComponent{constructor(e){super(),init(this,e,instance$5R,create_fragment$5X,safe_not_equal,{icon:0,title:1,padLeft:2,padRight:3,style:4})}}function create_fragment$5W(e){let t,n,o,r,i,a;const s=e[8].default,c=create_slot(s,e,e[7],null);return{c(){t=element("div"),n=element("div"),c&&c.c(),attr(n,"class","inner svelte-1dacrl4"),attr(t,"class","outer buttonLike svelte-1dacrl4"),attr(t,"title",e[3]),attr(t,"data-testid",o=e[5]["data-testid"]),toggle_class(t,"disabled",e[0]),toggle_class(t,"square",e[1]),toggle_class(t,"narrow",e[2])},m(o,s){insert(o,t,s),append(t,n),c&&c.m(n,null),e[10](t),r=!0,i||(a=listen(t,"click",e[9]),i=!0)},p(e,[n]){c&&c.p&&(!r||128&n)&&update_slot_base(c,s,e,e[7],r?get_slot_changes(s,e[7],n,null):get_all_dirty_from_scope(e[7]),null),(!r||8&n)&&attr(t,"title",e[3]),(!r||32&n&&o!==(o=e[5]["data-testid"]))&&attr(t,"data-testid",o),(!r||1&n)&&toggle_class(t,"disabled",e[0]),(!r||2&n)&&toggle_class(t,"square",e[1]),(!r||4&n)&&toggle_class(t,"narrow",e[2])},i(e){r||(transition_in(c,e),r=!0)},o(e){transition_out(c,e),r=!1},d(n){n&&detach(t),c&&c.d(n),e[10](null),i=!1,a()}}}function instance$5Q(e,t,n){let o,{$$slots:r={},$$scope:i}=t,{disabled:a=!1}=t,{square:s=!1}=t,{narrow:c=!1}=t,{title:l=null}=t;return e.$$set=e=>{n(5,t=assign(assign({},t),exclude_internal_props(e))),"disabled"in e&&n(0,a=e.disabled),"square"in e&&n(1,s=e.square),"narrow"in e&&n(2,c=e.narrow),"title"in e&&n(3,l=e.title),"$$scope"in e&&n(7,i=e.$$scope)},t=exclude_internal_props(t),[a,s,c,l,o,t,function(){return o.getBoundingClientRect()},i,r,function(t){bubble.call(this,e,t)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(4,o)}))}]}class InlineButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$5Q,create_fragment$5W,safe_not_equal,{disabled:0,square:1,narrow:2,title:3,getBoundingClientRect:6})}get getBoundingClientRect(){return this.$$.ctx[6]}}function create_fragment$5V(e){let t,n,o,r=[{type:"text"},e[3],{autocomplete:e[2]}],i={};for(let e=0;e<r.length;e+=1)i=assign(i,r[e]);return{c(){t=element("input"),set_attributes(t,i)},m(r,i){insert(r,t,i),t.autofocus&&t.focus(),set_input_value(t,e[0]),e[10](t),n||(o=[listen(t,"input",e[9]),listen(t,"change",e[5]),listen(t,"input",e[6]),listen(t,"click",e[7]),listen(t,"keydown",e[8])],n=!0)},p(e,[n]){set_attributes(t,i=get_spread_update(r,[{type:"text"},8&n&&e[3],4&n&&{autocomplete:e[2]}])),1&n&&t.value!==e[0]&&set_input_value(t,e[0])},i:noop$2,o:noop$2,d(r){r&&detach(t),e[10](null),n=!1,run_all(o)}}}function instance$5P(e,t,n){const o=["value","focused","domEditor","autocomplete"];let r=compute_rest_props(t,o),{value:i}=t,{focused:a=!1}=t,{domEditor:s}=t,{autocomplete:c="new-password"}=t;return a&&onMount((()=>s.focus())),e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(3,r=compute_rest_props(t,o)),"value"in e&&n(0,i=e.value),"focused"in e&&n(4,a=e.focused),"domEditor"in e&&n(1,s=e.domEditor),"autocomplete"in e&&n(2,c=e.autocomplete)},[i,s,c,r,a,function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(){i=this.value,n(0,i)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{s=e,n(1,s)}))}]}class TextField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5P,create_fragment$5V,safe_not_equal,{value:0,focused:4,domEditor:1,autocomplete:2})}}function create_if_block$2u(e){let t,n;return t=new InlineButton({props:{disabled:e[1],$$slots:{default:[create_default_slot$2b]},$$scope:{ctx:e}}}),t.$on("click",e[12]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};2&n&&(o.disabled=e[1]),8192&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot$2b(e){let t,n;return t=new FontIcon({props:{icon:"icon eye"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5U(e){let t,n,o,r;const i=[e[8],{disabled:e[1]},{value:e[5]?"":e[3]},{placeholder:e[5]?"(Password is encrypted)":void 0},{type:e[5]||e[4]?"text":"password"}];let a={};for(let e=0;e<i.length;e+=1)a=assign(a,i[e]);n=new TextField({props:a}),n.$on("change",e[10]),n.$on("input",e[11]);let s=!e[5]&&create_if_block$2u(e);return{c(){t=element("div"),create_component(n.$$.fragment),o=space(),s&&s.c(),attr(t,"class","flex")},m(e,i){insert(e,t,i),mount_component(n,t,null),append(t,o),s&&s.m(t,null),r=!0},p(e,[o]){const r=314&o?get_spread_update(i,[256&o&&get_spread_object(e[8]),2&o&&{disabled:e[1]},40&o&&{value:e[5]?"":e[3]},32&o&&{placeholder:e[5]?"(Password is encrypted)":void 0},48&o&&{type:e[5]||e[4]?"text":"password"}]):{};n.$set(r),e[5]?s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros()):s?(s.p(e,o),32&o&&transition_in(s,1)):(s=create_if_block$2u(e),s.c(),transition_in(s,1),s.m(t,null))},i(e){r||(transition_in(n.$$.fragment,e),transition_in(s),r=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(s),r=!1},d(e){e&&detach(t),destroy_component(n),s&&s.d()}}}function instance$5O(e,t,n){let o,r;const i=["name","disabled","saveOnInput"];let a,s=compute_rest_props(t,i),{name:c}=t,{disabled:l=!1}=t,{saveOnInput:u=!1}=t;const{values:d,setFieldValue:p}=getFormContext();component_subscribe(e,d,(e=>n(9,a=e)));let m=!1;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(8,s=compute_rest_props(t,i)),"name"in e&&n(0,c=e.name),"disabled"in e&&n(1,l=e.disabled),"saveOnInput"in e&&n(2,u=e.saveOnInput)},e.$$.update=()=>{513&e.$$.dirty&&n(3,o=a[c]),8&e.$$.dirty&&n(5,r=o&&o.startsWith("crypt:"))},[c,l,u,o,m,r,d,p,s,a,e=>p(c,e.target.value),e=>{u&&p(c,e.target.value)},()=>n(4,m=!m)]}class FormPasswordFieldRaw extends SvelteComponent{constructor(e){super(),init(this,e,instance$5O,create_fragment$5U,safe_not_equal,{name:0,disabled:1,saveOnInput:2})}}function create_default_slot$2a(e){let t,n;const o=[{name:e[1]},e[4]];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormPasswordFieldRaw({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=18&n?get_spread_update(o,[2&n&&{name:e[1]},16&n&&get_spread_object(e[4])]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5T(e){let t,n,o;const r=[{type:"text"},{label:e[0]},e[2]];var i=e[3];function a(e){let t={$$slots:{default:[create_default_slot$2a]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=5&o?get_spread_update(r,[r[0],1&o&&{label:e[0]},4&o&&get_spread_object(e[2])]):{};if(50&o&&(s.$$scope={dirty:o,ctx:e}),i!==(i=e[3])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5N(e,t,n){const o=["label","name","templateProps"];let r=compute_rest_props(t,o),{label:i}=t,{name:a}=t,{templateProps:s={}}=t;const{template:c}=getFormContext();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(4,r=compute_rest_props(t,o)),"label"in e&&n(0,i=e.label),"name"in e&&n(1,a=e.name),"templateProps"in e&&n(2,s=e.templateProps)},[i,a,s,c,r]}class FormPasswordField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5N,create_fragment$5T,safe_not_equal,{label:0,name:1,templateProps:2})}}function create_fragment$5S(e){let t,n;const o=[{type:"submit"},{disabled:e[0]},e[3]];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormStyledButton({props:r}),t.$on("click",e[2]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=9&n?get_spread_update(o,[o[0],1&n&&{disabled:e[0]},8&n&&get_spread_object(e[3])]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5M(e,t,n){let o,{disabled:r=!1}=t;const i=createEventDispatcher(),{submitActionRef:a}=getFormContext(),{values:s}=getFormContext();function c(){i("click",o)}return component_subscribe(e,s,(e=>n(4,o=e))),a.set((()=>{r||c()})),e.$$set=e=>{n(3,t=assign(assign({},t),exclude_internal_props(e))),"disabled"in e&&n(0,r=e.disabled)},t=exclude_internal_props(t),[r,s,c,t]}class FormSubmit extends SvelteComponent{constructor(e){super(),init(this,e,instance$5M,create_fragment$5S,safe_not_equal,{disabled:0})}}function create_fragment$5R(e){let t,n;const o=[e[6],{value:e[3][e[0]]??e[1]}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new TextField({props:r}),t.$on("input",e[7]),t.$on("input",e[8]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=75&n?get_spread_update(o,[64&n&&get_spread_object(e[6]),11&n&&{value:e[3][e[0]]??e[1]}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5L(e,t,n){const o=["name","defaultValue","saveOnInput"];let r,i=compute_rest_props(t,o),{name:a}=t,{defaultValue:s}=t,{saveOnInput:c=!1}=t;const{values:l,setFieldValue:u}=getFormContext();component_subscribe(e,l,(e=>n(3,r=e)));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(6,i=compute_rest_props(t,o)),"name"in e&&n(0,a=e.name),"defaultValue"in e&&n(1,s=e.defaultValue),"saveOnInput"in e&&n(2,c=e.saveOnInput)},[a,s,c,r,l,u,i,e=>u(a,e.target.value),e=>{c&&u(a,e.target.value)}]}class FormTextFieldRaw extends SvelteComponent{constructor(e){super(),init(this,e,instance$5L,create_fragment$5R,safe_not_equal,{name:0,defaultValue:1,saveOnInput:2})}}function create_default_slot$29(e){let t,n;const o=[{name:e[1]},e[5],{focused:e[3]}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormTextFieldRaw({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=42&n?get_spread_update(o,[2&n&&{name:e[1]},32&n&&get_spread_object(e[5]),8&n&&{focused:e[3]}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5Q(e){let t,n,o;const r=[{type:"text"},{label:e[0]},e[2]];var i=e[4];function a(e){let t={$$slots:{default:[create_default_slot$29]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=5&o?get_spread_update(r,[r[0],1&o&&{label:e[0]},4&o&&get_spread_object(e[2])]):{};if(106&o&&(s.$$scope={dirty:o,ctx:e}),i!==(i=e[4])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5K(e,t,n){const o=["label","name","templateProps","focused"];let r=compute_rest_props(t,o),{label:i}=t,{name:a}=t,{templateProps:s={}}=t,{focused:c=!1}=t;const{template:l}=getFormContext();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(5,r=compute_rest_props(t,o)),"label"in e&&n(0,i=e.label),"name"in e&&n(1,a=e.name),"templateProps"in e&&n(2,s=e.templateProps),"focused"in e&&n(3,c=e.focused)},[i,a,s,c,l,r]}class FormTextField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5K,create_fragment$5Q,safe_not_equal,{label:0,name:1,templateProps:2,focused:3})}}function create_default_slot$28(e){let t;const n=e[3].default,o=create_slot(n,e,e[4],null);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||16&r)&&update_slot_base(o,n,e,e[4],t?get_slot_changes(n,e[4],r,null):get_all_dirty_from_scope(e[4]),null)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_fragment$5P(e){let t,n;return t=new FormProviderCore({props:{values:e[1],template:e[0],$$slots:{default:[create_default_slot$28]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.template=e[0]),16&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5J(e,t,n){let{$$slots:o={},$$scope:r}=t,{initialValues:i={}}=t,{template:a=FormFieldTemplateLarge}=t;const s=writable(i);return e.$$set=e=>{"initialValues"in e&&n(2,i=e.initialValues),"template"in e&&n(0,a=e.template),"$$scope"in e&&n(4,r=e.$$scope)},[a,s,i,o,r]}class FormProvider extends SvelteComponent{constructor(e){super(),init(this,e,instance$5J,create_fragment$5P,safe_not_equal,{initialValues:2,template:0})}}function clickOutside(e){const t=t=>{!e||e.contains(t.target)||t.defaultPrevented||e.dispatchEvent(new CustomEvent("clickOutside"))};return document.addEventListener("mousedown",t,!0),{destroy(){document.removeEventListener("mousedown",t,!0)}}}const get_footer_slot_changes=e=>({}),get_footer_slot_context=e=>({}),get_header_slot_changes=e=>({}),get_header_slot_context=e=>({});function create_if_block_1$1w(e){let t,n,o,r,i,a,s,c;const l=e[9].header,u=create_slot(l,e,e[8],get_header_slot_context);return i=new FontIcon({props:{icon:"icon close"}}),{c(){t=element("div"),n=element("div"),u&&u.c(),o=space(),r=element("div"),create_component(i.$$.fragment),attr(r,"class","close svelte-1k8vlpo"),attr(t,"class","header svelte-1k8vlpo"),toggle_class(t,"fullScreen",e[0])},m(l,d){insert(l,t,d),append(t,n),u&&u.m(n,null),append(t,o),append(t,r),mount_component(i,r,null),a=!0,s||(c=listen(r,"click",e[3]),s=!0)},p(e,n){u&&u.p&&(!a||256&n)&&update_slot_base(u,l,e,e[8],a?get_slot_changes(l,e[8],n,get_header_slot_changes):get_all_dirty_from_scope(e[8]),get_header_slot_context),(!a||1&n)&&toggle_class(t,"fullScreen",e[0])},i(e){a||(transition_in(u,e),transition_in(i.$$.fragment,e),a=!0)},o(e){transition_out(u,e),transition_out(i.$$.fragment,e),a=!1},d(e){e&&detach(t),u&&u.d(e),destroy_component(i),s=!1,c()}}}function create_if_block$2t(e){let t,n;const o=e[9].footer,r=create_slot(o,e,e[8],get_footer_slot_context);return{c(){t=element("div"),r&&r.c(),attr(t,"class","footer svelte-1k8vlpo"),toggle_class(t,"fullScreen",e[0])},m(e,o){insert(e,t,o),r&&r.m(t,null),n=!0},p(e,i){r&&r.p&&(!n||256&i)&&update_slot_base(r,o,e,e[8],n?get_slot_changes(o,e[8],i,get_footer_slot_changes):get_all_dirty_from_scope(e[8]),get_footer_slot_context),(!n||1&i)&&toggle_class(t,"fullScreen",e[0])},i(e){n||(transition_in(r,e),n=!0)},o(e){transition_out(r,e),n=!1},d(e){e&&detach(t),r&&r.d(e)}}}function create_fragment$5O(e){let t,n,o,r,i,a,s,c,l=e[6].header&&create_if_block_1$1w(e);const u=e[9].default,d=create_slot(u,e,e[8],null);let p=e[6].footer&&create_if_block$2t(e);return{c(){t=element("div"),n=element("div"),l&&l.c(),o=space(),r=element("div"),d&&d.c(),i=space(),p&&p.c(),attr(r,"class","content svelte-1k8vlpo"),toggle_class(r,"noPadding",e[1]),toggle_class(r,"fullScreen",e[0]),attr(n,"class","window svelte-1k8vlpo"),attr(n,"data-testid","ModalBase_window"),toggle_class(n,"fullScreen",e[0]),toggle_class(n,"simple",e[2]),attr(t,"id","myModal"),attr(t,"class","bglayer svelte-1k8vlpo")},m(u,m){insert(u,t,m),append(t,n),l&&l.m(n,null),append(n,o),append(n,r),d&&d.m(r,null),append(n,i),p&&p.m(n,null),a=!0,s||(c=[listen(window,"keydown",e[5]),action_destroyer(clickOutside.call(null,n)),listen(n,"clickOutside",e[4])],s=!0)},p(e,[t]){e[6].header?l?(l.p(e,t),64&t&&transition_in(l,1)):(l=create_if_block_1$1w(e),l.c(),transition_in(l,1),l.m(n,o)):l&&(group_outros(),transition_out(l,1,1,(()=>{l=null})),check_outros()),d&&d.p&&(!a||256&t)&&update_slot_base(d,u,e,e[8],a?get_slot_changes(u,e[8],t,null):get_all_dirty_from_scope(e[8]),null),(!a||2&t)&&toggle_class(r,"noPadding",e[1]),(!a||1&t)&&toggle_class(r,"fullScreen",e[0]),e[6].footer?p?(p.p(e,t),64&t&&transition_in(p,1)):(p=create_if_block$2t(e),p.c(),transition_in(p,1),p.m(n,null)):p&&(group_outros(),transition_out(p,1,1,(()=>{p=null})),check_outros()),(!a||1&t)&&toggle_class(n,"fullScreen",e[0]),(!a||4&t)&&toggle_class(n,"simple",e[2])},i(e){a||(transition_in(l),transition_in(d,e),transition_in(p),a=!0)},o(e){transition_out(l),transition_out(d,e),transition_out(p),a=!1},d(e){e&&detach(t),l&&l.d(),d&&d.d(e),p&&p.d(),s=!1,run_all(c)}}}function instance$5I(e,t,n){let o;component_subscribe(e,currentDropDownMenu,(e=>n(10,o=e)));let{$$slots:r={},$$scope:i}=t;const a=compute_slots(r);let{fullScreen:s=!1}=t,{noPadding:c=!1}=t,{simple:l=!1}=t,{modalId:u}=t;function d(){u==getActiveModalId()&&closeModal(u)}return onMount((()=>{const e=document.activeElement;return()=>{e&&e.focus()}})),e.$$set=e=>{"fullScreen"in e&&n(0,s=e.fullScreen),"noPadding"in e&&n(1,c=e.noPadding),"simple"in e&&n(2,l=e.simple),"modalId"in e&&n(7,u=e.modalId),"$$scope"in e&&n(8,i=e.$$scope)},[s,c,l,d,function(){o||d()},function(e){e.keyCode==keycodes.escape&&d()},a,u,i,r]}class ModalBase extends SvelteComponent{constructor(e){super(),init(this,e,instance$5I,create_fragment$5O,safe_not_equal,{fullScreen:0,noPadding:1,simple:2,modalId:7})}}function create_else_block$19(e){let t,n,o,r,i,a,s;return o=new FontIcon({props:{icon:"img error"}}),{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=element("div"),a=text$1(e[1]),attr(n,"class","icon svelte-1a6igp5"),attr(i,"data-testid","ErrorMessageModal_message"),attr(t,"class","wrapper svelte-1a6igp5")},m(e,c){insert(e,t,c),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),append(i,a),s=!0},p(e,t){(!s||2&t)&&set_data(a,e[1])},i(e){s||(transition_in(o.$$.fragment,e),s=!0)},o(e){transition_out(o.$$.fragment,e),s=!1},d(e){e&&detach(t),destroy_component(o)}}}function create_if_block$2s(e){let t,n;return{c(){t=element("pre"),n=text$1(e[1]),attr(t,"class","svelte-1a6igp5")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){2&t&&set_data(n,e[1])},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_default_slot_1$1q(e){let t,n,o,r;const i=[create_if_block$2s,create_else_block$19],a=[];function s(e,t){return e[2]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_header_slot$F(e){let t,n;return{c(){t=element("div"),n=text$1(e[0]),attr(t,"slot","header")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){1&t&&set_data(n,e[0])},d(e){e&&detach(t)}}}function create_footer_slot$D(e){let t,n,o;return n=new FormSubmit({props:{value:"Close","data-testid":"ErrorMessageModal_closeButton"}}),n.$on("click",closeCurrentModal),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"slot","footer")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_default_slot$27(e){let t,n;const o=[e[3]];let r={$$slots:{footer:[create_footer_slot$D],header:[create_header_slot$F],default:[create_default_slot_1$1q]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=8&n?get_spread_update(o,[get_spread_object(e[3])]):{};23&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5N(e){let t,n;return t=new FormProvider({props:{$$slots:{default:[create_default_slot$27]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};31&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5H(e,t,n){const o=["title","message","showAsCode"];let r=compute_rest_props(t,o),{title:i="Error"}=t,{message:a}=t,{showAsCode:s=!1}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(3,r=compute_rest_props(t,o)),"title"in e&&n(0,i=e.title),"message"in e&&n(1,a=e.message),"showAsCode"in e&&n(2,s=e.showAsCode)},[i,a,s,r]}class ErrorMessageModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5H,create_fragment$5N,safe_not_equal,{title:0,message:1,showAsCode:2})}}let compiled=null;function hasPermission(e){return lib$5.testPermission(e,compiled)}function subscribePermissionCompiler(){useConfig().subscribe((e=>{if(!e)return;const{permissions:t}=e;compiled=lib$5.compilePermissions(t)}))}function setConfigForPermissions(e){compiled=lib$5.compilePermissions((null==e?void 0:e.permissions)||[])}const doServerPing=e=>{const t=getCurrentConfig(),n=[...e];t.storageDatabase&&hasPermission("internal-storage")&&n.push("__storage"),n.push(...getVolatileConnections()),t.singleConnection&&n.push(t.singleConnection._id),apiCall("server-connections/ping",{conidArray:_.compact(n),strmid:strmid})},doDatabasePing=e=>{const t=_.get(e,"name"),n=_.get(e,"connection._id");n&&t&&apiCall("database-connections/ping",{conid:n,database:t})};let openedConnectionsHandle=null,currentDatabaseHandle=null;function subscribeConnectionPingers(){openedConnectionsWithTemporary.subscribe((e=>{doServerPing(e),openedConnectionsHandle&&window.clearInterval(openedConnectionsHandle),openedConnectionsHandle=window.setInterval((()=>doServerPing(e)),2e4)})),currentDatabase.subscribe((e=>{doDatabasePing(e),currentDatabaseHandle&&window.clearInterval(currentDatabaseHandle),currentDatabaseHandle=window.setInterval((()=>doDatabasePing(e)),2e4)}))}function callServerPing(){const e=getOpenedConnections();doServerPing(e)}function create_if_block_2$11(e){let t,n,o,r;return n=new FontIcon({props:{icon:"icon loading"}}),{c(){t=element("div"),create_component(n.$$.fragment),o=text$1(" Testing connection")},m(e,i){insert(e,t,i),mount_component(n,t,null),append(t,o),r=!0},i(e){r||(transition_in(n.$$.fragment,e),r=!0)},o(e){transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block_1$1v(e){let t,n,o,r,i,a,s,c,l=e[1].error+"";return o=new FontIcon({props:{icon:"img error"}}),s=new Link$1({props:{onClick:e[14],$$slots:{default:[create_default_slot_2$J]},$$scope:{ctx:e}}}),{c(){t=element("div"),n=text$1("Connect failed: "),create_component(o.$$.fragment),r=space(),i=text$1(l),a=space(),create_component(s.$$.fragment),attr(t,"class","error-result")},m(e,l){insert(e,t,l),append(t,n),mount_component(o,t,null),append(t,r),append(t,i),append(t,a),mount_component(s,t,null),c=!0},p(e,t){(!c||2&t)&&l!==(l=e[1].error+"")&&set_data(i,l);const n={};2&t&&(n.onClick=e[14]),1048576&t&&(n.$$scope={dirty:t,ctx:e}),s.$set(n)},i(e){c||(transition_in(o.$$.fragment,e),transition_in(s.$$.fragment,e),c=!0)},o(e){transition_out(o.$$.fragment,e),transition_out(s.$$.fragment,e),c=!1},d(e){e&&detach(t),destroy_component(o),destroy_component(s)}}}function create_default_slot_2$J(e){let t;return{c(){t=text$1("Show detail")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_default_slot_1$1p(e){let t,n,o,r,i,a,s,c,l;t=new FormTextField({props:{label:"Connection",name:"connectionLabel",disabled:!0}}),o=new FormTextField({props:{label:"Username",name:"user",autocomplete:"username",disabled:"askPassword"==e[3],focused:"askUser"==e[3],saveOnInput:!0,"data-testid":"DatabaseLoginModal_username"}}),i=new FormPasswordField({props:{label:"Password",name:"password",autocomplete:"current-password",focused:"askPassword"==e[3],saveOnInput:!0,"data-testid":"DatabaseLoginModal_password"}});let u=e[0]&&create_if_block_2$11(),d=!e[0]&&e[1]&&"error"==e[1].msgtype&&create_if_block_1$1v(e);return{c(){create_component(t.$$.fragment),n=space(),create_component(o.$$.fragment),r=space(),create_component(i.$$.fragment),a=space(),u&&u.c(),s=space(),d&&d.c(),c=empty()},m(e,p){mount_component(t,e,p),insert(e,n,p),mount_component(o,e,p),insert(e,r,p),mount_component(i,e,p),insert(e,a,p),u&&u.m(e,p),insert(e,s,p),d&&d.m(e,p),insert(e,c,p),l=!0},p(e,t){const n={};8&t&&(n.disabled="askPassword"==e[3]),8&t&&(n.focused="askUser"==e[3]),o.$set(n);const r={};8&t&&(r.focused="askPassword"==e[3]),i.$set(r),e[0]?u?1&t&&transition_in(u,1):(u=create_if_block_2$11(),u.c(),transition_in(u,1),u.m(s.parentNode,s)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros()),!e[0]&&e[1]&&"error"==e[1].msgtype?d?(d.p(e,t),3&t&&transition_in(d,1)):(d=create_if_block_1$1v(e),d.c(),transition_in(d,1),d.m(c.parentNode,c)):d&&(group_outros(),transition_out(d,1,1,(()=>{d=null})),check_outros())},i(e){l||(transition_in(t.$$.fragment,e),transition_in(o.$$.fragment,e),transition_in(i.$$.fragment,e),transition_in(u),transition_in(d),l=!0)},o(e){transition_out(t.$$.fragment,e),transition_out(o.$$.fragment,e),transition_out(i.$$.fragment,e),transition_out(u),transition_out(d),l=!1},d(e){destroy_component(t,e),e&&detach(n),destroy_component(o,e),e&&detach(r),destroy_component(i,e),e&&detach(a),u&&u.d(e),e&&detach(s),d&&d.d(e),e&&detach(c)}}}function create_header_slot$E(e){let t,n,o;return{c(){t=text$1("Database Log In ("),n=text$1(e[2]),o=text$1(")")},m(e,r){insert(e,t,r),insert(e,n,r),insert(e,o,r)},p(e,t){4&t&&set_data(n,e[2])},d(e){e&&detach(t),e&&detach(n),e&&detach(o)}}}function create_else_block$18(e){let t,n;return t=new FormSubmit({props:{value:"Connect","data-testid":"DatabaseLoginModal_connect"}}),t.$on("click",e[6]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block$2r(e){let t,n;return t=new FormStyledButton({props:{value:"Stop connecting","data-testid":"DatabaseLoginModal_stop"}}),t.$on("click",e[5]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_footer_slot$C(e){let t,n,o,r,i;const a=[create_if_block$2r,create_else_block$18],s=[];function c(e,t){return e[0]?0:1}return t=c(e),n=s[t]=a[t](e),r=new FormStyledButton({props:{value:"Close","data-testid":"DatabaseLoginModal_close"}}),r.$on("click",closeCurrentModal),{c(){n.c(),o=space(),create_component(r.$$.fragment)},m(e,n){s[t].m(e,n),insert(e,o,n),mount_component(r,e,n),i=!0},p(e,r){let i=t;t=c(e),t===i?s[t].p(e,r):(group_outros(),transition_out(s[i],1,1,(()=>{s[i]=null})),check_outros(),n=s[t],n?n.p(e,r):(n=s[t]=a[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){i||(transition_in(n),transition_in(r.$$.fragment,e),i=!0)},o(e){transition_out(n),transition_out(r.$$.fragment,e),i=!1},d(e){s[t].d(e),e&&detach(o),destroy_component(r,e)}}}function create_default_slot$26(e){let t,n;const o=[e[7],{simple:!0}];let r={$$slots:{footer:[create_footer_slot$C],header:[create_header_slot$E],default:[create_default_slot_1$1p]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=128&n?get_spread_update(o,[get_spread_object(e[7]),o[1]]):{};1048591&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5M(e){let t,n;return t=new FormProviderCore({props:{values:e[4],$$slots:{default:[create_default_slot$26]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};1048719&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}let currentModalConid=null;function isDatabaseLoginVisible(){return!!currentModalConid}function instance$5G(e,t,n){let o;const r=["conid","passwordMode","testedConnection","onConnect","onCancel"];let i,a=compute_rest_props(t,r);var s,c=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let{conid:l}=t,{passwordMode:u}=t,{testedConnection:d}=t,{onConnect:p=null}=t,{onCancel:m=null}=t;const f=writable({});let h,g,$;component_subscribe(e,f,(e=>n(17,i=e)));const b=createRef(0);let y,v=!1;currentModalConid=l,onMount((()=>c(void 0,void 0,void 0,(function*(){h=d||(yield getConnectionInfo({conid:l})),"askPassword"==o&&set_store_value(f,i=Object.assign(Object.assign({},i),{user:h.user,connectionLabel:lib$5.getConnectionLabel(h)}),i),"askUser"==o&&set_store_value(f,i=Object.assign(Object.assign({},i),{connectionLabel:lib$5.getConnectionLabel(h)}),i);const e=(h.engine||"").match(/^([^@]*)@/);n(2,y=e?e[1]:h.engine)})))),onDestroy((()=>{currentModalConid=null,v||(m&&m(),openedConnections.update((e=>_.without(e,l))))}));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(7,a=compute_rest_props(t,r)),"conid"in e&&n(8,l=e.conid),"passwordMode"in e&&n(9,u=e.passwordMode),"testedConnection"in e&&n(10,d=e.testedConnection),"onConnect"in e&&n(11,p=e.onConnect),"onCancel"in e&&n(12,m=e.onCancel)},e.$$.update=()=>{9728&e.$$.dirty&&n(3,o=null!==n(13,s=null==d?void 0:d.passwordMode)&&void 0!==s?s:u)},[g,$,y,o,f,function(){b.update((e=>e+1)),n(0,g=!1)},function(e){return c(this,void 0,void 0,(function*(){if(v=!0,p)return p(Object.assign(Object.assign({},d),{user:"askUser"==o?i.user:d.user,password:i.password})),void closeCurrentModal();n(0,g=!0),b.update((e=>e+1));const e=b.get(),t=yield apiCall("connections/save-volatile",{conid:l,user:i.user,password:i.password,test:!0});b.get()==e&&(n(0,g=!1),"connected"==t.msgtype?(setVolatileConnectionRemapping(l,t._id),yield callServerPing(),dispatchCacheChange({key:"server-status-changed"}),batchDispatchCacheTriggers((e=>e.conid==l)),closeCurrentModal()):n(1,$=t))}))},a,l,u,d,p,m,s,()=>showModal(ErrorMessageModal,{message:$.detail,showAsCode:!0,title:"Database connection error"})]}class DatabaseLoginModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5G,create_fragment$5M,safe_not_equal,{conid:8,passwordMode:9,testedConnection:10,onConnect:11,onCancel:12})}}function get_each_context$Y(e,t,n){const o=e.slice();return o[5]=t[n],o}function create_if_block_1$1u(e){let t;return{c(){t=text$1("download\n and")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_each_block$Y(e){let t,n,o=e[5]+"";return{c(){t=element("li"),n=text$1(o)},m(e,o){insert(e,t,o),append(t,n)},p(e,t){2&t&&o!==(o=e[5]+"")&&set_data(n,o)},d(e){e&&detach(t)}}}function create_default_slot_1$1o(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f,h,g,_,$,b;o=new FontIcon({props:{icon:"img error"}});let y=create_if_block_1$1u(),v=e[1]||[],x=[];for(let t=0;t<v.length;t+=1)x[t]=create_each_block$Y(get_each_context$Y(e,v,t));return{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=element("div"),a=element("p"),s=text$1("Cloud operation ended with error:"),c=element("br"),l=space(),u=text$1(e[0]),d=space(),p=element("p"),m=text$1("This is a limitation of the free version of DbGate. To continue using cloud operations, please "),y&&y.c(),f=text$1(" purchase DbGate Premium."),h=space(),g=element("p"),g.textContent="Free version limit:",_=space(),$=element("ul");for(let e=0;e<x.length;e+=1)x[e].c();attr(n,"class","icon svelte-fcnirv"),attr(i,"data-testid","LicenseLimitMessageModal_message"),attr(t,"class","wrapper svelte-fcnirv")},m(e,v){insert(e,t,v),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),append(i,a),append(a,s),append(a,c),append(a,l),append(a,u),append(i,d),append(i,p),append(p,m),y&&y.m(p,null),append(p,f),append(i,h),append(i,g),append(i,_),append(i,$);for(let e=0;e<x.length;e+=1)x[e]&&x[e].m($,null);b=!0},p(e,t){if((!b||1&t)&&set_data(u,e[0]),2&t){let n;for(v=e[1]||[],n=0;n<v.length;n+=1){const o=get_each_context$Y(e,v,n);x[n]?x[n].p(o,t):(x[n]=create_each_block$Y(o),x[n].c(),x[n].m($,null))}for(;n<x.length;n+=1)x[n].d(1);x.length=v.length}},i(e){b||(transition_in(o.$$.fragment,e),b=!0)},o(e){transition_out(o.$$.fragment,e),b=!1},d(e){e&&detach(t),destroy_component(o),y&&y.d(),destroy_each(x,e)}}}function create_header_slot$D(e){let t;return{c(){t=element("div"),t.textContent="License limit error",attr(t,"slot","header")},m(e,n){insert(e,t,n)},p:noop$2,d(e){e&&detach(t)}}}function create_if_block$2q(e){let t,n;return t=new FormStyledButton({props:{value:"Download DbGate Premium",skipWidth:!0}}),t.$on("click",e[3]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_footer_slot$B(e){let t,n,o,r,i,a;n=new FormSubmit({props:{value:"Close","data-testid":"LicenseLimitMessageModal_closeButton"}}),n.$on("click",closeCurrentModal);let s=create_if_block$2q(e);return i=new FormStyledButton({props:{value:"Purchase DbGate Premium",skipWidth:!0}}),i.$on("click",e[4]),{c(){t=element("div"),create_component(n.$$.fragment),o=space(),s&&s.c(),r=space(),create_component(i.$$.fragment),attr(t,"slot","footer")},m(e,c){insert(e,t,c),mount_component(n,t,null),append(t,o),s&&s.m(t,null),append(t,r),mount_component(i,t,null),a=!0},p(e,t){s.p(e,t)},i(e){a||(transition_in(n.$$.fragment,e),transition_in(s),transition_in(i.$$.fragment,e),a=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(s),transition_out(i.$$.fragment,e),a=!1},d(e){e&&detach(t),destroy_component(n),s&&s.d(),destroy_component(i)}}}function create_default_slot$25(e){let t,n;const o=[e[2]];let r={$$slots:{footer:[create_footer_slot$B],header:[create_header_slot$D],default:[create_default_slot_1$1o]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=4&n?get_spread_update(o,[get_spread_object(e[2])]):{};259&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5L(e){let t,n;return t=new FormProvider({props:{$$slots:{default:[create_default_slot$25]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};263&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5F(e,t,n){const o=["message","licenseLimits"];let r=compute_rest_props(t,o),{message:i}=t,{licenseLimits:a}=t;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(2,r=compute_rest_props(t,o)),"message"in e&&n(0,i=e.message),"licenseLimits"in e&&n(1,a=e.licenseLimits)},[i,a,r,()=>openWebLink("https://dbgate.io/download/"),()=>openWebLink("https://dbgate.io/purchase/premium/")]}class LicenseLimitMessageModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5F,create_fragment$5L,safe_not_equal,{message:0,licenseLimits:1})}}const strmid=v1_1$6();let eventSource,apiLogging=!1,apiDisabled=!1;const disabledOnOauth=isOauthCallback$1(),volatileConnectionMapStore=writable({}),volatileConnectionMapInvStore=writable({});let volatileConnectionMapValue={};volatileConnectionMapStore.subscribe((e=>{volatileConnectionMapValue=e}));let volatileConnectionMapInvValue={};function disableApi(){apiDisabled=!0}function enableApi(){apiDisabled=!1}function setVolatileConnectionRemapping(e,t){volatileConnectionMapStore.update((n=>Object.assign(Object.assign({},n),{[e]:t}))),volatileConnectionMapInvStore.update((n=>Object.assign(Object.assign({},n),{[t]:e})))}function removeVolatileMapping(e){const t=volatileConnectionMapValue[e];t&&(volatileConnectionMapStore.update((t=>_.omit(t,e))),volatileConnectionMapInvStore.update((e=>_.omit(e,t))))}function wantEventSource(){eventSource||(eventSource=new EventSource(`${resolveApi()}/stream?strmid=${strmid}`))}function processApiResponse(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){if(null==n?void 0:n.missingCredentials){if(n.detail.redirectToDbLogin){const e=yield apiCall("connections/volatile-dblogin-from-auth",{conid:n.detail.conid});if(e)return setVolatileConnectionRemapping(n.detail.conid,e._id),yield callServerPing(),dispatchCacheChange({key:"server-status-changed"}),batchDispatchCacheTriggers((e=>e.conid==n.detail.conid)),null;const t=`dbg-dblogin:${strmid}:${n.detail.conid}`;if(localStorage.setItem("dbloginState",t),getElectron()){openWebLink((yield apiCall("connections/dblogin-app",{conid:n.detail.conid,state:t})).url)}else openWebLink(`connections/dblogin-web?conid=${n.detail.conid}&state=${encodeURIComponent(t)}&redirectUri=${location.origin+location.pathname}`)}else isDatabaseLoginVisible()||showModal(DatabaseLoginModal,n.detail);return null}return(null==n?void 0:n.apiErrorMessage)?((null==n?void 0:n.apiErrorIsLicenseLimit)?showModal(LicenseLimitMessageModal,{message:n.apiErrorMessage,licenseLimits:n.apiErrorLimitedLicenseLimits}):showSnackbarError("API error:"+(null==n?void 0:n.apiErrorMessage)),{errorMessage:n.apiErrorMessage}):n}))}function transformApiArgs(e){return _.mapValues(e,((e,t)=>"conid"==t&&e&&volatileConnectionMapValue[e]?volatileConnectionMapValue[e]:"conidArray"==t&&_.isArray(e)?e.map((e=>volatileConnectionMapValue[e]||e)):e))}function transformApiArgsInv(e){return _.mapValues(e,((e,t)=>"conid"==t&&e&&volatileConnectionMapInvValue[e]?volatileConnectionMapInvValue[e]:"conidArray"==t&&_.isArray(e)?e.map((e=>volatileConnectionMapInvValue[e]||e)):e))}function apiCall(e,t=void 0,n=void 0){return __awaiter$h(this,void 0,void 0,(function*(){if(apiLogging&&console.log(">>> API CALL",e,t),!(null==n?void 0:n.skipDisableChecks)){if(apiDisabled)return void console.log("API disabled!!",e);if(disabledOnOauth&&"auth/oauth-token"!=e)return void console.log("API disabled because oauth callback!!",e)}t=transformApiArgs(t);const o=getElectron();if(o){const n=yield o.invoke(e.replace("/","-"),t);return yield processApiResponse(e,t,n)}{const n=yield fetch(`${resolveApi()}/${e}`,{method:"POST",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json"},resolveApiHeaders()),body:JSON.stringify(t,lib$5.serializeJsTypesReplacer)});if(401==n.status&&!apiDisabled){const t=window.dbgate_page;if(disableApi(),console.log("Disabling API",e),"login"!=t&&"admin-login"!=t&&"not-logged"!=t){const e=yield apiCall("config/get",{},{skipDisableChecks:!0});yield handleAuthOnStartup(e)}return}const o=yield n.json();return yield processApiResponse(e,t,o)}}))}volatileConnectionMapInvStore.subscribe((e=>{volatileConnectionMapInvValue=e}));const apiHandlers=new WeakMap;function apiOn(e,t){const n=getElectron();if(n){if(!apiHandlers.has(t)){const n=(n,o)=>{apiLogging&&console.log("@@@ API EVENT",e,o),t(o)};apiHandlers.set(t,n)}n.addEventListener(e,apiHandlers.get(t))}else{if(wantEventSource(),!apiHandlers.has(t)){const n=n=>{const o=JSON.parse(n.data);apiLogging&&console.log("@@@ API EVENT",e,o),t(o)};apiHandlers.set(t,n)}eventSource.addEventListener(e,apiHandlers.get(t))}}function apiOff(e,t){const n=getElectron();apiHandlers.has(t)&&(n?n.removeEventListener(e,apiHandlers.get(t)):(wantEventSource(),eventSource.removeEventListener(e,apiHandlers.get(t))))}function useApiCall(e,t,n){const o=writable(n);return apiCall(e,t).then((e=>{o.set(e)})),o}function getVolatileConnections(){return Object.values(volatileConnectionMapValue)}function installNewVolatileConnectionListener(){apiOn("got-volatile-token",(({savedConId:e,volatileConId:t})=>__awaiter$h(this,void 0,void 0,(function*(){setVolatileConnectionRemapping(e,t),yield callServerPing(),dispatchCacheChange({key:"server-status-changed"}),batchDispatchCacheTriggers((t=>t.conid==e))}))))}function installNewCloudTokenListener(){apiOn("got-cloud-token",(e=>__awaiter$h(this,void 0,void 0,(function*(){console.log("HOLDER",e),cloudSigninTokenHolder.set(e)}))))}function getAuthCategory(e){return e.isBasicAuth?"basic":isOneOfPage("admin","admin-license")&&e.isAdminLoginForm?"admin":getElectron()?"electron":"token"}function refreshPublicCloudFiles(e=!1){sessionStorage.getItem("publicCloudFilesLoaded")&&!e||(apiCall("cloud/refresh-public-files",{isRefresh:!!sessionStorage.getItem("publicCloudFilesLoaded")}),sessionStorage.setItem("publicCloudFilesLoaded","true"))}function enableApiLog(){apiLogging=!0,console.log("API loggin enabled")}function disableApiLog(){apiLogging=!1,console.log("API loggin disabled")}window.enableApiLog=enableApiLog,window.disableApiLog=disableApiLog;var jsonify={},at,ch,escapee={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},text;function error$1(e){throw{name:"SyntaxError",message:e,at:at,text:text}}function next(e){return e&&e!==ch&&error$1("Expected '"+e+"' instead of '"+ch+"'"),ch=text.charAt(at),at+=1,ch}function number(){var e,t="";for("-"===ch&&(t="-",next("-"));ch>="0"&&ch<="9";)t+=ch,next();if("."===ch)for(t+=".";next()&&ch>="0"&&ch<="9";)t+=ch;if("e"===ch||"E"===ch)for(t+=ch,next(),"-"!==ch&&"+"!==ch||(t+=ch,next());ch>="0"&&ch<="9";)t+=ch,next();return e=Number(t),isFinite(e)||error$1("Bad number"),e}function string(){var e,t,n,o="";if('"'===ch)for(;next();){if('"'===ch)return next(),o;if("\\"===ch)if(next(),"u"===ch){for(n=0,t=0;t<4&&(e=parseInt(next(),16),isFinite(e));t+=1)n=16*n+e;o+=String.fromCharCode(n)}else{if("string"!=typeof escapee[ch])break;o+=escapee[ch]}else o+=ch}error$1("Bad string")}function white(){for(;ch&&ch<=" ";)next()}function word(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null;default:error$1("Unexpected '"+ch+"'")}}function array(){var e=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),e;for(;ch;){if(e.push(value()),white(),"]"===ch)return next("]"),e;next(","),white()}}error$1("Bad array")}function object(){var e,t={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),t;for(;ch;){if(e=string(),white(),next(":"),Object.prototype.hasOwnProperty.call(t,e)&&error$1('Duplicate key "'+e+'"'),t[e]=value(),white(),"}"===ch)return next("}"),t;next(","),white()}}error$1("Bad object")}function value(){switch(white(),ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}}var parse$3=function(e,t){var n;return text=e,at=0,ch=" ",n=value(),white(),ch&&error$1("Syntax error"),"function"==typeof t?function e(n,o){var r,i,a=n[o];if(a&&"object"==typeof a)for(r in value)Object.prototype.hasOwnProperty.call(a,r)&&(void 0===(i=e(a,r))?delete a[r]:a[r]=i);return t.call(n,o,a)}({"":n},""):n},escapable=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str$1(e,t){var n,o,r,i,a,s=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(i=c.length,n=0;n<i;n+=1)a[n]=str$1(n,c)||"null";return r=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,r}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;n<i;n+=1)"string"==typeof(o=rep[n])&&(r=str$1(o,c))&&a.push(quote(o)+(gap?": ":":")+r);else for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(r=str$1(o,c))&&a.push(quote(o)+(gap?": ":":")+r);return r=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,r}}var stringify$1=function(e,t,n){var o;if(gap="",indent="","number"==typeof n)for(o=0;o<n;o+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str$1("",{"":e})};jsonify.parse=parse$3,jsonify.stringify=stringify$1;var toString={}.toString,isarray=Array.isArray||function(e){return"[object Array]"==toString.call(e)},toStr$2=Object.prototype.toString,isArguments=function(e){var t=toStr$2.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===toStr$2.call(e.callee)),n},keysShim$1;if(!Object.keys){var has=Object.prototype.hasOwnProperty,toStr$1=Object.prototype.toString,isArgs$1=isArguments,isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call((function(){}),"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(e){var t=e.constructor;return t&&t.prototype===e},excludedKeys={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!excludedKeys["$"+e]&&has.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{equalsConstructorPrototype(window[e])}catch(e){return!0}}catch(e){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(e){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(e);try{return equalsConstructorPrototype(e)}catch(e){return!1}};keysShim$1=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===toStr$1.call(e),o=isArgs$1(e),r=t&&"[object String]"===toStr$1.call(e),i=[];if(!t&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var a=hasProtoEnumBug&&n;if(r&&e.length>0&&!has.call(e,0))for(var s=0;s<e.length;++s)i.push(String(s));if(o&&e.length>0)for(var c=0;c<e.length;++c)i.push(String(c));else for(var l in e)a&&"prototype"===l||!has.call(e,l)||i.push(String(l));if(hasDontEnumBug)for(var u=equalsConstructorPrototypeIfNotBuggy(e),d=0;d<dontEnums.length;++d)u&&"constructor"===dontEnums[d]||!has.call(e,dontEnums[d])||i.push(dontEnums[d]);return i}}var implementation$2=keysShim$1,slice=Array.prototype.slice,isArgs=isArguments,origKeys=Object.keys,keysShim=origKeys?function(e){return origKeys(e)}:implementation$2,originalKeys=Object.keys;keysShim.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return isArgs(e)?originalKeys(slice.call(e)):originalKeys(e)})}else Object.keys=keysShim;return Object.keys||keysShim};var objectKeys$1=keysShim,callBind$2={exports:{}},ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max$3=Math.max,funcType="[object Function]",concatty=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var r=0;r<t.length;r+=1)n[r+e.length]=t[r];return n},slicy=function(e,t){for(var n=[],o=t||0,r=0;o<e.length;o+=1,r+=1)n[r]=e[o];return n},joiny=function(e,t){for(var n="",o=0;o<e.length;o+=1)n+=e[o],o+1<e.length&&(n+=t);return n},implementation$1=function(e){var t=this;if("function"!=typeof t||toStr.apply(t)!==funcType)throw new TypeError(ERROR_MESSAGE+t);for(var n,o=slicy(arguments,1),r=max$3(0,t.length-o.length),i=[],a=0;a<r;a++)i[a]="$"+a;if(n=Function("binder","return function ("+joiny(i,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var r=t.apply(this,concatty(o,arguments));return Object(r)===r?r:this}return t.apply(e,concatty(o,arguments))})),t.prototype){var s=function(){};s.prototype=t.prototype,n.prototype=new s,s.prototype=null}return n},implementation=implementation$1,functionBind=Function.prototype.bind||implementation,esErrors=Error,_eval=EvalError,range=RangeError,ref=ReferenceError,syntax=SyntaxError,type$1=TypeError,uri=URIError,shams=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(e,t);if(42!==r.value||!0!==r.enumerable)return!1}return!0},origSymbol="undefined"!=typeof Symbol&&Symbol,hasSymbolSham=shams,hasSymbols$1=function(){return"function"==typeof origSymbol&&("function"==typeof Symbol&&("symbol"==typeof origSymbol("foo")&&("symbol"==typeof Symbol("bar")&&hasSymbolSham())))},test={__proto__:null,foo:{}},$Object=Object,hasProto$1=function(){return{__proto__:test}.foo===test.foo&&!(test instanceof $Object)},call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind$1=functionBind,hasown=bind$1.call(call,$hasOwn),undefined$1,$Error=esErrors,$EvalError=_eval,$RangeError=range,$ReferenceError=ref,$SyntaxError$1=syntax,$TypeError$2=type$1,$URIError=uri,$Function=Function,getEvalledConstructor=function(e){try{return $Function('"use strict"; return ('+e+").constructor;")()}catch(e){}},$gOPD$1=Object.getOwnPropertyDescriptor;if($gOPD$1)try{$gOPD$1({},"")}catch(e){$gOPD$1=null}var throwTypeError=function(){throw new $TypeError$2},ThrowTypeError=$gOPD$1?function(){try{return throwTypeError}catch(e){try{return $gOPD$1(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,hasSymbols=hasSymbols$1(),hasProto=hasProto$1(),getProto=Object.getPrototypeOf||(hasProto?function(e){return e.__proto__}:null),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined$1,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined$1:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined$1:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined$1:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined$1:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined$1:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined$1:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined$1:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":"object"==typeof JSON?JSON:undefined$1,"%Map%":"undefined"==typeof Map?undefined$1:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined$1,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined$1:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined$1:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined$1,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined$1:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined$1:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined$1:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined$1:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined$1:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined$1:WeakSet};if(getProto)try{null.error}catch(e){var errorProto=getProto(getProto(e));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function e(t){var n;if("%AsyncFunction%"===t)n=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===t)n=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var r=e("%AsyncGenerator%");r&&getProto&&(n=getProto(r.prototype))}return INTRINSICS[t]=n,n},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(e){var t=$strSlice(e,0,1),n=$strSlice(e,-1);if("%"===t&&"%"!==n)throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(e,rePropName,(function(e,t,n,r){o[o.length]=n?$replace(r,reEscapeChar,"$1"):t||e})),o},getBaseIntrinsic=function(e,t){var n,o=e;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(n=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var r=INTRINSICS[o];if(r===needsEval&&(r=doEval(o)),void 0===r&&!t)throw new $TypeError$2("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:r}}throw new $SyntaxError$1("intrinsic "+e+" does not exist!")},getIntrinsic=function(e,t){if("string"!=typeof e||0===e.length)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new $TypeError$2('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,e))throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=stringToPath(e),o=n.length>0?n[0]:"",r=getBaseIntrinsic("%"+o+"%",t),i=r.name,a=r.value,s=!1,c=r.alias;c&&(o=c[0],$spliceApply(n,$concat([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var d=n[l],p=$strSlice(d,0,1),m=$strSlice(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new $SyntaxError$1("property names with quotes must have matching quotes");if("constructor"!==d&&u||(s=!0),hasOwn(INTRINSICS,i="%"+(o+="."+d)+"%"))a=INTRINSICS[i];else if(null!=a){if(!(d in a)){if(!t)throw new $TypeError$2("base intrinsic for "+e+" exists, but the property is not available.");return}if($gOPD$1&&l+1>=n.length){var f=$gOPD$1(a,d);a=(u=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:a[d]}else u=hasOwn(a,d),a=a[d];u&&!s&&(INTRINSICS[i]=a)}}return a},GetIntrinsic$3=getIntrinsic,$defineProperty$2=GetIntrinsic$3("%Object.defineProperty%",!0)||!1;if($defineProperty$2)try{$defineProperty$2({},"a",{value:1})}catch(e){$defineProperty$2=!1}var esDefineProperty=$defineProperty$2,GetIntrinsic$2=getIntrinsic,$gOPD=GetIntrinsic$2("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch(e){$gOPD=null}var gopd$1=$gOPD,$defineProperty$1=esDefineProperty,$SyntaxError=syntax,$TypeError$1=type$1,gopd=gopd$1,defineDataProperty=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new $TypeError$1("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new $TypeError$1("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,a=arguments.length>6&&arguments[6],s=!!gopd&&gopd(e,t);if($defineProperty$1)$defineProperty$1(e,t,{configurable:null===i&&s?s.configurable:!i,enumerable:null===o&&s?s.enumerable:!o,value:n,writable:null===r&&s?s.writable:!r});else{if(!a&&(o||r||i))throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}},$defineProperty=esDefineProperty,hasPropertyDescriptors=function(){return!!$defineProperty};hasPropertyDescriptors.hasArrayLengthDefineBug=function(){if(!$defineProperty)return null;try{return 1!==$defineProperty([],"length",{value:1}).length}catch(e){return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors,GetIntrinsic$1=getIntrinsic,define=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD=gopd$1,$TypeError=type$1,$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(e,t){if("function"!=typeof e)throw new $TypeError("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||$floor(t)!==t)throw new $TypeError("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in e&&gOPD){var i=gOPD(e,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(r=!1)}return(o||r||!n)&&(hasDescriptors?define(e,"length",t,!0,!0):define(e,"length",t)),e};!function(e){var t=functionBind,n=getIntrinsic,o=setFunctionLength,r=type$1,i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||t.call(a,i),c=esDefineProperty,l=n("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new r("a function is required");var n=s(t,a,arguments);return o(n,1+l(0,e.length-(arguments.length-1)),!0)};var u=function(){return s(t,i,arguments)};c?c(e.exports,"apply",{value:u}):e.exports.apply=u}(callBind$2);var GetIntrinsic=getIntrinsic,callBind$1=callBind$2.exports,$indexOf=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$1=function(e,t){var n=GetIntrinsic(e,!!t);return"function"==typeof n&&$indexOf(e,".prototype.")>-1?callBind$1(n):n},jsonStringify=("undefined"!=typeof JSON?JSON:jsonify).stringify,isArray=isarray,objectKeys=objectKeys$1,callBind=callBind$2.exports,callBound=callBound$1,$join=callBound("Array.prototype.join"),$push=callBound("Array.prototype.push"),strRepeat=function(e,t){for(var n="",o=0;o<e;o+=1)n+=t;return n},defaultReplacer=function(e,t,n){return n},jsonStableStringify=function(e){var t=arguments.length>1?arguments[1]:void 0,n=t&&t.space||"";"number"==typeof n&&(n=strRepeat(n," "));var o=!!t&&"boolean"==typeof t.cycles&&t.cycles,r=t&&t.replacer?callBind(t.replacer):defaultReplacer,i="function"==typeof t?t:t&&t.cmp,a=i&&function(e){var t=i.length>2&&function(t){return e[t]};return function(n,o){return i({key:n,value:e[n]},{key:o,value:e[o]},t?{__proto__:null,get:t}:void 0)}},s=[];return function e(t,i,c,l){var u=n?"\n"+strRepeat(l,n):"",d=n?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=r(t,i,c))){if("object"!=typeof c||null===c)return jsonStringify(c);if(isArray(c)){for(var p=[],m=0;m<c.length;m++){var f=e(c,m,c[m],l+1)||jsonStringify(null);$push(p,u+n+f)}return"["+$join(p,",")+u+"]"}if(-1!==s.indexOf(c)){if(o)return jsonStringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}$push(s,c);var h=objectKeys(c).sort(a&&a(c));for(p=[],m=0;m<h.length;m++){var g=e(c,i=h[m],c[i],l+1);if(g){var _=jsonStringify(i)+d+g;$push(p,u+n+_)}}return s.splice(s.indexOf(c),1),"{"+$join(p,",")+u+"}"}}({"":e},"",e,0)};const cachedByKey={},cachedPromisesByKey={},cachedKeysByReloadTrigger={},subscriptionsByReloadTrigger={},cacheGenerationByKey={};let cacheGeneration=0;function cacheGet(e){return cachedByKey[e]}function addCacheKeyToReloadTrigger(e,t){for(const n of getAsArray(t)){const t=jsonStableStringify(n);t in cachedKeysByReloadTrigger||(cachedKeysByReloadTrigger[t]=[]),cachedKeysByReloadTrigger[t].push(e)}}function cacheSet(e,t,n,o){cachedByKey[e]=t,addCacheKeyToReloadTrigger(e,n),delete cachedPromisesByKey[e],cacheGenerationByKey[e]=o}function cacheClean(e){cacheGeneration+=1;for(const t of getAsArray(e)){const e=jsonStableStringify(transformApiArgsInv(t)),n=cachedKeysByReloadTrigger[e];if(n)for(const e of n)delete cachedByKey[e],delete cachedPromisesByKey[e],cacheGenerationByKey[e]=cacheGeneration;delete cachedKeysByReloadTrigger[e]}}function getCachedPromise(e,t,n){if(t in cachedPromisesByKey)return cachedPromisesByKey[t];const o=n();return cachedPromisesByKey[t]=o,addCacheKeyToReloadTrigger(t,e),o}function acquireCacheGeneration(){return cacheGeneration+=1,cacheGeneration}function getCacheGenerationForKey(e){return cacheGenerationByKey[e]||0}function loadCachedValue(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){const o=cacheGet(t);if(o)return o;{const o=acquireCacheGeneration();try{const r=yield getCachedPromise(e,t,n);return getCacheGenerationForKey(t)>o?cacheGet(t)||r:(cacheSet(t,r,e,o),r)}catch(r){console.error("Error when using cached promise",r),cacheClean(e);const i=yield n();return cacheSet(t,i,e,o),i}}}))}function subscribeCacheChange(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){for(const t of getAsArray(e)){const e=jsonStableStringify(t);subscriptionsByReloadTrigger[e]||(subscriptionsByReloadTrigger[e]=[]),subscriptionsByReloadTrigger[e].push(n)}}))}function unsubscribeCacheChange(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){for(const t of getAsArray(e)){const e=jsonStableStringify(t);subscriptionsByReloadTrigger[e]&&(subscriptionsByReloadTrigger[e]=subscriptionsByReloadTrigger[e].filter((e=>e!=n))),0==subscriptionsByReloadTrigger[e].length&&delete subscriptionsByReloadTrigger[e]}}))}function dispatchCacheChange(e){cacheClean(e);for(const t of getAsArray(e)){const e=jsonStableStringify(transformApiArgsInv(t));if(subscriptionsByReloadTrigger[e])for(const t of subscriptionsByReloadTrigger[e])t()}}function batchDispatchCacheTriggers(e){for(const t in subscriptionsByReloadTrigger){const n=JSON.parse(t);e(n)&&dispatchCacheChange(n)}}apiOn("changed-cache",(e=>dispatchCacheChange(e)));const cache={};function getLocalStorage(e,t=void 0){if(e in cache)return cache[e];const n=localStorage.getItem(e);if(n)try{const t=JSON.parse(n);return cache[e]=t,t}catch(e){return t}return t}function setLocalStorage(e,t){localStorage.setItem(e,JSON.stringify(t)),delete cache[e]}function removeLocalStorage(e){localStorage.removeItem(e),delete cache[e]}const databaseInfoLoader=({conid:e,database:t,modelTransFile:n})=>({url:"database-connections/structure",params:{conid:e,database:t,modelTransFile:n},reloadTrigger:{key:"database-structure-changed",conid:e,database:t},transform:lib$5.extendDatabaseInfo}),schemaListLoader=({conid:e,database:t})=>({url:"database-connections/schema-list",params:{conid:e,database:t},reloadTrigger:{key:"schema-list-changed",conid:e,database:t}}),connectionInfoLoader=({conid:e})=>({url:"connections/get",params:{conid:e},reloadTrigger:{key:"connection-list-changed"}}),configLoader=()=>({url:"config/get",params:{},reloadTrigger:{key:"config-changed"}}),settingsLoader=()=>({url:"config/get-settings",params:{},reloadTrigger:{key:"settings-changed"}}),platformInfoLoader=()=>({url:"config/platform-info",params:{},reloadTrigger:{key:"platform-info-changed"}}),favoritesLoader=()=>({url:"files/favorites",params:{},reloadTrigger:{key:"files-changed-favorites"}}),databaseStatusLoader=({conid:e,database:t})=>({url:"database-connections/status",params:{conid:e,database:t},reloadTrigger:{key:"database-status-changed",conid:e,database:t}}),databaseListLoader=({conid:e})=>({url:"server-connections/list-databases",params:{conid:e},reloadTrigger:{key:"database-list-changed",conid:e},onLoaded:t=>{(null==t?void 0:t.length)>0&&setLocalStorage(`database_list_${e}`,t)},errorValue:[]}),databaseServerVersionLoader=({conid:e,database:t})=>({url:"database-connections/server-version",params:{conid:e,database:t},reloadTrigger:{key:"database-server-version-changed",conid:e,database:t}}),archiveFoldersLoader=()=>({url:"archive/folders",params:{},reloadTrigger:{key:"archive-folders-changed"}}),archiveFilesLoader=({folder:e})=>({url:"archive/files",params:{folder:e},reloadTrigger:{key:"archive-files-changed",folder:e}}),appFoldersLoader=()=>({url:"apps/folders",params:{},reloadTrigger:{key:"app-folders-changed"}}),appFilesLoader=({folder:e})=>({url:"apps/files",params:{folder:e},reloadTrigger:{key:"app-files-changed",app:e}}),usedAppsLoader=({conid:e,database:t})=>({url:"apps/get-used-apps",params:{},reloadTrigger:{key:"used-apps-changed"}}),serverStatusLoader=()=>({url:"server-connections/server-status",params:{},reloadTrigger:{key:"server-status-changed"}}),connectionListLoader=()=>({url:"connections/list",params:{},reloadTrigger:{key:"connection-list-changed"}}),installedPluginsLoader=()=>({url:"plugins/installed",params:{},reloadTrigger:{key:"installed-plugins-changed"}}),filesLoader=({folder:e})=>({url:"files/list",params:{folder:e},reloadTrigger:{key:"files-changed",folder:e}}),authTypesLoader=({engine:e})=>({url:"plugins/auth-types",params:{engine:e},reloadTrigger:{key:"installed-plugins-changed"},errorValue:null}),publicCloudFilesLoader=()=>({url:"cloud/public-files",params:{},reloadTrigger:{key:"public-cloud-changed"}}),cloudContentListLoader=()=>({url:"cloud/content-list",params:{},reloadTrigger:{key:"cloud-content-changed"}});function getCore(e,t){return __awaiter$h(this,void 0,void 0,(function*(){const{url:n,params:o,reloadTrigger:r,transform:i,onLoaded:a,errorValue:s}=e(t),c=jsonStableStringify(Object.assign({url:n},o));return yield loadCachedValue(r,c,(function(){return __awaiter$h(this,void 0,void 0,(function*(){const e=yield apiCall(n,o);if((null==e?void 0:e.errorMessage)&&void 0!==s)return a&&a(s),s;const t=(i||(e=>e))(e);return a&&a(t),t}))}))}))}function useCore(e,t){const{url:n,params:o,reloadTrigger:r,transform:i,onLoaded:a}=e(t),s=jsonStableStringify(Object.assign({url:n},o));let c=0;return{subscribe:n=>{function o(){return __awaiter$h(this,void 0,void 0,(function*(){const o=yield getCore(e,t);c>0&&n(o)}))}return c+=1,o(),r?(subscribeCacheChange(r,s,o),()=>{c-=1,unsubscribeCacheChange(r,s,o)}):()=>{c-=1}}}}function getDatabaseInfo(e){return getCore(databaseInfoLoader,e)}function useDatabaseInfo(e){return useCore(databaseInfoLoader,e)}function getDbCore(e,t=void 0){return __awaiter$h(this,void 0,void 0,(function*(){const n=yield getDatabaseInfo(e);return n?n[t||e.objectTypeField].find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName)):null}))}function useDbCore(e,t=void 0){const n=useDatabaseInfo(e);return n?derived(n,(n=>{if(!n)return null;if(!_.isArray(t))return n[t||e.objectTypeField].find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName));for(const o of t){const t=n[o||e.objectTypeField].find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName));if(t)return t}})):null}function getTableInfo(e){return getDbCore(e,"tables")}function useTableInfo(e){return useDbCore(e,"tables")}function useViewInfo(e){return useDbCore(e,["views","matviews"])}function useCollectionInfo(e){return useDbCore(e,"collections")}function getSqlObjectInfo(e){return getDbCore(e)}function getConnectionInfo(e){return getCore(connectionInfoLoader,e)}function useConnectionInfo(e){return useCore(connectionInfoLoader,e)}function useDatabaseStatus(e){return useCore(databaseStatusLoader,e)}function useDatabaseList(e){return useCore(databaseListLoader,e)}function useDatabaseServerVersion(e){return useCore(databaseServerVersionLoader,e)}function useServerStatus(){return useCore(serverStatusLoader,{})}function getConnectionList(){return getCore(connectionListLoader,{})}function useConnectionList(){return useCore(connectionListLoader,{})}function getConfig(){return getCore(configLoader,{})}function useConfig(){return useCore(configLoader,{})}function getSettings(){return getCore(settingsLoader,{})}function useSettings(){return useCore(settingsLoader,{})}function usePlatformInfo(){return useCore(platformInfoLoader,{})}function useArchiveFiles(e){return useCore(archiveFilesLoader,e)}function useArchiveFolders(e={}){return useCore(archiveFoldersLoader,e)}function useAppFiles(e){return useCore(appFilesLoader,e)}function useAppFolders(e={}){return useCore(appFoldersLoader,e)}function getUsedApps(e={}){return getCore(usedAppsLoader,e)}function useUsedApps(e={}){return useCore(usedAppsLoader,e)}function useInstalledPlugins(e={}){return useCore(installedPluginsLoader,e)}function useFiles(e){return useCore(filesLoader,e)}function useFavorites(e={}){return useCore(favoritesLoader,e)}function useAuthTypes(e){return useCore(authTypesLoader,e)}function getSchemaList(e){return getCore(schemaListLoader,e)}function useSchemaList(e){return useCore(schemaListLoader,e)}function usePublicCloudFiles(e={}){return useCore(publicCloudFilesLoader,e)}function useCloudContentList(e={}){return useCore(cloudContentListLoader,e)}const darkModeMediaQuery=window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null,systemThemeStore=writable((null==darkModeMediaQuery?void 0:darkModeMediaQuery.matches)?"theme-dark":"theme-light");function getSystemTheme(){return(null==darkModeMediaQuery?void 0:darkModeMediaQuery.matches)?"theme-dark":"theme-light"}function writableWithStorage(e,t,n){const o=localStorage.getItem(t),r=writable(o?lib$5.safeJsonParse(o,e,!0):e);return r.subscribe((e=>{n&&n(e)?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(e))})),r}function writableWithForage(e,t,n){const o=writable(e);return o.subscribe((e=>{localforage.setItem(t,e)})),localforage.getItem(t).then((r=>{if(null==r){const n=localStorage.getItem(t);if(n){localStorage.removeItem(t);const r=lib$5.safeJsonParse(n,e,!0);localforage.setItem(t,r),o.set(r)}}else o.set(n?n(r):r)})),o}function writableSettingsValue(e,t){const n=derived(useSettings(),(n=>{var o;return null!==(o=(n||{})[t])&&void 0!==o?o:e}));return Object.assign(Object.assign({},n),{set:e=>apiCall("config/update-settings",{[t]:e}),update:n=>__awaiter$h(this,void 0,void 0,(function*(){var o;const r=yield getSettings(),i=n(null!==(o=r[t])&&void 0!==o?o:e);apiCall("config/update-settings",{[t]:i})}))})}function subscribeCssVariable(e,t,n){e.subscribe((e=>document.documentElement.style.setProperty(n,t(e))))}darkModeMediaQuery&&darkModeMediaQuery.addEventListener("change",(e=>{systemThemeStore.set(e.matches?"theme-dark":"theme-light")}));const selectedWidget=writableWithStorage(isAdminPage()?"admin":"database",isAdminPage()?"selectedAdminWidget":"selectedWidget"),lockedDatabaseMode=writableWithStorage(!1,"lockedDatabaseMode"),visibleWidgetSideBar=writableWithStorage(!0,"visibleWidgetSideBar"),visibleSelectedWidget=derived([selectedWidget,visibleWidgetSideBar],(([e,t])=>t?e:null)),emptyConnectionGroupNames=writableWithStorage([],"emptyConnectionGroupNames"),collapsedConnectionGroupNames=writableWithStorage([],"collapsedConnectionGroupNames"),openedConnections=writable([]),temporaryOpenedConnections=writable([]),openedSingleDatabaseConnections=writable([]),expandedConnections=writable([]),currentDatabase=writableWithStorage(null,"currentDatabase"),openedTabs=writableWithForage([],getOpenedTabsStorageName(),(e=>[...e||[]])),copyRowsFormat=writableWithStorage("textWithoutHeaders","copyRowsFormat"),extensions=writable(null),visibleCommandPalette=writable(null),commands=writable({}),currentTheme=getElectron()?writableSettingsValue(null,"currentTheme"):writableWithStorage(null,"currentTheme",(e=>null==e)),currentEditorTheme=getElectron()?writableSettingsValue(null,"currentEditorTheme"):writableWithStorage(null,"currentEditorTheme"),currentEditorKeybindigMode=getElectron()?writableSettingsValue(null,"currentEditorKeybindigMode"):writableWithStorage(null,"currentEditorKeybindigMode"),currentEditorWrapEnabled=getElectron()?writableSettingsValue(!1,"currentEditorWrapEnabled"):writableWithStorage(!1,"currentEditorWrapEnabled"),currentEditorFontSize=getElectron()?writableSettingsValue(null,"currentEditorFontSize"):writableWithStorage(null,"currentEditorFontSize"),currentEditorFont=writableSettingsValue(null,"editor.fontFamily");writableSettingsValue(!1,"ai.allowSendModels");const activeTabId=derived([openedTabs],(([e])=>{var t;return null===(t=e.find((e=>e.selected)))||void 0===t?void 0:t.tabid})),activeTab=derived([openedTabs],(([e])=>e.find((e=>e.selected)))),recentDatabases=writableWithStorage([],"recentDatabases"),pinnedDatabases=writableWithStorage([],"pinnedDatabases"),pinnedTables=writableWithStorage([],"pinnedTables"),commandsSettings=writable({}),allResultsInOneTabDefault=writableWithStorage(!1,"allResultsInOneTabDefault"),commandsCustomized=derived([commands,commandsSettings],(([e,t])=>_.mapValues(e,((e,n)=>Object.assign(Object.assign({},e),t[n]))))),appUpdateStatus=writable(null),appUpdaterActive=writable(!1),draggingTab=writable(null),draggingTabTarget=writable(null),draggingDbGroup=writable(null),draggingDbGroupTarget=writable(null),visibleToolbar=writable(!1),leftPanelWidth=writableWithStorage(300,"leftPanelWidth"),currentDropDownMenu=writable(null),openedModals=writable([]),draggedPinnedObject=writable(null),openedSnackbars=writable([]);readable(null,(()=>{}));const currentArchive=writableWithStorage("default","currentArchive"),currentApplication=writableWithStorage(null,"currentApplication"),isFileDragActive=writable(!1),selectedCellsCallback=writable(null),loadingPluginStore=writable({loaded:!1,loadingPackageName:null}),activeDbKeysStore=writableWithStorage({},"activeDbKeysStore"),appliedCurrentSchema=writable(null),loadingSchemaLists=writable({}),lastUsedDefaultActions=writableWithStorage({},"lastUsedDefaultActions"),selectedDatabaseObjectAppObject=writable(null),focusedConnectionOrDatabase=writable(null),focusedTreeDbKey=writable(null),cloudSigninTokenHolder=writableSettingsValue(null,"cloudSigninTokenHolder"),cloudConnectionsStore=writable({}),DEFAULT_OBJECT_SEARCH_SETTINGS={pureName:!0,schemaName:!1,columnName:!1,columnDataType:!1,tableComment:!0,columnComment:!1,sqlObjectText:!1,tableEngine:!1},DEFAULT_CONNECTION_SEARCH_SETTINGS={displayName:!0,server:!0,user:!1,engine:!1,database:!0},databaseObjectAppObjectSearchSettings=writableWithStorage(DEFAULT_OBJECT_SEARCH_SETTINGS,"databaseObjectAppObjectSearchSettings2"),connectionAppObjectSearchSettings=writableWithStorage(DEFAULT_CONNECTION_SEARCH_SETTINGS,"connectionAppObjectSearchSettings2");let currentThemeValue=null;currentTheme.subscribe((e=>{currentThemeValue=e}));const getCurrentTheme=()=>currentThemeValue,currentThemeDefinition=derived([currentTheme,extensions,systemThemeStore],(([e,t,n])=>{var o;const r=null!=e?e:n;return null===(o=null==t?void 0:t.themes)||void 0===o?void 0:o.find((e=>e.themeClassName==r))}));currentThemeDefinition.subscribe((e=>{(null==e?void 0:e.themeType)&&getCurrentTheme()?localStorage.setItem("currentThemeType",null==e?void 0:e.themeType):localStorage.removeItem("currentThemeType")}));const openedConnectionsWithTemporary=derived([openedConnections,temporaryOpenedConnections,openedSingleDatabaseConnections],(([e,t,n])=>_.uniq([...e,...t.map((e=>e.conid)),...n])));let nativeMenuOnStartup=null;const visibleTitleBar=derived(useSettings(),(e=>!!getElectron()&&(!!e&&(null==nativeMenuOnStartup&&(nativeMenuOnStartup=!!e["app.useNativeMenu"]),!e["app.fullscreen"]&&!nativeMenuOnStartup)))),alignDataGridNumbersToRight=derived(useSettings(),(e=>!!(null==e?void 0:e["dataGrid.alignNumbersRight"]))),visibleHamburgerMenuWidget=derived(useSettings(),(e=>!getElectron()||!!e&&!!e["app.fullscreen"]));subscribeCssVariable(visibleSelectedWidget,(e=>e?1:0),"--dim-visible-left-panel"),subscribeCssVariable(leftPanelWidth,(e=>`${e}px`),"--dim-left-panel-width"),subscribeCssVariable(visibleTitleBar,(e=>e?1:0),"--dim-visible-titlebar"),subscribeCssVariable(lockedDatabaseMode,(e=>e?0:1),"--dim-visible-tabs-databases"),subscribeCssVariable(alignDataGridNumbersToRight,(e=>e?"right":"left"),"--data-grid-numbers-align");let activeTabIdValue=null;activeTabId.subscribe((e=>{activeTabIdValue=e,invalidateCommands()}));const getActiveTabId=()=>activeTabIdValue;let visibleCommandPaletteValue=null;visibleCommandPalette.subscribe((e=>{visibleCommandPaletteValue=e,invalidateCommands()}));const getVisibleCommandPalette=()=>visibleCommandPaletteValue;let visibleToolbarValue=null;visibleToolbar.subscribe((e=>{visibleToolbarValue=e,invalidateCommands()}));const getVisibleToolbar=()=>visibleToolbarValue;let openedTabsValue=null;openedTabs.subscribe((e=>{openedTabsValue=e,invalidateCommands()}));const getOpenedTabs=()=>openedTabsValue;let commandsValue=null;commands.subscribe((e=>{commandsValue=e;const t=getElectron();t&&t.send("update-commands",JSON.stringify(e))}));const getCommands=()=>commandsValue;let activeTabValue=null;activeTab.subscribe((e=>{activeTabValue=e}));const getActiveTab=()=>activeTabValue;let currentConfigValue=null;const getCurrentConfig=()=>currentConfigValue;let recentDatabasesValue=null;recentDatabases.subscribe((e=>{recentDatabasesValue=e}));const getRecentDatabases=()=>_.compact(recentDatabasesValue);pinnedDatabases.subscribe((e=>{}));let lockedDatabaseModeValue=null;lockedDatabaseMode.subscribe((e=>{lockedDatabaseModeValue=e}));const getLockedDatabaseMode=()=>lockedDatabaseModeValue;let currentDatabaseValue=null;currentDatabase.subscribe((e=>{var t,n;currentDatabaseValue=e,(null===(t=null==e?void 0:e.connection)||void 0===t?void 0:t._id)&&((null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n.singleDatabase)?openedSingleDatabaseConnections.update((t=>{var n;return _.uniq([...t,null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n._id])})):(openedConnections.update((t=>{var n;return _.uniq([...t,null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n._id])})),expandedConnections.update((t=>{var n;return _.uniq([...t,null===(n=null==e?void 0:e.connection)||void 0===n?void 0:n._id])})))),invalidateCommands()}));const getCurrentDatabase=()=>currentDatabaseValue;let currentSettingsValue=null;const getCurrentSettings=()=>currentSettingsValue||{};let extensionsValue=null;extensions.subscribe((e=>{extensionsValue=e}));const getExtensions=()=>extensionsValue;let openedConnectionsValue=null;openedConnections.subscribe((e=>{openedConnectionsValue=e}));const getOpenedConnections=()=>openedConnectionsValue;function subscribeApiDependendStores(){useSettings().subscribe((e=>{currentSettingsValue=e,commandsSettings.set((e||{}).commands||{}),invalidateCommands()})),useConfig().subscribe((e=>{currentConfigValue=e,invalidateCommands(),e.singleDbConnection&&switchCurrentDatabase(e.singleDbConnection)}))}let currentArchiveValue=null;currentArchive.subscribe((e=>{currentArchiveValue=e}));const getCurrentArchive=()=>currentArchiveValue;let appUpdaterActiveValue=!1;appUpdaterActive.subscribe((e=>{appUpdaterActiveValue=e}));const getAppUpdaterActive=()=>appUpdaterActiveValue;let appliedCurrentSchemaValue=null;appliedCurrentSchema.subscribe((e=>{appliedCurrentSchemaValue=e}));const getAppliedCurrentSchema=()=>appliedCurrentSchemaValue;let selectedDatabaseObjectAppObjectValue=null;selectedDatabaseObjectAppObject.subscribe((e=>{selectedDatabaseObjectAppObjectValue=e}));const getSelectedDatabaseObjectAppObject=()=>selectedDatabaseObjectAppObjectValue;let openedModalsValue=[];openedModals.subscribe((e=>{openedModalsValue=e}));const getOpenedModals=()=>openedModalsValue;let focusedConnectionOrDatabaseValue=null;focusedConnectionOrDatabase.subscribe((e=>{focusedConnectionOrDatabaseValue=e}));const getFocusedConnectionOrDatabase=()=>focusedConnectionOrDatabaseValue;let openedSingleDatabaseConnectionsValue=[];openedSingleDatabaseConnections.subscribe((e=>{openedSingleDatabaseConnectionsValue=e}));const getOpenedSingleDatabaseConnections=()=>openedSingleDatabaseConnectionsValue;let lastUsedDefaultActionsValue={};lastUsedDefaultActions.subscribe((e=>{lastUsedDefaultActionsValue=e}));const getLastUsedDefaultActions=()=>lastUsedDefaultActionsValue;let databaseObjectAppObjectSearchSettingsValue=Object.assign({},DEFAULT_OBJECT_SEARCH_SETTINGS);databaseObjectAppObjectSearchSettings.subscribe((e=>{databaseObjectAppObjectSearchSettingsValue=e}));const getDatabaseObjectAppObjectSearchSettings=()=>databaseObjectAppObjectSearchSettingsValue;let connectionAppObjectSearchSettingsValue=Object.assign({},DEFAULT_CONNECTION_SEARCH_SETTINGS);connectionAppObjectSearchSettings.subscribe((e=>{connectionAppObjectSearchSettingsValue=e}));const getConnectionAppObjectSearchSettings=()=>connectionAppObjectSearchSettingsValue;let focusedTreeDbKeyValue=null;focusedTreeDbKey.subscribe((e=>{focusedTreeDbKeyValue=e}));const getFocusedTreeDbKey=()=>focusedTreeDbKeyValue;let cloudConnectionsStoreValue={};cloudConnectionsStore.subscribe((e=>{cloudConnectionsStoreValue=e}));const getCloudConnectionsStore=()=>cloudConnectionsStoreValue,currentActiveCloudTags=derived(currentDatabase,(e=>{var t;if(!e||!e.connection)return[];const n=null===(t=e.connection)||void 0===t?void 0:t.engine,[o,r]=n.split("@"),i=[o],a=[...i];return i.includes("mariadb")&&a.push("mysql"),i.includes("mysql")&&a.push("mariadb"),i.includes("cockroach")&&a.push("postgres"),i.includes("libsql")&&a.push("sqlite"),a}));function sleep(e){return new Promise((t=>window.setTimeout((()=>t(null)),e)))}function changeTab(e,t){openedTabs.update((n=>n.map((n=>n.tabid==e?t(n):n))))}function markTabUnsaved(e){getOpenedTabs().find((t=>t.tabid==e)).unsaved||openedTabs.update((t=>t.map((t=>t.tabid==e?Object.assign(Object.assign({},t),{unsaved:!0,tabPreviewMode:!1}):t))))}function markTabSaved(e){openedTabs.update((t=>t.map((t=>t.tabid==e?Object.assign(Object.assign({},t),{unsaved:!1}):t))))}function setSelectedTabFunc(e,t,n={}){return[...(e||[]).filter((e=>e.tabid!=t)).map((e=>Object.assign(Object.assign({},e),{selected:!1,focused:!1}))),...(e||[]).filter((e=>e.tabid==t)).map((e=>Object.assign(Object.assign(Object.assign({},e),{selected:!0,focused:!1}),n)))]}function setSelectedTab(e){openedTabs.update((t=>setSelectedTabFunc(t,e)))}function getObjectTypeFieldLabel(e,t){var n;return"matviews"==e?"Materialized Views":"collections"==e?null!==(n=_.startCase(null==t?void 0:t.collectionPluralLabel))&&void 0!==n?n:"Collections/Containers":_.startCase(e)}function isMac(){var e;return((null===navigator||void 0===navigator?void 0:navigator.platform)||(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||"unknown").toUpperCase().indexOf("MAC")>=0}function formatKeyText(e){return isMac()?e.replace(/CtrlOrCommand\+/g,"⌘ ").replace(/Shift\+/g,"⇧ ").replace(/Alt\+/g,"⌥ ").replace(/Command\+/g,"⌘ ").replace(/Ctrl\+/g,"⌃ ").replace(/Backspace/g,"⌫ "):e.replace(/CtrlOrCommand\+/g,"Ctrl+")}function resolveKeyText(e){return isMac()?e.replace(/CtrlOrCommand\+/g,"Command+"):e.replace(/CtrlOrCommand\+/g,"Ctrl+")}function isCtrlOrCommandKey(e){return isMac()?e.metaKey:e.ctrlKey}function loadSchemaList(e,t){return __awaiter$h(this,void 0,void 0,(function*(){try{loadingSchemaLists.update((n=>Object.assign(Object.assign({},n),{[`${e}::${t}`]:!0})));const n=yield getSchemaList({conid:e,database:t});return n.errorMessage?(showSnackbarError(`Error loading schemas: ${n.errorMessage}`),void console.error("Error loading schemas",n.errorMessage)):n}finally{loadingSchemaLists.update((n=>_.omit(n,[`${e}::${t}`])))}}))}function switchCurrentDatabase(e){var t;return __awaiter$h(this,void 0,void 0,(function*(){if((null===(t=null==e?void 0:e.connection)||void 0===t?void 0:t.useSeparateSchemas)&&!lib$5.isCompositeDbName(e.name)){const t=e.connection._id,n=e.name,o=`selected-schema-${t}-${n}`,r=localStorage.getItem(o),i=yield loadSchemaList(t,n);if(!i)return;const a=lib$5.findEngineDriver(e.connection,getExtensions()),s=lib$5.findDefaultSchema(i,null==a?void 0:a.dialect,r);currentDatabase.set(Object.assign(Object.assign({},e),{name:`${e.name}::${s}`}))}else currentDatabase.set(e)}))}function getKeyTextFromEvent(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.metaKey&&(t+="Command+"),e.shiftKey&&(t+="Shift+"),e.altKey&&(t+="Alt+"),t+=e.key,t}function create_fragment$5K(e){let t,n;return{c:noop$2,m(e,o){t||(n=listen(window,"keydown",handleCommandKeyDown),t=!0)},p:noop$2,i:noop$2,o:noop$2,d(e){t=!1,n()}}}function handleCommandKeyDown(e){const t=getKeyTextFromEvent(e),n=get_store_value(commandsCustomized);let o=Object.values(n).filter((e=>e.keyText&&resolveKeyText(e.keyText).toLowerCase().split("|").map((e=>e.trim())).includes(t.toLowerCase())&&(null==e.disableHandleKeyText||!resolveKeyText(e.disableHandleKeyText).toLowerCase().split("|").map((e=>e.trim())).includes(t.toLowerCase()))));if(o.length>0&&o.find((e=>!e.systemCommand))&&(e.preventDefault(),e.stopPropagation()),o.length>1&&o.find((e=>e.systemCommand))&&o.find((e=>!e.systemCommand))&&(o=o.filter((e=>!e.systemCommand))),o.every((e=>e.systemCommand)))return;const r=o.filter((e=>e.enabled&&!e.isGroupCommand));if(r.length>1&&console.log("Warning, multiple commands mapped to",t,r),1==r.length){const e=r[0];return void(e.onClick?e.onClick():e.getSubCommands&&visibleCommandPalette.set(e))}const i=o.filter((e=>e.enabled&&e.isGroupCommand));if(i.length>1&&console.log("Warning, multiple commands mapped to",t,i),1==i.length){runGroupCommand(i[0].group)}}window.__changeCurrentTheme=e=>currentTheme.set(e);class CommandListener extends SvelteComponent{constructor(e){super(),init(this,e,null,create_fragment$5K,safe_not_equal,{})}}var MapShim=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,o){return e[0]===t&&(n=o,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(t,n){var o=e(this.__entries__,t);~o?this.__entries__[o][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,o=e(n,t);~o&&n.splice(o,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,o=this.__entries__;n<o.length;n++){var r=o[n];e.call(t,r[1],r[0])}},t}()}(),isBrowser="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,global$1="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),requestAnimationFrame$1="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(global$1):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},trailingTimeout=2;function throttle(e,t){var n=!1,o=!1,r=0;function i(){n&&(n=!1,e()),o&&s()}function a(){requestAnimationFrame$1(i)}function s(){var e=Date.now();if(n){if(e-r<trailingTimeout)return;o=!0}else n=!0,o=!1,setTimeout(a,t);r=e}return s}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported="undefined"!=typeof MutationObserver,ResizeObserverController=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){isBrowser&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){isBrowser&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,o=transitionKeys.some((function(e){return!!~n.indexOf(e)}));o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),defineConfigurable=function(e,t){for(var n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},getWindowOf=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+toFloat(e["border-"+n+"-width"])}),0)}function getPaddings(e){for(var t={},n=0,o=["top","right","bottom","left"];n<o.length;n++){var r=o[n],i=e["padding-"+r];t[r]=toFloat(i)}return t}function getSVGContentRect(e){var t=e.getBBox();return createRectInit(0,0,t.width,t.height)}function getHTMLElementContentRect(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return emptyRect;var o=getWindowOf(e).getComputedStyle(e),r=getPaddings(o),i=r.left+r.right,a=r.top+r.bottom,s=toFloat(o.width),c=toFloat(o.height);if("border-box"===o.boxSizing&&(Math.round(s+i)!==t&&(s-=getBordersSize(o,"left","right")+i),Math.round(c+a)!==n&&(c-=getBordersSize(o,"top","bottom")+a)),!isDocumentElement(e)){var l=Math.round(s+i)-t,u=Math.round(c+a)-n;1!==Math.abs(l)&&(s-=l),1!==Math.abs(u)&&(c-=u)}return createRectInit(r.left,r.top,s,c)}var isSVGGraphicsElement="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof getWindowOf(e).SVGGraphicsElement}:function(e){return e instanceof getWindowOf(e).SVGElement&&"function"==typeof e.getBBox};function isDocumentElement(e){return e===getWindowOf(e).document.documentElement}function getContentRect(e){return isBrowser?isSVGGraphicsElement(e)?getSVGContentRect(e):getHTMLElementContentRect(e):emptyRect}function createReadOnlyRect(e){var t=e.x,n=e.y,o=e.width,r=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(i.prototype);return defineConfigurable(a,{x:t,y:n,width:o,height:r,top:n,right:t+o,bottom:r+n,left:t}),a}function createRectInit(e,t,n,o){return{x:e,y:t,width:n,height:o}}var ResizeObservation=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=getContentRect(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),ResizeObserverEntry=function(e,t){var n=createReadOnlyRect(t);defineConfigurable(this,{target:e,contentRect:n})},ResizeObserverSPI=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new MapShim,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new ResizeObservation(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new ResizeObserverEntry(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),observers="undefined"!=typeof WeakMap?new WeakMap:new MapShim,ResizeObserver$1=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ResizeObserverController.getInstance(),o=new ResizeObserverSPI(t,n,this);observers.set(this,o)};["observe","unobserve","disconnect"].forEach((function(e){ResizeObserver$1.prototype[e]=function(){var t;return(t=observers.get(this))[e].apply(t,arguments)}}));var index=void 0!==global$1.ResizeObserver?global$1.ResizeObserver:ResizeObserver$1;function resizeObserver(e,t){const n=()=>{const t=e.getBoundingClientRect();e.dispatchEvent(new CustomEvent("resize",{detail:{width:t.width,height:t.height}}))};let o=null;function r(){t&&!o&&(o=new index((()=>{n()})),o.observe(e)),!t&&o&&(o.disconnect(),o=null)}return r(),t&&n(),{destroy(){o&&(o.disconnect(),o=null)},update(e){t=e,r()}}}function create_default_slot$24(e){let t,n;return t=new FontIcon({props:{icon:"icon chevron-down"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5J(e){let t,n,o,r,i,a,s,c,l;return a=new InlineButton({props:{square:!0,$$slots:{default:[create_default_slot$24]},$$scope:{ctx:e}}}),{c(){t=element("div"),n=element("table"),o=element("tr"),r=element("td"),i=text$1("title\n "),create_component(a.$$.fragment),attr(r,"class","svelte-pa7e1d"),attr(t,"class","svelte-pa7e1d")},m(u,d){insert(u,t,d),append(t,n),append(n,o),append(o,r),append(r,i),mount_component(a,r,null),s=!0,c||(l=[action_destroyer(resizeObserver.call(null,r,!0)),listen(r,"resize",e[1])],c=!0)},p(e,[t]){const n={};4&t&&(n.$$scope={dirty:t,ctx:e}),a.$set(n)},i(e){s||(transition_in(a.$$.fragment,e),s=!0)},o(e){transition_out(a.$$.fragment,e),s=!1},d(e){e&&detach(t),destroy_component(a),c=!1,run_all(l)}}}const dataGridRowHeight=writable(0);function instance$5E(e,t,n){let o,r=noop$2;component_subscribe(e,dataGridRowHeight,(e=>n(0,o=e))),e.$$.on_destroy.push((()=>r()));return e.$$.update=()=>{1&e.$$.dirty&&console.log("dataGridRowHeight",o)},[o,e=>{set_store_value(dataGridRowHeight,o=e.detail.height+1,o)}]}class DataGridRowHeightMeter extends SvelteComponent{constructor(e){super(),init(this,e,instance$5E,create_fragment$5J,safe_not_equal,{})}}function create_else_block$17(e){let t,n,o,r,i,a;return o=new FontIcon({props:{icon:"icon loading"}}),{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=text$1(e[0]),attr(n,"class","spinner svelte-1s05410"),attr(t,"class","container svelte-1s05410")},m(e,s){insert(e,t,s),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),a=!0},p(e,t){(!a||1&t)&&set_data(i,e[0])},i(e){a||(transition_in(o.$$.fragment,e),a=!0)},o(e){transition_out(o.$$.fragment,e),a=!1},d(e){e&&detach(t),destroy_component(o)}}}function create_if_block$2p(e){let t,n,o,r,i,a,s,c;return i=new FontIcon({props:{icon:"icon loading"}}),{c(){t=element("div"),n=element("div"),o=element("div"),r=element("div"),create_component(i.$$.fragment),a=space(),s=text$1(e[0]),attr(r,"class","spinner svelte-1s05410"),attr(o,"class","container svelte-1s05410"),attr(n,"class","box svelte-1s05410"),attr(t,"class","wrapper svelte-1s05410")},m(e,l){insert(e,t,l),append(t,n),append(n,o),append(o,r),mount_component(i,r,null),append(o,a),append(o,s),c=!0},p(e,t){(!c||1&t)&&set_data(s,e[0])},i(e){c||(transition_in(i.$$.fragment,e),c=!0)},o(e){transition_out(i.$$.fragment,e),c=!1},d(e){e&&detach(t),destroy_component(i)}}}function create_fragment$5I(e){let t,n,o,r;const i=[create_if_block$2p,create_else_block$17],a=[];function s(e,t){return e[1]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,[r]){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function instance$5D(e,t,n){let{message:o}=t,{wrapper:r=!1}=t;return e.$$set=e=>{"message"in e&&n(0,o=e.message),"wrapper"in e&&n(1,r=e.wrapper)},[o,r]}class LoadingInfo extends SvelteComponent{constructor(e){super(),init(this,e,instance$5D,create_fragment$5I,safe_not_equal,{message:0,wrapper:1})}}const jsonlFormat={storageType:"jsonl",extension:"jsonl",extensions:["jsonl","ndjson"],name:"JSON lines/NDJSON",readerFunc:"jsonLinesReader",writerFunc:"jsonLinesWriter"},jsonFormat={storageType:"json",extension:"json",name:"JSON",readerFunc:"jsonReader",writerFunc:"jsonWriter",args:[{type:"select",name:"jsonStyle",label:"JSON style",options:[{name:"Array",value:""},{name:"Object",value:"object"}],apiName:"jsonStyle"},{type:"text",name:"keyField",label:'Key field (only for "Object" style)',apiName:"keyField"},{type:"text",name:"rootField",label:"Root field",apiName:"rootField"}]},sqlFormat={storageType:"sql",extension:"sql",name:"SQL",writerFunc:"sqlDataWriter"},jsonlQuickExport={label:"JSON lines/NDJSON",extension:"jsonl",createWriter:e=>({functionName:"jsonLinesWriter",props:{fileName:e}})},jsonQuickExport={label:"JSON",extension:"json",createWriter:e=>({functionName:"jsonWriter",props:{fileName:e}})},sqlQuickExport={label:"SQL",extension:"sql",createWriter:(e,t)=>({functionName:"sqlDataWriter",props:{fileName:e,dataName:t}})};function buildFileFormats(e){const t=[jsonlFormat,jsonFormat,sqlFormat];for(const{content:n}of e){const{fileFormats:e}=n;e&&t.push(...e)}return t}function buildQuickExports(e){const t=[jsonQuickExport,jsonlQuickExport,sqlQuickExport];for(const{content:n}of e)n.quickExports&&t.push(...n.quickExports);return t}function findFileFormat(e,t){return e.fileFormats.find((e=>e.storageType==t))}function getFileFormatDirections(e){if(!e)return[];const t=[];return e.readerFunc&&t.push("source"),e.writerFunc&&t.push("target"),t}function getDefaultFileFormat(e){return e.fileFormats.find((e=>"csv"==e.storageType))||jsonlFormat}const themeClassName$1="theme-light",themeName$1="Light",themeType$1="light";class ThemeLight extends SvelteComponent{constructor(e){super(),init(this,e,null,null,safe_not_equal,{})}}var light=Object.freeze({__proto__:null,default:ThemeLight,themeClassName:themeClassName$1,themeName:themeName$1,themeType:themeType$1});const themeClassName="theme-dark",themeName="Dark",themeType="dark";class ThemeDark extends SvelteComponent{constructor(e){super(),init(this,e,null,null,safe_not_equal,{})}}var dark=Object.freeze({__proto__:null,default:ThemeDark,themeClassName:themeClassName,themeName:themeName,themeType:themeType});function buildThemes(e){const t=[light,dark];for(const{content:n}of e){const{themes:e}=n;e&&t.push(...e)}return t}var __awaiter$g=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};function loadPlugins(pluginsDict,installedPlugins){return __awaiter$g(this,void 0,void 0,(function*(){window.DBGATE_PACKAGES={"dbgate-tools":dbgateTools,"dbgate-sqltree":sqlTree},window.DBGATE_TOOLS=dbgateTools;const newPlugins={};for(const installed of installedPlugins||[])if(!_.keys(pluginsDict).includes(installed.name)){console.log("Loading module",installed.name),loadingPluginStore.set({loaded:!1,loadingPackageName:installed.name});const resp=yield apiCall("plugins/script",{packageName:installed.name}),module=eval(`${resp}; plugin`);console.log("Loaded plugin",module);const moduleContent=module.__esModule?module.default:module;newPlugins[installed.name]=moduleContent}return installedPlugins&&loadingPluginStore.set({loaded:!0,loadingPackageName:null}),newPlugins}))}function buildDrivers(e){const t=[];for(const{content:n}of e)n.drivers&&t.push(...n.drivers);return t}function filterByEdition(e){return e.filter((e=>!e.premiumOnly||isProApp()))}function buildExtensions(e){return{plugins:e,fileFormats:filterByEdition(buildFileFormats(e)),themes:filterByEdition(buildThemes(e)),drivers:filterByEdition(buildDrivers(e)),quickExports:filterByEdition(buildQuickExports(e))}}function instance$5C(e,t,n){let o,r,i;component_subscribe(e,extensions,(e=>n(4,r=e))),this&&this.__awaiter;let a={};const s=useInstalledPlugins();return component_subscribe(e,s,(e=>n(3,i=e))),e.$$.update=()=>{10&e.$$.dirty&&loadPlugins(a,i).then((e=>{_.isEmpty(e)||n(1,a=_.pick(Object.assign(Object.assign({},a),e),i.map((e=>e.name))))})),10&e.$$.dirty&&n(2,o=(i||[]).map((e=>({packageName:e.name,manifest:e,content:a[e.name]}))).filter((e=>e.content))),4&e.$$.dirty&&set_store_value(extensions,r=buildExtensions(o),r)},[s,a,o,i]}class PluginsProvider extends SvelteComponent{constructor(e){super(),init(this,e,instance$5C,null,safe_not_equal,{})}}var lib$1={},GridDisplay$1={},GridConfig={};function createGridConfig(){return{hiddenColumns:[],expandedColumns:[],addedColumns:[],filters:{},columnWidths:{},sort:[],focusedColumns:null,grouping:{},formFilterColumns:[]}}function createGridCache(){return{refreshTime:(new Date).getTime()}}Object.defineProperty(GridConfig,"__esModule",{value:!0}),GridConfig.createGridCache=GridConfig.createGridConfig=void 0,GridConfig.createGridConfig=createGridConfig,GridConfig.createGridCache=createGridCache;var lib={},parseFilter$1={},parsimmon_umd_min={exports:{}};!function(e,t){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function o(e){if(!(this instanceof o))return new o(e);this._=e}var r=o.prototype;function i(e,t){for(var n=0;n<e;n++)t(n)}function a(e,t,n){return function(e,t){i(t.length,(function(n){e(t[n],n,t)}))}((function(n,o,r){t=e(t,n,o,r)}),n),t}function s(e,t){return a((function(t,n,o,r){return t.concat([e(n,o,r)])}),[],t)}function c(e,t){var n={v:0,buf:t};return i(e,(function(){var e;n={v:n.v<<1|(e=n.buf,e[0]>>7),buf:function(e){var t=a((function(e,t,n,o){return e.concat(n===o.length-1?Buffer.from([t,0]).readUInt16BE(0):o.readUInt16BE(n))}),[],e);return Buffer.from(s((function(e){return(e<<1&65535)>>8}),t))}(n.buf)}})),n}function l(){return"undefined"!=typeof Buffer}function u(){if(!l())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function d(e){u();var t=a((function(e,t){return e+t}),0,e);if(t%8!=0)throw new Error("The bits ["+e.join(", ")+"] add up to "+t+" which is not an even number of bytes; the total should be divisible by 8");var n,r=t/8,i=(n=function(e){return e>48},a((function(e,t){return e||(n(t)?t:e)}),null,e));if(i)throw new Error(i+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o((function(t,n){var o=r+n;return o>t.length?x(n,r.toString()+" bytes"):v(o,a((function(e,t){var n=c(t,e.buf);return{coll:e.coll.concat(n.v),buf:n.buf}}),{coll:[],buf:t.slice(n,o)},e).coll)}))}function p(e,t){return new o((function(n,o){return u(),o+t>n.length?x(o,t+" bytes for "+e):v(o+t,n.slice(o,o+t))}))}function m(e,t){if("number"!=typeof(n=t)||Math.floor(n)!==n||t<0||t>6)throw new Error(e+" requires integer length in range [0, 6].");var n}function f(e){return m("uintBE",e),p("uintBE("+e+")",e).map((function(t){return t.readUIntBE(0,e)}))}function h(e){return m("uintLE",e),p("uintLE("+e+")",e).map((function(t){return t.readUIntLE(0,e)}))}function g(e){return m("intBE",e),p("intBE("+e+")",e).map((function(t){return t.readIntBE(0,e)}))}function _(e){return m("intLE",e),p("intLE("+e+")",e).map((function(t){return t.readIntLE(0,e)}))}function $(e){return e instanceof o}function b(e){return"[object Array]"==={}.toString.call(e)}function y(e){return l()&&Buffer.isBuffer(e)}function v(e,t){return{status:!0,index:e,value:t,furthest:-1,expected:[]}}function x(e,t){return b(t)||(t=[t]),{status:!1,index:-1,value:null,furthest:e,expected:t}}function w(e,t){if(!t)return e;if(e.furthest>t.furthest)return e;var n=e.furthest===t.furthest?function(e,t){if(function(){if(void 0!==o._supportsSet)return o._supportsSet;var e="undefined"!=typeof Set;return o._supportsSet=e,e}()&&Array.from){for(var n=new Set(e),r=0;r<t.length;r++)n.add(t[r]);var i=Array.from(n);return i.sort(),i}for(var a={},s=0;s<e.length;s++)a[e[s]]=!0;for(var c=0;c<t.length;c++)a[t[c]]=!0;var l=[];for(var u in a)({}).hasOwnProperty.call(a,u)&&l.push(u);return l.sort(),l}(e.expected,t.expected):t.expected;return{status:e.status,index:e.index,value:e.value,furthest:t.furthest,expected:n}}var C={};function k(e,t){if(y(e))return{offset:t,line:-1,column:-1};e in C||(C[e]={});for(var n=C[e],o=0,r=0,i=0,a=t;a>=0;){if(a in n){o=n[a].line,0===i&&(i=n[a].lineStart);break}("\n"===e.charAt(a)||"\r"===e.charAt(a)&&"\n"!==e.charAt(a+1))&&(r++,0===i&&(i=a+1)),a--}var s=o+r,c=t-i;return n[t]={line:s,lineStart:i},{offset:t,line:s+1,column:c+1}}function S(e){if(!$(e))throw new Error("not a parser: "+e)}function T(e,t){return"string"==typeof e?e.charAt(t):e[t]}function E(e){if("number"!=typeof e)throw new Error("not a number: "+e)}function A(e){if("function"!=typeof e)throw new Error("not a function: "+e)}function O(e){if("string"!=typeof e)throw new Error("not a string: "+e)}var N=2,I=3,D=8,M=5*D,R=4*D,L=" ";function F(e,t){return new Array(t+1).join(e)}function P(e,t,n){var o=t-e.length;return o<=0?e:F(n,o)+e}function j(e,t,n,o){return{from:e-t>0?e-t:0,to:e+n>o?o:e+n}}function B(e,t){var n,o,r,i,c,l=t.index,u=l.offset,d=1;if(u===e.length)return"Got the end of the input";if(y(e)){var p=u-u%D,m=u-p,f=j(p,M,R+D,e.length),h=s((function(e){return s((function(e){return P(e.toString(16),2,"0")}),e)}),function(e,t){var n=e.length,o=[],r=0;if(n<=t)return[e.slice()];for(var i=0;i<n;i++)o[r]||o.push([]),o[r].push(e[i]),(i+1)%t==0&&r++;return o}(e.slice(f.from,f.to).toJSON().data,D));i=function(e){return 0===e.from&&1===e.to?{from:e.from,to:e.to}:{from:e.from/D,to:Math.floor(e.to/D)}}(f),o=p/D,n=3*m,m>=4&&(n+=1),d=2,r=s((function(e){return e.length<=4?e.join(" "):e.slice(0,4).join(" ")+" "+e.slice(4).join(" ")}),h),(c=(8*(i.to>0?i.to-1:i.to)).toString(16).length)<2&&(c=2)}else{var g=e.split(/\r\n|[\n\r\u2028\u2029]/);n=l.column-1,o=l.line-1,i=j(o,N,I,g.length),r=g.slice(i.from,i.to),c=i.to.toString().length}var _=o-i.from;return y(e)&&(c=(8*(i.to>0?i.to-1:i.to)).toString(16).length)<2&&(c=2),a((function(t,o,r){var a,s=r===_,l=s?"> ":L;return a=y(e)?P((8*(i.from+r)).toString(16),c,"0"):P((i.from+r+1).toString(),c," "),[].concat(t,[l+a+" | "+o],s?[L+F(" ",c)+" | "+P("",n," ")+F("^",d)]:[])}),[],r).join("\n")}function q(e,t){return["\n","-- PARSING FAILED "+F("-",50),"\n\n",B(e,t),"\n\n",(n=t.expected,1===n.length?"Expected:\n\n"+n[0]:"Expected one of the following: \n\n"+n.join(", ")),"\n"].join("");var n}function W(e){return void 0!==e.flags?e.flags:[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.unicode?"u":"",e.sticky?"y":""].join("")}function z(){for(var e=[].slice.call(arguments),t=e.length,n=0;n<t;n+=1)S(e[n]);return o((function(n,o){for(var r,i=new Array(t),a=0;a<t;a+=1){if(!(r=w(e[a]._(n,o),r)).status)return r;i[a]=r.value,o=r.index}return w(v(o,i),r)}))}function U(){var e=[].slice.call(arguments);if(0===e.length)throw new Error("seqMap needs at least one argument");var t=e.pop();return A(t),z.apply(null,e).map((function(e){return t.apply(null,e)}))}function H(){var e=[].slice.call(arguments),t=e.length;if(0===t)return Z("zero alternates");for(var n=0;n<t;n+=1)S(e[n]);return o((function(t,n){for(var o,r=0;r<e.length;r+=1)if((o=w(e[r]._(t,n),o)).status)return o;return o}))}function V(e,t){return G(e,t).or(Q([]))}function G(e,t){return S(e),S(t),U(e,t.then(e).many(),(function(e,t){return[e].concat(t)}))}function K(e){O(e);var t="'"+e+"'";return o((function(n,o){var r=o+e.length,i=n.slice(o,r);return i===e?v(r,i):x(o,t)}))}function Y(e,t){!function(e){if(!(e instanceof RegExp))throw new Error("not a regexp: "+e);for(var t=W(e),n=0;n<t.length;n++){var o=t.charAt(n);if("i"!==o&&"m"!==o&&"u"!==o&&"s"!==o)throw new Error('unsupported regexp flag "'+o+'": '+e)}}(e),arguments.length>=2?E(t):t=0;var n=function(e){return RegExp("^(?:"+e.source+")",W(e))}(e),r=""+e;return o((function(e,o){var i=n.exec(e.slice(o));if(i){if(0<=t&&t<=i.length){var a=i[0],s=i[t];return v(o+a.length,s)}return x(o,"valid match group (0 to "+i.length+") in "+r)}return x(o,r)}))}function Q(e){return o((function(t,n){return v(n,e)}))}function Z(e){return o((function(t,n){return x(n,e)}))}function J(e){if($(e))return o((function(t,n){var o=e._(t,n);return o.index=n,o.value="",o}));if("string"==typeof e)return J(K(e));if(e instanceof RegExp)return J(Y(e));throw new Error("not a string, regexp, or parser: "+e)}function X(e){return S(e),o((function(t,n){var o=e._(t,n),r=t.slice(n,o.index);return o.status?x(n,'not "'+r+'"'):v(n,null)}))}function ee(e){return A(e),o((function(t,n){var o=T(t,n);return n<t.length&&e(o)?v(n+1,o):x(n,"a character/byte matching "+e)}))}function te(e,t){arguments.length<2&&(t=e,e=void 0);var n=o((function(e,o){return n._=t()._,n._(e,o)}));return e?n.desc(e):n}function ne(){return Z("fantasy-land/empty")}r.parse=function(e){if("string"!=typeof e&&!y(e))throw new Error(".parse must be called with a string or Buffer as its argument");var t,n=this.skip(ae)._(e,0);return t=n.status?{status:!0,value:n.value}:{status:!1,index:k(e,n.furthest),expected:n.expected},delete C[e],t},r.tryParse=function(e){var t=this.parse(e);if(t.status)return t.value;var n=q(e,t),o=new Error(n);throw o.type="ParsimmonError",o.result=t,o},r.assert=function(e,t){return this.chain((function(n){return e(n)?Q(n):Z(t)}))},r.or=function(e){return H(this,e)},r.trim=function(e){return this.wrap(e,e)},r.wrap=function(e,t){return U(e,this,t,(function(e,t){return t}))},r.thru=function(e){return e(this)},r.then=function(e){return S(e),z(this,e).map((function(e){return e[1]}))},r.many=function(){var e=this;return o((function(t,n){for(var o=[],r=void 0;;){if(!(r=w(e._(t,n),r)).status)return w(v(n,o),r);if(n===r.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");n=r.index,o.push(r.value)}}))},r.tieWith=function(e){return O(e),this.map((function(t){if(function(e){if(!b(e))throw new Error("not an array: "+e)}(t),t.length){O(t[0]);for(var n=t[0],o=1;o<t.length;o++)O(t[o]),n+=e+t[o];return n}return""}))},r.tie=function(){return this.tieWith("")},r.times=function(e,t){var n=this;return arguments.length<2&&(t=e),E(e),E(t),o((function(o,r){for(var i=[],a=void 0,s=void 0,c=0;c<e;c+=1){if(s=w(a=n._(o,r),s),!a.status)return s;r=a.index,i.push(a.value)}for(;c<t&&(s=w(a=n._(o,r),s),a.status);c+=1)r=a.index,i.push(a.value);return w(v(r,i),s)}))},r.result=function(e){return this.map((function(){return e}))},r.atMost=function(e){return this.times(0,e)},r.atLeast=function(e){return U(this.times(e),this.many(),(function(e,t){return e.concat(t)}))},r.map=function(e){A(e);var t=this;return o((function(n,o){var r=t._(n,o);return r.status?w(v(r.index,e(r.value)),r):r}))},r.contramap=function(e){A(e);var t=this;return o((function(n,o){var r=t.parse(e(n.slice(o)));return r.status?v(o+n.length,r.value):r}))},r.promap=function(e,t){return A(e),A(t),this.contramap(e).map(t)},r.skip=function(e){return z(this,e).map((function(e){return e[0]}))},r.mark=function(){return U(oe,this,oe,(function(e,t,n){return{start:e,value:t,end:n}}))},r.node=function(e){return U(oe,this,oe,(function(t,n,o){return{name:e,value:n,start:t,end:o}}))},r.sepBy=function(e){return V(this,e)},r.sepBy1=function(e){return G(this,e)},r.lookahead=function(e){return this.skip(J(e))},r.notFollowedBy=function(e){return this.skip(X(e))},r.desc=function(e){b(e)||(e=[e]);var t=this;return o((function(n,o){var r=t._(n,o);return r.status||(r.expected=e),r}))},r.fallback=function(e){return this.or(Q(e))},r.ap=function(e){return U(e,this,(function(e,t){return e(t)}))},r.chain=function(e){var t=this;return o((function(n,o){var r=t._(n,o);return r.status?w(e(r.value)._(n,r.index),r):r}))},r.concat=r.or,r.empty=ne,r.of=Q,r["fantasy-land/ap"]=r.ap,r["fantasy-land/chain"]=r.chain,r["fantasy-land/concat"]=r.concat,r["fantasy-land/empty"]=r.empty,r["fantasy-land/of"]=r.of,r["fantasy-land/map"]=r.map;var oe=o((function(e,t){return v(t,k(e,t))})),re=o((function(e,t){return t>=e.length?x(t,"any character/byte"):v(t+1,T(e,t))})),ie=o((function(e,t){return v(e.length,e.slice(t))})),ae=o((function(e,t){return t<e.length?x(t,"EOF"):v(t,null)})),se=Y(/[0-9]/).desc("a digit"),ce=Y(/[0-9]*/).desc("optional digits"),le=Y(/[a-z]/i).desc("a letter"),ue=Y(/[a-z]*/i).desc("optional letters"),de=Y(/\s*/).desc("optional whitespace"),pe=Y(/\s+/).desc("whitespace"),me=K("\r"),fe=K("\n"),he=K("\r\n"),ge=H(he,fe,me).desc("newline"),_e=H(ge,ae);o.all=ie,o.alt=H,o.any=re,o.cr=me,o.createLanguage=function(e){var t={};for(var n in e)({}).hasOwnProperty.call(e,n)&&function(n){t[n]=te((function(){return e[n](t)}))}(n);return t},o.crlf=he,o.custom=function(e){return o(e(v,x))},o.digit=se,o.digits=ce,o.empty=ne,o.end=_e,o.eof=ae,o.fail=Z,o.formatError=q,o.index=oe,o.isParser=$,o.lazy=te,o.letter=le,o.letters=ue,o.lf=fe,o.lookahead=J,o.makeFailure=x,o.makeSuccess=v,o.newline=ge,o.noneOf=function(e){return ee((function(t){return e.indexOf(t)<0})).desc("none of '"+e+"'")},o.notFollowedBy=X,o.of=Q,o.oneOf=function(e){for(var t=e.split(""),n=0;n<t.length;n++)t[n]="'"+t[n]+"'";return ee((function(t){return e.indexOf(t)>=0})).desc(t)},o.optWhitespace=de,o.Parser=o,o.range=function(e,t){return ee((function(n){return e<=n&&n<=t})).desc(e+"-"+t)},o.regex=Y,o.regexp=Y,o.sepBy=V,o.sepBy1=G,o.seq=z,o.seqMap=U,o.seqObj=function(){for(var e,t={},n=0,r=(e=arguments,Array.prototype.slice.call(e)),i=r.length,a=0;a<i;a+=1){var s=r[a];if(!$(s)){if(b(s)&&2===s.length&&"string"==typeof s[0]&&$(s[1])){var c=s[0];if(Object.prototype.hasOwnProperty.call(t,c))throw new Error("seqObj: duplicate key "+c);t[c]=!0,n++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(0===n)throw new Error("seqObj expects at least one named parser, found zero");return o((function(e,t){for(var n,o={},a=0;a<i;a+=1){var s,c;if(b(r[a])?(s=r[a][0],c=r[a][1]):(s=null,c=r[a]),!(n=w(c._(e,t),n)).status)return n;s&&(o[s]=n.value),t=n.index}return w(v(t,o),n)}))},o.string=K,o.succeed=Q,o.takeWhile=function(e){return A(e),o((function(t,n){for(var o=n;o<t.length&&e(T(t,o));)o++;return v(o,t.slice(n,o))}))},o.test=ee,o.whitespace=pe,o["fantasy-land/empty"]=ne,o["fantasy-land/of"]=Q,o.Binary={bitSeq:d,bitSeqObj:function(e){u();var t={},n=0,o=s((function(e){if(b(e)){var o=e;if(2!==o.length)throw new Error("["+o.join(", ")+"] should be length 2, got length "+o.length);if(O(o[0]),E(o[1]),Object.prototype.hasOwnProperty.call(t,o[0]))throw new Error("duplicate key in bitSeqObj: "+o[0]);return t[o[0]]=!0,n++,o}return E(e),[null,e]}),e);if(n<1)throw new Error("bitSeqObj expects at least one named pair, got ["+e.join(", ")+"]");var r=s((function(e){return e[0]}),o);return d(s((function(e){return e[1]}),o)).map((function(e){return a((function(e,t){return null!==t[0]&&(e[t[0]]=t[1]),e}),{},s((function(t,n){return[t,e[n]]}),r))}))},byte:function(e){if(u(),E(e),e>255)throw new Error("Value specified to byte constructor ("+e+"=0x"+e.toString(16)+") is larger in value than a single byte.");var t=(e>15?"0x":"0x0")+e.toString(16);return o((function(n,o){var r=T(n,o);return r===e?v(o+1,r):x(o,t)}))},buffer:function(e){return p("buffer",e).map((function(e){return Buffer.from(e)}))},encodedString:function(e,t){return p("string",t).map((function(t){return t.toString(e)}))},uintBE:f,uint8BE:f(1),uint16BE:f(2),uint32BE:f(4),uintLE:h,uint8LE:h(1),uint16LE:h(2),uint32LE:h(4),intBE:g,int8BE:g(1),int16BE:g(2),int32BE:g(4),intLE:_,int8LE:_(1),int16LE:_(2),int32LE:_(4),floatBE:p("floatBE",4).map((function(e){return e.readFloatBE(0)})),floatLE:p("floatLE",4).map((function(e){return e.readFloatLE(0)})),doubleBE:p("doubleBE",8).map((function(e){return e.readDoubleBE(0)})),doubleLE:p("doubleLE",8).map((function(e){return e.readDoubleLE(0)}))},e.exports=o}])}(parsimmon_umd_min);var moment$1={exports:{}};!function(e,t){e.exports=function(){var t,n;function o(){return t.apply(null,arguments)}function r(e){t=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var n,o=[],r=e.length;for(n=0;n<r;++n)o.push(t(e[n],n));return o}function m(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,n,o){return Kn(e,t,n,o,!0).utc()}function h(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(e){return null==e._pf&&(e._pf=h()),e._pf}function _(e){var t=null,o=!1,r=e._d&&!isNaN(e._d.getTime());return r&&(t=g(e),o=n.call(t.parsedDateParts,(function(e){return null!=e})),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o),e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?r:(e._isValid=r,e._isValid)}function $(e){var t=f(NaN);return null!=e?m(g(t),e):g(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),o=n.length>>>0;for(t=0;t<o;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var b=o.momentProperties=[],y=!1;function v(e,t){var n,o,r,i=b.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)l(r=t[o=b[n]])||(e[o]=r);return e}function x(e){v(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,o.updateOffset(this),y=!1)}function w(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function C(e){!1===o.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return m((function(){if(null!=o.deprecationHandler&&o.deprecationHandler(null,e),n){var r,i,a,c=[],l=arguments.length;for(i=0;i<l;i++){if(r="","object"==typeof arguments[i]){for(a in r+="\n["+i+"] ",arguments[0])s(arguments[0],a)&&(r+=a+": "+arguments[0][a]+", ");r=r.slice(0,-2)}else r=arguments[i];c.push(r)}C(e+"\nArguments: "+Array.prototype.slice.call(c).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var S,T={};function E(e,t){null!=o.deprecationHandler&&o.deprecationHandler(e,t),T[e]||(C(t),T[e]=!0)}function A(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e){var t,n;for(n in e)s(e,n)&&(A(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function N(e,t){var n,o=m({},e);for(n in t)s(t,n)&&(a(e[n])&&a(t[n])?(o[n]={},m(o[n],e[n]),m(o[n],t[n])):null!=t[n]?o[n]=t[n]:delete o[n]);for(n in e)s(e,n)&&!s(t,n)&&a(e[n])&&(o[n]=m({},o[n]));return o}function I(e){null!=e&&this.set(e)}o.suppressDeprecationWarnings=!1,o.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var D={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function M(e,t,n){var o=this._calendar[e]||this._calendar.sameElse;return A(o)?o.call(t,n):o}function R(e,t,n){var o=""+Math.abs(e),r=t-o.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},j={};function B(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(j[e]=r),t&&(j[t[0]]=function(){return R(r.apply(this,arguments),t[1],t[2])}),n&&(j[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function q(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,n,o=e.match(L);for(t=0,n=o.length;t<n;t++)j[o[t]]?o[t]=j[o[t]]:o[t]=q(o[t]);return function(t){var r,i="";for(r=0;r<n;r++)i+=A(o[r])?o[r].call(t,e):o[r];return i}}function z(e,t){return e.isValid()?(t=U(t,e.localeData()),P[t]=P[t]||W(t),P[t](e)):e.localeData().invalidDate()}function U(e,t){var n=5;function o(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,o),F.lastIndex=0,n-=1;return e}var H={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var G="Invalid date";function K(){return this._invalidDate}var Y="%d",Q=/\d{1,2}/;function Z(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function X(e,t,n,o){var r=this._relativeTime[n];return A(r)?r(e,t,n,o):r.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var te={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"==typeof e?te[e]||te[e.toLowerCase()]:void 0}function oe(e){var t,n,o={};for(n in e)s(e,n)&&(t=ne(n))&&(o[t]=e[n]);return o}var re={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ie(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:re[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}var ae,se=/\d/,ce=/\d\d/,le=/\d{3}/,ue=/\d{4}/,de=/[+-]?\d{6}/,pe=/\d\d?/,me=/\d\d\d\d?/,fe=/\d\d\d\d\d\d?/,he=/\d{1,3}/,ge=/\d{1,4}/,_e=/[+-]?\d{1,6}/,$e=/\d+/,be=/[+-]?\d+/,ye=/Z|[+-]\d\d:?\d\d/gi,ve=/Z|[+-]\d\d(?::?\d\d)?/gi,xe=/[+-]?\d+(\.\d{1,3})?/,we=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ce=/^[1-9]\d?/,ke=/^([1-9]\d|\d)/;function Se(e,t,n){ae[e]=A(t)?t:function(e,o){return e&&n?n:t}}function Te(e,t){return s(ae,e)?ae[e](t._strict,t._locale):new RegExp(Ee(e))}function Ee(e){return Ae(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,o,r){return t||n||o||r})))}function Ae(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Oe(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ne(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Oe(t)),n}ae={};var Ie={};function De(e,t){var n,o,r=t;for("string"==typeof e&&(e=[e]),u(t)&&(r=function(e,n){n[t]=Ne(e)}),o=e.length,n=0;n<o;n++)Ie[e[n]]=r}function Me(e,t){De(e,(function(e,n,o,r){o._w=o._w||{},t(e,o._w,o,r)}))}function Re(e,t,n){null!=t&&s(Ie,e)&&Ie[e](t,n._a,n,e)}function Le(e){return e%4==0&&e%100!=0||e%400==0}var Fe=0,Pe=1,je=2,Be=3,qe=4,We=5,ze=6,Ue=7,He=8;function Ve(e){return Le(e)?366:365}B("Y",0,0,(function(){var e=this.year();return e<=9999?R(e,4):"+"+e})),B(0,["YY",2],0,(function(){return this.year()%100})),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),Se("Y",be),Se("YY",pe,ce),Se("YYYY",ge,ue),Se("YYYYY",_e,de),Se("YYYYYY",_e,de),De(["YYYYY","YYYYYY"],Fe),De("YYYY",(function(e,t){t[Fe]=2===e.length?o.parseTwoDigitYear(e):Ne(e)})),De("YY",(function(e,t){t[Fe]=o.parseTwoDigitYear(e)})),De("Y",(function(e,t){t[Fe]=parseInt(e,10)})),o.parseTwoDigitYear=function(e){return Ne(e)+(Ne(e)>68?1900:2e3)};var Ge,Ke=Qe("FullYear",!0);function Ye(){return Le(this.year())}function Qe(e,t){return function(n){return null!=n?(Je(this,e,n),o.updateOffset(this,t),this):Ze(this,e)}}function Ze(e,t){if(!e.isValid())return NaN;var n=e._d,o=e._isUTC;switch(t){case"Milliseconds":return o?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return o?n.getUTCSeconds():n.getSeconds();case"Minutes":return o?n.getUTCMinutes():n.getMinutes();case"Hours":return o?n.getUTCHours():n.getHours();case"Date":return o?n.getUTCDate():n.getDate();case"Day":return o?n.getUTCDay():n.getDay();case"Month":return o?n.getUTCMonth():n.getMonth();case"FullYear":return o?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Je(e,t,n){var o,r,i,a,s;if(e.isValid()&&!isNaN(n)){switch(o=e._d,r=e._isUTC,t){case"Milliseconds":return void(r?o.setUTCMilliseconds(n):o.setMilliseconds(n));case"Seconds":return void(r?o.setUTCSeconds(n):o.setSeconds(n));case"Minutes":return void(r?o.setUTCMinutes(n):o.setMinutes(n));case"Hours":return void(r?o.setUTCHours(n):o.setHours(n));case"Date":return void(r?o.setUTCDate(n):o.setDate(n));case"FullYear":break;default:return}i=n,a=e.month(),s=29!==(s=e.date())||1!==a||Le(i)?s:28,r?o.setUTCFullYear(i,a,s):o.setFullYear(i,a,s)}}function Xe(e){return A(this[e=ne(e)])?this[e]():this}function et(e,t){if("object"==typeof e){var n,o=ie(e=oe(e)),r=o.length;for(n=0;n<r;n++)this[o[n].unit](e[o[n].unit])}else if(A(this[e=ne(e)]))return this[e](t);return this}function tt(e,t){return(e%t+t)%t}function nt(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=tt(t,12);return e+=(t-n)/12,1===n?Le(e)?29:28:31-n%7%2}Ge=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},B("M",["MM",2],"Mo",(function(){return this.month()+1})),B("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),B("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),Se("M",pe,Ce),Se("MM",pe,ce),Se("MMM",(function(e,t){return t.monthsShortRegex(e)})),Se("MMMM",(function(e,t){return t.monthsRegex(e)})),De(["M","MM"],(function(e,t){t[Pe]=Ne(e)-1})),De(["MMM","MMMM"],(function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[Pe]=r:g(n).invalidMonth=e}));var ot="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),rt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),it=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,at=we,st=we;function ct(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||it).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function lt(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[it.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ut(e,t,n){var o,r,i,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;o<12;++o)i=f([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=Ge.call(this._shortMonthsParse,a))?r:null:-1!==(r=Ge.call(this._longMonthsParse,a))?r:null:"MMM"===t?-1!==(r=Ge.call(this._shortMonthsParse,a))||-1!==(r=Ge.call(this._longMonthsParse,a))?r:null:-1!==(r=Ge.call(this._longMonthsParse,a))||-1!==(r=Ge.call(this._shortMonthsParse,a))?r:null}function dt(e,t,n){var o,r,i;if(this._monthsParseExact)return ut.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;o<12;o++){if(r=f([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function pt(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Ne(t);else if(!u(t=e.localeData().monthsParse(t)))return e;var n=t,o=e.date();return o=o<29?o:Math.min(o,nt(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,o):e._d.setMonth(n,o),e}function mt(e){return null!=e?(pt(this,e),o.updateOffset(this,!0),this):Ze(this,"Month")}function ft(){return nt(this.year(),this.month())}function ht(e){return this._monthsParseExact?(s(this,"_monthsRegex")||_t.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=at),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(e){return this._monthsParseExact?(s(this,"_monthsRegex")||_t.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=st),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function _t(){function e(e,t){return t.length-e.length}var t,n,o,r,i=[],a=[],s=[];for(t=0;t<12;t++)n=f([2e3,t]),o=Ae(this.monthsShort(n,"")),r=Ae(this.months(n,"")),i.push(o),a.push(r),s.push(r),s.push(o);i.sort(e),a.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function $t(e,t,n,o,r,i,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,o,r,i,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,o,r,i,a),s}function bt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function yt(e,t,n){var o=7+t-n;return-(7+bt(e,0,o).getUTCDay()-t)%7+o-1}function vt(e,t,n,o,r){var i,a,s=1+7*(t-1)+(7+n-o)%7+yt(e,o,r);return s<=0?a=Ve(i=e-1)+s:s>Ve(e)?(i=e+1,a=s-Ve(e)):(i=e,a=s),{year:i,dayOfYear:a}}function xt(e,t,n){var o,r,i=yt(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?o=a+wt(r=e.year()-1,t,n):a>wt(e.year(),t,n)?(o=a-wt(e.year(),t,n),r=e.year()+1):(r=e.year(),o=a),{week:o,year:r}}function wt(e,t,n){var o=yt(e,t,n),r=yt(e+1,t,n);return(Ve(e)-o+r)/7}function Ct(e){return xt(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),Se("w",pe,Ce),Se("ww",pe,ce),Se("W",pe,Ce),Se("WW",pe,ce),Me(["w","ww","W","WW"],(function(e,t,n,o){t[o.substr(0,1)]=Ne(e)}));var kt={dow:0,doy:6};function St(){return this._week.dow}function Tt(){return this._week.doy}function Et(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=xt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Ot(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Nt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function It(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),B("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),B("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),Se("d",pe),Se("e",pe),Se("E",pe),Se("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Se("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Se("dddd",(function(e,t){return t.weekdaysRegex(e)})),Me(["dd","ddd","dddd"],(function(e,t,n,o){var r=n._locale.weekdaysParse(e,o,n._strict);null!=r?t.d=r:g(n).invalidWeekday=e})),Me(["d","e","E"],(function(e,t,n,o){t[o]=Ne(e)}));var Dt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Mt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Lt=we,Ft=we,Pt=we;function jt(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?It(n,this._week.dow):e?n[e.day()]:n}function Bt(e){return!0===e?It(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function qt(e){return!0===e?It(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Wt(e,t,n){var o,r,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)i=f([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=Ge.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=Ge.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=Ge.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=Ge.call(this._weekdaysParse,a))||-1!==(r=Ge.call(this._shortWeekdaysParse,a))||-1!==(r=Ge.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=Ge.call(this._shortWeekdaysParse,a))||-1!==(r=Ge.call(this._weekdaysParse,a))||-1!==(r=Ge.call(this._minWeekdaysParse,a))?r:null:-1!==(r=Ge.call(this._minWeekdaysParse,a))||-1!==(r=Ge.call(this._weekdaysParse,a))||-1!==(r=Ge.call(this._shortWeekdaysParse,a))?r:null}function zt(e,t,n){var o,r,i;if(this._weekdaysParseExact)return Wt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(r=f([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[o]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(n&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(n&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!n&&this._weekdaysParse[o].test(e))return o}}function Ut(e){if(!this.isValid())return null!=e?this:NaN;var t=Ze(this,"Day");return null!=e?(e=Ot(e,this.localeData()),this.add(e-t,"d")):t}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Vt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Nt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Gt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Lt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Kt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ft),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Yt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Pt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qt(){function e(e,t){return t.length-e.length}var t,n,o,r,i,a=[],s=[],c=[],l=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),o=Ae(this.weekdaysMin(n,"")),r=Ae(this.weekdaysShort(n,"")),i=Ae(this.weekdays(n,"")),a.push(o),s.push(r),c.push(i),l.push(o),l.push(r),l.push(i);a.sort(e),s.sort(e),c.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Zt(){return this.hours()%12||12}function Jt(){return this.hours()||24}function Xt(e,t){B(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function en(e,t){return t._meridiemParse}function tn(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Zt),B("k",["kk",2],0,Jt),B("hmm",0,0,(function(){return""+Zt.apply(this)+R(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+Zt.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+R(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)})),Xt("a",!0),Xt("A",!1),Se("a",en),Se("A",en),Se("H",pe,ke),Se("h",pe,Ce),Se("k",pe,Ce),Se("HH",pe,ce),Se("hh",pe,ce),Se("kk",pe,ce),Se("hmm",me),Se("hmmss",fe),Se("Hmm",me),Se("Hmmss",fe),De(["H","HH"],Be),De(["k","kk"],(function(e,t,n){var o=Ne(e);t[Be]=24===o?0:o})),De(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),De(["h","hh"],(function(e,t,n){t[Be]=Ne(e),g(n).bigHour=!0})),De("hmm",(function(e,t,n){var o=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o)),g(n).bigHour=!0})),De("hmmss",(function(e,t,n){var o=e.length-4,r=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o,2)),t[We]=Ne(e.substr(r)),g(n).bigHour=!0})),De("Hmm",(function(e,t,n){var o=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o))})),De("Hmmss",(function(e,t,n){var o=e.length-4,r=e.length-2;t[Be]=Ne(e.substr(0,o)),t[qe]=Ne(e.substr(o,2)),t[We]=Ne(e.substr(r))}));var nn=/[ap]\.?m?\.?/i,on=Qe("Hours",!0);function rn(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var an,sn={calendar:D,longDateFormat:H,invalidDate:G,ordinal:Y,dayOfMonthOrdinalParse:Q,relativeTime:J,months:ot,monthsShort:rt,week:kt,weekdays:Dt,weekdaysMin:Rt,weekdaysShort:Mt,meridiemParse:nn},cn={},ln={};function un(e,t){var n,o=Math.min(e.length,t.length);for(n=0;n<o;n+=1)if(e[n]!==t[n])return n;return o}function dn(e){return e?e.toLowerCase().replace("_","-"):e}function pn(e){for(var t,n,o,r,i=0;i<e.length;){for(t=(r=dn(e[i]).split("-")).length,n=(n=dn(e[i+1]))?n.split("-"):null;t>0;){if(o=fn(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&un(r,n)>=t-1)break;t--}i++}return an}function mn(e){return!(!e||!e.match("^[^/\\\\]*$"))}function fn(t){var n=null;if(void 0===cn[t]&&e&&e.exports&&mn(t))try{n=an._abbr,commonjsRequire("./locale/"+t),hn(n)}catch(e){cn[t]=null}return cn[t]}function hn(e,t){var n;return e&&((n=l(t)?$n(e):gn(e,t))?an=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),an._abbr}function gn(e,t){if(null!==t){var n,o=sn;if(t.abbr=e,null!=cn[e])E("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])o=cn[t.parentLocale]._config;else{if(null==(n=fn(t.parentLocale)))return ln[t.parentLocale]||(ln[t.parentLocale]=[]),ln[t.parentLocale].push({name:e,config:t}),null;o=n._config}return cn[e]=new I(N(o,t)),ln[e]&&ln[e].forEach((function(e){gn(e.name,e.config)})),hn(e),cn[e]}return delete cn[e],null}function _n(e,t){if(null!=t){var n,o,r=sn;null!=cn[e]&&null!=cn[e].parentLocale?cn[e].set(N(cn[e]._config,t)):(null!=(o=fn(e))&&(r=o._config),t=N(r,t),null==o&&(t.abbr=e),(n=new I(t)).parentLocale=cn[e],cn[e]=n),hn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?(cn[e]=cn[e].parentLocale,e===hn()&&hn(e)):null!=cn[e]&&delete cn[e]);return cn[e]}function $n(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return an;if(!i(e)){if(t=fn(e))return t;e=[e]}return pn(e)}function bn(){return S(cn)}function yn(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[Pe]<0||n[Pe]>11?Pe:n[je]<1||n[je]>nt(n[Fe],n[Pe])?je:n[Be]<0||n[Be]>24||24===n[Be]&&(0!==n[qe]||0!==n[We]||0!==n[ze])?Be:n[qe]<0||n[qe]>59?qe:n[We]<0||n[We]>59?We:n[ze]<0||n[ze]>999?ze:-1,g(e)._overflowDayOfYear&&(t<Fe||t>je)&&(t=je),g(e)._overflowWeeks&&-1===t&&(t=Ue),g(e)._overflowWeekday&&-1===t&&(t=He),g(e).overflow=t),e}var vn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wn=/Z|[+-]\d\d(?::?\d\d)?/,Cn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Sn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,En={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function An(e){var t,n,o,r,i,a,s=e._i,c=vn.exec(s)||xn.exec(s),l=Cn.length,u=kn.length;if(c){for(g(e).iso=!0,t=0,n=l;t<n;t++)if(Cn[t][1].exec(c[1])){r=Cn[t][0],o=!1!==Cn[t][2];break}if(null==r)return void(e._isValid=!1);if(c[3]){for(t=0,n=u;t<n;t++)if(kn[t][1].exec(c[3])){i=(c[2]||" ")+kn[t][0];break}if(null==i)return void(e._isValid=!1)}if(!o&&null!=i)return void(e._isValid=!1);if(c[4]){if(!wn.exec(c[4]))return void(e._isValid=!1);a="Z"}e._f=r+(i||"")+(a||""),qn(e)}else e._isValid=!1}function On(e,t,n,o,r,i){var a=[Nn(e),rt.indexOf(t),parseInt(n,10),parseInt(o,10),parseInt(r,10)];return i&&a.push(parseInt(i,10)),a}function Nn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dn(e,t,n){return!e||Mt.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(g(n).weekdayMismatch=!0,n._isValid=!1,!1)}function Mn(e,t,n){if(e)return En[e];if(t)return 0;var o=parseInt(n,10),r=o%100;return(o-r)/100*60+r}function Rn(e){var t,n=Tn.exec(In(e._i));if(n){if(t=On(n[4],n[3],n[2],n[5],n[6],n[7]),!Dn(n[1],t,e))return;e._a=t,e._tzm=Mn(n[8],n[9],n[10]),e._d=bt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function Ln(e){var t=Sn.exec(e._i);null===t?(An(e),!1===e._isValid&&(delete e._isValid,Rn(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:o.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Fn(e,t,n){return null!=e?e:null!=t?t:n}function Pn(e){var t=new Date(o.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function jn(e){var t,n,o,r,i,a=[];if(!e._d){for(o=Pn(e),e._w&&null==e._a[je]&&null==e._a[Pe]&&Bn(e),null!=e._dayOfYear&&(i=Fn(e._a[Fe],o[Fe]),(e._dayOfYear>Ve(i)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=bt(i,0,e._dayOfYear),e._a[Pe]=n.getUTCMonth(),e._a[je]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=o[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Be]&&0===e._a[qe]&&0===e._a[We]&&0===e._a[ze]&&(e._nextDay=!0,e._a[Be]=0),e._d=(e._useUTC?bt:$t).apply(null,a),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Be]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(g(e).weekdayMismatch=!0)}}function Bn(e){var t,n,o,r,i,a,s,c,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,a=4,n=Fn(t.GG,e._a[Fe],xt(Yn(),1,4).year),o=Fn(t.W,1),((r=Fn(t.E,1))<1||r>7)&&(c=!0)):(i=e._locale._week.dow,a=e._locale._week.doy,l=xt(Yn(),i,a),n=Fn(t.gg,e._a[Fe],l.year),o=Fn(t.w,l.week),null!=t.d?((r=t.d)<0||r>6)&&(c=!0):null!=t.e?(r=t.e+i,(t.e<0||t.e>6)&&(c=!0)):r=i),o<1||o>wt(n,i,a)?g(e)._overflowWeeks=!0:null!=c?g(e)._overflowWeekday=!0:(s=vt(n,o,r,i,a),e._a[Fe]=s.year,e._dayOfYear=s.dayOfYear)}function qn(e){if(e._f!==o.ISO_8601)if(e._f!==o.RFC_2822){e._a=[],g(e).empty=!0;var t,n,r,i,a,s,c,l=""+e._i,u=l.length,d=0;for(c=(r=U(e._f,e._locale).match(L)||[]).length,t=0;t<c;t++)i=r[t],(n=(l.match(Te(i,e))||[])[0])&&((a=l.substr(0,l.indexOf(n))).length>0&&g(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),d+=n.length),j[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),Re(i,n,e)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=u-d,l.length>0&&g(e).unusedInput.push(l),e._a[Be]<=12&&!0===g(e).bigHour&&e._a[Be]>0&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[Be]=Wn(e._locale,e._a[Be],e._meridiem),null!==(s=g(e).era)&&(e._a[Fe]=e._locale.erasConvertYear(s,e._a[Fe])),jn(e),yn(e)}else Rn(e);else An(e)}function Wn(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((o=e.isPM(n))&&t<12&&(t+=12),o||12!==t||(t=0),t):t}function zn(e){var t,n,o,r,i,a,s=!1,c=e._f.length;if(0===c)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<c;r++)i=0,a=!1,t=v({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],qn(t),_(t)&&(a=!0),i+=g(t).charsLeftOver,i+=10*g(t).unusedTokens.length,g(t).score=i,s?i<o&&(o=i,n=t):(null==o||i<o||a)&&(o=i,n=t,a&&(s=!0));m(e,n||t)}function Un(e){if(!e._d){var t=oe(e._i),n=void 0===t.day?t.date:t.day;e._a=p([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),jn(e)}}function Hn(e){var t=new x(yn(Vn(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Vn(e){var t=e._i,n=e._f;return e._locale=e._locale||$n(e._l),null===t||void 0===n&&""===t?$({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new x(yn(t)):(d(t)?e._d=t:i(n)?zn(e):n?qn(e):Gn(e),_(e)||(e._d=null),e))}function Gn(e){var t=e._i;l(t)?e._d=new Date(o.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?Ln(e):i(t)?(e._a=p(t.slice(0),(function(e){return parseInt(e,10)})),jn(e)):a(t)?Un(e):u(t)?e._d=new Date(t):o.createFromInputFallback(e)}function Kn(e,t,n,o,r){var s={};return!0!==t&&!1!==t||(o=t,t=void 0),!0!==n&&!1!==n||(o=n,n=void 0),(a(e)&&c(e)||i(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=n,s._i=e,s._f=t,s._strict=o,Hn(s)}function Yn(e,t,n,o){return Kn(e,t,n,o,!1)}o.createFromInputFallback=k("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),o.ISO_8601=function(){},o.RFC_2822=function(){};var Qn=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Yn.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:$()})),Zn=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Yn.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:$()}));function Jn(e,t){var n,o;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Yn();for(n=t[0],o=1;o<t.length;++o)t[o].isValid()&&!t[o][e](n)||(n=t[o]);return n}function Xn(){return Jn("isBefore",[].slice.call(arguments,0))}function eo(){return Jn("isAfter",[].slice.call(arguments,0))}var to=function(){return Date.now?Date.now():+new Date},no=["year","quarter","month","week","day","hour","minute","second","millisecond"];function oo(e){var t,n,o=!1,r=no.length;for(t in e)if(s(e,t)&&(-1===Ge.call(no,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<r;++n)if(e[no[n]]){if(o)return!1;parseFloat(e[no[n]])!==Ne(e[no[n]])&&(o=!0)}return!0}function ro(){return this._isValid}function io(){return Ao(NaN)}function ao(e){var t=oe(e),n=t.year||0,o=t.quarter||0,r=t.month||0,i=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=oo(t),this._milliseconds=+u+1e3*l+6e4*c+1e3*s*60*60,this._days=+a+7*i,this._months=+r+3*o+12*n,this._data={},this._locale=$n(),this._bubble()}function so(e){return e instanceof ao}function co(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function lo(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&Ne(e[o])!==Ne(t[o]))&&a++;return a+i}function uo(e,t){B(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+R(~~(e/60),2)+t+R(~~e%60,2)}))}uo("Z",":"),uo("ZZ",""),Se("Z",ve),Se("ZZ",ve),De(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=mo(ve,e)}));var po=/([\+\-]|\d\d)/gi;function mo(e,t){var n,o,r=(t||"").match(e);return null===r?null:0===(o=60*(n=((r[r.length-1]||[])+"").match(po)||["-",0,0])[1]+Ne(n[2]))?0:"+"===n[0]?o:-o}function fo(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(w(e)||d(e)?e.valueOf():Yn(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),o.updateOffset(n,!1),n):Yn(e).local()}function ho(e){return-Math.round(e._d.getTimezoneOffset())}function go(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=mo(ve,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=ho(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Mo(this,Ao(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,o.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:ho(this)}function _o(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function $o(e){return this.utcOffset(0,e)}function bo(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(ho(this),"m")),this}function yo(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=mo(ye,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function vo(e){return!!this.isValid()&&(e=e?Yn(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function xo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function wo(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=Vn(t))._a?(e=t._isUTC?f(t._a):Yn(t._a),this._isDSTShifted=this.isValid()&&lo(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Co(){return!!this.isValid()&&!this._isUTC}function ko(){return!!this.isValid()&&this._isUTC}function So(){return!!this.isValid()&&this._isUTC&&0===this._offset}o.updateOffset=function(){};var To=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Eo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ao(e,t){var n,o,r,i=e,a=null;return so(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(a=To.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:Ne(a[je])*n,h:Ne(a[Be])*n,m:Ne(a[qe])*n,s:Ne(a[We])*n,ms:Ne(co(1e3*a[ze]))*n}):(a=Eo.exec(e))?(n="-"===a[1]?-1:1,i={y:Oo(a[2],n),M:Oo(a[3],n),w:Oo(a[4],n),d:Oo(a[5],n),h:Oo(a[6],n),m:Oo(a[7],n),s:Oo(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=Io(Yn(i.from),Yn(i.to)),(i={}).ms=r.milliseconds,i.M=r.months),o=new ao(i),so(e)&&s(e,"_locale")&&(o._locale=e._locale),so(e)&&s(e,"_isValid")&&(o._isValid=e._isValid),o}function Oo(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function No(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Io(e,t){var n;return e.isValid()&&t.isValid()?(t=fo(t,e),e.isBefore(t)?n=No(e,t):((n=No(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Do(e,t){return function(n,o){var r;return null===o||isNaN(+o)||(E(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=o,o=r),Mo(this,Ao(n,o),e),this}}function Mo(e,t,n,r){var i=t._milliseconds,a=co(t._days),s=co(t._months);e.isValid()&&(r=null==r||r,s&&pt(e,Ze(e,"Month")+s*n),a&&Je(e,"Date",Ze(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&o.updateOffset(e,a||s))}Ao.fn=ao.prototype,Ao.invalid=io;var Ro=Do(1,"add"),Lo=Do(-1,"subtract");function Fo(e){return"string"==typeof e||e instanceof String}function Po(e){return w(e)||d(e)||Fo(e)||u(e)||Bo(e)||jo(e)||null==e}function jo(e){var t,n,o=a(e)&&!c(e),r=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],l=i.length;for(t=0;t<l;t+=1)n=i[t],r=r||s(e,n);return o&&r}function Bo(e){var t=i(e),n=!1;return t&&(n=0===e.filter((function(t){return!u(t)&&Fo(e)})).length),t&&n}function qo(e){var t,n,o=a(e)&&!c(e),r=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<i.length;t+=1)n=i[t],r=r||s(e,n);return o&&r}function Wo(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function zo(e,t){1===arguments.length&&(arguments[0]?Po(arguments[0])?(e=arguments[0],t=void 0):qo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Yn(),r=fo(n,this).startOf("day"),i=o.calendarFormat(this,r)||"sameElse",a=t&&(A(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,Yn(n)))}function Uo(){return new x(this)}function Ho(e,t){var n=w(e)?e:Yn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function Vo(e,t){var n=w(e)?e:Yn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function Go(e,t,n,o){var r=w(e)?e:Yn(e),i=w(t)?t:Yn(t);return!!(this.isValid()&&r.isValid()&&i.isValid())&&("("===(o=o||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===o[1]?this.isBefore(i,n):!this.isAfter(i,n))}function Ko(e,t){var n,o=w(e)?e:Yn(e);return!(!this.isValid()||!o.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function Yo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Zo(e,t,n){var o,r,i;if(!this.isValid())return NaN;if(!(o=fo(e,this)).isValid())return NaN;switch(r=6e4*(o.utcOffset()-this.utcOffset()),t=ne(t)){case"year":i=Jo(this,o)/12;break;case"month":i=Jo(this,o);break;case"quarter":i=Jo(this,o)/3;break;case"second":i=(this-o)/1e3;break;case"minute":i=(this-o)/6e4;break;case"hour":i=(this-o)/36e5;break;case"day":i=(this-o-r)/864e5;break;case"week":i=(this-o-r)/6048e5;break;default:i=this-o}return n?i:Oe(i)}function Jo(e,t){if(e.date()<t.date())return-Jo(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(n,"months");return-(n+(t-o<0?(t-o)/(o-e.clone().add(n-1,"months")):(t-o)/(e.clone().add(n+1,"months")-o)))||0}function Xo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function er(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?z(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(n,"Z")):z(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function tr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,o,r="moment",i="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",o=i+'[")]',this.format(e+t+n+o)}function nr(e){e||(e=this.isUtc()?o.defaultFormatUtc:o.defaultFormat);var t=z(this,e);return this.localeData().postformat(t)}function or(e,t){return this.isValid()&&(w(e)&&e.isValid()||Yn(e).isValid())?Ao({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rr(e){return this.from(Yn(),e)}function ir(e,t){return this.isValid()&&(w(e)&&e.isValid()||Yn(e).isValid())?Ao({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ar(e){return this.to(Yn(),e)}function sr(e){var t;return void 0===e?this._locale._abbr:(null!=(t=$n(e))&&(this._locale=t),this)}o.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",o.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var cr=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function lr(){return this._locale}var ur=1e3,dr=60*ur,pr=60*dr,mr=3506328*pr;function fr(e,t){return(e%t+t)%t}function hr(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-mr:new Date(e,t,n).valueOf()}function gr(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-mr:Date.UTC(e,t,n)}function _r(e){var t,n;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gr:hr,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fr(t+(this._isUTC?0:this.utcOffset()*dr),pr);break;case"minute":t=this._d.valueOf(),t-=fr(t,dr);break;case"second":t=this._d.valueOf(),t-=fr(t,ur)}return this._d.setTime(t),o.updateOffset(this,!0),this}function $r(e){var t,n;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gr:hr,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=pr-fr(t+(this._isUTC?0:this.utcOffset()*dr),pr)-1;break;case"minute":t=this._d.valueOf(),t+=dr-fr(t,dr)-1;break;case"second":t=this._d.valueOf(),t+=ur-fr(t,ur)-1}return this._d.setTime(t),o.updateOffset(this,!0),this}function br(){return this._d.valueOf()-6e4*(this._offset||0)}function yr(){return Math.floor(this.valueOf()/1e3)}function vr(){return new Date(this.valueOf())}function xr(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function wr(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Cr(){return this.isValid()?this.toISOString():null}function kr(){return _(this)}function Sr(){return m({},g(this))}function Tr(){return g(this).overflow}function Er(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ar(e,t){var n,r,i,a=this._eras||$n("en")._eras;for(n=0,r=a.length;n<r;++n)switch("string"==typeof a[n].since&&(i=o(a[n].since).startOf("day"),a[n].since=i.valueOf()),typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=o(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf()}return a}function Or(e,t,n){var o,r,i,a,s,c=this.eras();for(e=e.toUpperCase(),o=0,r=c.length;o<r;++o)if(i=c[o].name.toUpperCase(),a=c[o].abbr.toUpperCase(),s=c[o].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return c[o];break;case"NNNN":if(i===e)return c[o];break;case"NNNNN":if(s===e)return c[o]}else if([i,a,s].indexOf(e)>=0)return c[o]}function Nr(e,t){var n=e.since<=e.until?1:-1;return void 0===t?o(e.since).year():o(e.since).year()+(t-e.offset)*n}function Ir(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),o[e].since<=n&&n<=o[e].until)return o[e].name;if(o[e].until<=n&&n<=o[e].since)return o[e].name}return""}function Dr(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),o[e].since<=n&&n<=o[e].until)return o[e].narrow;if(o[e].until<=n&&n<=o[e].since)return o[e].narrow}return""}function Mr(){var e,t,n,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),o[e].since<=n&&n<=o[e].until)return o[e].abbr;if(o[e].until<=n&&n<=o[e].since)return o[e].abbr}return""}function Rr(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-o(i[e].since).year())*n+i[e].offset;return this.year()}function Lr(e){return s(this,"_erasNameRegex")||zr.call(this),e?this._erasNameRegex:this._erasRegex}function Fr(e){return s(this,"_erasAbbrRegex")||zr.call(this),e?this._erasAbbrRegex:this._erasRegex}function Pr(e){return s(this,"_erasNarrowRegex")||zr.call(this),e?this._erasNarrowRegex:this._erasRegex}function jr(e,t){return t.erasAbbrRegex(e)}function Br(e,t){return t.erasNameRegex(e)}function qr(e,t){return t.erasNarrowRegex(e)}function Wr(e,t){return t._eraYearOrdinalRegex||$e}function zr(){var e,t,n,o,r,i=[],a=[],s=[],c=[],l=this.eras();for(e=0,t=l.length;e<t;++e)n=Ae(l[e].name),o=Ae(l[e].abbr),r=Ae(l[e].narrow),a.push(n),i.push(o),s.push(r),c.push(n),c.push(o),c.push(r);this._erasRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}function Ur(e,t){B(0,[e,e.length],0,t)}function Hr(e){return Zr.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Vr(e){return Zr.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Gr(){return wt(this.year(),1,4)}function Kr(){return wt(this.isoWeekYear(),1,4)}function Yr(){var e=this.localeData()._week;return wt(this.year(),e.dow,e.doy)}function Qr(){var e=this.localeData()._week;return wt(this.weekYear(),e.dow,e.doy)}function Zr(e,t,n,o,r){var i;return null==e?xt(this,o,r).year:(t>(i=wt(e,o,r))&&(t=i),Jr.call(this,e,t,n,o,r))}function Jr(e,t,n,o,r){var i=vt(e,t,n,o,r),a=bt(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Xr(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),Se("N",jr),Se("NN",jr),Se("NNN",jr),Se("NNNN",Br),Se("NNNNN",qr),De(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,o){var r=n._locale.erasParse(e,o,n._strict);r?g(n).era=r:g(n).invalidEra=e})),Se("y",$e),Se("yy",$e),Se("yyy",$e),Se("yyyy",$e),Se("yo",Wr),De(["y","yy","yyy","yyyy"],Fe),De(["yo"],(function(e,t,n,o){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Fe]=n._locale.eraYearOrdinalParse(e,r):t[Fe]=parseInt(e,10)})),B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Ur("gggg","weekYear"),Ur("ggggg","weekYear"),Ur("GGGG","isoWeekYear"),Ur("GGGGG","isoWeekYear"),Se("G",be),Se("g",be),Se("GG",pe,ce),Se("gg",pe,ce),Se("GGGG",ge,ue),Se("gggg",ge,ue),Se("GGGGG",_e,de),Se("ggggg",_e,de),Me(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,o){t[o.substr(0,2)]=Ne(e)})),Me(["gg","GG"],(function(e,t,n,r){t[r]=o.parseTwoDigitYear(e)})),B("Q",0,"Qo","quarter"),Se("Q",se),De("Q",(function(e,t){t[Pe]=3*(Ne(e)-1)})),B("D",["DD",2],"Do","date"),Se("D",pe,Ce),Se("DD",pe,ce),Se("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),De(["D","DD"],je),De("Do",(function(e,t){t[je]=Ne(e.match(pe)[0])}));var ei=Qe("Date",!0);function ti(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),Se("DDD",he),Se("DDDD",le),De(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=Ne(e)})),B("m",["mm",2],0,"minute"),Se("m",pe,ke),Se("mm",pe,ce),De(["m","mm"],qe);var ni=Qe("Minutes",!1);B("s",["ss",2],0,"second"),Se("s",pe,ke),Se("ss",pe,ce),De(["s","ss"],We);var oi,ri,ii=Qe("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Se("S",he,se),Se("SS",he,ce),Se("SSS",he,le),oi="SSSS";oi.length<=9;oi+="S")Se(oi,$e);function ai(e,t){t[ze]=Ne(1e3*("0."+e))}for(oi="S";oi.length<=9;oi+="S")De(oi,ai);function si(){return this._isUTC?"UTC":""}function ci(){return this._isUTC?"Coordinated Universal Time":""}ri=Qe("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var li=x.prototype;function ui(e){return Yn(1e3*e)}function di(){return Yn.apply(null,arguments).parseZone()}function pi(e){return e}li.add=Ro,li.calendar=zo,li.clone=Uo,li.diff=Zo,li.endOf=$r,li.format=nr,li.from=or,li.fromNow=rr,li.to=ir,li.toNow=ar,li.get=Xe,li.invalidAt=Tr,li.isAfter=Ho,li.isBefore=Vo,li.isBetween=Go,li.isSame=Ko,li.isSameOrAfter=Yo,li.isSameOrBefore=Qo,li.isValid=kr,li.lang=cr,li.locale=sr,li.localeData=lr,li.max=Zn,li.min=Qn,li.parsingFlags=Sr,li.set=et,li.startOf=_r,li.subtract=Lo,li.toArray=xr,li.toObject=wr,li.toDate=vr,li.toISOString=er,li.inspect=tr,"undefined"!=typeof Symbol&&null!=Symbol.for&&(li[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),li.toJSON=Cr,li.toString=Xo,li.unix=yr,li.valueOf=br,li.creationData=Er,li.eraName=Ir,li.eraNarrow=Dr,li.eraAbbr=Mr,li.eraYear=Rr,li.year=Ke,li.isLeapYear=Ye,li.weekYear=Hr,li.isoWeekYear=Vr,li.quarter=li.quarters=Xr,li.month=mt,li.daysInMonth=ft,li.week=li.weeks=Et,li.isoWeek=li.isoWeeks=At,li.weeksInYear=Yr,li.weeksInWeekYear=Qr,li.isoWeeksInYear=Gr,li.isoWeeksInISOWeekYear=Kr,li.date=ei,li.day=li.days=Ut,li.weekday=Ht,li.isoWeekday=Vt,li.dayOfYear=ti,li.hour=li.hours=on,li.minute=li.minutes=ni,li.second=li.seconds=ii,li.millisecond=li.milliseconds=ri,li.utcOffset=go,li.utc=$o,li.local=bo,li.parseZone=yo,li.hasAlignedHourOffset=vo,li.isDST=xo,li.isLocal=Co,li.isUtcOffset=ko,li.isUtc=So,li.isUTC=So,li.zoneAbbr=si,li.zoneName=ci,li.dates=k("dates accessor is deprecated. Use date instead.",ei),li.months=k("months accessor is deprecated. Use month instead",mt),li.years=k("years accessor is deprecated. Use year instead",Ke),li.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_o),li.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",wo);var mi=I.prototype;function fi(e,t,n,o){var r=$n(),i=f().set(o,t);return r[n](i,e)}function hi(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return fi(e,t,n,"month");var o,r=[];for(o=0;o<12;o++)r[o]=fi(e,o,n,"month");return r}function gi(e,t,n,o){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var r,i=$n(),a=e?i._week.dow:0,s=[];if(null!=n)return fi(t,(n+a)%7,o,"day");for(r=0;r<7;r++)s[r]=fi(t,(r+a)%7,o,"day");return s}function _i(e,t){return hi(e,t,"months")}function $i(e,t){return hi(e,t,"monthsShort")}function bi(e,t,n){return gi(e,t,n,"weekdays")}function yi(e,t,n){return gi(e,t,n,"weekdaysShort")}function vi(e,t,n){return gi(e,t,n,"weekdaysMin")}mi.calendar=M,mi.longDateFormat=V,mi.invalidDate=K,mi.ordinal=Z,mi.preparse=pi,mi.postformat=pi,mi.relativeTime=X,mi.pastFuture=ee,mi.set=O,mi.eras=Ar,mi.erasParse=Or,mi.erasConvertYear=Nr,mi.erasAbbrRegex=Fr,mi.erasNameRegex=Lr,mi.erasNarrowRegex=Pr,mi.months=ct,mi.monthsShort=lt,mi.monthsParse=dt,mi.monthsRegex=gt,mi.monthsShortRegex=ht,mi.week=Ct,mi.firstDayOfYear=Tt,mi.firstDayOfWeek=St,mi.weekdays=jt,mi.weekdaysMin=qt,mi.weekdaysShort=Bt,mi.weekdaysParse=zt,mi.weekdaysRegex=Gt,mi.weekdaysShortRegex=Kt,mi.weekdaysMinRegex=Yt,mi.isPM=tn,mi.meridiem=rn,hn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Ne(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),o.lang=k("moment.lang is deprecated. Use moment.locale instead.",hn),o.langData=k("moment.langData is deprecated. Use moment.localeData instead.",$n);var xi=Math.abs;function wi(){var e=this._data;return this._milliseconds=xi(this._milliseconds),this._days=xi(this._days),this._months=xi(this._months),e.milliseconds=xi(e.milliseconds),e.seconds=xi(e.seconds),e.minutes=xi(e.minutes),e.hours=xi(e.hours),e.months=xi(e.months),e.years=xi(e.years),this}function Ci(e,t,n,o){var r=Ao(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function ki(e,t){return Ci(this,e,t,1)}function Si(e,t){return Ci(this,e,t,-1)}function Ti(e){return e<0?Math.floor(e):Math.ceil(e)}function Ei(){var e,t,n,o,r,i=this._milliseconds,a=this._days,s=this._months,c=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*Ti(Oi(s)+a),a=0,s=0),c.milliseconds=i%1e3,e=Oe(i/1e3),c.seconds=e%60,t=Oe(e/60),c.minutes=t%60,n=Oe(t/60),c.hours=n%24,a+=Oe(n/24),s+=r=Oe(Ai(a)),a-=Ti(Oi(r)),o=Oe(s/12),s%=12,c.days=a,c.months=s,c.years=o,this}function Ai(e){return 4800*e/146097}function Oi(e){return 146097*e/4800}function Ni(e){if(!this.isValid())return NaN;var t,n,o=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+o/864e5,n=this._months+Ai(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Oi(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Ii(e){return function(){return this.as(e)}}var Di=Ii("ms"),Mi=Ii("s"),Ri=Ii("m"),Li=Ii("h"),Fi=Ii("d"),Pi=Ii("w"),ji=Ii("M"),Bi=Ii("Q"),qi=Ii("y"),Wi=Di;function zi(){return Ao(this)}function Ui(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function Hi(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vi=Hi("milliseconds"),Gi=Hi("seconds"),Ki=Hi("minutes"),Yi=Hi("hours"),Qi=Hi("days"),Zi=Hi("months"),Ji=Hi("years");function Xi(){return Oe(this.days()/7)}var ea=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function oa(e,t,n,o){var r=Ao(e).abs(),i=ea(r.as("s")),a=ea(r.as("m")),s=ea(r.as("h")),c=ea(r.as("d")),l=ea(r.as("M")),u=ea(r.as("w")),d=ea(r.as("y")),p=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||a<=1&&["m"]||a<n.m&&["mm",a]||s<=1&&["h"]||s<n.h&&["hh",s]||c<=1&&["d"]||c<n.d&&["dd",c];return null!=n.w&&(p=p||u<=1&&["w"]||u<n.w&&["ww",u]),(p=p||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,p[3]=+e>0,p[4]=o,na.apply(null,p)}function ra(e){return void 0===e?ea:"function"==typeof e&&(ea=e,!0)}function ia(e,t){return void 0!==ta[e]&&(void 0===t?ta[e]:(ta[e]=t,"s"===e&&(ta.ss=t-1),!0))}function aa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,o,r=!1,i=ta;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(i=Object.assign({},ta,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),o=oa(this,!r,i,n=this.localeData()),r&&(o=n.pastFuture(+this,o)),n.postformat(o)}var sa=Math.abs;function ca(e){return(e>0)-(e<0)||+e}function la(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,o,r,i,a,s,c=sa(this._milliseconds)/1e3,l=sa(this._days),u=sa(this._months),d=this.asSeconds();return d?(e=Oe(c/60),t=Oe(e/60),c%=60,e%=60,n=Oe(u/12),u%=12,o=c?c.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",i=ca(this._months)!==ca(d)?"-":"",a=ca(this._days)!==ca(d)?"-":"",s=ca(this._milliseconds)!==ca(d)?"-":"",r+"P"+(n?i+n+"Y":"")+(u?i+u+"M":"")+(l?a+l+"D":"")+(t||e||c?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(c?s+o+"S":"")):"P0D"}var ua=ao.prototype;return ua.isValid=ro,ua.abs=wi,ua.add=ki,ua.subtract=Si,ua.as=Ni,ua.asMilliseconds=Di,ua.asSeconds=Mi,ua.asMinutes=Ri,ua.asHours=Li,ua.asDays=Fi,ua.asWeeks=Pi,ua.asMonths=ji,ua.asQuarters=Bi,ua.asYears=qi,ua.valueOf=Wi,ua._bubble=Ei,ua.clone=zi,ua.get=Ui,ua.milliseconds=Vi,ua.seconds=Gi,ua.minutes=Ki,ua.hours=Yi,ua.days=Qi,ua.weeks=Xi,ua.months=Zi,ua.years=Ji,ua.humanize=aa,ua.toISOString=la,ua.toString=la,ua.toJSON=la,ua.locale=sr,ua.localeData=lr,ua.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",la),ua.lang=cr,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Se("x",be),Se("X",xe),De("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),De("x",(function(e,t,n){n._d=new Date(Ne(e))})),
|
|
17
17
|
//! moment.js
|
|
18
18
|
o.version="2.30.1",r(Yn),o.fn=li,o.min=Xn,o.max=eo,o.now=to,o.utc=f,o.unix=ui,o.months=_i,o.isDate=d,o.locale=hn,o.invalid=$,o.duration=Ao,o.isMoment=w,o.weekdays=bi,o.parseZone=di,o.localeData=$n,o.isDuration=so,o.monthsShort=$i,o.weekdaysMin=vi,o.defineLocale=gn,o.updateLocale=_n,o.locales=bn,o.weekdaysShort=yi,o.normalizeUnits=ne,o.relativeTimeRounding=ra,o.relativeTimeThreshold=ia,o.calendarFormat=Wo,o.prototype=li,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o}()}(moment$1);var moment=moment$1.exports,common$2={};!function(e){var t=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.interpretEscapes=e.word=e.token=e.whitespace=void 0;const n=t(parsimmon_umd_min.exports);function o(t){return t.skip(e.whitespace)}e.whitespace=n.default.regexp(/\s*/m),e.token=o,e.word=function(e){return n.default.string(e).thru(o)},e.interpretEscapes=function(e){let t={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};return e.replace(/\\(u[0-9a-fA-F]{4}|[^u])/,((e,n)=>{let o=n.charAt(0),r=n.slice(1);return"u"===o?String.fromCharCode(parseInt(r,16)):t.hasOwnProperty(o)?t[o]:o}))}}(common$2);var __importDefault$j=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(parseFilter$1,"__esModule",{value:!0}),parseFilter$1.parseFilter=void 0;const parsimmon_1=__importDefault$j(parsimmon_umd_min.exports),moment_1$1=__importDefault$j(moment$1.exports),common_1=common$2,dbgate_tools_1$b=lib$5,binaryCondition=(e,t=!1)=>n=>{const o=(0,dbgate_tools_1$b.parseNumberSafe)(n);return t&&!isNaN(o)?{conditionType:"or",conditions:[{conditionType:"binary",operator:e,left:{exprType:"placeholder"},right:{exprType:"value",value:n}},{conditionType:"binary",operator:e,left:{exprType:"placeholder"},right:{exprType:"value",value:o}}]}:{conditionType:"binary",operator:e,left:{exprType:"placeholder"},right:{exprType:"value",value:n}}},simpleEqualCondition=()=>e=>({conditionType:"binary",operator:"=",left:{exprType:"placeholder"},right:{exprType:"value",value:e}}),likeCondition=(e,t)=>n=>({conditionType:e,left:{exprType:"placeholder"},right:{exprType:"value",value:t.replace("#VALUE#",n)}}),compoudCondition=e=>t=>1==t.length?t[0]:{conditionType:e,conditions:t},unaryCondition=e=>()=>({conditionType:e,expr:{exprType:"placeholder"}}),binaryFixedValueCondition=e=>()=>({conditionType:"binary",operator:"=",left:{exprType:"placeholder"},right:{exprType:"value",value:e}}),negateCondition=e=>({conditionType:"not",condition:e}),numberTestCondition=()=>e=>({conditionType:"or",conditions:[{conditionType:"like",left:{exprType:"placeholder"},right:{exprType:"value",value:`.*${e}.*`}},{conditionType:"binary",operator:"=",left:{exprType:"placeholder"},right:{exprType:"value",value:e}}]}),idRegex=/[('"]([0-9a-f]{24})['")]/,objectIdTestCondition=()=>e=>({conditionType:"binary",operator:"=",left:{exprType:"placeholder"},right:{exprType:"value",value:{$oid:e.match(idRegex)[1]}}}),specificPredicateCondition=e=>()=>({conditionType:"specificPredicate",predicate:e,expr:{exprType:"placeholder"}}),sqlTemplate=e=>({conditionType:"rawTemplate",templateSql:e,expr:{exprType:"placeholder"}});function getTransformCondition(e,t){return{conditionType:"binary",operator:"=",left:{exprType:"transform",transform:e,expr:{exprType:"placeholder"}},right:{exprType:"value",value:t}}}const yearCondition=()=>e=>getTransformCondition("YEAR",e),yearMonthCondition=()=>e=>{const t=e.match(/(\d\d\d\d)-(\d\d?)/);return{conditionType:"and",conditions:[getTransformCondition("YEAR",t[1]),getTransformCondition("MONTH",t[2])]}},yearMonthDayCondition=()=>e=>{const t=e.match(/(\d\d\d\d)-(\d\d?)-(\d\d?)/);return{conditionType:"and",conditions:[getTransformCondition("YEAR",t[1]),getTransformCondition("MONTH",t[2]),getTransformCondition("DAY",t[3])]}},yearEdge=e=>t=>(0,moment_1$1.default)(new Date(parseInt(t),0,1))[e]("year").format("YYYY-MM-DDTHH:mm:ss.SSS"),yearMonthEdge=e=>t=>{const n=t.match(/(\d\d\d\d)-(\d\d?)/);return(0,moment_1$1.default)(new Date(parseInt(n[1]),parseInt(n[2])-1,1))[e]("month").format("YYYY-MM-DDTHH:mm:ss.SSS")},yearMonthDayEdge=e=>t=>{const n=t.match(/(\d\d\d\d)-(\d\d?)-(\d\d?)/);return(0,moment_1$1.default)(new Date(parseInt(n[1]),parseInt(n[2])-1,parseInt(n[3])))[e]("day").format("YYYY-MM-DDTHH:mm:ss.SSS")},yearMonthDayMinuteEdge=e=>t=>{const n=t.match(/(\d\d\d\d)-(\d\d?)-(\d\d?)\s+(\d\d?):(\d\d?)/),o=n[1],r=n[2],i=n[3],a=n[4],s=n[5],c=new Date(o,r-1,i,a,s);return(0,moment_1$1.default)(c)[e]("minute").format("YYYY-MM-DDTHH:mm:ss.SSS")},yearMonthDayMinuteSecondEdge=e=>t=>{const n=t.match(/(\d\d\d\d)-(\d\d?)-(\d\d?)(T|\s+)(\d\d?):(\d\d?):(\d\d?)/),o=n[1],r=n[2],i=n[3],a=n[5],s=n[6],c=n[7],l=new Date(o,r-1,i,a,s,c);return(0,moment_1$1.default)(l)[e]("second").format("YYYY-MM-DDTHH:mm:ss.SSS")},createIntervalCondition=(e,t)=>({conditionType:"and",conditions:[{conditionType:"binary",operator:">=",left:{exprType:"placeholder"},right:{exprType:"value",value:e}},{conditionType:"binary",operator:"<=",left:{exprType:"placeholder"},right:{exprType:"value",value:t}}]}),createDateIntervalCondition=(e,t)=>createIntervalCondition(e.format("YYYY-MM-DDTHH:mm:ss.SSS"),t.format("YYYY-MM-DDTHH:mm:ss.SSS")),fixedMomentIntervalCondition=(e,t)=>()=>createDateIntervalCondition((0,moment_1$1.default)().add(e,t).startOf(e),(0,moment_1$1.default)().add(e,t).endOf(e)),yearMonthDayMinuteCondition=()=>e=>{const t=e.match(/(\d\d\d\d)-(\d\d?)-(\d\d?)\s+(\d\d?):(\d\d?)/),n=t[1],o=t[2],r=t[3],i=t[4],a=t[5],s=new Date(n,o-1,r,i,a);return createDateIntervalCondition((0,moment_1$1.default)(s).startOf("minute"),(0,moment_1$1.default)(s).endOf("minute"))},yearMonthDaySecondCondition=()=>e=>{const t=e.match(/(\d\d\d\d)-(\d\d?)-(\d\d?)(T|\s+)(\d\d?):(\d\d?):(\d\d?)/),n=t[1],o=t[2],r=t[3],i=t[5],a=t[6],s=t[7],c=new Date(n,o-1,r,i,a,s);return createDateIntervalCondition((0,moment_1$1.default)(c).startOf("second"),(0,moment_1$1.default)(c).endOf("second"))},createParser=e=>{const t={string1:()=>(0,common_1.token)(parsimmon_1.default.regexp(/"((?:\\.|.)*?)"/,1)).map(common_1.interpretEscapes).desc("string quoted"),string2:()=>(0,common_1.token)(parsimmon_1.default.regexp(/'((?:\\.|.)*?)'/,1)).map(common_1.interpretEscapes).desc("string quoted"),string1Num:()=>(0,common_1.token)(parsimmon_1.default.regexp(/"-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?"/,1)).map(dbgate_tools_1$b.parseNumberSafe).desc("numer quoted"),string2Num:()=>(0,common_1.token)(parsimmon_1.default.regexp(/'-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?'/,1)).map(dbgate_tools_1$b.parseNumberSafe).desc("numer quoted"),number:()=>(0,common_1.token)(parsimmon_1.default.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/)).map(dbgate_tools_1$b.parseNumberSafe).desc("number"),objectid:()=>(0,common_1.token)(parsimmon_1.default.regexp(/ObjectId\(['"]?[0-9a-f]{24}['"]?\)/)).desc("ObjectId"),objectidstr:()=>(0,common_1.token)(parsimmon_1.default.regexp(/[0-9a-f]{24}/)).desc("ObjectId string"),hexstring:()=>(0,common_1.token)(parsimmon_1.default.regexp(/0x(([0-9a-fA-F][0-9a-fA-F])+)/,1)).map((e=>({type:"Buffer",data:(0,dbgate_tools_1$b.hexStringToArray)(e)}))).desc("hex string"),noQuotedString:()=>parsimmon_1.default.regexp(/[^\s^,^'^"]+/).desc("string unquoted"),sql:()=>(0,common_1.token)(parsimmon_1.default.regexp(/\{(.*?)\}/,1)).map(sqlTemplate).desc("sql literal"),value:e=>parsimmon_1.default.alt(...n.map((t=>e[t]))),valueTestEq:e=>e.value.map(binaryCondition("=")),hexTestEq:e=>e.hexstring.map(binaryCondition("=")),valueTestObjectIdStr:e=>e.objectidstr.map(simpleEqualCondition()),valueTestStr:e=>e.value.map(likeCondition("like","%#VALUE#%")),valueTestNum:e=>e.number.map(numberTestCondition()),valueTestObjectId:e=>e.objectid.map(objectIdTestCondition()),notExists:e=>e.not.then(e.exists).map(specificPredicateCondition("notExists")),notEmptyArray:e=>e.not.then(e.empty).then(e.array).map(specificPredicateCondition("notEmptyArray")),emptyArray:e=>e.empty.then(e.array).map(specificPredicateCondition("emptyArray")),exists:()=>(0,common_1.word)("EXISTS").map(specificPredicateCondition("exists")),this:()=>(0,common_1.word)("THIS"),last:()=>(0,common_1.word)("LAST"),next:()=>(0,common_1.word)("NEXT"),week:()=>(0,common_1.word)("WEEK"),month:()=>(0,common_1.word)("MONTH"),year:()=>(0,common_1.word)("YEAR"),yesterday:()=>(0,common_1.word)("YESTERDAY").map(fixedMomentIntervalCondition("day",-1)),today:()=>(0,common_1.word)("TODAY").map(fixedMomentIntervalCondition("day",0)),tomorrow:()=>(0,common_1.word)("TOMORROW").map(fixedMomentIntervalCondition("day",1)),lastWeek:e=>e.last.then(e.week).map(fixedMomentIntervalCondition("week",-1)),thisWeek:e=>e.this.then(e.week).map(fixedMomentIntervalCondition("week",0)),nextWeek:e=>e.next.then(e.week).map(fixedMomentIntervalCondition("week",1)),lastMonth:e=>e.last.then(e.month).map(fixedMomentIntervalCondition("month",-1)),thisMonth:e=>e.this.then(e.month).map(fixedMomentIntervalCondition("month",0)),nextMonth:e=>e.next.then(e.month).map(fixedMomentIntervalCondition("month",1)),lastYear:e=>e.last.then(e.year).map(fixedMomentIntervalCondition("year",-1)),thisYear:e=>e.this.then(e.year).map(fixedMomentIntervalCondition("year",0)),nextYear:e=>e.next.then(e.year).map(fixedMomentIntervalCondition("year",1)),dateValueStart:e=>parsimmon_1.default.alt(e.yearMonthDayMinuteSecondStart,e.yearMonthDayMinuteStart,e.yearMonthDayStart,e.yearMonthStart,e.yearNumStart),dateValueEnd:e=>parsimmon_1.default.alt(e.yearMonthDayMinuteSecondEnd,e.yearMonthDayMinuteEnd,e.yearMonthDayEnd,e.yearMonthEnd,e.yearNumEnd),dateLe:e=>(0,common_1.word)("<=").then(e.dateValueEnd).map(binaryCondition("<=")),dateGe:e=>(0,common_1.word)(">=").then(e.dateValueStart).map(binaryCondition(">=")),dateLt:e=>(0,common_1.word)("<").then(e.dateValueStart).map(binaryCondition("<")),dateGt:e=>(0,common_1.word)(">").then(e.dateValueEnd).map(binaryCondition(">")),yearNum:()=>parsimmon_1.default.regexp(/\d\d\d\d/).map(yearCondition()),yearMonthNum:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?/).map(yearMonthCondition()),yearMonthDayNum:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?/).map(yearMonthDayCondition()),yearMonthDayMinute:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?\s+\d\d?:\d\d?/).map(yearMonthDayMinuteCondition()),yearMonthDaySecond:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?(\s+|T)\d\d?:\d\d?:\d\d?/).map(yearMonthDaySecondCondition()),yearNumStart:()=>parsimmon_1.default.regexp(/\d\d\d\d/).map(yearEdge("startOf")),yearNumEnd:()=>parsimmon_1.default.regexp(/\d\d\d\d/).map(yearEdge("endOf")),yearMonthStart:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?/).map(yearMonthEdge("startOf")),yearMonthEnd:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?/).map(yearMonthEdge("endOf")),yearMonthDayStart:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?/).map(yearMonthDayEdge("startOf")),yearMonthDayEnd:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?/).map(yearMonthDayEdge("endOf")),yearMonthDayMinuteStart:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?\s+\d\d?:\d\d?/).map(yearMonthDayMinuteEdge("startOf")),yearMonthDayMinuteEnd:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?\s+\d\d?:\d\d?/).map(yearMonthDayMinuteEdge("endOf")),yearMonthDayMinuteSecondStart:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?(\s+|T)\d\d?:\d\d?:\d\d?/).map(yearMonthDayMinuteSecondEdge("startOf")),yearMonthDayMinuteSecondEnd:()=>parsimmon_1.default.regexp(/\d\d\d\d-\d\d?-\d\d?(\s+|T)\d\d?:\d\d?:\d\d?/).map(yearMonthDayMinuteSecondEdge("endOf")),comma:()=>(0,common_1.word)(","),not:()=>(0,common_1.word)("NOT"),empty:()=>(0,common_1.word)("EMPTY"),array:()=>(0,common_1.word)("ARRAY"),notNull:e=>e.not.then(e.null).map(unaryCondition("isNotNull")),null:()=>(0,common_1.word)("NULL").map(unaryCondition("isNull")),isEmpty:e=>e.empty.map(unaryCondition("isEmpty")),isNotEmpty:e=>e.not.then(e.empty).map(unaryCondition("isNotEmpty")),true:()=>parsimmon_1.default.regexp(/true/i).map(binaryFixedValueCondition("1")),false:()=>parsimmon_1.default.regexp(/false/i).map(binaryFixedValueCondition("0")),trueNum:()=>(0,common_1.word)("1").map(binaryFixedValueCondition("1")),falseNum:()=>(0,common_1.word)("0").map(binaryFixedValueCondition("0")),eq:t=>(0,common_1.word)("=").then(t.value).map(binaryCondition("=",e.allowNumberDualTesting)),ne:t=>(0,common_1.word)("!=").then(t.value).map(binaryCondition("<>",e.allowNumberDualTesting)),ne2:t=>(0,common_1.word)("<>").then(t.value).map(binaryCondition("<>",e.allowNumberDualTesting)),le:t=>(0,common_1.word)("<=").then(t.value).map(binaryCondition("<=",e.allowNumberDualTesting)),ge:t=>(0,common_1.word)(">=").then(t.value).map(binaryCondition(">=",e.allowNumberDualTesting)),lt:t=>(0,common_1.word)("<").then(t.value).map(binaryCondition("<",e.allowNumberDualTesting)),gt:t=>(0,common_1.word)(">").then(t.value).map(binaryCondition(">",e.allowNumberDualTesting)),startsWith:e=>(0,common_1.word)("^").then(e.value).map(likeCondition("like","#VALUE#%")),endsWith:e=>(0,common_1.word)("$").then(e.value).map(likeCondition("like","%#VALUE#")),contains:e=>(0,common_1.word)("+").then(e.value).map(likeCondition("like","%#VALUE#%")),startsWithNot:e=>(0,common_1.word)("!^").then(e.value).map(likeCondition("like","#VALUE#%")).map(negateCondition),endsWithNot:e=>(0,common_1.word)("!$").then(e.value).map(likeCondition("like","%#VALUE#")).map(negateCondition),containsNot:e=>(0,common_1.word)("~").then(e.value).map(likeCondition("like","%#VALUE#%")).map(negateCondition),element:e=>parsimmon_1.default.alt(...o.map((t=>e[t]))).trim(common_1.whitespace),factor:e=>e.element.sepBy(common_1.whitespace).map(compoudCondition("and")),list:e=>e.factor.sepBy(e.comma).map(compoudCondition("or"))},n=[];e.allowStringToken&&n.push("string1","string2","noQuotedString"),e.allowNumberToken&&n.push("string1Num","string2Num","number");const o=[];return e.supportDatetimeComparison&&o.push("yearMonthDaySecond","yearMonthDayMinute","yearMonthDayNum","yearMonthNum","yearNum"),e.supportDatetimeSymbols&&o.push("today","yesterday","tomorrow","lastWeek","thisWeek","nextWeek","lastMonth","thisMonth","nextMonth","lastYear","thisYear","nextYear"),e.supportDatetimeComparison&&o.push("dateLe","dateGe","dateLt","dateGt"),e.supportExistsTesting&&o.push("exists","notExists"),e.supportArrayTesting&&o.push("emptyArray","notEmptyArray"),e.supportNullTesting&&o.push("null","notNull"),e.supportEquals&&o.push("eq","ne","ne2"),e.supportSqlCondition&&o.push("sql"),(e.supportNumberLikeComparison||e.supportDatetimeComparison)&&o.push("le","ge","lt","gt"),e.supportEmpty&&o.push("isEmpty","isNotEmpty"),e.allowHexString&&o.push("hexTestEq"),e.supportStringInclusion&&o.push("startsWith","endsWith","contains","startsWithNot","endsWithNot","containsNot"),e.supportBooleanValues&&(e.allowNumberToken||e.allowStringToken?o.push("true","false"):o.push("true","false","trueNum","falseNum")),e.allowObjectIdTesting&&(o.push("valueTestObjectIdStr"),o.push("valueTestObjectId")),e.allowNumberDualTesting&&o.push("valueTestNum"),e.allowStringToken?o.push("valueTestStr"):o.push("valueTestEq"),parsimmon_1.default.createLanguage(t)},cachedFilters={};function getParser(e){const t=JSON.stringify(e);return cachedFilters[t]||(cachedFilters[t]=createParser(e)),cachedFilters[t]}function parseFilter(e,t){return getParser(t).list.tryParse(e)}parseFilter$1.parseFilter=parseFilter;var filterTool={},dateFns={},add$1={},addDays$1={},constructFrom$2={},constants$1={};constants$1.secondsInYear=constants$1.secondsInWeek=constants$1.secondsInQuarter=constants$1.secondsInMonth=constants$1.secondsInMinute=constants$1.secondsInHour=constants$1.secondsInDay=constants$1.quartersInYear=constants$1.monthsInYear=constants$1.monthsInQuarter=constants$1.minutesInYear=constants$1.minutesInMonth=constants$1.minutesInHour=constants$1.minutesInDay=constants$1.minTime=constants$1.millisecondsInWeek=constants$1.millisecondsInSecond=constants$1.millisecondsInMinute=constants$1.millisecondsInHour=constants$1.millisecondsInDay=constants$1.maxTime=constants$1.daysInYear=constants$1.daysInWeek=constants$1.constructFromSymbol=void 0,constants$1.daysInWeek=7;const daysInYear=constants$1.daysInYear=365.2425,maxTime=constants$1.maxTime=24*Math.pow(10,8)*60*60*1e3;constants$1.minTime=-maxTime,constants$1.millisecondsInWeek=6048e5,constants$1.millisecondsInDay=864e5,constants$1.millisecondsInMinute=6e4,constants$1.millisecondsInHour=36e5,constants$1.millisecondsInSecond=1e3,constants$1.minutesInYear=525600,constants$1.minutesInMonth=43200,constants$1.minutesInDay=1440,constants$1.minutesInHour=60,constants$1.monthsInQuarter=3,constants$1.monthsInYear=12,constants$1.quartersInYear=4;const secondsInHour=constants$1.secondsInHour=3600;constants$1.secondsInMinute=60;const secondsInDay=constants$1.secondsInDay=24*secondsInHour;constants$1.secondsInWeek=7*secondsInDay;const secondsInYear=constants$1.secondsInYear=secondsInDay*daysInYear,secondsInMonth=constants$1.secondsInMonth=secondsInYear/12;constants$1.secondsInQuarter=3*secondsInMonth,constants$1.constructFromSymbol=Symbol.for("constructDateFrom"),constructFrom$2.constructFrom=constructFrom$1;var _index$45=constants$1;function constructFrom$1(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&_index$45.constructFromSymbol in e?e[_index$45.constructFromSymbol](t):e instanceof Date?new e.constructor(t):new Date(t)}var toDate$2={};toDate$2.toDate=toDate$1;var _index$44=constructFrom$2;function toDate$1(e,t){return(0,_index$44.constructFrom)(t||e,e)}addDays$1.addDays=addDays;var _index$43=constructFrom$2,_index2$1N=toDate$2;function addDays(e,t,n){const o=(0,_index2$1N.toDate)(e,n?.in);return isNaN(t)?(0,_index$43.constructFrom)(n?.in||e,NaN):t?(o.setDate(o.getDate()+t),o):o}var addMonths$1={};addMonths$1.addMonths=addMonths;var _index$42=constructFrom$2,_index2$1M=toDate$2;function addMonths(e,t,n){const o=(0,_index2$1M.toDate)(e,n?.in);if(isNaN(t))return(0,_index$42.constructFrom)(n?.in||e,NaN);if(!t)return o;const r=o.getDate(),i=(0,_index$42.constructFrom)(n?.in||e,o.getTime());i.setMonth(o.getMonth()+t+1,0);return r>=i.getDate()?i:(o.setFullYear(i.getFullYear(),i.getMonth(),r),o)}add$1.add=add;var _index$41=addDays$1,_index2$1L=addMonths$1,_index3$Z=constructFrom$2,_index4$q=toDate$2;function add(e,t,n){const{years:o=0,months:r=0,weeks:i=0,days:a=0,hours:s=0,minutes:c=0,seconds:l=0}=t,u=(0,_index4$q.toDate)(e,n?.in),d=r||o?(0,_index2$1L.addMonths)(u,r+12*o):u,p=a||i?(0,_index$41.addDays)(d,a+7*i):d,m=1e3*(l+60*(c+60*s));return(0,_index3$Z.constructFrom)(n?.in||e,+p+m)}var addBusinessDays$1={},isSaturday$1={};isSaturday$1.isSaturday=isSaturday;var _index$40=toDate$2;function isSaturday(e,t){return 6===(0,_index$40.toDate)(e,t?.in).getDay()}var isSunday$1={};isSunday$1.isSunday=isSunday;var _index$3$=toDate$2;function isSunday(e,t){return 0===(0,_index$3$.toDate)(e,t?.in).getDay()}var isWeekend$1={};isWeekend$1.isWeekend=isWeekend;var _index$3_=toDate$2;function isWeekend(e,t){const n=(0,_index$3_.toDate)(e,t?.in).getDay();return 0===n||6===n}addBusinessDays$1.addBusinessDays=addBusinessDays;var _index$3Z=constructFrom$2,_index2$1K=isSaturday$1,_index3$Y=isSunday$1,_index4$p=isWeekend$1,_index5$a=toDate$2;function addBusinessDays(e,t,n){const o=(0,_index5$a.toDate)(e,n?.in),r=(0,_index4$p.isWeekend)(o,n);if(isNaN(t))return(0,_index$3Z.constructFrom)(n?.in,NaN);const i=o.getHours(),a=t<0?-1:1,s=Math.trunc(t/5);o.setDate(o.getDate()+7*s);let c=Math.abs(t%5);for(;c>0;)o.setDate(o.getDate()+a),(0,_index4$p.isWeekend)(o,n)||(c-=1);return r&&(0,_index4$p.isWeekend)(o,n)&&0!==t&&((0,_index2$1K.isSaturday)(o,n)&&o.setDate(o.getDate()+(a<0?2:-1)),(0,_index3$Y.isSunday)(o,n)&&o.setDate(o.getDate()+(a<0?1:-2))),o.setHours(i),o}var addHours$1={},addMilliseconds$1={};addMilliseconds$1.addMilliseconds=addMilliseconds;var _index$3Y=constructFrom$2,_index2$1J=toDate$2;function addMilliseconds(e,t,n){return(0,_index$3Y.constructFrom)(n?.in||e,+(0,_index2$1J.toDate)(e)+t)}addHours$1.addHours=addHours;var _index$3X=addMilliseconds$1,_index2$1I=constants$1;function addHours(e,t,n){return(0,_index$3X.addMilliseconds)(e,t*_index2$1I.millisecondsInHour,n)}var addISOWeekYears$1={},getISOWeekYear$2={},startOfISOWeek$2={},startOfWeek$2={},defaultOptions$3={};defaultOptions$3.getDefaultOptions=getDefaultOptions$3,defaultOptions$3.setDefaultOptions=setDefaultOptions$2;let defaultOptions$2={};function getDefaultOptions$3(){return defaultOptions$2}function setDefaultOptions$2(e){defaultOptions$2=e}startOfWeek$2.startOfWeek=startOfWeek$1;var _index$3W=defaultOptions$3,_index2$1H=toDate$2;function startOfWeek$1(e,t){const n=(0,_index$3W.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=(0,_index2$1H.toDate)(e,t?.in),i=r.getDay(),a=(i<o?7:0)+i-o;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}startOfISOWeek$2.startOfISOWeek=startOfISOWeek$1;var _index$3V=startOfWeek$2;function startOfISOWeek$1(e,t){return(0,_index$3V.startOfWeek)(e,{...t,weekStartsOn:1})}getISOWeekYear$2.getISOWeekYear=getISOWeekYear$1;var _index$3U=constructFrom$2,_index2$1G=startOfISOWeek$2,_index3$X=toDate$2;function getISOWeekYear$1(e,t){const n=(0,_index3$X.toDate)(e,t?.in),o=n.getFullYear(),r=(0,_index$3U.constructFrom)(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const i=(0,_index2$1G.startOfISOWeek)(r),a=(0,_index$3U.constructFrom)(n,0);a.setFullYear(o,0,4),a.setHours(0,0,0,0);const s=(0,_index2$1G.startOfISOWeek)(a);return n.getTime()>=i.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}var setISOWeekYear$1={},differenceInCalendarDays$2={},getTimezoneOffsetInMilliseconds$2={};getTimezoneOffsetInMilliseconds$2.getTimezoneOffsetInMilliseconds=getTimezoneOffsetInMilliseconds$1;var _index$3T=toDate$2;function getTimezoneOffsetInMilliseconds$1(e){const t=(0,_index$3T.toDate)(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}var normalizeDates$2={};normalizeDates$2.normalizeDates=normalizeDates$1;var _index$3S=constructFrom$2;function normalizeDates$1(e,...t){const n=_index$3S.constructFrom.bind(null,e||t.find((e=>"object"==typeof e)));return t.map(n)}var startOfDay$2={};startOfDay$2.startOfDay=startOfDay$1;var _index$3R=toDate$2;function startOfDay$1(e,t){const n=(0,_index$3R.toDate)(e,t?.in);return n.setHours(0,0,0,0),n}differenceInCalendarDays$2.differenceInCalendarDays=differenceInCalendarDays$1;var _index$3Q=getTimezoneOffsetInMilliseconds$2,_index2$1F=normalizeDates$2,_index3$W=constants$1,_index4$o=startOfDay$2;function differenceInCalendarDays$1(e,t,n){const[o,r]=(0,_index2$1F.normalizeDates)(n?.in,e,t),i=(0,_index4$o.startOfDay)(o),a=(0,_index4$o.startOfDay)(r),s=+i-(0,_index$3Q.getTimezoneOffsetInMilliseconds)(i),c=+a-(0,_index$3Q.getTimezoneOffsetInMilliseconds)(a);return Math.round((s-c)/_index3$W.millisecondsInDay)}var startOfISOWeekYear$2={};startOfISOWeekYear$2.startOfISOWeekYear=startOfISOWeekYear$1;var _index$3P=constructFrom$2,_index2$1E=getISOWeekYear$2,_index3$V=startOfISOWeek$2;function startOfISOWeekYear$1(e,t){const n=(0,_index2$1E.getISOWeekYear)(e,t),o=(0,_index$3P.constructFrom)(t?.in||e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),(0,_index3$V.startOfISOWeek)(o)}setISOWeekYear$1.setISOWeekYear=setISOWeekYear;var _index$3O=constructFrom$2,_index2$1D=differenceInCalendarDays$2,_index3$U=startOfISOWeekYear$2,_index4$n=toDate$2;function setISOWeekYear(e,t,n){let o=(0,_index4$n.toDate)(e,n?.in);const r=(0,_index2$1D.differenceInCalendarDays)(o,(0,_index3$U.startOfISOWeekYear)(o,n)),i=(0,_index$3O.constructFrom)(n?.in||e,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),o=(0,_index3$U.startOfISOWeekYear)(i),o.setDate(o.getDate()+r),o}addISOWeekYears$1.addISOWeekYears=addISOWeekYears;var _index$3N=getISOWeekYear$2,_index2$1C=setISOWeekYear$1;function addISOWeekYears(e,t,n){return(0,_index2$1C.setISOWeekYear)(e,(0,_index$3N.getISOWeekYear)(e,n)+t,n)}var addMinutes$1={};addMinutes$1.addMinutes=addMinutes;var _index$3M=constants$1,_index2$1B=toDate$2;function addMinutes(e,t,n){const o=(0,_index2$1B.toDate)(e,n?.in);return o.setTime(o.getTime()+t*_index$3M.millisecondsInMinute),o}var addQuarters$1={};addQuarters$1.addQuarters=addQuarters;var _index$3L=addMonths$1;function addQuarters(e,t,n){return(0,_index$3L.addMonths)(e,3*t,n)}var addSeconds$1={};addSeconds$1.addSeconds=addSeconds;var _index$3K=addMilliseconds$1;function addSeconds(e,t,n){return(0,_index$3K.addMilliseconds)(e,1e3*t,n)}var addWeeks$1={};addWeeks$1.addWeeks=addWeeks;var _index$3J=addDays$1;function addWeeks(e,t,n){return(0,_index$3J.addDays)(e,7*t,n)}var addYears$1={};addYears$1.addYears=addYears;var _index$3I=addMonths$1;function addYears(e,t,n){return(0,_index$3I.addMonths)(e,12*t,n)}var areIntervalsOverlapping$1={};areIntervalsOverlapping$1.areIntervalsOverlapping=areIntervalsOverlapping;var _index$3H=toDate$2;function areIntervalsOverlapping(e,t,n){const[o,r]=[+(0,_index$3H.toDate)(e.start,n?.in),+(0,_index$3H.toDate)(e.end,n?.in)].sort(((e,t)=>e-t)),[i,a]=[+(0,_index$3H.toDate)(t.start,n?.in),+(0,_index$3H.toDate)(t.end,n?.in)].sort(((e,t)=>e-t));return n?.inclusive?o<=a&&i<=r:o<a&&i<r}var clamp$1={},max$2={};max$2.max=max$1;var _index$3G=constructFrom$2,_index2$1A=toDate$2;function max$1(e,t){let n,o=t?.in;return e.forEach((e=>{o||"object"!=typeof e||(o=_index$3G.constructFrom.bind(null,e));const t=(0,_index2$1A.toDate)(e,o);(!n||n<t||isNaN(+t))&&(n=t)})),(0,_index$3G.constructFrom)(o,n||NaN)}var min$1={};min$1.min=min;var _index$3F=constructFrom$2,_index2$1z=toDate$2;function min(e,t){let n,o=t?.in;return e.forEach((e=>{o||"object"!=typeof e||(o=_index$3F.constructFrom.bind(null,e));const t=(0,_index2$1z.toDate)(e,o);(!n||n>t||isNaN(+t))&&(n=t)})),(0,_index$3F.constructFrom)(o,n||NaN)}clamp$1.clamp=clamp;var _index$3E=normalizeDates$2,_index2$1y=max$2,_index3$T=min$1;function clamp(e,t,n){const[o,r,i]=(0,_index$3E.normalizeDates)(n?.in,e,t.start,t.end);return(0,_index3$T.min)([(0,_index2$1y.max)([o,r],n),i],n)}var closestIndexTo$1={};closestIndexTo$1.closestIndexTo=closestIndexTo;var _index$3D=toDate$2;function closestIndexTo(e,t){const n=+(0,_index$3D.toDate)(e);if(isNaN(n))return NaN;let o,r;return t.forEach(((e,t)=>{const i=(0,_index$3D.toDate)(e);if(isNaN(+i))return o=NaN,void(r=NaN);const a=Math.abs(n-+i);(null==o||a<r)&&(o=t,r=a)})),o}var closestTo$1={};closestTo$1.closestTo=closestTo;var _index$3C=normalizeDates$2,_index2$1x=closestIndexTo$1,_index3$S=constructFrom$2;function closestTo(e,t,n){const[o,...r]=(0,_index$3C.normalizeDates)(n?.in,e,...t),i=(0,_index2$1x.closestIndexTo)(o,r);return"number"==typeof i&&isNaN(i)?(0,_index3$S.constructFrom)(o,NaN):void 0!==i?r[i]:void 0}var compareAsc$1={};compareAsc$1.compareAsc=compareAsc;var _index$3B=toDate$2;function compareAsc(e,t){const n=+(0,_index$3B.toDate)(e)-+(0,_index$3B.toDate)(t);return n<0?-1:n>0?1:n}var compareDesc$1={};compareDesc$1.compareDesc=compareDesc;var _index$3A=toDate$2;function compareDesc(e,t){const n=+(0,_index$3A.toDate)(e)-+(0,_index$3A.toDate)(t);return n>0?-1:n<0?1:n}var constructNow$1={};constructNow$1.constructNow=constructNow;var _index$3z=constructFrom$2;function constructNow(e){return(0,_index$3z.constructFrom)(e,Date.now())}var daysToWeeks$1={};daysToWeeks$1.daysToWeeks=daysToWeeks;var _index$3y=constants$1;function daysToWeeks(e){const t=Math.trunc(e/_index$3y.daysInWeek);return 0===t?0:t}var differenceInBusinessDays$1={},isSameDay$1={};isSameDay$1.isSameDay=isSameDay;var _index$3x=normalizeDates$2,_index2$1w=startOfDay$2;function isSameDay(e,t,n){const[o,r]=(0,_index$3x.normalizeDates)(n?.in,e,t);return+(0,_index2$1w.startOfDay)(o)==+(0,_index2$1w.startOfDay)(r)}var isValid$2={},isDate$2={};function isDate$1(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}isDate$2.isDate=isDate$1,isValid$2.isValid=isValid$1;var _index$3w=isDate$2,_index2$1v=toDate$2;function isValid$1(e){return!(!(0,_index$3w.isDate)(e)&&"number"!=typeof e||isNaN(+(0,_index2$1v.toDate)(e)))}differenceInBusinessDays$1.differenceInBusinessDays=differenceInBusinessDays;var _index$3v=normalizeDates$2,_index2$1u=addDays$1,_index3$R=differenceInCalendarDays$2,_index4$m=isSameDay$1,_index5$9=isValid$2,_index6$5=isWeekend$1;function differenceInBusinessDays(e,t,n){const[o,r]=(0,_index$3v.normalizeDates)(n?.in,e,t);if(!(0,_index5$9.isValid)(o)||!(0,_index5$9.isValid)(r))return NaN;const i=(0,_index3$R.differenceInCalendarDays)(o,r),a=i<0?-1:1,s=Math.trunc(i/7);let c=5*s,l=(0,_index2$1u.addDays)(r,7*s);for(;!(0,_index4$m.isSameDay)(o,l);)c+=(0,_index6$5.isWeekend)(l,n)?0:a,l=(0,_index2$1u.addDays)(l,a);return 0===c?0:c}var differenceInCalendarISOWeekYears$1={};differenceInCalendarISOWeekYears$1.differenceInCalendarISOWeekYears=differenceInCalendarISOWeekYears;var _index$3u=normalizeDates$2,_index2$1t=getISOWeekYear$2;function differenceInCalendarISOWeekYears(e,t,n){const[o,r]=(0,_index$3u.normalizeDates)(n?.in,e,t);return(0,_index2$1t.getISOWeekYear)(o,n)-(0,_index2$1t.getISOWeekYear)(r,n)}var differenceInCalendarISOWeeks$1={};differenceInCalendarISOWeeks$1.differenceInCalendarISOWeeks=differenceInCalendarISOWeeks;var _index$3t=getTimezoneOffsetInMilliseconds$2,_index2$1s=normalizeDates$2,_index3$Q=constants$1,_index4$l=startOfISOWeek$2;function differenceInCalendarISOWeeks(e,t,n){const[o,r]=(0,_index2$1s.normalizeDates)(n?.in,e,t),i=(0,_index4$l.startOfISOWeek)(o),a=(0,_index4$l.startOfISOWeek)(r),s=+i-(0,_index$3t.getTimezoneOffsetInMilliseconds)(i),c=+a-(0,_index$3t.getTimezoneOffsetInMilliseconds)(a);return Math.round((s-c)/_index3$Q.millisecondsInWeek)}var differenceInCalendarMonths$1={};differenceInCalendarMonths$1.differenceInCalendarMonths=differenceInCalendarMonths;var _index$3s=normalizeDates$2;function differenceInCalendarMonths(e,t,n){const[o,r]=(0,_index$3s.normalizeDates)(n?.in,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}var differenceInCalendarQuarters$1={},getQuarter$1={};getQuarter$1.getQuarter=getQuarter;var _index$3r=toDate$2;function getQuarter(e,t){const n=(0,_index$3r.toDate)(e,t?.in);return Math.trunc(n.getMonth()/3)+1}differenceInCalendarQuarters$1.differenceInCalendarQuarters=differenceInCalendarQuarters;var _index$3q=normalizeDates$2,_index2$1r=getQuarter$1;function differenceInCalendarQuarters(e,t,n){const[o,r]=(0,_index$3q.normalizeDates)(n?.in,e,t);return 4*(o.getFullYear()-r.getFullYear())+((0,_index2$1r.getQuarter)(o)-(0,_index2$1r.getQuarter)(r))}var differenceInCalendarWeeks$1={};differenceInCalendarWeeks$1.differenceInCalendarWeeks=differenceInCalendarWeeks;var _index$3p=getTimezoneOffsetInMilliseconds$2,_index2$1q=normalizeDates$2,_index3$P=constants$1,_index4$k=startOfWeek$2;function differenceInCalendarWeeks(e,t,n){const[o,r]=(0,_index2$1q.normalizeDates)(n?.in,e,t),i=(0,_index4$k.startOfWeek)(o,n),a=(0,_index4$k.startOfWeek)(r,n),s=+i-(0,_index$3p.getTimezoneOffsetInMilliseconds)(i),c=+a-(0,_index$3p.getTimezoneOffsetInMilliseconds)(a);return Math.round((s-c)/_index3$P.millisecondsInWeek)}var differenceInCalendarYears$1={};differenceInCalendarYears$1.differenceInCalendarYears=differenceInCalendarYears;var _index$3o=normalizeDates$2;function differenceInCalendarYears(e,t,n){const[o,r]=(0,_index$3o.normalizeDates)(n?.in,e,t);return o.getFullYear()-r.getFullYear()}var differenceInDays$1={};differenceInDays$1.differenceInDays=differenceInDays;var _index$3n=normalizeDates$2,_index2$1p=differenceInCalendarDays$2;function differenceInDays(e,t,n){const[o,r]=(0,_index$3n.normalizeDates)(n?.in,e,t),i=compareLocalAsc(o,r),a=Math.abs((0,_index2$1p.differenceInCalendarDays)(o,r));o.setDate(o.getDate()-i*a);const s=i*(a-Number(compareLocalAsc(o,r)===-i));return 0===s?0:s}function compareLocalAsc(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var differenceInHours$1={},getRoundingMethod$1={};function getRoundingMethod(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return 0===n?0:n}}getRoundingMethod$1.getRoundingMethod=getRoundingMethod,differenceInHours$1.differenceInHours=differenceInHours;var _index$3m=getRoundingMethod$1,_index2$1o=normalizeDates$2,_index3$O=constants$1;function differenceInHours(e,t,n){const[o,r]=(0,_index2$1o.normalizeDates)(n?.in,e,t),i=(+o-+r)/_index3$O.millisecondsInHour;return(0,_index$3m.getRoundingMethod)(n?.roundingMethod)(i)}var differenceInISOWeekYears$1={},subISOWeekYears$1={};subISOWeekYears$1.subISOWeekYears=subISOWeekYears;var _index$3l=addISOWeekYears$1;function subISOWeekYears(e,t,n){return(0,_index$3l.addISOWeekYears)(e,-t,n)}differenceInISOWeekYears$1.differenceInISOWeekYears=differenceInISOWeekYears;var _index$3k=normalizeDates$2,_index2$1n=compareAsc$1,_index3$N=differenceInCalendarISOWeekYears$1,_index4$j=subISOWeekYears$1;function differenceInISOWeekYears(e,t,n){const[o,r]=(0,_index$3k.normalizeDates)(n?.in,e,t),i=(0,_index2$1n.compareAsc)(o,r),a=Math.abs((0,_index3$N.differenceInCalendarISOWeekYears)(o,r,n)),s=(0,_index4$j.subISOWeekYears)(o,i*a,n),c=i*(a-Number((0,_index2$1n.compareAsc)(s,r)===-i));return 0===c?0:c}var differenceInMilliseconds$1={};differenceInMilliseconds$1.differenceInMilliseconds=differenceInMilliseconds;var _index$3j=toDate$2;function differenceInMilliseconds(e,t){return+(0,_index$3j.toDate)(e)-+(0,_index$3j.toDate)(t)}var differenceInMinutes$1={};differenceInMinutes$1.differenceInMinutes=differenceInMinutes;var _index$3i=getRoundingMethod$1,_index2$1m=constants$1,_index3$M=differenceInMilliseconds$1;function differenceInMinutes(e,t,n){const o=(0,_index3$M.differenceInMilliseconds)(e,t)/_index2$1m.millisecondsInMinute;return(0,_index$3i.getRoundingMethod)(n?.roundingMethod)(o)}var differenceInMonths$1={},isLastDayOfMonth$1={},endOfDay$1={};endOfDay$1.endOfDay=endOfDay;var _index$3h=toDate$2;function endOfDay(e,t){const n=(0,_index$3h.toDate)(e,t?.in);return n.setHours(23,59,59,999),n}var endOfMonth$1={};endOfMonth$1.endOfMonth=endOfMonth;var _index$3g=toDate$2;function endOfMonth(e,t){const n=(0,_index$3g.toDate)(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}isLastDayOfMonth$1.isLastDayOfMonth=isLastDayOfMonth;var _index$3f=endOfDay$1,_index2$1l=endOfMonth$1,_index3$L=toDate$2;function isLastDayOfMonth(e,t){const n=(0,_index3$L.toDate)(e,t?.in);return+(0,_index$3f.endOfDay)(n,t)==+(0,_index2$1l.endOfMonth)(n,t)}differenceInMonths$1.differenceInMonths=differenceInMonths;var _index$3e=normalizeDates$2,_index2$1k=compareAsc$1,_index3$K=differenceInCalendarMonths$1,_index4$i=isLastDayOfMonth$1;function differenceInMonths(e,t,n){const[o,r,i]=(0,_index$3e.normalizeDates)(n?.in,e,e,t),a=(0,_index2$1k.compareAsc)(r,i),s=Math.abs((0,_index3$K.differenceInCalendarMonths)(r,i));if(s<1)return 0;1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*s);let c=(0,_index2$1k.compareAsc)(r,i)===-a;(0,_index4$i.isLastDayOfMonth)(o)&&1===s&&1===(0,_index2$1k.compareAsc)(o,i)&&(c=!1);const l=a*(s-+c);return 0===l?0:l}var differenceInQuarters$1={};differenceInQuarters$1.differenceInQuarters=differenceInQuarters;var _index$3d=getRoundingMethod$1,_index2$1j=differenceInMonths$1;function differenceInQuarters(e,t,n){const o=(0,_index2$1j.differenceInMonths)(e,t,n)/3;return(0,_index$3d.getRoundingMethod)(n?.roundingMethod)(o)}var differenceInSeconds$1={};differenceInSeconds$1.differenceInSeconds=differenceInSeconds;var _index$3c=getRoundingMethod$1,_index2$1i=differenceInMilliseconds$1;function differenceInSeconds(e,t,n){const o=(0,_index2$1i.differenceInMilliseconds)(e,t)/1e3;return(0,_index$3c.getRoundingMethod)(n?.roundingMethod)(o)}var differenceInWeeks$1={};differenceInWeeks$1.differenceInWeeks=differenceInWeeks;var _index$3b=getRoundingMethod$1,_index2$1h=differenceInDays$1;function differenceInWeeks(e,t,n){const o=(0,_index2$1h.differenceInDays)(e,t,n)/7;return(0,_index$3b.getRoundingMethod)(n?.roundingMethod)(o)}var differenceInYears$1={};differenceInYears$1.differenceInYears=differenceInYears;var _index$3a=normalizeDates$2,_index2$1g=compareAsc$1,_index3$J=differenceInCalendarYears$1;function differenceInYears(e,t,n){const[o,r]=(0,_index$3a.normalizeDates)(n?.in,e,t),i=(0,_index2$1g.compareAsc)(o,r),a=Math.abs((0,_index3$J.differenceInCalendarYears)(o,r));o.setFullYear(1584),r.setFullYear(1584);const s=i*(a-+((0,_index2$1g.compareAsc)(o,r)===-i));return 0===s?0:s}var eachDayOfInterval$1={},normalizeInterval$1={};normalizeInterval$1.normalizeInterval=normalizeInterval;var _index$39=normalizeDates$2;function normalizeInterval(e,t){const[n,o]=(0,_index$39.normalizeDates)(e,t.start,t.end);return{start:n,end:o}}eachDayOfInterval$1.eachDayOfInterval=eachDayOfInterval;var _index$38=normalizeInterval$1,_index2$1f=constructFrom$2;function eachDayOfInterval(e,t){const{start:n,end:o}=(0,_index$38.normalizeInterval)(t?.in,e);let r=+n>+o;const i=r?+n:+o,a=r?o:n;a.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,r=!r);const c=[];for(;+a<=i;)c.push((0,_index2$1f.constructFrom)(n,a)),a.setDate(a.getDate()+s),a.setHours(0,0,0,0);return r?c.reverse():c}var eachHourOfInterval$1={};eachHourOfInterval$1.eachHourOfInterval=eachHourOfInterval;var _index$37=normalizeInterval$1,_index2$1e=constructFrom$2;function eachHourOfInterval(e,t){const{start:n,end:o}=(0,_index$37.normalizeInterval)(t?.in,e);let r=+n>+o;const i=r?+n:+o,a=r?o:n;a.setMinutes(0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,r=!r);const c=[];for(;+a<=i;)c.push((0,_index2$1e.constructFrom)(n,a)),a.setHours(a.getHours()+s);return r?c.reverse():c}var eachMinuteOfInterval$1={};eachMinuteOfInterval$1.eachMinuteOfInterval=eachMinuteOfInterval;var _index$36=normalizeInterval$1,_index2$1d=addMinutes$1,_index3$I=constructFrom$2;function eachMinuteOfInterval(e,t){const{start:n,end:o}=(0,_index$36.normalizeInterval)(t?.in,e);n.setSeconds(0,0);let r=+n>+o;const i=r?+n:+o;let a=r?o:n,s=t?.step??1;if(!s)return[];s<0&&(s=-s,r=!r);const c=[];for(;+a<=i;)c.push((0,_index3$I.constructFrom)(n,a)),a=(0,_index2$1d.addMinutes)(a,s);return r?c.reverse():c}var eachMonthOfInterval$1={};eachMonthOfInterval$1.eachMonthOfInterval=eachMonthOfInterval;var _index$35=normalizeInterval$1,_index2$1c=constructFrom$2;function eachMonthOfInterval(e,t){const{start:n,end:o}=(0,_index$35.normalizeInterval)(t?.in,e);let r=+n>+o;const i=r?+n:+o,a=r?o:n;a.setHours(0,0,0,0),a.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,r=!r);const c=[];for(;+a<=i;)c.push((0,_index2$1c.constructFrom)(n,a)),a.setMonth(a.getMonth()+s);return r?c.reverse():c}var eachQuarterOfInterval$1={},startOfQuarter$1={};startOfQuarter$1.startOfQuarter=startOfQuarter;var _index$34=toDate$2;function startOfQuarter(e,t){const n=(0,_index$34.toDate)(e,t?.in),o=n.getMonth(),r=o-o%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}eachQuarterOfInterval$1.eachQuarterOfInterval=eachQuarterOfInterval;var _index$33=normalizeInterval$1,_index2$1b=addQuarters$1,_index3$H=constructFrom$2,_index4$h=startOfQuarter$1;function eachQuarterOfInterval(e,t){const{start:n,end:o}=(0,_index$33.normalizeInterval)(t?.in,e);let r=+n>+o;const i=r?+(0,_index4$h.startOfQuarter)(n):+(0,_index4$h.startOfQuarter)(o);let a=r?(0,_index4$h.startOfQuarter)(o):(0,_index4$h.startOfQuarter)(n),s=t?.step??1;if(!s)return[];s<0&&(s=-s,r=!r);const c=[];for(;+a<=i;)c.push((0,_index3$H.constructFrom)(n,a)),a=(0,_index2$1b.addQuarters)(a,s);return r?c.reverse():c}var eachWeekOfInterval$1={};eachWeekOfInterval$1.eachWeekOfInterval=eachWeekOfInterval;var _index$32=normalizeInterval$1,_index2$1a=addWeeks$1,_index3$G=constructFrom$2,_index4$g=startOfWeek$2;function eachWeekOfInterval(e,t){const{start:n,end:o}=(0,_index$32.normalizeInterval)(t?.in,e);let r=+n>+o;const i=r?(0,_index4$g.startOfWeek)(o,t):(0,_index4$g.startOfWeek)(n,t),a=r?(0,_index4$g.startOfWeek)(n,t):(0,_index4$g.startOfWeek)(o,t);i.setHours(15),a.setHours(15);const s=+a.getTime();let c=i,l=t?.step??1;if(!l)return[];l<0&&(l=-l,r=!r);const u=[];for(;+c<=s;)c.setHours(0),u.push((0,_index3$G.constructFrom)(n,c)),c=(0,_index2$1a.addWeeks)(c,l),c.setHours(15);return r?u.reverse():u}var eachWeekendOfInterval$1={};eachWeekendOfInterval$1.eachWeekendOfInterval=eachWeekendOfInterval;var _index$31=normalizeInterval$1,_index2$19=constructFrom$2,_index3$F=eachDayOfInterval$1,_index4$f=isWeekend$1;function eachWeekendOfInterval(e,t){const{start:n,end:o}=(0,_index$31.normalizeInterval)(t?.in,e),r=(0,_index3$F.eachDayOfInterval)({start:n,end:o},t),i=[];let a=0;for(;a<r.length;){const e=r[a++];(0,_index4$f.isWeekend)(e)&&i.push((0,_index2$19.constructFrom)(n,e))}return i}var eachWeekendOfMonth$1={},startOfMonth$1={};startOfMonth$1.startOfMonth=startOfMonth;var _index$30=toDate$2;function startOfMonth(e,t){const n=(0,_index$30.toDate)(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}eachWeekendOfMonth$1.eachWeekendOfMonth=eachWeekendOfMonth;var _index$2$=eachWeekendOfInterval$1,_index2$18=endOfMonth$1,_index3$E=startOfMonth$1;function eachWeekendOfMonth(e,t){const n=(0,_index3$E.startOfMonth)(e,t),o=(0,_index2$18.endOfMonth)(e,t);return(0,_index$2$.eachWeekendOfInterval)({start:n,end:o},t)}var eachWeekendOfYear$1={},endOfYear$1={};endOfYear$1.endOfYear=endOfYear;var _index$2_=toDate$2;function endOfYear(e,t){const n=(0,_index$2_.toDate)(e,t?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}var startOfYear$2={};startOfYear$2.startOfYear=startOfYear$1;var _index$2Z=toDate$2;function startOfYear$1(e,t){const n=(0,_index$2Z.toDate)(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}eachWeekendOfYear$1.eachWeekendOfYear=eachWeekendOfYear;var _index$2Y=eachWeekendOfInterval$1,_index2$17=endOfYear$1,_index3$D=startOfYear$2;function eachWeekendOfYear(e,t){const n=(0,_index3$D.startOfYear)(e,t),o=(0,_index2$17.endOfYear)(e,t);return(0,_index$2Y.eachWeekendOfInterval)({start:n,end:o},t)}var eachYearOfInterval$1={};eachYearOfInterval$1.eachYearOfInterval=eachYearOfInterval;var _index$2X=normalizeInterval$1,_index2$16=constructFrom$2;function eachYearOfInterval(e,t){const{start:n,end:o}=(0,_index$2X.normalizeInterval)(t?.in,e);let r=+n>+o;const i=r?+n:+o,a=r?o:n;a.setHours(0,0,0,0),a.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,r=!r);const c=[];for(;+a<=i;)c.push((0,_index2$16.constructFrom)(n,a)),a.setFullYear(a.getFullYear()+s);return r?c.reverse():c}var endOfDecade$1={};endOfDecade$1.endOfDecade=endOfDecade;var _index$2W=toDate$2;function endOfDecade(e,t){const n=(0,_index$2W.toDate)(e,t?.in),o=n.getFullYear(),r=9+10*Math.floor(o/10);return n.setFullYear(r,11,31),n.setHours(23,59,59,999),n}var endOfHour$1={};endOfHour$1.endOfHour=endOfHour;var _index$2V=toDate$2;function endOfHour(e,t){const n=(0,_index$2V.toDate)(e,t?.in);return n.setMinutes(59,59,999),n}var endOfISOWeek$1={},endOfWeek$1={};endOfWeek$1.endOfWeek=endOfWeek;var _index$2U=defaultOptions$3,_index2$15=toDate$2;function endOfWeek(e,t){const n=(0,_index$2U.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=(0,_index2$15.toDate)(e,t?.in),i=r.getDay(),a=6+(i<o?-7:0)-(i-o);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}endOfISOWeek$1.endOfISOWeek=endOfISOWeek;var _index$2T=endOfWeek$1;function endOfISOWeek(e,t){return(0,_index$2T.endOfWeek)(e,{...t,weekStartsOn:1})}var endOfISOWeekYear$1={};endOfISOWeekYear$1.endOfISOWeekYear=endOfISOWeekYear;var _index$2S=constructFrom$2,_index2$14=getISOWeekYear$2,_index3$C=startOfISOWeek$2;function endOfISOWeekYear(e,t){const n=(0,_index2$14.getISOWeekYear)(e,t),o=(0,_index$2S.constructFrom)(t?.in||e,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);const r=(0,_index3$C.startOfISOWeek)(o,t);return r.setMilliseconds(r.getMilliseconds()-1),r}var endOfMinute$1={};endOfMinute$1.endOfMinute=endOfMinute;var _index$2R=toDate$2;function endOfMinute(e,t){const n=(0,_index$2R.toDate)(e,t?.in);return n.setSeconds(59,999),n}var endOfQuarter$1={};endOfQuarter$1.endOfQuarter=endOfQuarter;var _index$2Q=toDate$2;function endOfQuarter(e,t){const n=(0,_index$2Q.toDate)(e,t?.in),o=n.getMonth(),r=o-o%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}var endOfSecond$1={};endOfSecond$1.endOfSecond=endOfSecond;var _index$2P=toDate$2;function endOfSecond(e,t){const n=(0,_index$2P.toDate)(e,t?.in);return n.setMilliseconds(999),n}var endOfToday$1={};endOfToday$1.endOfToday=endOfToday;var _index$2O=endOfDay$1;function endOfToday(e){return(0,_index$2O.endOfDay)(Date.now(),e)}var endOfTomorrow$1={};endOfTomorrow$1.endOfTomorrow=endOfTomorrow;var _index$2N=constructNow$1;function endOfTomorrow(e){const t=(0,_index$2N.constructNow)(e?.in),n=t.getFullYear(),o=t.getMonth(),r=t.getDate(),i=(0,_index$2N.constructNow)(e?.in);return i.setFullYear(n,o,r+1),i.setHours(23,59,59,999),e?.in?e.in(i):i}var endOfYesterday$1={};endOfYesterday$1.endOfYesterday=endOfYesterday;var _index$2M=constructFrom$2,_index2$13=constructNow$1;function endOfYesterday(e){const t=(0,_index2$13.constructNow)(e?.in),n=(0,_index$2M.constructFrom)(e?.in,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()-1),n.setHours(23,59,59,999),n}var format$1={},defaultLocale={},enUS$1={},formatDistance$4={formatDistance:void 0};const formatDistanceLocale$1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance$3=(e,t,n)=>{let o;const r=formatDistanceLocale$1[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};formatDistance$4.formatDistance=formatDistance$3;var formatLong$1={},buildFormatLongFn$2={};function buildFormatLongFn$1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}buildFormatLongFn$2.buildFormatLongFn=buildFormatLongFn$1,formatLong$1.formatLong=void 0;var _index$2L=buildFormatLongFn$2;const dateFormats$1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats$1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats$1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"};formatLong$1.formatLong={date:(0,_index$2L.buildFormatLongFn)({formats:dateFormats$1,defaultWidth:"full"}),time:(0,_index$2L.buildFormatLongFn)({formats:timeFormats$1,defaultWidth:"full"}),dateTime:(0,_index$2L.buildFormatLongFn)({formats:dateTimeFormats$1,defaultWidth:"full"})};var formatRelative$4={formatRelative:void 0};const formatRelativeLocale$1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative$3=(e,t,n,o)=>formatRelativeLocale$1[e];formatRelative$4.formatRelative=formatRelative$3;var localize$1={},buildLocalizeFn$2={};function buildLocalizeFn$1(e){return(t,n)=>{let o;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;o=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;o=e.values[r]||e.values[t]}return o[e.argumentCallback?e.argumentCallback(t):t]}}buildLocalizeFn$2.buildLocalizeFn=buildLocalizeFn$1,localize$1.localize=void 0;var _index$2K=buildLocalizeFn$2;const eraValues$1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues$1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues$1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues$1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues$1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues$1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber$1=(e,t)=>{const n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"};localize$1.localize={ordinalNumber:ordinalNumber$1,era:(0,_index$2K.buildLocalizeFn)({values:eraValues$1,defaultWidth:"wide"}),quarter:(0,_index$2K.buildLocalizeFn)({values:quarterValues$1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,_index$2K.buildLocalizeFn)({values:monthValues$1,defaultWidth:"wide"}),day:(0,_index$2K.buildLocalizeFn)({values:dayValues$1,defaultWidth:"wide"}),dayPeriod:(0,_index$2K.buildLocalizeFn)({values:dayPeriodValues$1,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$1,defaultFormattingWidth:"wide"})};var match$1={},buildMatchFn$2={};function buildMatchFn$1(e){return(t,n={})=>{const o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const a=i[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?findIndex$2(s,(e=>e.test(a))):findKey$1(s,(e=>e.test(a)));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(a.length)}}}function findKey$1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function findIndex$2(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}buildMatchFn$2.buildMatchFn=buildMatchFn$1;var buildMatchPatternFn$2={};function buildMatchPatternFn$1(e){return(t,n={})=>{const o=t.match(e.matchPattern);if(!o)return null;const r=o[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;return{value:a,rest:t.slice(r.length)}}}buildMatchPatternFn$2.buildMatchPatternFn=buildMatchPatternFn$1,match$1.match=void 0;var _index$2J=buildMatchFn$2,_index2$12=buildMatchPatternFn$2;const matchOrdinalNumberPattern$1=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern$1=/\d+/i,matchEraPatterns$1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns$1={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns$1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns$1={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns$1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns$1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns$1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns$1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}};match$1.match={ordinalNumber:(0,_index2$12.buildMatchPatternFn)({matchPattern:matchOrdinalNumberPattern$1,parsePattern:parseOrdinalNumberPattern$1,valueCallback:e=>parseInt(e,10)}),era:(0,_index$2J.buildMatchFn)({matchPatterns:matchEraPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$1,defaultParseWidth:"any"}),quarter:(0,_index$2J.buildMatchFn)({matchPatterns:matchQuarterPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:(0,_index$2J.buildMatchFn)({matchPatterns:matchMonthPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$1,defaultParseWidth:"any"}),day:(0,_index$2J.buildMatchFn)({matchPatterns:matchDayPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$1,defaultParseWidth:"any"}),dayPeriod:(0,_index$2J.buildMatchFn)({matchPatterns:matchDayPeriodPatterns$1,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$1,defaultParseWidth:"any"})},enUS$1.enUS=void 0;var _index$2I=formatDistance$4,_index2$11=formatLong$1,_index3$B=formatRelative$4,_index4$e=localize$1,_index5$8=match$1;enUS$1.enUS={code:"en-US",formatDistance:_index$2I.formatDistance,formatLong:_index2$11.formatLong,formatRelative:_index3$B.formatRelative,localize:_index4$e.localize,match:_index5$8.match,options:{weekStartsOn:0,firstWeekContainsDate:1}},function(e){Object.defineProperty(e,"defaultLocale",{enumerable:!0,get:function(){return t.enUS}});var t=enUS$1}(defaultLocale);var formatters$1={},getDayOfYear$2={};getDayOfYear$2.getDayOfYear=getDayOfYear$1;var _index$2H=differenceInCalendarDays$2,_index2$10=startOfYear$2,_index3$A=toDate$2;function getDayOfYear$1(e,t){const n=(0,_index3$A.toDate)(e,t?.in);return(0,_index$2H.differenceInCalendarDays)(n,(0,_index2$10.startOfYear)(n))+1}var getISOWeek$2={};getISOWeek$2.getISOWeek=getISOWeek$1;var _index$2G=constants$1,_index2$$=startOfISOWeek$2,_index3$z=startOfISOWeekYear$2,_index4$d=toDate$2;function getISOWeek$1(e,t){const n=(0,_index4$d.toDate)(e,t?.in),o=+(0,_index2$$.startOfISOWeek)(n)-+(0,_index3$z.startOfISOWeekYear)(n);return Math.round(o/_index$2G.millisecondsInWeek)+1}var getWeek$2={},startOfWeekYear$2={},getWeekYear$2={};getWeekYear$2.getWeekYear=getWeekYear$1;var _index$2F=defaultOptions$3,_index2$_=constructFrom$2,_index3$y=startOfWeek$2,_index4$c=toDate$2;function getWeekYear$1(e,t){const n=(0,_index4$c.toDate)(e,t?.in),o=n.getFullYear(),r=(0,_index$2F.getDefaultOptions)(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=(0,_index2$_.constructFrom)(t?.in||e,0);a.setFullYear(o+1,0,i),a.setHours(0,0,0,0);const s=(0,_index3$y.startOfWeek)(a,t),c=(0,_index2$_.constructFrom)(t?.in||e,0);c.setFullYear(o,0,i),c.setHours(0,0,0,0);const l=(0,_index3$y.startOfWeek)(c,t);return+n>=+s?o+1:+n>=+l?o:o-1}startOfWeekYear$2.startOfWeekYear=startOfWeekYear$1;var _index$2E=defaultOptions$3,_index2$Z=constructFrom$2,_index3$x=getWeekYear$2,_index4$b=startOfWeek$2;function startOfWeekYear$1(e,t){const n=(0,_index$2E.getDefaultOptions)(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=(0,_index3$x.getWeekYear)(e,t),i=(0,_index2$Z.constructFrom)(t?.in||e,0);i.setFullYear(r,0,o),i.setHours(0,0,0,0);return(0,_index4$b.startOfWeek)(i,t)}getWeek$2.getWeek=getWeek$1;var _index$2D=constants$1,_index2$Y=startOfWeek$2,_index3$w=startOfWeekYear$2,_index4$a=toDate$2;function getWeek$1(e,t){const n=(0,_index4$a.toDate)(e,t?.in),o=+(0,_index2$Y.startOfWeek)(n,t)-+(0,_index3$w.startOfWeekYear)(n,t);return Math.round(o/_index$2D.millisecondsInWeek)+1}var addLeadingZeros$2={};function addLeadingZeros$1(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}addLeadingZeros$2.addLeadingZeros=addLeadingZeros$1;var lightFormatters$1={lightFormatters:void 0},_index$2C=addLeadingZeros$2;lightFormatters$1.lightFormatters={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return(0,_index$2C.addLeadingZeros)("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):(0,_index$2C.addLeadingZeros)(n+1,2)},d:(e,t)=>(0,_index$2C.addLeadingZeros)(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>(0,_index$2C.addLeadingZeros)(e.getHours()%12||12,t.length),H:(e,t)=>(0,_index$2C.addLeadingZeros)(e.getHours(),t.length),m:(e,t)=>(0,_index$2C.addLeadingZeros)(e.getMinutes(),t.length),s:(e,t)=>(0,_index$2C.addLeadingZeros)(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds(),r=Math.trunc(o*Math.pow(10,n-3));return(0,_index$2C.addLeadingZeros)(r,t.length)}},formatters$1.formatters=void 0;var _index$2B=getDayOfYear$2,_index2$X=getISOWeek$2,_index3$v=getISOWeekYear$2,_index4$9=getWeek$2,_index5$7=getWeekYear$2,_index6$4=addLeadingZeros$2,_index7$4=lightFormatters$1;const dayPeriodEnum$1={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function formatTimezoneShort$1(e,t=""){const n=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),i=o%60;return 0===i?n+String(r):n+String(r)+t+(0,_index6$4.addLeadingZeros)(i,2)}function formatTimezoneWithOptionalMinutes$1(e,t){if(e%60==0){return(e>0?"-":"+")+(0,_index6$4.addLeadingZeros)(Math.abs(e)/60,2)}return formatTimezone$1(e,t)}function formatTimezone$1(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+(0,_index6$4.addLeadingZeros)(Math.trunc(o/60),2)+t+(0,_index6$4.addLeadingZeros)(o%60,2)}formatters$1.formatters={G:function(e,t,n){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),o=t>0?t:1-t;return n.ordinalNumber(o,{unit:"year"})}return _index7$4.lightFormatters.y(e,t)},Y:function(e,t,n,o){const r=(0,_index5$7.getWeekYear)(e,o),i=r>0?r:1-r;if("YY"===t){const e=i%100;return(0,_index6$4.addLeadingZeros)(e,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):(0,_index6$4.addLeadingZeros)(i,t.length)},R:function(e,t){const n=(0,_index3$v.getISOWeekYear)(e);return(0,_index6$4.addLeadingZeros)(n,t.length)},u:function(e,t){const n=e.getFullYear();return(0,_index6$4.addLeadingZeros)(n,t.length)},Q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return(0,_index6$4.addLeadingZeros)(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return(0,_index6$4.addLeadingZeros)(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){const o=e.getMonth();switch(t){case"M":case"MM":return _index7$4.lightFormatters.M(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return(0,_index6$4.addLeadingZeros)(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){const r=(0,_index4$9.getWeek)(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):(0,_index6$4.addLeadingZeros)(r,t.length)},I:function(e,t,n){const o=(0,_index2$X.getISOWeek)(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):(0,_index6$4.addLeadingZeros)(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):_index7$4.lightFormatters.d(e,t)},D:function(e,t,n){const o=(0,_index$2B.getDayOfYear)(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):(0,_index6$4.addLeadingZeros)(o,t.length)},E:function(e,t,n){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){const r=e.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return(0,_index6$4.addLeadingZeros)(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){const r=e.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return(0,_index6$4.addLeadingZeros)(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const o=e.getDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return(0,_index6$4.addLeadingZeros)(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const o=e.getHours();let r;switch(r=12===o?dayPeriodEnum$1.noon:0===o?dayPeriodEnum$1.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const o=e.getHours();let r;switch(r=o>=17?dayPeriodEnum$1.evening:o>=12?dayPeriodEnum$1.afternoon:o>=4?dayPeriodEnum$1.morning:dayPeriodEnum$1.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return _index7$4.lightFormatters.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):_index7$4.lightFormatters.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):(0,_index6$4.addLeadingZeros)(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):(0,_index6$4.addLeadingZeros)(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):_index7$4.lightFormatters.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):_index7$4.lightFormatters.s(e,t)},S:function(e,t){return _index7$4.lightFormatters.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return formatTimezoneWithOptionalMinutes$1(o);case"XXXX":case"XX":return formatTimezone$1(o);default:return formatTimezone$1(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return formatTimezoneWithOptionalMinutes$1(o);case"xxxx":case"xx":return formatTimezone$1(o);default:return formatTimezone$1(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort$1(o,":");default:return"GMT"+formatTimezone$1(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort$1(o,":");default:return"GMT"+formatTimezone$1(o,":")}},t:function(e,t,n){const o=Math.trunc(+e/1e3);return(0,_index6$4.addLeadingZeros)(o,t.length)},T:function(e,t,n){return(0,_index6$4.addLeadingZeros)(+e,t.length)}};var longFormatters$1={longFormatters:void 0};const dateLongFormatter$1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},timeLongFormatter$1=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},dateTimeLongFormatter$1=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return dateLongFormatter$1(e,t);let i;switch(o){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",dateLongFormatter$1(o,t)).replace("{{time}}",timeLongFormatter$1(r,t))};longFormatters$1.longFormatters={p:timeLongFormatter$1,P:dateTimeLongFormatter$1};var protectedTokens={};protectedTokens.isProtectedDayOfYearToken=isProtectedDayOfYearToken$1,protectedTokens.isProtectedWeekYearToken=isProtectedWeekYearToken$1,protectedTokens.warnOrThrowProtectedError=warnOrThrowProtectedError$1;const dayOfYearTokenRE$1=/^D+$/,weekYearTokenRE$1=/^Y+$/,throwTokens$1=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken$1(e){return dayOfYearTokenRE$1.test(e)}function isProtectedWeekYearToken$1(e){return weekYearTokenRE$1.test(e)}function warnOrThrowProtectedError$1(e,t,n){const o=message$1(e,t,n);if(console.warn(o),throwTokens$1.includes(e))throw new RangeError(o)}function message$1(e,t,n){const o="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}!function(e){e.format=e.formatDate=function(e,u,d){const f=(0,n.getDefaultOptions)(),h=d?.locale??f.locale??t.defaultLocale,g=d?.firstWeekContainsDate??d?.locale?.options?.firstWeekContainsDate??f.firstWeekContainsDate??f.locale?.options?.firstWeekContainsDate??1,_=d?.weekStartsOn??d?.locale?.options?.weekStartsOn??f.weekStartsOn??f.locale?.options?.weekStartsOn??0,$=(0,s.toDate)(e,d?.in);if(!(0,a.isValid)($))throw new RangeError("Invalid time value");let b=u.match(l).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,r.longFormatters[t])(e,h.formatLong)}return e})).join("").match(c).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:m(e)};if(o.formatters[t])return{isToken:!0,value:e};if(t.match(p))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));h.localize.preprocessor&&(b=h.localize.preprocessor($,b));const y={firstWeekContainsDate:g,weekStartsOn:_,locale:h};return b.map((t=>{if(!t.isToken)return t.value;const n=t.value;(!d?.useAdditionalWeekYearTokens&&(0,i.isProtectedWeekYearToken)(n)||!d?.useAdditionalDayOfYearTokens&&(0,i.isProtectedDayOfYearToken)(n))&&(0,i.warnOrThrowProtectedError)(n,u,String(e));return(0,o.formatters[n[0]])($,n,h.localize,y)})).join("")},Object.defineProperty(e,"formatters",{enumerable:!0,get:function(){return o.formatters}}),Object.defineProperty(e,"longFormatters",{enumerable:!0,get:function(){return r.longFormatters}});var t=defaultLocale,n=defaultOptions$3,o=formatters$1,r=longFormatters$1,i=protectedTokens,a=isValid$2,s=toDate$2;const c=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,l=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,u=/^'([^]*?)'?$/,d=/''/g,p=/[a-zA-Z]/;function m(e){const t=e.match(u);return t?t[1].replace(d,"'"):e}}(format$1);var formatDistance$2={};formatDistance$2.formatDistance=formatDistance$1;var _index$2A=defaultLocale,_index2$W=defaultOptions$3,_index3$u=getTimezoneOffsetInMilliseconds$2,_index4$8=normalizeDates$2,_index5$6=compareAsc$1,_index6$3=constants$1,_index7$3=differenceInMonths$1,_index8$2=differenceInSeconds$1;function formatDistance$1(e,t,n){const o=(0,_index2$W.getDefaultOptions)(),r=n?.locale??o.locale??_index$2A.defaultLocale,i=(0,_index5$6.compareAsc)(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i}),[s,c]=(0,_index4$8.normalizeDates)(n?.in,...i>0?[t,e]:[e,t]),l=(0,_index8$2.differenceInSeconds)(c,s),u=((0,_index3$u.getTimezoneOffsetInMilliseconds)(c)-(0,_index3$u.getTimezoneOffsetInMilliseconds)(s))/1e3,d=Math.round((l-u)/60);let p;if(d<2)return n?.includeSeconds?l<5?r.formatDistance("lessThanXSeconds",5,a):l<10?r.formatDistance("lessThanXSeconds",10,a):l<20?r.formatDistance("lessThanXSeconds",20,a):l<40?r.formatDistance("halfAMinute",0,a):l<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):0===d?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",d,a);if(d<45)return r.formatDistance("xMinutes",d,a);if(d<90)return r.formatDistance("aboutXHours",1,a);if(d<_index6$3.minutesInDay){const e=Math.round(d/60);return r.formatDistance("aboutXHours",e,a)}if(d<2520)return r.formatDistance("xDays",1,a);if(d<_index6$3.minutesInMonth){const e=Math.round(d/_index6$3.minutesInDay);return r.formatDistance("xDays",e,a)}if(d<2*_index6$3.minutesInMonth)return p=Math.round(d/_index6$3.minutesInMonth),r.formatDistance("aboutXMonths",p,a);if(p=(0,_index7$3.differenceInMonths)(c,s),p<12){const e=Math.round(d/_index6$3.minutesInMonth);return r.formatDistance("xMonths",e,a)}{const e=p%12,t=Math.trunc(p/12);return e<3?r.formatDistance("aboutXYears",t,a):e<9?r.formatDistance("overXYears",t,a):r.formatDistance("almostXYears",t+1,a)}}var formatDistanceStrict$1={};formatDistanceStrict$1.formatDistanceStrict=formatDistanceStrict;var _index$2z=defaultLocale,_index2$V=defaultOptions$3,_index3$t=getRoundingMethod$1,_index4$7=getTimezoneOffsetInMilliseconds$2,_index5$5=normalizeDates$2,_index6$2=compareAsc$1,_index7$2=constants$1;function formatDistanceStrict(e,t,n){const o=(0,_index2$V.getDefaultOptions)(),r=n?.locale??o.locale??_index$2z.defaultLocale,i=(0,_index6$2.compareAsc)(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i}),[s,c]=(0,_index5$5.normalizeDates)(n?.in,...i>0?[t,e]:[e,t]),l=(0,_index3$t.getRoundingMethod)(n?.roundingMethod??"round"),u=c.getTime()-s.getTime(),d=u/_index7$2.millisecondsInMinute,p=(u-((0,_index4$7.getTimezoneOffsetInMilliseconds)(c)-(0,_index4$7.getTimezoneOffsetInMilliseconds)(s)))/_index7$2.millisecondsInMinute,m=n?.unit;let f;if(f=m||(d<1?"second":d<60?"minute":d<_index7$2.minutesInDay?"hour":p<_index7$2.minutesInMonth?"day":p<_index7$2.minutesInYear?"month":"year"),"second"===f){const e=l(u/1e3);return r.formatDistance("xSeconds",e,a)}if("minute"===f){const e=l(d);return r.formatDistance("xMinutes",e,a)}if("hour"===f){const e=l(d/60);return r.formatDistance("xHours",e,a)}if("day"===f){const e=l(p/_index7$2.minutesInDay);return r.formatDistance("xDays",e,a)}if("month"===f){const e=l(p/_index7$2.minutesInMonth);return 12===e&&"month"!==m?r.formatDistance("xYears",1,a):r.formatDistance("xMonths",e,a)}{const e=l(p/_index7$2.minutesInYear);return r.formatDistance("xYears",e,a)}}var formatDistanceToNow$1={};formatDistanceToNow$1.formatDistanceToNow=formatDistanceToNow;var _index$2y=constructNow$1,_index2$U=formatDistance$2;function formatDistanceToNow(e,t){return(0,_index2$U.formatDistance)(e,(0,_index$2y.constructNow)(e),t)}var formatDistanceToNowStrict$1={};formatDistanceToNowStrict$1.formatDistanceToNowStrict=formatDistanceToNowStrict;var _index$2x=constructNow$1,_index2$T=formatDistanceStrict$1;function formatDistanceToNowStrict(e,t){return(0,_index2$T.formatDistanceStrict)(e,(0,_index$2x.constructNow)(e),t)}var formatDuration$2={};formatDuration$2.formatDuration=formatDuration$1;var _index$2w=defaultLocale,_index2$S=defaultOptions$3;const defaultFormat=["years","months","weeks","days","hours","minutes","seconds"];function formatDuration$1(e,t){const n=(0,_index2$S.getDefaultOptions)(),o=t?.locale??n.locale??_index$2w.defaultLocale,r=t?.format??defaultFormat,i=t?.zero??!1,a=t?.delimiter??" ";if(!o.formatDistance)return"";const s=r.reduce(((t,n)=>{const r=`x${n.replace(/(^.)/,(e=>e.toUpperCase()))}`,a=e[n];return void 0!==a&&(i||e[n])?t.concat(o.formatDistance(r,a)):t}),[]).join(a);return s}var formatISO$1={};formatISO$1.formatISO=formatISO;var _index$2v=addLeadingZeros$2,_index2$R=toDate$2;function formatISO(e,t){const n=(0,_index2$R.toDate)(e,t?.in);if(isNaN(+n))throw new RangeError("Invalid time value");const o=t?.format??"extended",r=t?.representation??"complete";let i="",a="";const s="extended"===o?"-":"",c="extended"===o?":":"";if("time"!==r){const e=(0,_index$2v.addLeadingZeros)(n.getDate(),2),t=(0,_index$2v.addLeadingZeros)(n.getMonth()+1,2);i=`${(0,_index$2v.addLeadingZeros)(n.getFullYear(),4)}${s}${t}${s}${e}`}if("date"!==r){const e=n.getTimezoneOffset();if(0!==e){const t=Math.abs(e);a=`${e<0?"+":"-"}${(0,_index$2v.addLeadingZeros)(Math.trunc(t/60),2)}:${(0,_index$2v.addLeadingZeros)(t%60,2)}`}else a="Z";i=`${i}${""===i?"":"T"}${[(0,_index$2v.addLeadingZeros)(n.getHours(),2),(0,_index$2v.addLeadingZeros)(n.getMinutes(),2),(0,_index$2v.addLeadingZeros)(n.getSeconds(),2)].join(c)}${a}`}return i}var formatISO9075$1={};formatISO9075$1.formatISO9075=formatISO9075;var _index$2u=addLeadingZeros$2,_index2$Q=isValid$2,_index3$s=toDate$2;function formatISO9075(e,t){const n=(0,_index3$s.toDate)(e,t?.in);if(!(0,_index2$Q.isValid)(n))throw new RangeError("Invalid time value");const o=t?.format??"extended",r=t?.representation??"complete";let i="";const a="extended"===o?"-":"",s="extended"===o?":":"";if("time"!==r){const e=(0,_index$2u.addLeadingZeros)(n.getDate(),2),t=(0,_index$2u.addLeadingZeros)(n.getMonth()+1,2);i=`${(0,_index$2u.addLeadingZeros)(n.getFullYear(),4)}${a}${t}${a}${e}`}if("date"!==r){i=`${i}${""===i?"":" "}${(0,_index$2u.addLeadingZeros)(n.getHours(),2)}${s}${(0,_index$2u.addLeadingZeros)(n.getMinutes(),2)}${s}${(0,_index$2u.addLeadingZeros)(n.getSeconds(),2)}`}return i}var formatISODuration$1={};function formatISODuration(e){const{years:t=0,months:n=0,days:o=0,hours:r=0,minutes:i=0,seconds:a=0}=e;return`P${t}Y${n}M${o}DT${r}H${i}M${a}S`}formatISODuration$1.formatISODuration=formatISODuration;var formatRFC3339$1={};formatRFC3339$1.formatRFC3339=formatRFC3339;var _index$2t=addLeadingZeros$2,_index2$P=isValid$2,_index3$r=toDate$2;function formatRFC3339(e,t){const n=(0,_index3$r.toDate)(e,t?.in);if(!(0,_index2$P.isValid)(n))throw new RangeError("Invalid time value");const o=t?.fractionDigits??0,r=(0,_index$2t.addLeadingZeros)(n.getDate(),2),i=(0,_index$2t.addLeadingZeros)(n.getMonth()+1,2),a=n.getFullYear(),s=(0,_index$2t.addLeadingZeros)(n.getHours(),2),c=(0,_index$2t.addLeadingZeros)(n.getMinutes(),2),l=(0,_index$2t.addLeadingZeros)(n.getSeconds(),2);let u="";if(o>0){const e=n.getMilliseconds(),t=Math.trunc(e*Math.pow(10,o-3));u="."+(0,_index$2t.addLeadingZeros)(t,o)}let d="";const p=n.getTimezoneOffset();if(0!==p){const e=Math.abs(p);d=`${p<0?"+":"-"}${(0,_index$2t.addLeadingZeros)(Math.trunc(e/60),2)}:${(0,_index$2t.addLeadingZeros)(e%60,2)}`}else d="Z";return`${a}-${i}-${r}T${s}:${c}:${l}${u}${d}`}var formatRFC7231$1={};formatRFC7231$1.formatRFC7231=formatRFC7231;var _index$2s=addLeadingZeros$2,_index2$O=isValid$2,_index3$q=toDate$2;const days=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function formatRFC7231(e){const t=(0,_index3$q.toDate)(e);if(!(0,_index2$O.isValid)(t))throw new RangeError("Invalid time value");return`${days[t.getUTCDay()]}, ${(0,_index$2s.addLeadingZeros)(t.getUTCDate(),2)} ${months[t.getUTCMonth()]} ${t.getUTCFullYear()} ${(0,_index$2s.addLeadingZeros)(t.getUTCHours(),2)}:${(0,_index$2s.addLeadingZeros)(t.getUTCMinutes(),2)}:${(0,_index$2s.addLeadingZeros)(t.getUTCSeconds(),2)} GMT`}var formatRelative$2={};formatRelative$2.formatRelative=formatRelative$1;var _index$2r=defaultLocale,_index2$N=defaultOptions$3,_index3$p=normalizeDates$2,_index4$6=differenceInCalendarDays$2,_index5$4=format$1;function formatRelative$1(e,t,n){const[o,r]=(0,_index3$p.normalizeDates)(n?.in,e,t),i=(0,_index2$N.getDefaultOptions)(),a=n?.locale??i.locale??_index$2r.defaultLocale,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=(0,_index4$6.differenceInCalendarDays)(o,r);if(isNaN(c))throw new RangeError("Invalid time value");let l;l=c<-6?"other":c<-1?"lastWeek":c<0?"yesterday":c<1?"today":c<2?"tomorrow":c<7?"nextWeek":"other";const u=a.formatRelative(l,o,r,{locale:a,weekStartsOn:s});return(0,_index5$4.format)(o,u,{locale:a,weekStartsOn:s})}var fromUnixTime$1={};fromUnixTime$1.fromUnixTime=fromUnixTime;var _index$2q=toDate$2;function fromUnixTime(e,t){return(0,_index$2q.toDate)(1e3*e,t?.in)}var getDate$1={};getDate$1.getDate=getDate;var _index$2p=toDate$2;function getDate(e,t){return(0,_index$2p.toDate)(e,t?.in).getDate()}var getDay$1={};getDay$1.getDay=getDay;var _index$2o=toDate$2;function getDay(e,t){return(0,_index$2o.toDate)(e,t?.in).getDay()}var getDaysInMonth$1={};getDaysInMonth$1.getDaysInMonth=getDaysInMonth;var _index$2n=constructFrom$2,_index2$M=toDate$2;function getDaysInMonth(e,t){const n=(0,_index2$M.toDate)(e,t?.in),o=n.getFullYear(),r=n.getMonth(),i=(0,_index$2n.constructFrom)(n,0);return i.setFullYear(o,r+1,0),i.setHours(0,0,0,0),i.getDate()}var getDaysInYear$1={},isLeapYear$1={};isLeapYear$1.isLeapYear=isLeapYear;var _index$2m=toDate$2;function isLeapYear(e,t){const n=(0,_index$2m.toDate)(e,t?.in).getFullYear();return n%400==0||n%4==0&&n%100!=0}getDaysInYear$1.getDaysInYear=getDaysInYear;var _index$2l=isLeapYear$1,_index2$L=toDate$2;function getDaysInYear(e,t){const n=(0,_index2$L.toDate)(e,t?.in);return Number.isNaN(+n)?NaN:(0,_index$2l.isLeapYear)(n)?366:365}var getDecade$1={};getDecade$1.getDecade=getDecade;var _index$2k=toDate$2;function getDecade(e,t){const n=(0,_index$2k.toDate)(e,t?.in).getFullYear();return 10*Math.floor(n/10)}var getDefaultOptions$2={};getDefaultOptions$2.getDefaultOptions=getDefaultOptions$1;var _index$2j=defaultOptions$3;function getDefaultOptions$1(){return Object.assign({},(0,_index$2j.getDefaultOptions)())}var getHours$1={};getHours$1.getHours=getHours;var _index$2i=toDate$2;function getHours(e,t){return(0,_index$2i.toDate)(e,t?.in).getHours()}var getISODay$1={};getISODay$1.getISODay=getISODay;var _index$2h=toDate$2;function getISODay(e,t){const n=(0,_index$2h.toDate)(e,t?.in).getDay();return 0===n?7:n}var getISOWeeksInYear$1={};getISOWeeksInYear$1.getISOWeeksInYear=getISOWeeksInYear;var _index$2g=addWeeks$1,_index2$K=constants$1,_index3$o=startOfISOWeekYear$2;function getISOWeeksInYear(e,t){const n=(0,_index3$o.startOfISOWeekYear)(e,t),o=+(0,_index3$o.startOfISOWeekYear)((0,_index$2g.addWeeks)(n,60))-+n;return Math.round(o/_index2$K.millisecondsInWeek)}var getMilliseconds$1={};getMilliseconds$1.getMilliseconds=getMilliseconds;var _index$2f=toDate$2;function getMilliseconds(e){return(0,_index$2f.toDate)(e).getMilliseconds()}var getMinutes$1={};getMinutes$1.getMinutes=getMinutes;var _index$2e=toDate$2;function getMinutes(e,t){return(0,_index$2e.toDate)(e,t?.in).getMinutes()}var getMonth$1={};getMonth$1.getMonth=getMonth;var _index$2d=toDate$2;function getMonth(e,t){return(0,_index$2d.toDate)(e,t?.in).getMonth()}var getOverlappingDaysInIntervals$1={};getOverlappingDaysInIntervals$1.getOverlappingDaysInIntervals=getOverlappingDaysInIntervals;var _index$2c=getTimezoneOffsetInMilliseconds$2,_index2$J=constants$1,_index3$n=toDate$2;function getOverlappingDaysInIntervals(e,t){const[n,o]=[+(0,_index3$n.toDate)(e.start),+(0,_index3$n.toDate)(e.end)].sort(((e,t)=>e-t)),[r,i]=[+(0,_index3$n.toDate)(t.start),+(0,_index3$n.toDate)(t.end)].sort(((e,t)=>e-t));if(!(n<i&&r<o))return 0;const a=r<n?n:r,s=a-(0,_index$2c.getTimezoneOffsetInMilliseconds)(a),c=i>o?o:i,l=c-(0,_index$2c.getTimezoneOffsetInMilliseconds)(c);return Math.ceil((l-s)/_index2$J.millisecondsInDay)}var getSeconds$1={};getSeconds$1.getSeconds=getSeconds;var _index$2b=toDate$2;function getSeconds(e){return(0,_index$2b.toDate)(e).getSeconds()}var getTime$1={};getTime$1.getTime=getTime;var _index$2a=toDate$2;function getTime(e){return+(0,_index$2a.toDate)(e)}var getUnixTime$1={};getUnixTime$1.getUnixTime=getUnixTime;var _index$29=toDate$2;function getUnixTime(e){return Math.trunc(+(0,_index$29.toDate)(e)/1e3)}var getWeekOfMonth$1={};getWeekOfMonth$1.getWeekOfMonth=getWeekOfMonth;var _index$28=defaultOptions$3,_index2$I=getDate$1,_index3$m=getDay$1,_index4$5=startOfMonth$1,_index5$3=toDate$2;function getWeekOfMonth(e,t){const n=(0,_index$28.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=(0,_index2$I.getDate)((0,_index5$3.toDate)(e,t?.in));if(isNaN(r))return NaN;let i=o-(0,_index3$m.getDay)((0,_index4$5.startOfMonth)(e,t));i<=0&&(i+=7);const a=r-i;return Math.ceil(a/7)+1}var getWeeksInMonth$1={},lastDayOfMonth$1={};lastDayOfMonth$1.lastDayOfMonth=lastDayOfMonth;var _index$27=toDate$2;function lastDayOfMonth(e,t){const n=(0,_index$27.toDate)(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(0,0,0,0),(0,_index$27.toDate)(n,t?.in)}getWeeksInMonth$1.getWeeksInMonth=getWeeksInMonth;var _index$26=differenceInCalendarWeeks$1,_index2$H=lastDayOfMonth$1,_index3$l=startOfMonth$1,_index4$4=toDate$2;function getWeeksInMonth(e,t){const n=(0,_index4$4.toDate)(e,t?.in);return(0,_index$26.differenceInCalendarWeeks)((0,_index2$H.lastDayOfMonth)(n,t),(0,_index3$l.startOfMonth)(n,t),t)+1}var getYear$1={};getYear$1.getYear=getYear;var _index$25=toDate$2;function getYear(e,t){return(0,_index$25.toDate)(e,t?.in).getFullYear()}var hoursToMilliseconds$1={};hoursToMilliseconds$1.hoursToMilliseconds=hoursToMilliseconds;var _index$24=constants$1;function hoursToMilliseconds(e){return Math.trunc(e*_index$24.millisecondsInHour)}var hoursToMinutes$1={};hoursToMinutes$1.hoursToMinutes=hoursToMinutes;var _index$23=constants$1;function hoursToMinutes(e){return Math.trunc(e*_index$23.minutesInHour)}var hoursToSeconds$1={};hoursToSeconds$1.hoursToSeconds=hoursToSeconds;var _index$22=constants$1;function hoursToSeconds(e){return Math.trunc(e*_index$22.secondsInHour)}var interval$1={};interval$1.interval=interval;var _index$21=normalizeDates$2;function interval(e,t,n){const[o,r]=(0,_index$21.normalizeDates)(n?.in,e,t);if(isNaN(+o))throw new TypeError("Start date is invalid");if(isNaN(+r))throw new TypeError("End date is invalid");if(n?.assertPositive&&+o>+r)throw new TypeError("End date must be after start date");return{start:o,end:r}}var intervalToDuration$1={};intervalToDuration$1.intervalToDuration=intervalToDuration;var _index$20=normalizeInterval$1,_index2$G=add$1,_index3$k=differenceInDays$1,_index4$3=differenceInHours$1,_index5$2=differenceInMinutes$1,_index6$1=differenceInMonths$1,_index7$1=differenceInSeconds$1,_index8$1=differenceInYears$1;function intervalToDuration(e,t){const{start:n,end:o}=(0,_index$20.normalizeInterval)(t?.in,e),r={},i=(0,_index8$1.differenceInYears)(o,n);i&&(r.years=i);const a=(0,_index2$G.add)(n,{years:r.years}),s=(0,_index6$1.differenceInMonths)(o,a);s&&(r.months=s);const c=(0,_index2$G.add)(a,{months:r.months}),l=(0,_index3$k.differenceInDays)(o,c);l&&(r.days=l);const u=(0,_index2$G.add)(c,{days:r.days}),d=(0,_index4$3.differenceInHours)(o,u);d&&(r.hours=d);const p=(0,_index2$G.add)(u,{hours:r.hours}),m=(0,_index5$2.differenceInMinutes)(o,p);m&&(r.minutes=m);const f=(0,_index2$G.add)(p,{minutes:r.minutes}),h=(0,_index7$1.differenceInSeconds)(o,f);return h&&(r.seconds=h),r}var intlFormat$1={};intlFormat$1.intlFormat=intlFormat;var _index$1$=toDate$2;function intlFormat(e,t,n){let o;return isFormatOptions(t)?o=t:n=t,new Intl.DateTimeFormat(n?.locale,o).format((0,_index$1$.toDate)(e))}function isFormatOptions(e){return void 0!==e&&!("locale"in e)}var intlFormatDistance$1={};intlFormatDistance$1.intlFormatDistance=intlFormatDistance;var _index$1_=normalizeDates$2,_index2$F=constants$1,_index3$j=differenceInCalendarDays$2,_index4$2=differenceInCalendarMonths$1,_index5$1=differenceInCalendarQuarters$1,_index6=differenceInCalendarWeeks$1,_index7=differenceInCalendarYears$1,_index8=differenceInHours$1,_index9=differenceInMinutes$1,_index10=differenceInSeconds$1;function intlFormatDistance(e,t,n){let o,r=0;const[i,a]=(0,_index$1_.normalizeDates)(n?.in,e,t);if(n?.unit)o=n?.unit,"second"===o?r=(0,_index10.differenceInSeconds)(i,a):"minute"===o?r=(0,_index9.differenceInMinutes)(i,a):"hour"===o?r=(0,_index8.differenceInHours)(i,a):"day"===o?r=(0,_index3$j.differenceInCalendarDays)(i,a):"week"===o?r=(0,_index6.differenceInCalendarWeeks)(i,a):"month"===o?r=(0,_index4$2.differenceInCalendarMonths)(i,a):"quarter"===o?r=(0,_index5$1.differenceInCalendarQuarters)(i,a):"year"===o&&(r=(0,_index7.differenceInCalendarYears)(i,a));else{const e=(0,_index10.differenceInSeconds)(i,a);Math.abs(e)<_index2$F.secondsInMinute?(r=(0,_index10.differenceInSeconds)(i,a),o="second"):Math.abs(e)<_index2$F.secondsInHour?(r=(0,_index9.differenceInMinutes)(i,a),o="minute"):Math.abs(e)<_index2$F.secondsInDay&&Math.abs((0,_index3$j.differenceInCalendarDays)(i,a))<1?(r=(0,_index8.differenceInHours)(i,a),o="hour"):Math.abs(e)<_index2$F.secondsInWeek&&(r=(0,_index3$j.differenceInCalendarDays)(i,a))&&Math.abs(r)<7?o="day":Math.abs(e)<_index2$F.secondsInMonth?(r=(0,_index6.differenceInCalendarWeeks)(i,a),o="week"):Math.abs(e)<_index2$F.secondsInQuarter?(r=(0,_index4$2.differenceInCalendarMonths)(i,a),o="month"):Math.abs(e)<_index2$F.secondsInYear&&(0,_index5$1.differenceInCalendarQuarters)(i,a)<4?(r=(0,_index5$1.differenceInCalendarQuarters)(i,a),o="quarter"):(r=(0,_index7.differenceInCalendarYears)(i,a),o="year")}return new Intl.RelativeTimeFormat(n?.locale,{numeric:"auto",...n}).format(r,o)}var isAfter$1={};isAfter$1.isAfter=isAfter;var _index$1Z=toDate$2;function isAfter(e,t){return+(0,_index$1Z.toDate)(e)>+(0,_index$1Z.toDate)(t)}var isBefore$1={};isBefore$1.isBefore=isBefore;var _index$1Y=toDate$2;function isBefore(e,t){return+(0,_index$1Y.toDate)(e)<+(0,_index$1Y.toDate)(t)}var isEqual$1={};isEqual$1.isEqual=isEqual;var _index$1X=toDate$2;function isEqual(e,t){return+(0,_index$1X.toDate)(e)==+(0,_index$1X.toDate)(t)}var isExists$1={};function isExists(e,t,n){const o=new Date(e,t,n);return o.getFullYear()===e&&o.getMonth()===t&&o.getDate()===n}isExists$1.isExists=isExists;var isFirstDayOfMonth$1={};isFirstDayOfMonth$1.isFirstDayOfMonth=isFirstDayOfMonth;var _index$1W=toDate$2;function isFirstDayOfMonth(e,t){return 1===(0,_index$1W.toDate)(e,t?.in).getDate()}var isFriday$1={};isFriday$1.isFriday=isFriday;var _index$1V=toDate$2;function isFriday(e,t){return 5===(0,_index$1V.toDate)(e,t?.in).getDay()}var isFuture$1={};isFuture$1.isFuture=isFuture;var _index$1U=toDate$2;function isFuture(e){return+(0,_index$1U.toDate)(e)>Date.now()}var isMatch$1={},parse$2={},Setter$1={},transpose$1={};transpose$1.transpose=transpose;var _index$1T=constructFrom$2;function transpose(e,t){const n=isConstructor(t)?new t(0):(0,_index$1T.constructFrom)(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function isConstructor(e){return"function"==typeof e&&e.prototype?.constructor===e}Setter$1.ValueSetter=Setter$1.Setter=Setter$1.DateTimezoneSetter=void 0;var _index$1S=constructFrom$2,_index2$E=transpose$1;const TIMEZONE_UNIT_PRIORITY=10;class Setter{subPriority=0;validate(e,t){return!0}}Setter$1.Setter=Setter;class ValueSetter extends Setter{constructor(e,t,n,o,r){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=o,r&&(this.subPriority=r)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}Setter$1.ValueSetter=ValueSetter;class DateTimezoneSetter extends Setter{priority=TIMEZONE_UNIT_PRIORITY;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>(0,_index$1S.constructFrom)(t,e))}set(e,t){return t.timestampIsSet?e:(0,_index$1S.constructFrom)(e,(0,_index2$E.transpose)(e,this.context))}}Setter$1.DateTimezoneSetter=DateTimezoneSetter;var parsers={},EraParser$1={},Parser$3={Parser:void 0},_Setter=Setter$1;class Parser$2{run(e,t,n,o){const r=this.parse(e,t,n,o);return r?{setter:new _Setter.ValueSetter(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(e,t,n){return!0}}Parser$3.Parser=Parser$2,EraParser$1.EraParser=void 0;var _Parser$u=Parser$3;class EraParser extends _Parser$u.Parser{priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}EraParser$1.EraParser=EraParser;var YearParser$1={},utils={},constants={};constants.timezonePatterns=constants.numericPatterns=void 0,constants.numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},constants.timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/},utils.dayPeriodEnumToHours=dayPeriodEnumToHours,utils.isLeapYearIndex=isLeapYearIndex$1,utils.mapValue=mapValue,utils.normalizeTwoDigitYear=normalizeTwoDigitYear,utils.parseAnyDigitsSigned=parseAnyDigitsSigned,utils.parseNDigits=parseNDigits,utils.parseNDigitsSigned=parseNDigitsSigned,utils.parseNumericPattern=parseNumericPattern,utils.parseTimezonePattern=parseTimezonePattern;var _index$1R=constants$1,_constants$e=constants;function mapValue(e,t){return e?{value:t(e.value),rest:e.rest}:e}function parseNumericPattern(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function parseTimezonePattern(e,t){const n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};const o="+"===n[1]?1:-1,r=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:o*(r*_index$1R.millisecondsInHour+i*_index$1R.millisecondsInMinute+a*_index$1R.millisecondsInSecond),rest:t.slice(n[0].length)}}function parseAnyDigitsSigned(e){return parseNumericPattern(_constants$e.numericPatterns.anyDigitsSigned,e)}function parseNDigits(e,t){switch(e){case 1:return parseNumericPattern(_constants$e.numericPatterns.singleDigit,t);case 2:return parseNumericPattern(_constants$e.numericPatterns.twoDigits,t);case 3:return parseNumericPattern(_constants$e.numericPatterns.threeDigits,t);case 4:return parseNumericPattern(_constants$e.numericPatterns.fourDigits,t);default:return parseNumericPattern(new RegExp("^\\d{1,"+e+"}"),t)}}function parseNDigitsSigned(e,t){switch(e){case 1:return parseNumericPattern(_constants$e.numericPatterns.singleDigitSigned,t);case 2:return parseNumericPattern(_constants$e.numericPatterns.twoDigitsSigned,t);case 3:return parseNumericPattern(_constants$e.numericPatterns.threeDigitsSigned,t);case 4:return parseNumericPattern(_constants$e.numericPatterns.fourDigitsSigned,t);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+e+"}"),t)}}function dayPeriodEnumToHours(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function normalizeTwoDigitYear(e,t){const n=t>0,o=n?t:1-t;let r;if(o<=50)r=e||100;else{const t=o+50;r=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return n?r:1-r}function isLeapYearIndex$1(e){return e%400==0||e%4==0&&e%100!=0}YearParser$1.YearParser=void 0;var _Parser$t=Parser$3,_utils$s=utils;class YearParser extends _Parser$t.Parser{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){const o=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return(0,_utils$s.mapValue)((0,_utils$s.parseNDigits)(4,e),o);case"yo":return(0,_utils$s.mapValue)(n.ordinalNumber(e,{unit:"year"}),o);default:return(0,_utils$s.mapValue)((0,_utils$s.parseNDigits)(t.length,e),o)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const o=e.getFullYear();if(n.isTwoDigitYear){const t=(0,_utils$s.normalizeTwoDigitYear)(n.year,o);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const r="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}YearParser$1.YearParser=YearParser;var LocalWeekYearParser$1={LocalWeekYearParser:void 0},_index$1Q=getWeekYear$2,_index2$D=startOfWeek$2,_Parser$s=Parser$3,_utils$r=utils;class LocalWeekYearParser extends _Parser$s.Parser{priority=130;parse(e,t,n){const o=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return(0,_utils$r.mapValue)((0,_utils$r.parseNDigits)(4,e),o);case"Yo":return(0,_utils$r.mapValue)(n.ordinalNumber(e,{unit:"year"}),o);default:return(0,_utils$r.mapValue)((0,_utils$r.parseNDigits)(t.length,e),o)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,o){const r=(0,_index$1Q.getWeekYear)(e,o);if(n.isTwoDigitYear){const t=(0,_utils$r.normalizeTwoDigitYear)(n.year,r);return e.setFullYear(t,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),(0,_index2$D.startOfWeek)(e,o)}const i="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(i,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),(0,_index2$D.startOfWeek)(e,o)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}LocalWeekYearParser$1.LocalWeekYearParser=LocalWeekYearParser;var ISOWeekYearParser$1={ISOWeekYearParser:void 0},_index$1P=startOfISOWeek$2,_index2$C=constructFrom$2,_Parser$r=Parser$3,_utils$q=utils;class ISOWeekYearParser extends _Parser$r.Parser{priority=130;parse(e,t){return"R"===t?(0,_utils$q.parseNDigitsSigned)(4,e):(0,_utils$q.parseNDigitsSigned)(t.length,e)}set(e,t,n){const o=(0,_index2$C.constructFrom)(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),(0,_index$1P.startOfISOWeek)(o)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}ISOWeekYearParser$1.ISOWeekYearParser=ISOWeekYearParser;var ExtendedYearParser$1={ExtendedYearParser:void 0},_Parser$q=Parser$3,_utils$p=utils;class ExtendedYearParser extends _Parser$q.Parser{priority=130;parse(e,t){return"u"===t?(0,_utils$p.parseNDigitsSigned)(4,e):(0,_utils$p.parseNDigitsSigned)(t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}ExtendedYearParser$1.ExtendedYearParser=ExtendedYearParser;var QuarterParser$1={QuarterParser:void 0},_Parser$p=Parser$3,_utils$o=utils;class QuarterParser extends _Parser$p.Parser{priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return(0,_utils$o.parseNDigits)(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}QuarterParser$1.QuarterParser=QuarterParser;var StandAloneQuarterParser$1={StandAloneQuarterParser:void 0},_Parser$o=Parser$3,_utils$n=utils;class StandAloneQuarterParser extends _Parser$o.Parser{priority=120;parse(e,t,n){switch(t){case"q":case"qq":return(0,_utils$n.parseNDigits)(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}StandAloneQuarterParser$1.StandAloneQuarterParser=StandAloneQuarterParser;var MonthParser$1={MonthParser:void 0},_constants$d=constants,_Parser$n=Parser$3,_utils$m=utils;class MonthParser extends _Parser$n.Parser{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){const o=e=>e-1;switch(t){case"M":return(0,_utils$m.mapValue)((0,_utils$m.parseNumericPattern)(_constants$d.numericPatterns.month,e),o);case"MM":return(0,_utils$m.mapValue)((0,_utils$m.parseNDigits)(2,e),o);case"Mo":return(0,_utils$m.mapValue)(n.ordinalNumber(e,{unit:"month"}),o);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}MonthParser$1.MonthParser=MonthParser;var StandAloneMonthParser$1={StandAloneMonthParser:void 0},_constants$c=constants,_Parser$m=Parser$3,_utils$l=utils;class StandAloneMonthParser extends _Parser$m.Parser{priority=110;parse(e,t,n){const o=e=>e-1;switch(t){case"L":return(0,_utils$l.mapValue)((0,_utils$l.parseNumericPattern)(_constants$c.numericPatterns.month,e),o);case"LL":return(0,_utils$l.mapValue)((0,_utils$l.parseNDigits)(2,e),o);case"Lo":return(0,_utils$l.mapValue)(n.ordinalNumber(e,{unit:"month"}),o);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}StandAloneMonthParser$1.StandAloneMonthParser=StandAloneMonthParser;var LocalWeekParser$1={},setWeek$1={};setWeek$1.setWeek=setWeek;var _index$1O=getWeek$2,_index2$B=toDate$2;function setWeek(e,t,n){const o=(0,_index2$B.toDate)(e,n?.in),r=(0,_index$1O.getWeek)(o,n)-t;return o.setDate(o.getDate()-7*r),(0,_index2$B.toDate)(o,n?.in)}LocalWeekParser$1.LocalWeekParser=void 0;var _index$1N=setWeek$1,_index2$A=startOfWeek$2,_constants$b=constants,_Parser$l=Parser$3,_utils$k=utils;class LocalWeekParser extends _Parser$l.Parser{priority=100;parse(e,t,n){switch(t){case"w":return(0,_utils$k.parseNumericPattern)(_constants$b.numericPatterns.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return(0,_utils$k.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,o){return(0,_index2$A.startOfWeek)((0,_index$1N.setWeek)(e,n,o),o)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}LocalWeekParser$1.LocalWeekParser=LocalWeekParser;var ISOWeekParser$1={},setISOWeek$1={};setISOWeek$1.setISOWeek=setISOWeek;var _index$1M=getISOWeek$2,_index2$z=toDate$2;function setISOWeek(e,t,n){const o=(0,_index2$z.toDate)(e,n?.in),r=(0,_index$1M.getISOWeek)(o,n)-t;return o.setDate(o.getDate()-7*r),o}ISOWeekParser$1.ISOWeekParser=void 0;var _index$1L=setISOWeek$1,_index2$y=startOfISOWeek$2,_constants$a=constants,_Parser$k=Parser$3,_utils$j=utils;class ISOWeekParser extends _Parser$k.Parser{priority=100;parse(e,t,n){switch(t){case"I":return(0,_utils$j.parseNumericPattern)(_constants$a.numericPatterns.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return(0,_utils$j.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return(0,_index2$y.startOfISOWeek)((0,_index$1L.setISOWeek)(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}ISOWeekParser$1.ISOWeekParser=ISOWeekParser;var DateParser$1={DateParser:void 0},_constants$9=constants,_Parser$j=Parser$3,_utils$i=utils;const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends _Parser$j.Parser{priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return(0,_utils$i.parseNumericPattern)(_constants$9.numericPatterns.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return(0,_utils$i.parseNDigits)(t.length,e)}}validate(e,t){const n=e.getFullYear(),o=(0,_utils$i.isLeapYearIndex)(n),r=e.getMonth();return o?t>=1&&t<=DAYS_IN_MONTH_LEAP_YEAR[r]:t>=1&&t<=DAYS_IN_MONTH[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}DateParser$1.DateParser=DateParser;var DayOfYearParser$1={DayOfYearParser:void 0},_constants$8=constants,_Parser$i=Parser$3,_utils$h=utils;class DayOfYearParser extends _Parser$i.Parser{priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return(0,_utils$h.parseNumericPattern)(_constants$8.numericPatterns.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return(0,_utils$h.parseNDigits)(t.length,e)}}validate(e,t){const n=e.getFullYear();return(0,_utils$h.isLeapYearIndex)(n)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}DayOfYearParser$1.DayOfYearParser=DayOfYearParser;var DayParser$1={},setDay$1={};setDay$1.setDay=setDay;var _index$1K=defaultOptions$3,_index2$x=addDays$1,_index3$i=toDate$2;function setDay(e,t,n){const o=(0,_index$1K.getDefaultOptions)(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,i=(0,_index3$i.toDate)(e,n?.in),a=i.getDay(),s=7-r,c=t<0||t>6?t-(a+s)%7:((t%7+7)%7+s)%7-(a+s)%7;return(0,_index2$x.addDays)(i,c,n)}DayParser$1.DayParser=void 0;var _index$1J=setDay$1,_Parser$h=Parser$3;class DayParser extends _Parser$h.Parser{priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,o){return(e=(0,_index$1J.setDay)(e,n,o)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}DayParser$1.DayParser=DayParser;var LocalDayParser$1={LocalDayParser:void 0},_index$1I=setDay$1,_Parser$g=Parser$3,_utils$g=utils;class LocalDayParser extends _Parser$g.Parser{priority=90;parse(e,t,n,o){const r=e=>{const t=7*Math.floor((e-1)/7);return(e+o.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return(0,_utils$g.mapValue)((0,_utils$g.parseNDigits)(t.length,e),r);case"eo":return(0,_utils$g.mapValue)(n.ordinalNumber(e,{unit:"day"}),r);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,o){return(e=(0,_index$1I.setDay)(e,n,o)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}LocalDayParser$1.LocalDayParser=LocalDayParser;var StandAloneLocalDayParser$1={StandAloneLocalDayParser:void 0},_index$1H=setDay$1,_Parser$f=Parser$3,_utils$f=utils;class StandAloneLocalDayParser extends _Parser$f.Parser{priority=90;parse(e,t,n,o){const r=e=>{const t=7*Math.floor((e-1)/7);return(e+o.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return(0,_utils$f.mapValue)((0,_utils$f.parseNDigits)(t.length,e),r);case"co":return(0,_utils$f.mapValue)(n.ordinalNumber(e,{unit:"day"}),r);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,o){return(e=(0,_index$1H.setDay)(e,n,o)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}StandAloneLocalDayParser$1.StandAloneLocalDayParser=StandAloneLocalDayParser;var ISODayParser$1={},setISODay$1={};setISODay$1.setISODay=setISODay;var _index$1G=addDays$1,_index2$w=getISODay$1,_index3$h=toDate$2;function setISODay(e,t,n){const o=(0,_index3$h.toDate)(e,n?.in),r=t-(0,_index2$w.getISODay)(o,n);return(0,_index$1G.addDays)(o,r,n)}ISODayParser$1.ISODayParser=void 0;var _index$1F=setISODay$1,_Parser$e=Parser$3,_utils$e=utils;class ISODayParser extends _Parser$e.Parser{priority=90;parse(e,t,n){const o=e=>0===e?7:e;switch(t){case"i":case"ii":return(0,_utils$e.parseNDigits)(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return(0,_utils$e.mapValue)(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),o);case"iiiii":return(0,_utils$e.mapValue)(n.day(e,{width:"narrow",context:"formatting"}),o);case"iiiiii":return(0,_utils$e.mapValue)(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),o);default:return(0,_utils$e.mapValue)(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),o)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return(e=(0,_index$1F.setISODay)(e,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}ISODayParser$1.ISODayParser=ISODayParser;var AMPMParser$1={AMPMParser:void 0},_Parser$d=Parser$3,_utils$d=utils;class AMPMParser extends _Parser$d.Parser{priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours((0,_utils$d.dayPeriodEnumToHours)(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}AMPMParser$1.AMPMParser=AMPMParser;var AMPMMidnightParser$1={AMPMMidnightParser:void 0},_Parser$c=Parser$3,_utils$c=utils;class AMPMMidnightParser extends _Parser$c.Parser{priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours((0,_utils$c.dayPeriodEnumToHours)(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}AMPMMidnightParser$1.AMPMMidnightParser=AMPMMidnightParser;var DayPeriodParser$1={DayPeriodParser:void 0},_Parser$b=Parser$3,_utils$b=utils;class DayPeriodParser extends _Parser$b.Parser{priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours((0,_utils$b.dayPeriodEnumToHours)(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}DayPeriodParser$1.DayPeriodParser=DayPeriodParser;var Hour1to12Parser$1={Hour1to12Parser:void 0},_constants$7=constants,_Parser$a=Parser$3,_utils$a=utils;class Hour1to12Parser extends _Parser$a.Parser{priority=70;parse(e,t,n){switch(t){case"h":return(0,_utils$a.parseNumericPattern)(_constants$7.numericPatterns.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return(0,_utils$a.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const o=e.getHours()>=12;return o&&n<12?e.setHours(n+12,0,0,0):o||12!==n?e.setHours(n,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}Hour1to12Parser$1.Hour1to12Parser=Hour1to12Parser;var Hour0to23Parser$1={Hour0to23Parser:void 0},_constants$6=constants,_Parser$9=Parser$3,_utils$9=utils;class Hour0to23Parser extends _Parser$9.Parser{priority=70;parse(e,t,n){switch(t){case"H":return(0,_utils$9.parseNumericPattern)(_constants$6.numericPatterns.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return(0,_utils$9.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}Hour0to23Parser$1.Hour0to23Parser=Hour0to23Parser;var Hour0To11Parser$1={Hour0To11Parser:void 0},_constants$5=constants,_Parser$8=Parser$3,_utils$8=utils;class Hour0To11Parser extends _Parser$8.Parser{priority=70;parse(e,t,n){switch(t){case"K":return(0,_utils$8.parseNumericPattern)(_constants$5.numericPatterns.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return(0,_utils$8.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}Hour0To11Parser$1.Hour0To11Parser=Hour0To11Parser;var Hour1To24Parser$1={Hour1To24Parser:void 0},_constants$4=constants,_Parser$7=Parser$3,_utils$7=utils;class Hour1To24Parser extends _Parser$7.Parser{priority=70;parse(e,t,n){switch(t){case"k":return(0,_utils$7.parseNumericPattern)(_constants$4.numericPatterns.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return(0,_utils$7.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const o=n<=24?n%24:n;return e.setHours(o,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}Hour1To24Parser$1.Hour1To24Parser=Hour1To24Parser;var MinuteParser$1={MinuteParser:void 0},_constants$3=constants,_Parser$6=Parser$3,_utils$6=utils;class MinuteParser extends _Parser$6.Parser{priority=60;parse(e,t,n){switch(t){case"m":return(0,_utils$6.parseNumericPattern)(_constants$3.numericPatterns.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return(0,_utils$6.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}MinuteParser$1.MinuteParser=MinuteParser;var SecondParser$1={SecondParser:void 0},_constants$2=constants,_Parser$5=Parser$3,_utils$5=utils;class SecondParser extends _Parser$5.Parser{priority=50;parse(e,t,n){switch(t){case"s":return(0,_utils$5.parseNumericPattern)(_constants$2.numericPatterns.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return(0,_utils$5.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}SecondParser$1.SecondParser=SecondParser;var FractionOfSecondParser$1={FractionOfSecondParser:void 0},_Parser$4=Parser$3,_utils$4=utils;class FractionOfSecondParser extends _Parser$4.Parser{priority=30;parse(e,t){return(0,_utils$4.mapValue)((0,_utils$4.parseNDigits)(t.length,e),(e=>Math.trunc(e*Math.pow(10,3-t.length))))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}FractionOfSecondParser$1.FractionOfSecondParser=FractionOfSecondParser;var ISOTimezoneWithZParser$1={ISOTimezoneWithZParser:void 0},_index$1E=constructFrom$2,_index2$v=getTimezoneOffsetInMilliseconds$2,_constants$1=constants,_Parser$3=Parser$3,_utils$3=utils;class ISOTimezoneWithZParser extends _Parser$3.Parser{priority=10;parse(e,t){switch(t){case"X":return(0,_utils$3.parseTimezonePattern)(_constants$1.timezonePatterns.basicOptionalMinutes,e);case"XX":return(0,_utils$3.parseTimezonePattern)(_constants$1.timezonePatterns.basic,e);case"XXXX":return(0,_utils$3.parseTimezonePattern)(_constants$1.timezonePatterns.basicOptionalSeconds,e);case"XXXXX":return(0,_utils$3.parseTimezonePattern)(_constants$1.timezonePatterns.extendedOptionalSeconds,e);default:return(0,_utils$3.parseTimezonePattern)(_constants$1.timezonePatterns.extended,e)}}set(e,t,n){return t.timestampIsSet?e:(0,_index$1E.constructFrom)(e,e.getTime()-(0,_index2$v.getTimezoneOffsetInMilliseconds)(e)-n)}incompatibleTokens=["t","T","x"]}ISOTimezoneWithZParser$1.ISOTimezoneWithZParser=ISOTimezoneWithZParser;var ISOTimezoneParser$1={ISOTimezoneParser:void 0},_index$1D=constructFrom$2,_index2$u=getTimezoneOffsetInMilliseconds$2,_constants=constants,_Parser$2=Parser$3,_utils$2=utils;class ISOTimezoneParser extends _Parser$2.Parser{priority=10;parse(e,t){switch(t){case"x":return(0,_utils$2.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalMinutes,e);case"xx":return(0,_utils$2.parseTimezonePattern)(_constants.timezonePatterns.basic,e);case"xxxx":return(0,_utils$2.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalSeconds,e);case"xxxxx":return(0,_utils$2.parseTimezonePattern)(_constants.timezonePatterns.extendedOptionalSeconds,e);default:return(0,_utils$2.parseTimezonePattern)(_constants.timezonePatterns.extended,e)}}set(e,t,n){return t.timestampIsSet?e:(0,_index$1D.constructFrom)(e,e.getTime()-(0,_index2$u.getTimezoneOffsetInMilliseconds)(e)-n)}incompatibleTokens=["t","T","X"]}ISOTimezoneParser$1.ISOTimezoneParser=ISOTimezoneParser;var TimestampSecondsParser$1={TimestampSecondsParser:void 0},_index$1C=constructFrom$2,_Parser$1=Parser$3,_utils$1=utils;class TimestampSecondsParser extends _Parser$1.Parser{priority=40;parse(e){return(0,_utils$1.parseAnyDigitsSigned)(e)}set(e,t,n){return[(0,_index$1C.constructFrom)(e,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"}TimestampSecondsParser$1.TimestampSecondsParser=TimestampSecondsParser;var TimestampMillisecondsParser$1={TimestampMillisecondsParser:void 0},_index$1B=constructFrom$2,_Parser=Parser$3,_utils=utils;class TimestampMillisecondsParser extends _Parser.Parser{priority=20;parse(e){return(0,_utils.parseAnyDigitsSigned)(e)}set(e,t,n){return[(0,_index$1B.constructFrom)(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}TimestampMillisecondsParser$1.TimestampMillisecondsParser=TimestampMillisecondsParser,parsers.parsers=void 0;var _EraParser=EraParser$1,_YearParser=YearParser$1,_LocalWeekYearParser=LocalWeekYearParser$1,_ISOWeekYearParser=ISOWeekYearParser$1,_ExtendedYearParser=ExtendedYearParser$1,_QuarterParser=QuarterParser$1,_StandAloneQuarterParser=StandAloneQuarterParser$1,_MonthParser=MonthParser$1,_StandAloneMonthParser=StandAloneMonthParser$1,_LocalWeekParser=LocalWeekParser$1,_ISOWeekParser=ISOWeekParser$1,_DateParser=DateParser$1,_DayOfYearParser=DayOfYearParser$1,_DayParser=DayParser$1,_LocalDayParser=LocalDayParser$1,_StandAloneLocalDayParser=StandAloneLocalDayParser$1,_ISODayParser=ISODayParser$1,_AMPMParser=AMPMParser$1,_AMPMMidnightParser=AMPMMidnightParser$1,_DayPeriodParser=DayPeriodParser$1,_Hour1to12Parser=Hour1to12Parser$1,_Hour0to23Parser=Hour0to23Parser$1,_Hour0To11Parser=Hour0To11Parser$1,_Hour1To24Parser=Hour1To24Parser$1,_MinuteParser=MinuteParser$1,_SecondParser=SecondParser$1,_FractionOfSecondParser=FractionOfSecondParser$1,_ISOTimezoneWithZParser=ISOTimezoneWithZParser$1,_ISOTimezoneParser=ISOTimezoneParser$1,_TimestampSecondsParser=TimestampSecondsParser$1,_TimestampMillisecondsParser=TimestampMillisecondsParser$1;parsers.parsers={G:new _EraParser.EraParser,y:new _YearParser.YearParser,Y:new _LocalWeekYearParser.LocalWeekYearParser,R:new _ISOWeekYearParser.ISOWeekYearParser,u:new _ExtendedYearParser.ExtendedYearParser,Q:new _QuarterParser.QuarterParser,q:new _StandAloneQuarterParser.StandAloneQuarterParser,M:new _MonthParser.MonthParser,L:new _StandAloneMonthParser.StandAloneMonthParser,w:new _LocalWeekParser.LocalWeekParser,I:new _ISOWeekParser.ISOWeekParser,d:new _DateParser.DateParser,D:new _DayOfYearParser.DayOfYearParser,E:new _DayParser.DayParser,e:new _LocalDayParser.LocalDayParser,c:new _StandAloneLocalDayParser.StandAloneLocalDayParser,i:new _ISODayParser.ISODayParser,a:new _AMPMParser.AMPMParser,b:new _AMPMMidnightParser.AMPMMidnightParser,B:new _DayPeriodParser.DayPeriodParser,h:new _Hour1to12Parser.Hour1to12Parser,H:new _Hour0to23Parser.Hour0to23Parser,K:new _Hour0To11Parser.Hour0To11Parser,k:new _Hour1To24Parser.Hour1To24Parser,m:new _MinuteParser.MinuteParser,s:new _SecondParser.SecondParser,S:new _FractionOfSecondParser.FractionOfSecondParser,X:new _ISOTimezoneWithZParser.ISOTimezoneWithZParser,x:new _ISOTimezoneParser.ISOTimezoneParser,t:new _TimestampSecondsParser.TimestampSecondsParser,T:new _TimestampMillisecondsParser.TimestampMillisecondsParser},function(e){Object.defineProperty(e,"longFormatters",{enumerable:!0,get:function(){return n.longFormatters}}),e.parse=function(e,h,g,_){const $=()=>(0,r.constructFrom)(_?.in||g,NaN),b=(0,i.getDefaultOptions)(),y=_?.locale??b.locale??t.defaultLocale,v=_?.firstWeekContainsDate??_?.locale?.options?.firstWeekContainsDate??b.firstWeekContainsDate??b.locale?.options?.firstWeekContainsDate??1,x=_?.weekStartsOn??_?.locale?.options?.weekStartsOn??b.weekStartsOn??b.locale?.options?.weekStartsOn??0;if(!h)return e?$():(0,a.toDate)(g,_?.in);const w={firstWeekContainsDate:v,weekStartsOn:x,locale:y},C=[new s.DateTimezoneSetter(_?.in,g)],k=h.match(u).map((e=>{const t=e[0];if(t in n.longFormatters){return(0,n.longFormatters[t])(e,y.formatLong)}return e})).join("").match(l),S=[];for(let t of k){!_?.useAdditionalWeekYearTokens&&(0,o.isProtectedWeekYearToken)(t)&&(0,o.warnOrThrowProtectedError)(t,h,e),!_?.useAdditionalDayOfYearTokens&&(0,o.isProtectedDayOfYearToken)(t)&&(0,o.warnOrThrowProtectedError)(t,h,e);const n=t[0],r=c.parsers[n];if(r){const{incompatibleTokens:o}=r;if(Array.isArray(o)){const e=S.find((e=>o.includes(e.token)||e.token===n));if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${t}\` at the same time`)}else if("*"===r.incompatibleTokens&&S.length>0)throw new RangeError(`The format string mustn't contain \`${t}\` and any other token at the same time`);S.push({token:n,fullToken:t});const i=r.run(e,t,y.match,w);if(!i)return $();C.push(i.setter),e=i.rest}else{if(n.match(f))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===t?t="'":"'"===n&&(t=t.match(d)[1].replace(p,"'")),0!==e.indexOf(t))return $();e=e.slice(t.length)}}if(e.length>0&&m.test(e))return $();const T=C.map((e=>e.priority)).sort(((e,t)=>t-e)).filter(((e,t,n)=>n.indexOf(e)===t)).map((e=>C.filter((t=>t.priority===e)).sort(((e,t)=>t.subPriority-e.subPriority)))).map((e=>e[0]));let E=(0,a.toDate)(g,_?.in);if(isNaN(+E))return $();const A={};for(const e of T){if(!e.validate(E,w))return $();const t=e.set(E,A,w);Array.isArray(t)?(E=t[0],Object.assign(A,t[1])):E=t}return E},Object.defineProperty(e,"parsers",{enumerable:!0,get:function(){return c.parsers}});var t=defaultLocale,n=longFormatters$1,o=protectedTokens,r=constructFrom$2,i=getDefaultOptions$2,a=toDate$2,s=Setter$1,c=parsers;const l=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,u=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,d=/^'([^]*?)'?$/,p=/''/g,m=/\S/,f=/[a-zA-Z]/}(parse$2),isMatch$1.isMatch=isMatch;var _index$1A=isValid$2,_index2$t=parse$2;function isMatch(e,t,n){return(0,_index$1A.isValid)((0,_index2$t.parse)(e,t,new Date,n))}var isMonday$1={};isMonday$1.isMonday=isMonday;var _index$1z=toDate$2;function isMonday(e,t){return 1===(0,_index$1z.toDate)(e,t?.in).getDay()}var isPast$1={};isPast$1.isPast=isPast;var _index$1y=toDate$2;function isPast(e){return+(0,_index$1y.toDate)(e)<Date.now()}var isSameHour$1={},startOfHour$1={};startOfHour$1.startOfHour=startOfHour;var _index$1x=toDate$2;function startOfHour(e,t){const n=(0,_index$1x.toDate)(e,t?.in);return n.setMinutes(0,0,0),n}isSameHour$1.isSameHour=isSameHour;var _index$1w=normalizeDates$2,_index2$s=startOfHour$1;function isSameHour(e,t,n){const[o,r]=(0,_index$1w.normalizeDates)(n?.in,e,t);return+(0,_index2$s.startOfHour)(o)==+(0,_index2$s.startOfHour)(r)}var isSameISOWeek$1={},isSameWeek$1={};isSameWeek$1.isSameWeek=isSameWeek;var _index$1v=normalizeDates$2,_index2$r=startOfWeek$2;function isSameWeek(e,t,n){const[o,r]=(0,_index$1v.normalizeDates)(n?.in,e,t);return+(0,_index2$r.startOfWeek)(o,n)==+(0,_index2$r.startOfWeek)(r,n)}isSameISOWeek$1.isSameISOWeek=isSameISOWeek;var _index$1u=isSameWeek$1;function isSameISOWeek(e,t,n){return(0,_index$1u.isSameWeek)(e,t,{...n,weekStartsOn:1})}var isSameISOWeekYear$1={};isSameISOWeekYear$1.isSameISOWeekYear=isSameISOWeekYear;var _index$1t=startOfISOWeekYear$2,_index2$q=normalizeDates$2;function isSameISOWeekYear(e,t,n){const[o,r]=(0,_index2$q.normalizeDates)(n?.in,e,t);return+(0,_index$1t.startOfISOWeekYear)(o)==+(0,_index$1t.startOfISOWeekYear)(r)}var isSameMinute$1={},startOfMinute$1={};startOfMinute$1.startOfMinute=startOfMinute;var _index$1s=toDate$2;function startOfMinute(e,t){const n=(0,_index$1s.toDate)(e,t?.in);return n.setSeconds(0,0),n}isSameMinute$1.isSameMinute=isSameMinute;var _index$1r=startOfMinute$1;function isSameMinute(e,t){return+(0,_index$1r.startOfMinute)(e)==+(0,_index$1r.startOfMinute)(t)}var isSameMonth$1={};isSameMonth$1.isSameMonth=isSameMonth;var _index$1q=normalizeDates$2;function isSameMonth(e,t,n){const[o,r]=(0,_index$1q.normalizeDates)(n?.in,e,t);return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()}var isSameQuarter$1={};isSameQuarter$1.isSameQuarter=isSameQuarter;var _index$1p=normalizeDates$2,_index2$p=startOfQuarter$1;function isSameQuarter(e,t,n){const[o,r]=(0,_index$1p.normalizeDates)(n?.in,e,t);return+(0,_index2$p.startOfQuarter)(o)==+(0,_index2$p.startOfQuarter)(r)}var isSameSecond$1={},startOfSecond$1={};startOfSecond$1.startOfSecond=startOfSecond;var _index$1o=toDate$2;function startOfSecond(e,t){const n=(0,_index$1o.toDate)(e,t?.in);return n.setMilliseconds(0),n}isSameSecond$1.isSameSecond=isSameSecond;var _index$1n=startOfSecond$1;function isSameSecond(e,t){return+(0,_index$1n.startOfSecond)(e)==+(0,_index$1n.startOfSecond)(t)}var isSameYear$1={};isSameYear$1.isSameYear=isSameYear;var _index$1m=normalizeDates$2;function isSameYear(e,t,n){const[o,r]=(0,_index$1m.normalizeDates)(n?.in,e,t);return o.getFullYear()===r.getFullYear()}var isThisHour$1={};isThisHour$1.isThisHour=isThisHour;var _index$1l=constructNow$1,_index2$o=isSameHour$1,_index3$g=toDate$2;function isThisHour(e,t){return(0,_index2$o.isSameHour)((0,_index3$g.toDate)(e,t?.in),(0,_index$1l.constructNow)(t?.in||e))}var isThisISOWeek$1={};isThisISOWeek$1.isThisISOWeek=isThisISOWeek;var _index$1k=constructFrom$2,_index2$n=constructNow$1,_index3$f=isSameISOWeek$1;function isThisISOWeek(e,t){return(0,_index3$f.isSameISOWeek)((0,_index$1k.constructFrom)(t?.in||e,e),(0,_index2$n.constructNow)(t?.in||e))}var isThisMinute$1={};isThisMinute$1.isThisMinute=isThisMinute;var _index$1j=constructNow$1,_index2$m=isSameMinute$1;function isThisMinute(e){return(0,_index2$m.isSameMinute)(e,(0,_index$1j.constructNow)(e))}var isThisMonth$1={};isThisMonth$1.isThisMonth=isThisMonth;var _index$1i=constructFrom$2,_index2$l=constructNow$1,_index3$e=isSameMonth$1;function isThisMonth(e,t){return(0,_index3$e.isSameMonth)((0,_index$1i.constructFrom)(t?.in||e,e),(0,_index2$l.constructNow)(t?.in||e))}var isThisQuarter$1={};isThisQuarter$1.isThisQuarter=isThisQuarter;var _index$1h=constructFrom$2,_index2$k=constructNow$1,_index3$d=isSameQuarter$1;function isThisQuarter(e,t){return(0,_index3$d.isSameQuarter)((0,_index$1h.constructFrom)(t?.in||e,e),(0,_index2$k.constructNow)(t?.in||e))}var isThisSecond$1={};isThisSecond$1.isThisSecond=isThisSecond;var _index$1g=constructNow$1,_index2$j=isSameSecond$1;function isThisSecond(e){return(0,_index2$j.isSameSecond)(e,(0,_index$1g.constructNow)(e))}var isThisWeek$1={};isThisWeek$1.isThisWeek=isThisWeek;var _index$1f=constructFrom$2,_index2$i=constructNow$1,_index3$c=isSameWeek$1;function isThisWeek(e,t){return(0,_index3$c.isSameWeek)((0,_index$1f.constructFrom)(t?.in||e,e),(0,_index2$i.constructNow)(t?.in||e),t)}var isThisYear$1={};isThisYear$1.isThisYear=isThisYear;var _index$1e=constructFrom$2,_index2$h=constructNow$1,_index3$b=isSameYear$1;function isThisYear(e,t){return(0,_index3$b.isSameYear)((0,_index$1e.constructFrom)(t?.in||e,e),(0,_index2$h.constructNow)(t?.in||e))}var isThursday$1={};isThursday$1.isThursday=isThursday;var _index$1d=toDate$2;function isThursday(e,t){return 4===(0,_index$1d.toDate)(e,t?.in).getDay()}var isToday$1={};isToday$1.isToday=isToday;var _index$1c=constructFrom$2,_index2$g=constructNow$1,_index3$a=isSameDay$1;function isToday(e,t){return(0,_index3$a.isSameDay)((0,_index$1c.constructFrom)(t?.in||e,e),(0,_index2$g.constructNow)(t?.in||e))}var isTomorrow$1={};isTomorrow$1.isTomorrow=isTomorrow;var _index$1b=addDays$1,_index2$f=constructNow$1,_index3$9=isSameDay$1;function isTomorrow(e,t){return(0,_index3$9.isSameDay)(e,(0,_index$1b.addDays)((0,_index2$f.constructNow)(t?.in||e),1),t)}var isTuesday$1={};isTuesday$1.isTuesday=isTuesday;var _index$1a=toDate$2;function isTuesday(e,t){return 2===(0,_index$1a.toDate)(e,t?.in).getDay()}var isWednesday$1={};isWednesday$1.isWednesday=isWednesday;var _index$19=toDate$2;function isWednesday(e,t){return 3===(0,_index$19.toDate)(e,t?.in).getDay()}var isWithinInterval$1={};isWithinInterval$1.isWithinInterval=isWithinInterval;var _index$18=toDate$2;function isWithinInterval(e,t,n){const o=+(0,_index$18.toDate)(e,n?.in),[r,i]=[+(0,_index$18.toDate)(t.start,n?.in),+(0,_index$18.toDate)(t.end,n?.in)].sort(((e,t)=>e-t));return o>=r&&o<=i}var isYesterday$1={},subDays$1={};subDays$1.subDays=subDays;var _index$17=addDays$1;function subDays(e,t,n){return(0,_index$17.addDays)(e,-t,n)}isYesterday$1.isYesterday=isYesterday;var _index$16=constructFrom$2,_index2$e=constructNow$1,_index3$8=isSameDay$1,_index4$1=subDays$1;function isYesterday(e,t){return(0,_index3$8.isSameDay)((0,_index$16.constructFrom)(t?.in||e,e),(0,_index4$1.subDays)((0,_index2$e.constructNow)(t?.in||e),1))}var lastDayOfDecade$1={};lastDayOfDecade$1.lastDayOfDecade=lastDayOfDecade;var _index$15=toDate$2;function lastDayOfDecade(e,t){const n=(0,_index$15.toDate)(e,t?.in),o=n.getFullYear(),r=9+10*Math.floor(o/10);return n.setFullYear(r+1,0,0),n.setHours(0,0,0,0),(0,_index$15.toDate)(n,t?.in)}var lastDayOfISOWeek$1={},lastDayOfWeek$1={};lastDayOfWeek$1.lastDayOfWeek=lastDayOfWeek;var _index$14=defaultOptions$3,_index2$d=toDate$2;function lastDayOfWeek(e,t){const n=(0,_index$14.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=(0,_index2$d.toDate)(e,t?.in),i=r.getDay(),a=6+(i<o?-7:0)-(i-o);return r.setHours(0,0,0,0),r.setDate(r.getDate()+a),r}lastDayOfISOWeek$1.lastDayOfISOWeek=lastDayOfISOWeek;var _index$13=lastDayOfWeek$1;function lastDayOfISOWeek(e,t){return(0,_index$13.lastDayOfWeek)(e,{...t,weekStartsOn:1})}var lastDayOfISOWeekYear$1={};lastDayOfISOWeekYear$1.lastDayOfISOWeekYear=lastDayOfISOWeekYear;var _index$12=constructFrom$2,_index2$c=getISOWeekYear$2,_index3$7=startOfISOWeek$2;function lastDayOfISOWeekYear(e,t){const n=(0,_index2$c.getISOWeekYear)(e,t),o=(0,_index$12.constructFrom)(t?.in||e,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);const r=(0,_index3$7.startOfISOWeek)(o,t);return r.setDate(r.getDate()-1),r}var lastDayOfQuarter$1={};lastDayOfQuarter$1.lastDayOfQuarter=lastDayOfQuarter;var _index$11=toDate$2;function lastDayOfQuarter(e,t){const n=(0,_index$11.toDate)(e,t?.in),o=n.getMonth(),r=o-o%3+3;return n.setMonth(r,0),n.setHours(0,0,0,0),n}var lastDayOfYear$1={};lastDayOfYear$1.lastDayOfYear=lastDayOfYear;var _index$10=toDate$2;function lastDayOfYear(e,t){const n=(0,_index$10.toDate)(e,t?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(0,0,0,0),n}var lightFormat={};!function(e){e.lightFormat=function(e,c){const l=(0,o.toDate)(e);if(!(0,n.isValid)(l))throw new RangeError("Invalid time value");const u=c.match(r);if(!u)return"";return u.map((e=>{if("''"===e)return"'";const n=e[0];if("'"===n)return function(e){const t=e.match(i);return t?t[1].replace(a,"'"):e}(e);const o=t.lightFormatters[n];if(o)return o(l,e);if(n.match(s))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return e})).join("")},Object.defineProperty(e,"lightFormatters",{enumerable:!0,get:function(){return t.lightFormatters}});var t=lightFormatters$1,n=isValid$2,o=toDate$2;const r=/(\w)\1*|''|'(''|[^'])+('|$)|./g,i=/^'([^]*?)'?$/,a=/''/g,s=/[a-zA-Z]/}(lightFormat);var milliseconds$1={};milliseconds$1.milliseconds=milliseconds;var _index$$=constants$1;function milliseconds({years:e,months:t,weeks:n,days:o,hours:r,minutes:i,seconds:a}){let s=0;e&&(s+=e*_index$$.daysInYear),t&&(s+=t*(_index$$.daysInYear/12)),n&&(s+=7*n),o&&(s+=o);let c=24*s*60*60;return r&&(c+=60*r*60),i&&(c+=60*i),a&&(c+=a),Math.trunc(1e3*c)}var millisecondsToHours$1={};millisecondsToHours$1.millisecondsToHours=millisecondsToHours;var _index$_=constants$1;function millisecondsToHours(e){const t=e/_index$_.millisecondsInHour;return Math.trunc(t)}var millisecondsToMinutes$1={};millisecondsToMinutes$1.millisecondsToMinutes=millisecondsToMinutes;var _index$Z=constants$1;function millisecondsToMinutes(e){const t=e/_index$Z.millisecondsInMinute;return Math.trunc(t)}var millisecondsToSeconds$1={};millisecondsToSeconds$1.millisecondsToSeconds=millisecondsToSeconds;var _index$Y=constants$1;function millisecondsToSeconds(e){const t=e/_index$Y.millisecondsInSecond;return Math.trunc(t)}var minutesToHours$1={};minutesToHours$1.minutesToHours=minutesToHours;var _index$X=constants$1;function minutesToHours(e){const t=e/_index$X.minutesInHour;return Math.trunc(t)}var minutesToMilliseconds$1={};minutesToMilliseconds$1.minutesToMilliseconds=minutesToMilliseconds;var _index$W=constants$1;function minutesToMilliseconds(e){return Math.trunc(e*_index$W.millisecondsInMinute)}var minutesToSeconds$1={};minutesToSeconds$1.minutesToSeconds=minutesToSeconds;var _index$V=constants$1;function minutesToSeconds(e){return Math.trunc(e*_index$V.secondsInMinute)}var monthsToQuarters$1={};monthsToQuarters$1.monthsToQuarters=monthsToQuarters;var _index$U=constants$1;function monthsToQuarters(e){const t=e/_index$U.monthsInQuarter;return Math.trunc(t)}var monthsToYears$1={};monthsToYears$1.monthsToYears=monthsToYears;var _index$T=constants$1;function monthsToYears(e){const t=e/_index$T.monthsInYear;return Math.trunc(t)}var nextDay$1={};nextDay$1.nextDay=nextDay;var _index$S=addDays$1,_index2$b=getDay$1;function nextDay(e,t,n){let o=t-(0,_index2$b.getDay)(e,n);return o<=0&&(o+=7),(0,_index$S.addDays)(e,o,n)}var nextFriday$1={};nextFriday$1.nextFriday=nextFriday;var _index$R=nextDay$1;function nextFriday(e,t){return(0,_index$R.nextDay)(e,5,t)}var nextMonday$1={};nextMonday$1.nextMonday=nextMonday;var _index$Q=nextDay$1;function nextMonday(e,t){return(0,_index$Q.nextDay)(e,1,t)}var nextSaturday$1={};nextSaturday$1.nextSaturday=nextSaturday;var _index$P=nextDay$1;function nextSaturday(e,t){return(0,_index$P.nextDay)(e,6,t)}var nextSunday$1={};nextSunday$1.nextSunday=nextSunday;var _index$O=nextDay$1;function nextSunday(e,t){return(0,_index$O.nextDay)(e,0,t)}var nextThursday$1={};nextThursday$1.nextThursday=nextThursday;var _index$N=nextDay$1;function nextThursday(e,t){return(0,_index$N.nextDay)(e,4,t)}var nextTuesday$1={};nextTuesday$1.nextTuesday=nextTuesday;var _index$M=nextDay$1;function nextTuesday(e,t){return(0,_index$M.nextDay)(e,2,t)}var nextWednesday$1={};nextWednesday$1.nextWednesday=nextWednesday;var _index$L=nextDay$1;function nextWednesday(e,t){return(0,_index$L.nextDay)(e,3,t)}var parseISO$1={};parseISO$1.parseISO=parseISO;var _index$K=constants$1,_index2$a=constructFrom$2,_index3$6=toDate$2;function parseISO(e,t){const n=()=>(0,_index2$a.constructFrom)(t?.in,NaN),o=t?.additionalDigits??2,r=splitDateString(e);let i;if(r.date){const e=parseYear(r.date,o);i=parseDate(e.restDateString,e.year)}if(!i||isNaN(+i))return n();const a=+i;let s,c=0;if(r.time&&(c=parseTime(r.time),isNaN(c)))return n();if(!r.timezone){const e=new Date(a+c),n=(0,_index3$6.toDate)(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return s=parseTimezone(r.timezone),isNaN(s)?n():(0,_index3$6.toDate)(a+c+s,t?.in)}const patterns={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dateRegex=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,timeRegex=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,timezoneRegex=/^([+-])(\d{2})(?::?(\d{2}))?$/;function splitDateString(e){const t={},n=e.split(patterns.dateTimeDelimiter);let o;if(n.length>2)return t;if(/:/.test(n[0])?o=n[0]:(t.date=n[0],o=n[1],patterns.timeZoneDelimiter.test(t.date)&&(t.date=e.split(patterns.timeZoneDelimiter)[0],o=e.substr(t.date.length,e.length))),o){const e=patterns.timezone.exec(o);e?(t.time=o.replace(e[1],""),t.timezone=e[1]):t.time=o}return t}function parseYear(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};const r=o[1]?parseInt(o[1]):null,i=o[2]?parseInt(o[2]):null;return{year:null===i?r:100*i,restDateString:e.slice((o[1]||o[2]).length)}}function parseDate(e,t){if(null===t)return new Date(NaN);const n=e.match(dateRegex);if(!n)return new Date(NaN);const o=!!n[4],r=parseDateUnit(n[1]),i=parseDateUnit(n[2])-1,a=parseDateUnit(n[3]),s=parseDateUnit(n[4]),c=parseDateUnit(n[5])-1;if(o)return validateWeekDate(t,s,c)?dayOfISOWeekYear(t,s,c):new Date(NaN);{const e=new Date(0);return validateDate(t,i,a)&&validateDayOfYearDate(t,r)?(e.setUTCFullYear(t,i,Math.max(r,a)),e):new Date(NaN)}}function parseDateUnit(e){return e?parseInt(e):1}function parseTime(e){const t=e.match(timeRegex);if(!t)return NaN;const n=parseTimeUnit(t[1]),o=parseTimeUnit(t[2]),r=parseTimeUnit(t[3]);return validateTime(n,o,r)?n*_index$K.millisecondsInHour+o*_index$K.millisecondsInMinute+1e3*r:NaN}function parseTimeUnit(e){return e&&parseFloat(e.replace(",","."))||0}function parseTimezone(e){if("Z"===e)return 0;const t=e.match(timezoneRegex);if(!t)return 0;const n="+"===t[1]?-1:1,o=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return validateTimezone(o,r)?n*(o*_index$K.millisecondsInHour+r*_index$K.millisecondsInMinute):NaN}function dayOfISOWeekYear(e,t,n){const o=new Date(0);o.setUTCFullYear(e,0,4);const r=7*(t-1)+n+1-(o.getUTCDay()||7);return o.setUTCDate(o.getUTCDate()+r),o}const daysInMonths=[31,null,31,30,31,30,31,31,30,31,30,31];function isLeapYearIndex(e){return e%400==0||e%4==0&&e%100!=0}function validateDate(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(daysInMonths[t]||(isLeapYearIndex(e)?29:28))}function validateDayOfYearDate(e,t){return t>=1&&t<=(isLeapYearIndex(e)?366:365)}function validateWeekDate(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function validateTime(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function validateTimezone(e,t){return t>=0&&t<=59}var parseJSON$1={};parseJSON$1.parseJSON=parseJSON;var _index$J=toDate$2;function parseJSON(e,t){const n=e.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);return n?(0,_index$J.toDate)(Date.UTC(+n[1],+n[2]-1,+n[3],+n[4]-(+n[9]||0)*("-"==n[8]?-1:1),+n[5]-(+n[10]||0)*("-"==n[8]?-1:1),+n[6],+((n[7]||"0")+"00").substring(0,3)),t?.in):(0,_index$J.toDate)(NaN,t?.in)}var previousDay$1={};previousDay$1.previousDay=previousDay;var _index$I=getDay$1,_index2$9=subDays$1;function previousDay(e,t,n){let o=(0,_index$I.getDay)(e,n)-t;return o<=0&&(o+=7),(0,_index2$9.subDays)(e,o,n)}var previousFriday$1={};previousFriday$1.previousFriday=previousFriday;var _index$H=previousDay$1;function previousFriday(e,t){return(0,_index$H.previousDay)(e,5,t)}var previousMonday$1={};previousMonday$1.previousMonday=previousMonday;var _index$G=previousDay$1;function previousMonday(e,t){return(0,_index$G.previousDay)(e,1,t)}var previousSaturday$1={};previousSaturday$1.previousSaturday=previousSaturday;var _index$F=previousDay$1;function previousSaturday(e,t){return(0,_index$F.previousDay)(e,6,t)}var previousSunday$1={};previousSunday$1.previousSunday=previousSunday;var _index$E=previousDay$1;function previousSunday(e,t){return(0,_index$E.previousDay)(e,0,t)}var previousThursday$1={};previousThursday$1.previousThursday=previousThursday;var _index$D=previousDay$1;function previousThursday(e,t){return(0,_index$D.previousDay)(e,4,t)}var previousTuesday$1={};previousTuesday$1.previousTuesday=previousTuesday;var _index$C=previousDay$1;function previousTuesday(e,t){return(0,_index$C.previousDay)(e,2,t)}var previousWednesday$1={};previousWednesday$1.previousWednesday=previousWednesday;var _index$B=previousDay$1;function previousWednesday(e,t){return(0,_index$B.previousDay)(e,3,t)}var quartersToMonths$1={};quartersToMonths$1.quartersToMonths=quartersToMonths;var _index$A=constants$1;function quartersToMonths(e){return Math.trunc(e*_index$A.monthsInQuarter)}var quartersToYears$1={};quartersToYears$1.quartersToYears=quartersToYears;var _index$z=constants$1;function quartersToYears(e){const t=e/_index$z.quartersInYear;return Math.trunc(t)}var roundToNearestHours$1={};roundToNearestHours$1.roundToNearestHours=roundToNearestHours;var _index$y=getRoundingMethod$1,_index2$8=constructFrom$2,_index3$5=toDate$2;function roundToNearestHours(e,t){const n=t?.nearestTo??1;if(n<1||n>12)return(0,_index2$8.constructFrom)(t?.in||e,NaN);const o=(0,_index3$5.toDate)(e,t?.in),r=o.getMinutes()/60,i=o.getSeconds()/60/60,a=o.getMilliseconds()/1e3/60/60,s=o.getHours()+r+i+a,c=t?.roundingMethod??"round",l=(0,_index$y.getRoundingMethod)(c)(s/n)*n;return o.setHours(l,0,0,0),o}var roundToNearestMinutes$1={};roundToNearestMinutes$1.roundToNearestMinutes=roundToNearestMinutes;var _index$x=getRoundingMethod$1,_index2$7=constructFrom$2,_index3$4=toDate$2;function roundToNearestMinutes(e,t){const n=t?.nearestTo??1;if(n<1||n>30)return(0,_index2$7.constructFrom)(e,NaN);const o=(0,_index3$4.toDate)(e,t?.in),r=o.getSeconds()/60,i=o.getMilliseconds()/1e3/60,a=o.getMinutes()+r+i,s=t?.roundingMethod??"round",c=(0,_index$x.getRoundingMethod)(s)(a/n)*n;return o.setMinutes(c,0,0),o}var secondsToHours$1={};secondsToHours$1.secondsToHours=secondsToHours;var _index$w=constants$1;function secondsToHours(e){const t=e/_index$w.secondsInHour;return Math.trunc(t)}var secondsToMilliseconds$1={};secondsToMilliseconds$1.secondsToMilliseconds=secondsToMilliseconds;var _index$v=constants$1;function secondsToMilliseconds(e){return e*_index$v.millisecondsInSecond}var secondsToMinutes$1={};secondsToMinutes$1.secondsToMinutes=secondsToMinutes;var _index$u=constants$1;function secondsToMinutes(e){const t=e/_index$u.secondsInMinute;return Math.trunc(t)}var set$2={},setMonth$1={};setMonth$1.setMonth=setMonth;var _index$t=constructFrom$2,_index2$6=getDaysInMonth$1,_index3$3=toDate$2;function setMonth(e,t,n){const o=(0,_index3$3.toDate)(e,n?.in),r=o.getFullYear(),i=o.getDate(),a=(0,_index$t.constructFrom)(n?.in||e,0);a.setFullYear(r,t,15),a.setHours(0,0,0,0);const s=(0,_index2$6.getDaysInMonth)(a);return o.setMonth(t,Math.min(i,s)),o}set$2.set=set$1;var _index$s=constructFrom$2,_index2$5=setMonth$1,_index3$2=toDate$2;function set$1(e,t,n){let o=(0,_index3$2.toDate)(e,n?.in);return isNaN(+o)?(0,_index$s.constructFrom)(n?.in||e,NaN):(null!=t.year&&o.setFullYear(t.year),null!=t.month&&(o=(0,_index2$5.setMonth)(o,t.month)),null!=t.date&&o.setDate(t.date),null!=t.hours&&o.setHours(t.hours),null!=t.minutes&&o.setMinutes(t.minutes),null!=t.seconds&&o.setSeconds(t.seconds),null!=t.milliseconds&&o.setMilliseconds(t.milliseconds),o)}var setDate$1={};setDate$1.setDate=setDate;var _index$r=toDate$2;function setDate(e,t,n){const o=(0,_index$r.toDate)(e,n?.in);return o.setDate(t),o}var setDayOfYear$1={};setDayOfYear$1.setDayOfYear=setDayOfYear;var _index$q=toDate$2;function setDayOfYear(e,t,n){const o=(0,_index$q.toDate)(e,n?.in);return o.setMonth(0),o.setDate(t),o}var setDefaultOptions$1={};setDefaultOptions$1.setDefaultOptions=setDefaultOptions;var _index$p=defaultOptions$3;function setDefaultOptions(e){const t={},n=(0,_index$p.getDefaultOptions)();for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(void 0===e[n]?delete t[n]:t[n]=e[n]);(0,_index$p.setDefaultOptions)(t)}var setHours$1={};setHours$1.setHours=setHours;var _index$o=toDate$2;function setHours(e,t,n){const o=(0,_index$o.toDate)(e,n?.in);return o.setHours(t),o}var setMilliseconds$1={};setMilliseconds$1.setMilliseconds=setMilliseconds;var _index$n=toDate$2;function setMilliseconds(e,t,n){const o=(0,_index$n.toDate)(e,n?.in);return o.setMilliseconds(t),o}var setMinutes$1={};setMinutes$1.setMinutes=setMinutes;var _index$m=toDate$2;function setMinutes(e,t,n){const o=(0,_index$m.toDate)(e,n?.in);return o.setMinutes(t),o}var setQuarter$1={};setQuarter$1.setQuarter=setQuarter;var _index$l=setMonth$1,_index2$4=toDate$2;function setQuarter(e,t,n){const o=(0,_index2$4.toDate)(e,n?.in),r=t-(Math.trunc(o.getMonth()/3)+1);return(0,_index$l.setMonth)(o,o.getMonth()+3*r)}var setSeconds$1={};setSeconds$1.setSeconds=setSeconds;var _index$k=toDate$2;function setSeconds(e,t,n){const o=(0,_index$k.toDate)(e,n?.in);return o.setSeconds(t),o}var setWeekYear$1={};setWeekYear$1.setWeekYear=setWeekYear;var _index$j=defaultOptions$3,_index2$3=constructFrom$2,_index3$1=differenceInCalendarDays$2,_index4=startOfWeekYear$2,_index5=toDate$2;function setWeekYear(e,t,n){const o=(0,_index$j.getDefaultOptions)(),r=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=(0,_index3$1.differenceInCalendarDays)((0,_index5.toDate)(e,n?.in),(0,_index4.startOfWeekYear)(e,n),n),a=(0,_index2$3.constructFrom)(n?.in||e,0);a.setFullYear(t,0,r),a.setHours(0,0,0,0);const s=(0,_index4.startOfWeekYear)(a,n);return s.setDate(s.getDate()+i),s}var setYear$1={};setYear$1.setYear=setYear;var _index$i=constructFrom$2,_index2$2=toDate$2;function setYear(e,t,n){const o=(0,_index2$2.toDate)(e,n?.in);return isNaN(+o)?(0,_index$i.constructFrom)(n?.in||e,NaN):(o.setFullYear(t),o)}var startOfDecade$1={};startOfDecade$1.startOfDecade=startOfDecade;var _index$h=toDate$2;function startOfDecade(e,t){const n=(0,_index$h.toDate)(e,t?.in),o=n.getFullYear(),r=10*Math.floor(o/10);return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}var startOfToday$1={};startOfToday$1.startOfToday=startOfToday;var _index$g=startOfDay$2;function startOfToday(e){return(0,_index$g.startOfDay)(Date.now(),e)}var startOfTomorrow$1={};startOfTomorrow$1.startOfTomorrow=startOfTomorrow;var _index$f=constructFrom$2,_index2$1=constructNow$1;function startOfTomorrow(e){const t=(0,_index2$1.constructNow)(e?.in),n=t.getFullYear(),o=t.getMonth(),r=t.getDate(),i=(0,_index$f.constructFrom)(e?.in,0);return i.setFullYear(n,o,r+1),i.setHours(0,0,0,0),i}var startOfYesterday$1={};startOfYesterday$1.startOfYesterday=startOfYesterday;var _index$e=constructNow$1;function startOfYesterday(e){const t=(0,_index$e.constructNow)(e?.in),n=t.getFullYear(),o=t.getMonth(),r=t.getDate(),i=(0,_index$e.constructNow)(e?.in);return i.setFullYear(n,o,r-1),i.setHours(0,0,0,0),i}var sub$1={},subMonths$1={};subMonths$1.subMonths=subMonths;var _index$d=addMonths$1;function subMonths(e,t,n){return(0,_index$d.addMonths)(e,-t,n)}sub$1.sub=sub;var _index$c=constructFrom$2,_index2=subDays$1,_index3=subMonths$1;function sub(e,t,n){const{years:o=0,months:r=0,weeks:i=0,days:a=0,hours:s=0,minutes:c=0,seconds:l=0}=t,u=(0,_index3.subMonths)(e,r+12*o,n),d=(0,_index2.subDays)(u,a+7*i,n),p=1e3*(l+60*(c+60*s));return(0,_index$c.constructFrom)(n?.in||e,+d-p)}var subBusinessDays$1={};subBusinessDays$1.subBusinessDays=subBusinessDays;var _index$b=addBusinessDays$1;function subBusinessDays(e,t,n){return(0,_index$b.addBusinessDays)(e,-t,n)}var subHours$1={};subHours$1.subHours=subHours;var _index$a=addHours$1;function subHours(e,t,n){return(0,_index$a.addHours)(e,-t,n)}var subMilliseconds$1={};subMilliseconds$1.subMilliseconds=subMilliseconds;var _index$9=addMilliseconds$1;function subMilliseconds(e,t,n){return(0,_index$9.addMilliseconds)(e,-t,n)}var subMinutes$1={};subMinutes$1.subMinutes=subMinutes;var _index$8=addMinutes$1;function subMinutes(e,t,n){return(0,_index$8.addMinutes)(e,-t,n)}var subQuarters$1={};subQuarters$1.subQuarters=subQuarters;var _index$7=addQuarters$1;function subQuarters(e,t,n){return(0,_index$7.addQuarters)(e,-t,n)}var subSeconds$1={};subSeconds$1.subSeconds=subSeconds;var _index$6=addSeconds$1;function subSeconds(e,t,n){return(0,_index$6.addSeconds)(e,-t,n)}var subWeeks$1={};subWeeks$1.subWeeks=subWeeks;var _index$5=addWeeks$1;function subWeeks(e,t,n){return(0,_index$5.addWeeks)(e,-t,n)}var subYears$1={};subYears$1.subYears=subYears;var _index$4=addYears$1;function subYears(e,t,n){return(0,_index$4.addYears)(e,-t,n)}var weeksToDays$1={};weeksToDays$1.weeksToDays=weeksToDays;var _index$3=constants$1;function weeksToDays(e){return Math.trunc(e*_index$3.daysInWeek)}var yearsToDays$1={};yearsToDays$1.yearsToDays=yearsToDays;var _index$2=constants$1;function yearsToDays(e){return Math.trunc(e*_index$2.daysInYear)}var yearsToMonths$1={};yearsToMonths$1.yearsToMonths=yearsToMonths;var _index$1=constants$1;function yearsToMonths(e){return Math.trunc(e*_index$1.monthsInYear)}var yearsToQuarters$1={};yearsToQuarters$1.yearsToQuarters=yearsToQuarters;var _index=constants$1;function yearsToQuarters(e){return Math.trunc(e*_index.quartersInYear)}!function(e){var t=add$1;Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))}));var n=addBusinessDays$1;Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))}));var o=addDays$1;Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var r=addHours$1;Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===r[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}}))}));var i=addISOWeekYears$1;Object.keys(i).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===i[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}}))}));var a=addMilliseconds$1;Object.keys(a).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===a[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}}))}));var s=addMinutes$1;Object.keys(s).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===s[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}}))}));var c=addMonths$1;Object.keys(c).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===c[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return c[t]}}))}));var l=addQuarters$1;Object.keys(l).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===l[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}}))}));var u=addSeconds$1;Object.keys(u).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===u[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}}))}));var d=addWeeks$1;Object.keys(d).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===d[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return d[t]}}))}));var p=addYears$1;Object.keys(p).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===p[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return p[t]}}))}));var m=areIntervalsOverlapping$1;Object.keys(m).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===m[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return m[t]}}))}));var f=clamp$1;Object.keys(f).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===f[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}}))}));var h=closestIndexTo$1;Object.keys(h).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===h[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}}))}));var g=closestTo$1;Object.keys(g).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===g[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return g[t]}}))}));var _=compareAsc$1;Object.keys(_).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===_[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return _[t]}}))}));var $=compareDesc$1;Object.keys($).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===$[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return $[t]}}))}));var b=constructFrom$2;Object.keys(b).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===b[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return b[t]}}))}));var y=constructNow$1;Object.keys(y).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===y[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return y[t]}}))}));var v=daysToWeeks$1;Object.keys(v).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===v[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return v[t]}}))}));var x=differenceInBusinessDays$1;Object.keys(x).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===x[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return x[t]}}))}));var w=differenceInCalendarDays$2;Object.keys(w).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===w[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return w[t]}}))}));var C=differenceInCalendarISOWeekYears$1;Object.keys(C).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===C[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return C[t]}}))}));var k=differenceInCalendarISOWeeks$1;Object.keys(k).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===k[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return k[t]}}))}));var S=differenceInCalendarMonths$1;Object.keys(S).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===S[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return S[t]}}))}));var T=differenceInCalendarQuarters$1;Object.keys(T).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===T[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return T[t]}}))}));var E=differenceInCalendarWeeks$1;Object.keys(E).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===E[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return E[t]}}))}));var A=differenceInCalendarYears$1;Object.keys(A).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===A[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return A[t]}}))}));var O=differenceInDays$1;Object.keys(O).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===O[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return O[t]}}))}));var N=differenceInHours$1;Object.keys(N).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===N[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return N[t]}}))}));var I=differenceInISOWeekYears$1;Object.keys(I).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===I[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return I[t]}}))}));var D=differenceInMilliseconds$1;Object.keys(D).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===D[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return D[t]}}))}));var M=differenceInMinutes$1;Object.keys(M).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===M[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return M[t]}}))}));var R=differenceInMonths$1;Object.keys(R).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===R[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return R[t]}}))}));var L=differenceInQuarters$1;Object.keys(L).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===L[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return L[t]}}))}));var F=differenceInSeconds$1;Object.keys(F).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===F[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return F[t]}}))}));var P=differenceInWeeks$1;Object.keys(P).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===P[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return P[t]}}))}));var j=differenceInYears$1;Object.keys(j).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===j[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return j[t]}}))}));var B=eachDayOfInterval$1;Object.keys(B).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===B[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return B[t]}}))}));var q=eachHourOfInterval$1;Object.keys(q).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===q[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return q[t]}}))}));var W=eachMinuteOfInterval$1;Object.keys(W).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===W[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return W[t]}}))}));var z=eachMonthOfInterval$1;Object.keys(z).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===z[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return z[t]}}))}));var U=eachQuarterOfInterval$1;Object.keys(U).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===U[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return U[t]}}))}));var H=eachWeekOfInterval$1;Object.keys(H).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===H[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return H[t]}}))}));var V=eachWeekendOfInterval$1;Object.keys(V).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===V[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return V[t]}}))}));var G=eachWeekendOfMonth$1;Object.keys(G).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===G[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return G[t]}}))}));var K=eachWeekendOfYear$1;Object.keys(K).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===K[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return K[t]}}))}));var Y=eachYearOfInterval$1;Object.keys(Y).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Y[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Y[t]}}))}));var Q=endOfDay$1;Object.keys(Q).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Q[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Q[t]}}))}));var Z=endOfDecade$1;Object.keys(Z).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Z[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Z[t]}}))}));var J=endOfHour$1;Object.keys(J).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===J[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return J[t]}}))}));var X=endOfISOWeek$1;Object.keys(X).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===X[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return X[t]}}))}));var ee=endOfISOWeekYear$1;Object.keys(ee).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ee[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ee[t]}}))}));var te=endOfMinute$1;Object.keys(te).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===te[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return te[t]}}))}));var ne=endOfMonth$1;Object.keys(ne).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ne[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ne[t]}}))}));var oe=endOfQuarter$1;Object.keys(oe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===oe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return oe[t]}}))}));var re=endOfSecond$1;Object.keys(re).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===re[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return re[t]}}))}));var ie=endOfToday$1;Object.keys(ie).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ie[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ie[t]}}))}));var ae=endOfTomorrow$1;Object.keys(ae).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ae[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ae[t]}}))}));var se=endOfWeek$1;Object.keys(se).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===se[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return se[t]}}))}));var ce=endOfYear$1;Object.keys(ce).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ce[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ce[t]}}))}));var le=endOfYesterday$1;Object.keys(le).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===le[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return le[t]}}))}));var ue=format$1;Object.keys(ue).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ue[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ue[t]}}))}));var de=formatDistance$2;Object.keys(de).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===de[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return de[t]}}))}));var pe=formatDistanceStrict$1;Object.keys(pe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===pe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return pe[t]}}))}));var me=formatDistanceToNow$1;Object.keys(me).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===me[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return me[t]}}))}));var fe=formatDistanceToNowStrict$1;Object.keys(fe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===fe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return fe[t]}}))}));var he=formatDuration$2;Object.keys(he).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===he[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return he[t]}}))}));var ge=formatISO$1;Object.keys(ge).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ge[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ge[t]}}))}));var _e=formatISO9075$1;Object.keys(_e).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===_e[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return _e[t]}}))}));var $e=formatISODuration$1;Object.keys($e).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===$e[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return $e[t]}}))}));var be=formatRFC3339$1;Object.keys(be).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===be[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return be[t]}}))}));var ye=formatRFC7231$1;Object.keys(ye).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ye[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ye[t]}}))}));var ve=formatRelative$2;Object.keys(ve).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ve[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ve[t]}}))}));var xe=fromUnixTime$1;Object.keys(xe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===xe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return xe[t]}}))}));var we=getDate$1;Object.keys(we).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===we[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return we[t]}}))}));var Ce=getDay$1;Object.keys(Ce).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ce[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ce[t]}}))}));var ke=getDayOfYear$2;Object.keys(ke).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ke[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ke[t]}}))}));var Se=getDaysInMonth$1;Object.keys(Se).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Se[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Se[t]}}))}));var Te=getDaysInYear$1;Object.keys(Te).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Te[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Te[t]}}))}));var Ee=getDecade$1;Object.keys(Ee).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ee[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ee[t]}}))}));var Ae=getDefaultOptions$2;Object.keys(Ae).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ae[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ae[t]}}))}));var Oe=getHours$1;Object.keys(Oe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Oe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Oe[t]}}))}));var Ne=getISODay$1;Object.keys(Ne).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ne[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ne[t]}}))}));var Ie=getISOWeek$2;Object.keys(Ie).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ie[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ie[t]}}))}));var De=getISOWeekYear$2;Object.keys(De).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===De[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return De[t]}}))}));var Me=getISOWeeksInYear$1;Object.keys(Me).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Me[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Me[t]}}))}));var Re=getMilliseconds$1;Object.keys(Re).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Re[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Re[t]}}))}));var Le=getMinutes$1;Object.keys(Le).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Le[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Le[t]}}))}));var Fe=getMonth$1;Object.keys(Fe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Fe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Fe[t]}}))}));var Pe=getOverlappingDaysInIntervals$1;Object.keys(Pe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Pe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Pe[t]}}))}));var je=getQuarter$1;Object.keys(je).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===je[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return je[t]}}))}));var Be=getSeconds$1;Object.keys(Be).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Be[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Be[t]}}))}));var qe=getTime$1;Object.keys(qe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===qe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return qe[t]}}))}));var We=getUnixTime$1;Object.keys(We).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===We[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return We[t]}}))}));var ze=getWeek$2;Object.keys(ze).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ze[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ze[t]}}))}));var Ue=getWeekOfMonth$1;Object.keys(Ue).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ue[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ue[t]}}))}));var He=getWeekYear$2;Object.keys(He).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===He[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return He[t]}}))}));var Ve=getWeeksInMonth$1;Object.keys(Ve).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ve[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ve[t]}}))}));var Ge=getYear$1;Object.keys(Ge).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ge[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ge[t]}}))}));var Ke=hoursToMilliseconds$1;Object.keys(Ke).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ke[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ke[t]}}))}));var Ye=hoursToMinutes$1;Object.keys(Ye).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ye[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ye[t]}}))}));var Qe=hoursToSeconds$1;Object.keys(Qe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Qe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Qe[t]}}))}));var Ze=interval$1;Object.keys(Ze).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ze[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ze[t]}}))}));var Je=intervalToDuration$1;Object.keys(Je).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Je[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Je[t]}}))}));var Xe=intlFormat$1;Object.keys(Xe).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Xe[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Xe[t]}}))}));var et=intlFormatDistance$1;Object.keys(et).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===et[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return et[t]}}))}));var tt=isAfter$1;Object.keys(tt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===tt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return tt[t]}}))}));var nt=isBefore$1;Object.keys(nt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===nt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return nt[t]}}))}));var ot=isDate$2;Object.keys(ot).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ot[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ot[t]}}))}));var rt=isEqual$1;Object.keys(rt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===rt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return rt[t]}}))}));var it=isExists$1;Object.keys(it).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===it[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return it[t]}}))}));var at=isFirstDayOfMonth$1;Object.keys(at).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===at[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return at[t]}}))}));var st=isFriday$1;Object.keys(st).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===st[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return st[t]}}))}));var ct=isFuture$1;Object.keys(ct).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ct[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ct[t]}}))}));var lt=isLastDayOfMonth$1;Object.keys(lt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===lt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return lt[t]}}))}));var ut=isLeapYear$1;Object.keys(ut).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ut[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ut[t]}}))}));var dt=isMatch$1;Object.keys(dt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===dt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return dt[t]}}))}));var pt=isMonday$1;Object.keys(pt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===pt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return pt[t]}}))}));var mt=isPast$1;Object.keys(mt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===mt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return mt[t]}}))}));var ft=isSameDay$1;Object.keys(ft).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ft[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ft[t]}}))}));var ht=isSameHour$1;Object.keys(ht).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ht[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ht[t]}}))}));var gt=isSameISOWeek$1;Object.keys(gt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===gt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return gt[t]}}))}));var _t=isSameISOWeekYear$1;Object.keys(_t).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===_t[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return _t[t]}}))}));var $t=isSameMinute$1;Object.keys($t).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===$t[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return $t[t]}}))}));var bt=isSameMonth$1;Object.keys(bt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===bt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return bt[t]}}))}));var yt=isSameQuarter$1;Object.keys(yt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===yt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return yt[t]}}))}));var vt=isSameSecond$1;Object.keys(vt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===vt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return vt[t]}}))}));var xt=isSameWeek$1;Object.keys(xt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===xt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return xt[t]}}))}));var wt=isSameYear$1;Object.keys(wt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===wt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return wt[t]}}))}));var Ct=isSaturday$1;Object.keys(Ct).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ct[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ct[t]}}))}));var kt=isSunday$1;Object.keys(kt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===kt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return kt[t]}}))}));var St=isThisHour$1;Object.keys(St).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===St[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return St[t]}}))}));var Tt=isThisISOWeek$1;Object.keys(Tt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Tt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Tt[t]}}))}));var Et=isThisMinute$1;Object.keys(Et).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Et[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Et[t]}}))}));var At=isThisMonth$1;Object.keys(At).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===At[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return At[t]}}))}));var Ot=isThisQuarter$1;Object.keys(Ot).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ot[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ot[t]}}))}));var Nt=isThisSecond$1;Object.keys(Nt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Nt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Nt[t]}}))}));var It=isThisWeek$1;Object.keys(It).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===It[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return It[t]}}))}));var Dt=isThisYear$1;Object.keys(Dt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Dt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Dt[t]}}))}));var Mt=isThursday$1;Object.keys(Mt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Mt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Mt[t]}}))}));var Rt=isToday$1;Object.keys(Rt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Rt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Rt[t]}}))}));var Lt=isTomorrow$1;Object.keys(Lt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Lt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Lt[t]}}))}));var Ft=isTuesday$1;Object.keys(Ft).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ft[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ft[t]}}))}));var Pt=isValid$2;Object.keys(Pt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Pt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Pt[t]}}))}));var jt=isWednesday$1;Object.keys(jt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===jt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return jt[t]}}))}));var Bt=isWeekend$1;Object.keys(Bt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Bt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Bt[t]}}))}));var qt=isWithinInterval$1;Object.keys(qt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===qt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return qt[t]}}))}));var Wt=isYesterday$1;Object.keys(Wt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Wt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Wt[t]}}))}));var zt=lastDayOfDecade$1;Object.keys(zt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===zt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return zt[t]}}))}));var Ut=lastDayOfISOWeek$1;Object.keys(Ut).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ut[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ut[t]}}))}));var Ht=lastDayOfISOWeekYear$1;Object.keys(Ht).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ht[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ht[t]}}))}));var Vt=lastDayOfMonth$1;Object.keys(Vt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Vt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Vt[t]}}))}));var Gt=lastDayOfQuarter$1;Object.keys(Gt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Gt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Gt[t]}}))}));var Kt=lastDayOfWeek$1;Object.keys(Kt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Kt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Kt[t]}}))}));var Yt=lastDayOfYear$1;Object.keys(Yt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Yt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Yt[t]}}))}));var Qt=lightFormat;Object.keys(Qt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Qt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Qt[t]}}))}));var Zt=max$2;Object.keys(Zt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Zt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Zt[t]}}))}));var Jt=milliseconds$1;Object.keys(Jt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Jt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Jt[t]}}))}));var Xt=millisecondsToHours$1;Object.keys(Xt).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Xt[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Xt[t]}}))}));var en=millisecondsToMinutes$1;Object.keys(en).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===en[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return en[t]}}))}));var tn=millisecondsToSeconds$1;Object.keys(tn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===tn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return tn[t]}}))}));var nn=min$1;Object.keys(nn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===nn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return nn[t]}}))}));var on=minutesToHours$1;Object.keys(on).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===on[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return on[t]}}))}));var rn=minutesToMilliseconds$1;Object.keys(rn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===rn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return rn[t]}}))}));var an=minutesToSeconds$1;Object.keys(an).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===an[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return an[t]}}))}));var sn=monthsToQuarters$1;Object.keys(sn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===sn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return sn[t]}}))}));var cn=monthsToYears$1;Object.keys(cn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===cn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return cn[t]}}))}));var ln=nextDay$1;Object.keys(ln).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ln[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ln[t]}}))}));var un=nextFriday$1;Object.keys(un).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===un[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return un[t]}}))}));var dn=nextMonday$1;Object.keys(dn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===dn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return dn[t]}}))}));var pn=nextSaturday$1;Object.keys(pn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===pn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return pn[t]}}))}));var mn=nextSunday$1;Object.keys(mn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===mn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return mn[t]}}))}));var fn=nextThursday$1;Object.keys(fn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===fn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return fn[t]}}))}));var hn=nextTuesday$1;Object.keys(hn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===hn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return hn[t]}}))}));var gn=nextWednesday$1;Object.keys(gn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===gn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return gn[t]}}))}));var _n=parse$2;Object.keys(_n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===_n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return _n[t]}}))}));var $n=parseISO$1;Object.keys($n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===$n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return $n[t]}}))}));var bn=parseJSON$1;Object.keys(bn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===bn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return bn[t]}}))}));var yn=previousDay$1;Object.keys(yn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===yn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return yn[t]}}))}));var vn=previousFriday$1;Object.keys(vn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===vn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return vn[t]}}))}));var xn=previousMonday$1;Object.keys(xn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===xn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return xn[t]}}))}));var wn=previousSaturday$1;Object.keys(wn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===wn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return wn[t]}}))}));var Cn=previousSunday$1;Object.keys(Cn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Cn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Cn[t]}}))}));var kn=previousThursday$1;Object.keys(kn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===kn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return kn[t]}}))}));var Sn=previousTuesday$1;Object.keys(Sn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Sn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Sn[t]}}))}));var Tn=previousWednesday$1;Object.keys(Tn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Tn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Tn[t]}}))}));var En=quartersToMonths$1;Object.keys(En).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===En[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return En[t]}}))}));var An=quartersToYears$1;Object.keys(An).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===An[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return An[t]}}))}));var On=roundToNearestHours$1;Object.keys(On).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===On[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return On[t]}}))}));var Nn=roundToNearestMinutes$1;Object.keys(Nn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Nn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Nn[t]}}))}));var In=secondsToHours$1;Object.keys(In).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===In[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return In[t]}}))}));var Dn=secondsToMilliseconds$1;Object.keys(Dn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Dn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Dn[t]}}))}));var Mn=secondsToMinutes$1;Object.keys(Mn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Mn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Mn[t]}}))}));var Rn=set$2;Object.keys(Rn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Rn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Rn[t]}}))}));var Ln=setDate$1;Object.keys(Ln).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ln[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ln[t]}}))}));var Fn=setDay$1;Object.keys(Fn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Fn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Fn[t]}}))}));var Pn=setDayOfYear$1;Object.keys(Pn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Pn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Pn[t]}}))}));var jn=setDefaultOptions$1;Object.keys(jn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===jn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return jn[t]}}))}));var Bn=setHours$1;Object.keys(Bn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Bn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Bn[t]}}))}));var qn=setISODay$1;Object.keys(qn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===qn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return qn[t]}}))}));var Wn=setISOWeek$1;Object.keys(Wn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Wn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Wn[t]}}))}));var zn=setISOWeekYear$1;Object.keys(zn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===zn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return zn[t]}}))}));var Un=setMilliseconds$1;Object.keys(Un).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Un[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Un[t]}}))}));var Hn=setMinutes$1;Object.keys(Hn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Hn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Hn[t]}}))}));var Vn=setMonth$1;Object.keys(Vn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Vn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Vn[t]}}))}));var Gn=setQuarter$1;Object.keys(Gn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Gn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Gn[t]}}))}));var Kn=setSeconds$1;Object.keys(Kn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Kn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Kn[t]}}))}));var Yn=setWeek$1;Object.keys(Yn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Yn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Yn[t]}}))}));var Qn=setWeekYear$1;Object.keys(Qn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Qn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Qn[t]}}))}));var Zn=setYear$1;Object.keys(Zn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Zn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Zn[t]}}))}));var Jn=startOfDay$2;Object.keys(Jn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Jn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Jn[t]}}))}));var Xn=startOfDecade$1;Object.keys(Xn).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Xn[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Xn[t]}}))}));var eo=startOfHour$1;Object.keys(eo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===eo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return eo[t]}}))}));var to=startOfISOWeek$2;Object.keys(to).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===to[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return to[t]}}))}));var no=startOfISOWeekYear$2;Object.keys(no).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===no[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return no[t]}}))}));var oo=startOfMinute$1;Object.keys(oo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===oo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return oo[t]}}))}));var ro=startOfMonth$1;Object.keys(ro).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ro[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ro[t]}}))}));var io=startOfQuarter$1;Object.keys(io).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===io[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return io[t]}}))}));var ao=startOfSecond$1;Object.keys(ao).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ao[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ao[t]}}))}));var so=startOfToday$1;Object.keys(so).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===so[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return so[t]}}))}));var co=startOfTomorrow$1;Object.keys(co).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===co[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return co[t]}}))}));var lo=startOfWeek$2;Object.keys(lo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===lo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return lo[t]}}))}));var uo=startOfWeekYear$2;Object.keys(uo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===uo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return uo[t]}}))}));var po=startOfYear$2;Object.keys(po).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===po[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return po[t]}}))}));var mo=startOfYesterday$1;Object.keys(mo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===mo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return mo[t]}}))}));var fo=sub$1;Object.keys(fo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===fo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return fo[t]}}))}));var ho=subBusinessDays$1;Object.keys(ho).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ho[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ho[t]}}))}));var go=subDays$1;Object.keys(go).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===go[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return go[t]}}))}));var _o=subHours$1;Object.keys(_o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===_o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return _o[t]}}))}));var $o=subISOWeekYears$1;Object.keys($o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===$o[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return $o[t]}}))}));var bo=subMilliseconds$1;Object.keys(bo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===bo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return bo[t]}}))}));var yo=subMinutes$1;Object.keys(yo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===yo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return yo[t]}}))}));var vo=subMonths$1;Object.keys(vo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===vo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return vo[t]}}))}));var xo=subQuarters$1;Object.keys(xo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===xo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return xo[t]}}))}));var wo=subSeconds$1;Object.keys(wo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===wo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return wo[t]}}))}));var Co=subWeeks$1;Object.keys(Co).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Co[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Co[t]}}))}));var ko=subYears$1;Object.keys(ko).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===ko[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ko[t]}}))}));var So=toDate$2;Object.keys(So).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===So[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return So[t]}}))}));var To=transpose$1;Object.keys(To).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===To[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return To[t]}}))}));var Eo=weeksToDays$1;Object.keys(Eo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Eo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Eo[t]}}))}));var Ao=yearsToDays$1;Object.keys(Ao).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Ao[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ao[t]}}))}));var Oo=yearsToMonths$1;Object.keys(Oo).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===Oo[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return Oo[t]}}))}));var No=yearsToQuarters$1;Object.keys(No).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===No[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return No[t]}}))}))}(dateFns);var __importDefault$i=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(filterTool,"__esModule",{value:!0}),filterTool.compileCompoudEvalCondition=filterTool.createMultiLineFilter=filterTool.getFilterValueExpression=void 0;const dbgate_tools_1$a=lib$5,date_fns_1$1=dateFns,isString_1$1=__importDefault$i(isString_1$8),cloneDeepWith_1$1=__importDefault$i(cloneDeepWith_1$4),parseFilter_1=parseFilter$1;function getDateStringWithoutTimeZone(e){return(0,isString_1$1.default)(e)?e.replace(/Z|([+-]\d{2}:\d{2})$/,""):e}function getFilterValueExpression(e,t){return null==e?"NULL":(0,dbgate_tools_1$a.isTypeDateTime)(t)?(0,date_fns_1$1.format)((0,date_fns_1$1.toDate)(getDateStringWithoutTimeZone(e)),"yyyy-MM-dd HH:mm:ss"):!0===e?"TRUE":!1===e?"FALSE":e.$oid?`ObjectId("${e.$oid}")`:e.$bigint?e.$bigint:"Buffer"==e.type&&Array.isArray(e.data)?"0x"+(0,dbgate_tools_1$a.arrayToHexString)(e.data):`="${e}"`}function createMultiLineFilter(e,t){let n="";for(let o of t.split("\n"))if(o=o.trim(),0!=o.length){if(n.length>0)if("is_not"===e)n+=" ";else n+=",";switch(e){case"is":n+="='"+o+"'";break;case"is_not":n+="<>'"+o+"'";break;case"contains":n+="'"+o+"'";break;case"begins":n+="^'"+o+"'";break;case"ends":n+="$'"+o+"'"}}return n}function compileCompoudEvalCondition(e){if(!e)return null;const t=[];for(const n in e)try{const o=(0,parseFilter_1.parseFilter)(e[n],dbgate_tools_1$a.evalFilterBehaviour),r=(0,cloneDeepWith_1$1.default)(o,(e=>{if("placeholder"==e.exprType)return{exprType:"column",columnName:n}}));t.push(r)}catch(e){}return 0==t.length?null:{conditionType:"and",conditions:t}}filterTool.getFilterValueExpression=getFilterValueExpression,filterTool.createMultiLineFilter=createMultiLineFilter,filterTool.compileCompoudEvalCondition=compileCompoudEvalCondition,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||t(n,e,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(parseFilter$1,e),n(filterTool,e)}(lib);var __importDefault$h=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(GridDisplay$1,"__esModule",{value:!0}),GridDisplay$1.reloadDataCacheFunc=GridDisplay$1.GridDisplay=void 0;const lodash_1$6=__importDefault$h(lodash.exports),GridConfig_1=GridConfig,dbgate_filterparser_1$1=lib,dbgate_tools_1$9=lib$5,dbgate_sqltree_1=lib$2,dbgate_tools_2=lib$5;class GridDisplay{constructor(e,t,n,o,r,i=null,a=null,s=null){this.config=e,this.setConfig=t,this.cache=n,this.setCache=o,this.driver=r,this.dbinfo=i,this.serverVersion=a,this.currentSettings=s,this.formColumns=[],this.changeSetKeyFields=null,this.editableStructure=null,this.sortable=!1,this.groupable=!1,this.filterable=!1,this.editable=!1,this.isLoadedCorrectly=!0,this.supportsReload=!1,this.isDynamicStructure=!1,this.filterBehaviourOverride=null,this.dialect=(null==r?void 0:r.dialectByVersion)&&(null==r?void 0:r.dialectByVersion(a))||(null==r?void 0:r.dialect)}get baseTableOrSimilar(){return this.baseTable||this.baseCollection||this.baseView}get baseTableOrCollection(){return this.baseTable||this.baseCollection}get baseTableOrView(){return this.baseTable||this.baseView}setColumnVisibility(e,t){const n=e.join(".");1==e.length?this.includeInColumnSet([{field:"hiddenColumns",uniqueName:n,isIncluded:!t},0==t&&this.isDynamicStructure&&{field:"addedColumns",uniqueName:n,isIncluded:!1}]):(this.includeInColumnSet([{field:"addedColumns",uniqueName:n,isIncluded:t}]),this.isDynamicStructure||this.reload())}addDynamicColumn(e){this.includeInColumnSet([{field:"addedColumns",uniqueName:e,isIncluded:!0},{field:"hiddenColumns",uniqueName:e,isIncluded:!1}])}focusColumns(e){this.setConfig((t=>Object.assign(Object.assign({},t),{focusedColumns:e})))}get hasReferences(){return!1}get focusedColumns(){return this.config.focusedColumns}get engine(){var e;return null===(e=this.driver)||void 0===e?void 0:e.engine}get allColumns(){return this.getColumns(null).filter((e=>e.isChecked||1==e.uniquePath.length))}findColumn(e){return this.getColumns(null).find((t=>t.uniqueName==e))}getFkTarget(e){return null}reload(){this.setCache(reloadDataCacheFunc)}includeInColumnSet(e){this.setConfig((t=>{let n=t;for(const o of e){if(!o)continue;const{field:e,uniqueName:r,isIncluded:i}=o;n=i?Object.assign(Object.assign({},n),{[e]:lodash_1$6.default.uniq([...t[e]||[],r])}):Object.assign(Object.assign({},n),{[e]:lodash_1$6.default.uniq((t[e]||[]).filter((e=>e!=r)))})}return n}))}showAllColumns(){this.setConfig((e=>Object.assign(Object.assign({},e),{hiddenColumns:[]})))}hideAllColumns(){this.setConfig((e=>Object.assign(Object.assign({},e),{hiddenColumns:this.columns.filter((e=>1==e.uniquePath.length)).map((e=>e.uniqueName))})))}setSearchInColumns(e){this.setConfig((t=>Object.assign(Object.assign({},t),{searchInColumns:e})))}get hiddenColumnIndexes(){var e;const t=(this.config.hiddenColumns||[]).map((e=>lodash_1$6.default.findIndex(this.allColumns,(t=>t.uniqueName==e))));if(this.config.searchInColumns&&!(null===(e=this.currentSettings)||void 0===e?void 0:e["dataGrid.showAllColumnsWhenSearch"]))for(let e=0;e<this.allColumns.length;e++)(0,dbgate_tools_1$9.filterName)(this.config.searchInColumns,this.allColumns[e].columnName)||t.push(e);return lodash_1$6.default.sortBy(lodash_1$6.default.uniq(t))}isColumnChecked(e){return 1==e.uniquePath.length?!this.config.hiddenColumns.includes(e.uniqueName):this.config.addedColumns.includes(e.uniqueName)}applyFilterOnSelect(e,t){var n,o;const r=[];for(const e in this.config.filters){const i=this.config.filters[e];if(!i)continue;const a=t[e];if(a)try{const e=(0,dbgate_filterparser_1$1.parseFilter)(i,null!==(o=null===(n=this.driver)||void 0===n?void 0:n.getFilterBehaviour(a.dataType,dbgate_tools_2.standardFilterBehaviours))&&void 0!==o?o:(0,dbgate_tools_2.detectSqlFilterBehaviour)(a.dataType));e&&r.push(lodash_1$6.default.cloneDeepWith(e,(e=>{if("placeholder"==e.exprType)return this.createColumnExpression(a,{alias:a.sourceAlias},void 0,"filter")})))}catch(e){console.warn(e.message);continue}}if(this.baseTableOrView&&this.config.multiColumnFilter){const e={conditionType:"or",conditions:[]};for(const t of this.baseTableOrView.columns)try{const n=(0,dbgate_filterparser_1$1.parseFilter)(this.config.multiColumnFilter,(0,dbgate_tools_2.detectSqlFilterBehaviour)(t.dataType));n&&e.conditions.push(lodash_1$6.default.cloneDeepWith(n,(e=>{if("placeholder"==e.exprType)return this.createColumnExpression(t,this.dialect.omitTableAliases?void 0:{alias:"basetbl"},void 0,"filter")})))}catch(e){continue}e.conditions.length>0&&r.push(e)}r.length>0&&(e.where={conditionType:"and",conditions:r})}applySortOnSelect(e,t){var n;if((null===(n=this.config.sort)||void 0===n?void 0:n.length)>0){const n=this.config.sort.map((e=>Object.assign(Object.assign({},e),{dispInfo:t[e.uniqueName]}))).map((t=>Object.assign(Object.assign({},t),{expr:e.columns.find((e=>e.alias==t.uniqueName))}))).filter((e=>e.dispInfo&&e.expr)).map((e=>Object.assign(Object.assign({},e.expr),{direction:e.order})));n.length>0&&(e.orderBy=n)}}get isGrouped(){return!lodash_1$6.default.isEmpty(this.config.grouping)}get groupColumns(){return this.isGrouped?lodash_1$6.default.keys(lodash_1$6.default.pickBy(this.config.grouping,(e=>"GROUP"==e||e.startsWith("GROUP:")))):null}applyGroupOnSelect(e,t){const n=this.groupColumns;if(n&&n.length>0&&(e.groupBy=n.map((e=>{const n={exprType:"column",columnName:t[e].columnName,source:{alias:t[e].sourceAlias}},o=this.config.grouping[e];return o.startsWith("GROUP:")?{exprType:"transform",transform:o,expr:n}:n}))),!lodash_1$6.default.isEmpty(this.config.grouping)){for(let t=0;t<e.columns.length;t++){const n=e.columns[t].alias,o=this.getGrouping(n);if("GROUP"!=o)if("NULL"==o)e.columns[t].alias=null;else if(o&&o.startsWith("GROUP:"))e.columns[t]={exprType:"transform",transform:o,expr:e.columns[t],alias:e.columns[t].alias};else{let n="MAX",r="";o&&("COUNT DISTINCT"==o?(n="COUNT",r="DISTINCT "):n=o),e.columns[t]={alias:e.columns[t].alias,exprType:"call",func:n,argsPrefix:r,args:[e.columns[t]]}}}e.columns=e.columns.filter((e=>e.alias))}}getColumns(e){return this.columns.filter((t=>{var n;return(0,dbgate_tools_1$9.filterName)(e,null===(n=t.columnName)||void 0===n?void 0:n.toString())}))}getGridColumns(){return this.getColumns(null).filter((e=>this.isColumnChecked(e)))}isExpandedColumn(e){return this.config.expandedColumns.includes(e)}toggleExpandedColumn(e,t){this.includeInColumnSet([{field:"expandedColumns",uniqueName:e,isIncluded:null==t?!this.isExpandedColumn(e):t}])}getFilter(e){return this.config.filters[e]}setFilter(e,t){this.setConfig((n=>Object.assign(Object.assign({},n),{filters:Object.assign(Object.assign({},n.filters),{[e]:t}),formViewRecordNumber:0}))),this.reload()}setMutliColumnFilter(e){this.setConfig((t=>Object.assign(Object.assign({},t),{multiColumnFilter:e,formViewRecordNumber:0}))),this.reload()}showFilter(e){this.setConfig((t=>t.filters.uniqueName?t:Object.assign(Object.assign({},t),{filters:Object.assign(Object.assign({},lodash_1$6.default.omitBy(t.filters,(e=>!e))),{[e]:""})})))}removeFilter(e){this.setConfig((t=>Object.assign(Object.assign({},t),{filters:lodash_1$6.default.omit(t.filters,[e]),formFilterColumns:(t.formFilterColumns||[]).filter((t=>t!=e))}))),this.reload()}setFilters(e){this.setConfig((t=>Object.assign(Object.assign({},t),{filters:Object.assign(Object.assign({},t.filters),e)}))),this.reload()}setSort(e,t){this.setConfig((n=>Object.assign(Object.assign({},n),{sort:[{uniqueName:e,order:t}]}))),this.reload()}addToSort(e,t){this.setConfig((n=>Object.assign(Object.assign({},n),{sort:[...n.sort||[],{uniqueName:e,order:t}]}))),this.reload()}clearSort(){this.setConfig((e=>Object.assign(Object.assign({},e),{sort:[]}))),this.reload()}setGrouping(e,t){this.setConfig((n=>Object.assign(Object.assign({},n),{grouping:t?Object.assign(Object.assign({},n.grouping),{[e]:t}):lodash_1$6.default.omitBy(n.grouping,((t,n)=>n==e))}))),this.reload()}getGrouping(e){var t,n;if(this.isGrouped){if(this.config.grouping[e])return this.config.grouping[e];const o=null===(n=null===(t=this.baseTable||this.baseView)||void 0===t?void 0:t.columns)||void 0===n?void 0:n.find((t=>t.columnName==e));return(0,dbgate_tools_2.isTypeLogical)(null==o?void 0:o.dataType)?"COUNT DISTINCT":(null==o?void 0:o.autoIncrement)?"COUNT":"MAX"}return null}clearGrouping(){this.setConfig((e=>Object.assign(Object.assign({},e),{grouping:{}}))),this.reload()}getSortOrder(e){var t;return null===(t=this.config.sort.find((t=>t.uniqueName==e)))||void 0===t?void 0:t.order}getSortOrderIndex(e){return this.config.sort.length<=1?-1:lodash_1$6.default.findIndex(this.config.sort,(t=>t.uniqueName==e))}isSortDefined(){return(this.config.sort||[]).length>0}get filterCount(){return lodash_1$6.default.compact(lodash_1$6.default.values(this.config.filters)).length}clearFilters(){this.setConfig((e=>Object.assign(Object.assign({},e),{filters:{},multiColumnFilter:null}))),this.reload()}resetConfig(){this.setConfig((e=>(0,GridConfig_1.createGridConfig)())),this.reload()}getChangeSetCondition(e){return this.changeSetKeyFields?lodash_1$6.default.pick(e,this.changeSetKeyFields):null}getChangeSetField(e,t,n,o=null,r=!1){const i=this.columns.find((e=>e.uniqueName==t));if(!i)return null;const a=this.baseTableOrSimilar;if(!r){if(!a)return null;if(a.pureName!=i.pureName||a.schemaName!=i.schemaName)return null}return Object.assign(Object.assign({},this.getChangeSetRow(e,n,o,r)),{uniqueName:t,columnName:i.columnName})}getChangeSetRow(e,t,n,o=!1){const r=this.baseTableOrSimilar;return o||r?{pureName:null==r?void 0:r.pureName,schemaName:null==r?void 0:r.schemaName,insertedRowIndex:t,existingRowIndex:n,condition:null==t&&null==n?this.getChangeSetCondition(e):null}:null}createSelect(e={}){return null}processReferences(e,t,n){}createColumnExpression(e,t,n,o="view"){let r=null;return this.dialect.createColumnViewExpression&&(r=this.dialect.createColumnViewExpression(e.columnName,e.dataType,t,n,o),r)?r:Object.assign(Object.assign(Object.assign({exprType:"column"},!this.dialect.omitTableAliases&&{alias:n||e.columnName}),{source:t}),e)}createSelectBase(e,t,n,o){var r,i;if(!t)return null;const a=null!=o?o:null===(r=t[0])||void 0===r?void 0:r.columnName,s={commandType:"select",from:Object.assign({name:lodash_1$6.default.pick(e,["schemaName","pureName"])},!this.dialect.omitTableAliases&&{alias:"basetbl"}),columns:t.map((e=>this.createColumnExpression(e,this.dialect.omitTableAliases?void 0:{alias:"basetbl"},void 0,"view"))),orderBy:(null===(i=this.driver)||void 0===i?void 0:i.requiresDefaultSortCriteria)?[{exprType:"column",columnName:a,direction:"ASC"}]:null},c=lodash_1$6.default.keyBy(this.columns.map((e=>Object.assign(Object.assign({},e),!this.dialect.omitTableAliases&&{sourceAlias:"basetbl"}))),"uniqueName");return this.processReferences(s,c,n),this.applyFilterOnSelect(s,c),this.applyGroupOnSelect(s,c),this.applySortOnSelect(s,c),s}getRowNumberOverSelect(e,t,n){return{commandType:"select",selectAll:!0,from:{subQuery:{commandType:"select",from:e.from,where:e.where,columns:[...e.columns,{alias:"_RowNumber",exprType:"rowNumber",orderBy:e.orderBy?e.orderBy.map((e=>"column"!=e.exprType||e.source?e:Object.assign(Object.assign({},e),!this.dialect.omitTableAliases&&{source:{alias:"basetbl"}}))):[Object.assign(Object.assign({},e.columns[0]),{direction:"ASC"})]}]},alias:"_RowNumberResult"},where:{conditionType:"between",expr:{exprType:"column",columnName:"_RowNumber",source:{alias:"_RowNumberResult"}},left:{exprType:"value",value:t+1},right:{exprType:"value",value:t+n}}}}getPageQuery(e,t){if(!this.driver)return null;let n=this.createSelect();return n?(this.dialect.rangeSelect?n.range={offset:e,limit:t}:this.dialect.rowNumberOverPaging&&(e>0||!this.dialect.topRecords)?n=this.getRowNumberOverSelect(n,e,t):this.dialect.limitSelect&&(n.topRecords=t),n):null}getPageQueryText(e,t){const n=this.getPageQuery(e,t);return(0,dbgate_sqltree_1.treeToSql)(this.driver,n,dbgate_sqltree_1.dumpSqlSelect)}getExportQuery(e=null){const t=this.createSelect({isExport:!0});if(!t)return null;e&&e(t);return(0,dbgate_sqltree_1.treeToSql)(this.driver,t,dbgate_sqltree_1.dumpSqlSelect)}getExportQueryJson(e=null){const t=this.createSelect({isExport:!0});return t?(e&&e(t),t):null}getExportColumnMap(){var e,t;const n=(null===(e=this.config.hiddenColumns)||void 0===e?void 0:e.length)>0||(null===(t=this.config.addedColumns)||void 0===t?void 0:t.length)>0;return this.isDynamicStructure&&!n?null:this.getColumns(null).filter((e=>e.isChecked)).map((e=>({dst:e.uniqueName,src:e.uniqueName,ignore:!n})))}resizeColumn(e,t,n){this.setConfig((o=>{const r=Object.assign({},o.columnWidths);return r[e]?r[e]+=n:r[e]=t+n,Object.assign(Object.assign({},o),{columnWidths:r})}))}getCountQuery(){let e=this.createSelect();return e.orderBy=null,this.isGrouped?e={commandType:"select",from:{subQuery:e,alias:"subq"},columns:[{exprType:"raw",sql:"COUNT(*)",alias:"count"}]}:(e.columns=[{exprType:"raw",sql:"COUNT(*)",alias:"count"}],e.selectAll=!1),e}compileJslFilters(){var e,t,n;const o=this.config&&this.config.filters;if(!o)return null;const r=[];for(const i in o){const a=this.isDynamicStructure?null:this.columns.find((e=>e.columnName==i));if(!this.isDynamicStructure&&!a)continue;const s=null!==(n=null!==(e=this.filterBehaviourOverride)&&void 0!==e?e:null===(t=this.driver)||void 0===t?void 0:t.getFilterBehaviour(a.dataType,dbgate_tools_2.standardFilterBehaviours))&&void 0!==n?n:(0,dbgate_tools_2.detectSqlFilterBehaviour)(a.dataType);try{const e=(0,dbgate_filterparser_1$1.parseFilter)(o[i],s),t=lodash_1$6.default.cloneDeepWith(e,(e=>{if("placeholder"==e.exprType)return{exprType:"column",columnName:this.isDynamicStructure?i:a.columnName}}));r.push(t)}catch(e){}}if(this.config.multiColumnFilter){const e=(0,dbgate_filterparser_1$1.parseFilter)(this.config.multiColumnFilter,dbgate_tools_2.stringFilterBehaviour);e&&r.push({conditionType:"anyColumnPass",placeholderCondition:e})}return 0==r.length?null:{conditionType:"and",conditions:r}}switchToFormView(e){this.setConfig((t=>Object.assign(Object.assign({},t),{isFormView:!0,formViewRecordNumber:e})))}switchToJsonView(){this.setConfig((e=>Object.assign(Object.assign({},e),{isJsonView:!0})))}formViewNavigate(e,t){switch(e){case"begin":this.setConfig((e=>Object.assign(Object.assign({},e),{formViewRecordNumber:0})));break;case"previous":this.setConfig((e=>Object.assign(Object.assign({},e),{formViewRecordNumber:Math.max((e.formViewRecordNumber||0)-1,0)})));break;case"next":this.setConfig((e=>Object.assign(Object.assign({},e),{formViewRecordNumber:Math.max((e.formViewRecordNumber||0)+1,0)})));break;case"end":this.setConfig((e=>Object.assign(Object.assign({},e),{formViewRecordNumber:Math.max(t-1,0)})))}this.reload()}}function reloadDataCacheFunc(e){return Object.assign(Object.assign({},(0,GridConfig_1.createGridCache)()),{refreshTime:(new Date).getTime()})}GridDisplay$1.GridDisplay=GridDisplay,GridDisplay$1.reloadDataCacheFunc=reloadDataCacheFunc;var PerspectiveConfig={},__importDefault$g=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PerspectiveConfig,"__esModule",{value:!0}),PerspectiveConfig.switchPerspectiveReferenceDirection=PerspectiveConfig.extractPerspectiveDatabases=PerspectiveConfig.createPerspectiveConfig=PerspectiveConfig.createPerspectiveNodeConfig=void 0;const v1_1$2=__importDefault$g(v1_1$6);function createPerspectiveNodeConfig(e){return{pureName:e.pureName,schemaName:e.schemaName,designerId:(0,v1_1$2.default)(),expandedColumns:[],checkedColumns:[],columnDisplays:{},sort:[],filters:{},isNodeChecked:!0}}function createPerspectiveConfig(e){if(!e)return{nodes:[],references:[],isArranged:!0,rootDesignerId:null};const t=createPerspectiveNodeConfig(e);return{nodes:[t],references:[],rootDesignerId:t.designerId,isArranged:!0}}function extractPerspectiveDatabases({conid:e,database:t},n){const o=[];function r(e,t){o.find((n=>n.conid==e&&n.database==t))||o.push({conid:e,database:t})}o.push({conid:e,database:t});for(const o of n.nodes)r(o.conid||e,o.database||t);return o}function switchPerspectiveReferenceDirection(e){return{designerId:e.designerId,sourceId:e.targetId,targetId:e.sourceId,isAutoGenerated:e.isAutoGenerated,columns:e.columns.map((e=>({source:e.target,target:e.source})))}}PerspectiveConfig.createPerspectiveNodeConfig=createPerspectiveNodeConfig,PerspectiveConfig.createPerspectiveConfig=createPerspectiveConfig,PerspectiveConfig.extractPerspectiveDatabases=extractPerspectiveDatabases,PerspectiveConfig.switchPerspectiveReferenceDirection=switchPerspectiveReferenceDirection;var PerspectiveTreeNode$1={},baseFindIndex=_baseFindIndex,baseIteratee$2=_baseIteratee,toInteger$2=toInteger_1,nativeMax$1=Math.max;function findIndex$1(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:toInteger$2(n);return r<0&&(r=nativeMax$1(o+r,0)),baseFindIndex(e,baseIteratee$2(t),r)}var findIndex_1$2=findIndex$1,perspectiveTools={};function getPerspectiveParentColumnName(e){const t=e.split("::");return t.length>=2?t.slice(0,-1).join("::"):null}function getPerspectiveMostNestedChildColumnName(e){const t=e.split("::");return t[t.length-1]}function perspectiveValueMatcher(e,t){return(null==e?void 0:e.$oid)&&(null==t?void 0:t.$oid)?e.$oid==t.$oid:e==t}Object.defineProperty(perspectiveTools,"__esModule",{value:!0}),perspectiveTools.perspectiveValueMatcher=perspectiveTools.getPerspectiveMostNestedChildColumnName=perspectiveTools.getPerspectiveParentColumnName=void 0,perspectiveTools.getPerspectiveParentColumnName=getPerspectiveParentColumnName,perspectiveTools.getPerspectiveMostNestedChildColumnName=getPerspectiveMostNestedChildColumnName,perspectiveTools.perspectiveValueMatcher=perspectiveValueMatcher;var __importDefault$f=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PerspectiveTreeNode$1,"__esModule",{value:!0}),PerspectiveTreeNode$1.getTableChildPerspectiveNodes=PerspectiveTreeNode$1.PerspectiveCustomJoinTreeNode=PerspectiveTreeNode$1.PerspectiveTableReferenceNode=PerspectiveTreeNode$1.PerspectiveTableNode=PerspectiveTreeNode$1.PerspectivePatternColumnNode=PerspectiveTreeNode$1.PerspectiveTableColumnNode=PerspectiveTreeNode$1.PerspectiveTreeNode=void 0;const dbgate_tools_1$8=lib$5,PerspectiveConfig_1=PerspectiveConfig,isEqual_1=__importDefault$f(isEqual_1$2),compact_1=__importDefault$f(compact_1$8),uniq_1=__importDefault$f(uniq_1$4),flatten_1=__importDefault$f(flatten_1$4),uniqBy_1=__importDefault$f(uniqBy_1$2),sortBy_1$3=__importDefault$f(sortBy_1$6),cloneDeepWith_1=__importDefault$f(cloneDeepWith_1$4),findIndex_1$1=__importDefault$f(findIndex_1$2),json_stable_stringify_1$2=__importDefault$f(jsonStableStringify),dbgate_filterparser_1=lib,v1_1$1=__importDefault$f(v1_1$6),perspectiveTools_1$1=perspectiveTools;class PerspectiveTreeNode{constructor(e,t,n,o,r,i,a){this.dbs=e,this.config=t,this.setConfig=n,this.parentNode=o,this.dataProvider=r,this.defaultDatabaseConfig=i,this.designerId=a,this.childNodesCache=null,this.nodeConfig=t.nodes.find((e=>e.designerId==a)),this.parentNodeConfig=null==o?void 0:o.nodeConfig}get childNodes(){return this.childNodesCache||(this.childNodesCache=this.generateChildNodes()),this.childNodesCache}get fieldName(){return this.codeName}get headerTableAttributes(){return null}get dataField(){return this.codeName}get tableCode(){return null}get namedObject(){return null}get tableNodeOrParent(){return this instanceof PerspectiveTableNode?this:null==this.parentNode?null:this.parentNode.tableNodeOrParent}get engineType(){return null}get databaseConfig(){var e,t,n,o;const r=Object.assign({},this.defaultDatabaseConfig);return(null===(e=this.nodeConfig)||void 0===e?void 0:e.conid)&&(r.conid=null===(t=this.nodeConfig)||void 0===t?void 0:t.conid),(null===(n=this.nodeConfig)||void 0===n?void 0:n.database)&&(r.database=null===(o=this.nodeConfig)||void 0===o?void 0:o.database),r}get isRoot(){return null==this.parentNode}get rootNode(){var e;return this.isRoot?this:null===(e=this.parentNode)||void 0===e?void 0:e.rootNode}get isSortable(){return!1}get generatesHiearchicGridColumn(){return this.isExpandable&&this.isCheckedNode}get generatesDataGridColumn(){return this.isCheckedColumn}get validParentDesignerId(){var e;return this.designerId?this.designerId:null===(e=this.parentNode)||void 0===e?void 0:e.validParentDesignerId}get preloadedLevelData(){return!1}get findByDesignerIdWithoutDesignerId(){return!1}matchChildRow(e,t){return!0}hasTableCode(e){var t;return e==this.tableCode||(null===(t=this.parentNode)||void 0===t?void 0:t.hasTableCode(e))}get level(){return this.parentNode?this.parentNode.level+1:0}get isExpanded(){var e,t;return null===(t=null===(e=this.parentNodeConfig)||void 0===e?void 0:e.expandedColumns)||void 0===t?void 0:t.includes(this.codeName)}get isCheckedColumn(){var e,t;return!!(null===(t=null===(e=this.parentNodeConfig)||void 0===e?void 0:e.checkedColumns)||void 0===t?void 0:t.includes(this.codeName))}get isChecked(){return this.isCheckedColumn}get isCheckedNode(){var e,t;return!!this.designerId&&!!(null===(t=null===(e=this.config.nodes)||void 0===e?void 0:e.find((e=>e.designerId==this.designerId)))||void 0===t?void 0:t.isNodeChecked)}get isSecondaryChecked(){return!1}get secondaryCheckable(){return!1}get columnTitle(){return this.title}get filterBehaviour(){return dbgate_tools_1$8.stringFilterBehaviour}get columnName(){return null}get customJoinConfig(){return null}get db(){var e,t;return null===(t=null===(e=this.dbs)||void 0===e?void 0:e[this.databaseConfig.conid])||void 0===t?void 0:t[this.databaseConfig.database]}get isCircular(){return!1}get pathIdentifier(){return this.parentNode?`${this.parentNode.pathIdentifier}_${this.codeName}`:this.codeName}hasDesignerIdInIncestors(e){var t;return e==this.designerId||((null===(t=this.parentNode)||void 0===t?void 0:t.hasDesignerIdInIncestors(e))||!1)}getChildMatchColumns(){return[]}getParentMatchColumns(){return[]}parseFilterCondition(e=null){return null}get hasUncheckedNodeInPath(){return!!this.parentNode&&(!(!this.designerId||this.isCheckedNode)||this.parentNode.hasUncheckedNodeInPath)}get childDataColumn(){return this.isCheckedColumn?this.codeName:null}toggleExpanded(e){this.includeInNodeSet("expandedColumns",null==e?!this.isExpanded:e)}toggleChecked(e){this.includeInNodeSet("checkedColumns",null==e?!this.isChecked:e)}toggleCheckedNode(e){this.setConfig((t=>{var n;const o=null===(n=t.nodes.find((e=>e.designerId==this.designerId)))||void 0===n?void 0:n.isNodeChecked,[r,i]=this.ensureNodeConfig(t);return Object.assign(Object.assign({},r),{nodes:r.nodes.map((t=>t.designerId==(this.designerId||i.designerId)?Object.assign(Object.assign({},t),{isNodeChecked:null==e?!o:e}):t))})}))}toggleSecondaryChecked(e){}createReferenceConfigColumns(){return null}ensureNodeConfig(e){var t,n;let o=e.nodes.find((e=>e.designerId==this.designerId));if(!o){const o=Object.assign(Object.assign({},(0,PerspectiveConfig_1.createPerspectiveNodeConfig)(this.namedObject)),{isAutoGenerated:!0,conid:null===(t=this.parentNodeConfig)||void 0===t?void 0:t.conid,database:null===(n=this.parentNodeConfig)||void 0===n?void 0:n.database}),r={designerId:(0,v1_1$1.default)(),sourceId:this.parentNode.designerId,targetId:o.designerId,isAutoGenerated:!0,columns:this.createReferenceConfigColumns()};return[Object.assign(Object.assign({},e),{nodes:[...e.nodes,o],references:[...e.references,r]}),o]}return[e,o]}includeInNodeSet(e,t){this.setConfig((n=>{var o,r;const i=n=>Object.assign(Object.assign({},n),{[e]:t?[...n[e]||[],this.codeName]:(n[e]||[]).filter((e=>e!=this.codeName))}),[a,s]=null===(r=null===(o=this.parentNode)||void 0===o?void 0:o.tableNodeOrParent)||void 0===r?void 0:r.ensureNodeConfig(n),c=Object.assign(Object.assign({},a),{nodes:a.nodes.map((e=>{var t,n;return e.designerId==((null===(n=null===(t=this.parentNode)||void 0===t?void 0:t.tableNodeOrParent)||void 0===n?void 0:n.designerId)||(null==s?void 0:s.designerId))?i(e):e}))});return c}))}getFilter(){var e,t;return null===(t=null===(e=this.parentNodeConfig)||void 0===e?void 0:e.filters)||void 0===t?void 0:t[this.codeName]}getDataLoadColumns(){return(0,compact_1.default)((0,uniq_1.default)([...this.childNodes.map((e=>e.childDataColumn)),...(0,flatten_1.default)(this.childNodes.filter((e=>e.isExpandable&&e.isChecked)).map((e=>e.getChildMatchColumns()))),...this.getParentMatchColumns(),...this.childNodes.filter((e=>e instanceof PerspectivePatternColumnNode)).filter((e=>{var t,n;return null===(n=null===(t=this.nodeConfig)||void 0===t?void 0:t.checkedColumns)||void 0===n?void 0:n.find((t=>t.startsWith(e.codeName+"::")))})).map((e=>e.columnName))]))}getMutliColumnCondition(e){var t;if(!(null===(t=this.nodeConfig)||void 0===t?void 0:t.multiColumnFilter))return null;const n=this.getBaseTableFromThis();if(!n)return null;return(0,dbgate_tools_1$8.isCollectionInfo)(n)?this.getMutliColumnNoSqlCondition():this.getMutliColumnSqlCondition(e)}getMutliColumnSqlCondition(e){var t,n;if(!(null===(t=this.nodeConfig)||void 0===t?void 0:t.multiColumnFilter))return null;const o=this.getBaseTableFromThis();if(!o)return null;try{const t=(0,dbgate_filterparser_1.parseFilter)(null===(n=this.nodeConfig)||void 0===n?void 0:n.multiColumnFilter,dbgate_tools_1$8.stringFilterBehaviour);if(t){const n={conditionType:"or",conditions:[]};for(const r of o.columns||[])n.conditions.push((0,cloneDeepWith_1.default)(t,(t=>{if("placeholder"==t.exprType)return{exprType:"column",alias:e,columnName:r.columnName}})));if(n.conditions.length>0)return n}}catch(e){console.warn(e.message)}return null}getMutliColumnNoSqlCondition(){var e,t,n,o;if(!(null===(e=this.nodeConfig)||void 0===e?void 0:e.multiColumnFilter))return null;const r=null===(n=null===(t=this.dataProvider)||void 0===t?void 0:t.dataPatterns)||void 0===n?void 0:n[this.designerId];if(!r)return null;const i=(0,dbgate_filterparser_1.parseFilter)(null===(o=this.nodeConfig)||void 0===o?void 0:o.multiColumnFilter,dbgate_tools_1$8.mongoFilterBehaviour);if(!i)return null;const a={conditionType:"or",conditions:[]};for(const e of r.columns||[])a.conditions.push((0,cloneDeepWith_1.default)(i,(t=>{if("placeholder"==t.exprType)return{exprType:"column",columnName:e.name}})));return a.conditions.length>0?a:void 0}getChildrenSqlCondition(e=null){const t=(0,compact_1.default)([...this.childNodes.map((t=>t.parseFilterCondition(e))),...this.buildParentFilterConditions(),this.getMutliColumnCondition(e)]);return 0==t.length?null:1==t.length?t[0]:{conditionType:"and",conditions:t}}getOrderBy(e){var t;const n=(0,compact_1.default)(this.childNodes.map((e=>{var t,n;const o=null===(n=null===(t=this.nodeConfig)||void 0===t?void 0:t.sort)||void 0===n?void 0:n.find((t=>t.columnName==e.columnName));if(o)return{columnName:e.columnName,order:o.order}})));if(n.length>0)return n;const o=null===(t=null==e?void 0:e.primaryKey)||void 0===t?void 0:t.columns.map((e=>({columnName:e.columnName,order:"ASC"})));if(o)return o;const r=null==e?void 0:e.uniqueKey;if((null==r?void 0:r.length)>=1)return r.map((e=>({columnName:e.columnName,order:"ASC"})));const i=null==e?void 0:e.columns;return i?[{columnName:i[0].columnName,order:"ASC"}]:[{columnName:"_id",order:"ASC"}]}getBaseTables(){const e=[],t=this.getBaseTableFromThis();t&&e.push({table:t,node:this});for(const t of this.childNodes)t.isChecked&&e.push(...t.getBaseTables());return e}getBaseTableFromThis(){return null}get filterInfo(){return null}findChildNodeByUniquePath(e){if(0==e.length)return this;const t=this.childNodes.find((t=>t.codeName==e[0]));return null==t?void 0:t.findChildNodeByUniquePath(e.slice(1))}findNodeByDesignerId(e){if(!this.designerId&&!this.findByDesignerIdWithoutDesignerId)return null;if(!e)return null;if(e==this.designerId)return this;for(const t of this.childNodes){const n=t.findNodeByDesignerId(e);if(n)return n}return null}get supportsParentFilter(){var e,t,n,o,r,i,a,s,c;return((null===(e=this.parentNode)||void 0===e?void 0:e.isRoot)||(null===(t=this.parentNode)||void 0===t?void 0:t.supportsParentFilter))&&(null===(o=null===(n=this.parentNode)||void 0===n?void 0:n.databaseConfig)||void 0===o?void 0:o.conid)==(null===(r=this.databaseConfig)||void 0===r?void 0:r.conid)&&(null===(a=null===(i=this.parentNode)||void 0===i?void 0:i.databaseConfig)||void 0===a?void 0:a.database)==(null===(s=this.databaseConfig)||void 0===s?void 0:s.database)&&"sqldb"==this.engineType&&"sqldb"==(null===(c=this.parentNode)||void 0===c?void 0:c.engineType)}get isParentFilter(){var e;return!!(null===(e=this.nodeConfig)||void 0===e?void 0:e.isParentFilter)}buildParentFilterConditions(){var e;const t=(0,compact_1.default)(((null===(e=this.config)||void 0===e?void 0:e.nodes)||[]).filter((e=>e.isParentFilter)).map((e=>this.rootNode.findNodeByDesignerId(e.designerId)))),n=(0,compact_1.default)(t.map((e=>{var t,n;if(e==this)return null;const o={commandType:"select",from:{name:e.namedObject,alias:"pert_0",relations:[]},selectAll:!0};let r=e,i=e,a=1,s="pert_0";for(;(null==i?void 0:i.parentNode)&&(null===(t=null==i?void 0:i.parentNode)||void 0===t?void 0:t.designerId)!=(null==this?void 0:this.designerId);){i=i.parentNode;let e=`pert_${a}`;o.from.relations.push({joinType:"INNER JOIN",alias:e,name:i.namedObject,conditions:r.getParentJoinCondition(s,e)}),s=e,r=i,a+=1}return(null===(n=null==i?void 0:i.parentNode)||void 0===n?void 0:n.designerId)!=(null==this?void 0:this.designerId)?null:(o.where={conditionType:"and",conditions:(0,compact_1.default)([...r.getParentJoinCondition(s,this.namedObject.pureName),e.getChildrenSqlCondition({alias:"pert_0"})])},{conditionType:"exists",subQuery:o})})));return n}getParentJoinCondition(e,t){return[]}get sortOrder(){var e,t,n;return null===(n=null===(t=null===(e=this.parentNodeConfig)||void 0===e?void 0:e.sort)||void 0===t?void 0:t.find((e=>e.columnName==this.columnName)))||void 0===n?void 0:n.order}get sortOrderIndex(){var e,t,n;return(null===(t=null===(e=this.parentNodeConfig)||void 0===e?void 0:e.sort)||void 0===t?void 0:t.length)>1?(0,findIndex_1$1.default)(null===(n=this.parentNodeConfig)||void 0===n?void 0:n.sort,(e=>e.columnName==this.columnName)):-1}}PerspectiveTreeNode$1.PerspectiveTreeNode=PerspectiveTreeNode;class PerspectiveTableColumnNode extends PerspectiveTreeNode{constructor(e,t,n,o,r,i,a,s,c){var l,u,d,p,m;super(n,o,r,s,i,a,c),this.column=e,this.table=t,this.isTable=!!(null===(u=null===(l=this.db)||void 0===l?void 0:l.tables)||void 0===u?void 0:u.find((e=>e.schemaName==t.schemaName&&e.pureName==t.pureName))),this.isView=!!(null===(p=null===(d=this.db)||void 0===d?void 0:d.views)||void 0===p?void 0:p.find((e=>e.schemaName==t.schemaName&&e.pureName==t.pureName))),this.foreignKey=null===(m=null==t?void 0:t.foreignKeys)||void 0===m?void 0:m.find((t=>1==t.columns.length&&t.columns[0].columnName==e.columnName)),this.refTable=this.db.tables.find((e=>{var t,n;return e.pureName==(null===(t=this.foreignKey)||void 0===t?void 0:t.refTableName)&&e.schemaName==(null===(n=this.foreignKey)||void 0===n?void 0:n.refSchemaName)}))}get engineType(){return this.parentNode.engineType}matchChildRow(e,t){return!!this.foreignKey&&e[this.foreignKey.columns[0].columnName]==t[this.foreignKey.columns[0].refColumnName]}getChildMatchColumns(){return this.foreignKey?[this.foreignKey.columns[0].columnName]:[]}getParentMatchColumns(){return this.foreignKey?[this.foreignKey.columns[0].refColumnName]:[]}getParentJoinCondition(e,t){return this.foreignKey?this.foreignKey.columns.map((n=>({conditionType:"binary",operator:"=",left:{exprType:"column",columnName:n.columnName,source:{alias:t}},right:{exprType:"column",columnName:n.refColumnName,source:{alias:e}}}))):[]}createReferenceConfigColumns(){var e,t;return null===(t=null===(e=this.foreignKey)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.map((e=>({source:e.columnName,target:e.refColumnName})))}getNodeLoadProps(e){return this.foreignKey?{schemaName:this.foreignKey.refSchemaName,pureName:this.foreignKey.refTableName,bindingColumns:[this.foreignKey.columns[0].refColumnName],bindingValues:(0,uniqBy_1.default)(e.map((e=>[e[this.foreignKey.columns[0].columnName]])),json_stable_stringify_1$2.default),dataColumns:this.getDataLoadColumns(),databaseConfig:this.databaseConfig,orderBy:this.getOrderBy(this.refTable),sqlCondition:this.getChildrenSqlCondition(),engineType:"sqldb"}:null}get icon(){return this.isCircular?"img circular":this.column.autoIncrement?"img autoincrement":this.foreignKey?"img foreign-key":"img column"}get codeName(){return this.column.columnName}get columnName(){return this.column.columnName}get fieldName(){return this.codeName+"Ref"}get title(){return this.column.columnName}get isExpandable(){return!!this.foreignKey}get isSortable(){return!0}get filterBehaviour(){return(0,dbgate_tools_1$8.detectSqlFilterBehaviour)(this.column.dataType)}get isCircular(){var e,t;return!!(null===(t=null===(e=this.parentNode)||void 0===e?void 0:e.parentNode)||void 0===t?void 0:t.hasTableCode(this.tableCode))}get isSecondaryChecked(){return super.isCheckedColumn}get isChecked(){return this.foreignKey?this.isCheckedNode:super.isCheckedColumn}get secondaryCheckable(){return!!this.foreignKey}toggleChecked(e){this.foreignKey?this.toggleCheckedNode(e):super.toggleChecked(e)}toggleSecondaryChecked(e){super.toggleChecked(null==e?!this.isSecondaryChecked:e)}generateChildNodes(){var e,t;if(!this.foreignKey)return[];return getTableChildPerspectiveNodes(null===(t=null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.tables)||void 0===t?void 0:t.find((e=>{var t,n;return e.pureName==(null===(t=this.foreignKey)||void 0===t?void 0:t.refTableName)&&e.schemaName==(null===(n=this.foreignKey)||void 0===n?void 0:n.refSchemaName)})),this.dbs,this.config,this.setConfig,this.dataProvider,this.defaultDatabaseConfig,this)}getBaseTableFromThis(){return this.refTable}get filterInfo(){return{columnName:this.columnName,filterBehaviour:this.filterBehaviour,pureName:this.column.pureName,schemaName:this.column.schemaName,foreignKey:this.foreignKey}}parseFilterCondition(e=null){const t=this.getFilter();if(!t)return null;const n=(0,dbgate_filterparser_1.parseFilter)(t,this.filterBehaviour);return n?(0,cloneDeepWith_1.default)(n,(t=>{if("placeholder"==t.exprType)return{exprType:"column",columnName:this.column.columnName,source:e}})):null}get headerTableAttributes(){return this.foreignKey?{schemaName:this.foreignKey.refSchemaName,pureName:this.foreignKey.refTableName,conid:this.databaseConfig.conid,database:this.databaseConfig.database,objectTypeField:this.table.objectTypeField}:null}get tableCode(){return this.foreignKey?`${this.foreignKey.refSchemaName}|${this.foreignKey.refTableName}`:`${this.table.schemaName}|${this.table.pureName}`}get namedObject(){return this.foreignKey?{schemaName:this.foreignKey.refSchemaName,pureName:this.foreignKey.refTableName}:null}}PerspectiveTreeNode$1.PerspectiveTableColumnNode=PerspectiveTableColumnNode;class PerspectivePatternColumnNode extends PerspectiveTreeNode{constructor(e,t,n,o,r,i,a,s,c,l){var u;super(o,r,i,c,a,s,l),this.table=e,this.column=t,this.tableColumn=n,this.parentNodeConfig=null===(u=this.tableNodeOrParent)||void 0===u?void 0:u.nodeConfig}get isChildColumn(){return this.parentNode instanceof PerspectivePatternColumnNode}get findByDesignerIdWithoutDesignerId(){return this.isExpandable}getNodeLoadProps(e){return null}get generatesHiearchicGridColumn(){var e,t,n;return!!(null===(n=null===(t=null===(e=this.tableNodeOrParent)||void 0===e?void 0:e.nodeConfig)||void 0===t?void 0:t.checkedColumns)||void 0===n?void 0:n.find((e=>e.startsWith(this.codeName+"::"))))||this.hasCheckedJoinChild()}get icon(){return this.column.types.includes("json")?"img json":"img column"}get codeName(){return this.parentNode instanceof PerspectivePatternColumnNode?`${this.parentNode.codeName}::${this.column.name}`:this.column.name}get columnName(){return this.column.name}get fieldName(){return this.column.name}get title(){return this.column.name}get isExpandable(){return this.column.columns.length>0}get isSortable(){return!this.isChildColumn}get filterBehaviour(){return this.tableColumn?(0,dbgate_tools_1$8.detectSqlFilterBehaviour)(this.tableColumn.dataType):dbgate_tools_1$8.mongoFilterBehaviour}get preloadedLevelData(){return!0}generatePatternChildNodes(){return this.column.columns.map((e=>new PerspectivePatternColumnNode(this.table,e,this.tableColumn,this.dbs,this.config,this.setConfig,this.dataProvider,this.defaultDatabaseConfig,this,null)))}hasCheckedJoinChild(){for(const e of this.childNodes){if(e instanceof PerspectivePatternColumnNode&&e.hasCheckedJoinChild())return!0;if(e.isCheckedNode)return!0}return!1}generateChildNodes(){var e,t,n,o,r;const i=this.generatePatternChildNodes(),a=[];for(const i of this.config.nodes)for(const s of this.config.references){const c=this.validParentDesignerId;if(s.sourceId==c&&s.targetId==i.designerId||s.targetId==c&&s.sourceId==i.designerId){if(1!=s.columns.length)continue;if(s.sourceId==c&&this.codeName==(0,perspectiveTools_1$1.getPerspectiveParentColumnName)(s.columns[0].source)){if(s.columns[0].target.includes("::"))continue}else{if(s.targetId!=c||this.codeName!=(0,perspectiveTools_1$1.getPerspectiveParentColumnName)(s.columns[0].target))continue;if(s.columns[0].source.includes("::"))continue}const l=Object.assign({},this.defaultDatabaseConfig);i.conid&&(l.conid=i.conid),i.database&&(l.database=i.database);const u=null===(t=null===(e=this.dbs)||void 0===e?void 0:e[l.conid])||void 0===t?void 0:t[l.database],d=null===(n=null==u?void 0:u.tables)||void 0===n?void 0:n.find((e=>e.pureName==i.pureName&&e.schemaName==i.schemaName)),p=null===(o=null==u?void 0:u.views)||void 0===o?void 0:o.find((e=>e.pureName==i.pureName&&e.schemaName==i.schemaName)),m=null===(r=null==u?void 0:u.collections)||void 0===r?void 0:r.find((e=>e.pureName==i.pureName&&e.schemaName==i.schemaName)),f={refNodeDesignerId:i.designerId,referenceDesignerId:s.designerId,baseDesignerId:c,joinName:i.alias,refTableName:i.pureName,refSchemaName:i.schemaName,conid:i.conid,database:i.database,columns:s.sourceId==c?s.columns.map((e=>({baseColumnName:e.source,refColumnName:e.target}))):s.columns.map((e=>({baseColumnName:e.target,refColumnName:e.source})))};(d||p||m)&&a.push(new PerspectiveCustomJoinTreeNode(f,d||p||m,this.dbs,this.config,this.setConfig,this.dataProvider,this.defaultDatabaseConfig,this,i.designerId))}}return[...i,...a]}get filterInfo(){return this.isChildColumn?null:{columnName:this.columnName,filterBehaviour:this.filterBehaviour,pureName:this.table.pureName,schemaName:this.table.schemaName,foreignKey:this.foreignKey}}parseFilterCondition(e=null){const t=this.getFilter();if(!t)return null;const n=(0,dbgate_filterparser_1.parseFilter)(t,dbgate_tools_1$8.mongoFilterBehaviour);return n?(0,cloneDeepWith_1.default)(n,(e=>{if(e.__placeholder__)return{[this.columnName]:e.__placeholder__}})):null}}PerspectiveTreeNode$1.PerspectivePatternColumnNode=PerspectivePatternColumnNode;class PerspectiveTableNode extends PerspectiveTreeNode{constructor(e,t,n,o,r,i,a,s){super(t,n,o,a,r,i,s),this.table=e,this.dataProvider=r}get engineType(){return(0,dbgate_tools_1$8.isCollectionInfo)(this.table)?"docdb":"sqldb"}getNodeLoadProps(e){const t=(0,dbgate_tools_1$8.isCollectionInfo)(this.table);return{schemaName:this.table.schemaName,pureName:this.table.pureName,dataColumns:this.getDataLoadColumns(),allColumns:t,databaseConfig:this.databaseConfig,orderBy:this.getOrderBy(this.table),sqlCondition:this.getChildrenSqlCondition(),engineType:t?"docdb":"sqldb"}}get codeName(){return this.table.schemaName?`${this.table.schemaName}:${this.table.pureName}`:this.table.pureName}get title(){var e;return(null===(e=this.nodeConfig)||void 0===e?void 0:e.alias)||this.table.pureName}get isExpandable(){return!0}generateChildNodes(){return getTableChildPerspectiveNodes(this.table,this.dbs,this.config,this.setConfig,this.dataProvider,this.defaultDatabaseConfig,this)}get icon(){return"img table"}getBaseTableFromThis(){return this.table}get headerTableAttributes(){return{schemaName:this.table.schemaName,pureName:this.table.pureName,conid:this.databaseConfig.conid,database:this.databaseConfig.database,objectTypeField:this.table.objectTypeField}}get tableCode(){return`${this.table.schemaName}|${this.table.pureName}`}get namedObject(){return{schemaName:this.table.schemaName,pureName:this.table.pureName}}}PerspectiveTreeNode$1.PerspectiveTableNode=PerspectiveTableNode;class PerspectiveTableReferenceNode extends PerspectiveTableNode{constructor(e,t,n,o,r,i,a,s,c,l){super(t,n,o,r,i,a,c,l),this.foreignKey=e,this.dataProvider=i,this.isMultiple=s}matchChildRow(e,t){return!!this.foreignKey&&e[this.foreignKey.columns[0].refColumnName]==t[this.foreignKey.columns[0].columnName]}getChildMatchColumns(){return this.foreignKey?[this.foreignKey.columns[0].refColumnName]:[]}getParentMatchColumns(){return this.foreignKey?[this.foreignKey.columns[0].columnName]:[]}getNodeLoadProps(e){return this.foreignKey?{schemaName:this.table.schemaName,pureName:this.table.pureName,bindingColumns:[this.foreignKey.columns[0].columnName],bindingValues:(0,uniqBy_1.default)(e.map((e=>[e[this.foreignKey.columns[0].refColumnName]])),json_stable_stringify_1$2.default),dataColumns:this.getDataLoadColumns(),databaseConfig:this.databaseConfig,orderBy:this.getOrderBy(this.table),sqlCondition:this.getChildrenSqlCondition(),engineType:"sqldb"}:null}createReferenceConfigColumns(){var e,t;return null===(t=null===(e=this.foreignKey)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.map((e=>({source:e.refColumnName,target:e.columnName})))}get columnTitle(){return this.table.pureName}get title(){return this.isMultiple?`${super.title} (${this.foreignKey.columns.map((e=>e.columnName)).join(", ")})`:super.title}get codeName(){return this.isMultiple?`${super.codeName}-${this.foreignKey.columns.map((e=>e.columnName)).join("_")}`:super.codeName}get isChecked(){return this.isCheckedNode}toggleChecked(e){this.toggleCheckedNode(e)}getParentJoinCondition(e,t){return this.foreignKey?this.foreignKey.columns.map((n=>({conditionType:"binary",operator:"=",left:{exprType:"column",columnName:n.refColumnName,source:{alias:t}},right:{exprType:"column",columnName:n.columnName,source:{alias:e}}}))):[]}}PerspectiveTreeNode$1.PerspectiveTableReferenceNode=PerspectiveTableReferenceNode;class PerspectiveCustomJoinTreeNode extends PerspectiveTableNode{constructor(e,t,n,o,r,i,a,s,c){super(t,n,o,r,i,a,s,c),this.customJoin=e,this.dataProvider=i}matchChildRow(e,t){for(const n of this.customJoin.columns)if(!(0,perspectiveTools_1$1.perspectiveValueMatcher)(e[(0,perspectiveTools_1$1.getPerspectiveMostNestedChildColumnName)(n.baseColumnName)],t[n.refColumnName]))return!1;return!0}getChildMatchColumns(){return this.customJoin.columns.map((e=>e.baseColumnName))}getParentMatchColumns(){return this.customJoin.columns.map((e=>e.refColumnName))}getNodeLoadProps(e){const t=(0,dbgate_tools_1$8.isCollectionInfo)(this.table),n=e.map((e=>this.customJoin.columns.map((t=>e[(0,perspectiveTools_1$1.getPerspectiveMostNestedChildColumnName)(t.baseColumnName)]))));return{schemaName:this.table.schemaName,pureName:this.table.pureName,bindingColumns:this.getParentMatchColumns(),bindingValues:(0,uniqBy_1.default)(n,(e=>JSON.stringify(e))),dataColumns:this.getDataLoadColumns(),allColumns:t,databaseConfig:this.databaseConfig,orderBy:this.getOrderBy(this.table),sqlCondition:this.getChildrenSqlCondition(),engineType:t?"docdb":"sqldb"}}get icon(){return"icon custom-join"}get codeName(){return this.customJoin.refNodeDesignerId}get customJoinConfig(){return this.customJoin}get isChecked(){return this.isCheckedNode}toggleChecked(e){this.toggleCheckedNode(e)}getParentJoinCondition(e,t){return this.customJoin.columns.map((n=>({conditionType:"binary",operator:"=",left:{exprType:"column",columnName:n.baseColumnName,source:{alias:t}},right:{exprType:"column",columnName:n.refColumnName,source:{alias:e}}})))}}function findDesignerIdForNode(e,t,n){const o=n(null),r=o.createReferenceConfigColumns();if(!(null==r?void 0:r.length))return o;const i=e.references.find((n=>n.sourceId==t.designerId&&(0,isEqual_1.default)(r.map((e=>e.source)),n.columns.map((e=>e.source)))&&(0,isEqual_1.default)(r.map((e=>e.target)),n.columns.map((e=>e.target)))&&(0,dbgate_tools_1$8.equalFullName)(e.nodes.find((e=>e.designerId==n.targetId)),o.namedObject)));if(i&&!t.hasDesignerIdInIncestors(i.targetId))return n(i.targetId);const a=e.references.find((n=>n.targetId==t.designerId&&(0,isEqual_1.default)(r.map((e=>e.target)),n.columns.map((e=>e.source)))&&(0,isEqual_1.default)(r.map((e=>e.source)),n.columns.map((e=>e.target)))&&(0,dbgate_tools_1$8.equalFullName)(e.nodes.find((e=>e.designerId==n.sourceId)),o.namedObject)));return a&&!t.hasDesignerIdInIncestors(a.sourceId)?n(a.sourceId):o}function getTableChildPerspectiveNodes(e,t,n,o,r,i,a){var s,c,l,u,d,p,m,f;if(!e)return[];const h=a.db,g=null===(s=null==r?void 0:r.dataPatterns)||void 0===s?void 0:s[a.designerId],_=(0,dbgate_tools_1$8.isTableInfo)(e)||(0,dbgate_tools_1$8.isViewInfo)(e)?e:null,$=(null===(c=null==_?void 0:_.columns)||void 0===c?void 0:c.map((s=>findDesignerIdForNode(n,a,(c=>{var l,u,d;return(null===(u=null===(l=null==g?void 0:g.columns)||void 0===l?void 0:l.find((e=>e.name==s.columnName)))||void 0===u?void 0:u.types.includes("json"))?new PerspectivePatternColumnNode(e,null===(d=null==g?void 0:g.columns)||void 0===d?void 0:d.find((e=>e.name==s.columnName)),s,t,n,o,r,i,a,c):new PerspectiveTableColumnNode(s,_,t,n,o,r,i,a,c)})))))||(null===(l=null==g?void 0:g.columns)||void 0===l?void 0:l.map((s=>findDesignerIdForNode(n,a,(c=>new PerspectivePatternColumnNode(e,s,null,t,n,o,r,i,a,c))))))||[],b=[];b.push(...$);const y=[];if(h&&(null==e?void 0:e.dependencies))for(const s of null==e?void 0:e.dependencies){const c=h.tables.find((e=>e.pureName==s.pureName&&e.schemaName==s.schemaName));if(c){const l=(null==e?void 0:e.dependencies.filter((e=>e.pureName==s.pureName&&e.schemaName==s.schemaName)).length)>=2;y.push(findDesignerIdForNode(n,a,(e=>new PerspectiveTableReferenceNode(s,c,t,n,o,r,i,l,a,e))))}}b.push(...(0,sortBy_1$3.default)(y,"title"));const v=[];for(const e of n.nodes)if(e.designerId!=(null===(u=a.parentNode)||void 0===u?void 0:u.designerId)&&!b.find((t=>t.designerId==e.designerId)))for(const s of n.references)if(s.sourceId==a.designerId&&s.targetId==e.designerId||s.targetId==a.designerId&&s.sourceId==e.designerId){if(s.columns.find((e=>e.source.includes("::")||e.target.includes("::"))))continue;const c=Object.assign({},i);e.conid&&(c.conid=e.conid),e.database&&(c.database=e.database);const l=null===(d=null==t?void 0:t[c.conid])||void 0===d?void 0:d[c.database],u=null===(p=null==l?void 0:l.tables)||void 0===p?void 0:p.find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName)),h=null===(m=null==l?void 0:l.views)||void 0===m?void 0:m.find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName)),g=null===(f=null==l?void 0:l.collections)||void 0===f?void 0:f.find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName)),_={refNodeDesignerId:e.designerId,referenceDesignerId:s.designerId,baseDesignerId:a.designerId,joinName:e.alias,refTableName:e.pureName,refSchemaName:e.schemaName,conid:e.conid,database:e.database,columns:s.sourceId==a.designerId?s.columns.map((e=>({baseColumnName:e.source,refColumnName:e.target}))):s.columns.map((e=>({baseColumnName:e.target,refColumnName:e.source})))};(u||h||g)&&v.push(new PerspectiveCustomJoinTreeNode(_,u||h||g,t,n,o,r,i,a,e.designerId))}return b.push(...(0,sortBy_1$3.default)(v,"title")),b}PerspectiveTreeNode$1.PerspectiveCustomJoinTreeNode=PerspectiveCustomJoinTreeNode,PerspectiveTreeNode$1.getTableChildPerspectiveNodes=getTableChildPerspectiveNodes;var TableGridDisplay$1={};Object.defineProperty(TableGridDisplay$1,"__esModule",{value:!0}),TableGridDisplay$1.TableGridDisplay=void 0;const dbgate_tools_1$7=lib$5,GridDisplay_1$5=GridDisplay$1;class TableGridDisplay extends GridDisplay_1$5.GridDisplay{constructor(e,t,n,o,r,i,a,s,c,l=null,u=!1,d=!1,p=null){super(n,o,r,i,t,a,c,p),this.tableName=e,this.displayOptions=s,this.getDictionaryDescription=l,this.isRawMode=d,this.currentSettings=p,this.addAllExpandedColumnsToSelected=!1,this.table=this.findTable(e),this.table&&this.table.columns&&0!=this.table.columns.length||(this.isLoadedCorrectly=!1),this.columns=this.getDisplayColumns(this.table,[]),this.addFormDisplayColumns(this.getDisplayColumns(this.table,[])),this.filterable=!0,this.sortable=!0,this.groupable=!0,this.editable=!u,this.supportsReload=!0,this.baseTable=this.table,this.table&&this.table.columns&&(this.changeSetKeyFields=this.table.primaryKey?this.table.primaryKey.columns.map((e=>e.columnName)):this.table.columns.map((e=>e.columnName))),this.config.isFormView&&(this.addAllExpandedColumnsToSelected=!0,this.hintBaseColumns=this.formColumns)}addFormDisplayColumns(e){for(const t of e)if(this.formColumns.push(t),this.isExpandedColumn(t.uniqueName)){const e=this.getFkTarget(t);if(e){const n=this.getDisplayColumns(e,t.uniquePath);this.addFormDisplayColumns(n)}}}findTable({schemaName:e,pureName:t}){return this.dbinfo&&this.dbinfo.tables&&this.dbinfo.tables.find((n=>n.pureName==t&&n.schemaName==e))}getDisplayColumns(e,t){var n,o;return(null===(o=null===(n=null==e?void 0:e.columns)||void 0===n?void 0:n.map((n=>this.getDisplayColumn(e,n,t))))||void 0===o?void 0:o.map((e=>{var t,n,o;return Object.assign(Object.assign({},e),{isChecked:this.isColumnChecked(e),hintColumnNames:(null===(n=null===(t=this.getFkDictionaryDescription(e.isForeignKeyUnique?e.foreignKey:null))||void 0===t?void 0:t.columns)||void 0===n?void 0:n.map((t=>`hint_${e.uniqueName}_${t}`)))||null,hintColumnDelimiter:null===(o=this.getFkDictionaryDescription(e.isForeignKeyUnique?e.foreignKey:null))||void 0===o?void 0:o.delimiter,isExpandable:!!e.foreignKey})})))||[]}addJoinsFromExpandedColumns(e,t,n,o){for(const r of t)if(this.isExpandedColumn(r.uniqueName)){const t=this.getFkTarget(r);if(t){const i=`${r.uniqueName}_ref`,a=this.getDisplayColumns(t,r.uniquePath);this.addReferenceToSelect(e,n,r),this.addJoinsFromExpandedColumns(e,a,i,o),this.addAddedColumnsToSelect(e,a,i,o)}}}addReferenceToSelect(e,t,n){var o,r,i,a,s,c,l;const u=`${n.uniqueName}_ref`;if((e.from.relations||[]).find((e=>e.alias==u)))return;const d=this.getFkTarget(n);d&&d.primaryKey&&(e.from.relations=[...e.from.relations||[],{joinType:"LEFT JOIN",name:d,alias:u,conditions:[{conditionType:"binary",operator:"=",left:{exprType:"column",columnName:n.columnName,source:{name:n,alias:t}},right:{exprType:"column",columnName:null!==(a=null===(i=null===(r=null===(o=n.foreignKey)||void 0===o?void 0:o.columns)||void 0===r?void 0:r[0])||void 0===i?void 0:i.refColumnName)&&void 0!==a?a:null===(l=null===(c=null===(s=d.primaryKey)||void 0===s?void 0:s.columns)||void 0===c?void 0:c[0])||void 0===l?void 0:l.columnName,source:{name:d,alias:u}}}]}])}getFkDictionaryDescription(e){if(!e)return null;const t=e.refTableName,n=e.refSchemaName,o=this.findTable({schemaName:n,pureName:t});if(o&&o.columns&&o.columns.length>0&&o.primaryKey){return this.getDictionaryDescription(o)}return null}addHintsToSelect(e){if(this.isRawMode)return!1;let t=!1;const n=this.groupColumns;for(const o of this.hintBaseColumns||this.getGridColumns())if(o.foreignKey){if(n&&!n.includes(o.uniqueName))continue;const r=this.getFkTarget(o);if(r&&r.columns&&r.columns.length>0&&r.primaryKey){const n=this.getDictionaryDescription(r);if(n){const r=o.uniquePath.slice(0,-1).join(".");this.addReferenceToSelect(e,r?`${r}_ref`:"basetbl",o);const i=`${o.uniqueName}_ref`;e.columns.push(...n.columns.map((e=>({exprType:"column",columnName:e,alias:`hint_${o.uniqueName}_${e}`,source:{alias:i}})))),t=!0}}}return t}enrichExpandedColumns(e){const t=[];for(const n of e)t.push(n),this.isExpandedColumn(n.uniqueName)&&t.push(...this.getExpandedColumns(n));return t}getExpandedColumns(e){const t=this.getFkTarget(e);return t?this.enrichExpandedColumns(this.getDisplayColumns(t,e.uniquePath)):[]}getFkTarget(e){const{uniqueName:t,foreignKey:n,isForeignKeyUnique:o}=e;if(!o)return null;const r=n.refTableName,i=n.refSchemaName;return this.findTable({schemaName:i,pureName:r})}processReferences(e,t,n){this.addJoinsFromExpandedColumns(e,this.columns,"basetbl",t),!n.isExport&&this.displayOptions.showHintColumns&&this.addHintsToSelect(e)}createSelect(e={}){if(!this.table)return null;return this.createSelectBase(this.table,this.table.columns,e)}getColumns(e){return this.enrichExpandedColumns(this.columns.filter((t=>(0,dbgate_tools_1$7.filterName)(e,t.columnName))))}getDisplayColumn(e,t,n){const o=[...n,t.columnName],r=o.join("."),i=Object.assign(Object.assign({},t),{pureName:e.pureName,schemaName:e.schemaName,headerText:1==o.length?t.columnName:`${e.pureName}.${t.columnName}`,uniqueName:r,uniquePath:o,isPrimaryKey:e.primaryKey&&!!e.primaryKey.columns.find((e=>e.columnName==t.columnName)),hasAutoValue:t.hasAutoValue,foreignKey:e.foreignKeys&&e.foreignKeys.find((e=>1==e.columns.length&&e.columns[0].columnName==t.columnName)),isForeignKeyUnique:!1});if(i.foreignKey){const e=this.dbinfo.tables.find((e=>e.schemaName==i.foreignKey.refSchemaName&&e.pureName==i.foreignKey.refTableName));e&&1==i.foreignKey.columns.length&&(0,dbgate_tools_1$7.isTableColumnUnique)(e,i.foreignKey.columns[0].refColumnName)&&(i.isForeignKeyUnique=!0)}return i}addAddedColumnsToSelect(e,t,n,o){for(const r of t)(this.addAllExpandedColumnsToSelected||this.config.addedColumns.includes(r.uniqueName))&&(e.columns.push(this.createColumnExpression(r,{name:r,alias:n},r.uniqueName,"view")),o[r.uniqueName]=Object.assign(Object.assign({},r),{sourceAlias:n}))}get hasReferences(){return!!this.table&&(!!(this.table.foreignKeys&&this.table.foreignKeys.length>0)||!!(this.table.dependencies&&this.table.dependencies.length>0))}}TableGridDisplay$1.TableGridDisplay=TableGridDisplay;var ViewGridDisplay$1={};Object.defineProperty(ViewGridDisplay$1,"__esModule",{value:!0}),ViewGridDisplay$1.ViewGridDisplay=void 0;const GridDisplay_1$4=GridDisplay$1;class ViewGridDisplay extends GridDisplay_1$4.GridDisplay{constructor(e,t,n,o,r,i,a,s){super(n,o,r,i,t,a,s),this.view=e,this.columns=this.getDisplayColumns(e),this.formColumns=this.columns,this.filterable=!0,this.sortable=!0,this.groupable=!1,this.editable=!1,this.supportsReload=!0,this.baseView=e}getDisplayColumns(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.columns)||void 0===t?void 0:t.map((t=>this.getDisplayColumn(e,t))))||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{isChecked:this.isColumnChecked(e)}))))||[]}getDisplayColumn(e,t){const n=[t.columnName],o=n.join(".");return Object.assign(Object.assign({},t),{pureName:e.pureName,schemaName:e.schemaName,headerText:t.columnName,uniqueName:o,uniquePath:n})}createSelect(e={}){return this.createSelectBase(this.view,this.view.columns,e)}}ViewGridDisplay$1.ViewGridDisplay=ViewGridDisplay;var JslGridDisplay$1={},CollectionGridDisplay$1={},__importDefault$e=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(CollectionGridDisplay$1,"__esModule",{value:!0}),CollectionGridDisplay$1.CollectionGridDisplay=CollectionGridDisplay$1.analyseCollectionDisplayColumns=void 0;const lodash_1$5=__importDefault$e(lodash.exports),GridDisplay_1$3=GridDisplay$1,dbgate_tools_1$6=lib$5;function getObjectKeys(e){return lodash_1$5.default.isArray(e)?Object.keys(e).slice(0,10).map((e=>parseInt(e))):lodash_1$5.default.isPlainObject(e)?Object.keys(e):[]}function createHeaderText(e){let t=`${e[0]}`;for(let n=1;n<e.length;n++){const o=e[n];lodash_1$5.default.isNumber(o)?t+=`[${o}]`:t+=`.${o}`}return t}function getColumnsForObject(e,t,n,o){for(const r of getObjectKeys(t)){const i=[...e,r].join(".");let a=n.find((e=>e.uniqueName==i));if(!a)if(a=getDisplayColumn(e,r,o),e.length>0){const e=lodash_1$5.default.findLastIndex(n,(e=>e.parentHeaderText.startsWith(a.parentHeaderText))),t=lodash_1$5.default.findLastIndex(n,(e=>e.headerText==a.parentHeaderText));e>=0?n.splice(e+1,0,a):t>=0?n.splice(t+1,0,a):n.push(a)}else n.push(a);(lodash_1$5.default.isPlainObject(t[r])||lodash_1$5.default.isArray(t[r]))&&(a.isExpandable=!0),o.isExpandedColumn(a.uniqueName)&&getColumnsForObject([...e,r],t[r],n,o)}}function getDisplayColumn(e,t,n){var o,r,i,a,s,c,l,u,d,p;const m=[...e,t],f=m.join(".");return{columnName:t,headerText:createHeaderText(m),uniqueName:f,uniquePath:m,isStructured:!0,parentHeaderText:createHeaderText(e),filterBehaviour:null!==(r=null===(o=null==n?void 0:n.driver)||void 0===o?void 0:o.getFilterBehaviour(null,dbgate_tools_1$6.standardFilterBehaviours))&&void 0!==r?r:dbgate_tools_1$6.mongoFilterBehaviour,pureName:null===(i=n.collection)||void 0===i?void 0:i.pureName,schemaName:null===(a=n.collection)||void 0===a?void 0:a.schemaName,isPartitionKey:!!(null===(c=null===(s=null==n?void 0:n.collection)||void 0===s?void 0:s.partitionKey)||void 0===c?void 0:c.find((e=>e.columnName==f))),isClusterKey:!!(null===(u=null===(l=null==n?void 0:n.collection)||void 0===l?void 0:l.clusterKey)||void 0===u?void 0:u.find((e=>e.columnName==f))),isUniqueKey:!!(null===(p=null===(d=null==n?void 0:n.collection)||void 0===d?void 0:d.uniqueKey)||void 0===p?void 0:p.find((e=>e.columnName==f)))}}function analyseCollectionDisplayColumns(e,t){var n;const o=[],r=null===(n=null==t?void 0:t.config)||void 0===n?void 0:n.addedColumns;for(const n of e||[])getColumnsForObject([],n,o,t);for(const e of r||[])o.find((t=>t.uniqueName==e))||o.push(getDisplayColumn([],e,t));return o.map((e=>Object.assign(Object.assign({},e),{isChecked:t.isColumnChecked(e)})))||[]}CollectionGridDisplay$1.analyseCollectionDisplayColumns=analyseCollectionDisplayColumns;class CollectionGridDisplay extends GridDisplay_1$3.GridDisplay{constructor(e,t,n,o,r,i,a,s,c=!1){var l,u;super(n,o,r,i,t),this.collection=e;const d=lodash_1$5.default.compact(s.updates.map((e=>e.document))),p=lodash_1$5.default.compact(s.inserts.map((e=>e.fields)));this.columns=analyseCollectionDisplayColumns([...a||[],...d,...p],this),this.filterable=!0,this.sortable=!0,this.editable=!c&&(null===(l=null==e?void 0:e.uniqueKey)||void 0===l?void 0:l.length)>0,this.supportsReload=!0,this.isDynamicStructure=!0,this.changeSetKeyFields=null===(u=null==e?void 0:e.uniqueKey)||void 0===u?void 0:u.map((e=>e.columnName)),this.baseCollection=e}}CollectionGridDisplay$1.CollectionGridDisplay=CollectionGridDisplay;var __importDefault$d=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(JslGridDisplay$1,"__esModule",{value:!0}),JslGridDisplay$1.JslGridDisplay=void 0;const lodash_1$4=__importDefault$d(lodash.exports),GridDisplay_1$2=GridDisplay$1,CollectionGridDisplay_1=CollectionGridDisplay$1,dbgate_tools_1$5=lib$5;class JslGridDisplay extends GridDisplay_1$2.GridDisplay{constructor(e,t,n,o,r,i,a,s,c,l=!1,u=null){var d;super(n,o,r,i,u),this.filterable=!0,this.sortable=!0,this.supportsReload=c,this.isDynamicStructure=s,this.filterBehaviourOverride=dbgate_tools_1$5.evalFilterBehaviour,this.editable=l,this.editableStructure=l?t:null,(null==t?void 0:t.columns)&&(this.columns=lodash_1$4.default.uniqBy(null===(d=t.columns.map((e=>({columnName:e.columnName,headerText:e.columnName,uniqueName:e.columnName,uniquePath:[e.columnName],notNull:e.notNull,autoIncrement:e.autoIncrement,pureName:null,schemaName:null}))))||void 0===d?void 0:d.map((e=>Object.assign(Object.assign({},e),{isChecked:this.isColumnChecked(e)}))),(e=>e.uniqueName))),(null==t?void 0:t.__isDynamicStructure)&&(this.columns=(0,CollectionGridDisplay_1.analyseCollectionDisplayColumns)(a,this)),this.columns||(this.columns=[]),this.formColumns=this.columns}}JslGridDisplay$1.JslGridDisplay=JslGridDisplay;var ChangeSet={},__importDefault$c=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ChangeSet,"__esModule",{value:!0}),ChangeSet.removeSchemaFromChangeSet=ChangeSet.changeSetChangedCount=ChangeSet.changeSetContainsChanges=ChangeSet.createMergedRowsChangeSet=ChangeSet.changeSetInsertDocuments=ChangeSet.changeSetInsertNewRow=ChangeSet.getChangeSetInsertedRows=ChangeSet.deleteChangeSetRows=ChangeSet.revertChangeSetRowChanges=ChangeSet.changeSetToSql=ChangeSet.extractChangeSetCondition=ChangeSet.batchUpdateChangeSet=ChangeSet.setChangeSetRowData=ChangeSet.setChangeSetValue=ChangeSet.findExistingChangeSetItem=ChangeSet.createChangeSet=void 0;const lodash_1$3=__importDefault$c(lodash.exports);function createChangeSet(){return{inserts:[],updates:[],deletes:[]}}function findExistingChangeSetItem(e,t){if(!e||!t)return["updates",null];if(null!=t.insertedRowIndex)return["inserts",e.inserts.find((e=>e.pureName==t.pureName&&e.schemaName==t.schemaName&&e.insertedRowIndex==t.insertedRowIndex))];{const n=e.updates.find((e=>e.pureName==t.pureName&&e.schemaName==t.schemaName&&(null!=t.existingRowIndex&&e.existingRowIndex==t.existingRowIndex||null==t.existingRowIndex&&lodash_1$3.default.isEqual(e.condition,t.condition))));if(n)return["updates",n];const o=e.deletes.find((e=>e.pureName==t.pureName&&e.schemaName==t.schemaName&&(null!=t.existingRowIndex&&e.existingRowIndex==t.existingRowIndex||null==t.existingRowIndex&&lodash_1$3.default.isEqual(e.condition,t.condition))));return o?["deletes",o]:["updates",null]}}function setChangeSetValue(e,t,n){if(!e||!t)return e;let[o,r]=findExistingChangeSetItem(e,t);return"deletes"==o&&(e=revertChangeSetRowChanges(e,t),[o,r]=findExistingChangeSetItem(e,t)),r?Object.assign(Object.assign({},e),{[o]:e[o].map((e=>e==r?Object.assign(Object.assign({},e),{fields:Object.assign(Object.assign({},e.fields),{[t.uniqueName]:n})}):e))}):Object.assign(Object.assign({},e),{[o]:[...e[o],{pureName:t.pureName,schemaName:t.schemaName,condition:t.condition,insertedRowIndex:t.insertedRowIndex,existingRowIndex:t.existingRowIndex,fields:{[t.uniqueName]:n}}]})}function setChangeSetRowData(e,t,n){if(!e||!t)return e;let[o,r]=findExistingChangeSetItem(e,t);return"deletes"==o&&(e=revertChangeSetRowChanges(e,t),[o,r]=findExistingChangeSetItem(e,t)),r?Object.assign(Object.assign({},e),{[o]:e[o].map((e=>e==r?Object.assign(Object.assign({},e),{fields:{},document:n}):e))}):Object.assign(Object.assign({},e),{[o]:[...e[o],{pureName:t.pureName,schemaName:t.schemaName,condition:t.condition,insertedRowIndex:t.insertedRowIndex,existingRowIndex:t.existingRowIndex,document:n}]})}function batchUpdateChangeSet(e,t,n){for(const o of lodash_1$3.default.zip(t,n)){const[t,n]=o;for(const o of lodash_1$3.default.keys(n))e=setChangeSetValue(e,Object.assign(Object.assign({},t),{columnName:o,uniqueName:o}),n[o])}return e}function extractFields(e,t=!0,n=[],o,r){const i=Object.assign({},e.fields);function a(e){var t;return"uuid"==(null===(t=null==o?void 0:o.columns.find((t=>t.columnName==e)))||void 0===t?void 0:t.dataType.toLowerCase())}for(const t in e.document||{})n.includes(t)&&(i[t]=e.document[t]);const s=Object.keys(i);return(null==r?void 0:r.generateDefaultValueForUuid)&&o&&s.push(...o.columns.map((e=>e.columnName))),lodash_1$3.default.uniq(s).filter((e=>t||null!=i[e]||a(e)&&(null==r?void 0:r.generateDefaultValueForUuid))).map((e=>function(e){var t,n;return a(e)&&null==i[e]&&(null==r?void 0:r.generateDefaultValueForUuid)?{targetColumn:e,sql:null==r?void 0:r.generateDefaultValueForUuid,exprType:"raw"}:{targetColumn:e,exprType:"value",value:i[e],dataType:null===(n=null===(t=null==o?void 0:o.columns)||void 0===t?void 0:t.find((t=>t.columnName==e)))||void 0===n?void 0:n.dataType}}(e)))}function changeSetInsertToSql(e,t=null,n=null){var o,r;const i=null===(o=null==t?void 0:t.tables)||void 0===o?void 0:o.find((t=>t.schemaName==e.schemaName&&t.pureName==e.pureName)),a=extractFields(e,!1,null===(r=null==i?void 0:i.columns)||void 0===r?void 0:r.map((e=>e.columnName)),i,n);if(0==a.length)return null;let s=!1;if(i){const e=i.columns.find((e=>e.autoIncrement));e&&a.find((t=>t.targetColumn==e.columnName))&&(s=!0)}const c={pureName:e.pureName,schemaName:e.schemaName};return[s?{targetTable:c,commandType:"allowIdentityInsert",allow:!0}:null,{targetTable:c,commandType:"insert",fields:a,insertWhereNotExistsCondition:e.insertIfNotExistsFields?compileSimpleChangeSetCondition(e.insertIfNotExistsFields):null},s?{targetTable:c,commandType:"allowIdentityInsert",allow:!1}:null]}function extractChangeSetCondition(e,t,n,o){return{conditionType:"and",conditions:lodash_1$3.default.keys(e.condition).map((r=>function(r){var i,a;const s=null===(a=null===(i=null==n?void 0:n.columns)||void 0===i?void 0:i.find((e=>e.columnName==r)))||void 0===a?void 0:a.dataType,c=e.condition[r],l={exprType:"column",columnName:r,source:(null==o?void 0:o.omitTableBeforeColumn)?void 0:{name:{pureName:e.pureName,schemaName:e.schemaName},alias:t}};return null==c?{conditionType:"isNull",expr:l}:{conditionType:"binary",operator:"=",left:l,right:{exprType:"value",dataType:s,value:c}}}(r)))}}function compileSimpleChangeSetCondition(e){return{conditionType:"and",conditions:lodash_1$3.default.keys(e).map((t=>function(t){const n=e[t],o={exprType:"column",columnName:t};return null==n?{conditionType:"isNull",expr:o}:{conditionType:"binary",operator:"=",left:o,right:{exprType:"value",value:n}}}(t)))}}function changeSetUpdateToSql(e,t=null,n=null){var o,r,i;const a=null===(o=null==t?void 0:t.tables)||void 0===o?void 0:o.find((t=>t.schemaName==e.schemaName&&t.pureName==e.pureName)),s=null===(r=null==a?void 0:a.columns)||void 0===r?void 0:r.find((e=>e.autoIncrement));return{from:{name:{pureName:e.pureName,schemaName:e.schemaName}},commandType:"update",fields:extractFields(e,!0,null===(i=null==a?void 0:a.columns)||void 0===i?void 0:i.map((e=>e.columnName)).filter((e=>e!=(null==s?void 0:s.columnName))),a),where:extractChangeSetCondition(e,void 0,a,n)}}function changeSetDeleteToSql(e,t=null,n=null){var o;const r=null===(o=null==t?void 0:t.tables)||void 0===o?void 0:o.find((t=>t.schemaName==e.schemaName&&t.pureName==e.pureName));return{from:{name:{pureName:e.pureName,schemaName:e.schemaName}},commandType:"delete",where:extractChangeSetCondition(e,void 0,r,n)}}function changeSetToSql(e,t,n){return lodash_1$3.default.compact(lodash_1$3.default.flatten([...e.inserts.map((e=>changeSetInsertToSql(e,t,n))),...e.updates.map((e=>changeSetUpdateToSql(e,t,n))),...e.deletes.map((e=>changeSetDeleteToSql(e,t,n)))]))}function revertChangeSetRowChanges(e,t){const[n,o]=findExistingChangeSetItem(e,t);return o?Object.assign(Object.assign({},e),{[n]:e[n].filter((e=>e!=o))}):e}function consolidateInsertIndexes(e,t){const n=e.inserts.filter((e=>e.pureName==t.pureName&&e.schemaName==t.schemaName)).map((e=>e.insertedRowIndex));return n.sort(((e,t)=>e-t)),n[n.length-1]!=n.length-1?Object.assign(Object.assign({},e),{inserts:e.inserts.map((e=>Object.assign(Object.assign({},e),{insertedRowIndex:n.indexOf(e.insertedRowIndex)})))}):e}function deleteChangeSetRows(e,t){let[n,o]=findExistingChangeSetItem(e,t);return"updates"==n&&(e=revertChangeSetRowChanges(e,t),[n,o]=findExistingChangeSetItem(e,t)),"inserts"==n?consolidateInsertIndexes(revertChangeSetRowChanges(e,t),t):o&&"deletes"==n?e:Object.assign(Object.assign({},e),{deletes:[...e.deletes,{pureName:t.pureName,schemaName:t.schemaName,condition:t.condition,existingRowIndex:t.existingRowIndex}]})}function getChangeSetInsertedRows(e,t){var n;if(!e)return[];const o=e.inserts.filter((e=>null==t||e.pureName==t.pureName&&e.schemaName==t.schemaName)),r=null===(n=lodash_1$3.default.maxBy(o,(e=>e.insertedRowIndex)))||void 0===n?void 0:n.insertedRowIndex;if(null==r)return[];const i=Array(r+1).fill({});for(const e of o)i[e.insertedRowIndex]=e.fields;return i}function changeSetInsertNewRow(e,t){const n=getChangeSetInsertedRows(e,t);return Object.assign(Object.assign({},e),{inserts:[...e.inserts,Object.assign(Object.assign({},t),{insertedRowIndex:n.length,fields:{}})]})}function changeSetInsertDocuments(e,t,n,o){const r=getChangeSetInsertedRows(e,n);return Object.assign(Object.assign({},e),{inserts:[...e.inserts,...t.map(((e,t)=>Object.assign(Object.assign({},n),{insertedRowIndex:r.length+t,fields:e,insertIfNotExistsFields:o?lodash_1$3.default.pick(e,o):null})))]})}function createMergedRowsChangeSet(e,t,n,o){const r=createChangeSet();return r.updates=t.map((t=>({pureName:e.pureName,schemaName:e.schemaName,fields:lodash_1$3.default.omit(t,o),condition:lodash_1$3.default.pick(t,o)}))),r.inserts=n.map((t=>({pureName:e.pureName,schemaName:e.schemaName,fields:t}))),r}function changeSetContainsChanges(e){var t;return!!e&&(e.deletes.length>0||e.updates.length>0||e.inserts.length>0||!!e.structure||!!e.setColumnMode||(null===(t=e.dataUpdateCommands)||void 0===t?void 0:t.length)>0)}function changeSetChangedCount(e){return e.deletes.length+e.updates.length+e.inserts.length}function removeSchemaFromChangeSet(e){return Object.assign(Object.assign({},e),{inserts:e.inserts.map((e=>Object.assign(Object.assign({},e),{schemaName:void 0}))),updates:e.updates.map((e=>Object.assign(Object.assign({},e),{schemaName:void 0}))),deletes:e.deletes.map((e=>Object.assign(Object.assign({},e),{schemaName:void 0})))})}ChangeSet.createChangeSet=createChangeSet,ChangeSet.findExistingChangeSetItem=findExistingChangeSetItem,ChangeSet.setChangeSetValue=setChangeSetValue,ChangeSet.setChangeSetRowData=setChangeSetRowData,ChangeSet.batchUpdateChangeSet=batchUpdateChangeSet,ChangeSet.extractChangeSetCondition=extractChangeSetCondition,ChangeSet.changeSetToSql=changeSetToSql,ChangeSet.revertChangeSetRowChanges=revertChangeSetRowChanges,ChangeSet.deleteChangeSetRows=deleteChangeSetRows,ChangeSet.getChangeSetInsertedRows=getChangeSetInsertedRows,ChangeSet.changeSetInsertNewRow=changeSetInsertNewRow,ChangeSet.changeSetInsertDocuments=changeSetInsertDocuments,ChangeSet.createMergedRowsChangeSet=createMergedRowsChangeSet,ChangeSet.changeSetContainsChanges=changeSetContainsChanges,ChangeSet.changeSetChangedCount=changeSetChangedCount,ChangeSet.removeSchemaFromChangeSet=removeSchemaFromChangeSet;var MacroDefinition={};Object.defineProperty(MacroDefinition,"__esModule",{value:!0});var runMacro={},rng=rngBrowser.exports,bytesToUuid=bytesToUuid_1;function v4(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var r=(e=e||{}).random||(e.rng||rng)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var i=0;i<16;++i)t[o+i]=r[i];return t||bytesToUuid(r)}var v4_1$1=v4,__importDefault$b=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(runMacro,"__esModule",{value:!0}),runMacro.runMacroOnChangeSet=runMacro.runMacroOnRow=runMacro.runMacroOnValue=runMacro.compileMacroFunction=void 0;const lodash_1$2=__importDefault$b(lodash.exports),v1_1=__importDefault$b(v1_1$6),v4_1=__importDefault$b(v4_1$1),moment_1=__importDefault$b(moment$1.exports),ChangeSet_1$1=ChangeSet,getMacroFunction={transformValue:e=>`\n(value, args, modules, rowIndex, row, columnName) => {\n ${e}\n}\n`,transformRow:e=>`\n(row, args, modules, rowIndex, columns) => {\n ${e}\n}\n`},modules={lodash:lodash_1$2.default,uuidv1:v1_1.default,uuidv4:v4_1.default,moment:moment_1.default};function compileMacroFunction(macro,errors=[]){if(!macro)return null;let func;try{return func=eval(getMacroFunction[macro.type](macro.code)),func}catch(e){return errors.push(`Error compiling macro ${macro.name}: ${e.message}`),null}}function runMacroOnValue(e,t,n,o,r,i,a=[]){if(!e)return n;try{return e(n,t,modules,o,r,i)}catch(e){return a.push(`Error processing column ${i} on row ${o}: ${e.message}`),n}}function runMacroOnRow(e,t,n,o,r,i=[]){if(!e)return o;try{return e(o,t,modules,n,r)}catch(e){return i.push(`Error processing row ${n}: ${e.message}`),o}}function runMacroOnChangeSet(e,t,n,o,r,i){var a;const s=[],c=compileMacroFunction(e,s);if(!c)return null;if("transformValue"==e.type){let e=o;for(const o of n){const n=r.getChangeSetField(o.rowData,o.column,void 0,i?o.row:void 0,i),a=runMacroOnValue(c,t,o.value,o.row,o.rowData,o.column,s);e=(0,ChangeSet_1$1.setChangeSetValue)(e,n,a)}return e}if("transformRow"==e.type){let e=o;const i=lodash_1$2.default.uniq(n.map((e=>e.row)));for(const o of i){const i=null===(a=n.find((e=>e.row==o)))||void 0===a?void 0:a.rowData,s=lodash_1$2.default.uniq(n.map((e=>e.column))),l=r.getChangeSetRow(i,null,o,!0),u=runMacroOnRow(c,t,o,i,s);e=(0,ChangeSet_1$1.setChangeSetRowData)(e,l,u)}return e}}runMacro.compileMacroFunction=compileMacroFunction,runMacro.runMacroOnValue=runMacroOnValue,runMacro.runMacroOnRow=runMacroOnRow,runMacro.runMacroOnChangeSet=runMacroOnChangeSet;var deleteCascade={},__importDefault$a=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(deleteCascade,"__esModule",{value:!0}),deleteCascade.getDeleteCascades=void 0;const lodash_1$1=__importDefault$a(lodash.exports),ChangeSet_1=ChangeSet;function processDependencies(e,t,n,o,r,i,a,s){if(t.find((e=>e.title==r.pureName)))return;const c=n.filter((e=>e.refSchemaName==r.schemaName&&e.refTableName==r.pureName));for(const l of c){const c=a.tables.find((e=>e.pureName==l.pureName&&e.schemaName==l.schemaName)),u=[...o,l];c&&!s.includes(c.pureName)&&processDependencies(e,t,n,u,c,i,a,[...s,c.pureName]);const d={commandType:"delete",from:{name:{pureName:l.pureName,schemaName:l.schemaName}},where:{conditionType:"exists",subQuery:{commandType:"select",selectAll:!0,from:{name:{pureName:l.pureName,schemaName:l.schemaName},alias:"t0",relations:[...u].reverse().map(((e,t)=>({joinType:"INNER JOIN",alias:`t${t+1}`,name:{pureName:e.refTableName,schemaName:e.refSchemaName},conditions:e.columns.map((e=>({conditionType:"binary",operator:"=",left:{exprType:"column",columnName:e.columnName,source:{alias:`t${t}`}},right:{exprType:"column",columnName:e.refColumnName,source:{alias:`t${t+1}`}}})))})))},where:{conditionType:"and",conditions:[(0,ChangeSet_1.extractChangeSetCondition)(i,`t${u.length}`),...r.primaryKey.columns.map((e=>({conditionType:"binary",operator:"=",left:{exprType:"column",columnName:e.columnName,source:{alias:"t0"}},right:{exprType:"column",columnName:e.columnName,source:{name:l}}})))]}}}};let p=t.find((e=>e.title==l.pureName));p||(p={title:l.pureName,commands:[]},t.push(p)),p.commands.push(d)}}function getDeleteCascades(e,t){const n=[],o=lodash_1$1.default.flatten(t.tables.map((e=>e.foreignKeys)));for(const r of e.deletes){const i=t.tables.find((e=>e.pureName==r.pureName&&e.schemaName==r.schemaName));if(!i.primaryKey)continue;const a=[];processDependencies(e,a,o,[],i,r,t,[i.pureName]);for(const e of a){const t=n.find((t=>t.title==e.title));t?t.commands.push(...e.commands):n.push(e)}}return n}deleteCascade.getDeleteCascades=getDeleteCascades;var PerspectiveDisplay$1={},isSymbol=isSymbol_1;function baseExtremum$1(e,t,n){for(var o=-1,r=e.length;++o<r;){var i=e[o],a=t(i);if(null!=a&&(void 0===s?a==a&&!isSymbol(a):n(a,s)))var s=a,c=i}return c}var _baseExtremum=baseExtremum$1;function baseGt$1(e,t){return e>t}var _baseGt=baseGt$1,baseExtremum=_baseExtremum,baseGt=_baseGt,identity$1=identity_1;function max(e){return e&&e.length?baseExtremum(e,identity$1,baseGt):void 0}var max_1$1=max;function baseClamp$1(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}var _baseClamp=baseClamp$1,baseClamp=_baseClamp,toInteger$1=toInteger_1,MAX_ARRAY_LENGTH=4294967295;function toLength$1(e){return e?baseClamp(toInteger$1(e),0,MAX_ARRAY_LENGTH):0}var toLength_1=toLength$1,toInteger=toInteger_1,toLength=toLength_1;function baseFill$1(e,t,n,o){var r=e.length;for((n=toInteger(n))<0&&(n=-n>r?0:r+n),(o=void 0===o||o>r?r:toInteger(o))<0&&(o+=r),o=n>o?0:toLength(o);n<o;)e[n++]=t;return e}var _baseFill=baseFill$1,baseFill=_baseFill,isIterateeCall=_isIterateeCall;function fill(e,t,n,o){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&isIterateeCall(e,t,n)&&(n=0,o=r),baseFill(e,t,n,o)):[]}var fill_1$1=fill,browser={exports:{}},s=1e3,m=60*s,h=60*m,d=24*h,w=7*d,y=365.25*d,ms=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return parse$1(e);if("number"===n&&isFinite(e))return t.long?fmtLong(e):fmtShort(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse$1(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(e){var t=Math.abs(e);return t>=d?Math.round(e/d)+"d":t>=h?Math.round(e/h)+"h":t>=m?Math.round(e/m)+"m":t>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){var t=Math.abs(e);return t>=d?plural(e,t,d,"day"):t>=h?plural(e,t,h,"hour"):t>=m?plural(e,t,m,"minute"):t>=s?plural(e,t,s,"second"):e+" ms"}function plural(e,t,n,o){var r=t>=1.5*n;return Math.round(e/n)+" "+o+(r?"s":"")}function setup(e){function t(e){let o,r,i,a=null;function s(...e){if(!s.enabled)return;const n=s,r=Number(new Date),i=r-(o||r);n.diff=i,n.prev=o,n.curr=r,o=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((o,r)=>{if("%%"===o)return"%";a++;const i=t.formatters[r];if("function"==typeof i){const t=e[a];o=i.call(n,t),e.splice(a,1),a--}return o})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==t.namespaces&&(r=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),r=o.length;for(n=0;n<r;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,o;for(n=0,o=t.skips.length;n<o;n++)if(t.skips[n].test(e))return!1;for(n=0,o=t.names.length;n<o;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=ms,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}var common$1=setup;!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(o++,"%c"===e&&(r=o))})),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=common$1(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports);var __importDefault$9=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PerspectiveDisplay$1,"__esModule",{value:!0}),PerspectiveDisplay$1.PerspectiveDisplay=PerspectiveDisplay$1.PerspectiveDisplayRow=PerspectiveDisplay$1.PerspectiveDisplayColumn=void 0;const max_1=__importDefault$9(max_1$1),fill_1=__importDefault$9(fill_1$1),findIndex_1=__importDefault$9(findIndex_1$2),isPlainObject_1$1=__importDefault$9(isPlainObject_1$4),isArray_1$2=__importDefault$9(isArray_1$4),debug_1$2=__importDefault$9(browser.exports),dbg$2=(0,debug_1$2.default)("dbgate:PerspectiveDisplay");let lastJoinId=0;function getJoinId(){return lastJoinId+=1,lastJoinId}class PerspectiveDisplayColumn{constructor(e){this.display=e,this.parentNodes=[],this.colSpanAtLevel={},this.columnIndex=0,this.dataNode=null}get rowSpan(){return this.display.columnLevelCount-this.parentNodes.length}showParent(e){return!!this.colSpanAtLevel[e]}getColSpan(e){return this.colSpanAtLevel[e]}isVisible(e){return e==this.columnLevel}get columnLevel(){return this.parentNodes.length}getParentName(e){var t;return null===(t=this.parentNodes[e])||void 0===t?void 0:t.title}getParentNode(e){return this.parentNodes[e]}getParentTableDesignerId(e){var t,n;return(null===(t=this.parentNodes[e])||void 0===t?void 0:t.headerTableAttributes)?null===(n=this.parentNodes[e])||void 0===n?void 0:n.designerId:""}}PerspectiveDisplay$1.PerspectiveDisplayColumn=PerspectiveDisplayColumn;class PerspectiveDisplayRow{constructor(e){this.display=e,this.rowData=[],this.rowSpans=null,this.rowCellSkips=null,this.rowJoinIds=[],this.rowData=(0,fill_1.default)(Array(e.columns.length),void 0),this.rowSpans=(0,fill_1.default)(Array(e.columns.length),1),this.rowJoinIds=(0,fill_1.default)(Array(e.columns.length),0),this.rowCellSkips=(0,fill_1.default)(Array(e.columns.length),!1)}}PerspectiveDisplay$1.PerspectiveDisplayRow=PerspectiveDisplayRow;class PerspectiveDisplay{constructor(e,t){this.root=e,this.columns=[],this.rows=[],this.loadIndicatorsCounts={},this.fillColumns(e.childNodes,[e]),this.columns.length>0&&(this.columns[0].colSpanAtLevel[0]=this.columns.length),this.columnLevelCount=(0,max_1.default)(this.columns.map((e=>e.parentNodes.length)))+1;const n=this.collectRows(t,e.childNodes);dbg$2("collected rows",n),this.mergeRows(n)}getRowAt(e){for(;this.rows.length<=e;)this.rows.push(new PerspectiveDisplayRow(this));return this.rows[e]}fillColumns(e,t){for(const n of e)(n.generatesHiearchicGridColumn||n.generatesDataGridColumn)&&this.processColumn(n,t)}processColumn(e,t){var n,o;if(e.generatesDataGridColumn){const r=new PerspectiveDisplayColumn(this);r.title=e.columnTitle,r.dataField=e.dataField,r.parentNodes=t,r.display=this,r.columnIndex=this.columns.length,r.dataNode=e,r.displayType=null===(o=null===(n=e.parentNodeConfig)||void 0===n?void 0:n.columnDisplays)||void 0===o?void 0:o[e.columnName],this.columns.push(r)}if(e.generatesHiearchicGridColumn){const n=this.columns.length;this.fillColumns(e.childNodes,[...t,e]),this.columns.length>n&&(this.columns[n].colSpanAtLevel[t.length]=this.columns.length-n)}}findColumnIndexFromNode(e){return(0,findIndex_1.default)(this.columns,(t=>{var n,o,r;return t.dataNode.columnName==e.columnName&&(null===(o=null===(n=t.dataNode)||void 0===n?void 0:n.parentNode)||void 0===o?void 0:o.designerId)==(null===(r=null==e?void 0:e.parentNode)||void 0===r?void 0:r.designerId)}))}extractArray(e){return(0,isArray_1$2.default)(e)?e:(0,isPlainObject_1$1.default)(e)?[e]:[]}collectRows(e,t){const n=t.filter((e=>e.generatesDataGridColumn)),o=t.filter((e=>e.generatesHiearchicGridColumn)),r=n.map((e=>this.findColumnIndexFromNode(e))),i=[];for(const t of e){const e=n.map((e=>t[e.columnName])),a=[];for(const e of o)if(t[e.fieldName]){const n={rows:this.collectRows(this.extractArray(t[e.fieldName]),e.childNodes)};a.push(n)}i.push({rowData:e,columnIndexes:r,subRowCollections:a,incompleteRowsIndicator:t.incompleteRowsIndicator})}return i}fillRowSpans(){for(let e=0;e<this.columns.length;e++){let t=0,n=0;for(const o of this.rows)void 0===o.rowData[e]&&o.rowJoinIds[e]==this.rows[t].rowJoinIds[e]&&o.rowJoinIds[e]?(o.rowCellSkips[e]=!0,this.rows[t].rowSpans[e]=n-t+1):t=n,n++}}mergeRows(e){let t=0;for(const n of e){t+=this.mergeRow(n,t)}this.fillRowSpans()}mergeRow(e,t){var n;if((null===(n=e.incompleteRowsIndicator)||void 0===n?void 0:n.length)>0){for(const n of e.incompleteRowsIndicator)this.loadIndicatorsCounts[n]||(this.loadIndicatorsCounts[n]=t),t<this.loadIndicatorsCounts[n]&&(this.loadIndicatorsCounts[n]=t);return 0}const o=this.getRowAt(t);for(let t=0;t<e.columnIndexes.length;t++)o.rowData[e.columnIndexes[t]]=e.rowData[t];let r=1;for(const n of e.subRowCollections){let e=0,o=t;for(const t of n.rows){const n=this.mergeRow(t,o);e+=n,o+=n}e>r&&(r=e)}const i=getJoinId();for(let n=0;n<r;n++){const o=this.getRowAt(t+n);for(let t=0;t<e.columnIndexes.length;t++)o.rowJoinIds[e.columnIndexes[t]]=i}return r}}PerspectiveDisplay$1.PerspectiveDisplay=PerspectiveDisplay;var PerspectiveDataProvider={};!function(e){var t=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))},n=commonjsGlobal&&commonjsGlobal.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},o=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.PerspectiveDataProvider=e.PERSPECTIVE_PAGE_SIZE=void 0;const r=o(browser.exports);e.PERSPECTIVE_PAGE_SIZE=100;const i=(0,r.default)("dbgate:PerspectiveDataProvider");e.PerspectiveDataProvider=class{constructor(e,t,n){this.cache=e,this.loader=t,this.dataPatterns=n}loadData(e){return t(this,void 0,void 0,(function*(){return i("load data",e),e.bindingColumns?this.loadDataNested(e):this.loadDataFlat(e)}))}loadDataNested(e){return t(this,void 0,void 0,(function*(){const t=this.cache.getTableCache(e),o=t.getUncachedBindingGroups(e);if(o.length>0){const r=yield this.loader.loadGrouping(Object.assign(Object.assign({},e),{bindingValues:o}));for(const n of o)t.storeGroupSize(e,n,0);for(const o of r){const{_perspective_group_size_:r}=o,i=n(o,["_perspective_group_size_"]);t.storeGroupSize(e,e.bindingColumns.map((e=>i[e])),r)}}const r=[];let i=0,a=!1,s=!1;for(;i<e.bindingValues.length;i++){const n=e.bindingValues[i],o=t.getBindingGroup(n);if(o.loadedAll||(a?s=!0:(yield this.loadNextGroup(e,i),a=!0)),r.push(...o.loadedRows),r.length>=e.topCount||s)return{rows:r.slice(0,e.topCount),incomplete:e.topCount<r.length||!o.loadedAll||i<e.bindingValues.length-1}}if(i>=e.bindingValues.length)return{rows:r,incomplete:!1}}))}loadNextGroup(n,o){return t(this,void 0,void 0,(function*(){const r=this.cache.getTableCache(n),i=[],a=[];let s=0;const c=()=>t(this,void 0,void 0,(function*(){const e=yield this.loader.loadData(Object.assign(Object.assign({},n),{bindingValues:i.map((e=>n.bindingValues[e]))}));for(const t of e){const e=a.find((e=>e.matchRow(t)));e&&e.loadedRows.push(t)}for(const e of a)e.loadedAll=!0}));for(;o<n.bindingValues.length;o++){const t=n.bindingValues[o],l=r.getBindingGroup(t);if(l&&!l.loadedAll)if(0!=l.groupSize){if(l.groupSize>=e.PERSPECTIVE_PAGE_SIZE){if(i.length>0)return void(yield c());const t=yield this.loader.loadData(Object.assign(Object.assign({},n),{topCount:null,range:{offset:l.loadedRows.length,limit:e.PERSPECTIVE_PAGE_SIZE},bindingValues:[l.bindingValues]}));return l.loadedRows=[...l.loadedRows,...t],void(l.loadedAll=t.length<e.PERSPECTIVE_PAGE_SIZE)}if(s+l.groupSize>e.PERSPECTIVE_PAGE_SIZE)return void(yield c());i.push(o),a.push(l),s+=l.groupSize}else l.loadedAll=!0}i.length>0&&(yield c())}))}loadDataFlat(e){return t(this,void 0,void 0,(function*(){const t=this.cache.getTableCache(e);if(e.topCount<=t.loadedCount)return t.getRowsResult(e);t.dataColumns=e.dataColumns,t.allColumns=e.allColumns;const n=yield this.loader.loadData(Object.assign(Object.assign({},e),{topCount:null,range:{offset:t.loadedCount,limit:e.topCount-t.loadedCount}}));if(!n)return{rows:[],incomplete:!1};if(n.errorMessage)throw new Error(n.errorMessage);return t.loadedRows=[...t.loadedRows,...n],t.loadedAll=n.length<e.topCount-t.loadedCount,t.getRowsResult(e)}))}loadRowCount(e){return t(this,void 0,void 0,(function*(){const t=this.cache.getTableCache(e);if(null!=t.allRowCount)return t.allRowCount;const n=yield this.loader.loadRowCount(Object.assign({},e));if(n.errorMessage)throw new Error(n.errorMessage);return t.allRowCount=parseInt(n.count),t.allRowCount}))}}}(PerspectiveDataProvider);var PerspectiveCache$1={},arrayFilter=_arrayFilter,arrayMap$2=_arrayMap,baseProperty=_baseProperty,baseTimes=_baseTimes,isArrayLikeObject$1=isArrayLikeObject_1,nativeMax=Math.max;function unzip$1(e){if(!e||!e.length)return[];var t=0;return e=arrayFilter(e,(function(e){if(isArrayLikeObject$1(e))return t=nativeMax(e.length,t),!0})),baseTimes(t,(function(t){return arrayMap$2(e,baseProperty(t))}))}var unzip_1=unzip$1,baseRest$1=_baseRest,unzip=unzip_1,zip=baseRest$1(unzip),zip_1$1=zip,SetCache=_SetCache,arrayIncludes=_arrayIncludes,arrayIncludesWith=_arrayIncludesWith,arrayMap$1=_arrayMap,baseUnary=_baseUnary,cacheHas=_cacheHas,LARGE_ARRAY_SIZE=200;function baseDifference$1(e,t,n,o){var r=-1,i=arrayIncludes,a=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=arrayMap$1(t,baseUnary(n))),o?(i=arrayIncludesWith,a=!1):t.length>=LARGE_ARRAY_SIZE&&(i=cacheHas,a=!1,t=new SetCache(t));e:for(;++r<s;){var u=e[r],d=null==n?u:n(u);if(u=o||0!==u?u:0,a&&d==d){for(var p=l;p--;)if(t[p]===d)continue e;c.push(u)}else i(t,d,o)||c.push(u)}return c}var _baseDifference=baseDifference$1,baseDifference=_baseDifference,baseFlatten=_baseFlatten,baseRest=_baseRest,isArrayLikeObject=isArrayLikeObject_1,difference$1=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0)):[]})),difference_1$1=difference$1,__importDefault$8=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PerspectiveCache$1,"__esModule",{value:!0}),PerspectiveCache$1.PerspectiveCache=PerspectiveCache$1.PerspectiveCacheTable=PerspectiveCache$1.PerspectiveBindingGroup=void 0;const pick_1$1=__importDefault$8(pick_1$4),zip_1=__importDefault$8(zip_1$1),difference_1=__importDefault$8(difference_1$1),debug_1$1=__importDefault$8(browser.exports),json_stable_stringify_1$1=__importDefault$8(jsonStableStringify),perspectiveTools_1=perspectiveTools,dbg$1=(0,debug_1$1.default)("dbgate:PerspectiveCache");class PerspectiveBindingGroup{constructor(e){this.table=e,this.loadedRows=[]}matchRow(e){return this.table.bindingColumns.every(((t,n)=>(0,perspectiveTools_1.perspectiveValueMatcher)(e[t],this.bindingValues[n])))}}PerspectiveCache$1.PerspectiveBindingGroup=PerspectiveBindingGroup;class PerspectiveCacheTable{constructor(e,t){this.cache=t,this.loadedRows=[],this.bindingGroups={},this.allRowCount=null,this.schemaName=e.schemaName,this.pureName=e.pureName,this.bindingColumns=e.bindingColumns,this.dataColumns=e.dataColumns,this.loadedAll=!1}get loadedCount(){return this.loadedRows.length}getRowsResult(e){return{rows:this.loadedRows.slice(0,e.topCount),incomplete:e.topCount<this.loadedCount||!this.loadedAll}}getBindingGroup(e){const t=(0,json_stable_stringify_1$1.default)(e);return this.bindingGroups[t]}getUncachedBindingGroups(e){const t=[];for(const n of e.bindingValues){const e=(0,json_stable_stringify_1$1.default)(n);this.bindingGroups[e]||t.push(n)}return t}storeGroupSize(e,t,n){const o=e.bindingValues.find((e=>(0,zip_1.default)(e,t).every((([e,t])=>(0,perspectiveTools_1.perspectiveValueMatcher)(e,t)))));if(o){const e=(0,json_stable_stringify_1$1.default)(o),r=new PerspectiveBindingGroup(this);r.bindingValues=t,r.groupSize=n,this.bindingGroups[e]=r}else dbg$1("Group not found",t)}}PerspectiveCache$1.PerspectiveCacheTable=PerspectiveCacheTable;class PerspectiveCache{constructor(){this.tables={},this.dataPatterns=[]}getTableCache(e){const t=(0,json_stable_stringify_1$1.default)((0,pick_1$1.default)(e,["schemaName","pureName","bindingColumns","databaseConfig","orderBy","sqlCondition"]));let n=this.tables[t];return n&&(0,difference_1.default)(e.dataColumns,n.dataColumns).length>0&&!n.allColumns&&(dbg$1("Delete cache because incomplete columns",e.pureName,n.dataColumns),delete this.tables[t],n=null),n||(n=new PerspectiveCacheTable(e,this),this.tables[t]=n,n)}clear(){this.tables={},this.dataPatterns=[]}}PerspectiveCache$1.PerspectiveCache=PerspectiveCache;var processPerspectiveDefaultColunns$1={};Object.defineProperty(processPerspectiveDefaultColunns$1,"__esModule",{value:!0}),processPerspectiveDefaultColunns$1.processPerspectiveDefaultColunns=processPerspectiveDefaultColunns$1.shouldProcessPerspectiveDefaultColunns=processPerspectiveDefaultColunns$1.perspectiveNodesHaveStructure=void 0;const dbgate_tools_1$4=lib$5,PerspectiveTreeNode_1=PerspectiveTreeNode$1,namePredicates=[e=>"name"==e.toLowerCase(),e=>"title"==e.toLowerCase(),e=>e.toLowerCase().includes("name"),e=>e.toLowerCase().includes("title"),e=>e.toLowerCase().includes("subject")];function getPerspectiveDefaultColumns(e,t,n){const o=e.columns.map((e=>e.columnName)),r=[...namePredicates,t=>{var n,o,r;return null===(r=null===(o=null===(n=e.columns.find((e=>e.columnName==t)))||void 0===n?void 0:n.dataType)||void 0===o?void 0:o.toLowerCase())||void 0===r?void 0:r.includes("char")}];for(const e of r){const t=o.find(e);if(t)return[[t],null]}if(n){const t=[t=>{var o,r;return 1==(null===(r=null===(o=(0,dbgate_tools_1$4.findForeignKeyForColumn)(e,t))||void 0===o?void 0:o.columns)||void 0===r?void 0:r.length)&&!n.includes(t)},t=>{var n,o;return 1==(null===(o=null===(n=(0,dbgate_tools_1$4.findForeignKeyForColumn)(e,t))||void 0===n?void 0:n.columns)||void 0===o?void 0:o.length)}];for(const e of t){const t=o.find(e);if(t)return[null,[t]]}}return[[o[0]],null]}function getPerspectiveDefaultCollectionColumns(e){const t=e.columns.map((e=>e.name)),n=[...namePredicates,t=>{var n,o;return null===(o=null===(n=e.columns.find((e=>e.name==t)))||void 0===n?void 0:n.types)||void 0===o?void 0:o.includes("string")}];for(const e of n){const n=t.find(e);if(n)return[n]}}function perspectiveNodesHaveStructure(e,t,n,o,r){var i;for(const a of e.nodes){const e=null===(i=null==t?void 0:t[a.conid||o])||void 0===i?void 0:i[a.database||r];if(!e)return!1;const s=e.tables.find((e=>e.pureName==a.pureName&&e.schemaName==a.schemaName)),c=e.views.find((e=>e.pureName==a.pureName&&e.schemaName==a.schemaName)),l=e.collections.find((e=>e.pureName==a.pureName&&e.schemaName==a.schemaName));if(!s&&!c&&!l)return!1;if(l&&!(null==n?void 0:n[a.designerId]))return!1}return!0}function shouldProcessPerspectiveDefaultColunns(e,t,n,o,r){return 0!=e.nodes.filter((e=>!e.defaultColumnsProcessed)).length&&perspectiveNodesHaveStructure(e,t,n,o,r)}function processPerspectiveDefaultColunnsStep(e,t,n,o,r){var i,a;const s=e.nodes.find((t=>t.designerId==e.rootDesignerId));if(!s)return null;const c=null===(i=null==t?void 0:t[s.conid||o])||void 0===i?void 0:i[s.database||r];if(!c)return null;const l=c.tables.find((e=>e.pureName==s.pureName&&e.schemaName==s.schemaName)),u=c.views.find((e=>e.pureName==s.pureName&&e.schemaName==s.schemaName)),d=new PerspectiveTreeNode_1.PerspectiveTableNode(l||u,t,e,null,null,{conid:o,database:r},null,e.rootDesignerId);for(const i of e.nodes){if(i.defaultColumnsProcessed)continue;const s=null===(a=null==t?void 0:t[i.conid||o])||void 0===a?void 0:a[i.database||r];if(!s)continue;const c=s.tables.find((e=>e.pureName==i.pureName&&e.schemaName==i.schemaName)),l=s.views.find((e=>e.pureName==i.pureName&&e.schemaName==i.schemaName)),u=s.collections.find((e=>e.pureName==i.pureName&&e.schemaName==i.schemaName));if(c||l){const t=d.findNodeByDesignerId(i.designerId);if(!t){const[t]=getPerspectiveDefaultColumns(c||l,s,null);return Object.assign(Object.assign({},e),{nodes:e.nodes.map((e=>e.designerId==i.designerId?Object.assign(Object.assign({},e),{defaultColumnsProcessed:!0,checkedColumns:t}):e))})}const n=t.childNodes.filter((e=>e.isCircular)).map((e=>e.columnName)),[o,r]=getPerspectiveDefaultColumns(c||l,s,n);if(!r)return Object.assign(Object.assign({},e),{nodes:e.nodes.map((e=>e.designerId==i.designerId?Object.assign(Object.assign({},e),{defaultColumnsProcessed:!0,checkedColumns:o}):e))});{const n=t.childNodes.find((e=>e.columnName==r[0]));if(null==n?void 0:n.designerId)return Object.assign(Object.assign({},e),{nodes:e.nodes.map((e=>e.designerId==n.designerId?Object.assign(Object.assign({},e),{isNodeChecked:!0}):e.designerId==i.designerId?Object.assign(Object.assign({},e),{defaultColumnsProcessed:!0}):e))});if(n){const[t,o]=n.ensureNodeConfig(e);return o.isNodeChecked=!0,Object.assign(Object.assign({},t),{nodes:t.nodes.map((e=>e.designerId==i.designerId?Object.assign(Object.assign({},e),{defaultColumnsProcessed:!0}):e))})}}}if(u){const t=getPerspectiveDefaultCollectionColumns(null==n?void 0:n[i.designerId]);return Object.assign(Object.assign({},e),{nodes:e.nodes.map((e=>e.designerId==i.designerId?Object.assign(Object.assign({},e),{defaultColumnsProcessed:!0,checkedColumns:t}):e))})}}return null}function markAllProcessed(e){return Object.assign(Object.assign({},e),{nodes:e.nodes.map((e=>Object.assign(Object.assign({},e),{defaultColumnsProcessed:!0})))})}function processPerspectiveDefaultColunns(e,t,n,o,r){for(;e.nodes.filter((e=>!e.defaultColumnsProcessed)).length>0;){const i=processPerspectiveDefaultColunnsStep(e,t,n,o,r);if(!i)return markAllProcessed(e);if(i.nodes.filter((e=>e.defaultColumnsProcessed)).length<=e.nodes.filter((e=>e.defaultColumnsProcessed)).length)return markAllProcessed(e);e=i}return markAllProcessed(e)}processPerspectiveDefaultColunns$1.perspectiveNodesHaveStructure=perspectiveNodesHaveStructure,processPerspectiveDefaultColunns$1.shouldProcessPerspectiveDefaultColunns=shouldProcessPerspectiveDefaultColunns,processPerspectiveDefaultColunns$1.processPerspectiveDefaultColunns=processPerspectiveDefaultColunns;var PerspectiveDataPattern={},baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1,boolTag="[object Boolean]";function isBoolean$1(e){return!0===e||!1===e||isObjectLike(e)&&baseGetTag(e)==boolTag}var isBoolean_1$1=isBoolean$1,__importDefault$7=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PerspectiveDataPattern,"__esModule",{value:!0}),PerspectiveDataPattern.analyseDataPattern=void 0;const isString_1=__importDefault$7(isString_1$8),isPlainObject_1=__importDefault$7(isPlainObject_1$4),isNumber_1=__importDefault$7(isNumber_1$3),isBoolean_1=__importDefault$7(isBoolean_1$1),isArray_1$1=__importDefault$7(isArray_1$4),dbgate_tools_1$3=lib$5;function detectValueType(e){return(0,isString_1.default)(e)?"string":(0,isNumber_1.default)(e)?"number":(0,isBoolean_1.default)(e)?"boolean":(null==e?void 0:e.$oid)?"oid":(0,isPlainObject_1.default)(e)||(0,isArray_1$1.default)(e)?"json":null==e?"null":void 0}function addObjectToColumns(e,t){if((0,isPlainObject_1.default)(t))for(const n of Object.keys(t)){let o=e.find((e=>e.name==n));o||(o={name:n,types:[],columns:[]},e.push(o));const r=t[n],i=detectValueType(r);if(o.types.includes(i)||o.types.push(i),(0,isPlainObject_1.default)(r)&&"oid"!=i&&addObjectToColumns(o.columns,r),(0,isArray_1$1.default)(r))for(const e of r)addObjectToColumns(o.columns,e);if((0,isString_1.default)(r)){const e=(0,dbgate_tools_1$3.safeJsonParse)(r);if(e&&((0,isPlainObject_1.default)(e)||(0,isArray_1$1.default)(e))&&(o.types.includes("json")||o.types.push("json"),(0,isPlainObject_1.default)(e)&&addObjectToColumns(o.columns,e),(0,isArray_1$1.default)(e)))for(const t of e)addObjectToColumns(o.columns,t)}}}function analyseDataPattern(e,t){const n=Object.assign(Object.assign({},e),{columns:[]});for(const e of t)addObjectToColumns(n.columns,e);return n}PerspectiveDataPattern.analyseDataPattern=analyseDataPattern;var PerspectiveDataLoader$1={},baseAssignValue=_baseAssignValue,baseForOwn=_baseForOwn,baseIteratee$1=_baseIteratee;function mapValues(e,t){var n={};return t=baseIteratee$1(t),baseForOwn(e,(function(e,o,r){baseAssignValue(n,o,t(e,o,r))})),n}var mapValues_1$1=mapValues,__awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))},__importDefault$6=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PerspectiveDataLoader$1,"__esModule",{value:!0}),PerspectiveDataLoader$1.PerspectiveDataLoader=void 0;const debug_1=__importDefault$6(browser.exports),mapValues_1=__importDefault$6(mapValues_1$1),isArray_1=__importDefault$6(isArray_1$4),dbgate_tools_1$2=lib$5;function normalizeLoadedRow(e){return(0,mapValues_1.default)(e,(e=>(0,dbgate_tools_1$2.safeJsonParse)(e)||e))}function normalizeResult(e){return(0,isArray_1.default)(e)?e.map(normalizeLoadedRow):e.errorMessage?e:Object.assign(Object.assign({},e),{errorMessage:"Unspecified error"})}const dbg=(0,debug_1.default)("dbgate:PerspectiveDataLoader");class PerspectiveDataLoader{constructor(e){this.apiCall=e}buildSqlCondition(e){const{schemaName:t,pureName:n,bindingColumns:o,bindingValues:r,dataColumns:i,orderBy:a,sqlCondition:s}=e,c=[];return s&&c.push(s),1==(null==o?void 0:o.length)&&c.push({conditionType:"in",expr:{exprType:"column",columnName:o[0],source:{name:{schemaName:t,pureName:n}}},values:r.map((e=>e[0]))}),c.length>0?{conditionType:"and",conditions:c}:null}loadGroupingSqlDb(e){return __awaiter$f(this,void 0,void 0,(function*(){const{schemaName:t,pureName:n,bindingColumns:o}=e,r=o.map((e=>({exprType:"column",columnName:e,source:{name:{schemaName:t,pureName:n}}}))),i={commandType:"select",from:{name:{schemaName:t,pureName:n}},columns:[{exprType:"call",func:"COUNT",args:[{exprType:"raw",sql:"*"}],alias:"_perspective_group_size_"},...r],where:this.buildSqlCondition(e)};i.groupBy=r,(null==dbg?void 0:dbg.enabled)&&dbg(`LOAD COUNTS, table=${e.pureName}, columns=${null==o?void 0:o.join(",")}`);const a=yield this.apiCall("database-connections/sql-select",{conid:e.databaseConfig.conid,database:e.databaseConfig.database,select:i});return a.errorMessage?a:a.rows.map((e=>Object.assign(Object.assign({},e),{_perspective_group_size_:parseInt(e._perspective_group_size_)})))}))}loadGroupingDocDb(e){return __awaiter$f(this,void 0,void 0,(function*(){const{schemaName:t,pureName:n,bindingColumns:o}=e,r={condition:this.buildSqlCondition(e),groupByColumns:o,aggregateColumns:[{alias:"pergrpsize",aggregateFunction:"count"}]};(null==dbg?void 0:dbg.enabled)&&dbg(`LOAD COUNTS, table=${e.pureName}, columns=${null==o?void 0:o.join(",")}`);const i=yield this.apiCall("database-connections/collection-data",{conid:e.databaseConfig.conid,database:e.databaseConfig.database,options:{pureName:n,aggregate:r}});return i.errorMessage?i:i.rows.map((e=>Object.assign(Object.assign({},e),{_perspective_group_size_:parseInt(e.pergrpsize)})))}))}loadGrouping(e){return __awaiter$f(this,void 0,void 0,(function*(){const{engineType:t}=e;switch(t){case"sqldb":return this.loadGroupingSqlDb(e);case"docdb":return this.loadGroupingDocDb(e)}}))}loadDataSqlDb(e){var t,n,o;return __awaiter$f(this,void 0,void 0,(function*(){const{schemaName:r,pureName:i,bindingColumns:a,bindingValues:s,dataColumns:c,orderBy:l,sqlCondition:u,engineType:d}=e;if(0==(null==c?void 0:c.length))return[];const p={commandType:"select",from:{name:{schemaName:r,pureName:i}},columns:null==c?void 0:c.map((e=>({exprType:"column",columnName:e,source:{name:{schemaName:r,pureName:i}}}))),selectAll:!c,orderBy:(null==l?void 0:l.length)>0?null==l?void 0:l.map((({columnName:e,order:t})=>({exprType:"column",columnName:e,direction:t,source:{name:{schemaName:r,pureName:i}}}))):null,range:e.range,where:this.buildSqlCondition(e)};(null==dbg?void 0:dbg.enabled)&&dbg(`LOAD DATA, table=${e.pureName}, columns=${null===(t=e.dataColumns)||void 0===t?void 0:t.join(",")}, range=${null===(n=e.range)||void 0===n?void 0:n.offset},${null===(o=e.range)||void 0===o?void 0:o.limit}`);const m=yield this.apiCall("database-connections/sql-select",{conid:e.databaseConfig.conid,database:e.databaseConfig.database,select:p});return m.errorMessage?m:m.rows}))}getDocDbLoadOptions(e,t){var n,o,r;const{pureName:i}=e;return{pureName:i,condition:this.buildSqlCondition(e),sort:t&&(null===(n=e.orderBy)||void 0===n?void 0:n.length)>0?e.orderBy.map((e=>Object.assign(Object.assign({},e),{direction:e.order}))):void 0,skip:null===(o=e.range)||void 0===o?void 0:o.offset,limit:null===(r=e.range)||void 0===r?void 0:r.limit}}loadDataDocDb(e){var t,n,o;return __awaiter$f(this,void 0,void 0,(function*(){(null==dbg?void 0:dbg.enabled)&&dbg(`LOAD DATA, collection=${e.pureName}, columns=${null===(t=e.dataColumns)||void 0===t?void 0:t.join(",")}, range=${null===(n=e.range)||void 0===n?void 0:n.offset},${null===(o=e.range)||void 0===o?void 0:o.limit}`);const r=this.getDocDbLoadOptions(e,!0),i=yield this.apiCall("database-connections/collection-data",{conid:e.databaseConfig.conid,database:e.databaseConfig.database,options:r});return i.errorMessage?i:i.rows}))}loadData(e){return __awaiter$f(this,void 0,void 0,(function*(){const{engineType:t}=e;switch(t){case"sqldb":return normalizeResult(yield this.loadDataSqlDb(e));case"docdb":return normalizeResult(yield this.loadDataDocDb(e))}}))}loadRowCountSqlDb(e){return __awaiter$f(this,void 0,void 0,(function*(){const{schemaName:t,pureName:n,bindingColumns:o,bindingValues:r,dataColumns:i,orderBy:a,sqlCondition:s}=e,c={commandType:"select",from:{name:{schemaName:t,pureName:n}},columns:[{exprType:"raw",sql:"COUNT(*)",alias:"count"}],where:this.buildSqlCondition(e)},l=yield this.apiCall("database-connections/sql-select",{conid:e.databaseConfig.conid,database:e.databaseConfig.database,select:c});return l.errorMessage?l:l.rows[0]}))}loadRowCountDocDb(e){return __awaiter$f(this,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},this.getDocDbLoadOptions(e,!1)),{countDocuments:!0});return yield this.apiCall("database-connections/collection-data",{conid:e.databaseConfig.conid,database:e.databaseConfig.database,options:t})}))}loadRowCount(e){return __awaiter$f(this,void 0,void 0,(function*(){const{engineType:t}=e;switch(t){case"sqldb":return this.loadRowCountSqlDb(e);case"docdb":return this.loadRowCountDocDb(e)}}))}}PerspectiveDataLoader$1.PerspectiveDataLoader=PerspectiveDataLoader;var DataReplicator$1={},__awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))},__importDefault$5=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(DataReplicator$1,"__esModule",{value:!0}),DataReplicator$1.DataReplicator=void 0;const dbgate_tools_1$1=lib$5,pick_1=__importDefault$5(pick_1$4),omit_1=__importDefault$5(omit_1$2),json_stable_stringify_1=__importDefault$5(jsonStableStringify),logger$1=(0,dbgate_tools_1$1.getLogger)("dataReplicator");class ReplicatorReference{constructor(e,t,n,o){this.base=e,this.ref=t,this.isMandatory=n,this.foreignKey=o}get columnName(){return this.foreignKey.columns[0].columnName}}class ReplicatorWeakReference{constructor(e,t,n){this.base=e,this.ref=t,this.foreignKey=n}get columnName(){return this.foreignKey.columns[0].columnName}}class ReplicatorItemHolder{get name(){return this.item.name}constructor(e,t){var n,o,r,i,a,s,c,l;if(this.item=e,this.replicator=t,this.references=[],this.backReferences=[],this.weakReferences=[],this.isPlanned=!1,this.idMap={},this.refByColumn={},this.table=t.db.tables.find((t=>t.pureName.toUpperCase()==e.name.toUpperCase())),this.autoColumn=null===(n=this.table.columns.find((e=>e.autoIncrement)))||void 0===n?void 0:n.columnName,1==(null===(r=null===(o=this.table.primaryKey)||void 0===o?void 0:o.columns)||void 0===r?void 0:r.length)&&(null===(s=null===(a=null===(i=this.table.primaryKey)||void 0===i?void 0:i.columns)||void 0===a?void 0:a[0])||void 0===s?void 0:s.columnName)==this.autoColumn||(this.autoColumn=null),!this.autoColumn&&1==(null===(l=null===(c=this.table.primaryKey)||void 0===c?void 0:c.columns)||void 0===l?void 0:l.length)){const e=this.table.primaryKey.columns[0].columnName,t=this.table.columns.find((t=>t.columnName==e));(0,dbgate_tools_1$1.isTypeNumber)(null==t?void 0:t.dataType)&&(this.autoColumn=e,this.isManualAutoColumn=!0)}this.autoColumn&&this.replicator.options.generateSqlScript&&(this.isManualAutoColumn=!0)}initializeReferences(){var e,t;for(const n of this.table.foreignKeys){if(1!=(null===(e=n.columns)||void 0===e?void 0:e.length))continue;const o=this.replicator.itemHolders.find((e=>e.name.toUpperCase()==n.refTableName.toUpperCase())),r=null===(t=this.table.columns.find((e=>{var t;return e.columnName==(null===(t=n.columns[0])||void 0===t?void 0:t.columnName)})))||void 0===t?void 0:t.notNull;if(null==o){if(!r){const e=new ReplicatorWeakReference(this,this.replicator.db.tables.find((e=>e.pureName==n.refTableName)),n);this.weakReferences.push(e)}}else{const e=new ReplicatorReference(this,o,r,n);this.references.push(e),this.refByColumn[e.columnName]=e,o.isReferenced=!0}}}createInsertObject(e,t){const n=(0,omit_1.default)((0,pick_1.default)(e,this.table.columns.map((e=>e.columnName))),[this.autoColumn,...this.backReferences.map((e=>e.columnName)),...t||[]]);for(const t in n){const o=this.refByColumn[t];if(o){const r=n[t];if(n[t]=o.ref.idMap[r],o.isMandatory&&null==n[t]){if(this.replicator.options.skipRowsWithUnresolvedRefs)return null;throw new Error(`Unresolved reference, base=${o.base.name}, ref=${o.ref.name}, ${t}=${e[t]}`)}}}return n}createUpdateObject(e){return(0,omit_1.default)((0,pick_1.default)(e,this.table.columns.map((e=>e.columnName))),[this.autoColumn,...this.backReferences.map((e=>e.columnName)),...this.references.map((e=>e.columnName))])}getMissingWeakRefsForRow(e){var t;return __awaiter$e(this,void 0,void 0,(function*(){if(!this.replicator.options.setNullForUnresolvedNullableRefs||!(null===(t=this.weakReferences)||void 0===t?void 0:t.length))return[];const n=(yield(0,dbgate_tools_1$1.runQueryOnDriver)(this.replicator.pool,this.replicator.driver,(t=>{t.put("^select "),t.putCollection(",",this.weakReferences,(n=>{t.put("(^case ^when ^exists (^select * ^from %f where %i = %v) ^then 1 ^else 0 ^end) as %i",n.ref,n.foreignKey.columns[0].refColumnName,e[n.foreignKey.columns[0].columnName],n.foreignKey.columns[0].columnName)})),this.replicator.driver.dialect.requireFromDual&&t.put(" ^from ^dual")}))).rows[0];return this.weakReferences.filter((e=>0==n[e.columnName])).map((e=>e.columnName))}))}runImport(){return __awaiter$e(this,void 0,void 0,(function*(){const e=yield this.item.openStream(),t=this.replicator.driver,n=this.replicator.pool;let o=0,r=0,i=0,a=0,s=0,c=0,l=new Date;const{deleteMissing:u,deleteRestrictionColumns:d}=this.item,p={},m={},f=(0,dbgate_tools_1$1.createAsyncWriteStream)(this.replicator.stream,{processItem:e=>__awaiter$e(this,void 0,void 0,(function*(){if(e.__isStreamHeader)return;const a=()=>__awaiter$e(this,void 0,void 0,(function*(){var o,i,a;let s=this.createInsertObject(e);const c=yield(0,dbgate_tools_1$1.runQueryOnDriver)(n,t,(e=>{e.put("^select %i ^from %f ^where ",this.autoColumn,this.table),e.putCollection(" and ",this.item.matchColumns,(t=>{e.put("%i = %v",t,s[t])}))})),l=null===(a=null===(i=Object.entries((null===(o=null==c?void 0:c.rows)||void 0===o?void 0:o[0])||{}))||void 0===i?void 0:i[0])||void 0===a?void 0:a[1];return null!=l&&(r+=1,this.idMap[e[this.autoColumn]]=l),l})),f=t=>__awaiter$e(this,void 0,void 0,(function*(){const n=this.createUpdateObject(e);0!=Object.keys(n).length?(yield this.replicator.runDumperCommand((e=>{e.put("^update %f ^ set ",this.table),e.putCollection(",",Object.keys(n),(t=>{e.put("%i = %v",t,n[t])})),e.put(" ^where %i = %v",this.autoColumn,t),e.endCommand()})),i+=1):c+=1})),h=()=>__awaiter$e(this,void 0,void 0,(function*(){var r,i,a;const s=yield this.getMissingWeakRefsForRow(e);let l=this.createInsertObject(e,s);if(null==l)return void(c+=1);if(this.isManualAutoColumn){const t=yield this.replicator.generateIdentityValue(this.autoColumn,this.table);l=Object.assign(Object.assign({},l),{[this.autoColumn]:t}),this.idMap[e[this.autoColumn]]=t}let u=yield this.replicator.runDumperQuery((e=>{e.put("^insert ^into %f (%,i) ^values (%,v)",this.table,Object.keys(l),Object.values(l)),e.endCommand(),this.autoColumn&&this.isReferenced&&!this.replicator.driver.dialect.requireStandaloneSelectForScopeIdentity&&!this.isManualAutoColumn&&e.selectScopeIdentity(this.table)}));if(o+=1,this.autoColumn&&this.isReferenced&&!this.isManualAutoColumn){this.replicator.driver.dialect.requireStandaloneSelectForScopeIdentity&&(u=yield(0,dbgate_tools_1$1.runQueryOnDriver)(n,t,(e=>e.selectScopeIdentity(this.table))));const o=null===(a=null===(i=Object.entries(null===(r=null==u?void 0:u.rows)||void 0===r?void 0:r[0]))||void 0===i?void 0:i[0])||void 0===a?void 0:a[1];return null!=o&&(this.idMap[e[this.autoColumn]]=o),o}})),g=()=>{const t=this.createInsertObject(e);if((null==d?void 0:d.length)>0){const e=(0,pick_1.default)(t,d),n=(0,json_stable_stringify_1.default)(e);p[n]=e}const n=(0,pick_1.default)(t,this.item.matchColumns);m[(0,json_stable_stringify_1.default)(n)]=n},_=this.item.findExisting(e),$=this.item.updateExisting(e),b=this.item.createNew(e);u&&g();let y=null;_&&(y=yield a()),$&&null!=y&&(yield f(y)),b&&null==y&&(y=yield h()),null==y&&_&&(s+=1),(new Date).getTime()-l.getTime()>5e3&&(logger$1.info(`Replicating ${this.item.name} in progress, inserted ${o} rows, mapped ${r} rows, missing ${s} rows, skipped ${c} rows, updated ${i} rows`),l=new Date)}))}),h=(e,t,n)=>{e.putCollection(n?" or ":" and ",t,(t=>{e.put("("),e.putCollection(n?" and ":" or ",Object.keys(t),(o=>{e.put(n?"%i = %v":"not (%i = %v)",o,t[o])})),e.put(")")}))},g=e=>{const t=Object.values(p),n=Object.values(m);0==t.length&&0==n.length||(e.put(" ^where "),(null==d?void 0:d.length)>0&&(e.put("("),h(e,t,!0),e.put(")"),n.length>0&&e.put(" ^and ")),h(e,Object.values(m),!1))},_=()=>__awaiter$e(this,void 0,void 0,(function*(){const e=yield(0,dbgate_tools_1$1.runQueryOnDriver)(n,t,(e=>{e.put("^select count(*) as ~cnt ^from %f",this.table),g(e),e.endCommand()})),o=parseInt(e.rows[0].cnt);o>0&&(yield this.replicator.runDumperCommand((e=>{e.put("^delete ^from %f",this.table),g(e),e.endCommand()})),a+=o)}));return yield this.replicator.copyStream(e,f,{}),u&&(yield _()),{inserted:o,mapped:r,missing:s,skipped:c,updated:i,deleted:a}}))}}class DataReplicator{constructor(e,t,n,o,r,i,a={}){this.pool=e,this.driver=t,this.db=n,this.items=o,this.stream=r,this.copyStream=i,this.options=a,this.itemPlan=[],this.result="",this.identityValues={},this.itemHolders=o.map((e=>new ReplicatorItemHolder(e,this))),this.itemHolders.forEach((e=>e.initializeReferences())),this.dumper=t.createDumper()}findItemToPlan(){for(const e of this.itemHolders)if(!e.isPlanned&&e.references.every((e=>e.ref.isPlanned)))return e;for(const e of this.itemHolders)if(!e.isPlanned&&e.references.every((e=>e.ref.isPlanned||!e.isMandatory))){const t=e.references.filter((e=>!e.ref.isPlanned));return e.backReferences=t,e}throw new Error("Cycle in mandatory references")}createPlan(){for(;this.itemPlan.length<this.itemHolders.length;){const e=this.findItemToPlan();e.isPlanned=!0,this.itemPlan.push(e)}}runDumperCommand(e){return __awaiter$e(this,void 0,void 0,(function*(){this.options.generateSqlScript?e(this.dumper):yield(0,dbgate_tools_1$1.runCommandOnDriver)(this.pool,this.driver,e)}))}runDumperQuery(e){return __awaiter$e(this,void 0,void 0,(function*(){return this.options.generateSqlScript?(e(this.dumper),{rows:[]}):yield(0,dbgate_tools_1$1.runQueryOnDriver)(this.pool,this.driver,e)}))}generateIdentityValue(e,t){var n;return __awaiter$e(this,void 0,void 0,(function*(){const o=`${t.schemaName}.${t.pureName}`;if(!(o in this.identityValues)){const r=yield(0,dbgate_tools_1$1.runQueryOnDriver)(this.pool,this.driver,(n=>{n.put("^select max(%i) as ~maxid ^from %f",e,t)})),i=Math.max(null!==(n=r.rows[0].maxid)&&void 0!==n?n:0,0)+1;return this.identityValues[o]=i,i}return this.identityValues[o]+=1,this.identityValues[o]}))}run(){return __awaiter$e(this,void 0,void 0,(function*(){this.createPlan(),yield this.runDumperCommand((e=>e.beginTransaction()));try{for(const e of this.itemPlan){const t=yield e.runImport();logger$1.info(`Replicated ${e.name}, inserted ${t.inserted} rows, mapped ${t.mapped} rows, missing ${t.missing} rows, skipped ${t.skipped} rows, updated ${t.updated} rows, deleted ${t.deleted} rows`)}}catch(e){return logger$1.error((0,dbgate_tools_1$1.extractErrorLogData)(e),`Failed replicator job, rollbacking. ${e.message}`),void(yield this.runDumperCommand((e=>e.rollbackTransaction())))}this.options.rollbackAfterFinish?(logger$1.info("Rollbacking transaction, nothing was changed"),yield this.runDumperCommand((e=>e.rollbackTransaction()))):(logger$1.info("Committing replicator transaction"),yield this.runDumperCommand((e=>e.commitTransaction()))),this.result=this.dumper.s}))}}DataReplicator$1.DataReplicator=DataReplicator;var FreeTableGridDisplay$1={},__importDefault$4=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(FreeTableGridDisplay$1,"__esModule",{value:!0}),FreeTableGridDisplay$1.FreeTableGridDisplay=void 0;const lodash_1=__importDefault$4(lodash.exports),GridDisplay_1$1=GridDisplay$1,_1=lib$1;class FreeTableGridDisplay extends GridDisplay_1$1.GridDisplay{constructor(e,t,n,o,r){var i;super(t,n,o,r),this.model=e,this.columns=(null===(i=null==e?void 0:e.structure)||void 0===i?void 0:i.__isDynamicStructure)?(0,_1.analyseCollectionDisplayColumns)(null==e?void 0:e.rows,this):this.getDisplayColumns(e),this.filterable=!1,this.sortable=!1}getDisplayColumns(e){var t,n,o;return lodash_1.default.uniqBy((null===(o=null===(n=null===(t=null==e?void 0:e.structure)||void 0===t?void 0:t.columns)||void 0===n?void 0:n.map((e=>this.getDisplayColumn(e))))||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{isChecked:this.isColumnChecked(e)}))))||[],(e=>e.uniqueName))}getDisplayColumn(e){const t=[e.columnName],n=t.join(".");return Object.assign(Object.assign({},e),{pureName:"data",schemaName:"",headerText:e.columnName,uniqueName:n,uniquePath:t})}}FreeTableGridDisplay$1.FreeTableGridDisplay=FreeTableGridDisplay;var FreeTableModel={};function createFreeTableModel(){return{structure:{columns:[{columnName:"col1"}],foreignKeys:[]},rows:[{col1:"val1"},{col1:"val2"}]}}Object.defineProperty(FreeTableModel,"__esModule",{value:!0}),FreeTableModel.createFreeTableModel=void 0,FreeTableModel.createFreeTableModel=createFreeTableModel;var CustomGridDisplay$1={};Object.defineProperty(CustomGridDisplay$1,"__esModule",{value:!0}),CustomGridDisplay$1.CustomGridDisplay=void 0;const GridDisplay_1=GridDisplay$1;class CustomGridDisplay extends GridDisplay_1.GridDisplay{constructor(e,t,n,o,r,i,a,s,c,l=!1,u=null){super(o,r,i,a,n,s,c),this.tableName=e,this.additionalcondition=u,this.customColumns=t,this.columns=t.map((t=>({columnName:t.columnName,headerText:t.columnLabel,uniqueName:t.columnName,uniquePath:[t.columnName],isPrimaryKey:t.isPrimaryKey,isForeignKeyUnique:!1,schemaName:e.schemaName,pureName:e.pureName}))),this.changeSetKeyFields=t.filter((e=>e.isPrimaryKey)).map((e=>e.columnName)),this.baseTable=Object.assign(Object.assign({},e),{columns:this.columns.map((t=>Object.assign(Object.assign({},e),{columnName:t.columnName,dataType:"string"}))),foreignKeys:[]}),this.filterable=!0,this.sortable=!0,this.groupable=!1,this.editable=!l,this.supportsReload=!0}createSelect(e={}){var t;const n=this.createSelectBase(this.tableName,[],e,null===(t=this.customColumns.find((e=>e.isPrimaryKey)))||void 0===t?void 0:t.columnName);return n.selectAll=!0,this.additionalcondition&&(n.where?n.where={conditionType:"and",conditions:[n.where,this.additionalcondition]}:n.where=this.additionalcondition),n}}CustomGridDisplay$1.CustomGridDisplay=CustomGridDisplay;var ScriptDrivedDeployer$1={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))},__importDefault$3=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ScriptDrivedDeployer$1,"__esModule",{value:!0}),ScriptDrivedDeployer$1.ScriptDrivedDeployer=void 0;const dbgate_tools_1=lib$5,sortBy_1$2=__importDefault$3(sortBy_1$6),logger=(0,dbgate_tools_1.getLogger)("ScriptDrivedDeployer");class ScriptDrivedDeployer{constructor(e,t,n,o){this.dbhan=e,this.driver=t,this.files=n,this.crypto=o,this.predeploy=[],this.uninstall=[],this.install=[],this.once=[],this.postdeploy=[],this.isEmpty=!1,this.journalItems=[],this.predeploy=n.filter((e=>e.name.endsWith(".predeploy.sql"))),this.uninstall=n.filter((e=>e.name.endsWith(".uninstall.sql"))),this.install=n.filter((e=>e.name.endsWith(".install.sql"))),this.once=n.filter((e=>e.name.endsWith(".once.sql"))),this.postdeploy=n.filter((e=>e.name.endsWith(".postdeploy.sql"))),this.isEmpty=0===this.predeploy.length&&0===this.uninstall.length&&0===this.install.length&&0===this.once.length&&0===this.postdeploy.length}loadJournalItems(){return __awaiter$d(this,void 0,void 0,(function*(){try{const{rows:e}=yield(0,dbgate_tools_1.runQueryOnDriver)(this.dbhan,this.driver,(e=>e.put("select * from ~dbgate_deploy_journal")));this.journalItems=e,logger.debug(`Loaded ${e.length} items from DbGate deploy journal`)}catch(e){logger.warn((0,dbgate_tools_1.extractErrorLogData)(e),"Error loading DbGate deploy journal, creating table dbgate_deploy_journal");const t=this.driver.createDumper();t.createTable({pureName:"dbgate_deploy_journal",columns:[{columnName:"id",dataType:"int",autoIncrement:!0,notNull:!0,pureName:"dbgate_deploy_journal"},{columnName:"name",dataType:"varchar(100)",notNull:!0,pureName:"dbgate_deploy_journal"},{columnName:"category",dataType:"varchar(100)",notNull:!0,pureName:"dbgate_deploy_journal"},{columnName:"script_hash",dataType:"varchar(100)",notNull:!0,pureName:"dbgate_deploy_journal"},{columnName:"first_run_date",dataType:"varchar(100)",notNull:!0,pureName:"dbgate_deploy_journal"},{columnName:"last_run_date",dataType:"varchar(100)",notNull:!0,pureName:"dbgate_deploy_journal"},{columnName:"run_count",dataType:"int",notNull:!0,pureName:"dbgate_deploy_journal"}],foreignKeys:[],primaryKey:{columns:[{columnName:"id"}],constraintType:"primaryKey",pureName:"dbgate_deploy_journal"}}),yield this.driver.query(this.dbhan,t.s,{discardResult:!0})}}))}runPre(){return __awaiter$d(this,void 0,void 0,(function*(){this.isEmpty||(yield this.loadJournalItems(),yield this.runFiles(this.predeploy,"predeploy"))}))}runPost(){return __awaiter$d(this,void 0,void 0,(function*(){yield this.runFiles(this.install,"install"),yield this.runFiles(this.once,"once"),yield this.runFiles(this.postdeploy,"postdeploy")}))}run(){return __awaiter$d(this,void 0,void 0,(function*(){yield this.runPre(),yield this.runPost()}))}runFiles(e,t){return __awaiter$d(this,void 0,void 0,(function*(){for(const n of(0,sortBy_1$2.default)(e,(e=>e.name)))yield this.runFile(n,t)}))}saveToJournal(e,t,n){return __awaiter$d(this,void 0,void 0,(function*(){const o=this.journalItems.find((t=>t.name==e.name));o?yield(0,dbgate_tools_1.runCommandOnDriver)(this.dbhan,this.driver,(e=>{e.put("update ~dbgate_deploy_journal set ~last_run_date = %v, ~script_hash = %v, ~run_count = ~run_count + 1 where ~id = %v",(new Date).toISOString(),n,o.id)})):yield(0,dbgate_tools_1.runCommandOnDriver)(this.dbhan,this.driver,(o=>{o.put("insert into ~dbgate_deploy_journal (~name, ~category, ~first_run_date, ~last_run_date, ~script_hash, ~run_count) values (%v, %v, %v, %v, %v, 1)",e.name,t,(new Date).toISOString(),(new Date).toISOString(),n)}))}))}runFileCore(e,t,n){return __awaiter$d(this,void 0,void 0,(function*(){this.driver.supportsTransactions&&(0,dbgate_tools_1.runCommandOnDriver)(this.dbhan,this.driver,(e=>e.beginTransaction())),logger.debug(`Running ${t} script ${e.name}`);try{yield this.driver.script(this.dbhan,e.text,{useTransaction:!1}),yield this.saveToJournal(e,t,n)}catch(n){if(logger.error((0,dbgate_tools_1.extractErrorLogData)(n),`Error running ${t} script ${e.name}`),this.driver.supportsTransactions)return void(0,dbgate_tools_1.runCommandOnDriver)(this.dbhan,this.driver,(e=>e.rollbackTransaction()))}this.driver.supportsTransactions&&(0,dbgate_tools_1.runCommandOnDriver)(this.dbhan,this.driver,(e=>e.commitTransaction()))}))}runFile(e,t){return __awaiter$d(this,void 0,void 0,(function*(){const n=this.crypto.createHash("md5").update(e.text.trim()).digest("hex"),o=this.journalItems.find((t=>t.name==e.name)),r=o&&o.script_hash==n;switch(t){case"predeploy":case"postdeploy":yield this.runFileCore(e,t,n);break;case"once":if(o)return;yield this.runFileCore(e,t,n);break;case"install":if(r)return;const i=this.uninstall.find((t=>t.name==e.name.replace(".install.sql",".uninstall.sql")));i&&o&&(yield this.runFileCore(i,"uninstall",this.crypto.createHash("md5").update(i.text.trim()).digest("hex"))),yield this.runFileCore(e,t,n)}}))}}ScriptDrivedDeployer$1.ScriptDrivedDeployer=ScriptDrivedDeployer;var chartDefinitions={};Object.defineProperty(chartDefinitions,"__esModule",{value:!0}),chartDefinitions.ChartLimits=chartDefinitions.ChartConstDefaults=void 0,chartDefinitions.ChartConstDefaults={sortOrder:" asc",windowAlign:"end",windowSize:100,parentAggregateLimit:200},chartDefinitions.ChartLimits={AUTODETECT_CHART_LIMIT:10,AUTODETECT_MEASURES_LIMIT:10,APPLY_LIMIT_AFTER_ROWS:100,MAX_DISTINCT_VALUES:10,VALID_VALUE_RATIO_LIMIT:.5,PIE_RATIO_LIMIT:.05,PIE_COUNT_LIMIT:10};var chartProcessor={};function baseSum$2(e,t){for(var n,o=-1,r=e.length;++o<r;){var i=t(e[o]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var _baseSum=baseSum$2,baseSum$1=_baseSum,identity=identity_1;function sum(e){return e&&e.length?baseSum$1(e,identity):0}var sum_1$2=sum,chartTools={},arrayMap=_arrayMap;function baseToPairs$1(e,t){return arrayMap(t,(function(t){return[t,e[t]]}))}var _baseToPairs=baseToPairs$1;function setToPairs$1(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}var _setToPairs=setToPairs$1,baseToPairs=_baseToPairs,getTag=_getTag,mapToArray=_mapToArray,setToPairs=_setToPairs,mapTag="[object Map]",setTag="[object Set]";function createToPairs$1(e){return function(t){var n=getTag(t);return n==mapTag?mapToArray(t):n==setTag?setToPairs(t):baseToPairs(t,e(t))}}var _createToPairs=createToPairs$1,createToPairs=_createToPairs,keys=keys_1$2,toPairs=createToPairs(keys),toPairs_1$1=toPairs,baseIteratee=_baseIteratee,baseSum=_baseSum;function sumBy(e,t){return e&&e.length?baseSum(e,baseIteratee(t)):0}var sumBy_1$1=sumBy,__importDefault$2=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(chartTools,"__esModule",{value:!0}),chartTools.computeChartBucketCardinality=chartTools.fillChartTimelineBuckets=chartTools.aggregateChartNumericValuesFromChild=chartTools.aggregateChartNumericValuesFromSource=chartTools.autoAggregateCompactTimelineChart=chartTools.compareChartDatesParsed=chartTools.computeDateBucketDistance=chartTools.computeChartBucketKey=chartTools.incrementChartDate=chartTools.stringifyChartDate=chartTools.tryParseChartDate=chartTools.getChartDebugPrint=void 0;const toPairs_1=__importDefault$2(toPairs_1$1),sumBy_1=__importDefault$2(sumBy_1$1),chartDefinitions_1$2=chartDefinitions,date_fns_1=dateFns;function getChartDebugPrint(e){let t="";t+=`Chart: ${e.definition.chartType} (${e.definition.xdef.transformFunction})\n`;for(const n of e.bucketKeysOrdered)t+=`${n}: ${(0,toPairs_1.default)(e.buckets[n]).map((([e,t])=>`${e}=${t}`)).join(", ")}\n`;return t}function tryParseChartDate(e){if(e instanceof Date)return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),fraction:void 0};if("string"!=typeof e)return null;const t=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:\d{2})?)?$/);if(!t)return null;const[n,o,r,i,a,s,c,l]=t;return{year:parseInt(o,10),month:parseInt(r,10),day:parseInt(i,10),hour:parseInt(a,10)||0,minute:parseInt(s,10)||0,second:parseInt(c,10)||0,fraction:l||void 0}}function pad2Digits(e){return("00"+e).slice(-2)}function stringifyChartDate(e,t){switch(t){case"date:year":return`${e.year}`;case"date:month":return`${e.year}-${pad2Digits(e.month)}`;case"date:day":return`${e.year}-${pad2Digits(e.month)}-${pad2Digits(e.day)}`;case"date:hour":return`${e.year}-${pad2Digits(e.month)}-${pad2Digits(e.day)} ${pad2Digits(e.hour)}`;case"date:minute":return`${e.year}-${pad2Digits(e.month)}-${pad2Digits(e.day)} ${pad2Digits(e.hour)}:${pad2Digits(e.minute)}`;default:return""}}function incrementChartDate(e,t){var n,o,r,i;const a=new Date(e.year,(null!==(n=e.month)&&void 0!==n?n:1)-1,null!==(o=e.day)&&void 0!==o?o:1,null!==(r=e.hour)&&void 0!==r?r:0,null!==(i=e.minute)&&void 0!==i?i:0);let s;switch(t){case"date:year":s=(0,date_fns_1.addYears)(a,1);break;case"date:month":s=(0,date_fns_1.addMonths)(a,1);break;case"date:day":s=(0,date_fns_1.addDays)(a,1);break;case"date:hour":s=(0,date_fns_1.addHours)(a,1);break;case"date:minute":s=(0,date_fns_1.addMinutes)(a,1)}switch(t){case"date:year":return{year:s.getFullYear()};case"date:month":return{year:s.getFullYear(),month:s.getMonth()+1};case"date:day":return{year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate()};case"date:hour":return{year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),hour:s.getHours()};case"date:minute":return{year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),hour:s.getHours(),minute:s.getMinutes()}}}function computeChartBucketKey(e,t,n){switch(t.definition.xdef.transformFunction){case"date:year":return[e?`${e.year}`:null,{year:e.year}];case"date:month":return[e?`${e.year}-${pad2Digits(e.month)}`:null,{year:e.year,month:e.month}];case"date:day":return[e?`${e.year}-${pad2Digits(e.month)}-${pad2Digits(e.day)}`:null,{year:e.year,month:e.month,day:e.day}];case"date:hour":return[e?`${e.year}-${pad2Digits(e.month)}-${pad2Digits(e.day)} ${pad2Digits(e.hour)}`:null,{year:e.year,month:e.month,day:e.day,hour:e.hour}];case"date:minute":return[e?`${e.year}-${pad2Digits(e.month)}-${pad2Digits(e.day)} ${pad2Digits(e.hour)}:${pad2Digits(e.minute)}`:null,{year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute}];default:return[n[t.definition.xdef.field],null]}}function computeDateBucketDistance(e,t,n){switch(n){case"date:year":return t.year-e.year;case"date:month":return 12*(t.year-e.year)+(t.month-e.month);case"date:day":return 365*(t.year-e.year)+30*(t.month-e.month)+(t.day-e.day);case"date:hour":return 365*(t.year-e.year)*24+30*(t.month-e.month)*24+24*(t.day-e.day)+(t.hour-e.hour);case"date:minute":return 365*(t.year-e.year)*24*60+30*(t.month-e.month)*24*60+24*(t.day-e.day)*60+60*(t.hour-e.hour)+(t.minute-e.minute);default:return NaN}}function compareChartDatesParsed(e,t,n){switch(n){case"date:year":return e.year-t.year;case"date:month":return e.year===t.year?e.month-t.month:e.year-t.year;case"date:day":return e.year===t.year&&e.month===t.month?e.day-t.day:e.year===t.year?e.month-t.month:e.year-t.year;case"date:hour":return e.year===t.year&&e.month===t.month&&e.day===t.day?e.hour-t.hour:e.year===t.year&&e.month===t.month?e.day-t.day:e.year===t.year?e.month-t.month:e.year-t.year;case"date:minute":return e.year===t.year&&e.month===t.month&&e.day===t.day&&e.hour===t.hour?e.minute-t.minute:e.year===t.year&&e.month===t.month&&e.day===t.day?e.hour-t.hour:e.year===t.year&&e.month===t.month?e.day-t.day:e.year===t.year?e.month-t.month:e.year-t.year}}function getParentDateBucketKey(e,t){switch(t){case"date:year":return null;case"date:month":return e.slice(0,4);case"date:day":return e.slice(0,7);case"date:hour":return e.slice(0,10);case"date:minute":return e.slice(0,13)}}function getParentDateBucketTransform(e){switch(e){case"date:year":default:return null;case"date:month":return"date:year";case"date:day":return"date:month";case"date:hour":return"date:day";case"date:minute":return"date:hour"}}function getParentKeyParsed(e,t){switch(t){case"date:year":default:return null;case"date:month":return{year:e.year};case"date:day":return{year:e.year,month:e.month};case"date:hour":return{year:e.year,month:e.month,day:e.day};case"date:minute":return{year:e.year,month:e.month,day:e.day,hour:e.hour}}}function createParentChartAggregation(e){if(e.isGivenDefinition)return null;const t=getParentDateBucketTransform(e.definition.xdef.transformFunction);if(!t)return null;const n={definition:Object.assign(Object.assign({},e.definition),{xdef:Object.assign(Object.assign({},e.definition.xdef),{transformFunction:t})}),rowsAdded:e.rowsAdded,bucketKeysOrdered:[],buckets:{},bucketKeyDateParsed:{},isGivenDefinition:!1,invalidXRows:e.invalidXRows,invalidYRows:Object.assign({},e.invalidYRows),validYRows:Object.assign({},e.validYRows),topDistinctValues:Object.assign({},e.topDistinctValues),availableColumns:e.availableColumns};for(const[t,o]of Object.entries(e.buckets)){const r=getParentDateBucketKey(t,e.definition.xdef.transformFunction);r&&(n.bucketKeyDateParsed[r]=getParentKeyParsed(e.bucketKeyDateParsed[t],e.definition.xdef.transformFunction),aggregateChartNumericValuesFromChild(n,r,o))}const o=Object.keys(n.buckets).sort();return n.minX=o.length>0?o[0]:null,n.maxX=o.length>0?o[o.length-1]:null,n}function autoAggregateCompactTimelineChart(e){for(var t;;){const n=e.bucketKeyDateParsed[e.minX],o=e.bucketKeyDateParsed[e.maxX];if(!n||!o)return e;const r=e.definition.xdef.transformFunction;if(!r.startsWith("date:"))return e;if(computeDateBucketDistance(n,o,r)<(null!==(t=e.definition.xdef.parentAggregateLimit)&&void 0!==t?t:chartDefinitions_1$2.ChartConstDefaults.parentAggregateLimit))return e;const i=createParentChartAggregation(e);if(!i)return e;e=i}}function aggregateChartNumericValuesFromSource(e,t,n,o){for(const r of e.definition.ydefs){if(null==n[r.field]){o[r.field]&&(e.invalidYRows[r.field]=(e.invalidYRows[r.field]||0)+1);continue}e.validYRows[r.field]=(e.validYRows[r.field]||0)+1;let i=e.topDistinctValues[r.field];switch(i||(i=new Set,e.topDistinctValues[r.field]=i),i.size<chartDefinitions_1$2.ChartLimits.MAX_DISTINCT_VALUES&&e.topDistinctValues[r.field].add(n[r.field]),r.aggregateFunction){case"sum":e.buckets[t][r.field]=(e.buckets[t][r.field]||0)+(n[r.field]||0);break;case"first":void 0===e.buckets[t][r.field]&&(e.buckets[t][r.field]=n[r.field]);break;case"last":e.buckets[t][r.field]=n[r.field];break;case"min":void 0===e.buckets[t][r.field]?e.buckets[t][r.field]=n[r.field]:e.buckets[t][r.field]=Math.min(e.buckets[t][r.field],n[r.field]);break;case"max":void 0===e.buckets[t][r.field]?e.buckets[t][r.field]=n[r.field]:e.buckets[t][r.field]=Math.max(e.buckets[t][r.field],n[r.field]);break;case"count":e.buckets[t][r.field]=(e.buckets[t][r.field]||0)+1;break;case"avg":void 0===e.buckets[t][r.field]?e.buckets[t][r.field]=[n[r.field],1]:(e.buckets[t][r.field][0]+=n[r.field],e.buckets[t][r.field][1]+=1)}}}function aggregateChartNumericValuesFromChild(e,t,n){for(const o of e.definition.ydefs)if(null!=n[o.field])switch(e.buckets[t]||(e.buckets[t]={}),o.aggregateFunction){case"sum":case"count":e.buckets[t][o.field]=(e.buckets[t][o.field]||0)+(n[o.field]||0);break;case"min":void 0===e.buckets[t][o.field]?e.buckets[t][o.field]=n[o.field]:e.buckets[t][o.field]=Math.min(e.buckets[t][o.field],n[o.field]);break;case"max":void 0===e.buckets[t][o.field]?e.buckets[t][o.field]=n[o.field]:e.buckets[t][o.field]=Math.max(e.buckets[t][o.field],n[o.field]);break;case"avg":void 0===e.buckets[t][o.field]?e.buckets[t][o.field]=n[o.field]:(e.buckets[t][o.field][0]+=n[o.field][0],e.buckets[t][o.field][1]+=n[o.field][1]);break;case"first":case"last":throw new Error(`Cannot aggregate ${o.aggregateFunction} for ${o.field} in child bucket`)}}function fillChartTimelineBuckets(e){const t=e.bucketKeyDateParsed[e.minX],n=e.bucketKeyDateParsed[e.maxX];if(!t||!n)return;const o=e.definition.xdef.transformFunction;let r=t;for(;compareChartDatesParsed(r,n,o)<=0;){const t=stringifyChartDate(r,o);e.buckets[t]||(e.buckets[t]={},e.bucketKeyDateParsed[t]=r),r=incrementChartDate(r,o)}}function computeChartBucketCardinality(e){return(0,sumBy_1.default)(Object.keys(e),(t=>e[t]))}chartTools.getChartDebugPrint=getChartDebugPrint,chartTools.tryParseChartDate=tryParseChartDate,chartTools.stringifyChartDate=stringifyChartDate,chartTools.incrementChartDate=incrementChartDate,chartTools.computeChartBucketKey=computeChartBucketKey,chartTools.computeDateBucketDistance=computeDateBucketDistance,chartTools.compareChartDatesParsed=compareChartDatesParsed,chartTools.autoAggregateCompactTimelineChart=autoAggregateCompactTimelineChart,chartTools.aggregateChartNumericValuesFromSource=aggregateChartNumericValuesFromSource,chartTools.aggregateChartNumericValuesFromChild=aggregateChartNumericValuesFromChild,chartTools.fillChartTimelineBuckets=fillChartTimelineBuckets,chartTools.computeChartBucketCardinality=computeChartBucketCardinality;var chartScoring={},__importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(chartScoring,"__esModule",{value:!0}),chartScoring.getChartYFieldScore=chartScoring.getChartScore=void 0;const sortBy_1$1=__importDefault$1(sortBy_1$6),sum_1$1=__importDefault$1(sum_1$2),chartDefinitions_1$1=chartDefinitions;function getChartScore(e){let t=0;t+=5*e.rowsAdded;const n=e.definition.ydefs.map((t=>getChartYFieldScore(e,t))),o=(0,sortBy_1$1.default)(n).reverse();return t+=(0,sum_1$1.default)(o.slice(0,chartDefinitions_1$1.ChartLimits.AUTODETECT_MEASURES_LIMIT)),t}function getChartYFieldScore(e,t){var n,o,r;let i=0;return i+=5*e.validYRows[t.field],i+=20*(null!==(o=null===(n=e.topDistinctValues[t.field])||void 0===n?void 0:n.size)&&void 0!==o?o:0),i+=2*e.rowsAdded,i-=50*(null!==(r=e.invalidYRows[t.field])&&void 0!==r?r:0),i}chartScoring.getChartScore=getChartScore,chartScoring.getChartYFieldScore=getChartYFieldScore;var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(chartProcessor,"__esModule",{value:!0}),chartProcessor.ChartProcessor=void 0;const chartDefinitions_1=chartDefinitions,sortBy_1=__importDefault(sortBy_1$6),sum_1=__importDefault(sum_1$2),chartTools_1=chartTools,chartScoring_1=chartScoring;class ChartProcessor{constructor(e=[]){this.givenDefinitions=e,this.chartsProcessing=[],this.charts=[],this.availableColumnsDict={},this.availableColumns=[],this.autoDetectCharts=!1,this.rowsAdded=0;for(const t of e)this.chartsProcessing.push({definition:t,rowsAdded:0,bucketKeysOrdered:[],buckets:{},bucketKeyDateParsed:{},isGivenDefinition:!0,invalidXRows:0,invalidYRows:{},availableColumns:[],validYRows:{},topDistinctValues:{}});this.autoDetectCharts=0==this.givenDefinitions.length}addRow(e){const t={},n={},o={},r={};for(const[i,a]of Object.entries(e)){const e="string"==typeof a?Number(a):"number"==typeof a?a:NaN;this.availableColumnsDict[i]={field:i};const s=i.toLowerCase(),c=s.endsWith("_id")||"id"==s||i.endsWith("Id"),l=(0,chartTools_1.tryParseChartDate)(a);l?t[i]=l:isNaN(e)||!isFinite(e)?"string"==typeof a&&isNaN(e)&&a.length<100&&(r[i]=a):(n[i]=e,c||(o[i]=e))}if(this.autoDetectCharts)for(const n in t){let t=this.chartsProcessing.find((e=>{var t;return!e.isGivenDefinition&&e.definition.xdef.field===n&&(null===(t=e.definition.xdef.transformFunction)||void 0===t?void 0:t.startsWith("date:"))}));!t&&(this.rowsAdded<chartDefinitions_1.ChartLimits.APPLY_LIMIT_AFTER_ROWS||this.chartsProcessing.length<chartDefinitions_1.ChartLimits.AUTODETECT_CHART_LIMIT)&&(t={definition:{chartType:"line",xdef:{field:n,transformFunction:"date:day"},ydefs:[]},rowsAdded:0,bucketKeysOrdered:[],buckets:{},bucketKeyDateParsed:{},isGivenDefinition:!1,invalidXRows:0,invalidYRows:{},availableColumns:[],validYRows:{},topDistinctValues:{}},this.chartsProcessing.push(t));for(const[o,r]of Object.entries(e)){if(null==r)continue;if(o==n)continue;let e=t.definition.ydefs.find((e=>e.field===o));!e&&(this.rowsAdded<chartDefinitions_1.ChartLimits.APPLY_LIMIT_AFTER_ROWS||t.definition.ydefs.length<chartDefinitions_1.ChartLimits.AUTODETECT_MEASURES_LIMIT)&&(e={field:o,aggregateFunction:"sum"},t.definition.ydefs.push(e))}}for(const i of this.chartsProcessing)this.applyRawData(i,e,t[i.definition.xdef.field],i.isGivenDefinition?n:o,r);for(let e=0;e<this.chartsProcessing.length;e++)this.chartsProcessing[e]=(0,chartTools_1.autoAggregateCompactTimelineChart)(this.chartsProcessing[e]);this.rowsAdded+=1,this.rowsAdded==chartDefinitions_1.ChartLimits.APPLY_LIMIT_AFTER_ROWS&&this.applyLimitsOnCharts()}applyLimitsOnCharts(){const e=this.chartsProcessing.filter((e=>!e.isGivenDefinition));if(e.length>chartDefinitions_1.ChartLimits.AUTODETECT_CHART_LIMIT){const t=(0,sortBy_1.default)(this.chartsProcessing.slice(0,chartDefinitions_1.ChartLimits.AUTODETECT_CHART_LIMIT),(e=>-(0,chartScoring_1.getChartScore)(e)));for(const t of e)t.definition.ydefs=(0,sortBy_1.default)(t.definition.ydefs,(e=>-(0,chartScoring_1.getChartYFieldScore)(t,e))).slice(0,chartDefinitions_1.ChartLimits.AUTODETECT_MEASURES_LIMIT);this.chartsProcessing=[...this.chartsProcessing.filter((e=>e.isGivenDefinition)),...t]}}addRows(...e){for(const t of e)this.addRow(t)}finalize(){var e;this.applyLimitsOnCharts(),this.availableColumns=Object.values(this.availableColumnsDict);for(const t of this.chartsProcessing){let n=t;if(0==t.rowsAdded)continue;const o=null!==(e=t.definition.xdef.sortOrder)&&void 0!==e?e:"ascKeys";"natural"!=o&&("ascKeys"!=o&&"descKeys"!=o||(t.definition.xdef.transformFunction.startsWith("date:")&&(n=(0,chartTools_1.autoAggregateCompactTimelineChart)(n),(0,chartTools_1.fillChartTimelineBuckets)(n)),n.bucketKeysOrdered=(0,sortBy_1.default)(Object.keys(n.buckets)),"descKeys"==o&&n.bucketKeysOrdered.reverse()),"ascValues"!=o&&"descValues"!=o||(n.bucketKeysOrdered=(0,sortBy_1.default)(Object.keys(n.buckets),(e=>(0,chartTools_1.computeChartBucketCardinality)(n.buckets[e]))),"descValues"==o&&n.bucketKeysOrdered.reverse())),n.isGivenDefinition||(n=Object.assign(Object.assign({},n),{definition:Object.assign(Object.assign({},n.definition),{ydefs:n.definition.ydefs.filter((e=>!n.invalidYRows[e.field]&&n.validYRows[e.field]/n.rowsAdded>=chartDefinitions_1.ChartLimits.VALID_VALUE_RATIO_LIMIT))})})),n&&(n.availableColumns=this.availableColumns,this.charts.push(n)),this.groupPieOtherBuckets(n)}this.charts=[...this.charts.filter((e=>e.isGivenDefinition)),...(0,sortBy_1.default)(this.charts.filter((e=>!e.isGivenDefinition)),(e=>-(0,chartScoring_1.getChartScore)(e)))]}groupPieOtherBuckets(e){var t,n,o;if("pie"!==e.definition.chartType)return;const r=null!==(t=e.definition.pieRatioLimit)&&void 0!==t?t:chartDefinitions_1.ChartLimits.PIE_RATIO_LIMIT,i=null!==(n=e.definition.pieCountLimit)&&void 0!==n?n:chartDefinitions_1.ChartLimits.PIE_COUNT_LIMIT;if(0==r&&0==i)return;const a={};let s={};const c=(0,sum_1.default)(Object.values(e.buckets).map((e=>(0,chartTools_1.computeChartBucketCardinality)(e))));if(0!=c){for(const[t,n]of Object.entries(e.buckets))if((0,chartTools_1.computeChartBucketCardinality)(n)/c<r)for(const e in n)a[e]=(null!==(o=a[e])&&void 0!==o?o:0)+n[e];else s[t]=n;if(Object.keys(s).length>i){const e=(0,sortBy_1.default)(Object.entries(s),(([,e])=>-(0,chartTools_1.computeChartBucketCardinality)(e))).map((([e])=>e)),t={};e.forEach(((e,n)=>{var o;if(n<i)t[e]=s[e];else for(const t in s[e])a[t]=(null!==(o=a[t])&&void 0!==o?o:0)+s[e][t]})),s=t}Object.keys(a).length>0&&(s.Other=a),e.buckets=s,e.bucketKeysOrdered=[...e.bucketKeysOrdered,"Other"].filter((e=>e in s))}}applyRawData(e,t,n,o,r){if(null==e.definition.xdef)return;if(null==t[e.definition.xdef.field])return;if(null==n&&e.definition.xdef.transformFunction.startsWith("date:"))return void(e.invalidXRows+=1);const[i,a]=(0,chartTools_1.computeChartBucketKey)(n,e,t);i&&(a&&(e.bucketKeyDateParsed[i]=a),(null==e.minX||i<e.minX)&&(e.minX=i),(null==e.maxX||i>e.maxX)&&(e.maxX=i),e.buckets[i]||(e.buckets[i]={},"natural"==e.definition.xdef.sortOrder&&e.bucketKeysOrdered.push(i)),(0,chartTools_1.aggregateChartNumericValuesFromSource)(e,i,o,t),e.rowsAdded+=1)}}function plusExpandIcon(e){return e?"icon minus-box":"icon plus-box"}function chevronExpandIcon(e){return e?"icon chevron-down":"icon chevron-right"}function create_if_block$2o(e){let t,n,o,r;var i=e[2].default;function a(e){return{props:{data:e[3],expandIcon:getExpandIcon(!e[8]&&e[11],e[4],e[12],e[5]),checkedObjectsStore:e[6],module:e[2],disableContextMenu:e[7],passProps:e[9],filter:e[1]}}}i&&(t=construct_svelte_component(i,a(e)),t.$on("dblclick",e[13]),t.$on("expand",e[14]));let s=(e[12]||e[8])&&e[4]&&create_if_block_1$1t(e);return{c(){t&&create_component(t.$$.fragment),n=space(),s&&s.c(),o=empty()},m(e,i){t&&mount_component(t,e,i),insert(e,n,i),s&&s.m(e,i),insert(e,o,i),r=!0},p(e,r){const c={};if(8&r&&(c.data=e[3]),6448&r&&(c.expandIcon=getExpandIcon(!e[8]&&e[11],e[4],e[12],e[5])),64&r&&(c.checkedObjectsStore=e[6]),4&r&&(c.module=e[2]),128&r&&(c.disableContextMenu=e[7]),512&r&&(c.passProps=e[9]),2&r&&(c.filter=e[1]),4&r&&i!==(i=e[2].default)){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),t.$on("dblclick",e[13]),t.$on("expand",e[14]),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(c);(e[12]||e[8])&&e[4]?s?(s.p(e,r),4368&r&&transition_in(s,1)):(s=create_if_block_1$1t(e),s.c(),transition_in(s,1),s.m(o.parentNode,o)):s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros())},i(e){r||(t&&transition_in(t.$$.fragment,e),transition_in(s),r=!0)},o(e){t&&transition_out(t.$$.fragment,e),transition_out(s),r=!1},d(e){t&&destroy_component(t,e),e&&detach(n),s&&s.d(e),e&&detach(o)}}}function create_if_block_1$1t(e){let t,n,o;var r=e[4](e[3],{isExpandedBySearch:e[8]});function i(e){return{props:{data:e[3],filter:e[1],passProps:e[9],isExpandedBySearch:e[8],isExpanded:e[12],isMainMatched:e[10]}}}return r&&(n=construct_svelte_component(r,i(e))),{c(){t=element("div"),n&&create_component(n.$$.fragment),attr(t,"class","subitems svelte-k6fdqm")},m(e,r){insert(e,t,r),n&&mount_component(n,t,null),o=!0},p(e,o){const a={};if(8&o&&(a.data=e[3]),2&o&&(a.filter=e[1]),512&o&&(a.passProps=e[9]),256&o&&(a.isExpandedBySearch=e[8]),4096&o&&(a.isExpanded=e[12]),1024&o&&(a.isMainMatched=e[10]),280&o&&r!==(r=e[4](e[3],{isExpandedBySearch:e[8]}))){if(n){group_outros();const e=n;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}r?(n=construct_svelte_component(r,i(e)),create_component(n.$$.fragment),transition_in(n.$$.fragment,1),mount_component(n,t,null)):n=null}else r&&n.$set(a)},i(e){o||(n&&transition_in(n.$$.fragment,e),o=!0)},o(e){n&&transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),n&&destroy_component(n)}}}function create_fragment$5H(e){let t,n,o=!e[0]&&create_if_block$2o(e);return{c(){o&&o.c(),t=empty()},m(e,r){o&&o.m(e,r),insert(e,t,r),n=!0},p(e,[n]){e[0]?o&&(group_outros(),transition_out(o,1,1,(()=>{o=null})),check_outros()):o?(o.p(e,n),1&n&&transition_in(o,1)):(o=create_if_block$2o(e),o.c(),transition_in(o,1),o.m(t.parentNode,t))},i(e){n||(transition_in(o),n=!0)},o(e){transition_out(o),n=!1},d(e){o&&o.d(e),e&&detach(t)}}}function getExpandIcon(e,t,n,o){return t?e?o(n):"icon invisible-box":null}function instance$5B(e,t,n){let o,r;var i=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let{isHidden:a}=t,{filter:s}=t,{module:c}=t,{data:l}=t,{subItemsComponent:u}=t,{expandOnClick:d}=t,{isExpandable:p}=t,{expandIconFunc:m=plusExpandIcon}=t,{checkedObjectsStore:f=null}=t,{disableContextMenu:h=!1}=t,{isExpandedBySearch:g=!1}=t,{passProps:_}=t,{getIsExpanded:$=null}=t,{setIsExpanded:b=null}=t,{isMainMatched:y=!1}=t,v=!1;function x(){$&&b?b(l,!r):n(19,v=!v)}return e.$$set=e=>{"isHidden"in e&&n(0,a=e.isHidden),"filter"in e&&n(1,s=e.filter),"module"in e&&n(2,c=e.module),"data"in e&&n(3,l=e.data),"subItemsComponent"in e&&n(4,u=e.subItemsComponent),"expandOnClick"in e&&n(15,d=e.expandOnClick),"isExpandable"in e&&n(16,p=e.isExpandable),"expandIconFunc"in e&&n(5,m=e.expandIconFunc),"checkedObjectsStore"in e&&n(6,f=e.checkedObjectsStore),"disableContextMenu"in e&&n(7,h=e.disableContextMenu),"isExpandedBySearch"in e&&n(8,g=e.isExpandedBySearch),"passProps"in e&&n(9,_=e.passProps),"getIsExpanded"in e&&n(17,$=e.getIsExpanded),"setIsExpanded"in e&&n(18,b=e.setIsExpanded),"isMainMatched"in e&&n(10,y=e.isMainMatched)},e.$$.update=()=>{65544&e.$$.dirty&&n(11,o=l&&p&&p(l)),919560&e.$$.dirty&&n(12,r=!!o&&($&&b?$(l):v))},[a,s,c,l,u,m,f,h,g,_,y,o,r,function(){return i(this,void 0,void 0,(function*(){u&&d&&(yield tick(),x())}))},x,d,p,$,b,v]}chartProcessor.ChartProcessor=ChartProcessor,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||t(n,e,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(GridDisplay$1,e),n(GridConfig,e),n(PerspectiveConfig,e),n(PerspectiveTreeNode$1,e),n(TableGridDisplay$1,e),n(ViewGridDisplay$1,e),n(JslGridDisplay$1,e),n(ChangeSet,e),n(MacroDefinition,e),n(runMacro,e),n(CollectionGridDisplay$1,e),n(deleteCascade,e),n(PerspectiveDisplay$1,e),n(PerspectiveDataProvider,e),n(PerspectiveCache$1,e),n(PerspectiveConfig,e),n(processPerspectiveDefaultColunns$1,e),n(PerspectiveDataPattern,e),n(PerspectiveDataLoader$1,e),n(perspectiveTools,e),n(DataReplicator$1,e),n(FreeTableGridDisplay$1,e),n(FreeTableModel,e),n(CustomGridDisplay$1,e),n(ScriptDrivedDeployer$1,e),n(chartDefinitions,e),n(chartProcessor,e)}(lib$1);class AppObjectListItem extends SvelteComponent{constructor(e){super(),init(this,e,instance$5B,create_fragment$5H,safe_not_equal,{isHidden:0,filter:1,module:2,data:3,subItemsComponent:4,expandOnClick:15,isExpandable:16,expandIconFunc:5,checkedObjectsStore:6,disableContextMenu:7,isExpandedBySearch:8,passProps:9,getIsExpanded:17,setIsExpanded:18,isMainMatched:10})}}function get_each_context$X(e,t,n){const o=e.slice();return o[25]=t[n],o}function create_if_block$2n(e){let t,n,o,r,i,a=e[5]&&create_if_block_1$1s(e),s=e[1],c=[];for(let t=0;t<s.length;t+=1)c[t]=create_each_block$X(get_each_context$X(e,s,t));const l=e=>transition_out(c[e],1,1,(()=>{c[e]=null}));return{c(){a&&a.c(),t=space(),n=element("div");for(let e=0;e<c.length;e+=1)c[e].c()},m(s,l){a&&a.m(s,l),insert(s,t,l),insert(s,n,l);for(let e=0;e<c.length;e+=1)c[e]&&c[e].m(n,null);o=!0,r||(i=listen(n,"drop",e[14]),r=!0)},p(e,o){if(e[5]?a?(a.p(e,o),32&o&&transition_in(a,1)):(a=create_if_block_1$1s(e),a.c(),transition_in(a,1),a.m(t.parentNode,t)):a&&(group_outros(),transition_out(a,1,1,(()=>{a=null})),check_outros()),34034&o){let t;for(s=e[1],t=0;t<s.length;t+=1){const r=get_each_context$X(e,s,t);c[t]?(c[t].p(r,o),transition_in(c[t],1)):(c[t]=create_each_block$X(r),c[t].c(),transition_in(c[t],1),c[t].m(n,null))}for(group_outros(),t=s.length;t<c.length;t+=1)l(t);check_outros()}},i(e){if(!o){transition_in(a);for(let e=0;e<s.length;e+=1)transition_in(c[e]);o=!0}},o(e){transition_out(a),c=c.filter(Boolean);for(let e=0;e<c.length;e+=1)transition_out(c[e]);o=!1},d(e){a&&a.d(e),e&&detach(t),e&&detach(n),destroy_each(c,e),r=!1,i()}}}function create_if_block_1$1s(e){let t,n,o,r,i;return n=new Link$1({props:{onClick:e[22],$$slots:{default:[create_default_slot_1$1n]},$$scope:{ctx:e}}}),r=new Link$1({props:{onClick:e[23],$$slots:{default:[create_default_slot$23]},$$scope:{ctx:e}}}),{c(){t=element("div"),create_component(n.$$.fragment),o=text$1("\n |\n "),create_component(r.$$.fragment),attr(t,"class","ml-2")},m(e,a){insert(e,t,a),mount_component(n,t,null),append(t,o),mount_component(r,t,null),i=!0},p(e,t){const o={};268435456&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const i={};268435456&t&&(i.$$scope={dirty:t,ctx:e}),r.$set(i)},i(e){i||(transition_in(n.$$.fragment,e),transition_in(r.$$.fragment,e),i=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(r.$$.fragment,e),i=!1},d(e){e&&detach(t),destroy_component(n),destroy_component(r)}}}function create_default_slot_1$1n(e){let t;return{c(){t=text$1("Check all")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_default_slot$23(e){let t;return{c(){t=text$1("Uncheck all")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_each_block$X(e){let t,n;const o=[{isHidden:!e[25].isMatched},e[15],{module:e[4]},{data:e[25].data},{checkedObjectsStore:e[5]},{disableContextMenu:e[6]},{passProps:e[7]},{isExpandedBySearch:e[10]&&e[25].isChildMatched},{filter:e[10]},{isMainMatched:e[25].isMainMatched}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new AppObjectListItem({props:r}),t.$on("objectClick",e[24]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=34034&n?get_spread_update(o,[2&n&&{isHidden:!e[25].isMatched},32768&n&&get_spread_object(e[15]),16&n&&{module:e[4]},2&n&&{data:e[25].data},32&n&&{checkedObjectsStore:e[5]},64&n&&{disableContextMenu:e[6]},128&n&&{passProps:e[7]},1026&n&&{isExpandedBySearch:e[10]&&e[25].isChildMatched},1024&n&&{filter:e[10]},2&n&&{isMainMatched:e[25].isMainMatched}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5G(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f=(e[3]?e[3](e[0]):e[0])+"",h=(e[1]&&`(${e[11]})`)+"";o=new FontIcon({props:{icon:e[2](e[12])}});let g=e[12]&&create_if_block$2n(e);return{c(){t=element("div"),n=element("span"),create_component(o.$$.fragment),r=space(),i=text$1(f),a=space(),s=text$1(h),l=space(),g&&g.c(),u=empty(),attr(n,"class","expand-icon svelte-1a3znv3"),attr(t,"class","group svelte-1a3znv3")},m(f,h){insert(f,t,h),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),append(t,a),append(t,s),insert(f,l,h),g&&g.m(f,h),insert(f,u,h),d=!0,p||(m=[listen(t,"click",e[20]),listen(t,"drop",e[14]),action_destroyer(c=contextMenu.call(null,t,e[8]?e[21]:null))],p=!0)},p(e,[t]){const n={};4100&t&&(n.icon=e[2](e[12])),o.$set(n),(!d||9&t)&&f!==(f=(e[3]?e[3](e[0]):e[0])+"")&&set_data(i,f),(!d||2050&t)&&h!==(h=(e[1]&&`(${e[11]})`)+"")&&set_data(s,h),c&&is_function(c.update)&&257&t&&c.update.call(null,e[8]?e[21]:null),e[12]?g?(g.p(e,t),4096&t&&transition_in(g,1)):(g=create_if_block$2n(e),g.c(),transition_in(g,1),g.m(u.parentNode,u)):g&&(group_outros(),transition_out(g,1,1,(()=>{g=null})),check_outros())},i(e){d||(transition_in(o.$$.fragment,e),transition_in(g),d=!0)},o(e){transition_out(o.$$.fragment,e),transition_out(g),d=!1},d(e){e&&detach(t),destroy_component(o),e&&detach(l),g&&g.d(e),e&&detach(u),p=!1,run_all(m)}}}function instance$5A(e,t,n){let o,r,i;const a=["group","groupFunc","items","groupIconFunc","mapGroupTitle","module","checkedObjectsStore","disableContextMenu","passProps","onDropOnGroup","groupContextMenu","collapsedGroupNames","filter"];let s,c=compute_rest_props(t,a),l=noop$2,u=()=>(l(),l=subscribe(x,(e=>n(19,s=e))),x);e.$$.on_destroy.push((()=>l()));let{group:d}=t,{groupFunc:p}=t,{items:m}=t,{groupIconFunc:f=plusExpandIcon}=t,{mapGroupTitle:h}=t,{module:g}=t,{checkedObjectsStore:_=null}=t,{disableContextMenu:$=!1}=t,{passProps:b}=t,{onDropOnGroup:y}=t,{groupContextMenu:v=null}=t,{collapsedGroupNames:x}=t;u();let{filter:w}=t;function C(e){_.update((t=>{const n=e?[...t,...r.filter((e=>!t.find((t=>g.extractKey(e.data)==g.extractKey(t))))).map((e=>e.data))]:t.filter((e=>p(e)!=d));return n}))}return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(15,c=compute_rest_props(t,a)),"group"in e&&n(0,d=e.group),"groupFunc"in e&&n(16,p=e.groupFunc),"items"in e&&n(1,m=e.items),"groupIconFunc"in e&&n(2,f=e.groupIconFunc),"mapGroupTitle"in e&&n(3,h=e.mapGroupTitle),"module"in e&&n(4,g=e.module),"checkedObjectsStore"in e&&n(5,_=e.checkedObjectsStore),"disableContextMenu"in e&&n(6,$=e.disableContextMenu),"passProps"in e&&n(7,b=e.passProps),"onDropOnGroup"in e&&n(17,y=e.onDropOnGroup),"groupContextMenu"in e&&n(8,v=e.groupContextMenu),"collapsedGroupNames"in e&&u(n(9,x=e.collapsedGroupNames)),"filter"in e&&n(10,w=e.filter)},e.$$.update=()=>{524289&e.$$.dirty&&n(12,o=!s.includes(d)),2&e.$$.dirty&&n(18,r=m.filter((e=>e.isMatched))),262146&e.$$.dirty&&n(11,i=r.length<m.length?`${r.length}/${m.length}`:`${m.length}`)},[d,m,f,h,g,_,$,b,v,x,w,i,o,C,function(e){var t=e.dataTransfer.getData("app_object_drag_data");t&&y&&(e.stopPropagation(),y(t,d))},c,p,y,r,s,()=>x.update((e=>e.includes(d)?e.filter((e=>e!=d)):[...e,d])),()=>v(d),()=>C(!0),()=>C(!1),function(t){bubble.call(this,e,t)}]}class AppObjectGroup extends SvelteComponent{constructor(e){super(),init(this,e,instance$5A,create_fragment$5G,safe_not_equal,{group:0,groupFunc:16,items:1,groupIconFunc:2,mapGroupTitle:3,module:4,checkedObjectsStore:5,disableContextMenu:6,passProps:7,onDropOnGroup:17,groupContextMenu:8,collapsedGroupNames:9,filter:10})}}function get_each_context_1$a(e,t,n){const o=e.slice();return o[39]=t[n],o}function get_each_context$W(e,t,n){const o=e.slice();return o[36]=t[n],o}function create_else_block$16(e){let t,n,o,r=e[19],i=[];for(let t=0;t<r.length;t+=1)i[t]=create_each_block_1$a(get_each_context_1$a(e,r,t));const a=e=>transition_out(i[e],1,1,(()=>{i[e]=null}));let s=e[21]&&create_if_block_1$1r(e);return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=space(),s&&s.c(),n=empty()},m(e,r){for(let t=0;t<i.length;t+=1)i[t]&&i[t].m(e,r);insert(e,t,r),s&&s.m(e,r),insert(e,n,r),o=!0},p(e,o){if(26740735&o[0]){let n;for(r=e[19],n=0;n<r.length;n+=1){const a=get_each_context_1$a(e,r,n);i[n]?(i[n].p(a,o),transition_in(i[n],1)):(i[n]=create_each_block_1$a(a),i[n].c(),transition_in(i[n],1),i[n].m(t.parentNode,t))}for(group_outros(),n=r.length;n<i.length;n+=1)a(n);check_outros()}e[21]?s?(s.p(e,o),2097152&o[0]&&transition_in(s,1)):(s=create_if_block_1$1r(e),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros())},i(e){if(!o){for(let e=0;e<r.length;e+=1)transition_in(i[e]);transition_in(s),o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)transition_out(i[e]);transition_out(s),o=!1},d(e){destroy_each(i,e),e&&detach(t),s&&s.d(e),e&&detach(n)}}}function create_if_block$2m(e){let t,n,o=e[11]?_.sortBy(_.keys(e[22])):_.keys(e[22]),r=[];for(let t=0;t<o.length;t+=1)r[t]=create_each_block$W(get_each_context$W(e,o,t));const i=e=>transition_out(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=empty()},m(e,o){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,o);insert(e,t,o),n=!0},p(e,n){if(4456443&n[0]){let a;for(o=e[11]?_.sortBy(_.keys(e[22])):_.keys(e[22]),a=0;a<o.length;a+=1){const i=get_each_context$W(e,o,a);r[a]?(r[a].p(i,n),transition_in(r[a],1)):(r[a]=create_each_block$W(i),r[a].c(),transition_in(r[a],1),r[a].m(t.parentNode,t))}for(group_outros(),a=o.length;a<r.length;a+=1)i(a);check_outros()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)transition_in(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)transition_out(r[e]);n=!1},d(e){destroy_each(r,e),e&&detach(t)}}}function create_each_block_1$a(e){let t,n;return t=new AppObjectListItem({props:{isHidden:!e[20].includes(e[39]),module:e[0],subItemsComponent:e[1],expandOnClick:e[2],data:e[39],isExpandable:e[3],expandIconFunc:e[5],checkedObjectsStore:e[6],disableContextMenu:e[7],filter:e[4],isExpandedBySearch:e[4]&&e[24].includes(e[39]),isMainMatched:e[4]&&e[23].includes(e[39]),passProps:e[8],getIsExpanded:e[9],setIsExpanded:e[10]}}),t.$on("objectClick",e[33]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};1572864&n[0]&&(o.isHidden=!e[20].includes(e[39])),1&n[0]&&(o.module=e[0]),2&n[0]&&(o.subItemsComponent=e[1]),4&n[0]&&(o.expandOnClick=e[2]),524288&n[0]&&(o.data=e[39]),8&n[0]&&(o.isExpandable=e[3]),32&n[0]&&(o.expandIconFunc=e[5]),64&n[0]&&(o.checkedObjectsStore=e[6]),128&n[0]&&(o.disableContextMenu=e[7]),16&n[0]&&(o.filter=e[4]),17301520&n[0]&&(o.isExpandedBySearch=e[4]&&e[24].includes(e[39])),8912912&n[0]&&(o.isMainMatched=e[4]&&e[23].includes(e[39])),256&n[0]&&(o.passProps=e[8]),512&n[0]&&(o.getIsExpanded=e[9]),1024&n[0]&&(o.setIsExpanded=e[10]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_1$1r(e){let t,n,o;return n=new Link$1({props:{onClick:e[34],$$slots:{default:[create_default_slot$22]},$$scope:{ctx:e}}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","ml-2")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p(e,t){const o={};262144&t[0]&&(o.onClick=e[34]),1572864&t[0]|2048&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_default_slot$22(e){let t,n,o=e[20].length-e[19].length+"";return{c(){t=text$1("Show next "),n=text$1(o)},m(e,o){insert(e,t,o),insert(e,n,o)},p(e,t){1572864&t[0]&&o!==(o=e[20].length-e[19].length+"")&&set_data(n,o)},d(e){e&&detach(t),e&&detach(n)}}}function create_each_block$W(e){let t,n;return t=new AppObjectGroup({props:{group:e[36],module:e[0],items:e[22][e[36]],expandIconFunc:e[5],groupIconFunc:e[13],isExpandable:e[3],subItemsComponent:e[1],checkedObjectsStore:e[6],groupFunc:e[14],mapGroupTitle:e[15],disableContextMenu:e[7],filter:e[4],passProps:e[8],getIsExpanded:e[9],setIsExpanded:e[10],onDropOnGroup:e[16],groupContextMenu:e[12],collapsedGroupNames:e[17]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};4196352&n[0]&&(o.group=e[36]),1&n[0]&&(o.module=e[0]),4196352&n[0]&&(o.items=e[22][e[36]]),32&n[0]&&(o.expandIconFunc=e[5]),8192&n[0]&&(o.groupIconFunc=e[13]),8&n[0]&&(o.isExpandable=e[3]),2&n[0]&&(o.subItemsComponent=e[1]),64&n[0]&&(o.checkedObjectsStore=e[6]),16384&n[0]&&(o.groupFunc=e[14]),32768&n[0]&&(o.mapGroupTitle=e[15]),128&n[0]&&(o.disableContextMenu=e[7]),16&n[0]&&(o.filter=e[4]),256&n[0]&&(o.passProps=e[8]),512&n[0]&&(o.getIsExpanded=e[9]),1024&n[0]&&(o.setIsExpanded=e[10]),65536&n[0]&&(o.onDropOnGroup=e[16]),4096&n[0]&&(o.groupContextMenu=e[12]),131072&n[0]&&(o.collapsedGroupNames=e[17]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5F(e){let t,n,o,r;const i=[create_if_block$2m,create_else_block$16],a=[];function s(e,t){return e[14]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function extendGroups(e,t){const n={...e};for(const e of t)n[e]||(n[e]=[]);return n}function instance$5z(e,t,n){let o,r,i,a,s,c,l,u,d,p;component_subscribe(e,focusedConnectionOrDatabase,(e=>n(32,p=e)));let{list:m}=t,{module:f}=t,{subItemsComponent:h}=t,{expandOnClick:g=!1}=t,{isExpandable:$}=t,{filter:b}=t,{expandIconFunc:y}=t,{checkedObjectsStore:v=null}=t,{disableContextMenu:x=!1}=t,{passProps:w={}}=t,{getIsExpanded:C=null}=t,{setIsExpanded:k=null}=t,{sortGroups:S=!1}=t,{groupContextMenu:T=null}=t,{groupIconFunc:E=plusExpandIcon}=t,{groupFunc:A}=t,{mapGroupTitle:O}=t,{onDropOnGroup:N}=t,{emptyGroupNames:I=[]}=t,{isExpandedBySearch:D=!1}=t,{collapsedGroupNames:M=writable([])}=t,{onChangeFilteredList:R}=t,L=!1;function F(){n(18,L=!0)}return e.$$set=e=>{"list"in e&&n(25,m=e.list),"module"in e&&n(0,f=e.module),"subItemsComponent"in e&&n(1,h=e.subItemsComponent),"expandOnClick"in e&&n(2,g=e.expandOnClick),"isExpandable"in e&&n(3,$=e.isExpandable),"filter"in e&&n(4,b=e.filter),"expandIconFunc"in e&&n(5,y=e.expandIconFunc),"checkedObjectsStore"in e&&n(6,v=e.checkedObjectsStore),"disableContextMenu"in e&&n(7,x=e.disableContextMenu),"passProps"in e&&n(8,w=e.passProps),"getIsExpanded"in e&&n(9,C=e.getIsExpanded),"setIsExpanded"in e&&n(10,k=e.setIsExpanded),"sortGroups"in e&&n(11,S=e.sortGroups),"groupContextMenu"in e&&n(12,T=e.groupContextMenu),"groupIconFunc"in e&&n(13,E=e.groupIconFunc),"groupFunc"in e&&n(14,A=e.groupFunc),"mapGroupTitle"in e&&n(15,O=e.mapGroupTitle),"onDropOnGroup"in e&&n(16,N=e.onDropOnGroup),"emptyGroupNames"in e&&n(26,I=e.emptyGroupNames),"isExpandedBySearch"in e&&n(27,D=e.isExpandedBySearch),"collapsedGroupNames"in e&&n(17,M=e.collapsedGroupNames),"onChangeFilteredList"in e&&n(28,R=e.onChangeFilteredList)},e.$$.update=()=>{273&e.$$.dirty[0]&&n(31,o=f.createMatcher&&f.createMatcher(b,w?.searchSettings)),33570817&e.$$.dirty[0]|1&e.$$.dirty[1]&&n(30,r=_.compact((m||[]).map((e=>{const t=!o||o(e);let n=!0,r=!0,i=!0;0==t?(n=!1,i=!1,r=!1):"child"==t?r=!1:"main"==t?i=!1:"none"==t?(n=!1,i=!1,r=!1):"both"==t&&(i=!f.disableShowChildrenWithParentMatch);return{group:A?A(e):void 0,data:e,isMatched:n,isChildMatched:i,isMainMatched:r}})))),1073741824&e.$$.dirty[0]&&n(20,i=r.filter((e=>e.isMatched)).map((e=>e.data))),1073741824&e.$$.dirty[0]&&n(24,a=r.filter((e=>e.isChildMatched)).map((e=>e.data))),1073741824&e.$$.dirty[0]&&n(23,s=r.filter((e=>e.isMainMatched)).map((e=>e.data))),1140867072&e.$$.dirty[0]&&n(22,c=A?extendGroups(_.groupBy(r,"group"),I):null),169082896&e.$$.dirty[0]&&n(19,l=D&&!L?i.slice(0,b.trim().length<3?1:3):m),135790592&e.$$.dirty[0]&&n(21,u=D&&l.length<i.length),3670016&e.$$.dirty[0]&&n(29,d=u?i.slice(l.length):[]),536870912&e.$$.dirty[0]|2&e.$$.dirty[1]&&p&&d.some((e=>p.conid==e?.connection?._id&&p.database==e?.name))&&tick().then(F)},[f,h,g,$,b,y,v,x,w,C,k,S,T,E,A,O,N,M,L,l,i,u,c,s,a,m,I,D,R,d,r,o,p,function(t){bubble.call(this,e,t)},()=>{n(18,L=!0)}]}class AppObjectList extends SvelteComponent{constructor(e){super(),init(this,e,instance$5z,create_fragment$5F,safe_not_equal,{list:25,module:0,subItemsComponent:1,expandOnClick:2,isExpandable:3,filter:4,expandIconFunc:5,checkedObjectsStore:6,disableContextMenu:7,passProps:8,getIsExpanded:9,setIsExpanded:10,sortGroups:11,groupContextMenu:12,groupIconFunc:13,groupFunc:14,mapGroupTitle:15,onDropOnGroup:16,emptyGroupNames:26,isExpandedBySearch:27,collapsedGroupNames:17,onChangeFilteredList:28},null,[-1,-1])}}function createQuickExportMenuItems(e,t){const n=getExtensions();return[Object.assign({text:"Export advanced..."},t),{divider:!0},...n.quickExports.map((t=>({text:t.label,onClick:e(t)}))),{divider:!0},{text:"Current archive",onClick:e({extension:"jsonl",label:"Current archive",noFilenameDependency:!0,createWriter:(e,t)=>({functionName:"archiveWriter",props:{fileName:t,folderName:getCurrentArchive()}})})}]}function createQuickExportMenu(e,t,n={}){return hasPermission("dbops/export")?Object.assign({text:"Export",submenu:createQuickExportMenuItems(e,t)},n):null}function getTargetName(e,t,n){const o=`targetName_${t}`;if(n[o])return n[o];const r=findFileFormat(e,n.targetStorageType);if(r){const e=r.getDefaultOutputName?r.getDefaultOutputName(t,n):null;return e||`${t}.${r.extension}`}return t}function extractFormatApiParameters(e,t,n){const o=(n.args||[]).filter((e=>e.apiName)).map((o=>[o.apiName,e[`${t}_${n.storageType}_${o.name}`]])).filter((e=>null!=e[1]));return _.fromPairs(o)}function extractDriverApiParameters(e,t,n){const o=(n.importExportArgs||[]).filter((e=>e.apiName)).map((o=>[o.apiName,e[`${t}_${n.engine}_${o.name}`]])).filter((e=>null!=e[1]));return _.fromPairs(o)}function extractShellConnection(e,t){return getCurrentConfig().allowShellConnection?Object.assign(Object.assign({},_.omitBy(_.omit(e,["_id","displayName","databases","connectionColor","status","unsaved"]),(e=>!e))),{database:t}):{_id:e._id,engine:e.engine,database:t}}function extractShellConnectionHostable(e,t){const n=lib$5.findEngineDriver(e,getExtensions());return(null==n?void 0:n.singleConnectionOnly)?{systemConnection:{$hostConnection:!0},connection:n.engine}:{connection:extractShellConnection(e,t)}}function extractShellHostConnection(e,t){const n=lib$5.findEngineDriver(e,getExtensions());if(null==n?void 0:n.singleConnectionOnly)return{conid:e._id,database:t}}function getConnection(e,t,n,o){return __awaiter$h(this,void 0,void 0,(function*(){if("database"==t||"query"==t){const t=yield getConnectionInfo({conid:n}),r=lib$5.findEngineDriver(t,e);return[extractShellConnection(t,o),r]}return[null,null]}))}function getSourceExpr(e,t,n,o,r,i){const{sourceStorageType:a}=n,s=(null==r?void 0:r.singleConnectionOnly)&&i?{systemConnection:{$hostConnection:!0},connection:null==r?void 0:r.engine}:{connection:o};if("database"==a){const e={schemaName:n.sourceSchemaName,pureName:t};return["tableReader",Object.assign(Object.assign(Object.assign({},s),extractDriverApiParameters(n,"source",r)),e)]}if("query"==a)return["queryReader",Object.assign(Object.assign(Object.assign({},s),extractDriverApiParameters(n,"source",r)),{queryType:n.sourceQueryType,query:"json"==n.sourceQueryType?JSON.parse(n.sourceQuery):n.sourceQuery})];if(findFileFormat(e,a)){const o=n[`sourceFile_${t}`],r=findFileFormat(e,a);if(r&&r.readerFunc)return[r.readerFunc,Object.assign(Object.assign({},o?_.omit(o,["isDownload"]):{fileName:n.importFromZipFile?`zip://archive:${n.sourceArchiveFolder}//${t}`:t}),extractFormatApiParameters(n,"source",r))]}if("jsldata"==a)return["jslDataReader",{jslid:n.sourceJslId}];if("archive"==a)return["archiveReader",{folderName:n.sourceArchiveFolder,fileName:t}];throw new Error(`Unknown source storage type: ${a}`)}function getFlagsFroAction(e){switch(e){case"dropCreateTable":return{createIfNotExists:!0,dropIfExists:!0};case"truncate":return{createIfNotExists:!0,truncate:!0};case"appendData":return{createIfNotExists:!1,truncate:!1}}return{createIfNotExists:!0}}function getTargetExpr(e,t,n,o,r,i){const{targetStorageType:a}=n,s=(null==r?void 0:r.singleConnectionOnly)&&i?{systemConnection:{$hostConnection:!0},connection:null==r?void 0:r.engine}:{connection:o},c=findFileFormat(e,a);if(c&&c.writerFunc){const o=c.getOutputParams&&c.getOutputParams(t,n);return[c.writerFunc,Object.assign(Object.assign({},o||{fileName:getTargetName(e,t,n)}),extractFormatApiParameters(n,"target",c))]}if("database"==a)return["tableWriter",Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s),{schemaName:n.targetSchemaName,pureName:getTargetName(e,t,n)}),extractDriverApiParameters(n,"target",r)),getFlagsFroAction(n[`actionType_${t}`])),{progressName:t})];if("archive"==a)return["archiveWriter",{folderName:n.targetArchiveFolder,fileName:getTargetName(e,t,n)}];throw new Error(`Unknown target storage type: ${a}`)}function normalizeExportColumnMap(e){return e&&e.find((e=>!e.ignore))&&(e=e.filter((e=>!e.skip))).length>0?e.map((e=>_.omit(e,["ignore"]))):null}function createImpExpScript(e,t,n=void 0,o=!1){return __awaiter$h(this,void 0,void 0,(function*(){const r=getCurrentConfig();let i=new lib$5.ScriptWriterJson(t.startVariableIndex||0);"script"==n&&r.allowShellScripting&&(i=new lib$5.ScriptWriterJavaScript(t.startVariableIndex||0));const[a,s]=yield getConnection(e,t.sourceStorageType,t.sourceConnectionId,t.sourceDatabaseName),[c,l]=yield getConnection(e,t.targetStorageType,t.targetConnectionId,t.targetDatabaseName);let u=null;if(o&&((null==s?void 0:s.singleConnectionOnly)&&(u={conid:t.sourceConnectionId,database:t.sourceDatabaseName}),null==l?void 0:l.singleConnectionOnly)){if(u&&(u.conid!=t.targetConnectionId||u.database!=t.targetDatabaseName))throw new Error("Cannot use two different single-connections in the same script");u={conid:t.targetConnectionId,database:t.targetDatabaseName}}const d=getAsArray(t.sourceList);for(const n of d){const o=i.allocVariable();i.assign(o,...getSourceExpr(e,n,t,a,s,u));const r=i.allocVariable();i.assign(r,...getTargetExpr(e,n,t,c,l,u));const d=normalizeExportColumnMap(t[`columns_${n}`]);let p=null;d&&(p=i.allocVariable(),i.assignValue(p,d)),i.copyStream(o,r,p,u?{name:n,runid:{$runid:!0}}:n),i.endLine()}if(t.exportToZipFile){let e=t.exportToZipFileName||`zip-archive-${moment().format("YYYY-MM-DD-HH-mm-ss")}.zip`;e.endsWith(".zip")||(e+=".zip"),i.zipDirectory(".",t.createZipFileInArchive?"archive:"+e:e)}const p=i.getScript(t.schedule);return"json"==n&&(p.hostConnection=u),p}))}function getActionOptions(e,t,n,o){const r=[];return"database"==n.targetStorageType?(r.push({label:"Create table/append",value:"createTable"}),r.push({label:"Append data",value:"appendData"}),r.push({label:"Truncate and import",value:"truncate"}),r.push({label:"Drop and create table",value:"dropCreateTable"})):r.push({label:"Create file",value:"createFile"}),r}function createPreviewReader(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){const[o,r]=yield getConnection(e,t.sourceStorageType,t.sourceConnectionId,t.sourceDatabaseName),[i,a]=getSourceExpr(e,n,t,o,r,null);return{functionName:i,props:Object.assign(Object.assign({},a),{limitRows:100})}}))}function runImportExportScript({script:e,runningMessage:t,canceledMessage:n,finishedMessage:o,afterFinish:r=null,hostConnection:i=null}){return __awaiter$h(this,void 0,void 0,(function*(){let a,s=!1;if(i)a=v1_1$6(),yield apiCall("database-connections/eval-json-script",{runid:a,conid:i.conid,database:i.database,script:e});else{const t=yield apiCall("runners/start",{script:e});a=t.runid}const c=showSnackbar({message:t,icon:"icon loading",buttons:[{label:"Cancel",onClick:()=>{s=!0,apiCall("runners/cancel",{runid:a})}}]});function l(e){const t=e.writtenRowsCount||e.readRowCount;t&&updateSnackbarProgressMessage(c,`${t} rows processed`)}apiOn(`runner-done-${a}`,(function e(){closeSnackbar(c),apiOff(`runner-done-${a}`,e),apiOff(`runner-progress-${a}`,l),s?showSnackbarError(n):(showSnackbarInfo(o),r&&r())})),apiOn(`runner-progress-${a}`,l)}))}function saveExportedFile(e,t,n,o,r,i=null){return __awaiter$h(this,void 0,void 0,(function*(){const a=getElectron();let s,c;if(a)s=yield a.showSaveDialog({filters:e,defaultPath:t,properties:["showOverwriteConfirmation"]});else{const e=yield apiCall("files/generate-uploads-file",{extension:n});s=e.filePath,c=e.fileName}if(!s)return;runImportExportScript({script:r(s),runningMessage:`Exporting ${o}`,canceledMessage:`Export ${o} canceled`,finishedMessage:`Export ${o} finished`,afterFinish:()=>{a||downloadFromApi(`uploads/get?file=${c}`,t)},hostConnection:i})}))}function generateQuickExportScript(e,t,n,o,r){const i=new lib$5.ScriptWriterJson,a=i.allocVariable();i.assign(a,e.functionName,e.props);const s=i.allocVariable(),c=t.createWriter(n,o);i.assign(s,c.functionName,c.props);const l=normalizeExportColumnMap(r);let u=null;return l&&(u=i.allocVariable(),i.assignValue(u,l)),i.copyStream(a,s,u,"data"),i.endLine(),i.getScript()}function exportQuickExportFile(e,t,n,o=null){return __awaiter$h(this,void 0,void 0,(function*(){if(n.noFilenameDependency){runImportExportScript({script:generateQuickExportScript(t,n,null,e,o),runningMessage:`Exporting ${e}`,canceledMessage:`Export ${e} canceled`,finishedMessage:`Export ${e} finished`,hostConnection:t.hostConnection})}else yield saveExportedFile([{name:n.label,extensions:[n.extension]}],`${e}.${n.extension}`,n.extension,e,(r=>generateQuickExportScript(t,n,r,e,o)),t.hostConnection)}))}function saveFileToDisk(e,t={formatLabel:"HTML page",formatExtension:"html",defaultFileName:null}){var n,o;return __awaiter$h(this,void 0,void 0,(function*(){const{formatLabel:r,formatExtension:i}=t,a=getElectron();if(a){const o=[{name:r,extensions:[i]}],s=yield a.showSaveDialog({filters:o,defaultPath:null!==(n=t.defaultFileName)&&void 0!==n?n:`file.${i}`,properties:["showOverwriteConfirmation"]});if(!s)return;yield e(s),a.openExternal("file:///"+s)}else{const n=yield apiCall("files/generate-uploads-file");yield e(n.filePath),yield downloadFromApi(`uploads/get?file=${n.fileName}`,null!==(o=t.defaultFileName)&&void 0!==o?o:`file.${i}`)}}))}function downloadFromApi(e,t){return __awaiter$h(this,void 0,void 0,(function*(){fetch(`${resolveApi()}/${e}`,{method:"GET",headers:resolveApiHeaders()}).then((e=>e.blob())).then((e=>{const n=URL.createObjectURL(e),o=document.createElement("a");document.body.appendChild(o),o.download=t,o.href=n,o.click(),o.remove(),setTimeout((()=>{URL.revokeObjectURL(n)}))}))}))}function splitterDrag(e,t){let n=null;const o=e=>{n=e[t],document.addEventListener("mousemove",r,!0),document.addEventListener("mouseup",i,!0)},r=o=>{o.preventDefault();const r=o[t]-n;n=o[t],e.dispatchEvent(new CustomEvent("resizeSplitter",{detail:r}))},i=e=>{e.preventDefault(),n=null,document.removeEventListener("mousemove",r,!0),document.removeEventListener("mouseup",i,!0)};return e.addEventListener("mousedown",o),{destroy(){e.removeEventListener("mousedown",o),null!=n&&(document.removeEventListener("mousemove",r,!0),document.removeEventListener("mouseup",i,!0))}}}const get__2_slot_changes$6=e=>({}),get__2_slot_context$6=e=>({}),get__1_slot_changes$6=e=>({}),get__1_slot_context$6=e=>({});function create_if_block_6$o(e){let t,n,o;const r=e[13][1],i=create_slot(r,e,e[12],get__1_slot_context$6);return{c(){t=element("div"),i&&i.c(),attr(t,"class","child1 svelte-16cskqp"),attr(t,"style",n=e[1]?e[7]?"display:none":e[8]?"flex:1":`width:${e[0]}px; min-width:${e[0]}px; max-width:${e[0]}px}`:"flex:1")},m(e,n){insert(e,t,n),i&&i.m(t,null),o=!0},p(e,a){i&&i.p&&(!o||4096&a)&&update_slot_base(i,r,e,e[12],o?get_slot_changes(r,e[12],a,get__1_slot_changes$6):get_all_dirty_from_scope(e[12]),get__1_slot_context$6),(!o||387&a&&n!==(n=e[1]?e[7]?"display:none":e[8]?"flex:1":`width:${e[0]}px; min-width:${e[0]}px; max-width:${e[0]}px}`:"flex:1"))&&attr(t,"style",n)},i(e){o||(transition_in(i,e),o=!0)},o(e){transition_out(i,e),o=!1},d(e){e&&detach(t),i&&i.d(e)}}}function create_if_block_4$C(e){let t,n,o,r,i,a=!e[2]&&create_if_block_5$u(e);const s=e[13][2],c=create_slot(s,e,e[12],get__2_slot_context$6);return{c(){a&&a.c(),t=space(),n=element("div"),c&&c.c(),attr(n,"class",o=null_to_empty(e[7]?"child1":"child2")+" svelte-16cskqp"),attr(n,"style",r=e[8]?"display:none":e[7]?"flex:1":"child2")},m(e,o){a&&a.m(e,o),insert(e,t,o),insert(e,n,o),c&&c.m(n,null),i=!0},p(e,l){e[2]?a&&(a.d(1),a=null):a?a.p(e,l):(a=create_if_block_5$u(e),a.c(),a.m(t.parentNode,t)),c&&c.p&&(!i||4096&l)&&update_slot_base(c,s,e,e[12],i?get_slot_changes(s,e[12],l,get__2_slot_changes$6):get_all_dirty_from_scope(e[12]),get__2_slot_context$6),(!i||128&l&&o!==(o=null_to_empty(e[7]?"child1":"child2")+" svelte-16cskqp"))&&attr(n,"class",o),(!i||384&l&&r!==(r=e[8]?"display:none":e[7]?"flex:1":"child2"))&&attr(n,"style",r)},i(e){i||(transition_in(c,e),i=!0)},o(e){transition_out(c,e),i=!1},d(e){a&&a.d(e),e&&detach(t),e&&detach(n),c&&c.d(e)}}}function create_if_block_5$u(e){let t,n,o,r;return{c(){t=element("div"),attr(t,"class","horizontal-split-handle"),attr(t,"style",n=e[7]||e[8]?"display:none":"")},m(n,i){insert(n,t,i),o||(r=[action_destroyer(splitterDrag.call(null,t,"clientX")),listen(t,"resizeSplitter",e[14])],o=!0)},p(e,o){384&o&&n!==(n=e[7]||e[8]?"display:none":"")&&attr(t,"style",n)},d(e){e&&detach(t),o=!1,run_all(r)}}}function create_if_block_2$10(e){let t,n,o,r;const i=[create_if_block_3$L,create_else_block_1$g],a=[];function s(e,t){return e[7]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_else_block_1$g(e){let t,n,o,r,i,a;return n=new FontIcon({props:{icon:"icon chevron-double-left"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-16cskqp"),attr(t,"style",o=`left: ${e[0]-16}px`)},m(o,s){insert(o,t,s),mount_component(n,t,null),r=!0,i||(a=listen(t,"click",e[16]),i=!0)},p(e,n){(!r||1&n&&o!==(o=`left: ${e[0]-16}px`))&&attr(t,"style",o)},i(e){r||(transition_in(n.$$.fragment,e),r=!0)},o(e){transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),destroy_component(n),i=!1,a()}}}function create_if_block_3$L(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:"icon chevron-double-right"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-16cskqp"),attr(t,"style","left: 0px")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",e[15]),r=!0)},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_if_block$2l(e){let t,n,o,r;const i=[create_if_block_1$1q,create_else_block$15],a=[];function s(e,t){return e[8]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_else_block$15(e){let t,n,o,r,i,a;return n=new FontIcon({props:{icon:"icon chevron-double-right"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-16cskqp"),attr(t,"style",o=`left: ${e[0]}px`)},m(o,s){insert(o,t,s),mount_component(n,t,null),r=!0,i||(a=listen(t,"click",e[18]),i=!0)},p(e,n){(!r||1&n&&o!==(o=`left: ${e[0]}px`))&&attr(t,"style",o)},i(e){r||(transition_in(n.$$.fragment,e),r=!0)},o(e){transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),destroy_component(n),i=!1,a()}}}function create_if_block_1$1q(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:"icon chevron-double-left"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-16cskqp"),attr(t,"style","right: 0px")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",e[17]),r=!0)},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_fragment$5E(e){let t,n,o,r,i,a,s=!e[2]&&create_if_block_6$o(e),c=e[1]&&create_if_block_4$C(e),l=e[3]&&!e[8]&&e[1]&&create_if_block_2$10(e),u=e[4]&&!e[7]&&e[1]&&create_if_block$2l(e);return{c(){t=element("div"),s&&s.c(),n=space(),c&&c.c(),o=space(),l&&l.c(),r=space(),u&&u.c(),attr(t,"class","container svelte-16cskqp"),add_render_callback((()=>e[19].call(t)))},m(d,p){insert(d,t,p),s&&s.m(t,null),append(t,n),c&&c.m(t,null),append(t,o),l&&l.m(t,null),append(t,r),u&&u.m(t,null),i=add_iframe_resize_listener(t,e[19].bind(t)),a=!0},p(e,[i]){e[2]?s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros()):s?(s.p(e,i),4&i&&transition_in(s,1)):(s=create_if_block_6$o(e),s.c(),transition_in(s,1),s.m(t,n)),e[1]?c?(c.p(e,i),2&i&&transition_in(c,1)):(c=create_if_block_4$C(e),c.c(),transition_in(c,1),c.m(t,o)):c&&(group_outros(),transition_out(c,1,1,(()=>{c=null})),check_outros()),e[3]&&!e[8]&&e[1]?l?(l.p(e,i),266&i&&transition_in(l,1)):(l=create_if_block_2$10(e),l.c(),transition_in(l,1),l.m(t,r)):l&&(group_outros(),transition_out(l,1,1,(()=>{l=null})),check_outros()),e[4]&&!e[7]&&e[1]?u?(u.p(e,i),146&i&&transition_in(u,1)):(u=create_if_block$2l(e),u.c(),transition_in(u,1),u.m(t,null)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros())},i(e){a||(transition_in(s),transition_in(c),transition_in(l),transition_in(u),a=!0)},o(e){transition_out(s),transition_out(c),transition_out(l),transition_out(u),a=!1},d(e){e&&detach(t),s&&s.d(),c&&c.d(),l&&l.d(),u&&u.d(),i()}}}function computeSplitterSize(e,t,n,o){return null!=n?t*n:o?t-o:_.isString(e)&&e.startsWith("~")&&e.endsWith("px")?t-parseInt(e.slice(1,-2)):_.isString(e)&&e.endsWith("px")?parseInt(e.slice(0,-2)):_.isString(e)&&e.endsWith("%")?t*parseFloat(e.slice(0,-1))/100:t/2}function instance$5y(e,t,n){let o,{$$slots:r={},$$scope:i}=t,{isSplitter:a=!0}=t,{initialValue:s}=t,{initialSizeRight:c}=t,{hideFirst:l=!1}=t,{allowCollapseChild1:u=!1}=t,{allowCollapseChild2:d=!1}=t,p=!1,m=!1,{size:f=0}=t,{onChangeSize:h=null}=t,g=null;return e.$$set=e=>{"isSplitter"in e&&n(1,a=e.isSplitter),"initialValue"in e&&n(9,s=e.initialValue),"initialSizeRight"in e&&n(10,c=e.initialSizeRight),"hideFirst"in e&&n(2,l=e.hideFirst),"allowCollapseChild1"in e&&n(3,u=e.allowCollapseChild1),"allowCollapseChild2"in e&&n(4,d=e.allowCollapseChild2),"size"in e&&n(0,f=e.size),"onChangeSize"in e&&n(11,h=e.onChangeSize),"$$scope"in e&&n(12,i=e.$$scope)},e.$$.update=()=>{1632&e.$$.dirty&&n(0,f=computeSplitterSize(s,o,g,c)),2081&e.$$.dirty&&h&&h(f,o-f)},[f,a,l,u,d,o,g,p,m,s,c,h,i,r,e=>{n(0,f+=e.detail),o>0&&n(6,g=f/o)},()=>{n(7,p=!1)},()=>{n(7,p=!0)},()=>{n(8,m=!1)},()=>{n(8,m=!0)},function(){o=this.clientWidth,n(5,o)}]}class HorizontalSplitter extends SvelteComponent{constructor(e){super(),init(this,e,instance$5y,create_fragment$5E,safe_not_equal,{isSplitter:1,initialValue:9,initialSizeRight:10,hideFirst:2,allowCollapseChild1:3,allowCollapseChild2:4,size:0,onChangeSize:11})}}const get__2_slot_changes$5=e=>({}),get__2_slot_context$5=e=>({}),get__1_slot_changes$5=e=>({}),get__1_slot_context$5=e=>({});function create_if_block_4$B(e){let t,n,o,r,i,a,s,c,l;const u=e[10][2],d=create_slot(u,e,e[9],get__2_slot_context$5);return{c(){t=element("div"),o=space(),r=element("div"),d&&d.c(),attr(t,"class","vertical-split-handle"),attr(t,"style",n=e[6]||e[7]?"display:none":""),attr(r,"class",i=null_to_empty(e[6]?"child1":"child2")+" svelte-kqh1iu"),attr(r,"style",a=e[7]?"display:none":e[6]?"flex:1":"child2")},m(n,i){insert(n,t,i),insert(n,o,i),insert(n,r,i),d&&d.m(r,null),s=!0,c||(l=[action_destroyer(splitterDrag.call(null,t,"clientY")),listen(t,"resizeSplitter",e[11])],c=!0)},p(e,o){(!s||192&o&&n!==(n=e[6]||e[7]?"display:none":""))&&attr(t,"style",n),d&&d.p&&(!s||512&o)&&update_slot_base(d,u,e,e[9],s?get_slot_changes(u,e[9],o,get__2_slot_changes$5):get_all_dirty_from_scope(e[9]),get__2_slot_context$5),(!s||64&o&&i!==(i=null_to_empty(e[6]?"child1":"child2")+" svelte-kqh1iu"))&&attr(r,"class",i),(!s||192&o&&a!==(a=e[7]?"display:none":e[6]?"flex:1":"child2"))&&attr(r,"style",a)},i(e){s||(transition_in(d,e),s=!0)},o(e){transition_out(d,e),s=!1},d(e){e&&detach(t),e&&detach(o),e&&detach(r),d&&d.d(e),c=!1,run_all(l)}}}function create_if_block_2$$(e){let t,n,o,r;const i=[create_if_block_3$K,create_else_block_1$f],a=[];function s(e,t){return e[6]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_else_block_1$f(e){let t,n,o,r,i,a;return n=new FontIcon({props:{icon:"icon chevron-double-up"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-kqh1iu"),attr(t,"style",o=`top: ${e[5]-16}px`)},m(o,s){insert(o,t,s),mount_component(n,t,null),r=!0,i||(a=listen(t,"click",e[13]),i=!0)},p(e,n){(!r||32&n&&o!==(o=`top: ${e[5]-16}px`))&&attr(t,"style",o)},i(e){r||(transition_in(n.$$.fragment,e),r=!0)},o(e){transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),destroy_component(n),i=!1,a()}}}function create_if_block_3$K(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:"icon chevron-double-down"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-kqh1iu"),attr(t,"style","top: 0px")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",e[12]),r=!0)},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_if_block$2k(e){let t,n,o,r;const i=[create_if_block_1$1p,create_else_block$14],a=[];function s(e,t){return e[7]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_else_block$14(e){let t,n,o,r,i,a;return n=new FontIcon({props:{icon:"icon chevron-double-down"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-kqh1iu"),attr(t,"style",o=`top: ${e[5]}px`)},m(o,s){insert(o,t,s),mount_component(n,t,null),r=!0,i||(a=listen(t,"click",e[15]),i=!0)},p(e,n){(!r||32&n&&o!==(o=`top: ${e[5]}px`))&&attr(t,"style",o)},i(e){r||(transition_in(n.$$.fragment,e),r=!0)},o(e){transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),destroy_component(n),i=!1,a()}}}function create_if_block_1$1p(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:"icon chevron-double-up"}}),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","collapse svelte-kqh1iu"),attr(t,"style","bottom: 0px")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",e[14]),r=!0)},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_fragment$5D(e){let t,n,o,r,i,a,s,c;const l=e[10][1],u=create_slot(l,e,e[9],get__1_slot_context$5);let d=e[0]&&create_if_block_4$B(e),p=e[1]&&!e[7]&&e[0]&&create_if_block_2$$(e),m=e[2]&&!e[6]&&e[0]&&create_if_block$2k(e);return{c(){t=element("div"),n=element("div"),u&&u.c(),r=space(),d&&d.c(),i=space(),p&&p.c(),a=space(),m&&m.c(),attr(n,"class","child1 svelte-kqh1iu"),attr(n,"style",o=e[0]?e[6]?"display:none":e[7]?"flex:1":`height:${e[5]}px; min-height:${e[5]}px; max-height:${e[5]}px}`:"flex:1"),attr(t,"class","container svelte-kqh1iu"),add_render_callback((()=>e[16].call(t)))},m(o,l){insert(o,t,l),append(t,n),u&&u.m(n,null),append(t,r),d&&d.m(t,null),append(t,i),p&&p.m(t,null),append(t,a),m&&m.m(t,null),s=add_iframe_resize_listener(t,e[16].bind(t)),c=!0},p(e,[r]){u&&u.p&&(!c||512&r)&&update_slot_base(u,l,e,e[9],c?get_slot_changes(l,e[9],r,get__1_slot_changes$5):get_all_dirty_from_scope(e[9]),get__1_slot_context$5),(!c||225&r&&o!==(o=e[0]?e[6]?"display:none":e[7]?"flex:1":`height:${e[5]}px; min-height:${e[5]}px; max-height:${e[5]}px}`:"flex:1"))&&attr(n,"style",o),e[0]?d?(d.p(e,r),1&r&&transition_in(d,1)):(d=create_if_block_4$B(e),d.c(),transition_in(d,1),d.m(t,i)):d&&(group_outros(),transition_out(d,1,1,(()=>{d=null})),check_outros()),e[1]&&!e[7]&&e[0]?p?(p.p(e,r),131&r&&transition_in(p,1)):(p=create_if_block_2$$(e),p.c(),transition_in(p,1),p.m(t,a)):p&&(group_outros(),transition_out(p,1,1,(()=>{p=null})),check_outros()),e[2]&&!e[6]&&e[0]?m?(m.p(e,r),69&r&&transition_in(m,1)):(m=create_if_block$2k(e),m.c(),transition_in(m,1),m.m(t,null)):m&&(group_outros(),transition_out(m,1,1,(()=>{m=null})),check_outros())},i(e){c||(transition_in(u,e),transition_in(d),transition_in(p),transition_in(m),c=!0)},o(e){transition_out(u,e),transition_out(d),transition_out(p),transition_out(m),c=!1},d(e){e&&detach(t),u&&u.d(e),d&&d.d(),p&&p.d(),m&&m.d(),s()}}}function instance$5x(e,t,n){let o,{$$slots:r={},$$scope:i}=t,{isSplitter:a=!0}=t,{initialValue:s}=t,{allowCollapseChild1:c=!1}=t,{allowCollapseChild2:l=!1}=t,u=0,d=!1,p=!1,m=null;return e.$$set=e=>{"isSplitter"in e&&n(0,a=e.isSplitter),"initialValue"in e&&n(8,s=e.initialValue),"allowCollapseChild1"in e&&n(1,c=e.allowCollapseChild1),"allowCollapseChild2"in e&&n(2,l=e.allowCollapseChild2),"$$scope"in e&&n(9,i=e.$$scope)},e.$$.update=()=>{280&e.$$.dirty&&n(5,u=computeSplitterSize(s,o,m))},[a,c,l,o,m,u,d,p,s,i,r,e=>{n(5,u+=e.detail),o>0&&n(4,m=u/o)},()=>{n(6,d=!1)},()=>{n(6,d=!0)},()=>{n(7,p=!1)},()=>{n(7,p=!0)},function(){o=this.clientHeight,n(3,o)}]}class VerticalSplitter extends SvelteComponent{constructor(e){super(),init(this,e,instance$5x,create_fragment$5D,safe_not_equal,{isSplitter:0,initialValue:8,allowCollapseChild1:1,allowCollapseChild2:2})}}function create_fragment$5C(e){let t,n,o,r=[e[2]],i={};for(let e=0;e<r.length;e+=1)i=assign(i,r[e]);return{c(){t=element("textarea"),set_attributes(t,i)},m(r,i){insert(r,t,i),t.autofocus&&t.focus(),set_input_value(t,e[0]),e[7](t),n||(o=[listen(t,"input",e[6]),listen(t,"change",e[4]),listen(t,"input",e[5])],n=!0)},p(e,[n]){set_attributes(t,i=get_spread_update(r,[4&n&&e[2]])),1&n&&set_input_value(t,e[0])},i:noop$2,o:noop$2,d(r){r&&detach(t),e[7](null),n=!1,run_all(o)}}}function instance$5w(e,t,n){const o=["value","focused"];let r,i=compute_rest_props(t,o),{value:a}=t,{focused:s=!1}=t;return s&&onMount((()=>r.focus())),e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(2,i=compute_rest_props(t,o)),"value"in e&&n(0,a=e.value),"focused"in e&&n(3,s=e.focused)},[a,r,i,s,function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(){a=this.value,n(0,a)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class TextAreaField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5w,create_fragment$5C,safe_not_equal,{value:0,focused:3})}}function create_default_slot$21(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f,h,g,_,$,b,y,v,x,w,C,k,S,T,E,A,O,N,I,D,M,R,L,F,P;function j(t){e[5](t)}let B={rows:10,focused:!0};return void 0!==e[0]&&(B.value=e[0]),n=new TextAreaField({props:B}),binding_callbacks.push((()=>bind$2(n,"value",j))),L=init_binding_group(e[7][0]),{c(){t=element("div"),create_component(n.$$.fragment),r=space(),i=element("div"),a=element("div"),s=element("input"),c=space(),l=element("label"),l.textContent="Is one of line",u=text$1("'"),d=space(),p=element("div"),m=element("input"),f=space(),h=element("label"),h.textContent="Is not one of line",g=text$1("'"),_=space(),$=element("div"),b=element("input"),y=space(),v=element("label"),v.textContent="Contains",x=text$1("'"),w=space(),C=element("div"),k=element("input"),S=space(),T=element("label"),T.textContent="Begins",E=text$1("'"),A=space(),O=element("div"),N=element("input"),I=space(),D=element("label"),D.textContent="Ends",M=text$1("'"),attr(s,"type","radio"),s.__value="is",s.value=s.__value,attr(s,"id","__is"),attr(l,"for","__is"),attr(m,"type","radio"),m.__value="is_not",m.value=m.__value,attr(m,"id","__is_not"),attr(h,"for","__is_not"),attr(b,"type","radio"),b.__value="contains",b.value=b.__value,attr(b,"id","__contains"),attr(v,"for","__contains"),attr(k,"type","radio"),k.__value="begins",k.value=k.__value,attr(k,"id","__begins"),attr(T,"for","__begins"),attr(N,"type","radio"),N.__value="ends",N.value=N.__value,attr(N,"id","__ends"),attr(D,"for","__ends"),attr(t,"class","flex"),L.p(s,m,b,k,N)},m(o,L){insert(o,t,L),mount_component(n,t,null),append(t,r),append(t,i),append(i,a),append(a,s),s.checked=s.__value===e[1],append(a,c),append(a,l),append(a,u),append(i,d),append(i,p),append(p,m),m.checked=m.__value===e[1],append(p,f),append(p,h),append(p,g),append(i,_),append(i,$),append($,b),b.checked=b.__value===e[1],append($,y),append($,v),append($,x),append(i,w),append(i,C),append(C,k),k.checked=k.__value===e[1],append(C,S),append(C,T),append(C,E),append(i,A),append(i,O),append(O,N),N.checked=N.__value===e[1],append(O,I),append(O,D),append(O,M),R=!0,F||(P=[listen(s,"change",e[6]),listen(m,"change",e[8]),listen(b,"change",e[9]),listen(k,"change",e[10]),listen(N,"change",e[11])],F=!0)},p(e,t){const r={};!o&&1&t&&(o=!0,r.value=e[0],add_flush_callback((()=>o=!1))),n.$set(r),2&t&&(s.checked=s.__value===e[1]),2&t&&(m.checked=m.__value===e[1]),2&t&&(b.checked=b.__value===e[1]),2&t&&(k.checked=k.__value===e[1]),2&t&&(N.checked=N.__value===e[1])},i(e){R||(transition_in(n.$$.fragment,e),R=!0)},o(e){transition_out(n.$$.fragment,e),R=!1},d(e){e&&detach(t),destroy_component(n),L.r(),F=!1,run_all(P)}}}function create_header_slot$C(e){let t;return{c(){t=element("div"),t.textContent="Filter multiple values",attr(t,"slot","header")},m(e,n){insert(e,t,n)},p:noop$2,d(e){e&&detach(t)}}}function create_footer_slot$A(e){let t,n,o,r,i;return n=new FormStyledButton({props:{value:"OK"}}),n.$on("click",e[2]),r=new FormStyledButton({props:{type:"button",value:"Close"}}),r.$on("click",closeCurrentModal),{c(){t=element("div"),create_component(n.$$.fragment),o=space(),create_component(r.$$.fragment),attr(t,"slot","footer")},m(e,a){insert(e,t,a),mount_component(n,t,null),append(t,o),mount_component(r,t,null),i=!0},p:noop$2,i(e){i||(transition_in(n.$$.fragment,e),transition_in(r.$$.fragment,e),i=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(r.$$.fragment,e),i=!1},d(e){e&&detach(t),destroy_component(n),destroy_component(r)}}}function create_fragment$5B(e){let t,n;const o=[e[3]];let r={$$slots:{footer:[create_footer_slot$A],header:[create_header_slot$C],default:[create_default_slot$21]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=8&n?get_spread_update(o,[get_spread_object(e[3])]):{};4099&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5v(e,t,n){const o=["onFilter"];let r,i=compute_rest_props(t,o),{onFilter:a}=t,s="is";return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(3,i=compute_rest_props(t,o)),"onFilter"in e&&n(4,a=e.onFilter)},[r,s,()=>{a(s,r),closeCurrentModal()},i,a,function(e){r=e,n(0,r)},function(){s=this.__value,n(1,s)},[[]],function(){s=this.__value,n(1,s)},function(){s=this.__value,n(1,s)},function(){s=this.__value,n(1,s)},function(){s=this.__value,n(1,s)}]}class FilterMultipleValuesModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5v,create_fragment$5B,safe_not_equal,{onFilter:4})}}function create_fragment$5A(e){let t,n;const o=[{type:"button"},e[2]];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormStyledButton({props:r}),t.$on("click",e[1]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=4&n?get_spread_update(o,[o[0],get_spread_object(e[2])]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5u(e,t,n){let o;const r=createEventDispatcher(),{values:i}=getFormContext();return component_subscribe(e,i,(e=>n(3,o=e))),e.$$set=e=>{n(2,t=assign(assign({},t),exclude_internal_props(e)))},[i,function(){r("click",o)},t=exclude_internal_props(t)]}class FormButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$5u,create_fragment$5A,safe_not_equal,{})}}function isOutOfViewport(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r={};return r.top=n.top<0,r.left=n.left<0,r.bottom=n.bottom+o.height>(window.innerHeight||document.documentElement.clientHeight),r.right=n.right>(window.innerWidth||document.documentElement.clientWidth),r.any=r.top||r.left||r.bottom||r.right,r}function create_fragment$5z(e){let t,n,o=e[0](e[1],e[2])+"";return{c(){t=element("div"),attr(t,"class",n="item "+e[3]+" svelte-3e0qet")},m(e,n){insert(e,t,n),t.innerHTML=o},p(e,[r]){7&r&&o!==(o=e[0](e[1],e[2])+"")&&(t.innerHTML=o),8&r&&n!==(n="item "+e[3]+" svelte-3e0qet")&&attr(t,"class",n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function instance$5t(e,t,n){let{isActive:o=!1}=t,{isFirst:r=!1}=t,{isHover:i=!1}=t,{isSelectable:a=!1}=t,{getOptionLabel:s}=t,{item:c}=t,{filterText:l=""}=t,u="";return e.$$set=e=>{"isActive"in e&&n(4,o=e.isActive),"isFirst"in e&&n(5,r=e.isFirst),"isHover"in e&&n(6,i=e.isHover),"isSelectable"in e&&n(7,a=e.isSelectable),"getOptionLabel"in e&&n(0,s=e.getOptionLabel),"item"in e&&n(1,c=e.item),"filterText"in e&&n(2,l=e.filterText)},e.$$.update=()=>{if(242&e.$$.dirty){const e=[];o&&e.push("active"),r&&e.push("first"),i&&e.push("hover"),c.isGroupHeader&&e.push("groupHeader"),c.isGroupItem&&e.push("groupItem"),a||e.push("notSelectable"),n(3,u=e.join(" "))}},[s,c,l,u,o,r,i,a]}class Item extends SvelteComponent{constructor(e){super(),init(this,e,instance$5t,create_fragment$5z,safe_not_equal,{isActive:4,isFirst:5,isHover:6,isSelectable:7,getOptionLabel:0,item:1,filterText:2})}}function get_each_context$V(e,t,n){const o=e.slice();return o[41]=t[n],o[42]=n,o}function create_else_block$13(e){let t,n,o=e[1],r=[];for(let t=0;t<o.length;t+=1)r[t]=create_each_block$V(get_each_context$V(e,o,t));const i=e=>transition_out(r[e],1,1,(()=>{r[e]=null}));let a=null;return o.length||(a=create_else_block_2$4(e)),{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=empty(),a&&a.c()},m(e,o){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,o);insert(e,t,o),a&&a.m(e,o),n=!0},p(e,n){if(114390&n[0]){let s;for(o=e[1],s=0;s<o.length;s+=1){const i=get_each_context$V(e,o,s);r[s]?(r[s].p(i,n),transition_in(r[s],1)):(r[s]=create_each_block$V(i),r[s].c(),transition_in(r[s],1),r[s].m(t.parentNode,t))}for(group_outros(),s=o.length;s<r.length;s+=1)i(s);check_outros(),!o.length&&a?a.p(e,n):o.length?a&&(a.d(1),a=null):(a=create_else_block_2$4(e),a.c(),a.m(t.parentNode,t))}},i(e){if(!n){for(let e=0;e<o.length;e+=1)transition_in(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)transition_out(r[e]);n=!1},d(e){destroy_each(r,e),e&&detach(t),a&&a.d(e)}}}function create_if_block$2j(e){let t,n,o;var r=e[3];function i(e){return{props:{items:e[1],itemHeight:e[8],$$slots:{default:[create_default_slot$20,({item:e,i:t})=>({41:e,42:t}),({item:e,i:t})=>[0,(e?1024:0)|(t?2048:0)]]},$$scope:{ctx:e}}}}return r&&(t=construct_svelte_component(r,i(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,o){const a={};if(2&o[0]&&(a.items=e[1]),256&o[0]&&(a.itemHeight=e[8]),9814&o[0]|11264&o[1]&&(a.$$scope={dirty:o,ctx:e}),8&o[0]&&r!==(r=e[3])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}r?(t=construct_svelte_component(r,i(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else r&&t.$set(a)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function create_else_block_2$4(e){let t,n=!e[11]&&create_if_block_2$_(e);return{c(){n&&n.c(),t=empty()},m(e,o){n&&n.m(e,o),insert(e,t,o)},p(e,o){e[11]?n&&(n.d(1),n=null):n?n.p(e,o):(n=create_if_block_2$_(e),n.c(),n.m(t.parentNode,t))},d(e){n&&n.d(e),e&&detach(t)}}}function create_if_block_2$_(e){let t,n;return{c(){t=element("div"),n=text$1(e[12]),attr(t,"class","empty svelte-1uyqfml")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){4096&t[0]&&set_data(n,e[12])},d(e){e&&detach(t)}}}function create_else_block_1$e(e){let t,n,o,r,i,a;var s=e[4];function c(e){return{props:{item:e[41],filterText:e[13],getOptionLabel:e[6],isFirst:isItemFirst(e[42]),isActive:isItemActive(e[41],e[9],e[10]),isHover:isItemHover(e[2],e[41],e[42],e[1]),isSelectable:isItemSelectable(e[41])}}}function l(){return e[29](e[42])}function u(){return e[30](e[42])}function d(...t){return e[31](e[41],e[42],...t)}return s&&(n=construct_svelte_component(s,c(e))),{c(){t=element("div"),n&&create_component(n.$$.fragment),o=space(),attr(t,"class","listItem"),attr(t,"tabindex","-1")},m(e,s){insert(e,t,s),n&&mount_component(n,t,null),append(t,o),r=!0,i||(a=[listen(t,"mouseover",l),listen(t,"focus",u),listen(t,"click",d)],i=!0)},p(r,i){e=r;const a={};if(2&i[0]&&(a.item=e[41]),8192&i[0]&&(a.filterText=e[13]),64&i[0]&&(a.getOptionLabel=e[6]),1538&i[0]&&(a.isActive=isItemActive(e[41],e[9],e[10])),6&i[0]&&(a.isHover=isItemHover(e[2],e[41],e[42],e[1])),2&i[0]&&(a.isSelectable=isItemSelectable(e[41])),16&i[0]&&s!==(s=e[4])){if(n){group_outros();const e=n;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}s?(n=construct_svelte_component(s,c(e)),create_component(n.$$.fragment),transition_in(n.$$.fragment,1),mount_component(n,t,o)):n=null}else s&&n.$set(a)},i(e){r||(n&&transition_in(n.$$.fragment,e),r=!0)},o(e){n&&transition_out(n.$$.fragment,e),r=!1},d(e){e&&detach(t),n&&destroy_component(n),i=!1,run_all(a)}}}function create_if_block_1$1o(e){let t,n,o=e[7](e[41])+"";return{c(){t=element("div"),n=text$1(o),attr(t,"class","listGroupTitle svelte-1uyqfml")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){130&t[0]&&o!==(o=e[7](e[41])+"")&&set_data(n,o)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_each_block$V(e){let t,n,o,r;const i=[create_if_block_1$1o,create_else_block_1$e],a=[];function s(e,t){return e[41].isGroupHeader&&!e[41].isSelectable?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_default_slot$20(e){let t,n,o,r,i;var a=e[4];function s(e){return{props:{item:e[41],filterText:e[13],getOptionLabel:e[6],isFirst:isItemFirst(e[42]),isActive:isItemActive(e[41],e[9],e[10]),isHover:isItemHover(e[2],e[41],e[42],e[1]),isSelectable:isItemSelectable(e[41])}}}function c(){return e[26](e[42])}function l(){return e[27](e[42])}function u(...t){return e[28](e[41],e[42],...t)}return a&&(n=construct_svelte_component(a,s(e))),{c(){t=element("div"),n&&create_component(n.$$.fragment),attr(t,"class","listItem")},m(e,a){insert(e,t,a),n&&mount_component(n,t,null),o=!0,r||(i=[listen(t,"mouseover",c),listen(t,"focus",l),listen(t,"click",u)],r=!0)},p(o,r){e=o;const i={};if(1024&r[1]&&(i.item=e[41]),8192&r[0]&&(i.filterText=e[13]),64&r[0]&&(i.getOptionLabel=e[6]),2048&r[1]&&(i.isFirst=isItemFirst(e[42])),1536&r[0]|1024&r[1]&&(i.isActive=isItemActive(e[41],e[9],e[10])),6&r[0]|3072&r[1]&&(i.isHover=isItemHover(e[2],e[41],e[42],e[1])),1024&r[1]&&(i.isSelectable=isItemSelectable(e[41])),16&r[0]&&a!==(a=e[4])){if(n){group_outros();const e=n;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}a?(n=construct_svelte_component(a,s(e)),create_component(n.$$.fragment),transition_in(n.$$.fragment,1),mount_component(n,t,null)):n=null}else a&&n.$set(i)},i(e){o||(n&&transition_in(n.$$.fragment,e),o=!0)},o(e){n&&transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),n&&destroy_component(n),r=!1,run_all(i)}}}function create_fragment$5y(e){let t,n,o,r,i,a;const s=[create_if_block$2j,create_else_block$13],c=[];function l(e,t){return e[5]?0:1}return n=l(e),o=c[n]=s[n](e),{c(){t=element("div"),o.c(),attr(t,"class","listContainer svelte-1uyqfml"),attr(t,"style",e[14]),toggle_class(t,"virtualList",e[5])},m(o,s){insert(o,t,s),c[n].m(t,null),e[32](t),r=!0,i||(a=[listen(window,"keydown",e[17]),listen(window,"resize",e[18])],i=!0)},p(e,i){let a=n;n=l(e),n===a?c[n].p(e,i):(group_outros(),transition_out(c[a],1,1,(()=>{c[a]=null})),check_outros(),o=c[n],o?o.p(e,i):(o=c[n]=s[n](e),o.c()),transition_in(o,1),o.m(t,null)),(!r||16384&i[0])&&attr(t,"style",e[14]),(!r||32&i[0])&&toggle_class(t,"virtualList",e[5])},i(e){r||(transition_in(o),r=!0)},o(e){transition_out(o),r=!1},d(o){o&&detach(t),c[n].d(),e[32](null),i=!1,run_all(a)}}}function isItemActive(e,t,n){return t&&t[n]===e[n]}function isItemFirst(e){return 0===e}function isItemHover(e,t,n,o){return isItemSelectable(t)&&(e===n||1===o.length)}function isItemSelectable(e){return e.isGroupHeader&&e.isSelectable||e.selectable||!e.hasOwnProperty("selectable")}function instance$5s(e,t,n){const o=createEventDispatcher();let r,i,{container:a}=t,{VirtualList:s=null}=t,{Item:c=Item}=t,{isVirtualList:l=!1}=t,{items:u=[]}=t,{labelIdentifier:d="label"}=t,{getOptionLabel:p=((e,t)=>{if(e)return e.isCreator?`Create "${t}"`:e[d]})}=t,{getGroupHeaderLabel:m=null}=t,{itemHeight:f=40}=t,{hoverItemIndex:h=0}=t,{value:g}=t,{optionIdentifier:_="value"}=t,{hideEmptyState:$=!1}=t,{noOptionsMessage:b="No options"}=t,{isMulti:y=!1}=t,{activeItemIndex:v=0}=t,{filterText:x=""}=t,{parent:w=null}=t,{listPlacement:C=null}=t,{listAutoWidth:k=null}=t,{listOffset:S=5}=t,T=0,E=!1;function A(e){e.isCreator||o("itemSelected",e)}function O(e){E||n(2,h=e)}function N(e){const{item:t,i:r,event:i}=e;if(i.stopPropagation(),g&&!y&&g[_]===t[_])return I();t.isCreator?o("itemCreated",x):isItemSelectable(t)&&(n(19,v=r),n(2,h=r),A(t))}function I(){o("closeList")}async function D(e){if(l)return;let t=!0;for(;t;)e>0&&h===u.length-1?n(2,h=0):n(2,e<0&&0===h?h=u.length-1:h+=e),t=!isItemSelectable(u[h]);await tick(),M("hover")}function M(e){if(l||!a)return;let t;const o=a.querySelector(`.listItem .${e}`);o&&(t=a.getBoundingClientRect().bottom-o.getBoundingClientRect().bottom),n(0,a.scrollTop-=t,a)}function R(){const{height:e,width:t}=w.getBoundingClientRect();n(14,i=""),n(14,i+=`min-width:${t}px;width:${k?"auto":"100%"};`),"top"===C||"auto"===C&&isOutOfViewport(w,a).bottom?n(14,i+=`bottom:${e+S}px;`):n(14,i+=`top:${e+S}px;`)}onMount((()=>{if(u.length>0&&!y&&g){const e=u.findIndex((e=>e[_]===g[_]));e&&n(2,h=e)}M("active"),a.addEventListener("scroll",(()=>{clearTimeout(T),T=setTimeout((()=>{E=!1}),100)}),!1)})),beforeUpdate((()=>{u||n(1,u=[]),u!==r&&u.length>0&&n(2,h=0),r=u}));return e.$$set=e=>{"container"in e&&n(0,a=e.container),"VirtualList"in e&&n(3,s=e.VirtualList),"Item"in e&&n(4,c=e.Item),"isVirtualList"in e&&n(5,l=e.isVirtualList),"items"in e&&n(1,u=e.items),"labelIdentifier"in e&&n(20,d=e.labelIdentifier),"getOptionLabel"in e&&n(6,p=e.getOptionLabel),"getGroupHeaderLabel"in e&&n(7,m=e.getGroupHeaderLabel),"itemHeight"in e&&n(8,f=e.itemHeight),"hoverItemIndex"in e&&n(2,h=e.hoverItemIndex),"value"in e&&n(9,g=e.value),"optionIdentifier"in e&&n(10,_=e.optionIdentifier),"hideEmptyState"in e&&n(11,$=e.hideEmptyState),"noOptionsMessage"in e&&n(12,b=e.noOptionsMessage),"isMulti"in e&&n(21,y=e.isMulti),"activeItemIndex"in e&&n(19,v=e.activeItemIndex),"filterText"in e&&n(13,x=e.filterText),"parent"in e&&n(22,w=e.parent),"listPlacement"in e&&n(23,C=e.listPlacement),"listAutoWidth"in e&&n(24,k=e.listAutoWidth),"listOffset"in e&&n(25,S=e.listOffset)},e.$$.update=()=>{4194305&e.$$.dirty[0]&&w&&a&&R()},[a,u,h,s,c,l,p,m,f,g,_,$,b,x,i,O,N,function(e){switch(e.key){case"Escape":e.preventDefault(),I();break;case"ArrowDown":e.preventDefault(),u.length&&D(1);break;case"ArrowUp":e.preventDefault(),u.length&&D(-1);break;case"Enter":if(e.preventDefault(),0===u.length)break;const t=u[h];if(g&&!y&&g[_]===t[_]){I();break}t.isCreator?o("itemCreated",x):(n(19,v=h),A(u[h]));break;case"Tab":if(e.preventDefault(),0===u.length)return I();if(g&&g[_]===u[h][_])return I();n(19,v=h),A(u[h])}},R,v,d,y,w,C,k,S,e=>O(e),e=>O(e),(e,t,n)=>N({item:e,i:t,event:n}),e=>O(e),e=>O(e),(e,t,n)=>N({item:e,i:t,event:n}),function(e){binding_callbacks[e?"unshift":"push"]((()=>{a=e,n(0,a)}))}]}class List$1 extends SvelteComponent{constructor(e){super(),init(this,e,instance$5s,create_fragment$5y,safe_not_equal,{container:0,VirtualList:3,Item:4,isVirtualList:5,items:1,labelIdentifier:20,getOptionLabel:6,getGroupHeaderLabel:7,itemHeight:8,hoverItemIndex:2,value:9,optionIdentifier:10,hideEmptyState:11,noOptionsMessage:12,isMulti:21,activeItemIndex:19,filterText:13,parent:22,listPlacement:23,listAutoWidth:24,listOffset:25},null,[-1,-1])}}function create_fragment$5x(e){let t,n=e[0](e[1])+"";return{c(){t=element("div"),attr(t,"class","selection svelte-pu1q1n")},m(e,o){insert(e,t,o),t.innerHTML=n},p(e,[o]){3&o&&n!==(n=e[0](e[1])+"")&&(t.innerHTML=n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function instance$5r(e,t,n){let{getSelectionLabel:o}=t,{item:r}=t;return e.$$set=e=>{"getSelectionLabel"in e&&n(0,o=e.getSelectionLabel),"item"in e&&n(1,r=e.item)},[o,r]}class Selection extends SvelteComponent{constructor(e){super(),init(this,e,instance$5r,create_fragment$5x,safe_not_equal,{getSelectionLabel:0,item:1})}}function get_each_context$U(e,t,n){const o=e.slice();return o[9]=t[n],o[11]=n,o}function create_if_block$2i(e){let t,n,o;function r(...t){return e[6](e[11],...t)}return{c(){t=element("div"),t.innerHTML='<svg width="100%" height="100%" viewBox="-2 -2 50 50" focusable="false" aria-hidden="true" role="presentation" class="svelte-liu9pa"><path d="M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124 l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z"></path></svg>',attr(t,"class","multiSelectItem_clear svelte-liu9pa")},m(e,i){insert(e,t,i),n||(o=listen(t,"click",r),n=!0)},p(t,n){e=t},d(e){e&&detach(t),n=!1,o()}}}function create_each_block$U(e){let t,n,o,r,i,a,s,c=e[4](e[9])+"",l=!e[2]&&!e[3]&&create_if_block$2i(e);function u(...t){return e[7](e[11],...t)}return{c(){t=element("div"),n=element("div"),o=space(),l&&l.c(),r=space(),attr(n,"class","multiSelectItem_label svelte-liu9pa"),attr(t,"class",i="multiSelectItem "+(e[1]===e[11]?"active":"")+" "+(e[2]?"disabled":"")+" svelte-liu9pa")},m(e,i){insert(e,t,i),append(t,n),n.innerHTML=c,append(t,o),l&&l.m(t,null),append(t,r),a||(s=listen(t,"click",u),a=!0)},p(o,a){e=o,17&a&&c!==(c=e[4](e[9])+"")&&(n.innerHTML=c),e[2]||e[3]?l&&(l.d(1),l=null):l?l.p(e,a):(l=create_if_block$2i(e),l.c(),l.m(t,r)),6&a&&i!==(i="multiSelectItem "+(e[1]===e[11]?"active":"")+" "+(e[2]?"disabled":"")+" svelte-liu9pa")&&attr(t,"class",i)},d(e){e&&detach(t),l&&l.d(),a=!1,s()}}}function create_fragment$5w(e){let t,n=e[0],o=[];for(let t=0;t<n.length;t+=1)o[t]=create_each_block$U(get_each_context$U(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=empty()},m(e,n){for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,n);insert(e,t,n)},p(e,[r]){if(63&r){let i;for(n=e[0],i=0;i<n.length;i+=1){const a=get_each_context$U(e,n,i);o[i]?o[i].p(a,r):(o[i]=create_each_block$U(a),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},i:noop$2,o:noop$2,d(e){destroy_each(o,e),e&&detach(t)}}}function instance$5q(e,t,n){const o=createEventDispatcher();let{value:r=[]}=t,{activeValue:i}=t,{isDisabled:a=!1}=t,{multiFullItemClearable:s=!1}=t,{getSelectionLabel:c}=t;function l(e,t){t.stopPropagation(),o("multiItemClear",{i:e})}return e.$$set=e=>{"value"in e&&n(0,r=e.value),"activeValue"in e&&n(1,i=e.activeValue),"isDisabled"in e&&n(2,a=e.isDisabled),"multiFullItemClearable"in e&&n(3,s=e.multiFullItemClearable),"getSelectionLabel"in e&&n(4,c=e.getSelectionLabel)},[r,i,a,s,c,l,(e,t)=>l(e,t),(e,t)=>s?l(e,t):{}]}class MultiSelection extends SvelteComponent{constructor(e){super(),init(this,e,instance$5q,create_fragment$5w,safe_not_equal,{value:0,activeValue:1,isDisabled:2,multiFullItemClearable:3,getSelectionLabel:4})}}function get_each_context$T(e,t,n){const o=e.slice();return o[23]=t[n],o}const get_default_slot_changes$1=e=>({item:32&e,i:32&e,hoverItemIndex:2&e}),get_default_slot_context$1=e=>({item:e[23].data,i:e[23].index,hoverItemIndex:e[1]});function fallback_block(e){let t;return{c(){t=text$1("Missing template")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_each_block$T(e,t){let n,o,r;const i=t[15].default,a=create_slot(i,t,t[14],get_default_slot_context$1),s=a||fallback_block();return{key:e,first:null,c(){n=element("svelte-virtual-list-row"),s&&s.c(),o=space(),set_custom_element_data(n,"class","svelte-g2cagw"),this.first=n},m(e,t){insert(e,n,t),s&&s.m(n,null),append(n,o),r=!0},p(e,n){t=e,a&&a.p&&(!r||16418&n)&&update_slot_base(a,i,t,t[14],r?get_slot_changes(i,t[14],n,get_default_slot_changes$1):get_all_dirty_from_scope(t[14]),get_default_slot_context$1)},i(e){r||(transition_in(s,e),r=!0)},o(e){transition_out(s,e),r=!1},d(e){e&&detach(n),s&&s.d(e)}}}function create_fragment$5v(e){let t,n,o,r,i,a,s=[],c=new Map,l=e[5];const u=e=>e[23].index;for(let t=0;t<l.length;t+=1){let n=get_each_context$T(e,l,t),o=u(n);c.set(o,s[t]=create_each_block$T(o,n))}return{c(){t=element("svelte-virtual-list-viewport"),n=element("svelte-virtual-list-contents");for(let e=0;e<s.length;e+=1)s[e].c();set_style(n,"padding-top",e[6]+"px"),set_style(n,"padding-bottom",e[7]+"px"),set_custom_element_data(n,"class","svelte-g2cagw"),set_style(t,"height",e[0]),set_custom_element_data(t,"class","svelte-g2cagw"),add_render_callback((()=>e[18].call(t)))},m(c,l){insert(c,t,l),append(t,n);for(let e=0;e<s.length;e+=1)s[e]&&s[e].m(n,null);e[16](n),e[17](t),o=add_iframe_resize_listener(t,e[18].bind(t)),r=!0,i||(a=listen(t,"scroll",e[8]),i=!0)},p(e,[o]){16418&o&&(l=e[5],group_outros(),s=update_keyed_each(s,o,u,1,e,l,c,n,outro_and_destroy_block,create_each_block$T,null,get_each_context$T),check_outros()),(!r||64&o)&&set_style(n,"padding-top",e[6]+"px"),(!r||128&o)&&set_style(n,"padding-bottom",e[7]+"px"),(!r||1&o)&&set_style(t,"height",e[0])},i(e){if(!r){for(let e=0;e<l.length;e+=1)transition_in(s[e]);r=!0}},o(e){for(let e=0;e<s.length;e+=1)transition_out(s[e]);r=!1},d(n){n&&detach(t);for(let e=0;e<s.length;e+=1)s[e].d();e[16](null),e[17](null),o(),i=!1,a()}}}function instance$5p(e,t,n){let o,r,i,a,s,c,{$$slots:l={},$$scope:u}=t,{items:d}=t,{height:p="100%"}=t,{itemHeight:m=40}=t,{hoverItemIndex:f=0}=t,{start:h=0}=t,{end:g=0}=t,_=[],$=0,b=0,y=0;return onMount((()=>{o=i.getElementsByTagName("svelte-virtual-list-row"),n(13,s=!0)})),e.$$set=e=>{"items"in e&&n(11,d=e.items),"height"in e&&n(0,p=e.height),"itemHeight"in e&&n(12,m=e.itemHeight),"hoverItemIndex"in e&&n(1,f=e.hoverItemIndex),"start"in e&&n(9,h=e.start),"end"in e&&n(10,g=e.end),"$$scope"in e&&n(14,u=e.$$scope)},e.$$.update=()=>{3584&e.$$.dirty&&n(5,a=d.slice(h,g).map(((e,t)=>({index:t+h,data:e})))),14340&e.$$.dirty&&s&&async function(e,t,i){const{scrollTop:a}=r;await tick();let s=b-a,l=h;for(;s<t&&l<e.length;){let e=o[l-h];e||(n(10,g=l+1),await tick(),e=o[l-h]),s+=_[l]=i||e.offsetHeight,l+=1}n(10,g=l);const u=e.length-g;c=(b+s)/g,n(7,y=u*c),_.length=e.length,r&&n(3,r.scrollTop=0,r)}(d,$,m)},[p,f,$,r,i,a,b,y,async function(){const{scrollTop:e}=r,t=h;for(let e=0;e<o.length;e+=1)_[h+e]=m||o[e].offsetHeight;let i=0,a=0;for(;i<d.length;){const t=_[i]||c;if(a+t>e){n(9,h=i),n(6,b=a);break}a+=t,i+=1}for(;i<d.length&&(a+=_[i]||c,i+=1,!(a>e+$)););n(10,g=i);const s=d.length-g;for(c=a/g;i<d.length;)_[i++]=c;if(n(7,y=s*c),h<t){await tick();let n=0,i=0;for(let e=h;e<t;e+=1)o[e-h]&&(n+=_[e],i+=m||o[e-h].offsetHeight);const a=i-n;r.scrollTo(0,e+a)}},h,g,d,m,s,u,l,function(e){binding_callbacks[e?"unshift":"push"]((()=>{i=e,n(4,i)}))},function(e){binding_callbacks[e?"unshift":"push"]((()=>{r=e,n(3,r)}))},function(){$=this.offsetHeight,n(2,$)}]}class VirtualList extends SvelteComponent{constructor(e){super(),init(this,e,instance$5p,create_fragment$5v,safe_not_equal,{items:11,height:0,itemHeight:12,hoverItemIndex:1,start:9,end:10})}}function create_fragment$5u(e){let t,n;return{c(){t=svg_element("svg"),n=svg_element("path"),attr(n,"fill","currentColor"),attr(n,"d","M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124\n l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z"),attr(t,"width","100%"),attr(t,"height","100%"),attr(t,"viewBox","-2 -2 50 50"),attr(t,"focusable","false"),attr(t,"aria-hidden","true"),attr(t,"role","presentation")},m(e,o){insert(e,t,o),append(t,n)},p:noop$2,i:noop$2,o:noop$2,d(e){e&&detach(t)}}}class ClearIcon extends SvelteComponent{constructor(e){super(),init(this,e,null,create_fragment$5u,safe_not_equal,{})}}function debounce(e,t,n){let o;return function(){let r=this,i=arguments,a=n&&!o;clearTimeout(o),o=setTimeout((function(){o=null,n||e.apply(r,i)}),t),a&&e.apply(r,i)}}function get_each_context$S(e,t,n){const o=e.slice();return o[103]=t[n],o}function create_if_block_10$c(e){let t,n,o,r,i;return{c(){t=element("span"),n=text$1(e[33]),o=space(),r=element("span"),i=text$1(e[32]),attr(t,"id","aria-selection"),attr(r,"id","aria-context")},m(e,a){insert(e,t,a),append(t,n),insert(e,o,a),insert(e,r,a),append(r,i)},p(e,t){4&t[1]&&set_data(n,e[33]),2&t[1]&&set_data(i,e[32])},d(e){e&&detach(t),e&&detach(o),e&&detach(r)}}}function create_if_block_9$d(e){let t,n,o;const r=[e[18]];var i=e[17];function a(e){let t={};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a())),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,o){const s=262144&o[0]?get_spread_update(r,[get_spread_object(e[18])]):{};if(131072&o[0]&&i!==(i=e[17])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a()),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function create_if_block_8$f(e){let t,n,o;var r=e[26];function i(e){return{props:{value:e[2],getSelectionLabel:e[12],activeValue:e[30],isDisabled:e[9],multiFullItemClearable:e[8]}}}return r&&(t=construct_svelte_component(r,i(e)),t.$on("multiItemClear",e[38]),t.$on("focus",e[40])),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,o){const a={};if(4&o[0]&&(a.value=e[2]),4096&o[0]&&(a.getSelectionLabel=e[12]),1073741824&o[0]&&(a.activeValue=e[30]),512&o[0]&&(a.isDisabled=e[9]),256&o[0]&&(a.multiFullItemClearable=e[8]),67108864&o[0]&&r!==(r=e[26])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}r?(t=construct_svelte_component(r,i(e)),t.$on("multiItemClear",e[38]),t.$on("focus",e[40]),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else r&&t.$set(a)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function create_if_block_7$h(e){let t,n,o,r,i;var a=e[25];function s(e){return{props:{item:e[2],getSelectionLabel:e[12]}}}return a&&(n=construct_svelte_component(a,s(e))),{c(){t=element("div"),n&&create_component(n.$$.fragment),attr(t,"class","selectedItem svelte-17l1npl")},m(a,s){insert(a,t,s),n&&mount_component(n,t,null),o=!0,r||(i=listen(t,"focus",e[40]),r=!0)},p(e,o){const r={};if(4&o[0]&&(r.item=e[2]),4096&o[0]&&(r.getSelectionLabel=e[12]),33554432&o[0]&&a!==(a=e[25])){if(n){group_outros();const e=n;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}a?(n=construct_svelte_component(a,s(e)),create_component(n.$$.fragment),transition_in(n.$$.fragment,1),mount_component(n,t,null)):n=null}else a&&n.$set(r)},i(e){o||(n&&transition_in(n.$$.fragment,e),o=!0)},o(e){n&&transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),n&&destroy_component(n),r=!1,i()}}}function create_if_block_6$n(e){let t,n,o,r,i;var a=e[23];return a&&(n=construct_svelte_component(a,{})),{c(){t=element("div"),n&&create_component(n.$$.fragment),attr(t,"class","clearSelect svelte-17l1npl"),attr(t,"aria-hidden","true")},m(a,s){insert(a,t,s),n&&mount_component(n,t,null),o=!0,r||(i=listen(t,"click",prevent_default(e[27])),r=!0)},p(e,o){if(8388608&o[0]&&a!==(a=e[23])){if(n){group_outros();const e=n;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}a?(n=construct_svelte_component(a,{}),create_component(n.$$.fragment),transition_in(n.$$.fragment,1),mount_component(n,t,null)):n=null}},i(e){o||(n&&transition_in(n.$$.fragment,e),o=!0)},o(e){n&&transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),n&&destroy_component(n),r=!1,i()}}}function create_if_block_4$A(e){let t;function n(e,t){return e[22]?create_if_block_5$t:create_else_block$12}let o=n(e),r=o(e);return{c(){t=element("div"),r.c(),attr(t,"class","indicator svelte-17l1npl"),attr(t,"aria-hidden","true")},m(e,n){insert(e,t,n),r.m(t,null)},p(e,i){o===(o=n(e))&&r?r.p(e,i):(r.d(1),r=o(e),r&&(r.c(),r.m(t,null)))},d(e){e&&detach(t),r.d()}}}function create_else_block$12(e){let t,n;return{c(){t=svg_element("svg"),n=svg_element("path"),attr(n,"d","M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747\n 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0\n 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502\n 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0\n 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"),attr(t,"width","100%"),attr(t,"height","100%"),attr(t,"viewBox","0 0 20 20"),attr(t,"focusable","false"),attr(t,"aria-hidden","true"),attr(t,"class","svelte-17l1npl")},m(e,o){insert(e,t,o),append(t,n)},p:noop$2,d(e){e&&detach(t)}}}function create_if_block_5$t(e){let t,n;return{c(){t=new HtmlTag(!1),n=empty(),t.a=n},m(o,r){t.m(e[22],o,r),insert(o,n,r)},p(e,n){4194304&n[0]&&t.p(e[22])},d(e){e&&detach(n),e&&t.d()}}}function create_if_block_3$J(e){let t;return{c(){t=element("div"),t.innerHTML='<svg class="spinner_icon svelte-17l1npl" viewBox="25 25 50 50"><circle class="spinner_path svelte-17l1npl" cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10"></circle></svg>',attr(t,"class","spinner svelte-17l1npl")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_if_block_2$Z(e){let t,n,o,r;const i=[e[34]];function a(t){e[84](t)}var s=e[24];function c(e){let t={};for(let e=0;e<i.length;e+=1)t=assign(t,i[e]);return void 0!==e[28]&&(t.hoverItemIndex=e[28]),{props:t}}return s&&(t=construct_svelte_component(s,c(e)),binding_callbacks.push((()=>bind$2(t,"hoverItemIndex",a))),t.$on("itemSelected",e[43]),t.$on("itemCreated",e[44]),t.$on("closeList",e[45])),{c(){t&&create_component(t.$$.fragment),o=empty()},m(e,n){t&&mount_component(t,e,n),insert(e,o,n),r=!0},p(e,r){const l=8&r[1]?get_spread_update(i,[get_spread_object(e[34])]):{};if(!n&&268435456&r[0]&&(n=!0,l.hoverItemIndex=e[28],add_flush_callback((()=>n=!1))),16777216&r[0]&&s!==(s=e[24])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}s?(t=construct_svelte_component(s,c(e)),binding_callbacks.push((()=>bind$2(t,"hoverItemIndex",a))),t.$on("itemSelected",e[43]),t.$on("itemCreated",e[44]),t.$on("closeList",e[45]),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,o.parentNode,o)):t=null}else s&&t.$set(l)},i(e){r||(t&&transition_in(t.$$.fragment,e),r=!0)},o(e){t&&transition_out(t.$$.fragment,e),r=!1},d(e){e&&detach(o),t&&destroy_component(t,e)}}}function create_if_block_1$1n(e){let t,n,o;return{c(){t=element("input"),attr(t,"name",n=e[16].name),attr(t,"type","hidden"),t.value=o=e[2]?e[12](e[2]):null,attr(t,"class","svelte-17l1npl")},m(e,n){insert(e,t,n)},p(e,r){65536&r[0]&&n!==(n=e[16].name)&&attr(t,"name",n),4100&r[0]&&o!==(o=e[2]?e[12](e[2]):null)&&(t.value=o)},d(e){e&&detach(t)}}}function create_if_block$2h(e){let t,n=e[2],o=[];for(let t=0;t<n.length;t+=1)o[t]=create_each_block$S(get_each_context$S(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=empty()},m(e,n){for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,n);insert(e,t,n)},p(e,r){if(69636&r[0]){let i;for(n=e[2],i=0;i<n.length;i+=1){const a=get_each_context$S(e,n,i);o[i]?o[i].p(a,r):(o[i]=create_each_block$S(a),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){destroy_each(o,e),e&&detach(t)}}}function create_each_block$S(e){let t,n,o;return{c(){t=element("input"),attr(t,"name",n=e[16].name),attr(t,"type","hidden"),t.value=o=e[103]?e[12](e[103]):null,attr(t,"class","svelte-17l1npl")},m(e,n){insert(e,t,n)},p(e,r){65536&r[0]&&n!==(n=e[16].name)&&attr(t,"name",n),4100&r[0]&&o!==(o=e[103]?e[12](e[103]):null)&&(t.value=o)},d(e){e&&detach(t)}}}function create_fragment$5t(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f,h,g,_,$,b=e[1]&&create_if_block_10$c(e),y=e[17]&&create_if_block_9$d(e),v=e[35]&&create_if_block_8$f(e),x=[{readOnly:s=!e[13]},e[31],{placeholder:e[36]},{style:e[14]},{disabled:e[9]}],w={};for(let e=0;e<x.length;e+=1)w=assign(w,x[e]);let C=!e[7]&&e[29]&&create_if_block_7$h(e),k=e[37]&&create_if_block_6$n(e),S=!e[37]&&(e[20]||e[19]&&!e[2]||!e[13]&&!e[9]&&!e[4]&&(e[29]&&!e[15]||!e[29]))&&create_if_block_4$A(e),T=e[4]&&create_if_block_3$J(),E=e[5]&&create_if_block_2$Z(e),A=(!e[7]||e[7]&&!e[35])&&create_if_block_1$1n(e),O=e[7]&&e[35]&&create_if_block$2h(e);return{c(){t=element("div"),n=element("span"),b&&b.c(),o=space(),y&&y.c(),r=space(),v&&v.c(),i=space(),a=element("input"),c=space(),C&&C.c(),l=space(),k&&k.c(),u=space(),S&&S.c(),d=space(),T&&T.c(),p=space(),E&&E.c(),m=space(),A&&A.c(),f=space(),O&&O.c(),attr(n,"aria-live","polite"),attr(n,"aria-atomic","false"),attr(n,"aria-relevant","additions text"),attr(n,"class","a11yText svelte-17l1npl"),set_attributes(a,w),toggle_class(a,"svelte-17l1npl",!0),attr(t,"class",h="selectContainer "+e[21]+" svelte-17l1npl"),attr(t,"style",e[11]),toggle_class(t,"hasError",e[10]),toggle_class(t,"multiSelect",e[7]),toggle_class(t,"disabled",e[9]),toggle_class(t,"focused",e[1])},m(s,h){insert(s,t,h),append(t,n),b&&b.m(n,null),append(t,o),y&&y.m(t,null),append(t,r),v&&v.m(t,null),append(t,i),append(t,a),a.autofocus&&a.focus(),e[82](a),set_input_value(a,e[3]),append(t,c),C&&C.m(t,null),append(t,l),k&&k.m(t,null),append(t,u),S&&S.m(t,null),append(t,d),T&&T.m(t,null),append(t,p),E&&E.m(t,null),append(t,m),A&&A.m(t,null),append(t,f),O&&O.m(t,null),e[85](t),g=!0,_||($=[listen(window,"click",e[41]),listen(window,"focusin",e[41]),listen(window,"keydown",e[39]),listen(a,"focus",e[40]),listen(a,"input",e[83]),listen(t,"click",e[42])],_=!0)},p(e,o){e[1]?b?b.p(e,o):(b=create_if_block_10$c(e),b.c(),b.m(n,null)):b&&(b.d(1),b=null),e[17]?y?(y.p(e,o),131072&o[0]&&transition_in(y,1)):(y=create_if_block_9$d(e),y.c(),transition_in(y,1),y.m(t,r)):y&&(group_outros(),transition_out(y,1,1,(()=>{y=null})),check_outros()),e[35]?v?(v.p(e,o),16&o[1]&&transition_in(v,1)):(v=create_if_block_8$f(e),v.c(),transition_in(v,1),v.m(t,i)):v&&(group_outros(),transition_out(v,1,1,(()=>{v=null})),check_outros()),set_attributes(a,w=get_spread_update(x,[(!g||8192&o[0]&&s!==(s=!e[13]))&&{readOnly:s},1&o[1]&&e[31],(!g||32&o[1])&&{placeholder:e[36]},(!g||16384&o[0])&&{style:e[14]},(!g||512&o[0])&&{disabled:e[9]}])),8&o[0]&&a.value!==e[3]&&set_input_value(a,e[3]),toggle_class(a,"svelte-17l1npl",!0),!e[7]&&e[29]?C?(C.p(e,o),536871040&o[0]&&transition_in(C,1)):(C=create_if_block_7$h(e),C.c(),transition_in(C,1),C.m(t,l)):C&&(group_outros(),transition_out(C,1,1,(()=>{C=null})),check_outros()),e[37]?k?(k.p(e,o),64&o[1]&&transition_in(k,1)):(k=create_if_block_6$n(e),k.c(),transition_in(k,1),k.m(t,u)):k&&(group_outros(),transition_out(k,1,1,(()=>{k=null})),check_outros()),e[37]||!(e[20]||e[19]&&!e[2])&&(e[13]||e[9]||e[4]||(!e[29]||e[15])&&e[29])?S&&(S.d(1),S=null):S?S.p(e,o):(S=create_if_block_4$A(e),S.c(),S.m(t,d)),e[4]?T||(T=create_if_block_3$J(),T.c(),T.m(t,p)):T&&(T.d(1),T=null),e[5]?E?(E.p(e,o),32&o[0]&&transition_in(E,1)):(E=create_if_block_2$Z(e),E.c(),transition_in(E,1),E.m(t,m)):E&&(group_outros(),transition_out(E,1,1,(()=>{E=null})),check_outros()),!e[7]||e[7]&&!e[35]?A?A.p(e,o):(A=create_if_block_1$1n(e),A.c(),A.m(t,f)):A&&(A.d(1),A=null),e[7]&&e[35]?O?O.p(e,o):(O=create_if_block$2h(e),O.c(),O.m(t,null)):O&&(O.d(1),O=null),(!g||2097152&o[0]&&h!==(h="selectContainer "+e[21]+" svelte-17l1npl"))&&attr(t,"class",h),(!g||2048&o[0])&&attr(t,"style",e[11]),(!g||2098176&o[0])&&toggle_class(t,"hasError",e[10]),(!g||2097280&o[0])&&toggle_class(t,"multiSelect",e[7]),(!g||2097664&o[0])&&toggle_class(t,"disabled",e[9]),(!g||2097154&o[0])&&toggle_class(t,"focused",e[1])},i(e){g||(transition_in(y),transition_in(v),transition_in(C),transition_in(k),transition_in(E),g=!0)},o(e){transition_out(y),transition_out(v),transition_out(C),transition_out(k),transition_out(E),g=!1},d(n){n&&detach(t),b&&b.d(),y&&y.d(),v&&v.d(),e[82](null),C&&C.d(),k&&k.d(),S&&S.d(),T&&T.d(),E&&E.d(),A&&A.d(),O&&O.d(),e[85](null),_=!1,run_all($)}}}function convertStringItemsToObjects(e){return e.map(((e,t)=>({index:t,value:e,label:`${e}`})))}function instance$5o(e,t,n){let o,r,i,a,s,c,l,u;const d=createEventDispatcher();let{id:p=null}=t,{container:m}=t,{input:f}=t,{isMulti:h=!1}=t,{multiFullItemClearable:g=!1}=t,{isDisabled:_=!1}=t,{isCreatable:$=!1}=t,{isFocused:b=!1}=t,{value:y=null}=t,{filterText:v=""}=t,{placeholder:x="Select..."}=t,{placeholderAlwaysShow:w=!1}=t,{items:C=null}=t,{itemFilter:k=((e,t,n)=>`${e}`.toLowerCase().includes(t.toLowerCase()))}=t,{groupBy:S}=t,{groupFilter:T=(e=>e)}=t,{isGroupHeaderSelectable:E=!1}=t,{getGroupHeaderLabel:A=(e=>e[O]||e.id)}=t,{labelIdentifier:O="label"}=t,{getOptionLabel:N=((e,t)=>e.isCreator?`Create "${t}"`:e[O])}=t,{optionIdentifier:I="value"}=t,{loadOptions:D}=t,{hasError:M=!1}=t,{containerStyles:R=""}=t,{getSelectionLabel:L=(e=>e?e[O]:null)}=t,{createGroupHeaderItem:F=(e=>({value:e,label:e}))}=t,{createItem:P=(e=>({value:e,label:e}))}=t;let{isSearchable:j=!0}=t,{inputStyles:B=""}=t,{isClearable:q=!0}=t,{isWaiting:W=!1}=t,{listPlacement:z="auto"}=t,{listOpen:U=!1}=t,{isVirtualList:H=!1}=t,{loadOptionsInterval:V=300}=t,{noOptionsMessage:G="No options"}=t,{hideEmptyState:K=!1}=t,{inputAttributes:Y={}}=t,{listAutoWidth:Q=!0}=t,{itemHeight:Z=40}=t,{Icon:J}=t,{iconProps:X={}}=t,{showChevron:ee=!1}=t,{showIndicator:te=!1}=t,{containerClasses:ne=""}=t,{indicatorSvg:oe}=t,{listOffset:re=5}=t,{ClearIcon:ie=ClearIcon}=t,{Item:ae=Item}=t,{List:se=List$1}=t,{Selection:ce=Selection}=t,{MultiSelection:le=MultiSelection}=t,{VirtualList:ue=VirtualList}=t;function de(e){if(e.loadOptions&&e.filterText.length>0)return;if(!e.items)return[];e.items&&e.items.length>0&&"object"!=typeof e.items[0]&&(e.items=convertStringItemsToObjects(e.items));let t=e.items.filter((t=>{let n=k(N(t,e.filterText),e.filterText,t);return n&&e.isMulti&&e.value&&Array.isArray(e.value)&&(n=!e.value.some((n=>n[e.optionIdentifier]===t[e.optionIdentifier]))),n}));return e.groupBy&&(t=function(e){const t=[],n={};e.forEach((e=>{const o=S(e);t.includes(o)||(t.push(o),n[o]=[],o&&n[o].push(Object.assign(F(o,e),{id:o,isGroupHeader:!0,isSelectable:E}))),n[o].push(Object.assign({isGroupItem:!!o},e))}));const o=[];return T(t).forEach((e=>{o.push(...n[e])})),o}(t)),e.isCreatable&&(t=pe(t,e.filterText)),t}function pe(e,t){if(0===t.length)return e;const n=P(t);return e[0]&&t===e[0][O]?e:(n.isCreator=!0,[...e,n])}let me,fe,he,ge,_e,$e,{selectedValue:be=null}=t;const ye=debounce((async()=>{n(4,W=!0);let e=await D(v).catch((e=>{console.warn("svelte-select loadOptions error :>> ",e),d("error",{type:"loadOptions",details:e})}));e&&!e.cancelled&&(e?(e&&e.length>0&&"object"!=typeof e[0]&&(e=convertStringItemsToObjects(e)),n(81,o=[...e]),d("loaded",{items:o})):n(81,o=[]),$&&n(81,o=pe(o,v)),n(4,W=!1),n(1,b=!0),n(5,U=!0))}),V);let ve;function xe(){let e=!0;if(y){const t=[],o=[];y.forEach((n=>{t.includes(n[I])?e=!1:(t.push(n[I]),o.push(n))})),e||n(2,y=o)}return e}function we(e){let t=e?e[I]:y[I];return C.find((e=>e[I]===t))}function Ce(e){const{detail:t}=e,o=y[t?t.i:y.length-1];1===y.length?n(2,y=void 0):n(2,y=y.filter((e=>e!==o))),d("clear",o)}function ke(){n(1,b=!0),f&&f.focus()}beforeUpdate((async()=>{n(77,fe=y),n(78,he=v),n(79,ge=b),n(80,_e=h)})),onMount((()=>{b&&f&&f.focus()}));let{ariaValues:Se=(e=>`Option ${e}, selected.`)}=t,{ariaListOpen:Te=((e,t)=>`You are currently focused on option ${e}. There are ${t} results available.`)}=t,{ariaFocused:Ee=(()=>"Select is focused, type to refine list, press down to open the menu.")}=t;return e.$$set=e=>{"id"in e&&n(46,p=e.id),"container"in e&&n(0,m=e.container),"input"in e&&n(6,f=e.input),"isMulti"in e&&n(7,h=e.isMulti),"multiFullItemClearable"in e&&n(8,g=e.multiFullItemClearable),"isDisabled"in e&&n(9,_=e.isDisabled),"isCreatable"in e&&n(47,$=e.isCreatable),"isFocused"in e&&n(1,b=e.isFocused),"value"in e&&n(2,y=e.value),"filterText"in e&&n(3,v=e.filterText),"placeholder"in e&&n(48,x=e.placeholder),"placeholderAlwaysShow"in e&&n(49,w=e.placeholderAlwaysShow),"items"in e&&n(50,C=e.items),"itemFilter"in e&&n(51,k=e.itemFilter),"groupBy"in e&&n(52,S=e.groupBy),"groupFilter"in e&&n(53,T=e.groupFilter),"isGroupHeaderSelectable"in e&&n(54,E=e.isGroupHeaderSelectable),"getGroupHeaderLabel"in e&&n(55,A=e.getGroupHeaderLabel),"labelIdentifier"in e&&n(56,O=e.labelIdentifier),"getOptionLabel"in e&&n(57,N=e.getOptionLabel),"optionIdentifier"in e&&n(58,I=e.optionIdentifier),"loadOptions"in e&&n(59,D=e.loadOptions),"hasError"in e&&n(10,M=e.hasError),"containerStyles"in e&&n(11,R=e.containerStyles),"getSelectionLabel"in e&&n(12,L=e.getSelectionLabel),"createGroupHeaderItem"in e&&n(60,F=e.createGroupHeaderItem),"createItem"in e&&n(61,P=e.createItem),"isSearchable"in e&&n(13,j=e.isSearchable),"inputStyles"in e&&n(14,B=e.inputStyles),"isClearable"in e&&n(15,q=e.isClearable),"isWaiting"in e&&n(4,W=e.isWaiting),"listPlacement"in e&&n(63,z=e.listPlacement),"listOpen"in e&&n(5,U=e.listOpen),"isVirtualList"in e&&n(64,H=e.isVirtualList),"loadOptionsInterval"in e&&n(65,V=e.loadOptionsInterval),"noOptionsMessage"in e&&n(66,G=e.noOptionsMessage),"hideEmptyState"in e&&n(67,K=e.hideEmptyState),"inputAttributes"in e&&n(16,Y=e.inputAttributes),"listAutoWidth"in e&&n(68,Q=e.listAutoWidth),"itemHeight"in e&&n(69,Z=e.itemHeight),"Icon"in e&&n(17,J=e.Icon),"iconProps"in e&&n(18,X=e.iconProps),"showChevron"in e&&n(19,ee=e.showChevron),"showIndicator"in e&&n(20,te=e.showIndicator),"containerClasses"in e&&n(21,ne=e.containerClasses),"indicatorSvg"in e&&n(22,oe=e.indicatorSvg),"listOffset"in e&&n(70,re=e.listOffset),"ClearIcon"in e&&n(23,ie=e.ClearIcon),"Item"in e&&n(71,ae=e.Item),"List"in e&&n(24,se=e.List),"Selection"in e&&n(25,ce=e.Selection),"MultiSelection"in e&&n(26,le=e.MultiSelection),"VirtualList"in e&&n(72,ue=e.VirtualList),"selectedValue"in e&&n(73,be=e.selectedValue),"ariaValues"in e&&n(74,Se=e.ariaValues),"ariaListOpen"in e&&n(75,Te=e.ariaListOpen),"ariaFocused"in e&&n(76,Ee=e.ariaFocused)},e.$$.update=()=>{140&e.$$.dirty[0]|405340160&e.$$.dirty[1]&&n(81,o=de({loadOptions:D,filterText:v,items:C,value:y,isMulti:h,optionIdentifier:I,groupBy:S,isCreatable:$})),2048&e.$$.dirty[2]&&be&&console.warn("selectedValue is no longer used. Please use value instead."),524288&e.$$.dirty[1]&&function(e){e&&0!==e.length&&!e.some((e=>"object"!=typeof e))&&y&&(h?!y.some((e=>!e||!e[I])):y[I])&&(Array.isArray(y)?n(2,y=y.map((e=>we(e)||e))):n(2,y=we()||y))}(C),4&e.$$.dirty[0]&&y&&("string"==typeof y?n(2,y={[I]:y,label:y}):h&&Array.isArray(y)&&y.length>0&&n(2,y=y.map((e=>"string"==typeof e?{value:e,label:e}:e)))),73728&e.$$.dirty[0]&&(!Y&&j||(n(31,ve=Object.assign({autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:!1,tabindex:0,type:"text","aria-autocomplete":"list"},Y)),p&&n(31,ve.id=p,ve),j||n(31,ve.readonly=!0,ve))),128&e.$$.dirty[0]|262144&e.$$.dirty[2]&&(h&&y&&(Array.isArray(y)?n(2,y=[...y]):n(2,y=[y])),_e&&!h&&y&&n(2,y=null)),132&e.$$.dirty[0]&&h&&y&&y.length>1&&xe(),4&e.$$.dirty[0]&&y&&(h?JSON.stringify(y)!==JSON.stringify(fe)&&xe()&&d("select",y):fe&&JSON.stringify(y[I])===JSON.stringify(fe[I])||d("select",y)),132&e.$$.dirty[0]|32768&e.$$.dirty[2]&&!y&&h&&fe&&d("select",y),2&e.$$.dirty[0]|131072&e.$$.dirty[2]&&b!==ge&&(b||U?ke():f&&f.blur()),8&e.$$.dirty[0]|65536&e.$$.dirty[2]&&v!==he&&0!==v.length&&(n(1,b=!0),n(5,U=!0),D?ye():(n(5,U=!0),h&&n(30,me=void 0))),12&e.$$.dirty[0]&&n(29,r=y&&0===v.length),536904208&e.$$.dirty[0]&&n(37,i=r&&q&&!_&&!W),132&e.$$.dirty[0]|393216&e.$$.dirty[1]&&n(36,a=w&&h?x:y?"":x),132&e.$$.dirty[0]&&n(35,s=h&&y&&y.length>0),141&e.$$.dirty[0]|218103808&e.$$.dirty[1]|526326&e.$$.dirty[2]&&n(34,c={Item:ae,filterText:v,optionIdentifier:I,noOptionsMessage:G,hideEmptyState:K,isVirtualList:H,VirtualList:ue,value:y,isMulti:h,getGroupHeaderLabel:A,items:o,itemHeight:Z,getOptionLabel:N,listPlacement:z,parent:m,listAutoWidth:Q,listOffset:re}),132&e.$$.dirty[0]&&n(33,l=y?function(){let e;return e=h&&y.length>0?y.map((e=>L(e))).join(", "):L(y),Se(e)}():""),268435490&e.$$.dirty[0]|524288&e.$$.dirty[2]&&n(32,u=function(){if(!b||!o||0===o.length)return"";let e=o[$e];if(U&&e){let t=L(e),n=o?o.length:0;return Te(t,n)}return Ee()}())},[m,b,y,v,W,U,f,h,g,_,M,R,L,j,B,q,Y,J,X,ee,te,ne,oe,ie,se,ce,le,function(){n(2,y=void 0),n(5,U=!1),d("clear",y),ke()},$e,r,me,ve,u,l,c,s,a,i,Ce,function(e){if(b)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),n(5,U=!0),n(30,me=void 0);break;case"Tab":U||n(1,b=!1);break;case"Backspace":if(!h||v.length>0)return;if(h&&y&&y.length>0){if(Ce(void 0!==me?me:y.length-1),0===me||void 0===me)break;n(30,me=y.length>me?me-1:void 0)}break;case"ArrowLeft":if(!h||v.length>0)return;void 0===me?n(30,me=y.length-1):y.length>me&&0!==me&&n(30,me-=1);break;case"ArrowRight":if(!h||v.length>0||void 0===me)return;me===y.length-1?n(30,me=void 0):me<y.length-1&&n(30,me+=1)}},ke,function(e){if(!m)return;const t=e.path&&e.path.length>0?e.path[0]:e.target;m.contains(t)||m.contains(e.relatedTarget)||(n(1,b=!1),n(5,U=!1),n(30,me=void 0),f&&f.blur())},function(){_||(n(1,b=!0),n(5,U=!U))},function(e){const{detail:t}=e;if(t){n(3,v="");const e=Object.assign({},t);e.isGroupHeader&&!e.isSelectable||(n(2,y=h?y?y.concat([e]):[e]:e),n(2,y),setTimeout((()=>{n(5,U=!1),n(30,me=void 0)})))}},function(e){const{detail:t}=e;h?(n(2,y=y||[]),n(2,y=[...y,P(t)])):n(2,y=P(t)),d("itemCreated",t),n(3,v=""),n(5,U=!1),n(30,me=void 0)},function(){n(3,v=""),n(5,U=!1)},p,$,x,w,C,k,S,T,E,A,O,N,I,D,F,P,()=>o,z,H,V,G,K,Q,Z,re,ae,ue,be,Se,Te,Ee,fe,he,ge,_e,o,function(e){binding_callbacks[e?"unshift":"push"]((()=>{f=e,n(6,f)}))},function(){v=this.value,n(3,v)},function(e){$e=e,n(28,$e)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{m=e,n(0,m)}))}]}class Select extends SvelteComponent{constructor(e){super(),init(this,e,instance$5o,create_fragment$5t,safe_not_equal,{id:46,container:0,input:6,isMulti:7,multiFullItemClearable:8,isDisabled:9,isCreatable:47,isFocused:1,value:2,filterText:3,placeholder:48,placeholderAlwaysShow:49,items:50,itemFilter:51,groupBy:52,groupFilter:53,isGroupHeaderSelectable:54,getGroupHeaderLabel:55,labelIdentifier:56,getOptionLabel:57,optionIdentifier:58,loadOptions:59,hasError:10,containerStyles:11,getSelectionLabel:12,createGroupHeaderItem:60,createItem:61,getFilteredItems:62,isSearchable:13,inputStyles:14,isClearable:15,isWaiting:4,listPlacement:63,listOpen:5,isVirtualList:64,loadOptionsInterval:65,noOptionsMessage:66,hideEmptyState:67,inputAttributes:16,listAutoWidth:68,itemHeight:69,Icon:17,iconProps:18,showChevron:19,showIndicator:20,containerClasses:21,indicatorSvg:22,listOffset:70,ClearIcon:23,Item:71,List:24,Selection:25,MultiSelection:26,VirtualList:72,selectedValue:73,handleClear:27,ariaValues:74,ariaListOpen:75,ariaFocused:76},null,[-1,-1,-1,-1])}get getFilteredItems(){return this.$$.ctx[62]}get handleClear(){return this.$$.ctx[27]}}function get_each_context$R(e,t,n){const o=e.slice();return o[19]=t[n],o}function create_else_block$11(e){let t,n,o,r,i;const a=[e[10],{items:e[0]},{value:e[3]?_.compact(e[1]?.map(e[14])??[]):e[0].find(e[15])??null},{showIndicator:!e[3]},{isClearable:e[3]},{isMulti:e[3]},{class:e[11]["data-testid"]?"select-testid-"+e[11]["data-testid"]:void 0}];function s(t){e[16](t)}function c(t){e[17](t)}let l={};for(let e=0;e<a.length;e+=1)l=assign(l,a[e]);return void 0!==e[7]&&(l.listOpen=e[7]),void 0!==e[8]&&(l.isFocused=e[8]),n=new Select({props:l}),binding_callbacks.push((()=>bind$2(n,"listOpen",s))),binding_callbacks.push((()=>bind$2(n,"isFocused",c))),n.$on("select",e[18]),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","select svelte-3jbx4l")},m(e,o){insert(e,t,o),mount_component(n,t,null),i=!0},p(e,t){const i=3083&t?get_spread_update(a,[1024&t&&get_spread_object(e[10]),1&t&&{items:e[0]},11&t&&{value:e[3]?_.compact(e[1]?.map(e[14])??[]):e[0].find(e[15])??null},8&t&&{showIndicator:!e[3]},8&t&&{isClearable:e[3]},8&t&&{isMulti:e[3]},2048&t&&{class:e[11]["data-testid"]?"select-testid-"+e[11]["data-testid"]:void 0}]):{};!o&&128&t&&(o=!0,i.listOpen=e[7],add_flush_callback((()=>o=!1))),!r&&256&t&&(r=!0,i.isFocused=e[8],add_flush_callback((()=>r=!1))),n.$set(i)},i(e){i||(transition_in(n.$$.fragment,e),i=!0)},o(e){transition_out(n.$$.fragment,e),i=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block$2g(e){let t,n,o,r,i,a=[],s=new Map,c=e[4]&&create_if_block_1$1m(e),l=_.compact(e[0]);const u=e=>e[19].value;for(let t=0;t<l.length;t+=1){let n=get_each_context$R(e,l,t),o=u(n);s.set(o,a[t]=create_each_block$R(o,n))}let d=[{value:o=e[0].find(e[12])?e[1]:e[5]},{class:e[6]},e[10]],p={};for(let e=0;e<d.length;e+=1)p=assign(p,d[e]);return{c(){t=element("select"),c&&c.c(),n=empty();for(let e=0;e<a.length;e+=1)a[e].c();set_attributes(t,p),toggle_class(t,"svelte-3jbx4l",!0)},m(o,s){insert(o,t,s),c&&c.m(t,null),append(t,n);for(let e=0;e<a.length;e+=1)a[e]&&a[e].m(t,null);"value"in p&&(p.multiple?select_options:select_option)(t,p.value),t.autofocus&&t.focus(),r||(i=listen(t,"change",e[13]),r=!0)},p(e,r){e[4]?c?c.p(e,r):(c=create_if_block_1$1m(e),c.c(),c.m(t,n)):c&&(c.d(1),c=null),1&r&&(l=_.compact(e[0]),a=update_keyed_each(a,r,u,1,e,l,s,t,destroy_block,create_each_block$R,null,get_each_context$R)),set_attributes(t,p=get_spread_update(d,[35&r&&o!==(o=e[0].find(e[12])?e[1]:e[5])&&{value:o},64&r&&{class:e[6]},1024&r&&e[10]])),1123&r&&"value"in p&&(p.multiple?select_options:select_option)(t,p.value),toggle_class(t,"svelte-3jbx4l",!0)},i:noop$2,o:noop$2,d(e){e&&detach(t),c&&c.d();for(let e=0;e<a.length;e+=1)a[e].d();r=!1,i()}}}function create_if_block_1$1m(e){let t,n,o,r=(_.isString(e[4])?e[4]:"(not selected)")+"";return{c(){t=element("option"),n=text$1(r),o=space(),t.__value="",t.value=t.__value},m(e,r){insert(e,t,r),append(t,n),append(t,o)},p(e,t){16&t&&r!==(r=(_.isString(e[4])?e[4]:"(not selected)")+"")&&set_data(n,r)},d(e){e&&detach(t)}}}function create_each_block$R(e,t){let n,o,r,i,a=t[19].label+"";return{key:e,first:null,c(){n=element("option"),o=text$1(a),r=space(),n.__value=i=t[19].value,n.value=n.__value,this.first=n},m(e,t){insert(e,n,t),append(n,o),append(n,r)},p(e,r){t=e,1&r&&a!==(a=t[19].label+"")&&set_data(o,a),1&r&&i!==(i=t[19].value)&&(n.__value=i,n.value=n.__value)},d(e){e&&detach(n)}}}function create_fragment$5s(e){let t,n,o,r;const i=[create_if_block$2g,create_else_block$11],a=[];function s(e,t){return e[2]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,[r]){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function instance$5n(e,t,n){const o=["options","value","isNative","isMulti","notSelected","defaultValue","selectClass"];let r=compute_rest_props(t,o);const i=createEventDispatcher();let{options:a=[]}=t,{value:s}=t,{isNative:c=!1}=t,{isMulti:l=!1}=t,{notSelected:u=null}=t,{defaultValue:d=""}=t,{selectClass:p=""}=t,m=!1,f=!1;return e.$$set=e=>{n(11,t=assign(assign({},t),exclude_internal_props(e))),n(10,r=compute_rest_props(t,o)),"options"in e&&n(0,a=e.options),"value"in e&&n(1,s=e.value),"isNative"in e&&n(2,c=e.isNative),"isMulti"in e&&n(3,l=e.isMulti),"notSelected"in e&&n(4,u=e.notSelected),"defaultValue"in e&&n(5,d=e.defaultValue),"selectClass"in e&&n(6,p=e.selectClass)},e.$$.update=()=>{392&e.$$.dirty&&!m&&f&&l&&n(7,m=!0)},t=exclude_internal_props(t),[a,s,c,l,u,d,p,m,f,i,r,t,e=>e.value==s,e=>{i("change",e.target.value)},e=>a.find((t=>t.value==e)),e=>e.value==s,function(e){m=e,n(7,m),n(8,f),n(3,l)},function(e){f=e,n(8,f)},e=>{i("change",l?e.detail?.map((e=>e.value)):e.detail.value)}]}class SelectField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5n,create_fragment$5s,safe_not_equal,{options:0,value:1,isNative:2,isMulti:3,notSelected:4,defaultValue:5,selectClass:6})}}function create_fragment$5r(e){let t,n,o;const r=[e[9],{value:e[5]&&e[5][e[0]]||e[4]},{options:_.compact(e[1])},{isClearable:e[2]}];var i=e[3];function a(e){let t={};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a()),t.$on("change",e[10])),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=567&o?get_spread_update(r,[512&o&&get_spread_object(e[9]),49&o&&{value:e[5]&&e[5][e[0]]||e[4]},2&o&&{options:_.compact(e[1])},4&o&&{isClearable:e[2]}]):{};if(8&o&&i!==(i=e[3])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a()),t.$on("change",e[10]),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5m(e,t,n){const o=["name","options","isClearable","selectFieldComponent","defaultSelectValue"];let r,i=compute_rest_props(t,o);const a=createEventDispatcher();let{name:s}=t,{options:c}=t,{isClearable:l=!1}=t,{selectFieldComponent:u=SelectField}=t,{defaultSelectValue:d}=t;const{values:p,setFieldValue:m}=getFormContext();component_subscribe(e,p,(e=>n(5,r=e)));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(9,i=compute_rest_props(t,o)),"name"in e&&n(0,s=e.name),"options"in e&&n(1,c=e.options),"isClearable"in e&&n(2,l=e.isClearable),"selectFieldComponent"in e&&n(3,u=e.selectFieldComponent),"defaultSelectValue"in e&&n(4,d=e.defaultSelectValue)},[s,c,l,u,d,r,a,p,m,i,e=>{m(s,e.detail),a("change",e.detail)}]}class FormSelectFieldRaw extends SvelteComponent{constructor(e){super(),init(this,e,instance$5m,create_fragment$5r,safe_not_equal,{name:0,options:1,isClearable:2,selectFieldComponent:3,defaultSelectValue:4})}}function create_fragment$5q(e){let t,n;return t=new FormSelectFieldRaw({props:{name:e[0],options:e[1](),isNative:!0}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.name=e[0]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5l(e,t,n){let{name:o}=t,{filterBehaviour:r}=t;return e.$$set=e=>{"name"in e&&n(0,o=e.name),"filterBehaviour"in e&&n(2,r=e.filterBehaviour)},[o,function(){const e=[];return r.supportEquals&&e.push({value:"=",label:"equals"},{value:"<>",label:"does not equal"}),r.supportStringInclusion&&e.push({value:"+",label:"contains"},{value:"~",label:"does not contain"},{value:"^",label:"begins with"},{value:"!^",label:"does not begin with"},{value:"$",label:"ends with"},{value:"!$",label:"does not end with"}),r.supportNumberLikeComparison&&e.push({value:"<",label:"is smaller"},{value:">",label:"is greater"},{value:"<=",label:"is smaller or equal"},{value:">=",label:"is greater or equal"}),r.supportDatetimeComparison&&e.push({value:"<",label:"is before"},{value:">",label:"is after"},{value:"<=",label:"is before or equal"},{value:">=",label:"is after or equal"}),r.supportNullTesting&&e.push({value:"NULL",label:"is NULL"},{value:"NOT NULL",label:"is not NULL"}),r.supportExistsTesting&&e.push({value:"EXISTS",label:"field exists"},{value:"NOT EXISTS",label:"field does not exist"}),r.supportSqlCondition&&e.push({value:"sql",label:"SQL condition"},{value:"sqlRight",label:"SQL condition - right side only"}),e},r]}class SetFilterModal_Select extends SvelteComponent{constructor(e){super(),init(this,e,instance$5l,create_fragment$5q,safe_not_equal,{name:0,filterBehaviour:2})}}function create_fragment$5p(e){let t,n,o,r,i,a,s,c;return{c(){t=element("div"),n=element("input"),r=space(),i=element("span"),a=text$1(e[2]),attr(n,"type","radio"),attr(n,"name",e[0]),n.checked=o=e[3][e[0]]==e[1]},m(o,l){insert(o,t,l),append(t,n),append(t,r),append(t,i),append(i,a),s||(c=[listen(n,"click",e[6]),listen(i,"click",e[7])],s=!0)},p(e,[t]){1&t&&attr(n,"name",e[0]),11&t&&o!==(o=e[3][e[0]]==e[1])&&(n.checked=o),4&t&&set_data(a,e[2])},i:noop$2,o:noop$2,d(e){e&&detach(t),s=!1,run_all(c)}}}function instance$5k(e,t,n){let o,{name:r}=t,{value:i}=t,{text:a}=t;const{values:s,setFieldValue:c}=getFormContext();component_subscribe(e,s,(e=>n(3,o=e)));return e.$$set=e=>{"name"in e&&n(0,r=e.name),"value"in e&&n(1,i=e.value),"text"in e&&n(2,a=e.text)},[r,i,a,o,s,c,()=>c(r,i),()=>c(r,i)]}class FormRadioGroupItem extends SvelteComponent{constructor(e){super(),init(this,e,instance$5k,create_fragment$5p,safe_not_equal,{name:0,value:1,text:2})}}const get_default_slot_changes=e=>({values:1&e}),get_default_slot_context=e=>({values:e[0]});function create_fragment$5o(e){let t;const n=e[3].default,o=create_slot(n,e,e[2],get_default_slot_context);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,[r]){o&&o.p&&(!t||5&r)&&update_slot_base(o,n,e,e[2],t?get_slot_changes(n,e[2],r,get_default_slot_changes):get_all_dirty_from_scope(e[2]),get_default_slot_context)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function instance$5j(e,t,n){let o,{$$slots:r={},$$scope:i}=t;const{values:a}=getFormContext();return component_subscribe(e,a,(e=>n(0,o=e))),e.$$set=e=>{"$$scope"in e&&n(2,i=e.$$scope)},[o,a,i,r]}class FormValues extends SvelteComponent{constructor(e){super(),init(this,e,instance$5j,create_fragment$5o,safe_not_equal,{})}}function create_if_block_1$1l(e){let t,n;return t=new FormTextFieldRaw({props:{name:"value1",focused:!0}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot_3$r(e){let t,n,o=e[2](e[7].condition1),r=o&&create_if_block_1$1l();return{c(){r&&r.c(),t=empty()},m(e,o){r&&r.m(e,o),insert(e,t,o),n=!0},p(e,n){128&n&&(o=e[2](e[7].condition1)),o?r?128&n&&transition_in(r,1):(r=create_if_block_1$1l(),r.c(),transition_in(r,1),r.m(t.parentNode,t)):r&&(group_outros(),transition_out(r,1,1,(()=>{r=null})),check_outros())},i(e){n||(transition_in(r),n=!0)},o(e){transition_out(r),n=!1},d(e){r&&r.d(e),e&&detach(t)}}}function create_if_block$2f(e){let t,n;return t=new FormTextFieldRaw({props:{name:"value2"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot_2$I(e){let t,n,o=e[2](e[7].condition2),r=o&&create_if_block$2f();return{c(){r&&r.c(),t=empty()},m(e,o){r&&r.m(e,o),insert(e,t,o),n=!0},p(e,n){128&n&&(o=e[2](e[7].condition2)),o?r?128&n&&transition_in(r,1):(r=create_if_block$2f(),r.c(),transition_in(r,1),r.m(t.parentNode,t)):r&&(group_outros(),transition_out(r,1,1,(()=>{r=null})),check_outros())},i(e){n||(transition_in(r),n=!0)},o(e){transition_out(r),n=!1},d(e){r&&r.d(e),e&&detach(t)}}}function create_default_slot_1$1m(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f,h,g,_,$,b,y,v,x;return a=new SetFilterModal_Select({props:{filterBehaviour:e[1],name:"condition1"}}),l=new FormValues({props:{$$slots:{default:[create_default_slot_3$r,({values:e})=>({7:e}),({values:e})=>e?128:0]},$$scope:{ctx:e}}}),p=new FormRadioGroupItem({props:{name:"joinOperator",value:" ",text:"And"}}),f=new FormRadioGroupItem({props:{name:"joinOperator",value:",",text:"Or"}}),$=new SetFilterModal_Select({props:{filterBehaviour:e[1],name:"condition2"}}),v=new FormValues({props:{$$slots:{default:[create_default_slot_2$I,({values:e})=>({7:e}),({values:e})=>e?128:0]},$$scope:{ctx:e}}}),{c(){t=element("div"),n=element("div"),n.textContent="Show rows where",o=space(),r=element("div"),i=element("div"),create_component(a.$$.fragment),s=space(),c=element("div"),create_component(l.$$.fragment),u=space(),d=element("div"),create_component(p.$$.fragment),m=space(),create_component(f.$$.fragment),h=space(),g=element("div"),_=element("div"),create_component($.$$.fragment),b=space(),y=element("div"),create_component(v.$$.fragment),attr(n,"class","row svelte-10d5vjg"),attr(i,"class","col-6 mr-1"),attr(c,"class","col-6 mr-1"),attr(r,"class","row svelte-10d5vjg"),attr(d,"class","row svelte-10d5vjg"),attr(_,"class","col-6 mr-1"),attr(y,"class","col-6 mr-1"),attr(g,"class","row svelte-10d5vjg"),attr(t,"class","largeFormMarker")},m(e,w){insert(e,t,w),append(t,n),append(t,o),append(t,r),append(r,i),mount_component(a,i,null),append(r,s),append(r,c),mount_component(l,c,null),append(t,u),append(t,d),mount_component(p,d,null),append(d,m),mount_component(f,d,null),append(t,h),append(t,g),append(g,_),mount_component($,_,null),append(g,b),append(g,y),mount_component(v,y,null),x=!0},p(e,t){const n={};2&t&&(n.filterBehaviour=e[1]),a.$set(n);const o={};384&t&&(o.$$scope={dirty:t,ctx:e}),l.$set(o);const r={};2&t&&(r.filterBehaviour=e[1]),$.$set(r);const i={};384&t&&(i.$$scope={dirty:t,ctx:e}),v.$set(i)},i(e){x||(transition_in(a.$$.fragment,e),transition_in(l.$$.fragment,e),transition_in(p.$$.fragment,e),transition_in(f.$$.fragment,e),transition_in($.$$.fragment,e),transition_in(v.$$.fragment,e),x=!0)},o(e){transition_out(a.$$.fragment,e),transition_out(l.$$.fragment,e),transition_out(p.$$.fragment,e),transition_out(f.$$.fragment,e),transition_out($.$$.fragment,e),transition_out(v.$$.fragment,e),x=!1},d(e){e&&detach(t),destroy_component(a),destroy_component(l),destroy_component(p),destroy_component(f),destroy_component($),destroy_component(v)}}}function create_header_slot$B(e){let t;return{c(){t=element("div"),t.textContent="Set filter",attr(t,"slot","header")},m(e,n){insert(e,t,n)},p:noop$2,d(e){e&&detach(t)}}}function create_footer_slot$z(e){let t,n,o,r,i;return n=new FormSubmit({props:{value:"OK"}}),n.$on("click",e[3]),r=new FormButton({props:{type:"button",value:"Close"}}),r.$on("click",closeCurrentModal),{c(){t=element("div"),create_component(n.$$.fragment),o=space(),create_component(r.$$.fragment),attr(t,"slot","footer")},m(e,a){insert(e,t,a),mount_component(n,t,null),append(t,o),mount_component(r,t,null),i=!0},p:noop$2,i(e){i||(transition_in(n.$$.fragment,e),transition_in(r.$$.fragment,e),i=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(r.$$.fragment,e),i=!1},d(e){e&&detach(t),destroy_component(n),destroy_component(r)}}}function create_default_slot$1$(e){let t,n;const o=[e[4]];let r={$$slots:{footer:[create_footer_slot$z],header:[create_header_slot$B],default:[create_default_slot_1$1m]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=16&n?get_spread_update(o,[get_spread_object(e[4])]):{};258&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5n(e){let t,n;return t=new FormProvider({props:{initialValues:{condition1:e[0],condition2:"=",joinOperator:" "},template:FormFieldTemplateLarge,$$slots:{default:[create_default_slot$1$]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.initialValues={condition1:e[0],condition2:"=",joinOperator:" "}),274&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5i(e,t,n){const o=["condition1","onFilter","filterBehaviour"];let r=compute_rest_props(t,o),{condition1:i}=t,{onFilter:a}=t,{filterBehaviour:s}=t;const c=e=>"NULL"!=e&&"NOT NULL"!=e&&"EXISTS"!=e&&"NOT EXISTS"!=e,l=(e,t)=>c(e)?t?"sql"==e?`{${t}}`:"sqlRight"==e?`{$$ ${t}}`:s.allowStringToken?`${e}"${t}"`:`${e}${t}`:null:e;return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(4,r=compute_rest_props(t,o)),"condition1"in e&&n(0,i=e.condition1),"onFilter"in e&&n(5,a=e.onFilter),"filterBehaviour"in e&&n(1,s=e.filterBehaviour)},[i,s,c,e=>{const t=e.detail,{value1:n,condition1:o,value2:r,condition2:i,joinOperator:s}=t,c=l(o,n),u=l(i,r);c&&u?a(`${c}${s}${u}`):c?a(c):u&&a(u),closeCurrentModal()},r,a]}class SetFilterModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5i,create_fragment$5n,safe_not_equal,{condition1:0,onFilter:5,filterBehaviour:1})}}function create_default_slot$1_(e){let t,n;return t=new FontIcon({props:{icon:e[5]?"icon loading":e[0]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};33&n&&(o.icon=e[5]?"icon loading":e[0]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5m(e){let t,n,o={square:e[2],narrow:e[1],disabled:e[3],"data-testid":e[7]["data-testid"],$$slots:{default:[create_default_slot$1_]},$$scope:{ctx:e}};return t=new InlineButton({props:o}),e[10](t),t.$on("click",e[6]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};4&n&&(o.square=e[2]),2&n&&(o.narrow=e[1]),8&n&&(o.disabled=e[3]),128&n&&(o["data-testid"]=e[7]["data-testid"]),4129&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(n){e[10](null),destroy_component(t,n)}}}function instance$5h(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let r,{icon:i="icon chevron-down"}=t,{menu:a}=t,{asyncMenu:s}=t,{narrow:c=!1}=t,{square:l=!0}=t,{disabled:u=!1}=t,d=!1;return e.$$set=e=>{n(7,t=assign(assign({},t),exclude_internal_props(e))),"icon"in e&&n(0,i=e.icon),"menu"in e&&n(8,a=e.menu),"asyncMenu"in e&&n(9,s=e.asyncMenu),"narrow"in e&&n(1,c=e.narrow),"square"in e&&n(2,l=e.square),"disabled"in e&&n(3,u=e.disabled)},t=exclude_internal_props(t),[i,c,l,u,r,d,function(){return o(this,void 0,void 0,(function*(){if(u)return;let e=a;s&&(n(5,d=!0),e=yield s(),n(5,d=!1));const t=r.getBoundingClientRect(),o=t.left,i=t.bottom;currentDropDownMenu.set({left:o,top:i,items:e})}))},t,a,s,function(e){binding_callbacks[e?"unshift":"push"]((()=>{r=e,n(4,r)}))}]}class DropDownButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$5h,create_fragment$5m,safe_not_equal,{icon:0,menu:8,asyncMenu:9,narrow:1,square:2,disabled:3})}}function get_each_context$Q(e,t,n){const o=e.slice();return o[53]=t[n],o[55]=n,o}function get_each_context_1$9(e,t,n){const o=e.slice();o[56]=t[n];const r=_.indexOf(o[19],o[56]);return o[57]=r,o}function get_each_context_2$4(e,t,n){const o=e.slice();o[60]=t[n];const r={...o[60].props,...o[60].getProps?o[60].getProps(o[56]):null};return o[61]=r,o}const get__9_slot_spread_changes=e=>135266304&e[0],get__9_slot_changes$1=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__9_slot_context$1=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__8_slot_spread_changes=e=>135266304&e[0],get__8_slot_changes$1=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__8_slot_context$1=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__7_slot_spread_changes=e=>135266304&e[0],get__7_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__7_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__6_slot_spread_changes=e=>135266304&e[0],get__6_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__6_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__5_slot_spread_changes=e=>135266304&e[0],get__5_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__5_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__4_slot_spread_changes=e=>135266304&e[0],get__4_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__4_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__3_slot_spread_changes=e=>135266304&e[0],get__3_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__3_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__2_slot_spread_changes=e=>135266304&e[0],get__2_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__2_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__1_slot_spread_changes=e=>135266304&e[0],get__1_slot_changes_1$1=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__1_slot_context_1$1=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__0_slot_spread_changes=e=>135266304&e[0],get__0_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__0_slot_context$4=e=>({row:e[56],col:e[60],index:e[57],...e[61]}),get__1_slot_changes$4=e=>({row:1048576&e[0],col:134217728&e[0],index:1572864&e[0]}),get__1_slot_context$4=e=>({row:e[56],col:e[60],index:e[57]});function get_each_context_3$2(e,t,n){const o=e.slice();return o[60]=t[n],o}function get_each_context_4$2(e,t,n){const o=e.slice();return o[60]=t[n],o}function create_if_block_23$1(e){let t,n,o,r,i;return{c(){t=element("th"),n=element("input"),attr(n,"type","checkbox"),n.checked=o=e[26].every(e[40]),attr(n,"data-testid","TableControl_selectAllCheckBox"),attr(t,"class","svelte-a7z0sq")},m(o,a){insert(o,t,a),append(t,n),r||(i=listen(n,"change",e[41]),r=!0)},p(e,t){67119104&t[0]&&o!==(o=e[26].every(e[40]))&&(n.checked=o)},d(e){e&&detach(t),r=!1,i()}}}function create_if_block_22$2(e){let t,n;return t=new FontIcon({props:{icon:e[18]?"img sort-desc":"img sort-asc",padLeft:!0}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};262144&n[0]&&(o.icon=e[18]?"img sort-desc":"img sort-asc"),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_each_block_4$2(e){let t,n,o,r,i,a,s,c=(e[60].header||"")+"",l=e[17]==e[60].fieldName&&create_if_block_22$2(e);function u(){return e[42](e[60])}return{c(){t=element("th"),n=text$1(c),o=space(),l&&l.c(),r=space(),attr(t,"class","svelte-a7z0sq"),toggle_class(t,"clickable",e[60].sortable)},m(e,c){insert(e,t,c),append(t,n),append(t,o),l&&l.m(t,null),append(t,r),i=!0,a||(s=listen(t,"click",u),a=!0)},p(o,a){e=o,(!i||134217728&a[0])&&c!==(c=(e[60].header||"")+"")&&set_data(n,c),e[17]==e[60].fieldName?l?(l.p(e,a),134348800&a[0]&&transition_in(l,1)):(l=create_if_block_22$2(e),l.c(),transition_in(l,1),l.m(t,r)):l&&(group_outros(),transition_out(l,1,1,(()=>{l=null})),check_outros()),(!i||134217728&a[0])&&toggle_class(t,"clickable",e[60].sortable)},i(e){i||(transition_in(l),i=!0)},o(e){transition_out(l),i=!1},d(e){e&&detach(t),l&&l.d(),a=!1,s()}}}function create_if_block_19$4(e){let t,n,o,r=e[11]&&create_if_block_21$2(),i=e[27],a=[];for(let t=0;t<i.length;t+=1)a[t]=create_each_block_3$2(get_each_context_3$2(e,i,t));const s=e=>transition_out(a[e],1,1,(()=>{a[e]=null}));return{c(){t=element("tr"),r&&r.c(),n=space();for(let e=0;e<a.length;e+=1)a[e].c()},m(e,i){insert(e,t,i),r&&r.m(t,null),append(t,n);for(let e=0;e<a.length;e+=1)a[e]&&a[e].m(t,null);o=!0},p(e,o){if(e[11]?r||(r=create_if_block_21$2(),r.c(),r.m(t,n)):r&&(r.d(1),r=null),136347648&o[0]){let n;for(i=e[27],n=0;n<i.length;n+=1){const r=get_each_context_3$2(e,i,n);a[n]?(a[n].p(r,o),transition_in(a[n],1)):(a[n]=create_each_block_3$2(r),a[n].c(),transition_in(a[n],1),a[n].m(t,null))}for(group_outros(),n=i.length;n<a.length;n+=1)s(n);check_outros()}},i(e){if(!o){for(let e=0;e<i.length;e+=1)transition_in(a[e]);o=!0}},o(e){a=a.filter(Boolean);for(let e=0;e<a.length;e+=1)transition_out(a[e]);o=!1},d(e){e&&detach(t),r&&r.d(),destroy_each(a,e)}}}function create_if_block_21$2(e){let t;return{c(){t=element("td"),attr(t,"class","empty-cell svelte-a7z0sq")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_if_block_20$3(e){let t,n;function o(...t){return e[43](e[60],...t)}return t=new DataFilterControl({props:{filterBehaviour:lib$5.evalFilterBehaviour,filter:e[21][e[60].fieldName],setFilter:o,placeholder:"Data filter"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(n,r){e=n;const i={};136314880&r[0]&&(i.filter=e[21][e[60].fieldName]),134250496&r[0]&&(i.setFilter=o),t.$set(i)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_each_block_3$2(e){let t,n,o,r=e[60].filterable&&create_if_block_20$3(e);return{c(){t=element("td"),r&&r.c(),n=space(),attr(t,"class","filter-cell svelte-a7z0sq"),toggle_class(t,"empty-cell",!e[60].filterable)},m(e,i){insert(e,t,i),r&&r.m(t,null),append(t,n),o=!0},p(e,i){e[60].filterable?r?(r.p(e,i),134217728&i[0]&&transition_in(r,1)):(r=create_if_block_20$3(e),r.c(),transition_in(r,1),r.m(t,n)):r&&(group_outros(),transition_out(r,1,1,(()=>{r=null})),check_outros()),(!o||134217728&i[0])&&toggle_class(t,"empty-cell",!e[60].filterable)},i(e){o||(transition_in(r),o=!0)},o(e){transition_out(r),o=!1},d(e){e&&detach(t),r&&r.d()}}}function create_if_block_18$5(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f=e[53].group+"",h=e[53].rows.length+"";function g(){return e[44](e[55])}return o=new FontIcon({props:{icon:chevronExpandIcon(!e[24].includes(e[55])),padRight:!0}}),{c(){t=element("tr"),n=element("td"),create_component(o.$$.fragment),r=space(),i=element("strong"),a=text$1(f),s=text$1(" ("),c=text$1(h),l=text$1(")"),attr(n,"colspan",u=e[27].length+(e[11]?1:0)),attr(n,"class","groupcell svelte-a7z0sq"),attr(t,"class","group-row svelte-a7z0sq")},m(e,u){insert(e,t,u),append(t,n),mount_component(o,n,null),append(n,r),append(n,i),append(i,a),append(i,s),append(i,c),append(i,l),d=!0,p||(m=listen(n,"click",g),p=!0)},p(t,r){e=t;const i={};16777216&r[0]&&(i.icon=chevronExpandIcon(!e[24].includes(e[55]))),o.$set(i),(!d||1048576&r[0])&&f!==(f=e[53].group+"")&&set_data(a,f),(!d||1048576&r[0])&&h!==(h=e[53].rows.length+"")&&set_data(c,h),(!d||134219776&r[0]&&u!==(u=e[27].length+(e[11]?1:0)))&&attr(n,"colspan",u)},i(e){d||(transition_in(o.$$.fragment,e),d=!0)},o(e){transition_out(o.$$.fragment,e),d=!1},d(e){e&&detach(t),destroy_component(o),p=!1,m()}}}function create_if_block_1$1k(e){let t,n,o=e[53].rows,r=[];for(let t=0;t<o.length;t+=1)r[t]=create_each_block_1$9(get_each_context_1$9(e,o,t));const i=e=>transition_out(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=empty()},m(e,o){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,o);insert(e,t,o),n=!0},p(e,n){if(450460479&n[0]|64&n[1]){let a;for(o=e[53].rows,a=0;a<o.length;a+=1){const i=get_each_context_1$9(e,o,a);r[a]?(r[a].p(i,n),transition_in(r[a],1)):(r[a]=create_each_block_1$9(i),r[a].c(),transition_in(r[a],1),r[a].m(t.parentNode,t))}for(group_outros(),a=o.length;a<r.length;a+=1)i(a);check_outros()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)transition_in(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)transition_out(r[e]);n=!1},d(e){destroy_each(r,e),e&&detach(t)}}}function create_if_block_16$5(e){let t,n=e[14](e[56]),o=n&&create_if_block_17$5(e);return{c(){t=element("td"),o&&o.c(),attr(t,"class","svelte-a7z0sq")},m(e,n){insert(e,t,n),o&&o.m(t,null)},p(e,r){1064960&r[0]&&(n=e[14](e[56])),n?o?o.p(e,r):(o=create_if_block_17$5(e),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(e){e&&detach(t),o&&o.d()}}}function create_if_block_17$5(e){let t,n,o,r,i;function a(...t){return e[45](e[56],...t)}return{c(){t=element("input"),attr(t,"type","checkbox"),t.checked=n=e[11].includes(e[13](e[56])),attr(t,"data-testid",o=`TableControl_row_${e[57]}_checkbox`)},m(e,n){insert(e,t,n),r||(i=listen(t,"change",a),r=!0)},p(r,i){e=r,1058816&i[0]&&n!==(n=e[11].includes(e[13](e[56])))&&(t.checked=n),1572864&i[0]&&o!==(o=`TableControl_row_${e[57]}_checkbox`)&&attr(t,"data-testid",o)},d(e){e&&detach(t),r=!1,i()}}}function create_else_block$10(e){let t,n=(e[56][e[60].fieldName]||"")+"";return{c(){t=text$1(n)},m(e,n){insert(e,t,n)},p(e,o){135266304&o[0]&&n!==(n=(e[56][e[60].fieldName]||"")+"")&&set_data(t,n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_if_block_4$z(e){let t,n,o=e[56][e[60].slotKey]||"key",r=create_key_block$g(e);return{c(){r.c(),t=empty()},m(e,o){r.m(e,o),insert(e,t,o),n=!0},p(e,n){135266304&n[0]&&safe_not_equal(o,o=e[56][e[60].slotKey]||"key")?(group_outros(),transition_out(r,1,1,noop$2),check_outros(),r=create_key_block$g(e),r.c(),transition_in(r,1),r.m(t.parentNode,t)):r.p(e,n)},i(e){n||(transition_in(r),n=!0)},o(e){transition_out(r),n=!1},d(e){e&&detach(t),r.d(e)}}}function create_if_block_3$I(e){let t,n=e[60].formatter(e[56])+"";return{c(){t=text$1(n)},m(e,n){insert(e,t,n)},p(e,o){135266304&o[0]&&n!==(n=e[60].formatter(e[56])+"")&&set_data(t,n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_if_block_2$Y(e){let t,n,o;const r=[e[61]];var i=e[60].component;function a(e){let t={};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a())),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,o){const s=135266304&o[0]?get_spread_update(r,[get_spread_object(e[61])]):{};if(134217728&o[0]&&i!==(i=e[60].component)){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a()),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function create_if_block_15$5(e){let t;const n=e[38][9],o=create_slot(n,e,e[37],get__9_slot_context$1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__9_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__9_slot_changes$1),get__9_slot_context$1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_14$5(e){let t;const n=e[38][8],o=create_slot(n,e,e[37],get__8_slot_context$1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__8_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__8_slot_changes$1),get__8_slot_context$1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_13$6(e){let t;const n=e[38][7],o=create_slot(n,e,e[37],get__7_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__7_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__7_slot_changes$4),get__7_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_12$7(e){let t;const n=e[38][6],o=create_slot(n,e,e[37],get__6_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__6_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__6_slot_changes$4),get__6_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_11$a(e){let t;const n=e[38][5],o=create_slot(n,e,e[37],get__5_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__5_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__5_slot_changes$4),get__5_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_10$b(e){let t;const n=e[38][4],o=create_slot(n,e,e[37],get__4_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__4_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__4_slot_changes$4),get__4_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_9$c(e){let t;const n=e[38][3],o=create_slot(n,e,e[37],get__3_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__3_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__3_slot_changes$4),get__3_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_8$e(e){let t;const n=e[38][2],o=create_slot(n,e,e[37],get__2_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__2_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__2_slot_changes$4),get__2_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_7$g(e){let t;const n=e[38][1],o=create_slot(n,e,e[37],get__1_slot_context_1$1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__1_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__1_slot_changes_1$1),get__1_slot_context_1$1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_6$m(e){let t;const n=e[38][0],o=create_slot(n,e,e[37],get__0_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],get__0_slot_spread_changes(r)||!t?get_all_dirty_from_scope(e[37]):get_slot_changes(n,e[37],r,get__0_slot_changes$4),get__0_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_5$s(e){let t;const n=e[38][-1],o=create_slot(n,e,e[37],get__1_slot_context$4);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||135790592&r[0]|64&r[1])&&update_slot_base(o,n,e,e[37],t?get_slot_changes(n,e[37],r,get__1_slot_changes$4):get_all_dirty_from_scope(e[37]),get__1_slot_context$4)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_key_block$g(e){let t,n,o,r;const i=[create_if_block_5$s,create_if_block_6$m,create_if_block_7$g,create_if_block_8$e,create_if_block_9$c,create_if_block_10$b,create_if_block_11$a,create_if_block_12$7,create_if_block_13$6,create_if_block_14$5,create_if_block_15$5],a=[];function s(e,t){return-1==e[60].slot?0:0==e[60].slot?1:1==e[60].slot?2:2==e[60].slot?3:3==e[60].slot?4:4==e[60].slot?5:5==e[60].slot?6:6==e[60].slot?7:7==e[60].slot?8:8==e[60].slot?9:9==e[60].slot?10:-1}return~(t=s(e))&&(n=a[t]=i[t](e)),{c(){n&&n.c(),o=empty()},m(e,n){~t&&a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?~t&&a[t].p(e,r):(n&&(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros()),~t?(n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){~t&&a[t].d(e),e&&detach(o)}}}function create_each_block_2$4(e){let t,n,o,r;const i=[create_if_block_2$Y,create_if_block_3$I,create_if_block_4$z,create_else_block$10],a=[];function s(e,t){return e[60].component?0:e[60].formatter?1:null!=e[60].slot?2:3}return n=s(e),o=a[n]=i[n](e),{c(){t=element("td"),o.c(),attr(t,"class","svelte-a7z0sq"),toggle_class(t,"isHighlighted",e[60].isHighlighted&&e[60].isHighlighted(e[56])),toggle_class(t,"noCellPadding",e[8])},m(e,o){insert(e,t,o),a[n].m(t,null),r=!0},p(e,c){let l=n;n=s(e),n===l?a[n].p(e,c):(group_outros(),transition_out(a[l],1,1,(()=>{a[l]=null})),check_outros(),o=a[n],o?o.p(e,c):(o=a[n]=i[n](e),o.c()),transition_in(o,1),o.m(t,null)),(!r||135266304&c[0])&&toggle_class(t,"isHighlighted",e[60].isHighlighted&&e[60].isHighlighted(e[56])),(!r||256&c[0])&&toggle_class(t,"noCellPadding",e[8])},i(e){r||(transition_in(o),r=!0)},o(e){transition_out(o),r=!1},d(e){e&&detach(t),a[n].d()}}}function create_each_block_1$9(e){let t,n,o,r,i,a,s=e[57],c=e[11]&&create_if_block_16$5(e),l=e[27],u=[];for(let t=0;t<l.length;t+=1)u[t]=create_each_block_2$4(get_each_context_2$4(e,l,t));const d=e=>transition_out(u[e],1,1,(()=>{u[e]=null})),p=()=>e[46](t,s),m=()=>e[46](null,s);function f(){return e[47](e[57],e[56])}function h(...t){return e[48](e[57],...t)}function g(){return e[49](e[57])}return{c(){t=element("tr"),c&&c.c(),n=space();for(let e=0;e<u.length;e+=1)u[e].c();attr(t,"data-testid",o=`TableControl_row_${e[57]}`),attr(t,"class","svelte-a7z0sq"),toggle_class(t,"selected",e[4]&&("index"==e[16]?e[1]==e[57]:e[2]==e[13](e[56]))||e[9]&&e[0].includes(e[57])),toggle_class(t,"clickable",e[5])},m(o,s){insert(o,t,s),c&&c.m(t,null),append(t,n);for(let e=0;e<u.length;e+=1)u[e]&&u[e].m(t,null);p(),r=!0,i||(a=[listen(t,"click",f),listen(t,"mousedown",h),listen(t,"mousemove",g),listen(t,"mouseup",e[50])],i=!0)},p(i,a){if((e=i)[11]?c?c.p(e,a):(c=create_if_block_16$5(e),c.c(),c.m(t,n)):c&&(c.d(1),c=null),135790848&a[0]|64&a[1]){let n;for(l=e[27],n=0;n<l.length;n+=1){const o=get_each_context_2$4(e,l,n);u[n]?(u[n].p(o,a),transition_in(u[n],1)):(u[n]=create_each_block_2$4(o),u[n].c(),transition_in(u[n],1),u[n].m(t,null))}for(group_outros(),n=l.length;n<u.length;n+=1)d(n);check_outros()}(!r||1572864&a[0]&&o!==(o=`TableControl_row_${e[57]}`))&&attr(t,"data-testid",o),s!==e[57]&&(m(),s=e[57],p()),(!r||1647127&a[0])&&toggle_class(t,"selected",e[4]&&("index"==e[16]?e[1]==e[57]:e[2]==e[13](e[56]))||e[9]&&e[0].includes(e[57])),(!r||32&a[0])&&toggle_class(t,"clickable",e[5])},i(e){if(!r){for(let e=0;e<l.length;e+=1)transition_in(u[e]);r=!0}},o(e){u=u.filter(Boolean);for(let e=0;e<u.length;e+=1)transition_out(u[e]);r=!1},d(e){e&&detach(t),c&&c.d(),destroy_each(u,e),m(),i=!1,run_all(a)}}}function create_each_block$Q(e){let t,n,o,r=!e[24].includes(e[55]),i=e[53].group&&create_if_block_18$5(e),a=r&&create_if_block_1$1k(e);return{c(){i&&i.c(),t=space(),a&&a.c(),n=empty()},m(e,r){i&&i.m(e,r),insert(e,t,r),a&&a.m(e,r),insert(e,n,r),o=!0},p(e,o){e[53].group?i?(i.p(e,o),1048576&o[0]&&transition_in(i,1)):(i=create_if_block_18$5(e),i.c(),transition_in(i,1),i.m(t.parentNode,t)):i&&(group_outros(),transition_out(i,1,1,(()=>{i=null})),check_outros()),16777216&o[0]&&(r=!e[24].includes(e[55])),r?a?(a.p(e,o),16777216&o[0]&&transition_in(a,1)):(a=create_if_block_1$1k(e),a.c(),transition_in(a,1),a.m(n.parentNode,n)):a&&(group_outros(),transition_out(a,1,1,(()=>{a=null})),check_outros())},i(e){o||(transition_in(i),transition_in(a),o=!0)},o(e){transition_out(i),transition_out(a),o=!1},d(e){i&&i.d(e),e&&detach(t),a&&a.d(e),e&&detach(n)}}}function create_if_block$2e(e){let t,n,o,r;return{c(){t=element("tr"),n=element("td"),o=text$1(e[7]),attr(n,"colspan",r=e[27].length),attr(n,"class","svelte-a7z0sq"),attr(t,"class","svelte-a7z0sq")},m(e,r){insert(e,t,r),append(t,n),append(n,o)},p(e,t){128&t[0]&&set_data(o,e[7]),134217728&t[0]&&r!==(r=e[27].length)&&attr(n,"colspan",r)},d(e){e&&detach(t)}}}function create_fragment$5l(e){let t,n,o,r,i,a,s,c,l,u,d,p,m=e[11]&&create_if_block_23$1(e),f=e[27],h=[];for(let t=0;t<f.length;t+=1)h[t]=create_each_block_4$2(get_each_context_4$2(e,f,t));const g=e=>transition_out(h[e],1,1,(()=>{h[e]=null}));let _=e[15]&&create_if_block_19$4(e),$=e[20],b=[];for(let t=0;t<$.length;t+=1)b[t]=create_each_block$Q(get_each_context$Q(e,$,t));const y=e=>transition_out(b[e],1,1,(()=>{b[e]=null}));let v=e[7]&&0==e[20].length&&create_if_block$2e(e);return{c(){t=element("table"),n=element("thead"),o=element("tr"),m&&m.c(),r=space();for(let e=0;e<h.length;e+=1)h[e].c();i=space(),_&&_.c(),a=space(),s=element("tbody");for(let e=0;e<b.length;e+=1)b[e].c();c=space(),v&&v.c(),attr(n,"class","svelte-a7z0sq"),toggle_class(n,"stickyHeader",e[10]),attr(s,"class","svelte-a7z0sq"),attr(t,"tabindex",l=e[4]?-1:void 0),attr(t,"class","svelte-a7z0sq"),toggle_class(t,"selectable",e[4]),toggle_class(t,"disableFocusOutline",e[6]),toggle_class(t,"stickyHeader",e[10])},m(l,f){insert(l,t,f),append(t,n),append(n,o),m&&m.m(o,null),append(o,r);for(let e=0;e<h.length;e+=1)h[e]&&h[e].m(o,null);append(n,i),_&&_.m(n,null),append(t,a),append(t,s);for(let e=0;e<b.length;e+=1)b[e]&&b[e].m(s,null);append(s,c),v&&v.m(s,null),e[51](t),u=!0,d||(p=[listen(t,"keydown",e[39]),listen(t,"keydown",e[29])],d=!0)},p(e,i){if(e[11]?m?m.p(e,i):(m=create_if_block_23$1(e),m.c(),m.m(o,r)):m&&(m.d(1),m=null),134610944&i[0]){let t;for(f=e[27],t=0;t<f.length;t+=1){const n=get_each_context_4$2(e,f,t);h[t]?(h[t].p(n,i),transition_in(h[t],1)):(h[t]=create_each_block_4$2(n),h[t].c(),transition_in(h[t],1),h[t].m(o,null))}for(group_outros(),t=f.length;t<h.length;t+=1)g(t);check_outros()}if(e[15]?_?(_.p(e,i),32768&i[0]&&transition_in(_,1)):(_=create_if_block_19$4(e),_.c(),transition_in(_,1),_.m(n,null)):_&&(group_outros(),transition_out(_,1,1,(()=>{_=null})),check_outros()),(!u||1024&i[0])&&toggle_class(n,"stickyHeader",e[10]),467237695&i[0]|64&i[1]){let t;for($=e[20],t=0;t<$.length;t+=1){const n=get_each_context$Q(e,$,t);b[t]?(b[t].p(n,i),transition_in(b[t],1)):(b[t]=create_each_block$Q(n),b[t].c(),transition_in(b[t],1),b[t].m(s,c))}for(group_outros(),t=$.length;t<b.length;t+=1)y(t);check_outros()}e[7]&&0==e[20].length?v?v.p(e,i):(v=create_if_block$2e(e),v.c(),v.m(s,null)):v&&(v.d(1),v=null),(!u||16&i[0]&&l!==(l=e[4]?-1:void 0))&&attr(t,"tabindex",l),(!u||16&i[0])&&toggle_class(t,"selectable",e[4]),(!u||64&i[0])&&toggle_class(t,"disableFocusOutline",e[6]),(!u||1024&i[0])&&toggle_class(t,"stickyHeader",e[10])},i(e){if(!u){for(let e=0;e<f.length;e+=1)transition_in(h[e]);transition_in(_);for(let e=0;e<$.length;e+=1)transition_in(b[e]);u=!0}},o(e){h=h.filter(Boolean);for(let e=0;e<h.length;e+=1)transition_out(h[e]);transition_out(_),b=b.filter(Boolean);for(let e=0;e<b.length;e+=1)transition_out(b[e]);u=!1},d(n){n&&detach(t),m&&m.d(),destroy_each(h,n),_&&_.d(),destroy_each(b,n),v&&v.d(),e[51](null),d=!1,run_all(p)}}}function instance$5g(e,t,n){let o,r,i,a,s,c,l,u=noop$2,d=()=>(u(),u=subscribe(R,(e=>n(21,l=e))),R);e.$$.on_destroy.push((()=>u()));let{$$slots:p={},$$scope:m}=t,{columns:f}=t,{rows:h=null}=t,{groupedRows:g=null}=t,{focusOnCreate:$=!1}=t,{selectable:b=!1}=t,{selectedIndex:y=0}=t,{selectedKey:v=null}=t,{clickable:x=!1}=t,{disableFocusOutline:w=!1}=t,{emptyMessage:C=null}=t,{noCellPadding:k=!1}=t,{allowMultiSelect:S=!1}=t,{selectedIndexes:T=[]}=t,{onChangeMultipleSelection:E=null}=t,{domTable:A}=t,{stickyHeader:O=!1}=t,{checkedKeys:N=null}=t,{onSetCheckedKeys:I=null}=t,{extractTableItemKey:D=(e=>e.id)}=t,{itemSupportsCheckbox:M=(e=>!0)}=t,{filters:R=null}=t;d();let{selectionMode:L="index"}=t;const F=createEventDispatcher();let P=null,j=null;onMount((()=>{$&&A.focus()}));let B=null,q=!1,W=[],z={};return e.$$set=e=>{"columns"in e&&n(30,f=e.columns),"rows"in e&&n(31,h=e.rows),"groupedRows"in e&&n(32,g=e.groupedRows),"focusOnCreate"in e&&n(33,$=e.focusOnCreate),"selectable"in e&&n(4,b=e.selectable),"selectedIndex"in e&&n(1,y=e.selectedIndex),"selectedKey"in e&&n(2,v=e.selectedKey),"clickable"in e&&n(5,x=e.clickable),"disableFocusOutline"in e&&n(6,w=e.disableFocusOutline),"emptyMessage"in e&&n(7,C=e.emptyMessage),"noCellPadding"in e&&n(8,k=e.noCellPadding),"allowMultiSelect"in e&&n(9,S=e.allowMultiSelect),"selectedIndexes"in e&&n(0,T=e.selectedIndexes),"onChangeMultipleSelection"in e&&n(34,E=e.onChangeMultipleSelection),"domTable"in e&&n(3,A=e.domTable),"stickyHeader"in e&&n(10,O=e.stickyHeader),"checkedKeys"in e&&n(11,N=e.checkedKeys),"onSetCheckedKeys"in e&&n(12,I=e.onSetCheckedKeys),"extractTableItemKey"in e&&n(13,D=e.extractTableItemKey),"itemSupportsCheckbox"in e&&n(14,M=e.itemSupportsCheckbox),"filters"in e&&d(n(15,R=e.filters)),"selectionMode"in e&&n(16,L=e.selectionMode),"$$scope"in e&&n(37,m=e.$$scope)},e.$$.update=()=>{1073741824&e.$$.dirty[0]&&n(27,o=_.compact(_.flatten(f))),3&e.$$.dirty[1]&&n(36,r=g||[{group:null,rows:h}]),2129920&e.$$.dirty[0]|32&e.$$.dirty[1]&&n(35,i=R?function(e,t){const n=lib.compileCompoudEvalCondition(t);return n?e.map((e=>({group:e.group,rows:e.rows.filter((e=>{const t=Object.assign({},e);for(const n of o)n.filteredExpression&&(t[n.fieldName]=n.filteredExpression(e));return lib$2.evaluateCondition(n,t)}))}))).filter((e=>e.rows.length>0)):e}(r,l):r),393216&e.$$.dirty[0]|16&e.$$.dirty[1]&&n(20,a=B?i.map((e=>{let t=_.sortBy(e.rows,B);return q&&(t=[...t].reverse()),{group:e.group,rows:t}})):i),1048576&e.$$.dirty[0]&&n(19,s=a.map((e=>e.rows)).flat()),540672&e.$$.dirty[0]&&n(26,c=s.filter((e=>M(e)))),524288&e.$$.dirty[0]&&s&&n(0,T=[]),524289&e.$$.dirty[0]|8&e.$$.dirty[1]&&E&&s&&E(T.map((e=>s[e])))},[T,y,v,A,b,x,w,C,k,S,O,N,I,D,M,R,L,B,q,s,a,l,P,j,W,z,c,o,F,e=>{var t;const o="index"==L?y:_.findIndex(s,(e=>D(e)==v));let r=o;switch(e.keyCode){case keycodes.downArrow:r=Math.min(r+1,s.length-1);break;case keycodes.upArrow:r=Math.max(0,r-1);break;case keycodes.home:r=0;break;case keycodes.end:r=h.length-1;break;case keycodes.pageUp:r-=10;break;case keycodes.pageDown:r+=10}r<0&&(r=0),r>=s.length&&(r=s.length-1),x&&o!=r&&(e.preventDefault(),null===(t=z[r])||void 0===t||t.scrollIntoView(),x&&F("clickrow",s[r]),"index"==L?n(1,y=r):n(2,v=D(s[r])))},f,h,g,$,E,i,r,m,p,function(t){bubble.call(this,e,t)},e=>N.includes(D(e)),e=>{e.target.checked?I(c.map((e=>D(e)))):I([])},e=>{e.sortable&&(B==e.fieldName?q?(n(18,q=!1),n(17,B=null)):n(18,q=!0):(n(18,q=!1),n(17,B=e.fieldName)))},(e,t)=>R.update((n=>({...n,[e.fieldName]:t}))),e=>{W.includes(e)?n(24,W=W.filter((t=>t!=e))):n(24,W=[...W,e])},(e,t)=>{t.target.checked?I(_.uniq([...N,D(e)])):I(N.filter((t=>t!=D(e))))},function(e,t){binding_callbacks[e?"unshift":"push"]((()=>{z[t]=e,n(25,z)}))},(e,t)=>{b&&("index"==L?n(1,y=e):n(2,v=D(t)),A.focus()),x&&F("clickrow",t)},(e,t)=>{!S||t.ctrlKey||t.metaKey||(n(0,T=[]),n(22,P=e))},e=>{null!=P&&S&&(n(23,j=e),j!=P||T.length>0?n(0,T=j<P?_.range(j,P+1):_.range(P,j+1)):T.length>0&&n(0,T=[j]))},e=>{n(23,j=null),n(22,P=null)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{A=e,n(3,A)}))}]}class TableControl extends SvelteComponent{constructor(e){super(),init(this,e,instance$5g,create_fragment$5l,safe_not_equal,{columns:30,rows:31,groupedRows:32,focusOnCreate:33,selectable:4,selectedIndex:1,selectedKey:2,clickable:5,disableFocusOutline:6,emptyMessage:7,noCellPadding:8,allowMultiSelect:9,selectedIndexes:0,onChangeMultipleSelection:34,domTable:3,stickyHeader:10,checkedKeys:11,onSetCheckedKeys:12,extractTableItemKey:13,itemSupportsCheckbox:14,filters:15,selectionMode:16},null,[-1,-1,-1])}}function saveDbToApp(e,t,n){return __awaiter$h(this,void 0,void 0,(function*(){if("#new"==n){const n=yield apiCall("apps/create-folder",{folder:t});return yield apiCall("connections/update-database",{conid:e,database:t,values:{[`useApp:${n}`]:!0}}),n}return yield apiCall("connections/update-database",{conid:e,database:t,values:{[`useApp:${n}`]:!0}}),n}))}function filterAppsForDatabase(e,t,n){const o=((null==e?void 0:e.databases)||[]).find((e=>e.name==t));return null==n?void 0:n.filter((e=>o&&o[`useApp:${e.name}`]))}function checkDescriptionColumns(e,t){var n,o;return!!(null==e?void 0:e.length)&&(!!e.every((e=>t.columns.find((t=>t.columnName==e))))&&!(null===(o=null===(n=t.primaryKey)||void 0===n?void 0:n.columns)||void 0===o?void 0:o.find((t=>e.includes(t.columnName)))))}function getDictionaryDescription(e,t,n,o,r,i=!1){const a=null==r?void 0:r.find((e=>e._id==t));if(!a)return null;const s=filterAppsForDatabase(a,n,o);if(!s)return null;const c=_.flatten(s.map((e=>e.dictionaryDescriptions||[]))).find((t=>t.pureName==e.pureName&&t.schemaName==e.schemaName));if(c&&(i||checkDescriptionColumns(c.columns,e)))return c;const l=e.columns.find((e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.dataType)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("char")}));return l?{columns:[l.columnName],delimiter:null,expression:l.columnName}:null}function parseDelimitedColumnList(e){return _.compact((e||"").split(",").map((e=>e.trim())))}function checkDescriptionExpression(e,t){return!!e&&(!!t&&checkDescriptionColumns(parseDelimitedColumnList(e),t))}function changeDelimitedColumnList(e,t,n){const o=parseDelimitedColumnList(e);return o.includes(t)==n?e:(n?o.push(t):_.remove(o,(e=>e==t)),o.join(","))}function saveDictionaryDescription(e,t,n,o,r,i){return __awaiter$h(this,void 0,void 0,(function*(){const a=yield saveDbToApp(t,n,i);yield apiCall("apps/save-dictionary-description",{appFolder:a,schemaName:e.schemaName,pureName:e.pureName,columns:parseDelimitedColumnList(o),expression:o,delimiter:r})}))}function create_fragment$5k(e){let t,n,o,r=[{type:"checkbox"},e[0]],i={};for(let e=0;e<r.length;e+=1)i=assign(i,r[e]);return{c(){t=element("input"),set_attributes(t,i)},m(r,i){insert(r,t,i),t.autofocus&&t.focus(),n||(o=listen(t,"change",e[1]),n=!0)},p(e,[n]){set_attributes(t,i=get_spread_update(r,[{type:"checkbox"},1&n&&e[0]]))},i:noop$2,o:noop$2,d(e){e&&detach(t),n=!1,o()}}}function instance$5f(e,t,n){const o=[];let r=compute_rest_props(t,o);return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(0,r=compute_rest_props(t,o))},[r,function(t){bubble.call(this,e,t)}]}class CheckboxField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5f,create_fragment$5k,safe_not_equal,{})}}function create_fragment$5j(e){let t,n;const o=[e[5],{checked:0!=e[2]?.[e[0]]&&("1"==e[2]?.[e[0]]||(e[2]?.[e[0]]??e[1]))}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new CheckboxField({props:r}),t.$on("change",e[4]),t.$on("change",e[6]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=39&n?get_spread_update(o,[32&n&&get_spread_object(e[5]),7&n&&{checked:0!=e[2]?.[e[0]]&&("1"==e[2]?.[e[0]]||(e[2]?.[e[0]]??e[1]))}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5e(e,t,n){const o=["name","defaultValue"];let r,i=compute_rest_props(t,o),{name:a}=t,{defaultValue:s}=t;const{values:c,setFieldValue:l}=getFormContext();return component_subscribe(e,c,(e=>n(2,r=e))),e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(5,i=compute_rest_props(t,o)),"name"in e&&n(0,a=e.name),"defaultValue"in e&&n(1,s=e.defaultValue)},[a,s,r,c,function(e){l(a,e.target.checked)},i,function(t){bubble.call(this,e,t)}]}class FormCheckboxFieldRaw extends SvelteComponent{constructor(e){super(),init(this,e,instance$5e,create_fragment$5j,safe_not_equal,{name:0,defaultValue:1})}}function create_default_slot$1Z(e){let t,n;const o=[{name:e[1]},e[9],{disabled:e[2]}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormCheckboxFieldRaw({props:r}),t.$on("change",e[10]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=518&n?get_spread_update(o,[2&n&&{name:e[1]},512&n&&get_spread_object(e[9]),4&n&&{disabled:e[2]}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5i(e){let t,n,o;const r=[{type:"checkbox"},{label:e[0]},{disabled:e[2]},e[3],{labelProps:e[2]?{disabled:!0}:{onClick:e[11]}}];var i=e[5];function a(e){let t={$$slots:{default:[create_default_slot$1Z]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=351&o?get_spread_update(r,[r[0],1&o&&{label:e[0]},4&o&&{disabled:e[2]},8&o&&get_spread_object(e[3]),342&o&&{labelProps:e[2]?{disabled:!0}:{onClick:e[11]}}]):{};if(4614&o&&(s.$$scope={dirty:o,ctx:e}),i!==(i=e[5])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5d(e,t,n){const o=["label","name","disabled","templateProps"];let r,i=compute_rest_props(t,o),{label:a}=t,{name:s}=t,{disabled:c=!1}=t,{templateProps:l={}}=t;const{template:u,setFieldValue:d,values:p}=getFormContext();component_subscribe(e,p,(e=>n(4,r=e)));const m=createEventDispatcher();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(9,i=compute_rest_props(t,o)),"label"in e&&n(0,a=e.label),"name"in e&&n(1,s=e.name),"disabled"in e&&n(2,c=e.disabled),"templateProps"in e&&n(3,l=e.templateProps)},[a,s,c,l,r,u,d,p,m,i,function(t){bubble.call(this,e,t)},()=>{d(s,0==r?.[s]||1!=r?.[s]&&!r?.[s]),m("change")}]}class FormCheckboxField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5d,create_fragment$5i,safe_not_equal,{label:0,name:1,disabled:2,templateProps:3})}}function create_default_slot$1Y(e){let t,n;const o=[{name:e[1]},e[4]];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new FormSelectFieldRaw({props:r}),t.$on("change",e[5]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=18&n?get_spread_update(o,[2&n&&{name:e[1]},16&n&&get_spread_object(e[4])]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5h(e){let t,n,o;const r=[{type:"select"},{label:e[0]},e[2]];var i=e[3];function a(e){let t={$$slots:{default:[create_default_slot$1Y]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a(e))),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,[o]){const s=5&o?get_spread_update(r,[r[0],1&o&&{label:e[0]},4&o&&get_spread_object(e[2])]):{};if(82&o&&(s.$$scope={dirty:o,ctx:e}),i!==(i=e[3])){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a(e)),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function instance$5c(e,t,n){const o=["label","name","templateProps"];let r=compute_rest_props(t,o),{label:i}=t,{name:a}=t,{templateProps:s={}}=t;const{template:c}=getFormContext();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(4,r=compute_rest_props(t,o)),"label"in e&&n(0,i=e.label),"name"in e&&n(1,a=e.name),"templateProps"in e&&n(2,s=e.templateProps)},[i,a,s,c,r,function(t){bubble.call(this,e,t)}]}class FormSelectField extends SvelteComponent{constructor(e){super(),init(this,e,instance$5c,create_fragment$5h,safe_not_equal,{label:0,name:1,templateProps:2})}}function create_fragment$5g(e){let t,n;const o=[{isNative:!0},e[5],{value:e[0]},{options:[{label:"(New application linked to current DB)",value:"#new"},...(e[1]||[]).map(func$t)]}];let r={};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new SelectField({props:r}),t.$on("change",e[9]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const r=35&n?get_spread_update(o,[o[0],32&n&&get_spread_object(e[5]),1&n&&{value:e[0]},2&n&&{options:[{label:"(New application linked to current DB)",value:"#new"},...(e[1]||[]).map(func$t)]}]):{};t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}const func$t=e=>({label:e.name,value:e.name});function instance$5b(e,t,n){let o,r;const i=["value","disableInitialize"];let a,s,c,l=compute_rest_props(t,i),u=noop$2,d=noop$2;component_subscribe(e,currentDatabase,(e=>n(8,c=e))),e.$$.on_destroy.push((()=>u())),e.$$.on_destroy.push((()=>d()));let{value:p="#new"}=t,{disableInitialize:m=!1}=t;const f=createEventDispatcher();return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(5,l=compute_rest_props(t,i)),"value"in e&&n(0,p=e.value),"disableInitialize"in e&&n(6,m=e.disableInitialize)},e.$$.update=()=>{if(451&e.$$.dirty&&!m&&"#new"==p&&c){const e=filterAppsForDatabase(c.connection,c.name,s||[]),t=_.intersection((a||[]).map((e=>e.name)),e.map((e=>e.name)));t.length>0&&(n(0,p=t[0]),f("change",p))}},n(3,o=useAppFolders()),u(),u=subscribe(o,(e=>n(1,a=e))),n(2,r=useUsedApps()),d(),d=subscribe(r,(e=>n(7,s=e))),[p,a,r,o,f,l,m,s,c,e=>{n(0,p=e.detail),f("change",p)}]}class TargetApplicationSelect extends SvelteComponent{constructor(e){super(),init(this,e,instance$5b,create_fragment$5g,safe_not_equal,{value:0,disableInitialize:6})}}function create__1_slot$o(e){let t,n,o,r,i;function a(...t){return e[19](e[22],...t)}function s(...t){return e[20](e[22],...t)}return{c(){t=element("input"),attr(t,"type","checkbox"),attr(t,"slot","1"),t.disabled=n=e[4]?.primaryKey?.columns?.find(a),t.checked=o=parseDelimitedColumnList(e[3].columns).includes(e[22].columnName)},m(e,n){insert(e,t,n),r||(i=listen(t,"change",s),r=!0)},p(r,i){e=r,4194320&i&&n!==(n=e[4]?.primaryKey?.columns?.find(a))&&(t.disabled=n),4194312&i&&o!==(o=parseDelimitedColumnList(e[3].columns).includes(e[22].columnName))&&(t.checked=o)},d(e){e&&detach(t),r=!1,i()}}}function create_default_slot_1$1l(e){let t,n,o,r,i,a,s,c,l;return n=new TableControl({props:{rows:e[4]?.columns||[],columns:[{fieldName:"checked",header:"",slot:1},{fieldName:"columnName",header:"Column"},{fieldName:"dataType",header:"Data type"}],$$slots:{1:[create__1_slot$o,({row:e})=>({22:e}),({row:e})=>e?4194304:0]},$$scope:{ctx:e}}}),r=new FormTextField({props:{name:"columns",label:"Show columns"}}),a=new FormTextField({props:{name:"delimiter",label:"Delimiter"}}),c=new FormSelectField({props:{label:"Target application",name:"targetApplication",disableInitialize:!0,selectFieldComponent:TargetApplicationSelect}}),{c(){t=element("div"),create_component(n.$$.fragment),o=space(),create_component(r.$$.fragment),i=space(),create_component(a.$$.fragment),s=space(),create_component(c.$$.fragment),attr(t,"class","wrapper svelte-y6l14f")},m(e,u){insert(e,t,u),mount_component(n,t,null),insert(e,o,u),mount_component(r,e,u),insert(e,i,u),mount_component(a,e,u),insert(e,s,u),mount_component(c,e,u),l=!0},p(e,t){const o={};16&t&&(o.rows=e[4]?.columns||[]),12582936&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){l||(transition_in(n.$$.fragment,e),transition_in(r.$$.fragment,e),transition_in(a.$$.fragment,e),transition_in(c.$$.fragment,e),l=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(r.$$.fragment,e),transition_out(a.$$.fragment,e),transition_out(c.$$.fragment,e),l=!1},d(e){e&&detach(t),destroy_component(n),e&&detach(o),destroy_component(r,e),e&&detach(i),destroy_component(a,e),e&&detach(s),destroy_component(c,e)}}}function create_header_slot$A(e){let t;return{c(){t=text$1("Define description")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_footer_slot$y(e){let t,n,o,r;return t=new FormSubmit({props:{value:"OK",disabled:!checkDescriptionExpression(e[3]?.columns,e[4])}}),t.$on("click",e[18]),o=new FormStyledButton({props:{type:"button",value:"Close"}}),o.$on("click",closeCurrentModal),{c(){create_component(t.$$.fragment),n=space(),create_component(o.$$.fragment)},m(e,i){mount_component(t,e,i),insert(e,n,i),mount_component(o,e,i),r=!0},p(e,n){const o={};24&n&&(o.disabled=!checkDescriptionExpression(e[3]?.columns,e[4])),t.$set(o)},i(e){r||(transition_in(t.$$.fragment,e),transition_in(o.$$.fragment,e),r=!0)},o(e){transition_out(t.$$.fragment,e),transition_out(o.$$.fragment,e),r=!1},d(e){destroy_component(t,e),e&&detach(n),destroy_component(o,e)}}}function create_default_slot$1X(e){let t,n;const o=[e[10]];let r={$$slots:{footer:[create_footer_slot$y],header:[create_header_slot$A],default:[create_default_slot_1$1l]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=1024&n?get_spread_update(o,[get_spread_object(e[10])]):{};8388639&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5f(e){let t,n;return t=new FormProviderCore({props:{values:e[9],$$slots:{default:[create_default_slot$1X]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};8389663&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$5a(e,t,n){let o,r,i,a,s;const c=["conid","database","pureName","schemaName","onConfirm"];let l,u,d,p,m,f,h=compute_rest_props(t,c),g=noop$2,$=noop$2,b=noop$2,y=noop$2;component_subscribe(e,currentDatabase,(e=>n(16,p=e))),e.$$.on_destroy.push((()=>g())),e.$$.on_destroy.push((()=>$())),e.$$.on_destroy.push((()=>b())),e.$$.on_destroy.push((()=>y()));let{conid:v}=t,{database:x}=t,{pureName:w}=t,{schemaName:C}=t,{onConfirm:k}=t;const S=writable({targetApplication:"#new"});component_subscribe(e,S,(e=>n(3,l=e)));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(10,h=compute_rest_props(t,c)),"conid"in e&&n(0,v=e.conid),"database"in e&&n(1,x=e.database),"pureName"in e&&n(11,w=e.pureName),"schemaName"in e&&n(12,C=e.schemaName),"onConfirm"in e&&n(2,k=e.onConfirm)},e.$$.update=()=>{if(6147&e.$$.dirty&&(n(8,o=useTableInfo({conid:v,database:x,schemaName:C,pureName:w})),y(),y=subscribe(o,(e=>n(4,f=e)))),163859&e.$$.dirty&&n(13,s=getDictionaryDescription(f,v,x,d,m,!0)),8192&e.$$.dirty&&s&&function(e){set_store_value(S,l={targetApplication:l.targetApplication,columns:e.expression,delimiter:e.delimiter},l)}(s),114696&e.$$.dirty&&"#new"==l.targetApplication&&p){const e=filterAppsForDatabase(p.connection,p.name,d||[]),t=_.intersection((u||[]).map((e=>e.name)),e.map((e=>e.name)));t.length>0&&set_store_value(S,l=Object.assign(Object.assign({},l),{targetApplication:t[0]}),l)}},n(7,r=useUsedApps()),$(),$=subscribe(r,(e=>n(15,d=e))),n(6,i=useAppFolders()),g(),g=subscribe(i,(e=>n(14,u=e))),n(5,a=useConnectionList()),b(),b=subscribe(a,(e=>n(17,m=e))),[v,x,k,l,f,a,i,r,o,S,h,w,C,s,u,d,p,m,()=>{closeCurrentModal(),saveDictionaryDescription(f,v,x,l.columns,l.delimiter,l.targetApplication),k()},(e,t)=>t.columnName==e.columnName,(e,t)=>{set_store_value(S,l={...l,columns:changeDelimitedColumnList(l.columns,e.columnName,t.target.checked)},l)}]}class DefineDictionaryDescriptionModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$5a,create_fragment$5f,safe_not_equal,{conid:0,database:1,pureName:11,schemaName:12,onConfirm:2})}}function get_each_context$P(e,t,n){const o=e.slice();return o[29]=t[n],o[31]=n,o}function get_each_context_1$8(e,t,n){const o=e.slice();return o[32]=t[n],o}const get__7_slot_changes_1=e=>({row:4&e[0]}),get__7_slot_context_1=e=>({row:e[29],index:e[31]}),get__6_slot_changes_1=e=>({row:4&e[0]}),get__6_slot_context_1=e=>({row:e[29],index:e[31]}),get__5_slot_changes_1=e=>({row:4&e[0]}),get__5_slot_context_1=e=>({row:e[29],index:e[31]}),get__4_slot_changes_1=e=>({row:4&e[0]}),get__4_slot_context_1=e=>({row:e[29],index:e[31]}),get__3_slot_changes_1=e=>({row:4&e[0]}),get__3_slot_context_1=e=>({row:e[29],index:e[31]}),get__2_slot_changes_1=e=>({row:4&e[0]}),get__2_slot_context_1=e=>({row:e[29],index:e[31]}),get__1_slot_changes_3=e=>({row:4&e[0]}),get__1_slot_context_3=e=>({row:e[29],index:e[31]}),get__0_slot_changes_1=e=>({row:4&e[0]}),get__0_slot_context_1=e=>({row:e[29],index:e[31]}),get__1_slot_changes_2=e=>({row:4&e[0]}),get__1_slot_context_2=e=>({row:e[29],index:e[31]});function get_each_context_2$3(e,t,n){const o=e.slice();return o[32]=t[n],o}const get__7_slot_changes$3=e=>({}),get__7_slot_context$3=e=>({}),get__6_slot_changes$3=e=>({}),get__6_slot_context$3=e=>({}),get__5_slot_changes$3=e=>({}),get__5_slot_context$3=e=>({}),get__4_slot_changes$3=e=>({}),get__4_slot_context$3=e=>({}),get__3_slot_changes$3=e=>({}),get__3_slot_context$3=e=>({}),get__2_slot_changes$3=e=>({}),get__2_slot_context$3=e=>({}),get__1_slot_changes_1=e=>({}),get__1_slot_context_1=e=>({}),get__0_slot_changes$3=e=>({}),get__0_slot_context$3=e=>({}),get__1_slot_changes$3=e=>({}),get__1_slot_context$3=e=>({});function create_else_block_1$d(e){let t,n=(e[32].header||"")+"";return{c(){t=text$1(n)},m(e,n){insert(e,t,n)},p(e,o){4096&o[0]&&n!==(n=(e[32].header||"")+"")&&set_data(t,n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_if_block_13$5(e){let t,n,o,r;const i=[create_if_block_14$4,create_if_block_15$4,create_if_block_16$4,create_if_block_17$4,create_if_block_18$4,create_if_block_19$3,create_if_block_20$2,create_if_block_21$1,create_if_block_22$1],a=[];function s(e,t){return-1==e[32].headerSlot?0:0==e[32].headerSlot?1:1==e[32].headerSlot?2:2==e[32].headerSlot?3:3==e[32].headerSlot?4:4==e[32].headerSlot?5:5==e[32].headerSlot?6:6==e[32].headerSlot?7:7==e[32].headerSlot?8:-1}return~(t=s(e))&&(n=a[t]=i[t](e)),{c(){n&&n.c(),o=empty()},m(e,n){~t&&a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?~t&&a[t].p(e,r):(n&&(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros()),~t?(n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){~t&&a[t].d(e),e&&detach(o)}}}function create_if_block_22$1(e){let t;const n=e[18][7],o=create_slot(n,e,e[17],get__7_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__7_slot_changes$3):get_all_dirty_from_scope(e[17]),get__7_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_21$1(e){let t;const n=e[18][6],o=create_slot(n,e,e[17],get__6_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__6_slot_changes$3):get_all_dirty_from_scope(e[17]),get__6_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_20$2(e){let t;const n=e[18][5],o=create_slot(n,e,e[17],get__5_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__5_slot_changes$3):get_all_dirty_from_scope(e[17]),get__5_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_19$3(e){let t;const n=e[18][4],o=create_slot(n,e,e[17],get__4_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__4_slot_changes$3):get_all_dirty_from_scope(e[17]),get__4_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_18$4(e){let t;const n=e[18][3],o=create_slot(n,e,e[17],get__3_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__3_slot_changes$3):get_all_dirty_from_scope(e[17]),get__3_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_17$4(e){let t;const n=e[18][2],o=create_slot(n,e,e[17],get__2_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__2_slot_changes$3):get_all_dirty_from_scope(e[17]),get__2_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_16$4(e){let t;const n=e[18][1],o=create_slot(n,e,e[17],get__1_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__1_slot_changes_1):get_all_dirty_from_scope(e[17]),get__1_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_15$4(e){let t;const n=e[18][0],o=create_slot(n,e,e[17],get__0_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__0_slot_changes$3):get_all_dirty_from_scope(e[17]),get__0_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_14$4(e){let t;const n=e[18][-1],o=create_slot(n,e,e[17],get__1_slot_context$3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131072&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__1_slot_changes$3):get_all_dirty_from_scope(e[17]),get__1_slot_context$3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_each_block_2$3(e){let t,n,o,r,i,a;const s=[create_if_block_13$5,create_else_block_1$d],c=[];function l(e,t){return null!=e[32].headerSlot?0:1}return n=l(e),o=c[n]=s[n](e),{c(){t=element("td"),o.c(),r=space(),attr(t,"style",i=e[32].width?`width: ${e[32].width}`:void 0),attr(t,"class","svelte-31dxoi")},m(e,o){insert(e,t,o),c[n].m(t,null),append(t,r),a=!0},p(e,u){let d=n;n=l(e),n===d?c[n].p(e,u):(group_outros(),transition_out(c[d],1,1,(()=>{c[d]=null})),check_outros(),o=c[n],o?o.p(e,u):(o=c[n]=s[n](e),o.c()),transition_in(o,1),o.m(t,r)),(!a||4096&u[0]&&i!==(i=e[32].width?`width: ${e[32].width}`:void 0))&&attr(t,"style",i)},i(e){a||(transition_in(o),a=!0)},o(e){transition_out(o),a=!1},d(e){e&&detach(t),c[n].d()}}}function create_else_block$$(e){let t,n=(e[29][e[32].fieldName]||"")+"";return{c(){t=text$1(n)},m(e,n){insert(e,t,n)},p(e,o){4100&o[0]&&n!==(n=(e[29][e[32].fieldName]||"")+"")&&set_data(t,n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_if_block_3$H(e){let t,n,o,r;const i=[create_if_block_4$y,create_if_block_5$r,create_if_block_6$l,create_if_block_7$f,create_if_block_8$d,create_if_block_9$b,create_if_block_10$a,create_if_block_11$9,create_if_block_12$6],a=[];function s(e,t){return-1==e[32].slot?0:0==e[32].slot?1:1==e[32].slot?2:2==e[32].slot?3:3==e[32].slot?4:4==e[32].slot?5:5==e[32].slot?6:6==e[32].slot?7:7==e[32].slot?8:-1}return~(t=s(e))&&(n=a[t]=i[t](e)),{c(){n&&n.c(),o=empty()},m(e,n){~t&&a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?~t&&a[t].p(e,r):(n&&(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros()),~t?(n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){~t&&a[t].d(e),e&&detach(o)}}}function create_if_block_2$X(e){let t,n=e[32].formatter(e[29])+"";return{c(){t=text$1(n)},m(e,n){insert(e,t,n)},p(e,o){4100&o[0]&&n!==(n=e[32].formatter(e[29])+"")&&set_data(t,n)},i:noop$2,o:noop$2,d(e){e&&detach(t)}}}function create_if_block_1$1j(e){let t,n,o;const r=[e[32].getProps(e[29])];var i=e[32].component;function a(e){let t={};for(let e=0;e<r.length;e+=1)t=assign(t,r[e]);return{props:t}}return i&&(t=construct_svelte_component(i,a())),{c(){t&&create_component(t.$$.fragment),n=empty()},m(e,r){t&&mount_component(t,e,r),insert(e,n,r),o=!0},p(e,o){const s=4100&o[0]?get_spread_update(r,[get_spread_object(e[32].getProps(e[29]))]):{};if(4096&o[0]&&i!==(i=e[32].component)){if(t){group_outros();const e=t;transition_out(e.$$.fragment,1,0,(()=>{destroy_component(e,1)})),check_outros()}i?(t=construct_svelte_component(i,a()),create_component(t.$$.fragment),transition_in(t.$$.fragment,1),mount_component(t,n.parentNode,n)):t=null}else i&&t.$set(s)},i(e){o||(t&&transition_in(t.$$.fragment,e),o=!0)},o(e){t&&transition_out(t.$$.fragment,e),o=!1},d(e){e&&detach(n),t&&destroy_component(t,e)}}}function create_if_block_12$6(e){let t;const n=e[18][7],o=create_slot(n,e,e[17],get__7_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__7_slot_changes_1):get_all_dirty_from_scope(e[17]),get__7_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_11$9(e){let t;const n=e[18][6],o=create_slot(n,e,e[17],get__6_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__6_slot_changes_1):get_all_dirty_from_scope(e[17]),get__6_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_10$a(e){let t;const n=e[18][5],o=create_slot(n,e,e[17],get__5_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__5_slot_changes_1):get_all_dirty_from_scope(e[17]),get__5_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_9$b(e){let t;const n=e[18][4],o=create_slot(n,e,e[17],get__4_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__4_slot_changes_1):get_all_dirty_from_scope(e[17]),get__4_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_8$d(e){let t;const n=e[18][3],o=create_slot(n,e,e[17],get__3_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__3_slot_changes_1):get_all_dirty_from_scope(e[17]),get__3_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_7$f(e){let t;const n=e[18][2],o=create_slot(n,e,e[17],get__2_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__2_slot_changes_1):get_all_dirty_from_scope(e[17]),get__2_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_6$l(e){let t;const n=e[18][1],o=create_slot(n,e,e[17],get__1_slot_context_3);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__1_slot_changes_3):get_all_dirty_from_scope(e[17]),get__1_slot_context_3)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_5$r(e){let t;const n=e[18][0],o=create_slot(n,e,e[17],get__0_slot_context_1);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__0_slot_changes_1):get_all_dirty_from_scope(e[17]),get__0_slot_context_1)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_if_block_4$y(e){let t;const n=e[18][-1],o=create_slot(n,e,e[17],get__1_slot_context_2);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,r){o&&o.p&&(!t||131076&r[0])&&update_slot_base(o,n,e,e[17],t?get_slot_changes(n,e[17],r,get__1_slot_changes_2):get_all_dirty_from_scope(e[17]),get__1_slot_context_2)},i(e){t||(transition_in(o,e),t=!0)},o(e){transition_out(o,e),t=!1},d(e){o&&o.d(e)}}}function create_each_block_1$8(e){let t,n,o,r,i,a;const s=[create_if_block_1$1j,create_if_block_2$X,create_if_block_3$H,create_else_block$$],c=[];function l(e,t){return e[32].component?0:e[32].formatter?1:null!=e[32].slot?2:3}return n=l(e),o=c[n]=s[n](e),{c(){t=element("td"),o.c(),attr(t,"style",r=e[32].width?`width: ${e[32].width}`:void 0),attr(t,"data-testid",i=e[32].testid?e[32].testid(e[29]):void 0),attr(t,"class","svelte-31dxoi"),toggle_class(t,"isHighlighted",e[32].isHighlighted&&e[32].isHighlighted(e[29]))},m(e,o){insert(e,t,o),c[n].m(t,null),a=!0},p(e,u){let d=n;n=l(e),n===d?c[n].p(e,u):(group_outros(),transition_out(c[d],1,1,(()=>{c[d]=null})),check_outros(),o=c[n],o?o.p(e,u):(o=c[n]=s[n](e),o.c()),transition_in(o,1),o.m(t,null)),(!a||4096&u[0]&&r!==(r=e[32].width?`width: ${e[32].width}`:void 0))&&attr(t,"style",r),(!a||4100&u[0]&&i!==(i=e[32].testid?e[32].testid(e[29]):void 0))&&attr(t,"data-testid",i),(!a||4100&u[0])&&toggle_class(t,"isHighlighted",e[32].isHighlighted&&e[32].isHighlighted(e[29]))},i(e){a||(transition_in(o),a=!0)},o(e){transition_out(o),a=!1},d(e){e&&detach(t),c[n].d()}}}function create_each_block$P(e){let t,n,o,r,i=e[12],a=[];for(let t=0;t<i.length;t+=1)a[t]=create_each_block_1$8(get_each_context_1$8(e,i,t));const s=e=>transition_out(a[e],1,1,(()=>{a[e]=null}));function c(){return e[21](e[31],e[29])}return{c(){t=element("tr");for(let e=0;e<a.length;e+=1)a[e].c();attr(t,"class","svelte-31dxoi"),toggle_class(t,"selected",e[3]&&e[0]==e[31]),toggle_class(t,"clickable",e[4]),toggle_class(t,"isAdded",e[29].__isAdded),toggle_class(t,"isDeleted",e[29].__isDeleted),toggle_class(t,"isChanged",e[29].__isChanged)},m(e,i){insert(e,t,i);for(let e=0;e<a.length;e+=1)a[e]&&a[e].m(t,null);n=!0,o||(r=listen(t,"click",c),o=!0)},p(o,r){if(e=o,135172&r[0]){let n;for(i=e[12],n=0;n<i.length;n+=1){const o=get_each_context_1$8(e,i,n);a[n]?(a[n].p(o,r),transition_in(a[n],1)):(a[n]=create_each_block_1$8(o),a[n].c(),transition_in(a[n],1),a[n].m(t,null))}for(group_outros(),n=i.length;n<a.length;n+=1)s(n);check_outros()}(!n||9&r[0])&&toggle_class(t,"selected",e[3]&&e[0]==e[31]),(!n||16&r[0])&&toggle_class(t,"clickable",e[4]),(!n||4&r[0])&&toggle_class(t,"isAdded",e[29].__isAdded),(!n||4&r[0])&&toggle_class(t,"isDeleted",e[29].__isDeleted),(!n||4&r[0])&&toggle_class(t,"isChanged",e[29].__isChanged)},i(e){if(!n){for(let e=0;e<i.length;e+=1)transition_in(a[e]);n=!0}},o(e){a=a.filter(Boolean);for(let e=0;e<a.length;e+=1)transition_out(a[e]);n=!1},d(e){e&&detach(t),destroy_each(a,e),o=!1,r()}}}function create_if_block$2d(e){let t,n=e[2],o=create_key_block$f(e);return{c(){o.c(),t=empty()},m(e,n){o.m(e,n),insert(e,t,n)},p(e,r){4&r[0]&&safe_not_equal(n,n=e[2])?(o.d(1),o=create_key_block$f(e),o.c(),o.m(t.parentNode,t)):o.p(e,r)},d(e){e&&detach(t),o.d(e)}}}function create_key_block$f(e){let t,n,o,r;return{c(){t=element("tr"),n=element("td"),o=text$1("Loading next rows..."),attr(n,"colspan",r=e[12].length),attr(n,"class","svelte-31dxoi"),attr(t,"class","svelte-31dxoi")},m(r,i){insert(r,t,i),append(t,n),append(n,o),e[22](n)},p(e,t){4096&t[0]&&r!==(r=e[12].length)&&attr(n,"colspan",r)},d(n){n&&detach(t),e[22](null)}}}function create_fragment$5e(e){let t,n,o,r,i,a,s,c,l,u,d,p,m=e[12],f=[];for(let t=0;t<m.length;t+=1)f[t]=create_each_block_2$3(get_each_context_2$3(e,m,t));const h=e=>transition_out(f[e],1,1,(()=>{f[e]=null}));let g=e[2],_=[];for(let t=0;t<g.length;t+=1)_[t]=create_each_block$P(get_each_context$P(e,g,t));const $=e=>transition_out(_[e],1,1,(()=>{_[e]=null}));let b=e[6]&&create_if_block$2d(e);return{c(){t=element("div"),n=element("table"),o=element("thead"),r=element("tr");for(let e=0;e<f.length;e+=1)f[e].c();i=space(),a=element("tbody");for(let e=0;e<_.length;e+=1)_[e].c();s=space(),b&&b.c(),attr(r,"class","svelte-31dxoi"),attr(o,"class","svelte-31dxoi"),attr(a,"style",c=`max-height: ${e[9]-e[10]}px`),attr(a,"class","svelte-31dxoi"),attr(n,"tabindex",l=e[3]?-1:void 0),attr(n,"class","svelte-31dxoi"),toggle_class(n,"selectable",e[3]),toggle_class(n,"disableFocusOutline",e[5]),toggle_class(n,"singleLineRow",e[7]),attr(t,"class","wrapper svelte-31dxoi")},m(c,l){insert(c,t,l),append(t,n),append(n,o),append(o,r);for(let e=0;e<f.length;e+=1)f[e]&&f[e].m(r,null);append(n,i),append(n,a);for(let e=0;e<_.length;e+=1)_[e]&&_[e].m(a,null);append(a,s),b&&b.m(a,null),e[23](a),e[24](n),u=!0,d||(p=[action_destroyer(resizeObserver.call(null,o,!0)),listen(o,"resize",e[20]),listen(n,"keydown",e[19]),listen(n,"keydown",e[14]),action_destroyer(resizeObserver.call(null,t,!0)),listen(t,"resize",e[25])],d=!0)},p(e,t){if(135168&t[0]){let n;for(m=e[12],n=0;n<m.length;n+=1){const o=get_each_context_2$3(e,m,n);f[n]?(f[n].p(o,t),transition_in(f[n],1)):(f[n]=create_each_block_2$3(o),f[n].c(),transition_in(f[n],1),f[n].m(r,null))}for(group_outros(),n=m.length;n<f.length;n+=1)h(n);check_outros()}if(143391&t[0]){let n;for(g=e[2],n=0;n<g.length;n+=1){const o=get_each_context$P(e,g,n);_[n]?(_[n].p(o,t),transition_in(_[n],1)):(_[n]=create_each_block$P(o),_[n].c(),transition_in(_[n],1),_[n].m(a,s))}for(group_outros(),n=g.length;n<_.length;n+=1)$(n);check_outros()}e[6]?b?b.p(e,t):(b=create_if_block$2d(e),b.c(),b.m(a,null)):b&&(b.d(1),b=null),(!u||1536&t[0]&&c!==(c=`max-height: ${e[9]-e[10]}px`))&&attr(a,"style",c),(!u||8&t[0]&&l!==(l=e[3]?-1:void 0))&&attr(n,"tabindex",l),(!u||8&t[0])&&toggle_class(n,"selectable",e[3]),(!u||32&t[0])&&toggle_class(n,"disableFocusOutline",e[5]),(!u||128&t[0])&&toggle_class(n,"singleLineRow",e[7])},i(e){if(!u){for(let e=0;e<m.length;e+=1)transition_in(f[e]);for(let e=0;e<g.length;e+=1)transition_in(_[e]);u=!0}},o(e){f=f.filter(Boolean);for(let e=0;e<f.length;e+=1)transition_out(f[e]);_=_.filter(Boolean);for(let e=0;e<_.length;e+=1)transition_out(_[e]);u=!1},d(n){n&&detach(t),destroy_each(f,n),destroy_each(_,n),b&&b.d(),e[23](null),e[24](null),d=!1,run_all(p)}}}function instance$59(e,t,n){let o,r,i,a,{$$slots:s={},$$scope:c}=t,{columns:l}=t,{rows:u}=t,{focusOnCreate:d=!1}=t,{selectable:p=!1}=t,{selectedIndex:m=0}=t,{clickable:f=!1}=t,{disableFocusOutline:h=!1}=t,{onLoadNext:g=null}=t,{singleLineRow:$=!1}=t,{domTable:b}=t,y=0,v=0;onDestroy((()=>{a&&a.disconnect()}));const x=createEventDispatcher();onMount((()=>{d&&b.focus()}));return e.$$set=e=>{"columns"in e&&n(15,l=e.columns),"rows"in e&&n(2,u=e.rows),"focusOnCreate"in e&&n(16,d=e.focusOnCreate),"selectable"in e&&n(3,p=e.selectable),"selectedIndex"in e&&n(0,m=e.selectedIndex),"clickable"in e&&n(4,f=e.clickable),"disableFocusOutline"in e&&n(5,h=e.disableFocusOutline),"onLoadNext"in e&&n(6,g=e.onLoadNext),"singleLineRow"in e&&n(7,$=e.singleLineRow),"domTable"in e&&n(1,b=e.domTable),"$$scope"in e&&n(17,c=e.$$scope)},e.$$.update=()=>{var t;256&e.$$.dirty[0]&&(t=i,a&&(a.disconnect(),a=null),t&&(a=new IntersectionObserver((e=>{e.find((e=>e.isIntersecting))&&g()})),a.observe(t))),32768&e.$$.dirty[0]&&n(12,o=_.compact(_.flatten(l))),1&e.$$.dirty[0]&&function(e){if(!r)return;const t=r.children[e];t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}(m)},[m,b,u,p,f,h,g,$,i,y,v,r,o,x,e=>{e.keyCode==keycodes.downArrow&&n(0,m=Math.min(m+1,u.length-1)),e.keyCode==keycodes.upArrow&&n(0,m=Math.max(0,m-1)),e.keyCode==keycodes.pageUp&&(n(0,m-=Math.floor(y/v)-1),m<0&&n(0,m=0)),e.keyCode==keycodes.pageDown&&(n(0,m+=Math.floor(y/v)-1),m>=u.length&&n(0,m=u.length-1)),e.keyCode==keycodes.home&&n(0,m=0),e.keyCode==keycodes.end&&n(0,m=u.length-1)},l,d,c,s,function(t){bubble.call(this,e,t)},e=>{n(10,v=e.detail.height)},(e,t)=>{p&&(n(0,m=e),b.focus()),f&&x("clickrow",t)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{i=e,n(8,i)}))},function(e){binding_callbacks[e?"unshift":"push"]((()=>{r=e,n(11,r)}))},function(e){binding_callbacks[e?"unshift":"push"]((()=>{b=e,n(1,b)}))},e=>{n(9,y=e.detail.height)}]}class ScrollableTableControl extends SvelteComponent{constructor(e){super(),init(this,e,instance$59,create_fragment$5e,safe_not_equal,{columns:15,rows:2,focusOnCreate:16,selectable:3,selectedIndex:0,clickable:4,disableFocusOutline:5,onLoadNext:6,singleLineRow:7,domTable:1},null,[-1,-1])}}function create_fragment$5d(e){let t,n,o,r;return{c(){t=element("input"),attr(t,"type","text"),attr(t,"placeholder",e[1]),t.value=e[5],attr(t,"data-testid",n=e[8]["data-testid"]),attr(t,"class","svelte-nsxrdb")},m(n,i){insert(n,t,i),e[12](t),o||(r=[listen(t,"input",e[11]),listen(t,"keydown",e[6]),listen(t,"focus",e[13])],o=!0)},p(e,[o]){2&o&&attr(t,"placeholder",e[1]),32&o&&t.value!==e[5]&&(t.value=e[5]),256&o&&n!==(n=e[8]["data-testid"])&&attr(t,"data-testid",n)},i:noop$2,o:noop$2,d(n){n&&detach(t),e[12](null),o=!1,run_all(r)}}}function instance$58(e,t,n){let o,r,{placeholder:i}=t,{value:a}=t,{isDebounced:s=!1}=t,{onFocusFilteredList:c=null}=t,{onChange:l=null}=t;const u=_.debounce((e=>n(0,a=e)),500);return e.$$set=e=>{n(8,t=assign(assign({},t),exclude_internal_props(e))),"placeholder"in e&&n(1,i=e.placeholder),"value"in e&&n(0,a=e.value),"isDebounced"in e&&n(2,s=e.isDebounced),"onFocusFilteredList"in e&&n(9,c=e.onFocusFilteredList),"onChange"in e&&n(3,l=e.onChange)},e.$$.update=()=>{1&e.$$.dirty&&n(5,o=a||"")},t=exclude_internal_props(t),[a,i,s,l,r,o,function(e){e.keyCode==keycodes.escape&&(l?l(""):n(0,a="")),e.keyCode!=keycodes.downArrow&&e.keyCode!=keycodes.pageDown&&e.keyCode!=keycodes.enter||(null==c||c(),e.preventDefault())},u,t,c,function(e){r.focus(),e&&(n(4,r.value=e,r),l?l(e):n(0,a=e))},e=>{l?l(r.value):s?u(r.value):n(0,a=r.value)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},e=>r.select()]}class SearchInput extends SvelteComponent{constructor(e){super(),init(this,e,instance$58,create_fragment$5d,safe_not_equal,{placeholder:1,value:0,isDebounced:2,onFocusFilteredList:9,onChange:3,focus:10})}get focus(){return this.$$.ctx[10]}}function create_if_block_2$W(e){let t,n;return t=new LoadingInfo({props:{message:"Loading data"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_1$1i(e){let t,n,o;return n=new ScrollableTableControl({props:{rows:e[4],clickable:!0,columns:[e[2]&&{fieldName:"checked",header:"",width:"30px",slot:1},{fieldName:"value",header:"Value",formatter:e[23],width:"100px"},{fieldName:"description",header:"Description",formatter:e[24]}],$$slots:{1:[create__1_slot$n,({row:e})=>({28:e}),({row:e})=>e?268435456:0]},$$scope:{ctx:e}}}),n.$on("clickrow",e[25]),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","tableWrapper svelte-1ae830f")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p(e,t){const o={};16&t&&(o.rows=e[4]),100&t&&(o.columns=[e[2]&&{fieldName:"checked",header:"",width:"30px",slot:1},{fieldName:"value",header:"Value",formatter:e[23],width:"100px"},{fieldName:"description",header:"Description",formatter:e[24]}]),805306656&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create__1_slot$n(e){let t,n,o,r;function i(...t){return e[22](e[28],...t)}return{c(){t=element("input"),attr(t,"type","checkbox"),attr(t,"slot","1"),t.checked=n=e[8].includes(e[28][e[5].primaryKey.columns[0].columnName])},m(e,n){insert(e,t,n),o||(r=listen(t,"change",i),o=!0)},p(o,r){e=o,268435744&r&&n!==(n=e[8].includes(e[28][e[5].primaryKey.columns[0].columnName]))&&(t.checked=n)},d(e){e&&detach(t),o=!1,r()}}}function create_default_slot_1$1k(e){let t,n,o,r,i,a,s;function c(t){e[21](t)}let l={placeholder:"Search",isDebounced:!0};void 0!==e[3]&&(l.value=e[3]),n=new SearchInput({props:l}),binding_callbacks.push((()=>bind$2(n,"value",c)));let u=e[7]&&create_if_block_2$W(),d=!e[7]&&e[5]&&e[6]&&e[4]&&1==e[5]?.primaryKey?.columns?.length&&create_if_block_1$1i(e);return{c(){t=element("div"),create_component(n.$$.fragment),r=space(),u&&u.c(),i=space(),d&&d.c(),a=empty(),attr(t,"class","largeFormMarker")},m(e,o){insert(e,t,o),mount_component(n,t,null),insert(e,r,o),u&&u.m(e,o),insert(e,i,o),d&&d.m(e,o),insert(e,a,o),s=!0},p(e,t){const r={};!o&&8&t&&(o=!0,r.value=e[3],add_flush_callback((()=>o=!1))),n.$set(r),e[7]?u?128&t&&transition_in(u,1):(u=create_if_block_2$W(),u.c(),transition_in(u,1),u.m(i.parentNode,i)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros()),!e[7]&&e[5]&&e[6]&&e[4]&&1==e[5]?.primaryKey?.columns?.length?d?(d.p(e,t),240&t&&transition_in(d,1)):(d=create_if_block_1$1i(e),d.c(),transition_in(d,1),d.m(a.parentNode,a)):d&&(group_outros(),transition_out(d,1,1,(()=>{d=null})),check_outros())},i(e){s||(transition_in(n.$$.fragment,e),transition_in(u),transition_in(d),s=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(u),transition_out(d),s=!1},d(e){e&&detach(t),destroy_component(n),e&&detach(r),u&&u.d(e),e&&detach(i),d&&d.d(e),e&&detach(a)}}}function create_header_slot$z(e){let t,n;return{c(){t=text$1("Lookup from "),n=text$1(e[1])},m(e,o){insert(e,t,o),insert(e,n,o)},p(e,t){2&t&&set_data(n,e[1])},d(e){e&&detach(t),e&&detach(n)}}}function create_if_block$2c(e){let t,n;return t=new FormSubmit({props:{value:"OK"}}),t.$on("click",e[20]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_footer_slot$x(e){let t,n,o,r,i,a=e[2]&&create_if_block$2c(e);return n=new FormStyledButton({props:{type:"button",value:"Close"}}),n.$on("click",closeCurrentModal),r=new FormStyledButton({props:{type:"button",value:"Customize"}}),r.$on("click",e[11]),{c(){a&&a.c(),t=space(),create_component(n.$$.fragment),o=space(),create_component(r.$$.fragment)},m(e,s){a&&a.m(e,s),insert(e,t,s),mount_component(n,e,s),insert(e,o,s),mount_component(r,e,s),i=!0},p(e,n){e[2]?a?(a.p(e,n),4&n&&transition_in(a,1)):(a=create_if_block$2c(e),a.c(),transition_in(a,1),a.m(t.parentNode,t)):a&&(group_outros(),transition_out(a,1,1,(()=>{a=null})),check_outros())},i(e){i||(transition_in(a),transition_in(n.$$.fragment,e),transition_in(r.$$.fragment,e),i=!0)},o(e){transition_out(a),transition_out(n.$$.fragment,e),transition_out(r.$$.fragment,e),i=!1},d(e){a&&a.d(e),e&&detach(t),destroy_component(n,e),e&&detach(o),destroy_component(r,e)}}}function create_default_slot$1W(e){let t,n;const o=[e[12]];let r={$$slots:{footer:[create_footer_slot$x],header:[create_header_slot$z],default:[create_default_slot_1$1k]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=4096&n?get_spread_update(o,[get_spread_object(e[12])]):{};536871423&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5c(e){let t,n;return t=new FormProvider({props:{$$slots:{default:[create_default_slot$1W]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};536875519&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function instance$57(e,t,n){let o,r;const i=["onConfirm","conid","database","pureName","schemaName","driver","multiselect","dataType"];let a,s,c=compute_rest_props(t,i),l=noop$2,u=noop$2;e.$$.on_destroy.push((()=>l())),e.$$.on_destroy.push((()=>u()));var d=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let p,m,{onConfirm:f}=t,{conid:h}=t,{database:g}=t,{pureName:$}=t,{schemaName:b}=t,{driver:y}=t,{multiselect:v=!1}=t,{dataType:x}=t,w=null,C=!1,k="",S=[];function T(){var e,t;return d(this,void 0,void 0,(function*(){if(n(5,p=yield getTableInfo({conid:h,database:g,schemaName:b,pureName:$})),n(6,m=getDictionaryDescription(p,h,g,s,a)),!p||!m)return;if(1!=(null===(t=null===(e=null==p?void 0:p.primaryKey)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.length))return;y.createDumper();const o={commandType:"select",topRecords:100,from:{name:{schemaName:b,pureName:$}},columns:[...p.primaryKey.columns.map((e=>({exprType:"column",columnName:e.columnName}))),...m.columns.map((e=>({exprType:"column",columnName:e})))]};if(k){const e=_.compact(k.split(" ").map((e=>e.trim())));e.length>0&&(o.where={conditionType:"and",conditions:e.map((e=>({conditionType:"or",conditions:m.columns.map((t=>({conditionType:"like",left:{exprType:"column",columnName:t},right:{exprType:"value",value:`%${e}%`}})))})))})}n(7,C=!0);const r=yield apiCall("database-connections/sql-select",{conid:h,database:g,select:o});n(4,w=r.rows),n(7,C=!1)}))}onMount((()=>{T()}));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(12,c=compute_rest_props(t,i)),"onConfirm"in e&&n(0,f=e.onConfirm),"conid"in e&&n(13,h=e.conid),"database"in e&&n(14,g=e.database),"pureName"in e&&n(1,$=e.pureName),"schemaName"in e&&n(15,b=e.schemaName),"driver"in e&&n(16,y=e.driver),"multiselect"in e&&n(2,v=e.multiselect),"dataType"in e&&n(17,x=e.dataType)},e.$$.update=()=>{786440&e.$$.dirty&&T()},n(10,o=useUsedApps()),u(),u=subscribe(o,(e=>n(19,s=e))),n(9,r=useConnectionList()),l(),l=subscribe(r,(e=>n(18,a=e))),[f,$,v,k,w,p,m,C,S,r,o,function(){showModal(DefineDictionaryDescriptionModal,{conid:h,database:g,schemaName:b,pureName:$,onConfirm:()=>T()})},c,h,g,b,y,x,a,s,()=>{closeCurrentModal(),f(S)},function(e){k=e,n(3,k)},(e,t)=>{const o=e[p.primaryKey.columns[0].columnName];t.target.checked?S.includes(o)||n(8,S=[...S,o]):S.includes(o)&&n(8,S=S.filter((e=>e!=o))),t.stopPropagation()},e=>e[p.primaryKey.columns[0].columnName],e=>m.columns.map((t=>e[t])).join(m.delimiter||" "),e=>{const t=e.detail[p.primaryKey.columns[0].columnName];v?S.includes(t)?n(8,S=S.filter((e=>e!=t))):n(8,S=[...S,t]):(closeCurrentModal(),f(t))}]}class DictionaryLookupModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$57,create_fragment$5c,safe_not_equal,{onConfirm:0,conid:13,database:14,pureName:1,schemaName:15,driver:16,multiselect:2,dataType:17})}}function create_else_block$_(e){let t,n,o,r,i,a,s=(e[0]||"Unknown error")+"";return o=new FontIcon({props:{icon:e[1]}}),{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=text$1(s),attr(n,"class","icon svelte-19h1t3d"),attr(t,"class","container svelte-19h1t3d")},m(e,s){insert(e,t,s),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),a=!0},p(e,t){const n={};2&t&&(n.icon=e[1]),o.$set(n),(!a||1&t)&&s!==(s=(e[0]||"Unknown error")+"")&&set_data(i,s)},i(e){a||(transition_in(o.$$.fragment,e),a=!0)},o(e){transition_out(o.$$.fragment,e),a=!1},d(e){e&&detach(t),destroy_component(o)}}}function create_if_block_1$1h(e){let t,n,o,r,i,a,s,c=(e[0]||"Unknown error")+"";return r=new FontIcon({props:{icon:e[1]}}),{c(){t=element("div"),n=element("div"),o=element("div"),create_component(r.$$.fragment),i=space(),a=text$1(c),attr(o,"class","icon svelte-19h1t3d"),attr(n,"class","container svelte-19h1t3d")},m(e,c){insert(e,t,c),append(t,n),append(n,o),mount_component(r,o,null),append(n,i),append(n,a),s=!0},p(e,t){const n={};2&t&&(n.icon=e[1]),r.$set(n),(!s||1&t)&&c!==(c=(e[0]||"Unknown error")+"")&&set_data(a,c)},i(e){s||(transition_in(r.$$.fragment,e),s=!0)},o(e){transition_out(r.$$.fragment,e),s=!1},d(e){e&&detach(t),destroy_component(r)}}}function create_if_block$2b(e){let t,n,o,r,i,a=(e[0]||"Unknown error")+"";return n=new FontIcon({props:{icon:e[1]}}),{c(){t=element("div"),create_component(n.$$.fragment),o=space(),r=text$1(a),attr(t,"class","container-small svelte-19h1t3d")},m(e,a){insert(e,t,a),mount_component(n,t,null),append(t,o),append(t,r),i=!0},p(e,t){const o={};2&t&&(o.icon=e[1]),n.$set(o),(!i||1&t)&&a!==(a=(e[0]||"Unknown error")+"")&&set_data(r,a)},i(e){i||(transition_in(n.$$.fragment,e),i=!0)},o(e){transition_out(n.$$.fragment,e),i=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_fragment$5b(e){let t,n,o,r;const i=[create_if_block$2b,create_if_block_1$1h,create_else_block$_],a=[];function s(e,t){return e[2]?0:e[3]?1:2}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,[r]){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function instance$56(e,t,n){let{message:o}=t,{icon:r="img error"}=t,{isSmall:i=!1}=t,{alignTop:a=!1}=t;return e.$$set=e=>{"message"in e&&n(0,o=e.message),"icon"in e&&n(1,r=e.icon),"isSmall"in e&&n(2,i=e.isSmall),"alignTop"in e&&n(3,a=e.alignTop)},[o,r,i,a]}class ErrorInfo extends SvelteComponent{constructor(e){super(),init(this,e,instance$56,create_fragment$5b,safe_not_equal,{message:0,icon:1,isSmall:2,alignTop:3})}}function create_if_block_3$G(e){let t,n;return t=new LoadingInfo({props:{message:"Loading data"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_1$1g(e){let t,n,o,r;const i=[create_if_block_2$V,create_else_block$Z],a=[];function s(e,t){return e[4].errorMessage?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_else_block$Z(e){let t,n,o;return n=new ScrollableTableControl({props:{rows:e[4],clickable:!0,columns:[e[2]&&{fieldName:"checked",header:"",width:"30px",slot:1},{fieldName:"value",header:"Value",formatter:func$s}],$$slots:{1:[create__1_slot$m,({row:e})=>({22:e}),({row:e})=>e?4194304:0]},$$scope:{ctx:e}}}),n.$on("clickrow",e[19]),{c(){t=element("div"),create_component(n.$$.fragment),attr(t,"class","tableWrapper svelte-1ae830f")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p(e,t){const o={};16&t&&(o.rows=e[4]),4&t&&(o.columns=[e[2]&&{fieldName:"checked",header:"",width:"30px",slot:1},{fieldName:"value",header:"Value",formatter:func$s}]),12582976&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block_2$V(e){let t,n;return t=new ErrorInfo({props:{message:e[4].errorMessage}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};16&n&&(o.message=e[4].errorMessage),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create__1_slot$m(e){let t,n,o,r;function i(...t){return e[18](e[22],...t)}return{c(){t=element("input"),attr(t,"type","checkbox"),attr(t,"slot","1"),t.checked=n=e[6].includes(e[22].value)},m(e,n){insert(e,t,n),o||(r=listen(t,"change",i),o=!0)},p(o,r){e=o,4194368&r&&n!==(n=e[6].includes(e[22].value))&&(t.checked=n)},d(e){e&&detach(t),o=!1,r()}}}function create_default_slot_1$1j(e){let t,n,o,r,i,a,s;function c(t){e[17](t)}let l={placeholder:"Search",isDebounced:!0};void 0!==e[3]&&(l.value=e[3]),n=new SearchInput({props:l}),binding_callbacks.push((()=>bind$2(n,"value",c)));let u=e[5]&&create_if_block_3$G(),d=!e[5]&&e[4]&&create_if_block_1$1g(e);return{c(){t=element("div"),create_component(n.$$.fragment),r=space(),u&&u.c(),i=space(),d&&d.c(),a=empty(),attr(t,"class","largeFormMarker")},m(e,o){insert(e,t,o),mount_component(n,t,null),insert(e,r,o),u&&u.m(e,o),insert(e,i,o),d&&d.m(e,o),insert(e,a,o),s=!0},p(e,t){const r={};!o&&8&t&&(o=!0,r.value=e[3],add_flush_callback((()=>o=!1))),n.$set(r),e[5]?u?32&t&&transition_in(u,1):(u=create_if_block_3$G(),u.c(),transition_in(u,1),u.m(i.parentNode,i)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros()),!e[5]&&e[4]?d?(d.p(e,t),48&t&&transition_in(d,1)):(d=create_if_block_1$1g(e),d.c(),transition_in(d,1),d.m(a.parentNode,a)):d&&(group_outros(),transition_out(d,1,1,(()=>{d=null})),check_outros())},i(e){s||(transition_in(n.$$.fragment,e),transition_in(u),transition_in(d),s=!0)},o(e){transition_out(n.$$.fragment,e),transition_out(u),transition_out(d),s=!1},d(e){e&&detach(t),destroy_component(n),e&&detach(r),u&&u.d(e),e&&detach(i),d&&d.d(e),e&&detach(a)}}}function create_header_slot$y(e){let t,n;return{c(){t=text$1("Choose value from "),n=text$1(e[1])},m(e,o){insert(e,t,o),insert(e,n,o)},p(e,t){2&t&&set_data(n,e[1])},d(e){e&&detach(t),e&&detach(n)}}}function create_if_block$2a(e){let t,n;return t=new FormSubmit({props:{value:"OK"}}),t.$on("click",e[16]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_footer_slot$w(e){let t,n,o,r=e[2]&&create_if_block$2a(e);return n=new FormStyledButton({props:{type:"button",value:"Close"}}),n.$on("click",closeCurrentModal),{c(){r&&r.c(),t=space(),create_component(n.$$.fragment)},m(e,i){r&&r.m(e,i),insert(e,t,i),mount_component(n,e,i),o=!0},p(e,n){e[2]?r?(r.p(e,n),4&n&&transition_in(r,1)):(r=create_if_block$2a(e),r.c(),transition_in(r,1),r.m(t.parentNode,t)):r&&(group_outros(),transition_out(r,1,1,(()=>{r=null})),check_outros())},i(e){o||(transition_in(r),transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(r),transition_out(n.$$.fragment,e),o=!1},d(e){r&&r.d(e),e&&detach(t),destroy_component(n,e)}}}function create_default_slot$1V(e){let t,n;const o=[e[7]];let r={$$slots:{footer:[create_footer_slot$w],header:[create_header_slot$y],default:[create_default_slot_1$1j]},$$scope:{ctx:e}};for(let e=0;e<o.length;e+=1)r=assign(r,o[e]);return t=new ModalBase({props:r}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const r=128&n?get_spread_update(o,[get_spread_object(e[7])]):{};8388735&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$5a(e){let t,n;return t=new FormProvider({props:{$$slots:{default:[create_default_slot$1V]},$$scope:{ctx:e}}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,[n]){const o={};8388863&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}const func$s=e=>null==e.value?"(NULL)":e.value;function instance$55(e,t,n){const o=["onConfirm","conid","database","pureName","schemaName","field","driver","multiselect","jslid","formatterFunction","dataType"];let r=compute_rest_props(t,o);var i=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}c((o=o.apply(e,t||[])).next())}))};let{onConfirm:a}=t,{conid:s}=t,{database:c}=t,{pureName:l}=t,{schemaName:u}=t,{field:d}=t,{driver:p}=t,{multiselect:m=!1}=t,{jslid:f}=t,{formatterFunction:h}=t,{dataType:g}=t,_=null,$=!1,b="",y=[];function v(){return i(this,void 0,void 0,(function*(){n(5,$=!0),n(4,_=f?yield apiCall("jsldata/load-field-values",{jslid:f,search:b,field:d,formatterFunction:h}):yield apiCall("database-connections/load-field-values",{conid:s,database:c,search:b,schemaName:u,pureName:l,field:d,dataType:g})),n(5,$=!1)}))}onMount((()=>{v()}));return e.$$set=e=>{t=assign(assign({},t),exclude_internal_props(e)),n(7,r=compute_rest_props(t,o)),"onConfirm"in e&&n(0,a=e.onConfirm),"conid"in e&&n(8,s=e.conid),"database"in e&&n(9,c=e.database),"pureName"in e&&n(10,l=e.pureName),"schemaName"in e&&n(11,u=e.schemaName),"field"in e&&n(1,d=e.field),"driver"in e&&n(12,p=e.driver),"multiselect"in e&&n(2,m=e.multiselect),"jslid"in e&&n(13,f=e.jslid),"formatterFunction"in e&&n(14,h=e.formatterFunction),"dataType"in e&&n(15,g=e.dataType)},e.$$.update=()=>{8&e.$$.dirty&&v()},[a,d,m,b,_,$,y,r,s,c,l,u,p,f,h,g,()=>{closeCurrentModal(),a(y)},function(e){b=e,n(3,b)},(e,t)=>{const o=e.value;t.target.checked?y.includes(o)||n(6,y=[...y,o]):y.includes(o)&&n(6,y=y.filter((e=>e!=o))),t.stopPropagation()},e=>{const{value:t}=e.detail;m?y.includes(t)?n(6,y=y.filter((e=>e!=t))):n(6,y=[...y,t]):(closeCurrentModal(),a(t))}]}class ValueLookupModal extends SvelteComponent{constructor(e){super(),init(this,e,instance$55,create_fragment$5a,safe_not_equal,{onConfirm:0,conid:8,database:9,pureName:10,schemaName:11,field:1,driver:12,multiselect:2,jslid:13,formatterFunction:14,dataType:15})}}function create_if_block_5$q(e){let t,n;return t=new InlineButton({props:{title:e[9],narrow:!0,square:!0,$$slots:{default:[create_default_slot_3$q]},$$scope:{ctx:e}}}),t.$on("click",(function(){is_function(e[8])&&e[8].apply(this,arguments)})),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(n,o){e=n;const r={};512&o[0]&&(r.title=e[9]),128&o[0]|64&o[1]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot_3$q(e){let t,n;return t=new FontIcon({props:{icon:e[7]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.icon=e[7]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_4$x(e){let t,n;return t=new InlineButton({props:{narrow:!0,square:!0,$$slots:{default:[create_default_slot_2$H]},$$scope:{ctx:e}}}),t.$on("click",e[22]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};64&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_1$1f(e){let t,n,o,r,i,a;const s=[create_if_block_2$U,create_if_block_3$F],c=[];function l(e,o){return 36&o[0]&&(t=null),7200&o[0]&&(n=null),null==t&&(t=!(!e[5]?.databaseEngineTypes?.includes("sql")||!e[2])),t?0:(null==n&&(n=!!(e[10]&&e[11]||e[10]&&e[12]&&e[5]?.databaseEngineTypes?.includes("document"))),n?1:-1)}return~(o=l(e,[-1,-1]))&&(r=c[o]=s[o](e)),{c(){r&&r.c(),i=empty()},m(e,t){~o&&c[o].m(e,t),insert(e,i,t),a=!0},p(e,t){let n=o;o=l(e,t),o===n?~o&&c[o].p(e,t):(r&&(group_outros(),transition_out(c[n],1,1,(()=>{c[n]=null})),check_outros()),~o?(r=c[o],r?r.p(e,t):(r=c[o]=s[o](e),r.c()),transition_in(r,1),r.m(i.parentNode,i)):r=null)},i(e){a||(transition_in(r),a=!0)},o(e){transition_out(r),a=!1},d(e){~o&&c[o].d(e),e&&detach(i)}}}function create_default_slot_2$H(e){let t,n;return t=new FontIcon({props:{icon:"icon dots-vertical"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_3$F(e){let t,n;return t=new InlineButton({props:{narrow:!0,square:!0,"data-testid":`DataFilterControl_choosevalues_${e[12]}`,$$slots:{default:[create_default_slot_1$1i]},$$scope:{ctx:e}}}),t.$on("click",e[22]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};4096&n[0]&&(o["data-testid"]=`DataFilterControl_choosevalues_${e[12]}`),64&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_2$U(e){let t,n;return t=new InlineButton({props:{narrow:!0,square:!0,"data-testid":`DataFilterControl_choosevalues_${e[12]}`,$$slots:{default:[create_default_slot$1U]},$$scope:{ctx:e}}}),t.$on("click",e[21]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};4096&n[0]&&(o["data-testid"]=`DataFilterControl_choosevalues_${e[12]}`),64&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot_1$1i(e){let t,n;return t=new FontIcon({props:{icon:"icon dots-vertical"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_default_slot$1U(e){let t,n;return t=new FontIcon({props:{icon:"icon dots-horizontal"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block$29(e){let t,n,o;return{c(){t=element("div"),attr(t,"class","horizontal-split-handle resizeHandleControl")},m(r,i){insert(r,t,i),n||(o=[action_destroyer(splitterDrag.call(null,t,"clientX")),listen(t,"resizeSplitter",e[32])],n=!0)},d(e){e&&detach(t),n=!1,run_all(o)}}}function create_fragment$59(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f=e[7]&&e[8]&&create_if_block_5$q(e);const h=[create_if_block_1$1f,create_if_block_4$x],g=[];function _(e,t){return e[3]&&e[4]&&e[5]?0:e[6]?1:-1}~(a=_(e))&&(s=g[a]=h[a](e)),l=new DropDownButton({props:{icon:"icon filter",menu:e[18],narrow:!0,"data-testid":`DataFilterControl_filtermenu_${e[12]}`}});let $=e[1]&&create_if_block$29(e);return{c(){t=element("div"),n=element("input"),r=space(),f&&f.c(),i=space(),s&&s.c(),c=space(),create_component(l.$$.fragment),u=space(),$&&$.c(),attr(n,"type","text"),attr(n,"autocomplete","off"),n.readOnly=e[0],attr(n,"placeholder",e[13]),attr(n,"data-testid",o=`DataFilterControl_input_${e[12]}`),attr(n,"class","svelte-1tfc4w5"),toggle_class(n,"isError",e[16]),toggle_class(n,"isOk",e[17]),attr(t,"class","flex")},m(o,s){insert(o,t,s),append(t,n),e[33](n),set_input_value(n,e[14]),append(t,r),f&&f.m(t,null),append(t,i),~a&&g[a].m(t,null),append(t,c),mount_component(l,t,null),append(t,u),$&&$.m(t,null),d=!0,p||(m=[listen(n,"input",e[34]),listen(n,"keydown",e[19]),listen(n,"blur",e[23]),listen(n,"paste",e[20])],p=!0)},p(e,r){(!d||1&r[0])&&(n.readOnly=e[0]),(!d||8192&r[0])&&attr(n,"placeholder",e[13]),(!d||4096&r[0]&&o!==(o=`DataFilterControl_input_${e[12]}`))&&attr(n,"data-testid",o),16384&r[0]&&n.value!==e[14]&&set_input_value(n,e[14]),(!d||65536&r[0])&&toggle_class(n,"isError",e[16]),(!d||131072&r[0])&&toggle_class(n,"isOk",e[17]),e[7]&&e[8]?f?(f.p(e,r),384&r[0]&&transition_in(f,1)):(f=create_if_block_5$q(e),f.c(),transition_in(f,1),f.m(t,i)):f&&(group_outros(),transition_out(f,1,1,(()=>{f=null})),check_outros());let u=a;a=_(e),a===u?~a&&g[a].p(e,r):(s&&(group_outros(),transition_out(g[u],1,1,(()=>{g[u]=null})),check_outros()),~a?(s=g[a],s?s.p(e,r):(s=g[a]=h[a](e),s.c()),transition_in(s,1),s.m(t,c)):s=null);const p={};4096&r[0]&&(p["data-testid"]=`DataFilterControl_filtermenu_${e[12]}`),l.$set(p),e[1]?$||($=create_if_block$29(e),$.c(),$.m(t,null)):$&&($.d(1),$=null)},i(e){d||(transition_in(f),transition_in(s),transition_in(l.$$.fragment,e),d=!0)},o(e){transition_out(f),transition_out(s),transition_out(l.$$.fragment,e),d=!1},d(n){n&&detach(t),e[33](null),f&&f.d(),~a&&g[a].d(),destroy_component(l),$&&$.d(),p=!1,run_all(m)}}}function instance$54(e,t,n){let o,r,i,a,{isReadOnly:s=!1}=t,{filterBehaviour:c}=t,{filter:l}=t,{setFilter:u}=t,{showResizeSplitter:d=!1}=t,{onFocusGrid:p=null}=t,{onGetReference:m=null}=t,{foreignKey:f=null}=t,{conid:h=null}=t,{database:g=null}=t,{driver:_=null}=t,{jslid:$=null}=t,{customCommandIcon:b=null}=t,{onCustomCommand:y=null}=t,{customCommandTooltip:v=null}=t,{formatterFunction:x=null}=t,{pureName:w=null}=t,{schemaName:C=null}=t,{columnName:k=null}=t,{uniqueName:S=null}=t,{dataType:T=null}=t,{placeholder:E="Filter"}=t;function A(e){showModal(SetFilterModal,{condition1:e,filterBehaviour:c,onFilter:u})}function O(){(l||"")!=(o||"")&&u(o)}return e.$$set=e=>{"isReadOnly"in e&&n(0,s=e.isReadOnly),"filterBehaviour"in e&&n(24,c=e.filterBehaviour),"filter"in e&&n(25,l=e.filter),"setFilter"in e&&n(26,u=e.setFilter),"showResizeSplitter"in e&&n(1,d=e.showResizeSplitter),"onFocusGrid"in e&&n(27,p=e.onFocusGrid),"onGetReference"in e&&n(28,m=e.onGetReference),"foreignKey"in e&&n(2,f=e.foreignKey),"conid"in e&&n(3,h=e.conid),"database"in e&&n(4,g=e.database),"driver"in e&&n(5,_=e.driver),"jslid"in e&&n(6,$=e.jslid),"customCommandIcon"in e&&n(7,b=e.customCommandIcon),"onCustomCommand"in e&&n(8,y=e.onCustomCommand),"customCommandTooltip"in e&&n(9,v=e.customCommandTooltip),"formatterFunction"in e&&n(29,x=e.formatterFunction),"pureName"in e&&n(10,w=e.pureName),"schemaName"in e&&n(30,C=e.schemaName),"columnName"in e&&n(11,k=e.columnName),"uniqueName"in e&&n(12,S=e.uniqueName),"dataType"in e&&n(31,T=e.dataType),"placeholder"in e&&n(13,E=e.placeholder)},e.$$.update=()=>{if(268468224&e.$$.dirty[0]&&m&&a&&m(a),33554432&e.$$.dirty[0]&&n(14,o=l),16793600&e.$$.dirty[0])try{n(17,i=!1),n(16,r=!1),o&&(lib.parseFilter(o,c),n(17,i=!0))}catch(e){n(16,r=!0)}},[s,d,f,h,g,_,$,b,y,v,w,k,S,E,o,a,r,i,function(){const e=[{onClick:()=>u(""),text:"Clear Filter"},{onClick:()=>{showModal(FilterMultipleValuesModal,{onFilter:(e,t)=>u(lib.createMultiLineFilter(e,t))})},text:"Filter multiple values"}];return c.supportEquals&&e.push({onClick:()=>A("="),text:"Equals..."},{onClick:()=>A("<>"),text:"Does Not Equal..."}),c.supportExistsTesting&&e.push({onClick:()=>u("EXISTS"),text:"Field exists"},{onClick:()=>u("NOT EXISTS"),text:"Field does not exist"}),c.supportArrayTesting&&e.push({onClick:()=>u("NOT EMPTY ARRAY"),text:"Array is not empty"},{onClick:()=>u("EMPTY ARRAY"),text:"Array is empty"}),c.supportNullTesting&&e.push({onClick:()=>u("NULL"),text:"Is Null"},{onClick:()=>u("NOT NULL"),text:"Is Not Null"}),c.supportEmpty&&e.push({onClick:()=>u("EMPTY, NULL"),text:"Is Empty Or Null"},{onClick:()=>u("NOT EMPTY NOT NULL"),text:"Has Not Empty Value"}),c.supportNumberLikeComparison&&e.push({divider:!0},{onClick:()=>A(">"),text:"Greater Than..."},{onClick:()=>A(">="),text:"Greater Than Or Equal To..."},{onClick:()=>A("<"),text:"Less Than..."},{onClick:()=>A("<="),text:"Less Than Or Equal To..."}),c.supportStringInclusion&&e.push({divider:!0},{onClick:()=>A("+"),text:"Contains..."},{onClick:()=>A("~"),text:"Does Not Contain..."},{onClick:()=>A("^"),text:"Begins With..."},{onClick:()=>A("!^"),text:"Does Not Begin With..."},{onClick:()=>A("$"),text:"Ends With..."},{onClick:()=>A("!$"),text:"Does Not End With..."}),c.supportBooleanValues&&e.push({onClick:()=>u("TRUE"),text:"Is True"},{onClick:()=>u("FALSE"),text:"Is False"}),c.supportBooleanValues&&c.supportNullTesting&&e.push({onClick:()=>u("TRUE, NULL"),text:"Is True or NULL"},{onClick:()=>u("FALSE, NULL"),text:"Is False or NULL"}),c.supportDatetimeSymbols&&e.push({divider:!0},{onClick:()=>u("TOMORROW"),text:"Tomorrow"},{onClick:()=>u("TODAY"),text:"Today"},{onClick:()=>u("YESTERDAY"),text:"Yesterday"},{divider:!0},{onClick:()=>u("NEXT WEEK"),text:"Next Week"},{onClick:()=>u("THIS WEEK"),text:"This Week"},{onClick:()=>u("LAST WEEK"),text:"Last Week"},{divider:!0},{onClick:()=>u("NEXT MONTH"),text:"Next Month"},{onClick:()=>u("THIS MONTH"),text:"This Month"},{onClick:()=>u("LAST MONTH"),text:"Last Month"},{divider:!0},{onClick:()=>u("NEXT YEAR"),text:"Next Year"},{onClick:()=>u("THIS YEAR"),text:"This Year"},{onClick:()=>u("LAST YEAR"),text:"Last Year"}),c.supportDatetimeComparison&&e.push({divider:!0},{onClick:()=>A("<="),text:"Before..."},{onClick:()=>A(">="),text:"After..."},{onClick:()=>A(">=;<="),text:"Between..."}),c.supportSqlCondition&&e.push({divider:!0},{onClick:()=>A("sql"),text:"SQL condition ..."},{onClick:()=>A("sqlRight"),text:"SQL condition - right side ..."}),e},e=>{s||(e.keyCode==keycodes.enter&&O(),e.keyCode==keycodes.escape&&u(""),e.keyCode==keycodes.downArrow&&(p&&p(),e.preventDefault()))},function(e){var t=void 0;window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData&&(t=e.clipboardData.getData("text/plain")),t&&t.includes("\n")&&(e.preventDefault(),u(lib.createMultiLineFilter("is",t)))},function(){showModal(DictionaryLookupModal,{conid:h,database:g,driver:_,pureName:f.refTableName,schemaName:f.refSchemaName,multiselect:!0,dataType:T,onConfirm:e=>u(e.join(","))})},function(){showModal(ValueLookupModal,{conid:h,database:g,driver:_,jslid:$,multiselect:!0,schemaName:C,pureName:w,field:k||S,formatterFunction:x,dataType:T,onConfirm:e=>u(e.map((e=>lib.getFilterValueExpression(e))).join(","))})},O,c,l,u,p,m,x,C,T,function(t){bubble.call(this,e,t)},function(e){binding_callbacks[e?"unshift":"push"]((()=>{a=e,n(15,a)}))},function(){o=this.value,n(14,o),n(25,l)}]}class DataFilterControl extends SvelteComponent{constructor(e){super(),init(this,e,instance$54,create_fragment$59,safe_not_equal,{isReadOnly:0,filterBehaviour:24,filter:25,setFilter:26,showResizeSplitter:1,onFocusGrid:27,onGetReference:28,foreignKey:2,conid:3,database:4,driver:5,jslid:6,customCommandIcon:7,onCustomCommand:8,customCommandTooltip:9,formatterFunction:29,pureName:10,schemaName:30,columnName:11,uniqueName:12,dataType:31,placeholder:13},null,[-1,-1])}}function create_fragment$58(e){let t,n,o;const r=e[3].default,i=create_slot(r,e,e[2],null);return{c(){t=element("div"),i&&i.c(),attr(t,"style",n=`max-width: ${e[0]}px`),attr(t,"class","svelte-jy5e9j"),toggle_class(t,"isFlex",e[1])},m(e,n){insert(e,t,n),i&&i.m(t,null),o=!0},p(e,[a]){i&&i.p&&(!o||4&a)&&update_slot_base(i,r,e,e[2],o?get_slot_changes(r,e[2],a,null):get_all_dirty_from_scope(e[2]),null),(!o||1&a&&n!==(n=`max-width: ${e[0]}px`))&&attr(t,"style",n),(!o||2&a)&&toggle_class(t,"isFlex",e[1])},i(e){o||(transition_in(i,e),o=!0)},o(e){transition_out(i,e),o=!1},d(e){e&&detach(t),i&&i.d(e)}}}function instance$53(e,t,n){let{$$slots:o={},$$scope:r}=t,{width:i}=t,{isFlex:a=!1}=t;return e.$$set=e=>{"width"in e&&n(0,i=e.width),"isFlex"in e&&n(1,a=e.isFlex),"$$scope"in e&&n(2,r=e.$$scope)},[i,a,r,o]}class ManagerInnerContainer extends SvelteComponent{constructor(e){super(),init(this,e,instance$53,create_fragment$58,safe_not_equal,{width:0,isFlex:1})}}
|
|
19
19
|
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function isNothing(e){return null==e}function isObject(e){return"object"==typeof e&&null!==e}function toArray(e){return Array.isArray(e)?e:isNothing(e)?[]:[e]}function extend(e,t){var n,o,r,i;if(t)for(n=0,o=(i=Object.keys(t)).length;n<o;n+=1)e[r=i[n]]=t[r];return e}function repeat(e,t){var n,o="";for(n=0;n<t;n+=1)o+=e;return o}function isNegativeZero(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}var isNothing_1=isNothing,isObject_1=isObject,toArray_1=toArray,repeat_1=repeat,isNegativeZero_1=isNegativeZero,extend_1=extend,common={isNothing:isNothing_1,isObject:isObject_1,toArray:toArray_1,repeat:repeat_1,isNegativeZero:isNegativeZero_1,extend:extend_1};function formatError(e,t){var n="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),o+" "+n):o}function YAMLException$1(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=formatError(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}YAMLException$1.prototype=Object.create(Error.prototype),YAMLException$1.prototype.constructor=YAMLException$1,YAMLException$1.prototype.toString=function(e){return this.name+": "+formatError(this,e)};var exception=YAMLException$1;function getLine(e,t,n,o,r){var i="",a="",s=Math.floor(r/2)-1;return o-t>s&&(t=o-s+(i=" ... ").length),n-o>s&&(n=o+s-(a=" ...").length),{str:i+e.slice(t,n).replace(/\t/g,"→")+a,pos:o-t+i.length}}function padStart(e,t){return common.repeat(" ",t-e.length)+e}function makeSnippet(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,o=/\r?\n|\r|\0/g,r=[0],i=[],a=-1;n=o.exec(e.buffer);)i.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var s,c,l="",u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(s=1;s<=t.linesBefore&&!(a-s<0);s++)c=getLine(e.buffer,r[a-s],i[a-s],e.position-(r[a]-r[a-s]),d),l=common.repeat(" ",t.indent)+padStart((e.line-s+1).toString(),u)+" | "+c.str+"\n"+l;for(c=getLine(e.buffer,r[a],i[a],e.position,d),l+=common.repeat(" ",t.indent)+padStart((e.line+1).toString(),u)+" | "+c.str+"\n",l+=common.repeat("-",t.indent+u+3+c.pos)+"^\n",s=1;s<=t.linesAfter&&!(a+s>=i.length);s++)c=getLine(e.buffer,r[a+s],i[a+s],e.position-(r[a]-r[a+s]),d),l+=common.repeat(" ",t.indent)+padStart((e.line+s+1).toString(),u)+" | "+c.str+"\n";return l.replace(/\n$/,"")}var snippet=makeSnippet,TYPE_CONSTRUCTOR_OPTIONS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"];function compileStyleAliases(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}function Type$1(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(t))throw new exception('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=compileStyleAliases(t.styleAliases||null),-1===YAML_NODE_KINDS.indexOf(this.kind))throw new exception('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var type=Type$1;function compileList(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,o){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=o)})),n[t]=e})),n}function compileMap(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(o);return n}function Schema$1(e){return this.extend(e)}Schema$1.prototype.extend=function(e){var t=[],n=[];if(e instanceof type)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof type))throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof type))throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var o=Object.create(Schema$1.prototype);return o.implicit=(this.implicit||[]).concat(t),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=compileList(o,"implicit"),o.compiledExplicit=compileList(o,"explicit"),o.compiledTypeMap=compileMap(o.compiledImplicit,o.compiledExplicit),o};var schema=Schema$1,str=new type("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),seq=new type("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),map=new type("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),failsafe=new schema({explicit:[str,seq,map]});function resolveYamlNull(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function constructYamlNull(){return null}function isNull(e){return null===e}var _null=new type("tag:yaml.org,2002:null",{kind:"scalar",resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function resolveYamlBoolean(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function constructYamlBoolean(e){return"true"===e||"True"===e||"TRUE"===e}function isBoolean(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var bool=new type("tag:yaml.org,2002:bool",{kind:"scalar",resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function isHexCode(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function isOctCode(e){return 48<=e&&e<=55}function isDecCode(e){return 48<=e&&e<=57}function resolveYamlInteger(e){if(null===e)return!1;var t,n=e.length,o=0,r=!1;if(!n)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===n)return!0;if("b"===(t=e[++o])){for(o++;o<n;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;r=!0}return r&&"_"!==t}if("x"===t){for(o++;o<n;o++)if("_"!==(t=e[o])){if(!isHexCode(e.charCodeAt(o)))return!1;r=!0}return r&&"_"!==t}if("o"===t){for(o++;o<n;o++)if("_"!==(t=e[o])){if(!isOctCode(e.charCodeAt(o)))return!1;r=!0}return r&&"_"!==t}}if("_"===t)return!1;for(;o<n;o++)if("_"!==(t=e[o])){if(!isDecCode(e.charCodeAt(o)))return!1;r=!0}return!(!r||"_"===t)}function constructYamlInteger(e){var t,n=e,o=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(o=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return o*parseInt(n.slice(2),2);if("x"===n[1])return o*parseInt(n.slice(2),16);if("o"===n[1])return o*parseInt(n.slice(2),8)}return o*parseInt(n,10)}function isInteger(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!common.isNegativeZero(e)}var int=new type("tag:yaml.org,2002:int",{kind:"scalar",resolve:resolveYamlInteger,construct:constructYamlInteger,predicate:isInteger,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(e){return null!==e&&!(!YAML_FLOAT_PATTERN.test(e)||"_"===e[e.length-1])}function constructYamlFloat(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)}var SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/;function representYamlFloat(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(common.isNegativeZero(e))return"-0.0";return n=e.toString(10),SCIENTIFIC_WITHOUT_DOT.test(n)?n.replace("e",".e"):n}function isFloat(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||common.isNegativeZero(e))}var float=new type("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"}),json=failsafe.extend({implicit:[_null,bool,int,float]}),core$1=json,YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function resolveYamlTimestamp(e){return null!==e&&(null!==YAML_DATE_REGEXP.exec(e)||null!==YAML_TIMESTAMP_REGEXP.exec(e))}function constructYamlTimestamp(e){var t,n,o,r,i,a,s,c,l=0,u=null;if(null===(t=YAML_DATE_REGEXP.exec(e))&&(t=YAML_TIMESTAMP_REGEXP.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],o=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,o,r));if(i=+t[4],a=+t[5],s=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,o,r,i,a,s,l)),u&&c.setTime(c.getTime()-u),c}function representYamlTimestamp(e){return e.toISOString()}var timestamp=new type("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp});function resolveYamlMerge(e){return"<<"===e||null===e}var merge$3=new type("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge}),BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function resolveYamlBinary(e){if(null===e)return!1;var t,n,o=0,r=e.length,i=BASE64_MAP;for(n=0;n<r;n++)if(!((t=i.indexOf(e.charAt(n)))>64)){if(t<0)return!1;o+=6}return o%8==0}function constructYamlBinary(e){var t,n,o=e.replace(/[\r\n=]/g,""),r=o.length,i=BASE64_MAP,a=0,s=[];for(t=0;t<r;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|i.indexOf(o.charAt(t));return 0===(n=r%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)}function representYamlBinary(e){var t,n,o="",r=0,i=e.length,a=BASE64_MAP;for(t=0;t<i;t++)t%3==0&&t&&(o+=a[r>>18&63],o+=a[r>>12&63],o+=a[r>>6&63],o+=a[63&r]),r=(r<<8)+e[t];return 0===(n=i%3)?(o+=a[r>>18&63],o+=a[r>>12&63],o+=a[r>>6&63],o+=a[63&r]):2===n?(o+=a[r>>10&63],o+=a[r>>4&63],o+=a[r<<2&63],o+=a[64]):1===n&&(o+=a[r>>2&63],o+=a[r<<4&63],o+=a[64],o+=a[64]),o}function isBinary(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}var binary=new type("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary}),_hasOwnProperty$3=Object.prototype.hasOwnProperty,_toString$2=Object.prototype.toString;function resolveYamlOmap(e){if(null===e)return!0;var t,n,o,r,i,a=[],s=e;for(t=0,n=s.length;t<n;t+=1){if(o=s[t],i=!1,"[object Object]"!==_toString$2.call(o))return!1;for(r in o)if(_hasOwnProperty$3.call(o,r)){if(i)return!1;i=!0}if(!i)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0}function constructYamlOmap(e){return null!==e?e:[]}var omap=new type("tag:yaml.org,2002:omap",{kind:"sequence",resolve:resolveYamlOmap,construct:constructYamlOmap}),_toString$1=Object.prototype.toString;function resolveYamlPairs(e){if(null===e)return!0;var t,n,o,r,i,a=e;for(i=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(o=a[t],"[object Object]"!==_toString$1.call(o))return!1;if(1!==(r=Object.keys(o)).length)return!1;i[t]=[r[0],o[r[0]]]}return!0}function constructYamlPairs(e){if(null===e)return[];var t,n,o,r,i,a=e;for(i=new Array(a.length),t=0,n=a.length;t<n;t+=1)o=a[t],r=Object.keys(o),i[t]=[r[0],o[r[0]]];return i}var pairs=new type("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:resolveYamlPairs,construct:constructYamlPairs}),_hasOwnProperty$2=Object.prototype.hasOwnProperty;function resolveYamlSet(e){if(null===e)return!0;var t,n=e;for(t in n)if(_hasOwnProperty$2.call(n,t)&&null!==n[t])return!1;return!0}function constructYamlSet(e){return null!==e?e:{}}var set=new type("tag:yaml.org,2002:set",{kind:"mapping",resolve:resolveYamlSet,construct:constructYamlSet}),_default=core$1.extend({implicit:[timestamp,merge$3],explicit:[binary,omap,pairs,set]}),_hasOwnProperty$1=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(e){return Object.prototype.toString.call(e)}function is_EOL(e){return 10===e||13===e}function is_WHITE_SPACE(e){return 9===e||32===e}function is_WS_OR_EOL(e){return 9===e||32===e||10===e||13===e}function is_FLOW_INDICATOR(e){return 44===e||91===e||93===e||123===e||125===e}function fromHexCode(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function escapedHexLen(e){return 120===e?2:117===e?4:85===e?8:0}function fromDecimalCode(e){return 48<=e&&e<=57?e-48:-1}function simpleEscapeSequence(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function charFromCodepoint(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256),i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State$1(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||_default,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function generateError(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=snippet(n),new exception(t,n)}function throwError(e,t){throw generateError(e,t)}function throwWarning(e,t){e.onWarning&&e.onWarning.call(null,generateError(e,t))}var directiveHandlers={YAML:function(e,t,n){var o,r,i;null!==e.version&&throwError(e,"duplication of %YAML directive"),1!==n.length&&throwError(e,"YAML directive accepts exactly one argument"),null===(o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&throwError(e,"ill-formed argument of the YAML directive"),r=parseInt(o[1],10),i=parseInt(o[2],10),1!==r&&throwError(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&throwWarning(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var o,r;2!==n.length&&throwError(e,"TAG directive accepts exactly two arguments"),o=n[0],r=n[1],PATTERN_TAG_HANDLE.test(o)||throwError(e,"ill-formed tag handle (first argument) of the TAG directive"),_hasOwnProperty$1.call(e.tagMap,o)&&throwError(e,'there is a previously declared suffix for "'+o+'" tag handle'),PATTERN_TAG_URI.test(r)||throwError(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){throwError(e,"tag prefix is malformed: "+r)}e.tagMap[o]=r}};function captureSegment(e,t,n,o){var r,i,a,s;if(t<n){if(s=e.input.slice(t,n),o)for(r=0,i=s.length;r<i;r+=1)9===(a=s.charCodeAt(r))||32<=a&&a<=1114111||throwError(e,"expected valid JSON character");else PATTERN_NON_PRINTABLE.test(s)&&throwError(e,"the stream contains non-printable characters");e.result+=s}}function mergeMappings(e,t,n,o){var r,i,a,s;for(common.isObject(n)||throwError(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(r=Object.keys(n)).length;a<s;a+=1)i=r[a],_hasOwnProperty$1.call(t,i)||(t[i]=n[i],o[i]=!0)}function storeMappingPair(e,t,n,o,r,i,a,s,c){var l,u;if(Array.isArray(r))for(l=0,u=(r=Array.prototype.slice.call(r)).length;l<u;l+=1)Array.isArray(r[l])&&throwError(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===_class(r[l])&&(r[l]="[object Object]");if("object"==typeof r&&"[object Object]"===_class(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===o)if(Array.isArray(i))for(l=0,u=i.length;l<u;l+=1)mergeMappings(e,t,i[l],n);else mergeMappings(e,t,i,n);else e.json||_hasOwnProperty$1.call(n,r)||!_hasOwnProperty$1.call(t,r)||(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,throwError(e,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:i}):t[r]=i,delete n[r];return t}function readLineBreak(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):throwError(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function skipSeparationSpace(e,t,n){for(var o=0,r=e.input.charCodeAt(e.position);0!==r;){for(;is_WHITE_SPACE(r);)9===r&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!is_EOL(r))break;for(readLineBreak(e),r=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==o&&e.lineIndent<n&&throwWarning(e,"deficient indentation"),o}function testDocumentSeparator(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!is_WS_OR_EOL(t)))}function writeFoldedLines(e,t){1===t?e.result+=" ":t>1&&(e.result+=common.repeat("\n",t-1))}function readPlainScalar(e,t,n){var o,r,i,a,s,c,l,u,d=e.kind,p=e.result;if(is_WS_OR_EOL(u=e.input.charCodeAt(e.position))||is_FLOW_INDICATOR(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(is_WS_OR_EOL(o=e.input.charCodeAt(e.position+1))||n&&is_FLOW_INDICATOR(o)))return!1;for(e.kind="scalar",e.result="",r=i=e.position,a=!1;0!==u;){if(58===u){if(is_WS_OR_EOL(o=e.input.charCodeAt(e.position+1))||n&&is_FLOW_INDICATOR(o))break}else if(35===u){if(is_WS_OR_EOL(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&testDocumentSeparator(e)||n&&is_FLOW_INDICATOR(u))break;if(is_EOL(u)){if(s=e.line,c=e.lineStart,l=e.lineIndent,skipSeparationSpace(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=i,e.line=s,e.lineStart=c,e.lineIndent=l;break}}a&&(captureSegment(e,r,i,!1),writeFoldedLines(e,e.line-s),r=i=e.position,a=!1),is_WHITE_SPACE(u)||(i=e.position+1),u=e.input.charCodeAt(++e.position)}return captureSegment(e,r,i,!1),!!e.result||(e.kind=d,e.result=p,!1)}function readSingleQuotedScalar(e,t){var n,o,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,o=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(captureSegment(e,o,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;o=e.position,e.position++,r=e.position}else is_EOL(n)?(captureSegment(e,o,r,!0),writeFoldedLines(e,skipSeparationSpace(e,!1,t)),o=r=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);throwError(e,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(e,t){var n,o,r,i,a,s;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return captureSegment(e,n,e.position,!0),e.position++,!0;if(92===s){if(captureSegment(e,n,e.position,!0),is_EOL(s=e.input.charCodeAt(++e.position)))skipSeparationSpace(e,!1,t);else if(s<256&&simpleEscapeCheck[s])e.result+=simpleEscapeMap[s],e.position++;else if((a=escapedHexLen(s))>0){for(r=a,i=0;r>0;r--)(a=fromHexCode(s=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:throwError(e,"expected hexadecimal character");e.result+=charFromCodepoint(i),e.position++}else throwError(e,"unknown escape sequence");n=o=e.position}else is_EOL(s)?(captureSegment(e,n,o,!0),writeFoldedLines(e,skipSeparationSpace(e,!1,t)),n=o=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}throwError(e,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(e,t){var n,o,r,i,a,s,c,l,u,d,p,m,f=!0,h=e.tag,g=e.anchor,_=Object.create(null);if(91===(m=e.input.charCodeAt(e.position)))a=93,l=!1,i=[];else{if(123!==m)return!1;a=125,l=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),m=e.input.charCodeAt(++e.position);0!==m;){if(skipSeparationSpace(e,!0,t),(m=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=h,e.anchor=g,e.kind=l?"mapping":"sequence",e.result=i,!0;f?44===m&&throwError(e,"expected the node content, but found ','"):throwError(e,"missed comma between flow collection entries"),p=null,s=c=!1,63===m&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1))&&(s=c=!0,e.position++,skipSeparationSpace(e,!0,t)),n=e.line,o=e.lineStart,r=e.position,composeNode(e,t,CONTEXT_FLOW_IN,!1,!0),d=e.tag,u=e.result,skipSeparationSpace(e,!0,t),m=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==m||(s=!0,m=e.input.charCodeAt(++e.position),skipSeparationSpace(e,!0,t),composeNode(e,t,CONTEXT_FLOW_IN,!1,!0),p=e.result),l?storeMappingPair(e,i,_,d,u,p,n,o,r):s?i.push(storeMappingPair(e,null,_,d,u,p,n,o,r)):i.push(u),skipSeparationSpace(e,!0,t),44===(m=e.input.charCodeAt(e.position))?(f=!0,m=e.input.charCodeAt(++e.position)):f=!1}throwError(e,"unexpected end of the stream within a flow collection")}function readBlockScalar(e,t){var n,o,r,i,a=CHOMPING_CLIP,s=!1,c=!1,l=t,u=0,d=!1;if(124===(i=e.input.charCodeAt(e.position)))o=!1;else{if(62!==i)return!1;o=!0}for(e.kind="scalar",e.result="";0!==i;)if(43===(i=e.input.charCodeAt(++e.position))||45===i)CHOMPING_CLIP===a?a=43===i?CHOMPING_KEEP:CHOMPING_STRIP:throwError(e,"repeat of a chomping mode identifier");else{if(!((r=fromDecimalCode(i))>=0))break;0===r?throwError(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?throwError(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(is_WHITE_SPACE(i)){do{i=e.input.charCodeAt(++e.position)}while(is_WHITE_SPACE(i));if(35===i)do{i=e.input.charCodeAt(++e.position)}while(!is_EOL(i)&&0!==i)}for(;0!==i;){for(readLineBreak(e),e.lineIndent=0,i=e.input.charCodeAt(e.position);(!c||e.lineIndent<l)&&32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>l&&(l=e.lineIndent),is_EOL(i))u++;else{if(e.lineIndent<l){a===CHOMPING_KEEP?e.result+=common.repeat("\n",s?1+u:u):a===CHOMPING_CLIP&&s&&(e.result+="\n");break}for(o?is_WHITE_SPACE(i)?(d=!0,e.result+=common.repeat("\n",s?1+u:u)):d?(d=!1,e.result+=common.repeat("\n",u+1)):0===u?s&&(e.result+=" "):e.result+=common.repeat("\n",u):e.result+=common.repeat("\n",s?1+u:u),s=!0,c=!0,u=0,n=e.position;!is_EOL(i)&&0!==i;)i=e.input.charCodeAt(++e.position);captureSegment(e,n,e.position,!1)}}return!0}function readBlockSequence(e,t){var n,o,r=e.tag,i=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),o=e.input.charCodeAt(e.position);0!==o&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,throwError(e,"tab characters must not be used in indentation")),45===o)&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,skipSeparationSpace(e,!0,-1)&&e.lineIndent<=t)a.push(null),o=e.input.charCodeAt(e.position);else if(n=e.line,composeNode(e,t,CONTEXT_BLOCK_IN,!1,!0),a.push(e.result),skipSeparationSpace(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==o)throwError(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0)}function readBlockMapping(e,t,n){var o,r,i,a,s,c,l,u=e.tag,d=e.anchor,p={},m=Object.create(null),f=null,h=null,g=null,_=!1,$=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),l=e.input.charCodeAt(e.position);0!==l;){if(_||-1===e.firstTabInLine||(e.position=e.firstTabInLine,throwError(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),i=e.line,63!==l&&58!==l||!is_WS_OR_EOL(o)){if(a=e.line,s=e.lineStart,c=e.position,!composeNode(e,n,CONTEXT_FLOW_OUT,!1,!0))break;if(e.line===i){for(l=e.input.charCodeAt(e.position);is_WHITE_SPACE(l);)l=e.input.charCodeAt(++e.position);if(58===l)is_WS_OR_EOL(l=e.input.charCodeAt(++e.position))||throwError(e,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(storeMappingPair(e,p,m,f,h,null,a,s,c),f=h=g=null),$=!0,_=!1,r=!1,f=e.tag,h=e.result;else{if(!$)return e.tag=u,e.anchor=d,!0;throwError(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!$)return e.tag=u,e.anchor=d,!0;throwError(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(_&&(storeMappingPair(e,p,m,f,h,null,a,s,c),f=h=g=null),$=!0,_=!0,r=!0):_?(_=!1,r=!0):throwError(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=o;if((e.line===i||e.lineIndent>t)&&(_&&(a=e.line,s=e.lineStart,c=e.position),composeNode(e,t,CONTEXT_BLOCK_OUT,!0,r)&&(_?h=e.result:g=e.result),_||(storeMappingPair(e,p,m,f,h,g,a,s,c),f=h=g=null),skipSeparationSpace(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&0!==l)throwError(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return _&&storeMappingPair(e,p,m,f,h,null,a,s,c),$&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=p),$}function readTagProperty(e){var t,n,o,r,i=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&throwError(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(i=!0,r=e.input.charCodeAt(++e.position)):33===r?(a=!0,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(o=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):throwError(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!is_WS_OR_EOL(r);)33===r&&(a?throwError(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),PATTERN_TAG_HANDLE.test(n)||throwError(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),PATTERN_FLOW_INDICATORS.test(o)&&throwError(e,"tag suffix cannot contain flow indicator characters")}o&&!PATTERN_TAG_URI.test(o)&&throwError(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch(t){throwError(e,"tag name is malformed: "+o)}return i?e.tag=o:_hasOwnProperty$1.call(e.tagMap,n)?e.tag=e.tagMap[n]+o:"!"===n?e.tag="!"+o:"!!"===n?e.tag="tag:yaml.org,2002:"+o:throwError(e,'undeclared tag handle "'+n+'"'),!0}function readAnchorProperty(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&throwError(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function readAlias(e){var t,n,o;if(42!==(o=e.input.charCodeAt(e.position)))return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!is_WS_OR_EOL(o)&&!is_FLOW_INDICATOR(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),_hasOwnProperty$1.call(e.anchorMap,n)||throwError(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],skipSeparationSpace(e,!0,-1),!0}function composeNode(e,t,n,o,r){var i,a,s,c,l,u,d,p,m,f=1,h=!1,g=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=a=s=CONTEXT_BLOCK_OUT===n||CONTEXT_BLOCK_IN===n,o&&skipSeparationSpace(e,!0,-1)&&(h=!0,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)),1===f)for(;readTagProperty(e)||readAnchorProperty(e);)skipSeparationSpace(e,!0,-1)?(h=!0,s=i,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)):s=!1;if(s&&(s=h||r),1!==f&&CONTEXT_BLOCK_OUT!==n||(p=CONTEXT_FLOW_IN===n||CONTEXT_FLOW_OUT===n?t:t+1,m=e.position-e.lineStart,1===f?s&&(readBlockSequence(e,m)||readBlockMapping(e,m,p))||readFlowCollection(e,p)?g=!0:(a&&readBlockScalar(e,p)||readSingleQuotedScalar(e,p)||readDoubleQuotedScalar(e,p)?g=!0:readAlias(e)?(g=!0,null===e.tag&&null===e.anchor||throwError(e,"alias node should not have any properties")):readPlainScalar(e,p,CONTEXT_FLOW_IN===n)&&(g=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=s&&readBlockSequence(e,m))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&throwError(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c<l;c+=1)if((d=e.implicitTypes[c]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(_hasOwnProperty$1.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,c=0,l=(u=e.typeMap.multi[e.kind||"fallback"]).length;c<l;c+=1)if(e.tag.slice(0,u[c].tag.length)===u[c].tag){d=u[c];break}d||throwError(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&throwError(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):throwError(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function readDocument(e){var t,n,o,r,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(skipSeparationSpace(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!is_WS_OR_EOL(r);)r=e.input.charCodeAt(++e.position);for(o=[],(n=e.input.slice(t,e.position)).length<1&&throwError(e,"directive name must not be less than one character in length");0!==r;){for(;is_WHITE_SPACE(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!is_EOL(r));break}if(is_EOL(r))break;for(t=e.position;0!==r&&!is_WS_OR_EOL(r);)r=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}0!==r&&readLineBreak(e),_hasOwnProperty$1.call(directiveHandlers,n)?directiveHandlers[n](e,n,o):throwWarning(e,'unknown document directive "'+n+'"')}skipSeparationSpace(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,skipSeparationSpace(e,!0,-1)):a&&throwError(e,"directives end mark is expected"),composeNode(e,e.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(e,!0,-1),e.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(e.input.slice(i,e.position))&&throwWarning(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&testDocumentSeparator(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,skipSeparationSpace(e,!0,-1)):e.position<e.length-1&&throwError(e,"end of the stream or a document separator is expected")}function loadDocuments(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new State$1(e,t),o=e.indexOf("\0");for(-1!==o&&(n.position=o,throwError(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)readDocument(n);return n.documents}function loadAll$1(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var o=loadDocuments(e,n);if("function"!=typeof t)return o;for(var r=0,i=o.length;r<i;r+=1)t(o[r])}function load$1(e,t){var n=loadDocuments(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new exception("expected a single document in the stream, but found more")}}var loadAll_1=loadAll$1,load_1=load$1,loader={loadAll:loadAll_1,load:load_1},_toString=Object.prototype.toString,_hasOwnProperty=Object.prototype.hasOwnProperty,CHAR_BOM=65279,CHAR_TAB=9,CHAR_LINE_FEED=10,CHAR_CARRIAGE_RETURN=13,CHAR_SPACE=32,CHAR_EXCLAMATION=33,CHAR_DOUBLE_QUOTE=34,CHAR_SHARP=35,CHAR_PERCENT=37,CHAR_AMPERSAND=38,CHAR_SINGLE_QUOTE=39,CHAR_ASTERISK=42,CHAR_COMMA=44,CHAR_MINUS=45,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_GREATER_THAN=62,CHAR_QUESTION=63,CHAR_COMMERCIAL_AT=64,CHAR_LEFT_SQUARE_BRACKET=91,CHAR_RIGHT_SQUARE_BRACKET=93,CHAR_GRAVE_ACCENT=96,CHAR_LEFT_CURLY_BRACKET=123,CHAR_VERTICAL_LINE=124,CHAR_RIGHT_CURLY_BRACKET=125,ESCAPE_SEQUENCES={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},DEPRECATED_BOOLEANS_SYNTAX=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],DEPRECATED_BASE60_SYNTAX=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(e,t){var n,o,r,i,a,s,c;if(null===t)return{};for(n={},r=0,i=(o=Object.keys(t)).length;r<i;r+=1)a=o[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&_hasOwnProperty.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}function encodeHex(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else{if(!(e<=4294967295))throw new exception("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+common.repeat("0",o-t.length)+t}var QUOTING_TYPE_SINGLE=1,QUOTING_TYPE_DOUBLE=2;function State(e){this.schema=e.schema||_default,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=common.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=compileStyleMap(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?QUOTING_TYPE_DOUBLE:QUOTING_TYPE_SINGLE,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function indentString(e,t){for(var n,o=common.repeat(" ",t),r=0,i=-1,a="",s=e.length;r<s;)-1===(i=e.indexOf("\n",r))?(n=e.slice(r),r=s):(n=e.slice(r,i+1),r=i+1),n.length&&"\n"!==n&&(a+=o),a+=n;return a}function generateNextLine(e,t){return"\n"+common.repeat(" ",e.indent*t)}function testImplicitResolving(e,t){var n,o;for(n=0,o=e.implicitTypes.length;n<o;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}function isWhitespace(e){return e===CHAR_SPACE||e===CHAR_TAB}function isPrintable(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==CHAR_BOM||65536<=e&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==CHAR_BOM&&e!==CHAR_CARRIAGE_RETURN&&e!==CHAR_LINE_FEED}function isPlainSafe(e,t,n){var o=isNsCharOrWhitespace(e),r=o&&!isWhitespace(e);return(n?o:o&&e!==CHAR_COMMA&&e!==CHAR_LEFT_SQUARE_BRACKET&&e!==CHAR_RIGHT_SQUARE_BRACKET&&e!==CHAR_LEFT_CURLY_BRACKET&&e!==CHAR_RIGHT_CURLY_BRACKET)&&e!==CHAR_SHARP&&!(t===CHAR_COLON&&!r)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===CHAR_SHARP||t===CHAR_COLON&&r}function isPlainSafeFirst(e){return isPrintable(e)&&e!==CHAR_BOM&&!isWhitespace(e)&&e!==CHAR_MINUS&&e!==CHAR_QUESTION&&e!==CHAR_COLON&&e!==CHAR_COMMA&&e!==CHAR_LEFT_SQUARE_BRACKET&&e!==CHAR_RIGHT_SQUARE_BRACKET&&e!==CHAR_LEFT_CURLY_BRACKET&&e!==CHAR_RIGHT_CURLY_BRACKET&&e!==CHAR_SHARP&&e!==CHAR_AMPERSAND&&e!==CHAR_ASTERISK&&e!==CHAR_EXCLAMATION&&e!==CHAR_VERTICAL_LINE&&e!==CHAR_EQUALS&&e!==CHAR_GREATER_THAN&&e!==CHAR_SINGLE_QUOTE&&e!==CHAR_DOUBLE_QUOTE&&e!==CHAR_PERCENT&&e!==CHAR_COMMERCIAL_AT&&e!==CHAR_GRAVE_ACCENT}function isPlainSafeLast(e){return!isWhitespace(e)&&e!==CHAR_COLON}function codePointAt(e,t){var n,o=e.charCodeAt(t);return o>=55296&&o<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(o-55296)+n-56320+65536:o}function needIndentIndicator(e){return/^\n* /.test(e)}var STYLE_PLAIN=1,STYLE_SINGLE=2,STYLE_LITERAL=3,STYLE_FOLDED=4,STYLE_DOUBLE=5;function chooseScalarStyle(e,t,n,o,r,i,a,s){var c,l=0,u=null,d=!1,p=!1,m=-1!==o,f=-1,h=isPlainSafeFirst(codePointAt(e,0))&&isPlainSafeLast(codePointAt(e,e.length-1));if(t||a)for(c=0;c<e.length;l>=65536?c+=2:c++){if(!isPrintable(l=codePointAt(e,c)))return STYLE_DOUBLE;h=h&&isPlainSafe(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if((l=codePointAt(e,c))===CHAR_LINE_FEED)d=!0,m&&(p=p||c-f-1>o&&" "!==e[f+1],f=c);else if(!isPrintable(l))return STYLE_DOUBLE;h=h&&isPlainSafe(l,u,s),u=l}p=p||m&&c-f-1>o&&" "!==e[f+1]}return d||p?n>9&&needIndentIndicator(e)?STYLE_DOUBLE:a?i===QUOTING_TYPE_DOUBLE?STYLE_DOUBLE:STYLE_SINGLE:p?STYLE_FOLDED:STYLE_LITERAL:!h||a||r(e)?i===QUOTING_TYPE_DOUBLE?STYLE_DOUBLE:STYLE_SINGLE:STYLE_PLAIN}function writeScalar(e,t,n,o,r){e.dump=function(){if(0===t.length)return e.quotingType===QUOTING_TYPE_DOUBLE?'""':"''";if(!e.noCompatMode&&(-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(t)||DEPRECATED_BASE60_SYNTAX.test(t)))return e.quotingType===QUOTING_TYPE_DOUBLE?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=o||e.flowLevel>-1&&n>=e.flowLevel;switch(chooseScalarStyle(t,s,e.indent,a,(function(t){return testImplicitResolving(e,t)}),e.quotingType,e.forceQuotes&&!o,r)){case STYLE_PLAIN:return t;case STYLE_SINGLE:return"'"+t.replace(/'/g,"''")+"'";case STYLE_LITERAL:return"|"+blockHeader(t,e.indent)+dropEndingNewline(indentString(t,i));case STYLE_FOLDED:return">"+blockHeader(t,e.indent)+dropEndingNewline(indentString(foldString(t,a),i));case STYLE_DOUBLE:return'"'+escapeString(t)+'"';default:throw new exception("impossible error: invalid scalar style")}}()}function blockHeader(e,t){var n=needIndentIndicator(e)?String(t):"",o="\n"===e[e.length-1];return n+(o&&("\n"===e[e.length-2]||"\n"===e)?"+":o?"":"-")+"\n"}function dropEndingNewline(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function foldString(e,t){for(var n,o,r,i=/(\n+)([^\n]*)/g,a=(n=-1!==(n=e.indexOf("\n"))?n:e.length,i.lastIndex=n,foldLine(e.slice(0,n),t)),s="\n"===e[0]||" "===e[0];r=i.exec(e);){var c=r[1],l=r[2];o=" "===l[0],a+=c+(s||o||""===l?"":"\n")+foldLine(l,t),s=o}return a}function foldLine(e,t){if(""===e||" "===e[0])return e;for(var n,o,r=/ [^ ]/g,i=0,a=0,s=0,c="";n=r.exec(e);)(s=n.index)-i>t&&(o=a>i?a:s,c+="\n"+e.slice(i,o),i=o+1),a=s;return c+="\n",e.length-i>t&&a>i?c+=e.slice(i,a)+"\n"+e.slice(a+1):c+=e.slice(i),c.slice(1)}function escapeString(e){for(var t,n="",o=0,r=0;r<e.length;o>=65536?r+=2:r++)o=codePointAt(e,r),!(t=ESCAPE_SEQUENCES[o])&&isPrintable(o)?(n+=e[r],o>=65536&&(n+=e[r+1])):n+=t||encodeHex(o);return n}function writeFlowSequence(e,t,n){var o,r,i,a="",s=e.tag;for(o=0,r=n.length;o<r;o+=1)i=n[o],e.replacer&&(i=e.replacer.call(n,String(o),i)),(writeNode(e,t,i,!1,!1)||void 0===i&&writeNode(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=s,e.dump="["+a+"]"}function writeBlockSequence(e,t,n,o){var r,i,a,s="",c=e.tag;for(r=0,i=n.length;r<i;r+=1)a=n[r],e.replacer&&(a=e.replacer.call(n,String(r),a)),(writeNode(e,t+1,a,!0,!0,!1,!0)||void 0===a&&writeNode(e,t+1,null,!0,!0,!1,!0))&&(o&&""===s||(s+=generateNextLine(e,t)),e.dump&&CHAR_LINE_FEED===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=c,e.dump=s||"[]"}function writeFlowMapping(e,t,n){var o,r,i,a,s,c="",l=e.tag,u=Object.keys(n);for(o=0,r=u.length;o<r;o+=1)s="",""!==c&&(s+=", "),e.condenseFlow&&(s+='"'),a=n[i=u[o]],e.replacer&&(a=e.replacer.call(n,i,a)),writeNode(e,t,i,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),writeNode(e,t,a,!1,!1)&&(c+=s+=e.dump));e.tag=l,e.dump="{"+c+"}"}function writeBlockMapping(e,t,n,o){var r,i,a,s,c,l,u="",d=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new exception("sortKeys must be a boolean or a function");for(r=0,i=p.length;r<i;r+=1)l="",o&&""===u||(l+=generateNextLine(e,t)),s=n[a=p[r]],e.replacer&&(s=e.replacer.call(n,a,s)),writeNode(e,t+1,a,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&CHAR_LINE_FEED===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=generateNextLine(e,t)),writeNode(e,t+1,s,!0,c)&&(e.dump&&CHAR_LINE_FEED===e.dump.charCodeAt(0)?l+=":":l+=": ",u+=l+=e.dump));e.tag=d,e.dump=u||"{}"}function detectType(e,t,n){var o,r,i,a,s,c;for(i=0,a=(r=n?e.explicitTypes:e.implicitTypes).length;i<a;i+=1)if(((s=r[i]).instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===_toString.call(s.represent))o=s.represent(t,c);else{if(!_hasOwnProperty.call(s.represent,c))throw new exception("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');o=s.represent[c](t,c)}e.dump=o}return!0}return!1}function writeNode(e,t,n,o,r,i,a){e.tag=null,e.dump=n,detectType(e,n,!1)||detectType(e,n,!0);var s,c=_toString.call(e.dump),l=o;o&&(o=e.flowLevel<0||e.flowLevel>t);var u,d,p="[object Object]"===c||"[object Array]"===c;if(p&&(d=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(r=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===c)o&&0!==Object.keys(e.dump).length?(writeBlockMapping(e,t,e.dump,r),d&&(e.dump="&ref_"+u+e.dump)):(writeFlowMapping(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===c)o&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?writeBlockSequence(e,t-1,e.dump,r):writeBlockSequence(e,t,e.dump,r),d&&(e.dump="&ref_"+u+e.dump)):(writeFlowSequence(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new exception("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&writeScalar(e,e.dump,t,i,l)}null!==e.tag&&"?"!==e.tag&&(s=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),s="!"===e.tag[0]?"!"+s:"tag:yaml.org,2002:"===s.slice(0,18)?"!!"+s.slice(18):"!<"+s+">",e.dump=s+" "+e.dump)}return!0}function getDuplicateReferences(e,t){var n,o,r=[],i=[];for(inspectNode(e,r,i),n=0,o=i.length;n<o;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=new Array(o)}function inspectNode(e,t,n){var o,r,i;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,i=e.length;r<i;r+=1)inspectNode(e[r],t,n);else for(r=0,i=(o=Object.keys(e)).length;r<i;r+=1)inspectNode(e[o[r]],t,n)}function dump$1(e,t){var n=new State(t=t||{});n.noRefs||getDuplicateReferences(e,n);var o=e;return n.replacer&&(o=n.replacer.call({"":o},"",o)),writeNode(n,0,o,!0,!0)?n.dump+"\n":""}var dump_1=dump$1,dumper={dump:dump_1};function renamed(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Type=type,Schema=schema,FAILSAFE_SCHEMA=failsafe,JSON_SCHEMA=json,CORE_SCHEMA=core$1,DEFAULT_SCHEMA=_default,load=loader.load,loadAll=loader.loadAll,dump=dumper.dump,YAMLException=exception,types={binary:binary,float:float,map:map,null:_null,pairs:pairs,set:set,timestamp:timestamp,bool:bool,int:int,merge:merge$3,omap:omap,seq:seq,str:str},safeLoad=renamed("safeLoad","load"),safeLoadAll=renamed("safeLoadAll","loadAll"),safeDump=renamed("safeDump","dump"),jsYaml={Type:Type,Schema:Schema,FAILSAFE_SCHEMA:FAILSAFE_SCHEMA,JSON_SCHEMA:JSON_SCHEMA,CORE_SCHEMA:CORE_SCHEMA,DEFAULT_SCHEMA:DEFAULT_SCHEMA,load:load,loadAll:loadAll,dump:dump,YAMLException:YAMLException,types:types,safeLoad:safeLoad,safeLoadAll:safeLoadAll,safeDump:safeDump};function copyTextToClipboard(e){const t=document.activeElement,n=document.createElement("textarea");n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.width="2em",n.style.height="2em",n.style.padding="0",n.style.border="none",n.style.outline="none",n.style.boxShadow="none",n.style.background="transparent",n.value=e,document.body.appendChild(n),n.select();try{document.execCommand("copy")||console.log("Failed copy to clipboard")}catch(e){console.log("Failed copy to clipboard: "+e)}document.body.removeChild(n),t&&t.focus()}function getClipboardText(){return __awaiter$h(this,void 0,void 0,(function*(){return yield navigator.clipboard.readText()}))}function extractRowCopiedValue(e,t,n){let o=e[t];return void 0===o&&(o=_.get(e,t)),lib$5.stringifyCellValue(o,"clipboardIntent",n).value}const clipboardHeadersFormatter=e=>t=>t.join(e),clipboardTextFormatter=(e,t)=>(n,o,r)=>{const i=[];return t&&i.push(n.join(e)),i.push(...o.map((t=>{if(!t)return"";return n.map((e=>extractRowCopiedValue(t,e,null==r?void 0:r.editorTypes))).join(e)}))),i.join("\r\n")},clipboardJsonFormatter=()=>(e,t)=>JSON.stringify(t.map((t=>_.pick(t,e))),void 0,2),clipboardYamlFormatter=()=>(e,t)=>jsYaml.dump(t.map((t=>_.pick(t,e)))),clipboardJsonLinesFormatter=()=>(e,t)=>t.map((t=>JSON.stringify(_.pick(t,e)))).join("\r\n"),clipboardInsertsFormatter=()=>(e,t,n)=>{const{schemaName:o,pureName:r,driver:i}=n,a=i.createDumper();for(const n of t)a.putCmd("^insert ^into %f (%,i) ^values (%,v)",{schemaName:o,pureName:r},e,e.map((e=>n[e])));return a.s},clipboardUpdatesFormatter=()=>(e,t,n)=>{const{schemaName:o,pureName:r,driver:i,keyColumns:a}=n,s=i.createDumper();for(const n of t)s.put("^update %f ^set ",{schemaName:o,pureName:r}),s.putCollection(", ",e,(e=>s.put("%i=%v",e,n[e]))),s.put(" ^where "),s.putCollection(" ^and ",a,(e=>s.put("%i=%v",e,n[e]))),s.endCommand();return s.s},clipboardMongoInsertFormatter=()=>(e,t,n)=>{const{pureName:o}=n;return t.map((t=>`db.${o}.insert(${JSON.stringify(_.pick(t,e),void 0,2)});`)).join("\n")};function formatClipboardRows(e,t,n,o){return e in copyRowsFormatDefs?copyRowsFormatDefs[e].formatter(t,n,o):""}function copyRowsToClipboard(e,t,n,o){copyTextToClipboard(formatClipboardRows(e,t,n,o))}const copyRowsFormatDefs={textWithHeaders:{label:"Copy with headers",name:"With headers",formatter:clipboardTextFormatter("\t",!0)},textWithoutHeaders:{label:"Copy without headers",name:"Without headers",formatter:clipboardTextFormatter("\t",!1)},headers:{label:"Copy only headers",name:"Only Headers",formatter:clipboardHeadersFormatter("\t")},csv:{label:"Copy as CSV",name:"CSV",formatter:clipboardTextFormatter(",",!0)},json:{label:"Copy as JSON",name:"JSON",formatter:clipboardJsonFormatter()},jsonLines:{label:"Copy as JSON lines/NDJSON",name:"JSON lines/NDJSON",formatter:clipboardJsonLinesFormatter()},yaml:{label:"Copy as YAML",name:"YAML",formatter:clipboardYamlFormatter()},inserts:{label:"Copy as SQL INSERTs",name:"SQL INSERTs",formatter:clipboardInsertsFormatter()},updates:{label:"Copy as SQL UPDATEs",name:"SQL UPDATEs",formatter:clipboardUpdatesFormatter()},mongoInsert:{label:"Copy as Mongo INSERTs",name:"Mongo INSERTs",formatter:clipboardMongoInsertFormatter()}};function get_each_context$O(e,t,n){const o=e.slice();return o[3]=t[n],o}function create_else_block_1$c(e){let t;return{c(){t=text$1(e[0])},m(e,n){insert(e,t,n)},p(e,n){1&n&&set_data(t,e[0])},d(e){e&&detach(t)}}}function create_if_block$28(e){let t,n=e[1],o=[];for(let t=0;t<n.length;t+=1)o[t]=create_each_block$O(get_each_context$O(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=empty()},m(e,n){for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,n);insert(e,t,n)},p(e,r){if(2&r){let i;for(n=e[1],i=0;i<n.length;i+=1){const a=get_each_context$O(e,n,i);o[i]?o[i].p(a,r):(o[i]=create_each_block$O(a),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){destroy_each(o,e),e&&detach(t)}}}function create_else_block$Y(e){let t,n=e[3].text+"";return{c(){t=text$1(n)},m(e,n){insert(e,t,n)},p(e,o){2&o&&n!==(n=e[3].text+"")&&set_data(t,n)},d(e){e&&detach(t)}}}function create_if_block_1$1e(e){let t,n,o=e[3].text+"";return{c(){t=element("span"),n=text$1(o),attr(t,"class","highlight svelte-16142a0")},m(e,o){insert(e,t,o),append(t,n)},p(e,t){2&t&&o!==(o=e[3].text+"")&&set_data(n,o)},d(e){e&&detach(t)}}}function create_each_block$O(e){let t;function n(e,t){return e[3].isMatch?create_if_block_1$1e:create_else_block$Y}let o=n(e),r=o(e);return{c(){r.c(),t=empty()},m(e,n){r.m(e,n),insert(e,t,n)},p(e,i){o===(o=n(e))&&r?r.p(e,i):(r.d(1),r=o(e),r&&(r.c(),r.m(t.parentNode,t)))},d(e){r.d(e),e&&detach(t)}}}function create_fragment$57(e){let t;function n(e,t){return e[1]?create_if_block$28:create_else_block_1$c}let o=n(e),r=o(e);return{c(){r.c(),t=empty()},m(e,n){r.m(e,n),insert(e,t,n)},p(e,[i]){o===(o=n(e))&&r?r.p(e,i):(r.d(1),r=o(e),r&&(r.c(),r.m(t.parentNode,t)))},i:noop$2,o:noop$2,d(e){r.d(e),e&&detach(t)}}}function instance$52(e,t,n){let o,{text:r=""}=t,{filter:i=""}=t;return e.$$set=e=>{"text"in e&&n(0,r=e.text),"filter"in e&&n(2,i=e.filter)},e.$$.update=()=>{5&e.$$.dirty&&n(1,o=i?lib$5.tokenizeBySearchFilter(r,i):null)},[r,o,i]}class TokenizedFilteredText extends SvelteComponent{constructor(e){super(),init(this,e,instance$52,create_fragment$57,safe_not_equal,{text:0,filter:2})}}function create_if_block_10$9(e){let t,n;return t=new CheckboxField({props:{checked:!!e[25]}}),t.$on("change",e[42]),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};33554432&n[0]&&(o.checked=!!e[25]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_9$a(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:e[13]}}),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","expand-icon svelte-xyq2ga")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",stop_propagation(e[26])),r=!0)},p(e,t){const o={};8192&t[0]&&(o.icon=e[13]),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_if_block_8$c(e){let t;return{c(){t=element("span"),set_style(t,"margin-right",16*e[20]+"px")},m(e,n){insert(e,t,n)},p(e,n){1048576&n[0]&&set_style(t,"margin-right",16*e[20]+"px")},d(e){e&&detach(t)}}}function create_else_block_1$b(e){let t,n;return t=new FontIcon({props:{icon:e[0]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};1&n[0]&&(o.icon=e[0]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_7$e(e){let t,n;return t=new FontIcon({props:{icon:"icon loading"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p:noop$2,i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_6$k(e){let t,n;return t=new FontIcon({props:{style:`color:${e[16]}`,icon:"icon square"}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};65536&n[0]&&(o.style=`color:${e[16]}`),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_5$p(e){let t,n,o;return n=new FontIcon({props:{icon:e[8]}}),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","status svelte-xyq2ga")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p(e,t){const o={};256&t[0]&&(o.icon=e[8]),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block_4$w(e){let t,n,o;return n=new FontIcon({props:{icon:e[7],title:e[9]}}),n.$on("click",e[43]),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","status svelte-xyq2ga")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p(e,t){const o={};128&t[0]&&(o.icon=e[7]),512&t[0]&&(o.title=e[9]),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block_3$E(e){let t,n,o;return n=new TokenizedFilteredText({props:{text:e[11],filter:e[21]}}),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","ext-info svelte-xyq2ga")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p(e,t){const o={};2048&t[0]&&(o.text=e[11]),2097152&t[0]&&(o.filter=e[21]),n.$set(o)},i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_if_block_2$T(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:"icon pin"}}),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","pin svelte-xyq2ga")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",e[44]),r=!0)},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_if_block$27(e){let t,n,o,r;const i=[create_if_block_1$1d,create_else_block$X],a=[];function s(e,t){return e[19]?0:1}return t=s(e),n=a[t]=i[t](e),{c(){n.c(),o=empty()},m(e,n){a[t].m(e,n),insert(e,o,n),r=!0},p(e,r){let c=t;t=s(e),t===c?a[t].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),n=a[t],n?n.p(e,r):(n=a[t]=i[t](e),n.c()),transition_in(n,1),n.m(o.parentNode,o))},i(e){r||(transition_in(n),r=!0)},o(e){transition_out(n),r=!1},d(e){a[t].d(e),e&&detach(o)}}}function create_else_block$X(e){let t,n,o,r,i;return n=new FontIcon({props:{icon:"icon close"}}),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","unpin svelte-xyq2ga")},m(a,s){insert(a,t,s),mount_component(n,t,null),o=!0,r||(i=listen(t,"click",e[45]),r=!0)},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n),r=!1,i()}}}function create_if_block_1$1d(e){let t,n,o;return n=new FontIcon({props:{icon:"icon pin"}}),{c(){t=element("span"),create_component(n.$$.fragment),attr(t,"class","pin-active svelte-xyq2ga")},m(e,r){insert(e,t,r),mount_component(n,t,null),o=!0},p:noop$2,i(e){o||(transition_in(n.$$.fragment,e),o=!0)},o(e){transition_out(n.$$.fragment,e),o=!1},d(e){e&&detach(t),destroy_component(n)}}}function create_fragment$56(e){let t,n,o,r,i,a,s,c,l,u,d,p,m,f,h,g,_,$,b,y,v,x=e[14]&&create_if_block_10$9(e),w=e[13]&&create_if_block_9$a(e),C=e[20]&&create_if_block_8$c(e);const k=[create_if_block_7$e,create_else_block_1$b],S=[];function T(e,t){return e[6]?0:1}i=T(e),a=S[i]=k[i](e);let E=e[16]&&create_if_block_6$k(e);l=new TokenizedFilteredText({props:{text:e[1],filter:e[21]}});let A=e[8]&&create_if_block_5$p(e),O=e[7]&&create_if_block_4$w(e),N=e[11]&&create_if_block_3$E(e),I=e[17]&&create_if_block_2$T(e),D=e[18]&&create_if_block$27(e),M=[{class:"main"},{draggable:h=!0},e[23],{"data-testid":g=e[30]["data-testid"]}],R={};for(let e=0;e<M.length;e+=1)R=assign(R,M[e]);const L=e[35].default,F=create_slot(L,e,e[34],null);return{c(){t=element("div"),x&&x.c(),n=space(),w&&w.c(),o=space(),C&&C.c(),r=space(),a.c(),s=space(),E&&E.c(),c=space(),create_component(l.$$.fragment),u=space(),A&&A.c(),d=space(),O&&O.c(),p=space(),N&&N.c(),m=space(),I&&I.c(),f=space(),D&&D.c(),$=space(),F&&F.c(),set_attributes(t,R),toggle_class(t,"isBold",e[3]),toggle_class(t,"isGrayed",e[4]),toggle_class(t,"isChoosed",e[5]),toggle_class(t,"disableHover",e[22]),toggle_class(t,"svelte-xyq2ga",!0)},m(a,h){insert(a,t,h),x&&x.m(t,null),append(t,n),w&&w.m(t,null),append(t,o),C&&C.m(t,null),append(t,r),S[i].m(t,null),append(t,s),E&&E.m(t,null),append(t,c),mount_component(l,t,null),append(t,u),A&&A.m(t,null),append(t,d),O&&O.m(t,null),append(t,p),N&&N.m(t,null),append(t,m),I&&I.m(t,null),append(t,f),D&&D.m(t,null),e[47](t),insert(a,$,h),F&&F.m(a,h),b=!0,y||(v=[listen(t,"click",e[27]),listen(t,"mouseup",e[28]),listen(t,"mousedown",handleMouseDown),listen(t,"mousedown",e[36]),listen(t,"dblclick",e[37]),action_destroyer(_=contextMenu.call(null,t,e[15]?null:e[12])),listen(t,"dragstart",e[46]),listen(t,"dragstart",e[38]),listen(t,"dragenter",e[39]),listen(t,"dragend",e[40]),listen(t,"drop",e[41])],y=!0)},p(e,u){e[14]?x?(x.p(e,u),16384&u[0]&&transition_in(x,1)):(x=create_if_block_10$9(e),x.c(),transition_in(x,1),x.m(t,n)):x&&(group_outros(),transition_out(x,1,1,(()=>{x=null})),check_outros()),e[13]?w?(w.p(e,u),8192&u[0]&&transition_in(w,1)):(w=create_if_block_9$a(e),w.c(),transition_in(w,1),w.m(t,o)):w&&(group_outros(),transition_out(w,1,1,(()=>{w=null})),check_outros()),e[20]?C?C.p(e,u):(C=create_if_block_8$c(e),C.c(),C.m(t,r)):C&&(C.d(1),C=null);let h=i;i=T(e),i===h?S[i].p(e,u):(group_outros(),transition_out(S[h],1,1,(()=>{S[h]=null})),check_outros(),a=S[i],a?a.p(e,u):(a=S[i]=k[i](e),a.c()),transition_in(a,1),a.m(t,s)),e[16]?E?(E.p(e,u),65536&u[0]&&transition_in(E,1)):(E=create_if_block_6$k(e),E.c(),transition_in(E,1),E.m(t,c)):E&&(group_outros(),transition_out(E,1,1,(()=>{E=null})),check_outros());const $={};2&u[0]&&($.text=e[1]),2097152&u[0]&&($.filter=e[21]),l.$set($),e[8]?A?(A.p(e,u),256&u[0]&&transition_in(A,1)):(A=create_if_block_5$p(e),A.c(),transition_in(A,1),A.m(t,d)):A&&(group_outros(),transition_out(A,1,1,(()=>{A=null})),check_outros()),e[7]?O?(O.p(e,u),128&u[0]&&transition_in(O,1)):(O=create_if_block_4$w(e),O.c(),transition_in(O,1),O.m(t,p)):O&&(group_outros(),transition_out(O,1,1,(()=>{O=null})),check_outros()),e[11]?N?(N.p(e,u),2048&u[0]&&transition_in(N,1)):(N=create_if_block_3$E(e),N.c(),transition_in(N,1),N.m(t,m)):N&&(group_outros(),transition_out(N,1,1,(()=>{N=null})),check_outros()),e[17]?I?(I.p(e,u),131072&u[0]&&transition_in(I,1)):(I=create_if_block_2$T(e),I.c(),transition_in(I,1),I.m(t,f)):I&&(group_outros(),transition_out(I,1,1,(()=>{I=null})),check_outros()),e[18]?D?(D.p(e,u),262144&u[0]&&transition_in(D,1)):(D=create_if_block$27(e),D.c(),transition_in(D,1),D.m(t,null)):D&&(group_outros(),transition_out(D,1,1,(()=>{D=null})),check_outros()),set_attributes(t,R=get_spread_update(M,[{class:"main"},{draggable:true},8388608&u[0]&&e[23],(!b||1073741824&u[0]&&g!==(g=e[30]["data-testid"]))&&{"data-testid":g}])),_&&is_function(_.update)&&36864&u[0]&&_.update.call(null,e[15]?null:e[12]),toggle_class(t,"isBold",e[3]),toggle_class(t,"isGrayed",e[4]),toggle_class(t,"isChoosed",e[5]),toggle_class(t,"disableHover",e[22]),toggle_class(t,"svelte-xyq2ga",!0),F&&F.p&&(!b||8&u[1])&&update_slot_base(F,L,e,e[34],b?get_slot_changes(L,e[34],u,null):get_all_dirty_from_scope(e[34]),null)},i(e){b||(transition_in(x),transition_in(w),transition_in(a),transition_in(E),transition_in(l.$$.fragment,e),transition_in(A),transition_in(O),transition_in(N),transition_in(I),transition_in(D),transition_in(F,e),b=!0)},o(e){transition_out(x),transition_out(w),transition_out(a),transition_out(E),transition_out(l.$$.fragment,e),transition_out(A),transition_out(O),transition_out(N),transition_out(I),transition_out(D),transition_out(F,e),b=!1},d(n){n&&detach(t),x&&x.d(),w&&w.d(),C&&C.d(),S[i].d(),E&&E.d(),destroy_component(l),A&&A.d(),O&&O.d(),N&&N.d(),I&&I.d(),D&&D.d(),e[47](null),n&&detach($),F&&F.d(n),y=!1,run_all(v)}}}function handleMouseDown(e){1==e.button&&(e.preventDefault(),e.stopPropagation())}function instance$51(e,t,n){let o,r,i=noop$2,a=()=>(i(),i=subscribe(k,(e=>n(33,r=e))),k);e.$$.on_destroy.push((()=>i()));let{$$slots:s={},$$scope:c}=t;const l=createEventDispatcher();let{icon:u}=t,{title:d}=t,{data:p=null}=t,{module:m=null}=t,{isBold:f=!1}=t,{isGrayed:h=!1}=t,{isChoosed:g=!1}=t,{isBusy:_=!1}=t,{statusIcon:$}=t,{statusIconBefore:b}=t,{statusTitle:y}=t,{statusTitleToCopy:v}=t,{extInfo:x}=t,{menu:w}=t,{expandIcon:C}=t,{checkedObjectsStore:k=null}=t;a();let S,{disableContextMenu:T=!1}=t,{colorMark:E=null}=t,{onPin:A=null}=t,{onUnpin:O=null}=t,{showPinnedInsteadOfUnpin:N=!1}=t,{indentLevel:I=0}=t,{disableBoldScroll:D=!1}=t,{filter:M=null}=t,{disableHover:R=!1}=t,{divProps:L={}}=t;function F(e){!e&&o&&k.update((e=>e.filter((e=>(null==m?void 0:m.extractKey(p))!=(null==m?void 0:m.extractKey(e)))))),e&&!o&&k.update((e=>[...e,p]))}return e.$$set=e=>{n(30,t=assign(assign({},t),exclude_internal_props(e))),"icon"in e&&n(0,u=e.icon),"title"in e&&n(1,d=e.title),"data"in e&&n(2,p=e.data),"module"in e&&n(31,m=e.module),"isBold"in e&&n(3,f=e.isBold),"isGrayed"in e&&n(4,h=e.isGrayed),"isChoosed"in e&&n(5,g=e.isChoosed),"isBusy"in e&&n(6,_=e.isBusy),"statusIcon"in e&&n(7,$=e.statusIcon),"statusIconBefore"in e&&n(8,b=e.statusIconBefore),"statusTitle"in e&&n(9,y=e.statusTitle),"statusTitleToCopy"in e&&n(10,v=e.statusTitleToCopy),"extInfo"in e&&n(11,x=e.extInfo),"menu"in e&&n(12,w=e.menu),"expandIcon"in e&&n(13,C=e.expandIcon),"checkedObjectsStore"in e&&a(n(14,k=e.checkedObjectsStore)),"disableContextMenu"in e&&n(15,T=e.disableContextMenu),"colorMark"in e&&n(16,E=e.colorMark),"onPin"in e&&n(17,A=e.onPin),"onUnpin"in e&&n(18,O=e.onUnpin),"showPinnedInsteadOfUnpin"in e&&n(19,N=e.showPinnedInsteadOfUnpin),"indentLevel"in e&&n(20,I=e.indentLevel),"disableBoldScroll"in e&&n(32,D=e.disableBoldScroll),"filter"in e&&n(21,M=e.filter),"disableHover"in e&&n(22,R=e.disableHover),"divProps"in e&&n(23,L=e.divProps),"$$scope"in e&&n(34,c=e.$$scope)},e.$$.update=()=>{16388&e.$$.dirty[0]|5&e.$$.dirty[1]&&n(25,o=k&&r.find((e=>(null==m?void 0:m.extractKey(p))==(null==m?void 0:m.extractKey(e))))),16777224&e.$$.dirty[0]|2&e.$$.dirty[1]&&f&&S&&!D&&S.scrollIntoView({block:"nearest",inline:"nearest"}),16777248&e.$$.dirty[0]&&g&&S&&S.scrollIntoView({block:"nearest",inline:"nearest"})},t=exclude_internal_props(t),[u,d,p,f,h,g,_,$,b,y,v,x,w,C,k,T,E,A,O,N,I,M,R,L,S,o,function(){l("expand")},function(){k?o?k.update((e=>e.filter((e=>(null==m?void 0:m.extractKey(p))!=(null==m?void 0:m.extractKey(e)))))):k.update((e=>[...e,p])):l("click")},function(e){1==e.button&&(l("middleclick"),e.preventDefault(),e.stopPropagation())},F,t,m,D,r,c,s,function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},function(t){bubble.call(this,e,t)},e=>{F(e.target.checked)},()=>{v&&(copyTextToClipboard(v),showSnackbarSuccess("Copied to clipboard"))},e=>{e.preventDefault(),e.stopPropagation(),A()},e=>{e.preventDefault(),e.stopPropagation(),O()},e=>{e.dataTransfer.setData("app_object_drag_data",JSON.stringify(p))},function(e){binding_callbacks[e?"unshift":"push"]((()=>{S=e,n(24,S)}))}]}class AppObjectCore extends SvelteComponent{constructor(e){super(),init(this,e,instance$51,create_fragment$56,safe_not_equal,{icon:0,title:1,data:2,module:31,isBold:3,isGrayed:4,isChoosed:5,isBusy:6,statusIcon:7,statusIconBefore:8,statusTitle:9,statusTitleToCopy:10,extInfo:11,menu:12,expandIcon:13,checkedObjectsStore:14,disableContextMenu:15,colorMark:16,onPin:17,onUnpin:18,showPinnedInsteadOfUnpin:19,indentLevel:20,disableBoldScroll:32,filter:21,disableHover:22,divProps:23},null,[-1,-1])}}function fullDisplayName({schemaName:e,pureName:t}){return e?`${e}.${t}`:t}function create_fragment$55(e){let t,n,o,r,i,a,s,c,l;o=new FontIcon({props:{icon:e[0]}});const u=e[6].default,d=create_slot(u,e,e[5],null);return{c(){t=element("div"),n=element("div"),create_component(o.$$.fragment),r=space(),i=element("div"),d&&d.c(),attr(n,"class","icon svelte-1nx9a1b"),attr(i,"class","inner svelte-1nx9a1b"),attr(t,"class","button svelte-1nx9a1b"),attr(t,"data-testid",a=e[4]["data-testid"]),toggle_class(t,"disabled",e[1]),toggle_class(t,"fillHorizontal",e[2])},m(a,u){insert(a,t,u),append(t,n),mount_component(o,n,null),append(t,r),append(t,i),d&&d.m(i,null),s=!0,c||(l=listen(t,"click",e[3]),c=!0)},p(e,[n]){const r={};1&n&&(r.icon=e[0]),o.$set(r),d&&d.p&&(!s||32&n)&&update_slot_base(d,u,e,e[5],s?get_slot_changes(u,e[5],n,null):get_all_dirty_from_scope(e[5]),null),(!s||16&n&&a!==(a=e[4]["data-testid"]))&&attr(t,"data-testid",a),(!s||2&n)&&toggle_class(t,"disabled",e[1]),(!s||4&n)&&toggle_class(t,"fillHorizontal",e[2])},i(e){s||(transition_in(o.$$.fragment,e),transition_in(d,e),s=!0)},o(e){transition_out(o.$$.fragment,e),transition_out(d,e),s=!1},d(e){e&&detach(t),destroy_component(o),d&&d.d(e),c=!1,l()}}}function instance$50(e,t,n){let{$$slots:o={},$$scope:r}=t,{icon:i}=t,{disabled:a=!1}=t,{fillHorizontal:s=!1}=t;const c=createEventDispatcher();return e.$$set=e=>{n(4,t=assign(assign({},t),exclude_internal_props(e))),"icon"in e&&n(0,i=e.icon),"disabled"in e&&n(1,a=e.disabled),"fillHorizontal"in e&&n(2,s=e.fillHorizontal),"$$scope"in e&&n(5,r=e.$$scope)},t=exclude_internal_props(t),[i,a,s,function(){a||c("click")},t,r,o]}class LargeButton extends SvelteComponent{constructor(e){super(),init(this,e,instance$50,create_fragment$55,safe_not_equal,{icon:0,disabled:1,fillHorizontal:2})}}function create_fragment$54(e){let t,n;const o=e[2].default,r=create_slot(o,e,e[1],null);return{c(){t=element("div"),r&&r.c(),attr(t,"class","svelte-1i04ur4"),toggle_class(t,"noMargin",e[0])},m(e,o){insert(e,t,o),r&&r.m(t,null),n=!0},p(e,[i]){r&&r.p&&(!n||2&i)&&update_slot_base(r,o,e,e[1],n?get_slot_changes(o,e[1],i,null):get_all_dirty_from_scope(e[1]),null),(!n||1&i)&&toggle_class(t,"noMargin",e[0])},i(e){n||(transition_in(r,e),n=!0)},o(e){transition_out(r,e),n=!1},d(e){e&&detach(t),r&&r.d(e)}}}function instance$4$(e,t,n){let{$$slots:o={},$$scope:r}=t,{noMargin:i=!1}=t;return e.$$set=e=>{"noMargin"in e&&n(0,i=e.noMargin),"$$scope"in e&&n(1,r=e.$$scope)},[i,r,o]}class SearchBoxWrapper extends SvelteComponent{constructor(e){super(),init(this,e,instance$4$,create_fragment$54,safe_not_equal,{noMargin:0})}}function create_else_block$W(e){let t,n,o,r,i,a,s,c,l,u=[e[3]],d={};for(let e=0;e<u.length;e+=1)d=assign(d,u[e]);let p=[{class:"label"},e[3]],m={};for(let e=0;e<p.length;e+=1)m=assign(m,p[e]);const f=e[6].default,h=create_slot(f,e,e[5],null);return{c(){t=element("div"),n=element("div"),o=element("span"),r=text$1(e[1]),i=space(),a=element("div"),h&&h.c(),set_attributes(o,d),toggle_class(o,"disabled",e[2]),toggle_class(o,"svelte-9r8t4s",!0),attr(n,"class","label svelte-9r8t4s"),set_attributes(t,m),toggle_class(t,"svelte-9r8t4s",!0),attr(a,"class","value svelte-9r8t4s")},m(u,d){insert(u,t,d),append(t,n),append(n,o),append(o,r),insert(u,i,d),insert(u,a,d),h&&h.m(a,null),s=!0,c||(l=[listen(o,"click",(function(){is_function(e[3].onClick)&&e[3].onClick.apply(this,arguments)})),listen(t,"click",(function(){is_function(e[3].onClick)&&e[3].onClick.apply(this,arguments)}))],c=!0)},p(n,i){e=n,(!s||2&i)&&set_data_maybe_contenteditable(r,e[1],d.contenteditable),set_attributes(o,d=get_spread_update(u,[8&i&&e[3]])),toggle_class(o,"disabled",e[2]),toggle_class(o,"svelte-9r8t4s",!0),set_attributes(t,m=get_spread_update(p,[{class:"label"},8&i&&e[3]])),toggle_class(t,"svelte-9r8t4s",!0),h&&h.p&&(!s||32&i)&&update_slot_base(h,f,e,e[5],s?get_slot_changes(f,e[5],i,null):get_all_dirty_from_scope(e[5]),null)},i(e){s||(transition_in(h,e),s=!0)},o(e){transition_out(h,e),s=!1},d(e){e&&detach(t),e&&detach(i),e&&detach(a),h&&h.d(e),c=!1,run_all(l)}}}function create_if_block$26(e){let t,n,o,r,i,a;const s=e[6].default,c=create_slot(s,e,e[5],null);let l=[e[3],{class:"checkLabel"}],u={};for(let e=0;e<l.length;e+=1)u=assign(u,l[e]);return{c(){c&&c.c(),t=space(),n=element("span"),o=text$1(e[1]),set_attributes(n,u),toggle_class(n,"disabled",e[2]),toggle_class(n,"svelte-9r8t4s",!0)},m(s,l){c&&c.m(s,l),insert(s,t,l),insert(s,n,l),append(n,o),r=!0,i||(a=listen(n,"click",(function(){is_function(e[3].onClick)&&e[3].onClick.apply(this,arguments)})),i=!0)},p(t,i){e=t,c&&c.p&&(!r||32&i)&&update_slot_base(c,s,e,e[5],r?get_slot_changes(s,e[5],i,null):get_all_dirty_from_scope(e[5]),null),(!r||2&i)&&set_data_maybe_contenteditable(o,e[1],u.contenteditable),set_attributes(n,u=get_spread_update(l,[8&i&&e[3],{class:"checkLabel"}])),toggle_class(n,"disabled",e[2]),toggle_class(n,"svelte-9r8t4s",!0)},i(e){r||(transition_in(c,e),r=!0)},o(e){transition_out(c,e),r=!1},d(e){c&&c.d(e),e&&detach(t),e&&detach(n),i=!1,a()}}}function create_fragment$53(e){let t,n,o,r;const i=[create_if_block$26,create_else_block$W],a=[];function s(e,t){return"checkbox"==e[0]?0:1}return n=s(e),o=a[n]=i[n](e),{c(){t=element("div"),o.c(),attr(t,"class","row svelte-9r8t4s")},m(e,o){insert(e,t,o),a[n].m(t,null),r=!0},p(e,[r]){let c=n;n=s(e),n===c?a[n].p(e,r):(group_outros(),transition_out(a[c],1,1,(()=>{a[c]=null})),check_outros(),o=a[n],o?o.p(e,r):(o=a[n]=i[n](e),o.c()),transition_in(o,1),o.m(t,null))},i(e){r||(transition_in(o),r=!0)},o(e){transition_out(o),r=!1},d(e){e&&detach(t),a[n].d()}}}function instance$4_(e,t,n){let{$$slots:o={},$$scope:r}=t,{type:i}=t,{label:a}=t,{noMargin:s}=t,{disabled:c=!1}=t,{labelProps:l={}}=t;return e.$$set=e=>{"type"in e&&n(0,i=e.type),"label"in e&&n(1,a=e.label),"noMargin"in e&&n(4,s=e.noMargin),"disabled"in e&&n(2,c=e.disabled),"labelProps"in e&&n(3,l=e.labelProps),"$$scope"in e&&n(5,r=e.$$scope)},[i,a,c,l,s,r,o]}class FormFieldTemplateTiny extends SvelteComponent{constructor(e){super(),init(this,e,instance$4_,create_fragment$53,safe_not_equal,{type:0,label:1,noMargin:4,disabled:2,labelProps:3})}}var ace$1={exports:{}};!function(e,t){!function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,o){"string"==typeof e?(2==arguments.length&&(o=n),t.modules[e]||(t.payloads[e]=o,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n=function(e,t,n){if("string"==typeof t){var r=i(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var a=[],s=0,c=t.length;s<c;++s){var l=i(e,t[s]);if(null==l&&o.original)return;a.push(l)}return n&&n.apply(null,a)||!0}},o=function(e,t){var r=n("",e,t);return null==r&&o.original?o.original.apply(this,arguments):r},r=function(e,t){if(-1!==t.indexOf("!")){var n=t.split("!");return r(e,n[0])+"!"+r(e,n[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&o!=t;){var o=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},i=function(e,o){o=r(e,o);var i=t.modules[o];if(!i){if("function"==typeof(i=t.payloads[o])){var a={},s={id:o,uri:"",exports:a,packaged:!0};a=i((function(e,t){return n(o,e,t)}),a,s)||s.exports,t.modules[o]=a,delete t.payloads[o]}i=t.modules[o]=a||i}return i};!function(n){var r=e;n&&(e[n]||(e[n]={}),r=e[n]),r.define&&r.define.packaged||(t.original=r.define,r.define=t,r.define.packaged=!0),r.require&&r.require.packaged||(o.original=r.require,r.require=o,r.require.packaged=!0)}("ace")}(),ace.define("ace/lib/es6-shim",["require","exports","module"],(function(e,t,n){function o(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||o(String.prototype,"startsWith",(function(e,t){return t=t||0,this.lastIndexOf(e,t)===t})),String.prototype.endsWith||o(String.prototype,"endsWith",(function(e,t){var n=this;(void 0===t||t>n.length)&&(t=n.length),t-=e.length;var o=n.indexOf(e,t);return-1!==o&&o===t})),String.prototype.repeat||o(String.prototype,"repeat",(function(e){for(var t="",n=this;e>0;)1&e&&(t+=n),(e>>=1)&&(n+=n);return t})),String.prototype.includes||o(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];null!=o&&Object.keys(o).forEach((function(e){t[e]=o[e]}))}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map((function(t){return e[t]}))}),Array.prototype.find||o(Array.prototype,"find",(function(e){for(var t=this.length,n=arguments[1],o=0;o<t;o++){var r=this[o];if(e.call(n,r,o,this))return r}})),Array.prototype.findIndex||o(Array.prototype,"findIndex",(function(e){for(var t=this.length,n=arguments[1],o=0;o<t;o++){var r=this[o];if(e.call(n,r,o,this))return o}})),Array.prototype.includes||o(Array.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Array.prototype.fill||o(Array.prototype,"fill",(function(e){for(var t=this,n=t.length>>>0,o=arguments[1]|0,r=o<0?Math.max(n+o,0):Math.min(o,n),i=arguments[2],a=void 0===i?n:i|0,s=a<0?Math.max(n+a,0):Math.min(a,n);r<s;)t[r]=e,r++;return t})),Array.of||o(Array,"of",(function(){return Array.prototype.slice.call(arguments)}))})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],(function(e,t,n){e("./es6-shim")})),ace.define("ace/lib/deep_copy",["require","exports","module"],(function(e,t,n){t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(var o=0;o<t.length;o++)n[o]=e(t[o]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var o in n={},t)n[o]=e(t[o]);return n}})),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],(function(e,t,n){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";t>0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var o=/^\s\s*/,r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(o,"")},t.stringTrimRight=function(e){return e.replace(r,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,o=e.length;n<o;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,(function(e){n.push({offset:arguments[arguments.length-2],length:e.length})})),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},o=function(e){return o.cancel(),t=setTimeout(n,e||0),o};return o.schedule=o,o.call=function(){return this.cancel(),e(),o},o.cancel=function(){return clearTimeout(t),t=null,o},o.isPending=function(){return t},o},t.delayedCall=function(e,t){var n=null,o=function(){n=null,e()},r=function(e){null==n&&(n=setTimeout(o,e||t))};return r.delay=function(e){n&&clearTimeout(n),n=setTimeout(o,e||t)},r.schedule=r,r.call=function(){this.cancel(),e()},r.cancel=function(){n&&clearTimeout(n),n=null},r.isPending=function(){return n},r},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return!1}return!0},t.skipEmptyMatch=function(e,t,n){return n&&e.codePointAt(t)>65535?2:1}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,n){t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var o="object"==typeof navigator?navigator:{},r=(/mac|win|linux/i.exec(o.platform)||["other"])[0].toLowerCase(),i=o.userAgent||"",a=o.appName||"";t.isWin="win"==r,t.isMac="mac"==r,t.isLinux="linux"==r,t.isIE="Microsoft Internet Explorer"==a||a.indexOf("MSAppHost")>=0?parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=i.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(i.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(i.split(" Chrome/")[1])||void 0,t.isSafari=parseFloat(i.split(" Safari/")[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(i.split(" Edge/")[1])||void 0,t.isAIR=i.indexOf("AdobeAIR")>=0,t.isAndroid=i.indexOf("Android")>=0,t.isChromeOS=i.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(i)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,n){var o,r=e("./useragent");t.buildDom=function e(t,n,o){if("string"==typeof t&&t){var r=document.createTextNode(t);return n&&n.appendChild(r),r}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var i=[],a=0;a<t.length;a++){var s=e(t[a],n,o);s&&i.push(s)}return i}var c=document.createElement(t[0]),l=t[1],u=1;l&&"object"==typeof l&&!Array.isArray(l)&&(u=2);for(a=u;a<t.length;a++)e(t[a],c,o);return 2==u&&Object.keys(l).forEach((function(e){var t=l[e];"class"===e?c.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?c[e]=t:"ref"===e?o&&(o[t]=c):"style"===e?"string"==typeof t&&(c.style.cssText=t):null!=t&&c.setAttribute(e,t)})),n&&n.appendChild(c),c},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\s+/g);;){var o=n.indexOf(t);if(-1==o)break;n.splice(o,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\s+/g),o=!0;;){var r=n.indexOf(t);if(-1==r)break;o=!1,n.splice(r,1)}return o&&n.push(t),e.className=n.join(" "),o},t.setCssClass=function(e,n,o){o?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n,o=0;if(n=(t=t||document).querySelectorAll("style"))for(;o<n.length;)if(n[o++].id===e)return!0},t.removeElementById=function(e,t){(t=t||document).getElementById(e)&&t.getElementById(e).remove()};var i=[];function a(){var e=i;i=null,e&&e.forEach((function(e){s(e[0],e[1])}))}function s(e,n,r){if("undefined"!=typeof document){if(i)if(r)a();else if(!1===r)return i.push([e,n]);if(!o){var s=r;r&&r.getRootNode&&(s=r.getRootNode())&&s!=r||(s=document);var c=s.ownerDocument||s;if(n&&t.hasCssString(n,s))return null;n&&(e+="\n/*# sourceURL=ace/css/"+n+" */");var l=t.createElement("style");l.appendChild(c.createTextNode(e)),n&&(l.id=n),s==c&&(s=t.getDocumentHead(c)),s.insertBefore(l,s.firstChild)}}}if(t.useStrictCSP=function(e){o=e,0==e?a():i||(i=[])},t.importCssString=s,t.importCssStylsheet=function(e,n){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(n))},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var o=t.createElement("ace_outer"),r=o.style;r.position="absolute",r.left="-10000px",r.overflow="hidden",r.width="200px",r.minWidth="0px",r.height="150px",r.display="block",o.appendChild(n);var i=e&&e.documentElement||document&&document.documentElement;if(!i)return 0;i.appendChild(o);var a=n.offsetWidth;r.overflow="scroll";var s=n.offsetWidth;return a===s&&(s=o.clientWidth),i.removeChild(o),a-s},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!r.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,r.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document){var c=document.createElement("div");t.HI_DPI&&void 0!==c.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===c.style.animationName||(t.HAS_CSS_ANIMATION=!0),c=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,n){
|