diff --git a/CHANGELOG.md b/CHANGELOG.md index c4318de57..cd4b3e61a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### [UNRELEASED] -### Breaking Changes - -### New features - ### Bug fixes -### Other changes +* Fixed an issue with output spinners only showing for a split second. (#1429) ## [0.10.1] - 2024-05-23 diff --git a/shiny/www/shared/_version.json b/shiny/www/shared/_version.json index 7084d4649..fe098c430 100644 --- a/shiny/www/shared/_version.json +++ b/shiny/www/shared/_version.json @@ -1,5 +1,5 @@ { "note!": "This file is auto-generated by scripts/htmlDependencies.R", "package": "shiny", - "version": "Github (rstudio/shiny@4a8400d2a55127c4ba0f2f2debc8280225326c3f)" + "version": "Github (rstudio/shiny@e689cdc522c65da37342d9348266f50c8d4b3949)" } diff --git a/shiny/www/shared/bootstrap/_version.json b/shiny/www/shared/bootstrap/_version.json index cc866a981..e0883c904 100644 --- a/shiny/www/shared/bootstrap/_version.json +++ b/shiny/www/shared/bootstrap/_version.json @@ -1,6 +1,6 @@ { "note!": "This file is auto-generated by scripts/htmlDependencies.R", - "shiny_version": "Github (rstudio/shiny@4a8400d2a55127c4ba0f2f2debc8280225326c3f)", + "shiny_version": "Github (rstudio/shiny@e689cdc522c65da37342d9348266f50c8d4b3949)", "bslib_version": "Github (rstudio/bslib@3dd55fd7249d30ecddac8f98ba8dc70aee0b3459)", "htmltools_version": "Github (rstudio/htmltools@487aa0bed7313d7597b6edd5810e53cab0061198)", "bootstrap_version": "5.3.1" diff --git a/shiny/www/shared/busy-indicators/busy-indicators.css b/shiny/www/shared/busy-indicators/busy-indicators.css index 3785a33d2..3165efb7f 100644 --- a/shiny/www/shared/busy-indicators/busy-indicators.css +++ b/shiny/www/shared/busy-indicators/busy-indicators.css @@ -1,2 +1,2 @@ /*! shiny 1.8.1.9001 | (c) 2012-2024 RStudio, PBC. | License: GPL-3 | file LICENSE */ -:where([data-shiny-busy-spinners] .recalculating){position:relative}[data-shiny-busy-spinners] .recalculating{opacity:1}[data-shiny-busy-spinners] .recalculating:after{position:absolute;content:"";--_shiny-spinner-url: var(--shiny-spinner-url, url(spinners/ring.svg));--_shiny-spinner-color: var(--shiny-spinner-color, var(--bs-primary, #007bc2));--_shiny-spinner-size: var(--shiny-spinner-size, 32px);--_shiny-spinner-delay: var(--shiny-spinner-delay, 1s);background:var(--_shiny-spinner-color);width:var(--_shiny-spinner-size);height:var(--_shiny-spinner-size);inset:calc(50% - var(--_shiny-spinner-size) / 2);mask-image:var(--_shiny-spinner-url);-webkit-mask-image:var(--_shiny-spinner-url);opacity:0;animation-delay:var(--_shiny-spinner-delay);animation-name:fade-in;animation-duration:.25s}[data-shiny-busy-spinners] .recalculating>*:not(.recalculating){opacity:.2;transition:opacity .25s ease var(--shiny-spinner-delay, 1s)}[data-shiny-busy-spinners] .recalculating.shiny-html-output:after{display:none}[data-shiny-busy-spinners][data-shiny-busy-pulse].shiny-busy:after{--_shiny-pulse-background: var( --shiny-pulse-background, linear-gradient( 120deg, var(--bs-body-bg, #fff), var(--bs-indigo, #4b00c1), var(--bs-purple, #74149c), var(--bs-pink, #bf007f), var(--bs-body-bg, #fff) ) );--_shiny-pulse-height: var(--shiny-pulse-height, 5px);--_shiny-pulse-speed: var(--shiny-pulse-speed, 1.85s);position:fixed;top:0;left:0;height:var(--_shiny-pulse-height);background:var(--_shiny-pulse-background);z-index:9999;animation-name:busy-page-pulse;animation-duration:var(--_shiny-pulse-speed);animation-iteration-count:infinite;animation-timing-function:ease-in-out;content:""}[data-shiny-busy-spinners][data-shiny-busy-pulse].shiny-busy:has(.recalculating):after{display:none}[data-shiny-busy-spinners][data-shiny-busy-pulse].shiny-busy:has(#shiny-disconnected-overlay):after{display:none}[data-shiny-busy-pulse]:not([data-shiny-busy-spinners]).shiny-busy:after{--_shiny-pulse-background: var( --shiny-pulse-background, linear-gradient( 120deg, var(--bs-body-bg, #fff), var(--bs-indigo, #4b00c1), var(--bs-purple, #74149c), var(--bs-pink, #bf007f), var(--bs-body-bg, #fff) ) );--_shiny-pulse-height: var(--shiny-pulse-height, 5px);--_shiny-pulse-speed: var(--shiny-pulse-speed, 1.85s);position:fixed;top:0;left:0;height:var(--_shiny-pulse-height);background:var(--_shiny-pulse-background);z-index:9999;animation-name:busy-page-pulse;animation-duration:var(--_shiny-pulse-speed);animation-iteration-count:infinite;animation-timing-function:ease-in-out;content:""}[data-shiny-busy-pulse]:not([data-shiny-busy-spinners]).shiny-busy:has(#shiny-disconnected-overlay):after{display:none}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes busy-page-pulse{0%{left:-75%;width:75%}50%{left:100%;width:75%}to{left:-75%;width:75%}} +:where([data-shiny-busy-spinners] .recalculating){position:relative}[data-shiny-busy-spinners] .recalculating{opacity:1}[data-shiny-busy-spinners] .recalculating:after{position:absolute;content:"";--_shiny-spinner-url: var(--shiny-spinner-url, url(spinners/ring.svg));--_shiny-spinner-color: var(--shiny-spinner-color, var(--bs-primary, #007bc2));--_shiny-spinner-size: var(--shiny-spinner-size, 32px);--_shiny-spinner-delay: var(--shiny-spinner-delay, 1s);background:var(--_shiny-spinner-color);width:var(--_shiny-spinner-size);height:var(--_shiny-spinner-size);inset:calc(50% - var(--_shiny-spinner-size) / 2);mask-image:var(--_shiny-spinner-url);-webkit-mask-image:var(--_shiny-spinner-url);opacity:0;animation-delay:var(--_shiny-spinner-delay);animation-name:fade-in;animation-duration:.25s;animation-fill-mode:forwards}[data-shiny-busy-spinners] .recalculating>*:not(.recalculating){opacity:.2;transition:opacity .25s ease var(--shiny-spinner-delay, 1s)}[data-shiny-busy-spinners] .recalculating.shiny-html-output:after{display:none}[data-shiny-busy-spinners][data-shiny-busy-pulse].shiny-busy:after{--_shiny-pulse-background: var( --shiny-pulse-background, linear-gradient( 120deg, var(--bs-body-bg, #fff), var(--bs-indigo, #4b00c1), var(--bs-purple, #74149c), var(--bs-pink, #bf007f), var(--bs-body-bg, #fff) ) );--_shiny-pulse-height: var(--shiny-pulse-height, 5px);--_shiny-pulse-speed: var(--shiny-pulse-speed, 1.85s);position:fixed;top:0;left:0;height:var(--_shiny-pulse-height);background:var(--_shiny-pulse-background);z-index:9999;animation-name:busy-page-pulse;animation-duration:var(--_shiny-pulse-speed);animation-iteration-count:infinite;animation-timing-function:ease-in-out;content:""}[data-shiny-busy-spinners][data-shiny-busy-pulse].shiny-busy:has(.recalculating):after{display:none}[data-shiny-busy-spinners][data-shiny-busy-pulse].shiny-busy:has(#shiny-disconnected-overlay):after{display:none}[data-shiny-busy-pulse]:not([data-shiny-busy-spinners]).shiny-busy:after{--_shiny-pulse-background: var( --shiny-pulse-background, linear-gradient( 120deg, var(--bs-body-bg, #fff), var(--bs-indigo, #4b00c1), var(--bs-purple, #74149c), var(--bs-pink, #bf007f), var(--bs-body-bg, #fff) ) );--_shiny-pulse-height: var(--shiny-pulse-height, 5px);--_shiny-pulse-speed: var(--shiny-pulse-speed, 1.85s);position:fixed;top:0;left:0;height:var(--_shiny-pulse-height);background:var(--_shiny-pulse-background);z-index:9999;animation-name:busy-page-pulse;animation-duration:var(--_shiny-pulse-speed);animation-iteration-count:infinite;animation-timing-function:ease-in-out;content:""}[data-shiny-busy-pulse]:not([data-shiny-busy-spinners]).shiny-busy:has(#shiny-disconnected-overlay):after{display:none}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes busy-page-pulse{0%{left:-75%;width:75%}50%{left:100%;width:75%}to{left:-75%;width:75%}} diff --git a/shiny/www/shared/shiny.js b/shiny/www/shared/shiny.js index f13a922c7..ae3560565 100644 --- a/shiny/www/shared/shiny.js +++ b/shiny/www/shared/shiny.js @@ -30,13 +30,6 @@ ); }; - // globals:jquery - var require_jquery = __commonJS({ - "globals:jquery": function(exports, module) { - module.exports = window.jQuery; - } - }); - // node_modules/core-js/internals/global.js var require_global = __commonJS({ "node_modules/core-js/internals/global.js": function(exports, module) { @@ -1626,6 +1619,13 @@ } }); + // globals:jquery + var require_jquery = __commonJS({ + "globals:jquery": function(exports, module) { + module.exports = window.jQuery; + } + }); + // node_modules/core-js/internals/object-to-string.js var require_object_to_string = __commonJS({ "node_modules/core-js/internals/object-to-string.js": function(exports, module) { @@ -4292,16 +4292,6 @@ } }); - // node_modules/core-js/internals/is-data-descriptor.js - var require_is_data_descriptor = __commonJS({ - "node_modules/core-js/internals/is-data-descriptor.js": function(exports, module) { - var hasOwn5 = require_has_own_property(); - module.exports = function(descriptor) { - return descriptor !== void 0 && (hasOwn5(descriptor, "value") || hasOwn5(descriptor, "writable")); - }; - } - }); - // node_modules/core-js/internals/call-with-safe-iteration-closing.js var require_call_with_safe_iteration_closing = __commonJS({ "node_modules/core-js/internals/call-with-safe-iteration-closing.js": function(exports, module) { @@ -4365,6 +4355,16 @@ } }); + // node_modules/core-js/internals/is-data-descriptor.js + var require_is_data_descriptor = __commonJS({ + "node_modules/core-js/internals/is-data-descriptor.js": function(exports, module) { + var hasOwn5 = require_has_own_property(); + module.exports = function(descriptor) { + return descriptor !== void 0 && (hasOwn5(descriptor, "value") || hasOwn5(descriptor, "writable")); + }; + } + }); + // node_modules/core-js/internals/same-value.js var require_same_value = __commonJS({ "node_modules/core-js/internals/same-value.js": function(exports, module) { @@ -4408,17 +4408,13 @@ } }); - // node_modules/core-js/internals/is-regexp.js - var require_is_regexp = __commonJS({ - "node_modules/core-js/internals/is-regexp.js": function(exports, module) { - var isObject6 = require_is_object(); - var classof2 = require_classof_raw(); - var wellKnownSymbol7 = require_well_known_symbol(); - var MATCH2 = wellKnownSymbol7("match"); - module.exports = function(it) { - var isRegExp3; - return isObject6(it) && ((isRegExp3 = it[MATCH2]) !== void 0 ? !!isRegExp3 : classof2(it) == "RegExp"); - }; + // node_modules/core-js/internals/freezing.js + var require_freezing = __commonJS({ + "node_modules/core-js/internals/freezing.js": function(exports, module) { + var fails16 = require_fails(); + module.exports = !fails16(function() { + return Object.isExtensible(Object.preventExtensions({})); + }); } }); @@ -4457,16 +4453,6 @@ } }); - // node_modules/core-js/internals/freezing.js - var require_freezing = __commonJS({ - "node_modules/core-js/internals/freezing.js": function(exports, module) { - var fails16 = require_fails(); - module.exports = !fails16(function() { - return Object.isExtensible(Object.preventExtensions({})); - }); - } - }); - // node_modules/core-js/internals/internal-metadata.js var require_internal_metadata = __commonJS({ "node_modules/core-js/internals/internal-metadata.js": function(exports, module) { @@ -4551,6 +4537,18 @@ } }); + // node_modules/core-js/internals/define-built-ins.js + var require_define_built_ins = __commonJS({ + "node_modules/core-js/internals/define-built-ins.js": function(exports, module) { + var defineBuiltIn5 = require_define_built_in(); + module.exports = function(target, src, options) { + for (var key in src) + defineBuiltIn5(target, key, src[key], options); + return target; + }; + } + }); + // node_modules/core-js/internals/collection.js var require_collection = __commonJS({ "node_modules/core-js/internals/collection.js": function(exports, module) { @@ -4654,50 +4652,72 @@ } }); - // node_modules/core-js/internals/define-built-ins.js - var require_define_built_ins = __commonJS({ - "node_modules/core-js/internals/define-built-ins.js": function(exports, module) { - var defineBuiltIn5 = require_define_built_in(); - module.exports = function(target, src, options) { - for (var key in src) - defineBuiltIn5(target, key, src[key], options); - return target; - }; - } - }); - - // node_modules/core-js/internals/collection-strong.js - var require_collection_strong = __commonJS({ - "node_modules/core-js/internals/collection-strong.js": function(exports, module) { + // node_modules/core-js/internals/collection-weak.js + var require_collection_weak = __commonJS({ + "node_modules/core-js/internals/collection-weak.js": function(exports, module) { "use strict"; - var create3 = require_object_create(); - var defineBuiltInAccessor4 = require_define_built_in_accessor(); + var uncurryThis15 = require_function_uncurry_this(); var defineBuiltIns = require_define_built_ins(); - var bind2 = require_function_bind_context(); + var getWeakData = require_internal_metadata().getWeakData; var anInstance = require_an_instance(); + var anObject10 = require_an_object(); var isNullOrUndefined5 = require_is_null_or_undefined(); + var isObject6 = require_is_object(); var iterate2 = require_iterate(); - var defineIterator2 = require_iterator_define(); - var createIterResultObject2 = require_create_iter_result_object(); - var setSpecies3 = require_set_species(); - var DESCRIPTORS10 = require_descriptors(); - var fastKey = require_internal_metadata().fastKey; + var ArrayIterationModule = require_array_iteration(); + var hasOwn5 = require_has_own_property(); var InternalStateModule2 = require_internal_state(); var setInternalState2 = InternalStateModule2.set; var internalStateGetterFor = InternalStateModule2.getterFor; + var find2 = ArrayIterationModule.find; + var findIndex = ArrayIterationModule.findIndex; + var splice2 = uncurryThis15([].splice); + var id = 0; + var uncaughtFrozenStore = function(state) { + return state.frozen || (state.frozen = new UncaughtFrozenStore()); + }; + var UncaughtFrozenStore = function() { + this.entries = []; + }; + var findUncaughtFrozen = function(store, key) { + return find2(store.entries, function(it) { + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function(key) { + var entry = findUncaughtFrozen(this, key); + if (entry) + return entry[1]; + }, + has: function(key) { + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) + entry[1] = value; + else + this.entries.push([key, value]); + }, + "delete": function(key) { + var index = findIndex(this.entries, function(it) { + return it[0] === key; + }); + if (~index) + splice2(this.entries, index, 1); + return !!~index; + } + }; module.exports = { getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function(that, iterable) { anInstance(that, Prototype); setInternalState2(that, { type: CONSTRUCTOR_NAME, - index: create3(null), - first: void 0, - last: void 0, - size: 0 + id: id++, + frozen: void 0 }); - if (!DESCRIPTORS10) - that.size = 0; if (!isNullOrUndefined5(iterable)) iterate2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); @@ -4705,1005 +4725,963 @@ var getInternalState3 = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function(that, key, value) { var state = getInternalState3(that); - var entry = getEntry(that, key); - var previous, index; - if (entry) { - entry.value = value; - } else { - state.last = entry = { - index: index = fastKey(key, true), - key: key, - value: value, - previous: previous = state.last, - next: void 0, - removed: false - }; - if (!state.first) - state.first = entry; - if (previous) - previous.next = entry; - if (DESCRIPTORS10) - state.size++; - else - that.size++; - if (index !== "F") - state.index[index] = entry; - } + var data = getWeakData(anObject10(key), true); + if (data === true) + uncaughtFrozenStore(state).set(key, value); + else + data[state.id] = value; return that; }; - var getEntry = function(that, key) { - var state = getInternalState3(that); - var index = fastKey(key); - var entry; - if (index !== "F") - return state.index[index]; - for (entry = state.first; entry; entry = entry.next) { - if (entry.key == key) - return entry; - } - }; defineBuiltIns(Prototype, { - clear: function clear() { - var that = this; - var state = getInternalState3(that); - var data = state.index; - var entry = state.first; - while (entry) { - entry.removed = true; - if (entry.previous) - entry.previous = entry.previous.next = void 0; - delete data[entry.index]; - entry = entry.next; - } - state.first = state.last = void 0; - if (DESCRIPTORS10) - state.size = 0; - else - that.size = 0; - }, "delete": function(key) { - var that = this; - var state = getInternalState3(that); - var entry = getEntry(that, key); - if (entry) { - var next2 = entry.next; - var prev = entry.previous; - delete state.index[entry.index]; - entry.removed = true; - if (prev) - prev.next = next2; - if (next2) - next2.previous = prev; - if (state.first == entry) - state.first = next2; - if (state.last == entry) - state.last = prev; - if (DESCRIPTORS10) - state.size--; - else - that.size--; - } - return !!entry; - }, - forEach: function forEach3(callbackfn) { var state = getInternalState3(this); - var boundFunction = bind2(callbackfn, arguments.length > 1 ? arguments[1] : void 0); - var entry; - while (entry = entry ? entry.next : state.first) { - boundFunction(entry.value, entry.key, this); - while (entry && entry.removed) - entry = entry.previous; - } + if (!isObject6(key)) + return false; + var data = getWeakData(key); + if (data === true) + return uncaughtFrozenStore(state)["delete"](key); + return data && hasOwn5(data, state.id) && delete data[state.id]; }, has: function has(key) { - return !!getEntry(this, key); - } - }); - defineBuiltIns(Prototype, IS_MAP ? { - get: function get3(key) { - var entry = getEntry(this, key); - return entry && entry.value; + var state = getInternalState3(this); + if (!isObject6(key)) + return false; + var data = getWeakData(key); + if (data === true) + return uncaughtFrozenStore(state).has(key); + return data && hasOwn5(data, state.id); + } + }); + defineBuiltIns(Prototype, IS_MAP ? { + get: function get3(key) { + var state = getInternalState3(this); + if (isObject6(key)) { + var data = getWeakData(key); + if (data === true) + return uncaughtFrozenStore(state).get(key); + return data ? data[state.id] : void 0; + } }, set: function set(key, value) { - return define(this, key === 0 ? 0 : key, value); + return define(this, key, value); } } : { add: function add(value) { - return define(this, value = value === 0 ? 0 : value, value); + return define(this, value, true); } }); - if (DESCRIPTORS10) - defineBuiltInAccessor4(Prototype, "size", { - configurable: true, - get: function() { - return getInternalState3(this).size; - } - }); return Constructor; - }, - setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) { - var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator"; - var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); - var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); - defineIterator2(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) { - setInternalState2(this, { - type: ITERATOR_NAME, - target: iterated, - state: getInternalCollectionState(iterated), - kind: kind, - last: void 0 - }); - }, function() { - var state = getInternalIteratorState(this); - var kind = state.kind; - var entry = state.last; - while (entry && entry.removed) - entry = entry.previous; - if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { - state.target = void 0; - return createIterResultObject2(void 0, true); - } - if (kind == "keys") - return createIterResultObject2(entry.key, false); - if (kind == "values") - return createIterResultObject2(entry.value, false); - return createIterResultObject2([entry.key, entry.value], false); - }, IS_MAP ? "entries" : "values", !IS_MAP, true); - setSpecies3(CONSTRUCTOR_NAME); } }; } }); - // node_modules/core-js/modules/es.map.constructor.js - var require_es_map_constructor = __commonJS({ - "node_modules/core-js/modules/es.map.constructor.js": function() { + // node_modules/core-js/modules/es.weak-map.constructor.js + var require_es_weak_map_constructor = __commonJS({ + "node_modules/core-js/modules/es.weak-map.constructor.js": function() { "use strict"; + var FREEZING2 = require_freezing(); + var global11 = require_global(); + var uncurryThis15 = require_function_uncurry_this(); + var defineBuiltIns = require_define_built_ins(); + var InternalMetadataModule = require_internal_metadata(); var collection = require_collection(); - var collectionStrong = require_collection_strong(); - collection("Map", function(init2) { - return function Map2() { + var collectionWeak = require_collection_weak(); + var isObject6 = require_is_object(); + var enforceInternalState2 = require_internal_state().enforce; + var fails16 = require_fails(); + var NATIVE_WEAK_MAP = require_weak_map_basic_detection(); + var $Object = Object; + var isArray4 = Array.isArray; + var isExtensible = $Object.isExtensible; + var isFrozen = $Object.isFrozen; + var isSealed = $Object.isSealed; + var freeze2 = $Object.freeze; + var seal = $Object.seal; + var FROZEN = {}; + var SEALED = {}; + var IS_IE11 = !global11.ActiveXObject && "ActiveXObject" in global11; + var InternalWeakMap; + var wrapper = function(init2) { + return function WeakMap2() { return init2(this, arguments.length ? arguments[0] : void 0); }; - }, collectionStrong); - } - }); - - // node_modules/core-js/internals/array-buffer-basic-detection.js - var require_array_buffer_basic_detection = __commonJS({ - "node_modules/core-js/internals/array-buffer-basic-detection.js": function(exports, module) { - module.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined"; - } - }); - - // node_modules/core-js/internals/to-index.js - var require_to_index = __commonJS({ - "node_modules/core-js/internals/to-index.js": function(exports, module) { - var toIntegerOrInfinity4 = require_to_integer_or_infinity(); - var toLength7 = require_to_length(); - var $RangeError = RangeError; - module.exports = function(it) { - if (it === void 0) - return 0; - var number = toIntegerOrInfinity4(it); - var length = toLength7(number); - if (number !== length) - throw $RangeError("Wrong length or index"); - return length; }; + var $WeakMap = collection("WeakMap", wrapper, collectionWeak); + var WeakMapPrototype = $WeakMap.prototype; + var nativeSet = uncurryThis15(WeakMapPrototype.set); + var hasMSEdgeFreezingBug = function() { + return FREEZING2 && fails16(function() { + var frozenArray = freeze2([]); + nativeSet(new $WeakMap(), frozenArray, 1); + return !isFrozen(frozenArray); + }); + }; + if (NATIVE_WEAK_MAP) { + if (IS_IE11) { + InternalWeakMap = collectionWeak.getConstructor(wrapper, "WeakMap", true); + InternalMetadataModule.enable(); + nativeDelete = uncurryThis15(WeakMapPrototype["delete"]); + nativeHas = uncurryThis15(WeakMapPrototype.has); + nativeGet = uncurryThis15(WeakMapPrototype.get); + defineBuiltIns(WeakMapPrototype, { + "delete": function(key) { + if (isObject6(key) && !isExtensible(key)) { + var state = enforceInternalState2(this); + if (!state.frozen) + state.frozen = new InternalWeakMap(); + return nativeDelete(this, key) || state.frozen["delete"](key); + } + return nativeDelete(this, key); + }, + has: function has(key) { + if (isObject6(key) && !isExtensible(key)) { + var state = enforceInternalState2(this); + if (!state.frozen) + state.frozen = new InternalWeakMap(); + return nativeHas(this, key) || state.frozen.has(key); + } + return nativeHas(this, key); + }, + get: function get3(key) { + if (isObject6(key) && !isExtensible(key)) { + var state = enforceInternalState2(this); + if (!state.frozen) + state.frozen = new InternalWeakMap(); + return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); + } + return nativeGet(this, key); + }, + set: function set(key, value) { + if (isObject6(key) && !isExtensible(key)) { + var state = enforceInternalState2(this); + if (!state.frozen) + state.frozen = new InternalWeakMap(); + nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); + } else + nativeSet(this, key, value); + return this; + } + }); + } else if (hasMSEdgeFreezingBug()) { + defineBuiltIns(WeakMapPrototype, { + set: function set(key, value) { + var arrayIntegrityLevel; + if (isArray4(key)) { + if (isFrozen(key)) + arrayIntegrityLevel = FROZEN; + else if (isSealed(key)) + arrayIntegrityLevel = SEALED; + } + nativeSet(this, key, value); + if (arrayIntegrityLevel == FROZEN) + freeze2(key); + if (arrayIntegrityLevel == SEALED) + seal(key); + return this; + } + }); + } + } + var nativeDelete; + var nativeHas; + var nativeGet; } }); - // node_modules/core-js/internals/ieee754.js - var require_ieee754 = __commonJS({ - "node_modules/core-js/internals/ieee754.js": function(exports, module) { - var $Array2 = Array; - var abs = Math.abs; - var pow = Math.pow; - var floor = Math.floor; - var log = Math.log; - var LN2 = Math.LN2; - var pack = function(number, mantissaLength, bytes) { - var buffer = $Array2(bytes); - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; - var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; - var index = 0; - var exponent, mantissa, c5; - number = abs(number); - if (number != number || number === Infinity) { - mantissa = number != number ? 1 : 0; - exponent = eMax; - } else { - exponent = floor(log(number) / LN2); - c5 = pow(2, -exponent); - if (number * c5 < 1) { - exponent--; - c5 *= 2; - } - if (exponent + eBias >= 1) { - number += rt / c5; - } else { - number += rt * pow(2, 1 - eBias); - } - if (number * c5 >= 2) { - exponent++; - c5 /= 2; - } - if (exponent + eBias >= eMax) { - mantissa = 0; - exponent = eMax; - } else if (exponent + eBias >= 1) { - mantissa = (number * c5 - 1) * pow(2, mantissaLength); - exponent = exponent + eBias; - } else { - mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); - exponent = 0; - } - } - while (mantissaLength >= 8) { - buffer[index++] = mantissa & 255; - mantissa /= 256; - mantissaLength -= 8; - } - exponent = exponent << mantissaLength | mantissa; - exponentLength += mantissaLength; - while (exponentLength > 0) { - buffer[index++] = exponent & 255; - exponent /= 256; - exponentLength -= 8; - } - buffer[--index] |= sign * 128; - return buffer; - }; - var unpack = function(buffer, mantissaLength) { - var bytes = buffer.length; - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var nBits = exponentLength - 7; - var index = bytes - 1; - var sign = buffer[index--]; - var exponent = sign & 127; - var mantissa; - sign >>= 7; - while (nBits > 0) { - exponent = exponent * 256 + buffer[index--]; - nBits -= 8; - } - mantissa = exponent & (1 << -nBits) - 1; - exponent >>= -nBits; - nBits += mantissaLength; - while (nBits > 0) { - mantissa = mantissa * 256 + buffer[index--]; - nBits -= 8; - } - if (exponent === 0) { - exponent = 1 - eBias; - } else if (exponent === eMax) { - return mantissa ? NaN : sign ? -Infinity : Infinity; - } else { - mantissa = mantissa + pow(2, mantissaLength); - exponent = exponent - eBias; - } - return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); - }; + // node_modules/core-js/internals/collection-strong.js + var require_collection_strong = __commonJS({ + "node_modules/core-js/internals/collection-strong.js": function(exports, module) { + "use strict"; + var create3 = require_object_create(); + var defineBuiltInAccessor4 = require_define_built_in_accessor(); + var defineBuiltIns = require_define_built_ins(); + var bind2 = require_function_bind_context(); + var anInstance = require_an_instance(); + var isNullOrUndefined5 = require_is_null_or_undefined(); + var iterate2 = require_iterate(); + var defineIterator2 = require_iterator_define(); + var createIterResultObject2 = require_create_iter_result_object(); + var setSpecies3 = require_set_species(); + var DESCRIPTORS10 = require_descriptors(); + var fastKey = require_internal_metadata().fastKey; + var InternalStateModule2 = require_internal_state(); + var setInternalState2 = InternalStateModule2.set; + var internalStateGetterFor = InternalStateModule2.getterFor; module.exports = { - pack: pack, - unpack: unpack + getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var Constructor = wrapper(function(that, iterable) { + anInstance(that, Prototype); + setInternalState2(that, { + type: CONSTRUCTOR_NAME, + index: create3(null), + first: void 0, + last: void 0, + size: 0 + }); + if (!DESCRIPTORS10) + that.size = 0; + if (!isNullOrUndefined5(iterable)) + iterate2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); + }); + var Prototype = Constructor.prototype; + var getInternalState3 = internalStateGetterFor(CONSTRUCTOR_NAME); + var define = function(that, key, value) { + var state = getInternalState3(that); + var entry = getEntry(that, key); + var previous, index; + if (entry) { + entry.value = value; + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: void 0, + removed: false + }; + if (!state.first) + state.first = entry; + if (previous) + previous.next = entry; + if (DESCRIPTORS10) + state.size++; + else + that.size++; + if (index !== "F") + state.index[index] = entry; + } + return that; + }; + var getEntry = function(that, key) { + var state = getInternalState3(that); + var index = fastKey(key); + var entry; + if (index !== "F") + return state.index[index]; + for (entry = state.first; entry; entry = entry.next) { + if (entry.key == key) + return entry; + } + }; + defineBuiltIns(Prototype, { + clear: function clear() { + var that = this; + var state = getInternalState3(that); + var data = state.index; + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) + entry.previous = entry.previous.next = void 0; + delete data[entry.index]; + entry = entry.next; + } + state.first = state.last = void 0; + if (DESCRIPTORS10) + state.size = 0; + else + that.size = 0; + }, + "delete": function(key) { + var that = this; + var state = getInternalState3(that); + var entry = getEntry(that, key); + if (entry) { + var next2 = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) + prev.next = next2; + if (next2) + next2.previous = prev; + if (state.first == entry) + state.first = next2; + if (state.last == entry) + state.last = prev; + if (DESCRIPTORS10) + state.size--; + else + that.size--; + } + return !!entry; + }, + forEach: function forEach3(callbackfn) { + var state = getInternalState3(this); + var boundFunction = bind2(callbackfn, arguments.length > 1 ? arguments[1] : void 0); + var entry; + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); + while (entry && entry.removed) + entry = entry.previous; + } + }, + has: function has(key) { + return !!getEntry(this, key); + } + }); + defineBuiltIns(Prototype, IS_MAP ? { + get: function get3(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } : { + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (DESCRIPTORS10) + defineBuiltInAccessor4(Prototype, "size", { + configurable: true, + get: function() { + return getInternalState3(this).size; + } + }); + return Constructor; + }, + setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator"; + var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + defineIterator2(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) { + setInternalState2(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: void 0 + }); + }, function() { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + while (entry && entry.removed) + entry = entry.previous; + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + state.target = void 0; + return createIterResultObject2(void 0, true); + } + if (kind == "keys") + return createIterResultObject2(entry.key, false); + if (kind == "values") + return createIterResultObject2(entry.value, false); + return createIterResultObject2([entry.key, entry.value], false); + }, IS_MAP ? "entries" : "values", !IS_MAP, true); + setSpecies3(CONSTRUCTOR_NAME); + } }; } }); - // node_modules/core-js/internals/array-fill.js - var require_array_fill = __commonJS({ - "node_modules/core-js/internals/array-fill.js": function(exports, module) { + // node_modules/core-js/modules/es.map.constructor.js + var require_es_map_constructor = __commonJS({ + "node_modules/core-js/modules/es.map.constructor.js": function() { "use strict"; - var toObject6 = require_to_object(); - var toAbsoluteIndex4 = require_to_absolute_index(); - var lengthOfArrayLike5 = require_length_of_array_like(); - module.exports = function fill2(value) { - var O = toObject6(this); - var length = lengthOfArrayLike5(O); - var argumentsLength = arguments.length; - var index = toAbsoluteIndex4(argumentsLength > 1 ? arguments[1] : void 0, length); - var end = argumentsLength > 2 ? arguments[2] : void 0; - var endPos = end === void 0 ? length : toAbsoluteIndex4(end, length); - while (endPos > index) - O[index++] = value; - return O; - }; + var collection = require_collection(); + var collectionStrong = require_collection_strong(); + collection("Map", function(init2) { + return function Map2() { + return init2(this, arguments.length ? arguments[0] : void 0); + }; + }, collectionStrong); } }); - // node_modules/core-js/internals/array-buffer.js - var require_array_buffer = __commonJS({ - "node_modules/core-js/internals/array-buffer.js": function(exports, module) { + // node_modules/core-js/modules/es.set.constructor.js + var require_es_set_constructor = __commonJS({ + "node_modules/core-js/modules/es.set.constructor.js": function() { "use strict"; - var global11 = require_global(); - var uncurryThis15 = require_function_uncurry_this(); - var DESCRIPTORS10 = require_descriptors(); - var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection(); - var FunctionName = require_function_name(); - var createNonEnumerableProperty4 = require_create_non_enumerable_property(); - var defineBuiltInAccessor4 = require_define_built_in_accessor(); - var defineBuiltIns = require_define_built_ins(); - var fails16 = require_fails(); - var anInstance = require_an_instance(); - var toIntegerOrInfinity4 = require_to_integer_or_infinity(); - var toLength7 = require_to_length(); - var toIndex = require_to_index(); - var IEEE754 = require_ieee754(); - var getPrototypeOf3 = require_object_get_prototype_of(); - var setPrototypeOf2 = require_object_set_prototype_of(); - var getOwnPropertyNames4 = require_object_get_own_property_names().f; - var arrayFill = require_array_fill(); - var arraySlice2 = require_array_slice_simple(); - var setToStringTag5 = require_set_to_string_tag(); - var InternalStateModule2 = require_internal_state(); - var PROPER_FUNCTION_NAME2 = FunctionName.PROPER; - var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; - var ARRAY_BUFFER2 = "ArrayBuffer"; - var DATA_VIEW = "DataView"; - var PROTOTYPE = "prototype"; - var WRONG_LENGTH = "Wrong length"; - var WRONG_INDEX = "Wrong index"; - var getInternalArrayBufferState = InternalStateModule2.getterFor(ARRAY_BUFFER2); - var getInternalDataViewState = InternalStateModule2.getterFor(DATA_VIEW); - var setInternalState2 = InternalStateModule2.set; - var NativeArrayBuffer2 = global11[ARRAY_BUFFER2]; - var $ArrayBuffer = NativeArrayBuffer2; - var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; - var $DataView = global11[DATA_VIEW]; - var DataViewPrototype2 = $DataView && $DataView[PROTOTYPE]; - var ObjectPrototype2 = Object.prototype; - var Array2 = global11.Array; - var RangeError2 = global11.RangeError; - var fill2 = uncurryThis15(arrayFill); - var reverse2 = uncurryThis15([].reverse); - var packIEEE754 = IEEE754.pack; - var unpackIEEE754 = IEEE754.unpack; - var packInt8 = function(number) { - return [number & 255]; - }; - var packInt16 = function(number) { - return [number & 255, number >> 8 & 255]; - }; - var packInt32 = function(number) { - return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255]; + var collection = require_collection(); + var collectionStrong = require_collection_strong(); + collection("Set", function(init2) { + return function Set2() { + return init2(this, arguments.length ? arguments[0] : void 0); + }; + }, collectionStrong); + } + }); + + // node_modules/core-js/internals/flatten-into-array.js + var require_flatten_into_array = __commonJS({ + "node_modules/core-js/internals/flatten-into-array.js": function(exports, module) { + "use strict"; + var isArray4 = require_is_array(); + var lengthOfArrayLike5 = require_length_of_array_like(); + var doesNotExceedSafeInteger3 = require_does_not_exceed_safe_integer(); + var bind2 = require_function_bind_context(); + var flattenIntoArray2 = function(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? bind2(mapper, thisArg) : false; + var element, elementLen; + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + if (depth > 0 && isArray4(element)) { + elementLen = lengthOfArrayLike5(element); + targetIndex = flattenIntoArray2(target, original, element, elementLen, targetIndex, depth - 1) - 1; + } else { + doesNotExceedSafeInteger3(targetIndex + 1); + target[targetIndex] = element; + } + targetIndex++; + } + sourceIndex++; + } + return targetIndex; }; - var unpackInt32 = function(buffer) { - return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; + module.exports = flattenIntoArray2; + } + }); + + // node_modules/core-js/internals/array-reduce.js + var require_array_reduce = __commonJS({ + "node_modules/core-js/internals/array-reduce.js": function(exports, module) { + var aCallable2 = require_a_callable(); + var toObject6 = require_to_object(); + var IndexedObject2 = require_indexed_object(); + var lengthOfArrayLike5 = require_length_of_array_like(); + var $TypeError2 = TypeError; + var createMethod = function(IS_RIGHT) { + return function(that, callbackfn, argumentsLength, memo) { + aCallable2(callbackfn); + var O = toObject6(that); + var self2 = IndexedObject2(O); + var length = lengthOfArrayLike5(O); + var index = IS_RIGHT ? length - 1 : 0; + var i5 = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) + while (true) { + if (index in self2) { + memo = self2[index]; + index += i5; + break; + } + index += i5; + if (IS_RIGHT ? index < 0 : length <= index) { + throw $TypeError2("Reduce of empty array with no initial value"); + } + } + for (; IS_RIGHT ? index >= 0 : length > index; index += i5) + if (index in self2) { + memo = callbackfn(memo, self2[index], index, O); + } + return memo; + }; }; - var packFloat32 = function(number) { - return packIEEE754(number, 23, 4); + module.exports = { + left: createMethod(false), + right: createMethod(true) }; - var packFloat64 = function(number) { - return packIEEE754(number, 52, 8); + } + }); + + // node_modules/core-js/internals/is-regexp.js + var require_is_regexp = __commonJS({ + "node_modules/core-js/internals/is-regexp.js": function(exports, module) { + var isObject6 = require_is_object(); + var classof2 = require_classof_raw(); + var wellKnownSymbol7 = require_well_known_symbol(); + var MATCH2 = wellKnownSymbol7("match"); + module.exports = function(it) { + var isRegExp3; + return isObject6(it) && ((isRegExp3 = it[MATCH2]) !== void 0 ? !!isRegExp3 : classof2(it) == "RegExp"); }; - var addGetter = function(Constructor, key2, getInternalState3) { - defineBuiltInAccessor4(Constructor[PROTOTYPE], key2, { + } + }); + + // node_modules/core-js/internals/proxy-accessor.js + var require_proxy_accessor = __commonJS({ + "node_modules/core-js/internals/proxy-accessor.js": function(exports, module) { + var defineProperty3 = require_object_define_property().f; + module.exports = function(Target, Source, key) { + key in Target || defineProperty3(Target, key, { configurable: true, get: function() { - return getInternalState3(this)[key2]; + return Source[key]; + }, + set: function(it) { + Source[key] = it; } }); }; - var get3 = function(view, count, index, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalDataViewState(view); - if (intIndex + count > store.byteLength) - throw RangeError2(WRONG_INDEX); - var bytes = store.bytes; - var start = intIndex + store.byteOffset; - var pack = arraySlice2(bytes, start, start + count); - return isLittleEndian ? pack : reverse2(pack); - }; - var set = function(view, count, index, conversion, value, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalDataViewState(view); - if (intIndex + count > store.byteLength) - throw RangeError2(WRONG_INDEX); - var bytes = store.bytes; - var start = intIndex + store.byteOffset; - var pack = conversion(+value); - for (var i5 = 0; i5 < count; i5++) - bytes[start + i5] = pack[isLittleEndian ? i5 : count - i5 - 1]; + } + }); + + // node_modules/core-js/internals/not-a-regexp.js + var require_not_a_regexp = __commonJS({ + "node_modules/core-js/internals/not-a-regexp.js": function(exports, module) { + var isRegExp3 = require_is_regexp(); + var $TypeError2 = TypeError; + module.exports = function(it) { + if (isRegExp3(it)) { + throw $TypeError2("The method doesn't accept regular expressions"); + } + return it; }; - if (!NATIVE_ARRAY_BUFFER) { - $ArrayBuffer = function ArrayBuffer4(length) { - anInstance(this, ArrayBufferPrototype); - var byteLength = toIndex(length); - setInternalState2(this, { - type: ARRAY_BUFFER2, - bytes: fill2(Array2(byteLength), 0), - byteLength: byteLength - }); - if (!DESCRIPTORS10) { - this.byteLength = byteLength; - this.detached = false; - } - }; - ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE]; - $DataView = function DataView3(buffer, byteOffset, byteLength) { - anInstance(this, DataViewPrototype2); - anInstance(buffer, ArrayBufferPrototype); - var bufferState = getInternalArrayBufferState(buffer); - var bufferLength = bufferState.byteLength; - var offset = toIntegerOrInfinity4(byteOffset); - if (offset < 0 || offset > bufferLength) - throw RangeError2("Wrong offset"); - byteLength = byteLength === void 0 ? bufferLength - offset : toLength7(byteLength); - if (offset + byteLength > bufferLength) - throw RangeError2(WRONG_LENGTH); - setInternalState2(this, { - type: DATA_VIEW, - buffer: buffer, - byteLength: byteLength, - byteOffset: offset, - bytes: bufferState.bytes - }); - if (!DESCRIPTORS10) { - this.buffer = buffer; - this.byteLength = byteLength; - this.byteOffset = offset; + } + }); + + // node_modules/core-js/internals/correct-is-regexp-logic.js + var require_correct_is_regexp_logic = __commonJS({ + "node_modules/core-js/internals/correct-is-regexp-logic.js": function(exports, module) { + var wellKnownSymbol7 = require_well_known_symbol(); + var MATCH2 = wellKnownSymbol7("match"); + module.exports = function(METHOD_NAME) { + var regexp = /./; + try { + "/./"[METHOD_NAME](regexp); + } catch (error1) { + try { + regexp[MATCH2] = false; + return "/./"[METHOD_NAME](regexp); + } catch (error2) { } - }; - DataViewPrototype2 = $DataView[PROTOTYPE]; - if (DESCRIPTORS10) { - addGetter($ArrayBuffer, "byteLength", getInternalArrayBufferState); - addGetter($DataView, "buffer", getInternalDataViewState); - addGetter($DataView, "byteLength", getInternalDataViewState); - addGetter($DataView, "byteOffset", getInternalDataViewState); - } - defineBuiltIns(DataViewPrototype2, { - getInt8: function getInt8(byteOffset) { - return get3(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint82(byteOffset) { - return get3(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset) { - var bytes = get3(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset) { - var bytes = get3(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset) { - return unpackInt32(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)); - }, - getUint32: function getUint32(byteOffset) { - return unpackInt32(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)) >>> 0; - }, - getFloat32: function getFloat32(byteOffset) { - return unpackIEEE754(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 23); - }, - getFloat64: function getFloat64(byteOffset) { - return unpackIEEE754(get3(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 52); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setUint8: function setUint82(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setInt16: function setInt16(byteOffset, value) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0); - }, - setUint16: function setUint16(byteOffset, value) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0); - }, - setInt32: function setInt32(byteOffset, value) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0); - }, - setUint32: function setUint32(byteOffset, value) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0); - }, - setFloat32: function setFloat32(byteOffset, value) { - set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : void 0); - }, - setFloat64: function setFloat64(byteOffset, value) { - set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : void 0); - } - }); - } else { - INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME2 && NativeArrayBuffer2.name !== ARRAY_BUFFER2; - if (!fails16(function() { - NativeArrayBuffer2(1); - }) || !fails16(function() { - new NativeArrayBuffer2(-1); - }) || fails16(function() { - new NativeArrayBuffer2(); - new NativeArrayBuffer2(1.5); - new NativeArrayBuffer2(NaN); - return NativeArrayBuffer2.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; - })) { - $ArrayBuffer = function ArrayBuffer4(length) { - anInstance(this, ArrayBufferPrototype); - return new NativeArrayBuffer2(toIndex(length)); - }; - $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype; - for (keys2 = getOwnPropertyNames4(NativeArrayBuffer2), j3 = 0; keys2.length > j3; ) { - if (!((key = keys2[j3++]) in $ArrayBuffer)) { - createNonEnumerableProperty4($ArrayBuffer, key, NativeArrayBuffer2[key]); - } - } - ArrayBufferPrototype.constructor = $ArrayBuffer; - } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { - createNonEnumerableProperty4(NativeArrayBuffer2, "name", ARRAY_BUFFER2); - } - if (setPrototypeOf2 && getPrototypeOf3(DataViewPrototype2) !== ObjectPrototype2) { - setPrototypeOf2(DataViewPrototype2, ObjectPrototype2); } - testView = new $DataView(new $ArrayBuffer(2)); - $setInt8 = uncurryThis15(DataViewPrototype2.setInt8); - testView.setInt8(0, 2147483648); - testView.setInt8(1, 2147483649); - if (testView.getInt8(0) || !testView.getInt8(1)) - defineBuiltIns(DataViewPrototype2, { - setInt8: function setInt8(byteOffset, value) { - $setInt8(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint82(byteOffset, value) { - $setInt8(this, byteOffset, value << 24 >> 24); - } - }, { unsafe: true }); - } - var INCORRECT_ARRAY_BUFFER_NAME; - var keys2; - var j3; - var key; - var testView; - var $setInt8; - setToStringTag5($ArrayBuffer, ARRAY_BUFFER2); - setToStringTag5($DataView, DATA_VIEW); - module.exports = { - ArrayBuffer: $ArrayBuffer, - DataView: $DataView + return false; }; } }); - // node_modules/core-js/modules/es.data-view.constructor.js - var require_es_data_view_constructor = __commonJS({ - "node_modules/core-js/modules/es.data-view.constructor.js": function() { - var $88 = require_export(); - var ArrayBufferModule2 = require_array_buffer(); - var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection(); - $88({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, { - DataView: ArrayBufferModule2.DataView - }); - } - }); - - // node_modules/core-js/internals/array-reduce.js - var require_array_reduce = __commonJS({ - "node_modules/core-js/internals/array-reduce.js": function(exports, module) { - var aCallable2 = require_a_callable(); + // node_modules/core-js/internals/array-fill.js + var require_array_fill = __commonJS({ + "node_modules/core-js/internals/array-fill.js": function(exports, module) { + "use strict"; var toObject6 = require_to_object(); - var IndexedObject2 = require_indexed_object(); + var toAbsoluteIndex4 = require_to_absolute_index(); var lengthOfArrayLike5 = require_length_of_array_like(); - var $TypeError2 = TypeError; - var createMethod = function(IS_RIGHT) { - return function(that, callbackfn, argumentsLength, memo) { - aCallable2(callbackfn); - var O = toObject6(that); - var self2 = IndexedObject2(O); - var length = lengthOfArrayLike5(O); - var index = IS_RIGHT ? length - 1 : 0; - var i5 = IS_RIGHT ? -1 : 1; - if (argumentsLength < 2) - while (true) { - if (index in self2) { - memo = self2[index]; - index += i5; - break; - } - index += i5; - if (IS_RIGHT ? index < 0 : length <= index) { - throw $TypeError2("Reduce of empty array with no initial value"); - } - } - for (; IS_RIGHT ? index >= 0 : length > index; index += i5) - if (index in self2) { - memo = callbackfn(memo, self2[index], index, O); - } - return memo; - }; - }; - module.exports = { - left: createMethod(false), - right: createMethod(true) + module.exports = function fill2(value) { + var O = toObject6(this); + var length = lengthOfArrayLike5(O); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex4(argumentsLength > 1 ? arguments[1] : void 0, length); + var end = argumentsLength > 2 ? arguments[2] : void 0; + var endPos = end === void 0 ? length : toAbsoluteIndex4(end, length); + while (endPos > index) + O[index++] = value; + return O; }; } }); - // node_modules/core-js/internals/collection-weak.js - var require_collection_weak = __commonJS({ - "node_modules/core-js/internals/collection-weak.js": function(exports, module) { - "use strict"; - var uncurryThis15 = require_function_uncurry_this(); - var defineBuiltIns = require_define_built_ins(); - var getWeakData = require_internal_metadata().getWeakData; - var anInstance = require_an_instance(); - var anObject10 = require_an_object(); - var isNullOrUndefined5 = require_is_null_or_undefined(); - var isObject6 = require_is_object(); - var iterate2 = require_iterate(); - var ArrayIterationModule = require_array_iteration(); - var hasOwn5 = require_has_own_property(); - var InternalStateModule2 = require_internal_state(); - var setInternalState2 = InternalStateModule2.set; - var internalStateGetterFor = InternalStateModule2.getterFor; - var find2 = ArrayIterationModule.find; - var findIndex = ArrayIterationModule.findIndex; - var splice2 = uncurryThis15([].splice); - var id = 0; - var uncaughtFrozenStore = function(state) { - return state.frozen || (state.frozen = new UncaughtFrozenStore()); - }; - var UncaughtFrozenStore = function() { - this.entries = []; - }; - var findUncaughtFrozen = function(store, key) { - return find2(store.entries, function(it) { - return it[0] === key; - }); - }; - UncaughtFrozenStore.prototype = { - get: function(key) { - var entry = findUncaughtFrozen(this, key); - if (entry) - return entry[1]; - }, - has: function(key) { - return !!findUncaughtFrozen(this, key); - }, - set: function(key, value) { - var entry = findUncaughtFrozen(this, key); - if (entry) - entry[1] = value; - else - this.entries.push([key, value]); - }, - "delete": function(key) { - var index = findIndex(this.entries, function(it) { - return it[0] === key; - }); - if (~index) - splice2(this.entries, index, 1); - return !!~index; - } + // node_modules/core-js/internals/array-buffer-basic-detection.js + var require_array_buffer_basic_detection = __commonJS({ + "node_modules/core-js/internals/array-buffer-basic-detection.js": function(exports, module) { + module.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined"; + } + }); + + // node_modules/core-js/internals/to-index.js + var require_to_index = __commonJS({ + "node_modules/core-js/internals/to-index.js": function(exports, module) { + var toIntegerOrInfinity4 = require_to_integer_or_infinity(); + var toLength7 = require_to_length(); + var $RangeError = RangeError; + module.exports = function(it) { + if (it === void 0) + return 0; + var number = toIntegerOrInfinity4(it); + var length = toLength7(number); + if (number !== length) + throw $RangeError("Wrong length or index"); + return length; }; - module.exports = { - getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { - var Constructor = wrapper(function(that, iterable) { - anInstance(that, Prototype); - setInternalState2(that, { - type: CONSTRUCTOR_NAME, - id: id++, - frozen: void 0 - }); - if (!isNullOrUndefined5(iterable)) - iterate2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); - }); - var Prototype = Constructor.prototype; - var getInternalState3 = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function(that, key, value) { - var state = getInternalState3(that); - var data = getWeakData(anObject10(key), true); - if (data === true) - uncaughtFrozenStore(state).set(key, value); - else - data[state.id] = value; - return that; - }; - defineBuiltIns(Prototype, { - "delete": function(key) { - var state = getInternalState3(this); - if (!isObject6(key)) - return false; - var data = getWeakData(key); - if (data === true) - return uncaughtFrozenStore(state)["delete"](key); - return data && hasOwn5(data, state.id) && delete data[state.id]; - }, - has: function has(key) { - var state = getInternalState3(this); - if (!isObject6(key)) - return false; - var data = getWeakData(key); - if (data === true) - return uncaughtFrozenStore(state).has(key); - return data && hasOwn5(data, state.id); - } - }); - defineBuiltIns(Prototype, IS_MAP ? { - get: function get3(key) { - var state = getInternalState3(this); - if (isObject6(key)) { - var data = getWeakData(key); - if (data === true) - return uncaughtFrozenStore(state).get(key); - return data ? data[state.id] : void 0; - } - }, - set: function set(key, value) { - return define(this, key, value); - } - } : { - add: function add(value) { - return define(this, value, true); - } - }); - return Constructor; + } + }); + + // node_modules/core-js/internals/ieee754.js + var require_ieee754 = __commonJS({ + "node_modules/core-js/internals/ieee754.js": function(exports, module) { + var $Array2 = Array; + var abs = Math.abs; + var pow = Math.pow; + var floor = Math.floor; + var log = Math.log; + var LN2 = Math.LN2; + var pack = function(number, mantissaLength, bytes) { + var buffer = $Array2(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var index = 0; + var exponent, mantissa, c5; + number = abs(number); + if (number != number || number === Infinity) { + mantissa = number != number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + c5 = pow(2, -exponent); + if (number * c5 < 1) { + exponent--; + c5 *= 2; + } + if (exponent + eBias >= 1) { + number += rt / c5; + } else { + number += rt * pow(2, 1 - eBias); + } + if (number * c5 >= 2) { + exponent++; + c5 /= 2; + } + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c5 - 1) * pow(2, mantissaLength); + exponent = exponent + eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; + } + } + while (mantissaLength >= 8) { + buffer[index++] = mantissa & 255; + mantissa /= 256; + mantissaLength -= 8; + } + exponent = exponent << mantissaLength | mantissa; + exponentLength += mantissaLength; + while (exponentLength > 0) { + buffer[index++] = exponent & 255; + exponent /= 256; + exponentLength -= 8; + } + buffer[--index] |= sign * 128; + return buffer; + }; + var unpack = function(buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + while (nBits > 0) { + exponent = exponent * 256 + buffer[index--]; + nBits -= 8; + } + mantissa = exponent & (1 << -nBits) - 1; + exponent >>= -nBits; + nBits += mantissaLength; + while (nBits > 0) { + mantissa = mantissa * 256 + buffer[index--]; + nBits -= 8; + } + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? -Infinity : Infinity; + } else { + mantissa = mantissa + pow(2, mantissaLength); + exponent = exponent - eBias; } + return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); + }; + module.exports = { + pack: pack, + unpack: unpack }; } }); - // node_modules/core-js/modules/es.weak-map.constructor.js - var require_es_weak_map_constructor = __commonJS({ - "node_modules/core-js/modules/es.weak-map.constructor.js": function() { + // node_modules/core-js/internals/array-buffer.js + var require_array_buffer = __commonJS({ + "node_modules/core-js/internals/array-buffer.js": function(exports, module) { "use strict"; - var FREEZING2 = require_freezing(); var global11 = require_global(); var uncurryThis15 = require_function_uncurry_this(); + var DESCRIPTORS10 = require_descriptors(); + var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection(); + var FunctionName = require_function_name(); + var createNonEnumerableProperty4 = require_create_non_enumerable_property(); + var defineBuiltInAccessor4 = require_define_built_in_accessor(); var defineBuiltIns = require_define_built_ins(); - var InternalMetadataModule = require_internal_metadata(); - var collection = require_collection(); - var collectionWeak = require_collection_weak(); - var isObject6 = require_is_object(); - var enforceInternalState2 = require_internal_state().enforce; var fails16 = require_fails(); - var NATIVE_WEAK_MAP = require_weak_map_basic_detection(); - var $Object = Object; - var isArray4 = Array.isArray; - var isExtensible = $Object.isExtensible; - var isFrozen = $Object.isFrozen; - var isSealed = $Object.isSealed; - var freeze2 = $Object.freeze; - var seal = $Object.seal; - var FROZEN = {}; - var SEALED = {}; - var IS_IE11 = !global11.ActiveXObject && "ActiveXObject" in global11; - var InternalWeakMap; - var wrapper = function(init2) { - return function WeakMap2() { - return init2(this, arguments.length ? arguments[0] : void 0); - }; + var anInstance = require_an_instance(); + var toIntegerOrInfinity4 = require_to_integer_or_infinity(); + var toLength7 = require_to_length(); + var toIndex = require_to_index(); + var IEEE754 = require_ieee754(); + var getPrototypeOf3 = require_object_get_prototype_of(); + var setPrototypeOf2 = require_object_set_prototype_of(); + var getOwnPropertyNames4 = require_object_get_own_property_names().f; + var arrayFill = require_array_fill(); + var arraySlice2 = require_array_slice_simple(); + var setToStringTag5 = require_set_to_string_tag(); + var InternalStateModule2 = require_internal_state(); + var PROPER_FUNCTION_NAME2 = FunctionName.PROPER; + var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; + var ARRAY_BUFFER2 = "ArrayBuffer"; + var DATA_VIEW = "DataView"; + var PROTOTYPE = "prototype"; + var WRONG_LENGTH = "Wrong length"; + var WRONG_INDEX = "Wrong index"; + var getInternalArrayBufferState = InternalStateModule2.getterFor(ARRAY_BUFFER2); + var getInternalDataViewState = InternalStateModule2.getterFor(DATA_VIEW); + var setInternalState2 = InternalStateModule2.set; + var NativeArrayBuffer2 = global11[ARRAY_BUFFER2]; + var $ArrayBuffer = NativeArrayBuffer2; + var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; + var $DataView = global11[DATA_VIEW]; + var DataViewPrototype2 = $DataView && $DataView[PROTOTYPE]; + var ObjectPrototype2 = Object.prototype; + var Array2 = global11.Array; + var RangeError2 = global11.RangeError; + var fill2 = uncurryThis15(arrayFill); + var reverse2 = uncurryThis15([].reverse); + var packIEEE754 = IEEE754.pack; + var unpackIEEE754 = IEEE754.unpack; + var packInt8 = function(number) { + return [number & 255]; }; - var $WeakMap = collection("WeakMap", wrapper, collectionWeak); - var WeakMapPrototype = $WeakMap.prototype; - var nativeSet = uncurryThis15(WeakMapPrototype.set); - var hasMSEdgeFreezingBug = function() { - return FREEZING2 && fails16(function() { - var frozenArray = freeze2([]); - nativeSet(new $WeakMap(), frozenArray, 1); - return !isFrozen(frozenArray); + var packInt16 = function(number) { + return [number & 255, number >> 8 & 255]; + }; + var packInt32 = function(number) { + return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255]; + }; + var unpackInt32 = function(buffer) { + return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; + }; + var packFloat32 = function(number) { + return packIEEE754(number, 23, 4); + }; + var packFloat64 = function(number) { + return packIEEE754(number, 52, 8); + }; + var addGetter = function(Constructor, key2, getInternalState3) { + defineBuiltInAccessor4(Constructor[PROTOTYPE], key2, { + configurable: true, + get: function() { + return getInternalState3(this)[key2]; + } }); }; - if (NATIVE_WEAK_MAP) { - if (IS_IE11) { - InternalWeakMap = collectionWeak.getConstructor(wrapper, "WeakMap", true); - InternalMetadataModule.enable(); - nativeDelete = uncurryThis15(WeakMapPrototype["delete"]); - nativeHas = uncurryThis15(WeakMapPrototype.has); - nativeGet = uncurryThis15(WeakMapPrototype.get); - defineBuiltIns(WeakMapPrototype, { - "delete": function(key) { - if (isObject6(key) && !isExtensible(key)) { - var state = enforceInternalState2(this); - if (!state.frozen) - state.frozen = new InternalWeakMap(); - return nativeDelete(this, key) || state.frozen["delete"](key); - } - return nativeDelete(this, key); - }, - has: function has(key) { - if (isObject6(key) && !isExtensible(key)) { - var state = enforceInternalState2(this); - if (!state.frozen) - state.frozen = new InternalWeakMap(); - return nativeHas(this, key) || state.frozen.has(key); - } - return nativeHas(this, key); - }, - get: function get3(key) { - if (isObject6(key) && !isExtensible(key)) { - var state = enforceInternalState2(this); - if (!state.frozen) - state.frozen = new InternalWeakMap(); - return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); - } - return nativeGet(this, key); - }, - set: function set(key, value) { - if (isObject6(key) && !isExtensible(key)) { - var state = enforceInternalState2(this); - if (!state.frozen) - state.frozen = new InternalWeakMap(); - nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); - } else - nativeSet(this, key, value); - return this; - } + var get3 = function(view, count, index, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalDataViewState(view); + if (intIndex + count > store.byteLength) + throw RangeError2(WRONG_INDEX); + var bytes = store.bytes; + var start = intIndex + store.byteOffset; + var pack = arraySlice2(bytes, start, start + count); + return isLittleEndian ? pack : reverse2(pack); + }; + var set = function(view, count, index, conversion, value, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalDataViewState(view); + if (intIndex + count > store.byteLength) + throw RangeError2(WRONG_INDEX); + var bytes = store.bytes; + var start = intIndex + store.byteOffset; + var pack = conversion(+value); + for (var i5 = 0; i5 < count; i5++) + bytes[start + i5] = pack[isLittleEndian ? i5 : count - i5 - 1]; + }; + if (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer4(length) { + anInstance(this, ArrayBufferPrototype); + var byteLength = toIndex(length); + setInternalState2(this, { + type: ARRAY_BUFFER2, + bytes: fill2(Array2(byteLength), 0), + byteLength: byteLength }); - } else if (hasMSEdgeFreezingBug()) { - defineBuiltIns(WeakMapPrototype, { - set: function set(key, value) { - var arrayIntegrityLevel; - if (isArray4(key)) { - if (isFrozen(key)) - arrayIntegrityLevel = FROZEN; - else if (isSealed(key)) - arrayIntegrityLevel = SEALED; - } - nativeSet(this, key, value); - if (arrayIntegrityLevel == FROZEN) - freeze2(key); - if (arrayIntegrityLevel == SEALED) - seal(key); - return this; - } + if (!DESCRIPTORS10) { + this.byteLength = byteLength; + this.detached = false; + } + }; + ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE]; + $DataView = function DataView3(buffer, byteOffset, byteLength) { + anInstance(this, DataViewPrototype2); + anInstance(buffer, ArrayBufferPrototype); + var bufferState = getInternalArrayBufferState(buffer); + var bufferLength = bufferState.byteLength; + var offset = toIntegerOrInfinity4(byteOffset); + if (offset < 0 || offset > bufferLength) + throw RangeError2("Wrong offset"); + byteLength = byteLength === void 0 ? bufferLength - offset : toLength7(byteLength); + if (offset + byteLength > bufferLength) + throw RangeError2(WRONG_LENGTH); + setInternalState2(this, { + type: DATA_VIEW, + buffer: buffer, + byteLength: byteLength, + byteOffset: offset, + bytes: bufferState.bytes }); + if (!DESCRIPTORS10) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; + DataViewPrototype2 = $DataView[PROTOTYPE]; + if (DESCRIPTORS10) { + addGetter($ArrayBuffer, "byteLength", getInternalArrayBufferState); + addGetter($DataView, "buffer", getInternalDataViewState); + addGetter($DataView, "byteLength", getInternalDataViewState); + addGetter($DataView, "byteOffset", getInternalDataViewState); + } + defineBuiltIns(DataViewPrototype2, { + getInt8: function getInt8(byteOffset) { + return get3(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint82(byteOffset) { + return get3(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset) { + var bytes = get3(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset) { + var bytes = get3(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset) { + return unpackInt32(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)); + }, + getUint32: function getUint32(byteOffset) { + return unpackInt32(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)) >>> 0; + }, + getFloat32: function getFloat32(byteOffset) { + return unpackIEEE754(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 23); + }, + getFloat64: function getFloat64(byteOffset) { + return unpackIEEE754(get3(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 52); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint82(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16(byteOffset, value) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0); + }, + setUint16: function setUint16(byteOffset, value) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0); + }, + setInt32: function setInt32(byteOffset, value) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0); + }, + setUint32: function setUint32(byteOffset, value) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0); + }, + setFloat32: function setFloat32(byteOffset, value) { + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : void 0); + }, + setFloat64: function setFloat64(byteOffset, value) { + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : void 0); + } + }); + } else { + INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME2 && NativeArrayBuffer2.name !== ARRAY_BUFFER2; + if (!fails16(function() { + NativeArrayBuffer2(1); + }) || !fails16(function() { + new NativeArrayBuffer2(-1); + }) || fails16(function() { + new NativeArrayBuffer2(); + new NativeArrayBuffer2(1.5); + new NativeArrayBuffer2(NaN); + return NativeArrayBuffer2.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; + })) { + $ArrayBuffer = function ArrayBuffer4(length) { + anInstance(this, ArrayBufferPrototype); + return new NativeArrayBuffer2(toIndex(length)); + }; + $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype; + for (keys2 = getOwnPropertyNames4(NativeArrayBuffer2), j3 = 0; keys2.length > j3; ) { + if (!((key = keys2[j3++]) in $ArrayBuffer)) { + createNonEnumerableProperty4($ArrayBuffer, key, NativeArrayBuffer2[key]); + } + } + ArrayBufferPrototype.constructor = $ArrayBuffer; + } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { + createNonEnumerableProperty4(NativeArrayBuffer2, "name", ARRAY_BUFFER2); + } + if (setPrototypeOf2 && getPrototypeOf3(DataViewPrototype2) !== ObjectPrototype2) { + setPrototypeOf2(DataViewPrototype2, ObjectPrototype2); } + testView = new $DataView(new $ArrayBuffer(2)); + $setInt8 = uncurryThis15(DataViewPrototype2.setInt8); + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) + defineBuiltIns(DataViewPrototype2, { + setInt8: function setInt8(byteOffset, value) { + $setInt8(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint82(byteOffset, value) { + $setInt8(this, byteOffset, value << 24 >> 24); + } + }, { unsafe: true }); } - var nativeDelete; - var nativeHas; - var nativeGet; + var INCORRECT_ARRAY_BUFFER_NAME; + var keys2; + var j3; + var key; + var testView; + var $setInt8; + setToStringTag5($ArrayBuffer, ARRAY_BUFFER2); + setToStringTag5($DataView, DATA_VIEW); + module.exports = { + ArrayBuffer: $ArrayBuffer, + DataView: $DataView + }; } }); - // node_modules/core-js/modules/es.set.constructor.js - var require_es_set_constructor = __commonJS({ - "node_modules/core-js/modules/es.set.constructor.js": function() { + // node_modules/core-js/modules/es.data-view.constructor.js + var require_es_data_view_constructor = __commonJS({ + "node_modules/core-js/modules/es.data-view.constructor.js": function() { + var $88 = require_export(); + var ArrayBufferModule2 = require_array_buffer(); + var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection(); + $88({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, { + DataView: ArrayBufferModule2.DataView + }); + } + }); + + // node_modules/core-js/modules/es.weak-set.constructor.js + var require_es_weak_set_constructor = __commonJS({ + "node_modules/core-js/modules/es.weak-set.constructor.js": function() { "use strict"; var collection = require_collection(); - var collectionStrong = require_collection_strong(); - collection("Set", function(init2) { - return function Set2() { - return init2(this, arguments.length ? arguments[0] : void 0); - }; - }, collectionStrong); - } - }); - - // node_modules/core-js/internals/flatten-into-array.js - var require_flatten_into_array = __commonJS({ - "node_modules/core-js/internals/flatten-into-array.js": function(exports, module) { - "use strict"; - var isArray4 = require_is_array(); - var lengthOfArrayLike5 = require_length_of_array_like(); - var doesNotExceedSafeInteger3 = require_does_not_exceed_safe_integer(); - var bind2 = require_function_bind_context(); - var flattenIntoArray2 = function(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? bind2(mapper, thisArg) : false; - var element, elementLen; - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - if (depth > 0 && isArray4(element)) { - elementLen = lengthOfArrayLike5(element); - targetIndex = flattenIntoArray2(target, original, element, elementLen, targetIndex, depth - 1) - 1; - } else { - doesNotExceedSafeInteger3(targetIndex + 1); - target[targetIndex] = element; - } - targetIndex++; - } - sourceIndex++; - } - return targetIndex; - }; - module.exports = flattenIntoArray2; - } - }); - - // node_modules/core-js/internals/proxy-accessor.js - var require_proxy_accessor = __commonJS({ - "node_modules/core-js/internals/proxy-accessor.js": function(exports, module) { - var defineProperty3 = require_object_define_property().f; - module.exports = function(Target, Source, key) { - key in Target || defineProperty3(Target, key, { - configurable: true, - get: function() { - return Source[key]; - }, - set: function(it) { - Source[key] = it; - } - }); - }; - } - }); - - // node_modules/core-js/internals/not-a-regexp.js - var require_not_a_regexp = __commonJS({ - "node_modules/core-js/internals/not-a-regexp.js": function(exports, module) { - var isRegExp3 = require_is_regexp(); - var $TypeError2 = TypeError; - module.exports = function(it) { - if (isRegExp3(it)) { - throw $TypeError2("The method doesn't accept regular expressions"); - } - return it; - }; - } - }); - - // node_modules/core-js/internals/correct-is-regexp-logic.js - var require_correct_is_regexp_logic = __commonJS({ - "node_modules/core-js/internals/correct-is-regexp-logic.js": function(exports, module) { - var wellKnownSymbol7 = require_well_known_symbol(); - var MATCH2 = wellKnownSymbol7("match"); - module.exports = function(METHOD_NAME) { - var regexp = /./; - try { - "/./"[METHOD_NAME](regexp); - } catch (error1) { - try { - regexp[MATCH2] = false; - return "/./"[METHOD_NAME](regexp); - } catch (error2) { - } - } - return false; - }; - } - }); - - // node_modules/core-js/modules/es.weak-set.constructor.js - var require_es_weak_set_constructor = __commonJS({ - "node_modules/core-js/modules/es.weak-set.constructor.js": function() { - "use strict"; - var collection = require_collection(); - var collectionWeak = require_collection_weak(); - collection("WeakSet", function(init2) { - return function WeakSet2() { + var collectionWeak = require_collection_weak(); + collection("WeakSet", function(init2) { + return function WeakSet2() { return init2(this, arguments.length ? arguments[0] : void 0); }; }, collectionWeak); } }); - // srcts/src/initialize/disableForm.ts - var import_jquery = __toESM(require_jquery()); - function disableFormSubmission() { - (0, import_jquery.default)(document).on("submit", "form:not([action])", function(e4) { - e4.preventDefault(); - }); - } - - // srcts/src/initialize/history.ts - var import_jquery2 = __toESM(require_jquery()); - function trackHistory() { - var origPushState = window.history.pushState; - window.history.pushState = function() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - var result = origPushState.apply(this, args); - (0, import_jquery2.default)(document).trigger("pushstate"); - return result; - }; - } - // node_modules/core-js/modules/es.array.index-of.js - var $3 = require_export(); + var $ = require_export(); var uncurryThis = require_function_uncurry_this_clause(); var $indexOf = require_array_includes().indexOf; var arrayMethodIsStrict = require_array_method_is_strict(); var nativeIndexOf = uncurryThis([].indexOf); var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0; var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict("indexOf"); - $3({ target: "Array", proto: true, forced: FORCED }, { + $({ target: "Array", proto: true, forced: FORCED }, { indexOf: function indexOf(searchElement) { var fromIndex = arguments.length > 1 ? arguments[1] : void 0; return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex); @@ -5711,9 +5689,9 @@ }); // node_modules/core-js/modules/es.parse-int.js - var $4 = require_export(); + var $2 = require_export(); var $parseInt = require_number_parse_int(); - $4({ global: true, forced: parseInt != $parseInt }, { + $2({ global: true, forced: parseInt != $parseInt }, { parseInt: $parseInt }); @@ -5722,7 +5700,7 @@ // node_modules/core-js/modules/es.regexp.test.js require_es_regexp_exec(); - var $5 = require_export(); + var $3 = require_export(); var call = require_function_call(); var isCallable = require_is_callable(); var anObject = require_an_object(); @@ -5737,7 +5715,7 @@ return re.test("abc") === true && execCalled; }(); var nativeTest = /./.test; - $5({ target: "RegExp", proto: true, forced: !DELEGATES_TO_EXEC }, { + $3({ target: "RegExp", proto: true, forced: !DELEGATES_TO_EXEC }, { test: function(S4) { var R2 = anObject(this); var string = toString(S4); @@ -5753,7 +5731,7 @@ }); // srcts/src/initialize/browser.ts - var import_jquery3 = __toESM(require_jquery()); + var import_jquery = __toESM(require_jquery()); // srcts/src/utils/browser.ts var isQtVal = false; @@ -5799,27 +5777,41 @@ } function determineBrowserInfo() { if (/\bQt\//.test(userAgent)) { - (0, import_jquery3.default)(document.documentElement).addClass("qt"); + (0, import_jquery.default)(document.documentElement).addClass("qt"); setIsQt(true); } else { setIsQt(false); } if (/\bQt/.test(userAgent) && /\bMacintosh/.test(userAgent)) { - (0, import_jquery3.default)(document.documentElement).addClass("qtmac"); + (0, import_jquery.default)(document.documentElement).addClass("qtmac"); } if (/\bQt\/5/.test(userAgent) && /Linux/.test(userAgent)) { - (0, import_jquery3.default)(document.documentElement).addClass("qt5"); + (0, import_jquery.default)(document.documentElement).addClass("qt5"); } setIsIE(/MSIE|Trident|Edge/.test(userAgent)); setIEVersion(getIEVersion()); } - // srcts/src/window/libraries.ts - function windowShiny() { - if (!window["Shiny"]) { - window["Shiny"] = {}; - } - return window["Shiny"]; + // srcts/src/initialize/disableForm.ts + var import_jquery2 = __toESM(require_jquery()); + function disableFormSubmission() { + (0, import_jquery2.default)(document).on("submit", "form:not([action])", function(e4) { + e4.preventDefault(); + }); + } + + // srcts/src/initialize/history.ts + var import_jquery3 = __toESM(require_jquery()); + function trackHistory() { + var origPushState = window.history.pushState; + window.history.pushState = function() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var result = origPushState.apply(this, args); + (0, import_jquery3.default)(document).trigger("pushstate"); + return result; + }; } // node_modules/core-js/modules/es.object.to-string.js @@ -7133,7 +7125,7 @@ } }); - // srcts/src/bindings/input/checkbox.ts + // srcts/src/bindings/input/actionbutton.ts var import_es_array_iterator3 = __toESM(require_es_array_iterator()); var import_jquery5 = __toESM(require_jquery()); function _typeof3(obj) { @@ -7247,74 +7239,97 @@ }; return _getPrototypeOf(o4); } - var CheckboxInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits(CheckboxInputBinding2, _InputBinding); - var _super = _createSuper(CheckboxInputBinding2); - function CheckboxInputBinding2() { - _classCallCheck3(this, CheckboxInputBinding2); + var ActionButtonInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits(ActionButtonInputBinding2, _InputBinding); + var _super = _createSuper(ActionButtonInputBinding2); + function ActionButtonInputBinding2() { + _classCallCheck3(this, ActionButtonInputBinding2); return _super.apply(this, arguments); } - _createClass3(CheckboxInputBinding2, [{ + _createClass3(ActionButtonInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery5.default)(scope).find('input[type="checkbox"]'); + return (0, import_jquery5.default)(scope).find(".action-button"); } }, { key: "getValue", value: function getValue(el) { - return el.checked; + return (0, import_jquery5.default)(el).data("val") || 0; } }, { key: "setValue", value: function setValue(el, value) { - el.checked = value; + (0, import_jquery5.default)(el).data("val", value); } }, { - key: "subscribe", - value: function subscribe(el, callback) { - (0, import_jquery5.default)(el).on("change.checkboxInputBinding", function() { - callback(true); - }); + key: "getType", + value: function getType(el) { + return "shiny.action"; + el; } }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery5.default)(el).off(".checkboxInputBinding"); + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery5.default)(el).on( + "click.actionButtonInputBinding", + function() { + var $el = (0, import_jquery5.default)(this); + var val = $el.data("val") || 0; + $el.data("val", val + 1); + callback(false); + } + ); } }, { key: "getState", value: function getState(el) { return { - label: (0, import_jquery5.default)(el).parent().find("span").text(), - value: el.checked + value: this.getValue(el) }; } }, { key: "receiveMessage", value: function receiveMessage(el, data) { - if (hasDefinedProperty(data, "value")) { - el.checked = data.value; + var $el = (0, import_jquery5.default)(el); + if (hasDefinedProperty(data, "label") || hasDefinedProperty(data, "icon")) { + var label = $el.text(); + var icon = ""; + if ($el.find("i[class]").length > 0) { + var iconHtml = $el.find("i[class]")[0]; + if (iconHtml === $el.children()[0]) { + icon = (0, import_jquery5.default)(iconHtml).prop("outerHTML"); + } + } + if (hasDefinedProperty(data, "label")) { + label = data.label; + } + if (hasDefinedProperty(data, "icon")) { + var _data$icon; + icon = Array.isArray(data.icon) ? "" : (_data$icon = data.icon) !== null && _data$icon !== void 0 ? _data$icon : ""; + } + $el.html(icon + " " + label); } - if (hasDefinedProperty(data, "label")) { - (0, import_jquery5.default)(el).parent().find("span").text(data.label); + if (hasDefinedProperty(data, "disabled")) { + if (data.disabled) { + $el.attr("disabled", ""); + } else { + $el.attr("disabled", null); + } } - (0, import_jquery5.default)(el).trigger("change"); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery5.default)(el).off(".actionButtonInputBinding"); } }]); - return CheckboxInputBinding2; + return ActionButtonInputBinding2; }(InputBinding); - - // node_modules/core-js/modules/es.string.trim.js - var $25 = require_export(); - var $trim = require_string_trim().trim; - var forcedStringTrimMethod = require_string_trim_forced(); - $25({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, { - trim: function trim2() { - return $trim(this); - } + (0, import_jquery5.default)(document).on("click", "a.action-button", function(e4) { + e4.preventDefault(); }); - // srcts/src/bindings/input/checkboxgroup.ts + // srcts/src/bindings/input/checkbox.ts var import_es_array_iterator4 = __toESM(require_es_array_iterator()); var import_jquery6 = __toESM(require_jquery()); function _typeof4(obj) { @@ -7428,144 +7443,74 @@ }; return _getPrototypeOf2(o4); } - function getLabelNode(el) { - return (0, import_jquery6.default)(el).find('label[for="' + $escape(el.id) + '"]'); - } - function getLabel(obj) { - var parentNode = obj.parentNode; - if (parentNode.tagName === "LABEL") { - return (0, import_jquery6.default)(parentNode).find("span").text().trim(); - } - return null; - } - var CheckboxGroupInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits2(CheckboxGroupInputBinding2, _InputBinding); - var _super = _createSuper2(CheckboxGroupInputBinding2); - function CheckboxGroupInputBinding2() { - _classCallCheck4(this, CheckboxGroupInputBinding2); + var CheckboxInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits2(CheckboxInputBinding2, _InputBinding); + var _super = _createSuper2(CheckboxInputBinding2); + function CheckboxInputBinding2() { + _classCallCheck4(this, CheckboxInputBinding2); return _super.apply(this, arguments); } - _createClass4(CheckboxGroupInputBinding2, [{ + _createClass4(CheckboxInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery6.default)(scope).find(".shiny-input-checkboxgroup"); + return (0, import_jquery6.default)(scope).find('input[type="checkbox"]'); } }, { key: "getValue", value: function getValue(el) { - var $objs = (0, import_jquery6.default)('input:checkbox[name="' + $escape(el.id) + '"]:checked'); - var values2 = new Array($objs.length); - for (var i5 = 0; i5 < $objs.length; i5++) { - values2[i5] = $objs[i5].value; - } - return values2; + return el.checked; } }, { key: "setValue", value: function setValue(el, value) { - var _value; - value = (_value = value) !== null && _value !== void 0 ? _value : []; - (0, import_jquery6.default)('input:checkbox[name="' + $escape(el.id) + '"]').prop("checked", false); - if (value instanceof Array) { - for (var i5 = 0; i5 < value.length; i5++) { - (0, import_jquery6.default)('input:checkbox[name="' + $escape(el.id) + '"][value="' + $escape(value[i5]) + '"]').prop("checked", true); - } - } else { - (0, import_jquery6.default)('input:checkbox[name="' + $escape(el.id) + '"][value="' + $escape(value) + '"]').prop("checked", true); - } + el.checked = value; + } + }, { + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery6.default)(el).on("change.checkboxInputBinding", function() { + callback(true); + }); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery6.default)(el).off(".checkboxInputBinding"); } }, { key: "getState", value: function getState(el) { - var $objs = (0, import_jquery6.default)('input:checkbox[name="' + $escape(el.id) + '"]'); - var options = new Array($objs.length); - for (var i5 = 0; i5 < options.length; i5++) { - options[i5] = { - value: $objs[i5].value, - label: getLabel($objs[i5]) - }; - } return { - label: getLabelNode(el).text(), - value: this.getValue(el), - options: options + label: (0, import_jquery6.default)(el).parent().find("span").text(), + value: el.checked }; } }, { key: "receiveMessage", value: function receiveMessage(el, data) { - var $el = (0, import_jquery6.default)(el); - if (hasDefinedProperty(data, "options")) { - $el.find("div.shiny-options-group").remove(); - $el.find("label.checkbox").remove(); - $el.append(data.options); - } if (hasDefinedProperty(data, "value")) { - this.setValue(el, data.value); + el.checked = data.value; + } + if (hasDefinedProperty(data, "label")) { + (0, import_jquery6.default)(el).parent().find("span").text(data.label); } - updateLabel(data.label, getLabelNode(el)); (0, import_jquery6.default)(el).trigger("change"); } - }, { - key: "subscribe", - value: function subscribe(el, callback) { - (0, import_jquery6.default)(el).on("change.checkboxGroupInputBinding", function() { - callback(false); - }); - } - }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery6.default)(el).off(".checkboxGroupInputBinding"); - } }]); - return CheckboxGroupInputBinding2; + return CheckboxInputBinding2; }(InputBinding); - // srcts/src/bindings/input/number.ts - var import_es_regexp_exec3 = __toESM(require_es_regexp_exec()); - var import_es_array_iterator6 = __toESM(require_es_array_iterator()); - var import_jquery8 = __toESM(require_jquery()); - - // node_modules/core-js/modules/es.reflect.get.js - var $27 = require_export(); - var call3 = require_function_call(); - var isObject4 = require_is_object(); - var anObject5 = require_an_object(); - var isDataDescriptor = require_is_data_descriptor(); - var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor(); - var getPrototypeOf2 = require_object_get_prototype_of(); - function get(target, propertyKey) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var descriptor, prototype; - if (anObject5(target) === receiver) - return target[propertyKey]; - descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey); - if (descriptor) - return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === void 0 ? void 0 : call3(descriptor.get, receiver); - if (isObject4(prototype = getPrototypeOf2(target))) - return get(prototype, propertyKey, receiver); - } - $27({ target: "Reflect", stat: true }, { - get: get - }); - - // node_modules/core-js/modules/es.object.get-own-property-descriptor.js - var $28 = require_export(); - var fails9 = require_fails(); - var toIndexedObject2 = require_to_indexed_object(); - var nativeGetOwnPropertyDescriptor = require_object_get_own_property_descriptor().f; - var DESCRIPTORS5 = require_descriptors(); - var FORCED6 = !DESCRIPTORS5 || fails9(function() { - nativeGetOwnPropertyDescriptor(1); - }); - $28({ target: "Object", stat: true, forced: FORCED6, sham: !DESCRIPTORS5 }, { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor2(it, key) { - return nativeGetOwnPropertyDescriptor(toIndexedObject2(it), key); + // node_modules/core-js/modules/es.string.trim.js + var $26 = require_export(); + var $trim = require_string_trim().trim; + var forcedStringTrimMethod = require_string_trim_forced(); + $26({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, { + trim: function trim2() { + return $trim(this); } }); - // srcts/src/bindings/input/text.ts + // srcts/src/bindings/input/checkboxgroup.ts var import_es_array_iterator5 = __toESM(require_es_array_iterator()); var import_jquery7 = __toESM(require_jquery()); function _typeof5(obj) { @@ -7615,31 +7560,6 @@ } return (hint === "string" ? String : Number)(input); } - function _get() { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get.bind(); - } else { - _get = function _get3(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) - return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(arguments.length < 3 ? target : receiver); - } - return desc.value; - }; - } - return _get.apply(this, arguments); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf3(object); - if (object === null) - break; - } - return object; - } function _inherits3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); @@ -7704,127 +7624,103 @@ }; return _getPrototypeOf3(o4); } - function getLabelNode2(el) { - return (0, import_jquery7.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); + function getLabelNode(el) { + return (0, import_jquery7.default)(el).find('label[for="' + $escape(el.id) + '"]'); } - var TextInputBindingBase = /* @__PURE__ */ function(_InputBinding) { - _inherits3(TextInputBindingBase2, _InputBinding); - var _super = _createSuper3(TextInputBindingBase2); - function TextInputBindingBase2() { - _classCallCheck5(this, TextInputBindingBase2); + function getLabel(obj) { + var parentNode = obj.parentNode; + if (parentNode.tagName === "LABEL") { + return (0, import_jquery7.default)(parentNode).find("span").text().trim(); + } + return null; + } + var CheckboxGroupInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits3(CheckboxGroupInputBinding2, _InputBinding); + var _super = _createSuper3(CheckboxGroupInputBinding2); + function CheckboxGroupInputBinding2() { + _classCallCheck5(this, CheckboxGroupInputBinding2); return _super.apply(this, arguments); } - _createClass5(TextInputBindingBase2, [{ + _createClass5(CheckboxGroupInputBinding2, [{ key: "find", value: function find2(scope) { - var $inputs = (0, import_jquery7.default)(scope).find('input[type="text"], input[type="search"], input[type="url"], input[type="email"]'); - return $inputs.not('input[type="text"][id$="-selectized"]'); - } - }, { - key: "getId", - value: function getId(el) { - return _get(_getPrototypeOf3(TextInputBindingBase2.prototype), "getId", this).call(this, el) || el.name; + return (0, import_jquery7.default)(scope).find(".shiny-input-checkboxgroup"); } }, { key: "getValue", value: function getValue(el) { - throw "not implemented"; - el; + var $objs = (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"]:checked'); + var values2 = new Array($objs.length); + for (var i5 = 0; i5 < $objs.length; i5++) { + values2[i5] = $objs[i5].value; + } + return values2; } }, { key: "setValue", value: function setValue(el, value) { - throw "not implemented"; - el; - value; - } - }, { - key: "subscribe", - value: function subscribe(el, callback) { - (0, import_jquery7.default)(el).on( - "keyup.textInputBinding input.textInputBinding", - function() { - callback(true); - } - ); - (0, import_jquery7.default)(el).on( - "change.textInputBinding", - function() { - callback(false); + var _value; + value = (_value = value) !== null && _value !== void 0 ? _value : []; + (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"]').prop("checked", false); + if (value instanceof Array) { + for (var i5 = 0; i5 < value.length; i5++) { + (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"][value="' + $escape(value[i5]) + '"]').prop("checked", true); } - ); - } - }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery7.default)(el).off(".textInputBinding"); - } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - throw "not implemented"; - el; - data; - } - }, { - key: "getState", - value: function getState(el) { - throw "not implemented"; - el; - } - }, { - key: "getRatePolicy", - value: function getRatePolicy(el) { - return { - policy: "debounce", - delay: 250 - }; - el; - } - }]); - return TextInputBindingBase2; - }(InputBinding); - var TextInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) { - _inherits3(TextInputBinding2, _TextInputBindingBase); - var _super2 = _createSuper3(TextInputBinding2); - function TextInputBinding2() { - _classCallCheck5(this, TextInputBinding2); - return _super2.apply(this, arguments); - } - _createClass5(TextInputBinding2, [{ - key: "setValue", - value: function setValue(el, value) { - el.value = value; - } - }, { - key: "getValue", - value: function getValue(el) { - return el.value; + } else { + (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"][value="' + $escape(value) + '"]').prop("checked", true); + } } }, { key: "getState", value: function getState(el) { + var $objs = (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"]'); + var options = new Array($objs.length); + for (var i5 = 0; i5 < options.length; i5++) { + options[i5] = { + value: $objs[i5].value, + label: getLabel($objs[i5]) + }; + } return { - label: getLabelNode2(el).text(), - value: el.value, - placeholder: el.placeholder + label: getLabelNode(el).text(), + value: this.getValue(el), + options: options }; } }, { key: "receiveMessage", value: function receiveMessage(el, data) { - if (hasDefinedProperty(data, "value")) + var $el = (0, import_jquery7.default)(el); + if (hasDefinedProperty(data, "options")) { + $el.find("div.shiny-options-group").remove(); + $el.find("label.checkbox").remove(); + $el.append(data.options); + } + if (hasDefinedProperty(data, "value")) { this.setValue(el, data.value); - updateLabel(data.label, getLabelNode2(el)); - if (hasDefinedProperty(data, "placeholder")) - el.placeholder = data.placeholder; + } + updateLabel(data.label, getLabelNode(el)); (0, import_jquery7.default)(el).trigger("change"); } + }, { + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery7.default)(el).on("change.checkboxGroupInputBinding", function() { + callback(false); + }); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery7.default)(el).off(".checkboxGroupInputBinding"); + } }]); - return TextInputBinding2; - }(TextInputBindingBase); + return CheckboxGroupInputBinding2; + }(InputBinding); - // srcts/src/bindings/input/number.ts + // srcts/src/bindings/input/date.ts + var import_es_array_iterator6 = __toESM(require_es_array_iterator()); + var import_jquery8 = __toESM(require_jquery()); function _typeof6(obj) { "@babel/helpers - typeof"; return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { @@ -7936,77 +7832,240 @@ }; return _getPrototypeOf4(o4); } - function getLabelNode3(el) { - return (0, import_jquery8.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); - } - var NumberInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) { - _inherits4(NumberInputBinding2, _TextInputBindingBase); - var _super = _createSuper4(NumberInputBinding2); - function NumberInputBinding2() { - _classCallCheck6(this, NumberInputBinding2); + var DateInputBindingBase = /* @__PURE__ */ function(_InputBinding) { + _inherits4(DateInputBindingBase2, _InputBinding); + var _super = _createSuper4(DateInputBindingBase2); + function DateInputBindingBase2() { + _classCallCheck6(this, DateInputBindingBase2); return _super.apply(this, arguments); } - _createClass6(NumberInputBinding2, [{ + _createClass6(DateInputBindingBase2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery8.default)(scope).find('input[type="number"]'); - } - }, { - key: "getValue", - value: function getValue(el) { - var numberVal = (0, import_jquery8.default)(el).val(); - if (typeof numberVal == "string") { - if (/^\s*$/.test(numberVal)) - return null; - } - var numberValue = Number(numberVal); - if (!isNaN(numberValue)) { - return numberValue; - } - return numberVal; - } - }, { - key: "setValue", - value: function setValue(el, value) { - el.value = "" + value; + return (0, import_jquery8.default)(scope).find(".shiny-date-input"); } }, { key: "getType", value: function getType(el) { - return "shiny.number"; + return "shiny.date"; el; } }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var _data$value, _data$min, _data$max, _data$step; - if (hasDefinedProperty(data, "value")) - el.value = (_data$value = data.value) !== null && _data$value !== void 0 ? _data$value : ""; - if (hasDefinedProperty(data, "min")) - el.min = (_data$min = data.min) !== null && _data$min !== void 0 ? _data$min : ""; - if (hasDefinedProperty(data, "max")) - el.max = (_data$max = data.max) !== null && _data$max !== void 0 ? _data$max : ""; - if (hasDefinedProperty(data, "step")) - el.step = (_data$step = data.step) !== null && _data$step !== void 0 ? _data$step : ""; - updateLabel(data.label, getLabelNode3(el)); - (0, import_jquery8.default)(el).trigger("change"); + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery8.default)(el).on( + "keyup.dateInputBinding input.dateInputBinding", + function() { + callback(true); + } + ); + (0, import_jquery8.default)(el).on( + "changeDate.dateInputBinding change.dateInputBinding", + function() { + callback(false); + } + ); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery8.default)(el).off(".dateInputBinding"); + } + }, { + key: "getRatePolicy", + value: function getRatePolicy() { + return { + policy: "debounce", + delay: 250 + }; + } + }, { + key: "setValue", + value: function setValue(el, data) { + throw "not implemented"; + el; + data; + } + }, { + key: "initialize", + value: function initialize(el) { + var $input = (0, import_jquery8.default)(el).find("input"); + var date = $input.data("initial-date"); + if (date === void 0 || date === null) { + date = this._floorDateTime(this._dateAsUTC(new Date())); + } + this.setValue(el, date); + if ($input.data("min-date") !== void 0) { + this._setMin($input[0], $input.data("min-date")); + } + if ($input.data("max-date") !== void 0) { + this._setMax($input[0], $input.data("max-date")); + } + } + }, { + key: "_getLabelNode", + value: function _getLabelNode(el) { + return (0, import_jquery8.default)(el).find('label[for="' + $escape(el.id) + '"]'); + } + }, { + key: "_formatToString", + value: function _formatToString(format) { + var str = ""; + var i5; + for (i5 = 0; i5 < format.parts.length; i5++) { + str += format.separators[i5] + format.parts[i5]; + } + str += format.separators[i5]; + return str; + } + }, { + key: "_setMin", + value: function _setMin(el, date) { + if (date === null) { + (0, import_jquery8.default)(el).bsDatepicker("setStartDate", null); + return; + } + var parsedDate = this._newDate(date); + if (parsedDate === null) + return; + date = parsedDate; + if (isNaN(date.valueOf())) + return; + var curValue = (0, import_jquery8.default)(el).bsDatepicker("getUTCDate"); + (0, import_jquery8.default)(el).bsDatepicker("setStartDate", this._utcDateAsLocal(date)); + if (date && curValue && date.getTime() > curValue.getTime()) { + (0, import_jquery8.default)(el).bsDatepicker("clearDates"); + } else { + (0, import_jquery8.default)(el).bsDatepicker("setUTCDate", curValue); + } + } + }, { + key: "_setMax", + value: function _setMax(el, date) { + if (date === null) { + (0, import_jquery8.default)(el).bsDatepicker("setEndDate", null); + return; + } + var parsedDate = this._newDate(date); + if (parsedDate === null) + return; + date = parsedDate; + if (isNaN(date.valueOf())) + return; + var curValue = (0, import_jquery8.default)(el).bsDatepicker("getUTCDate"); + (0, import_jquery8.default)(el).bsDatepicker("setEndDate", this._utcDateAsLocal(date)); + if (date && curValue && date.getTime() < curValue.getTime()) { + (0, import_jquery8.default)(el).bsDatepicker("clearDates"); + } else { + (0, import_jquery8.default)(el).bsDatepicker("setUTCDate", curValue); + } + } + }, { + key: "_newDate", + value: function _newDate(date) { + if (date instanceof Date) + return date; + if (!date) + return null; + var d4 = parseDate(date); + if (isNaN(d4.valueOf())) + return null; + return d4; + } + }, { + key: "_floorDateTime", + value: function _floorDateTime(date) { + date = new Date(date.getTime()); + date.setUTCHours(0, 0, 0, 0); + return date; + } + }, { + key: "_dateAsUTC", + value: function _dateAsUTC(date) { + return new Date(date.getTime() - date.getTimezoneOffset() * 6e4); + } + }, { + key: "_utcDateAsLocal", + value: function _utcDateAsLocal(date) { + return new Date(date.getTime() + date.getTimezoneOffset() * 6e4); + } + }]); + return DateInputBindingBase2; + }(InputBinding); + var DateInputBinding = /* @__PURE__ */ function(_DateInputBindingBase) { + _inherits4(DateInputBinding2, _DateInputBindingBase); + var _super2 = _createSuper4(DateInputBinding2); + function DateInputBinding2() { + _classCallCheck6(this, DateInputBinding2); + return _super2.apply(this, arguments); + } + _createClass6(DateInputBinding2, [{ + key: "getValue", + value: function getValue(el) { + var date = (0, import_jquery8.default)(el).find("input").bsDatepicker("getUTCDate"); + return formatDateUTC(date); + } + }, { + key: "setValue", + value: function setValue(el, value) { + if (value === null) { + (0, import_jquery8.default)(el).find("input").val("").bsDatepicker("update"); + return; + } + var date = this._newDate(value); + if (date === null) { + return; + } + if (isNaN(date.valueOf())) + return; + (0, import_jquery8.default)(el).find("input").bsDatepicker("setUTCDate", date); } }, { key: "getState", value: function getState(el) { + var $el = (0, import_jquery8.default)(el); + var $input = $el.find("input"); + var min6 = $input.data("datepicker").startDate; + var max4 = $input.data("datepicker").endDate; + min6 = min6 === -Infinity ? null : formatDateUTC(min6); + max4 = max4 === Infinity ? null : formatDateUTC(max4); + var startview = $input.data("datepicker").startViewMode; + if (startview === 2) + startview = "decade"; + else if (startview === 1) + startview = "year"; + else if (startview === 0) + startview = "month"; return { - label: getLabelNode3(el).text(), + label: this._getLabelNode(el).text(), value: this.getValue(el), - min: Number(el.min), - max: Number(el.max), - step: Number(el.step) + valueString: $input.val(), + min: min6, + max: max4, + language: $input.data("datepicker").language, + weekstart: $input.data("datepicker").weekStart, + format: this._formatToString($input.data("datepicker").format), + startview: startview }; } + }, { + key: "receiveMessage", + value: function receiveMessage(el, data) { + var $input = (0, import_jquery8.default)(el).find("input"); + updateLabel(data.label, this._getLabelNode(el)); + if (hasDefinedProperty(data, "min")) + this._setMin($input[0], data.min); + if (hasDefinedProperty(data, "max")) + this._setMax($input[0], data.max); + if (hasDefinedProperty(data, "value")) + this.setValue(el, data.value); + (0, import_jquery8.default)(el).trigger("change"); + } }]); - return NumberInputBinding2; - }(TextInputBindingBase); + return DateInputBinding2; + }(DateInputBindingBase); - // srcts/src/bindings/input/password.ts + // srcts/src/bindings/input/daterange.ts var import_es_array_iterator7 = __toESM(require_es_array_iterator()); var import_jquery9 = __toESM(require_jquery()); function _typeof7(obj) { @@ -8120,802 +8179,1034 @@ }; return _getPrototypeOf5(o4); } - var PasswordInputBinding = /* @__PURE__ */ function(_TextInputBinding) { - _inherits5(PasswordInputBinding2, _TextInputBinding); - var _super = _createSuper5(PasswordInputBinding2); - function PasswordInputBinding2() { - _classCallCheck7(this, PasswordInputBinding2); + function getLabelNode2(el) { + return (0, import_jquery9.default)(el).find('label[for="' + $escape(el.id) + '"]'); + } + var DateRangeInputBinding = /* @__PURE__ */ function(_DateInputBindingBase) { + _inherits5(DateRangeInputBinding2, _DateInputBindingBase); + var _super = _createSuper5(DateRangeInputBinding2); + function DateRangeInputBinding2() { + _classCallCheck7(this, DateRangeInputBinding2); return _super.apply(this, arguments); } - _createClass7(PasswordInputBinding2, [{ + _createClass7(DateRangeInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery9.default)(scope).find('input[type="password"]'); + return (0, import_jquery9.default)(scope).find(".shiny-date-range-input"); } }, { - key: "getType", - value: function getType(el) { - return "shiny.password"; - el; + key: "getValue", + value: function getValue(el) { + var $inputs = (0, import_jquery9.default)(el).find("input"); + var start = $inputs.eq(0).bsDatepicker("getUTCDate"); + var end = $inputs.eq(1).bsDatepicker("getUTCDate"); + return [formatDateUTC(start), formatDateUTC(end)]; } - }]); - return PasswordInputBinding2; - }(TextInputBinding); - - // srcts/src/bindings/input/textarea.ts - var import_es_array_iterator8 = __toESM(require_es_array_iterator()); - var import_jquery10 = __toESM(require_jquery()); - function _typeof8(obj) { - "@babel/helpers - typeof"; - return _typeof8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof8(obj); - } - function _classCallCheck8(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties8(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey8(descriptor.key), descriptor); - } - } - function _createClass8(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties8(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties8(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _toPropertyKey8(arg) { - var key = _toPrimitive8(arg, "string"); - return _typeof8(key) === "symbol" ? key : String(key); - } - function _toPrimitive8(input, hint) { - if (_typeof8(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof8(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - function _inherits6(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf6(subClass, superClass); - } - function _setPrototypeOf6(o4, p3) { - _setPrototypeOf6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { - o5.__proto__ = p4; - return o5; - }; - return _setPrototypeOf6(o4, p3); - } - function _createSuper6(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct6(); - return function _createSuperInternal() { - var Super = _getPrototypeOf6(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf6(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + }, { + key: "setValue", + value: function setValue(el, value) { + if (!(value instanceof Object)) { + return; + } + var $inputs = (0, import_jquery9.default)(el).find("input"); + if (value.start !== void 0) { + if (value.start === null) { + $inputs.eq(0).val("").bsDatepicker("update"); + } else { + var start = this._newDate(value.start); + $inputs.eq(0).bsDatepicker("setUTCDate", start); + } + } + if (value.end !== void 0) { + if (value.end === null) { + $inputs.eq(1).val("").bsDatepicker("update"); + } else { + var end = this._newDate(value.end); + $inputs.eq(1).bsDatepicker("setUTCDate", end); + } + } } - return _possibleConstructorReturn6(this, result); - }; - } - function _possibleConstructorReturn6(self2, call8) { - if (call8 && (_typeof8(call8) === "object" || typeof call8 === "function")) { - return call8; - } else if (call8 !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); - } - return _assertThisInitialized6(self2); - } - function _assertThisInitialized6(self2) { - if (self2 === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self2; - } - function _isNativeReflectConstruct6() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) - return false; - if (typeof Proxy === "function") - return true; - try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - return true; - } catch (e4) { - return false; - } - } - function _getPrototypeOf6(o4) { - _getPrototypeOf6 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { - return o5.__proto__ || Object.getPrototypeOf(o5); - }; - return _getPrototypeOf6(o4); - } - var TextareaInputBinding = /* @__PURE__ */ function(_TextInputBinding) { - _inherits6(TextareaInputBinding2, _TextInputBinding); - var _super = _createSuper6(TextareaInputBinding2); - function TextareaInputBinding2() { - _classCallCheck8(this, TextareaInputBinding2); - return _super.apply(this, arguments); - } - _createClass8(TextareaInputBinding2, [{ - key: "find", - value: function find2(scope) { - return (0, import_jquery10.default)(scope).find("textarea"); + }, { + key: "getState", + value: function getState(el) { + var $el = (0, import_jquery9.default)(el); + var $inputs = $el.find("input"); + var $startinput = $inputs.eq(0); + var $endinput = $inputs.eq(1); + var min6 = $startinput.bsDatepicker("getStartDate"); + var max4 = $startinput.bsDatepicker("getEndDate"); + var minStr = min6 === -Infinity ? null : formatDateUTC(min6); + var maxStr = max4 === Infinity ? null : formatDateUTC(max4); + var startview = $startinput.data("datepicker").startView; + if (startview === 2) + startview = "decade"; + else if (startview === 1) + startview = "year"; + else if (startview === 0) + startview = "month"; + return { + label: getLabelNode2(el).text(), + value: this.getValue(el), + valueString: [$startinput.val(), $endinput.val()], + min: minStr, + max: maxStr, + weekstart: $startinput.data("datepicker").weekStart, + format: this._formatToString($startinput.data("datepicker").format), + language: $startinput.data("datepicker").language, + startview: startview + }; + } + }, { + key: "receiveMessage", + value: function receiveMessage(el, data) { + var $el = (0, import_jquery9.default)(el); + var $inputs = $el.find("input"); + var $startinput = $inputs.eq(0); + var $endinput = $inputs.eq(1); + updateLabel(data.label, getLabelNode2(el)); + if (hasDefinedProperty(data, "min")) { + this._setMin($startinput[0], data.min); + this._setMin($endinput[0], data.min); + } + if (hasDefinedProperty(data, "max")) { + this._setMax($startinput[0], data.max); + this._setMax($endinput[0], data.max); + } + if (hasDefinedProperty(data, "value")) { + this.setValue(el, data.value); + } + $el.trigger("change"); + } + }, { + key: "initialize", + value: function initialize(el) { + var $el = (0, import_jquery9.default)(el); + var $inputs = $el.find("input"); + var $startinput = $inputs.eq(0); + var $endinput = $inputs.eq(1); + var start = $startinput.data("initial-date"); + var end = $endinput.data("initial-date"); + if (start === void 0 || start === null) + start = this._dateAsUTC(new Date()); + if (end === void 0 || end === null) + end = this._dateAsUTC(new Date()); + this.setValue(el, { + start: start, + end: end + }); + this._setMin($startinput[0], $startinput.data("min-date")); + this._setMin($endinput[0], $startinput.data("min-date")); + this._setMax($startinput[0], $endinput.data("max-date")); + this._setMax($endinput[0], $endinput.data("max-date")); + } + }, { + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery9.default)(el).on( + "keyup.dateRangeInputBinding input.dateRangeInputBinding", + function() { + callback(true); + } + ); + (0, import_jquery9.default)(el).on( + "changeDate.dateRangeInputBinding change.dateRangeInputBinding", + function() { + callback(false); + } + ); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery9.default)(el).off(".dateRangeInputBinding"); } }]); - return TextareaInputBinding2; - }(TextInputBinding); + return DateRangeInputBinding2; + }(DateInputBindingBase); - // srcts/src/bindings/input/radio.ts + // srcts/src/bindings/input/fileinput.ts + var import_es_array_iterator10 = __toESM(require_es_array_iterator()); + var import_jquery12 = __toESM(require_jquery()); + + // node_modules/core-js/modules/es.array.from.js + var $30 = require_export(); + var from = require_array_from(); + var checkCorrectnessOfIteration = require_check_correctness_of_iteration(); + var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { + Array.from(iterable); + }); + $30({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { + from: from + }); + + // node_modules/core-js/modules/es.array.map.js + var $31 = require_export(); + var $map = require_array_iteration().map; + var arrayMethodHasSpeciesSupport4 = require_array_method_has_species_support(); + var HAS_SPECIES_SUPPORT3 = arrayMethodHasSpeciesSupport4("map"); + $31({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT3 }, { + map: function map(callbackfn) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0); + } + }); + + // srcts/src/file/fileProcessor.ts var import_es_array_iterator9 = __toESM(require_es_array_iterator()); var import_jquery11 = __toESM(require_jquery()); - function _typeof9(obj) { + + // srcts/src/events/inputChanged.ts + var import_jquery10 = __toESM(require_jquery()); + function triggerFileInputChanged(name, value, binding, el, inputType, onEl) { + var evt = import_jquery10.default.Event("shiny:inputchanged"); + evt.name = name; + evt.value = value; + evt.binding = binding; + evt.el = el; + evt.inputType = inputType; + (0, import_jquery10.default)(onEl).trigger(evt); + return evt; + } + + // srcts/src/shiny/initedMethods.ts + var import_es_array_iterator8 = __toESM(require_es_array_iterator()); + function _typeof8(obj) { "@babel/helpers - typeof"; - return _typeof9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof9(obj); + }, _typeof8(obj); } - function _classCallCheck9(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); + function _regeneratorRuntime() { + "use strict"; + _regeneratorRuntime = function _regeneratorRuntime16() { + return exports; + }; + var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) { + obj[key] = desc.value; + }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + function define(obj, key, value) { + return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key]; } - } - function _defineProperties9(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey9(descriptor.key), descriptor); - } - } - function _createClass9(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties9(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties9(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _toPropertyKey9(arg) { - var key = _toPrimitive9(arg, "string"); - return _typeof9(key) === "symbol" ? key : String(key); - } - function _toPrimitive9(input, hint) { - if (_typeof9(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof9(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); + try { + define({}, ""); + } catch (err) { + define = function define2(obj, key, value) { + return obj[key] = value; + }; } - return (hint === "string" ? String : Number)(input); - } - function _inherits7(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + function wrap(innerFn, outerFn, self2, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); + return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator; } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf7(subClass, superClass); - } - function _setPrototypeOf7(o4, p3) { - _setPrototypeOf7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { - o5.__proto__ = p4; - return o5; - }; - return _setPrototypeOf7(o4, p3); - } - function _createSuper7(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct7(); - return function _createSuperInternal() { - var Super = _getPrototypeOf7(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf7(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; } - return _possibleConstructorReturn7(this, result); - }; - } - function _possibleConstructorReturn7(self2, call8) { - if (call8 && (_typeof9(call8) === "object" || typeof call8 === "function")) { - return call8; - } else if (call8 !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized7(self2); - } - function _assertThisInitialized7(self2) { - if (self2 === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + exports.wrap = wrap; + var ContinueSentinel = {}; + function Generator() { } - return self2; - } - function _isNativeReflectConstruct7() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) - return false; - if (typeof Proxy === "function") - return true; - try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - return true; - } catch (e4) { - return false; + function GeneratorFunction() { } - } - function _getPrototypeOf7(o4) { - _getPrototypeOf7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { - return o5.__proto__ || Object.getPrototypeOf(o5); - }; - return _getPrototypeOf7(o4); - } - function getLabelNode4(el) { - return (0, import_jquery11.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); - } - function getLabel2(obj) { - var parentNode = obj.parentNode; - if (parentNode.tagName === "LABEL") { - return (0, import_jquery11.default)(parentNode).find("span").text().trim(); + function GeneratorFunctionPrototype() { } - return null; - } - var RadioInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits7(RadioInputBinding2, _InputBinding); - var _super = _createSuper7(RadioInputBinding2); - function RadioInputBinding2() { - _classCallCheck9(this, RadioInputBinding2); - return _super.apply(this, arguments); + var IteratorPrototype = {}; + define(IteratorPrototype, iteratorSymbol, function() { + return this; + }); + var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([]))); + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + define(prototype, method, function(arg) { + return this._invoke(method, arg); + }); + }); } - _createClass9(RadioInputBinding2, [{ - key: "find", - value: function find2(scope) { - return (0, import_jquery11.default)(scope).find(".shiny-input-radiogroup"); - } - }, { - key: "getValue", - value: function getValue(el) { - var checkedItems = (0, import_jquery11.default)('input:radio[name="' + $escape(el.id) + '"]:checked'); - if (checkedItems.length === 0) { - return null; - } - return checkedItems.val(); - } - }, { - key: "setValue", - value: function setValue(el, value) { - if (Array.isArray(value) && value.length === 0) { - (0, import_jquery11.default)('input:radio[name="' + $escape(el.id) + '"]').prop("checked", false); - } else { - (0, import_jquery11.default)('input:radio[name="' + $escape(el.id) + '"][value="' + $escape(value) + '"]').prop("checked", true); + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if ("throw" !== record.type) { + var result = record.arg, value = result.value; + return value && "object" == _typeof8(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) { + invoke("next", value2, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }) : PromiseImpl.resolve(value).then(function(unwrapped) { + result.value = unwrapped, resolve(result); + }, function(error) { + return invoke("throw", error, resolve, reject); + }); } + reject(record.arg); } - }, { - key: "getState", - value: function getState(el) { - var $objs = (0, import_jquery11.default)('input:radio[name="' + $escape(el.id) + '"]'); - var options = new Array($objs.length); - for (var i5 = 0; i5 < options.length; i5++) { - options[i5] = { - value: $objs[i5].value, - label: getLabel2($objs[i5]) - }; + var previousPromise; + defineProperty3(this, "_invoke", { value: function value(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); } - return { - label: getLabelNode4(el).text(), - value: this.getValue(el), - options: options - }; - } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var $el = (0, import_jquery11.default)(el); - if (hasDefinedProperty(data, "options")) { - $el.find("div.shiny-options-group").remove(); - $el.find("label.radio").remove(); - $el.append(data.options); + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } }); + } + function makeInvokeMethod(innerFn, self2, context) { + var state = "suspendedStart"; + return function(method, arg) { + if ("executing" === state) + throw new Error("Generator is already running"); + if ("completed" === state) { + if ("throw" === method) + throw arg; + return doneResult(); } - if (hasDefinedProperty(data, "value")) { - this.setValue(el, data.value); + for (context.method = method, context.arg = arg; ; ) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) + continue; + return delegateResult; + } + } + if ("next" === context.method) + context.sent = context._sent = context.arg; + else if ("throw" === context.method) { + if ("suspendedStart" === state) + throw state = "completed", context.arg; + context.dispatchException(context.arg); + } else + "return" === context.method && context.abrupt("return", context.arg); + state = "executing"; + var record = tryCatch(innerFn, self2, context); + if ("normal" === record.type) { + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) + continue; + return { value: record.arg, done: context.done }; + } + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } - updateLabel(data.label, getLabelNode4(el)); - (0, import_jquery11.default)(el).trigger("change"); - } - }, { - key: "subscribe", - value: function subscribe(el, callback) { - (0, import_jquery11.default)(el).on("change.radioInputBinding", function() { - callback(false); - }); - } - }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery11.default)(el).off(".radioInputBinding"); - } - }]); - return RadioInputBinding2; - }(InputBinding); - - // srcts/src/bindings/input/date.ts - var import_es_array_iterator10 = __toESM(require_es_array_iterator()); - var import_jquery12 = __toESM(require_jquery()); - function _typeof10(obj) { - "@babel/helpers - typeof"; - return _typeof10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof10(obj); - } - function _classCallCheck10(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); + }; } - } - function _defineProperties10(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey10(descriptor.key), descriptor); + function maybeInvokeDelegate(delegate, context) { + var methodName = context.method, method = delegate.iterator[methodName]; + if (void 0 === method) + return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; + var record = tryCatch(method, delegate.iterator, context.arg); + if ("throw" === record.type) + return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; + var info = record.arg; + return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } - } - function _createClass10(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties10(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties10(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _toPropertyKey10(arg) { - var key = _toPrimitive10(arg, "string"); - return _typeof10(key) === "symbol" ? key : String(key); - } - function _toPrimitive10(input, hint) { - if (_typeof10(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof10(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } - return (hint === "string" ? String : Number)(input); - } - function _inherits8(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal", delete record.arg, entry.completion = record; } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf8(subClass, superClass); - } - function _setPrototypeOf8(o4, p3) { - _setPrototypeOf8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { - o5.__proto__ = p4; - return o5; - }; - return _setPrototypeOf8(o4, p3); - } - function _createSuper8(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct8(); - return function _createSuperInternal() { - var Super = _getPrototypeOf8(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf8(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + function Context(tryLocsList) { + this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true); + } + function values2(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) + return iteratorMethod.call(iterable); + if ("function" == typeof iterable.next) + return iterable; + if (!isNaN(iterable.length)) { + var i5 = -1, next2 = function next3() { + for (; ++i5 < iterable.length; ) + if (hasOwn5.call(iterable, i5)) + return next3.value = iterable[i5], next3.done = false, next3; + return next3.value = void 0, next3.done = true, next3; + }; + return next2.next = next2; + } } - return _possibleConstructorReturn8(this, result); - }; - } - function _possibleConstructorReturn8(self2, call8) { - if (call8 && (_typeof10(call8) === "object" || typeof call8 === "function")) { - return call8; - } else if (call8 !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); + return { next: doneResult }; } - return _assertThisInitialized8(self2); - } - function _assertThisInitialized8(self2) { - if (self2 === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + function doneResult() { + return { value: void 0, done: true }; } - return self2; + return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) { + var ctor = "function" == typeof genFun && genFun.constructor; + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); + }, exports.mark = function(genFun) { + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; + }, exports.awrap = function(arg) { + return { __await: arg }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() { + return this; + }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) { + void 0 === PromiseImpl && (PromiseImpl = Promise); + var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() { + return this; + }), define(Gp, "toString", function() { + return "[object Generator]"; + }), exports.keys = function(val) { + var object = Object(val), keys2 = []; + for (var key in object) + keys2.push(key); + return keys2.reverse(), function next2() { + for (; keys2.length; ) { + var key2 = keys2.pop(); + if (key2 in object) + return next2.value = key2, next2.done = false, next2; + } + return next2.done = true, next2; + }; + }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset) + for (var name in this) + "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0); + }, stop: function stop() { + this.done = true; + var rootRecord = this.tryEntries[0].completion; + if ("throw" === rootRecord.type) + throw rootRecord.arg; + return this.rval; + }, dispatchException: function dispatchException(exception) { + if (this.done) + throw exception; + var context = this; + function handle(loc, caught) { + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught; + } + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5], record = entry.completion; + if ("root" === entry.tryLoc) + return handle("end"); + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc"); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) + return handle(entry.catchLoc, true); + if (this.prev < entry.finallyLoc) + return handle(entry.finallyLoc); + } else if (hasCatch) { + if (this.prev < entry.catchLoc) + return handle(entry.catchLoc, true); + } else { + if (!hasFinally) + throw new Error("try statement without catch or finally"); + if (this.prev < entry.finallyLoc) + return handle(entry.finallyLoc); + } + } + } + }, abrupt: function abrupt(type, arg) { + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5]; + if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); + var record = finallyEntry ? finallyEntry.completion : {}; + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); + }, complete: function complete(record, afterLoc) { + if ("throw" === record.type) + throw record.arg; + return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; + }, finish: function finish(finallyLoc) { + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5]; + if (entry.finallyLoc === finallyLoc) + return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; + } + }, catch: function _catch(tryLoc) { + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if ("throw" === record.type) { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + throw new Error("illegal catch attempt"); + }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { + return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel; + } }, exports; } - function _isNativeReflectConstruct8() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) - return false; - if (typeof Proxy === "function") - return true; + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - return true; - } catch (e4) { - return false; + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); } } - function _getPrototypeOf8(o4) { - _getPrototypeOf8 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { - return o5.__proto__ || Object.getPrototypeOf(o5); + function _asyncToGenerator(fn) { + return function() { + var self2 = this, args = arguments; + return new Promise(function(resolve, reject) { + var gen = fn.apply(self2, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(void 0); + }); }; - return _getPrototypeOf8(o4); } - var DateInputBindingBase = /* @__PURE__ */ function(_InputBinding) { - _inherits8(DateInputBindingBase2, _InputBinding); - var _super = _createSuper8(DateInputBindingBase2); - function DateInputBindingBase2() { - _classCallCheck10(this, DateInputBindingBase2); - return _super.apply(this, arguments); + var fullShinyObj; + function setShinyObj(shiny) { + fullShinyObj = shiny; + } + function validateShinyHasBeenSet() { + if (typeof fullShinyObj === "undefined") { + throw "Shiny has not finish initialization yet. Please wait for the 'shiny-initialized' event."; } - _createClass10(DateInputBindingBase2, [{ - key: "find", - value: function find2(scope) { - return (0, import_jquery12.default)(scope).find(".shiny-date-input"); + return fullShinyObj; + } + function shinySetInputValue(name, value, opts) { + validateShinyHasBeenSet().setInputValue(name, value, opts); + } + function shinyShinyApp() { + return validateShinyHasBeenSet().shinyapp; + } + function setShinyUser(user) { + validateShinyHasBeenSet().user = user; + } + function shinyForgetLastInputValue(name) { + validateShinyHasBeenSet().forgetLastInputValue(name); + } + function shinyBindAll(_x) { + return _shinyBindAll.apply(this, arguments); + } + function _shinyBindAll() { + _shinyBindAll = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(scope) { + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return validateShinyHasBeenSet().bindAll(scope); + case 2: + case "end": + return _context.stop(); + } + }, _callee); + })); + return _shinyBindAll.apply(this, arguments); + } + function shinyUnbindAll(scope) { + var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + validateShinyHasBeenSet().unbindAll(scope, includeSelf); + } + function shinyInitializeInputs(scope) { + validateShinyHasBeenSet().initializeInputs(scope); + } + function shinyAppBindOutput(_x2, _x3) { + return _shinyAppBindOutput.apply(this, arguments); + } + function _shinyAppBindOutput() { + _shinyAppBindOutput = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(id, binding) { + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return shinyShinyApp().bindOutput(id, binding); + case 2: + case "end": + return _context2.stop(); + } + }, _callee2); + })); + return _shinyAppBindOutput.apply(this, arguments); + } + function shinyAppUnbindOutput(id, binding) { + return shinyShinyApp().unbindOutput(id, binding); + } + function getShinyOnCustomMessage() { + return validateShinyHasBeenSet().oncustommessage; + } + var fileInputBinding; + function getFileInputBinding() { + return fileInputBinding; + } + function setFileInputBinding(fileInputBinding_) { + fileInputBinding = fileInputBinding_; + } + function getShinyCreateWebsocket() { + return validateShinyHasBeenSet().createSocket; + } + + // srcts/src/file/fileProcessor.ts + function _typeof9(obj) { + "@babel/helpers - typeof"; + return _typeof9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof9(obj); + } + function _inherits6(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf6(subClass, superClass); + } + function _setPrototypeOf6(o4, p3) { + _setPrototypeOf6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + o5.__proto__ = p4; + return o5; + }; + return _setPrototypeOf6(o4, p3); + } + function _createSuper6(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct6(); + return function _createSuperInternal() { + var Super = _getPrototypeOf6(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf6(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); } - }, { - key: "getType", - value: function getType(el) { - return "shiny.date"; - el; + return _possibleConstructorReturn6(this, result); + }; + } + function _possibleConstructorReturn6(self2, call8) { + if (call8 && (_typeof9(call8) === "object" || typeof call8 === "function")) { + return call8; + } else if (call8 !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized6(self2); + } + function _assertThisInitialized6(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct6() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e4) { + return false; + } + } + function _getPrototypeOf6(o4) { + _getPrototypeOf6 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + return o5.__proto__ || Object.getPrototypeOf(o5); + }; + return _getPrototypeOf6(o4); + } + function _classCallCheck8(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties8(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey8(descriptor.key), descriptor); + } + } + function _createClass8(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties8(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties8(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _defineProperty3(obj, key, value) { + key = _toPropertyKey8(key); + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey8(arg) { + var key = _toPrimitive8(arg, "string"); + return _typeof9(key) === "symbol" ? key : String(key); + } + function _toPrimitive8(input, hint) { + if (_typeof9(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof9(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var FileProcessor = /* @__PURE__ */ function() { + function FileProcessor2(files) { + var exec$run = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + _classCallCheck8(this, FileProcessor2); + _defineProperty3(this, "files", void 0); + _defineProperty3(this, "fileIndex", -1); + _defineProperty3(this, "aborted", false); + _defineProperty3(this, "completed", false); + this.files = Array.from(files); + if (exec$run) { + this.$run(); + } + } + _createClass8(FileProcessor2, [{ + key: "onBegin", + value: function onBegin(files, cont) { + files; + setTimeout(cont, 0); } }, { - key: "subscribe", - value: function subscribe(el, callback) { - (0, import_jquery12.default)(el).on( - "keyup.dateInputBinding input.dateInputBinding", - function() { - callback(true); - } - ); - (0, import_jquery12.default)(el).on( - "changeDate.dateInputBinding change.dateInputBinding", - function() { - callback(false); - } - ); + key: "onFile", + value: function onFile(file, cont) { + file; + setTimeout(cont, 0); } }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery12.default)(el).off(".dateInputBinding"); + key: "onComplete", + value: function onComplete() { + return; } }, { - key: "getRatePolicy", - value: function getRatePolicy() { - return { - policy: "debounce", - delay: 250 - }; + key: "onAbort", + value: function onAbort() { + return; } }, { - key: "setValue", - value: function setValue(el, data) { - throw "not implemented"; - el; - data; + key: "abort", + value: function abort() { + if (this.completed || this.aborted) + return; + this.aborted = true; + this.onAbort(); } }, { - key: "initialize", - value: function initialize(el) { - var $input = (0, import_jquery12.default)(el).find("input"); - var date = $input.data("initial-date"); - if (date === void 0 || date === null) { - date = this._floorDateTime(this._dateAsUTC(new Date())); - } - this.setValue(el, date); - if ($input.data("min-date") !== void 0) { - this._setMin($input[0], $input.data("min-date")); + key: "$getRun", + value: function $getRun() { + var _this = this; + var called = false; + return function() { + if (called) + return; + called = true; + _this.$run(); + }; + } + }, { + key: "$run", + value: function $run() { + if (this.aborted || this.completed) + return; + if (this.fileIndex < 0) { + this.fileIndex = 0; + this.onBegin(this.files, this.$getRun()); + return; } - if ($input.data("max-date") !== void 0) { - this._setMax($input[0], $input.data("max-date")); + if (this.fileIndex === this.files.length) { + this.completed = true; + this.onComplete(); + return; } + var file = this.files[this.fileIndex++]; + this.onFile(file, this.$getRun()); + } + }]); + return FileProcessor2; + }(); + var FileUploader = /* @__PURE__ */ function(_FileProcessor) { + _inherits6(FileUploader2, _FileProcessor); + var _super = _createSuper6(FileUploader2); + function FileUploader2(shinyapp, id, files, el) { + var _this2; + _classCallCheck8(this, FileUploader2); + _this2 = _super.call(this, files, false); + _defineProperty3(_assertThisInitialized6(_this2), "shinyapp", void 0); + _defineProperty3(_assertThisInitialized6(_this2), "id", void 0); + _defineProperty3(_assertThisInitialized6(_this2), "el", void 0); + _defineProperty3(_assertThisInitialized6(_this2), "jobId", void 0); + _defineProperty3(_assertThisInitialized6(_this2), "uploadUrl", void 0); + _defineProperty3(_assertThisInitialized6(_this2), "progressBytes", void 0); + _defineProperty3(_assertThisInitialized6(_this2), "totalBytes", void 0); + _this2.shinyapp = shinyapp; + _this2.id = id; + _this2.el = el; + _this2.$run(); + return _this2; + } + _createClass8(FileUploader2, [{ + key: "makeRequest", + value: function makeRequest(method, args, onSuccess, onFailure, blobs) { + this.shinyapp.makeRequest(method, args, onSuccess, onFailure, blobs); } }, { - key: "_getLabelNode", - value: function _getLabelNode(el) { - return (0, import_jquery12.default)(el).find('label[for="' + $escape(el.id) + '"]'); + key: "onBegin", + value: function onBegin(files, cont) { + var _this3 = this; + this.$setError(null); + this.$setActive(true); + this.$setVisible(true); + this.onProgress(null, 0); + this.totalBytes = 0; + this.progressBytes = 0; + import_jquery11.default.each(files, function(i5, file) { + _this3.totalBytes += file.size; + }); + var fileInfo = import_jquery11.default.map(files, function(file) { + return { + name: file.name, + size: file.size, + type: file.type + }; + }); + this.makeRequest("uploadInit", [fileInfo], function(response) { + _this3.jobId = response.jobId; + _this3.uploadUrl = response.uploadUrl; + cont(); + }, function(error) { + _this3.onError(error); + }, void 0); } }, { - key: "_formatToString", - value: function _formatToString(format) { - var str = ""; - var i5; - for (i5 = 0; i5 < format.parts.length; i5++) { - str += format.separators[i5] + format.parts[i5]; - } - str += format.separators[i5]; - return str; + key: "onFile", + value: function onFile(file, cont) { + var _this4 = this; + this.onProgress(file, 0); + import_jquery11.default.ajax(this.uploadUrl, { + type: "POST", + cache: false, + xhr: function xhr() { + if (typeof import_jquery11.default.ajaxSettings.xhr !== "function") + throw "jQuery's XHR is not a function"; + var xhrVal = import_jquery11.default.ajaxSettings.xhr(); + if (xhrVal.upload) { + xhrVal.upload.onprogress = function(e4) { + if (e4.lengthComputable) { + _this4.onProgress(file, (_this4.progressBytes + e4.loaded) / _this4.totalBytes); + } + }; + } + return xhrVal; + }, + data: file, + contentType: "application/octet-stream", + processData: false, + success: function success() { + _this4.progressBytes += file.size; + cont(); + }, + error: function error(jqXHR, textStatus, errorThrown) { + errorThrown; + _this4.onError(jqXHR.responseText || textStatus); + } + }); } }, { - key: "_setMin", - value: function _setMin(el, date) { - if (date === null) { - (0, import_jquery12.default)(el).bsDatepicker("setStartDate", null); - return; - } - var parsedDate = this._newDate(date); - if (parsedDate === null) - return; - date = parsedDate; - if (isNaN(date.valueOf())) - return; - var curValue = (0, import_jquery12.default)(el).bsDatepicker("getUTCDate"); - (0, import_jquery12.default)(el).bsDatepicker("setStartDate", this._utcDateAsLocal(date)); - if (date && curValue && date.getTime() > curValue.getTime()) { - (0, import_jquery12.default)(el).bsDatepicker("clearDates"); - } else { - (0, import_jquery12.default)(el).bsDatepicker("setUTCDate", curValue); - } + key: "onComplete", + value: function onComplete() { + var _this5 = this; + var fileInfo = import_jquery11.default.map(this.files, function(file, i5) { + return { + name: file.name, + size: file.size, + type: file.type + }; + i5; + }); + var evt = triggerFileInputChanged(this.id, fileInfo, getFileInputBinding(), this.el, "shiny.fileupload", document); + this.makeRequest("uploadEnd", [this.jobId, this.id], function() { + _this5.$setActive(false); + _this5.onProgress(null, 1); + _this5.$bar().text("Upload complete"); + (0, import_jquery11.default)(evt.el).val(""); + }, function(error) { + _this5.onError(error); + }, void 0); + this.$bar().text("Finishing upload"); } }, { - key: "_setMax", - value: function _setMax(el, date) { - if (date === null) { - (0, import_jquery12.default)(el).bsDatepicker("setEndDate", null); - return; - } - var parsedDate = this._newDate(date); - if (parsedDate === null) - return; - date = parsedDate; - if (isNaN(date.valueOf())) - return; - var curValue = (0, import_jquery12.default)(el).bsDatepicker("getUTCDate"); - (0, import_jquery12.default)(el).bsDatepicker("setEndDate", this._utcDateAsLocal(date)); - if (date && curValue && date.getTime() < curValue.getTime()) { - (0, import_jquery12.default)(el).bsDatepicker("clearDates"); - } else { - (0, import_jquery12.default)(el).bsDatepicker("setUTCDate", curValue); - } + key: "onError", + value: function onError(message) { + this.$setError(message || ""); + this.$setActive(false); } }, { - key: "_newDate", - value: function _newDate(date) { - if (date instanceof Date) - return date; - if (!date) - return null; - var d4 = parseDate(date); - if (isNaN(d4.valueOf())) - return null; - return d4; + key: "onAbort", + value: function onAbort() { + this.$setVisible(false); } }, { - key: "_floorDateTime", - value: function _floorDateTime(date) { - date = new Date(date.getTime()); - date.setUTCHours(0, 0, 0, 0); - return date; + key: "onProgress", + value: function onProgress(file, completed) { + this.$bar().width(Math.round(completed * 100) + "%"); + this.$bar().text(file ? file.name : ""); } }, { - key: "_dateAsUTC", - value: function _dateAsUTC(date) { - return new Date(date.getTime() - date.getTimezoneOffset() * 6e4); + key: "$container", + value: function $container() { + return (0, import_jquery11.default)("#" + $escape(this.id) + "_progress.shiny-file-input-progress"); } }, { - key: "_utcDateAsLocal", - value: function _utcDateAsLocal(date) { - return new Date(date.getTime() + date.getTimezoneOffset() * 6e4); + key: "$bar", + value: function $bar() { + return (0, import_jquery11.default)("#" + $escape(this.id) + "_progress.shiny-file-input-progress .progress-bar"); } - }]); - return DateInputBindingBase2; - }(InputBinding); - var DateInputBinding = /* @__PURE__ */ function(_DateInputBindingBase) { - _inherits8(DateInputBinding2, _DateInputBindingBase); - var _super2 = _createSuper8(DateInputBinding2); - function DateInputBinding2() { - _classCallCheck10(this, DateInputBinding2); - return _super2.apply(this, arguments); - } - _createClass10(DateInputBinding2, [{ - key: "getValue", - value: function getValue(el) { - var date = (0, import_jquery12.default)(el).find("input").bsDatepicker("getUTCDate"); - return formatDateUTC(date); + }, { + key: "$setVisible", + value: function $setVisible(visible) { + this.$container().css("visibility", visible ? "visible" : "hidden"); } }, { - key: "setValue", - value: function setValue(el, value) { - if (value === null) { - (0, import_jquery12.default)(el).find("input").val("").bsDatepicker("update"); - return; - } - var date = this._newDate(value); - if (date === null) { - return; + key: "$setError", + value: function $setError(error) { + this.$bar().toggleClass("progress-bar-danger", error !== null); + if (error !== null) { + this.onProgress(null, 1); + this.$bar().text(error); } - if (isNaN(date.valueOf())) - return; - (0, import_jquery12.default)(el).find("input").bsDatepicker("setUTCDate", date); } }, { - key: "getState", - value: function getState(el) { - var $el = (0, import_jquery12.default)(el); - var $input = $el.find("input"); - var min6 = $input.data("datepicker").startDate; - var max4 = $input.data("datepicker").endDate; - min6 = min6 === -Infinity ? null : formatDateUTC(min6); - max4 = max4 === Infinity ? null : formatDateUTC(max4); - var startview = $input.data("datepicker").startViewMode; - if (startview === 2) - startview = "decade"; - else if (startview === 1) - startview = "year"; - else if (startview === 0) - startview = "month"; - return { - label: this._getLabelNode(el).text(), - value: this.getValue(el), - valueString: $input.val(), - min: min6, - max: max4, - language: $input.data("datepicker").language, - weekstart: $input.data("datepicker").weekStart, - format: this._formatToString($input.data("datepicker").format), - startview: startview - }; - } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var $input = (0, import_jquery12.default)(el).find("input"); - updateLabel(data.label, this._getLabelNode(el)); - if (hasDefinedProperty(data, "min")) - this._setMin($input[0], data.min); - if (hasDefinedProperty(data, "max")) - this._setMax($input[0], data.max); - if (hasDefinedProperty(data, "value")) - this.setValue(el, data.value); - (0, import_jquery12.default)(el).trigger("change"); + key: "$setActive", + value: function $setActive(active) { + this.$container().toggleClass("active", !!active); } }]); - return DateInputBinding2; - }(DateInputBindingBase); + return FileUploader2; + }(FileProcessor); - // srcts/src/bindings/input/slider.ts - var import_es_regexp_exec4 = __toESM(require_es_regexp_exec()); - var import_es_array_iterator11 = __toESM(require_es_array_iterator()); - var import_jquery13 = __toESM(require_jquery()); - function _typeof11(obj) { + // srcts/src/bindings/input/fileinput.ts + function _typeof10(obj) { "@babel/helpers - typeof"; - return _typeof11 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof11(obj); + }, _typeof10(obj); } - function _classCallCheck11(instance, Constructor) { + function _classCallCheck9(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties11(target, props) { + function _defineProperties9(target, props) { for (var i5 = 0; i5 < props.length; i5++) { var descriptor = props[i5]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey11(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey9(descriptor.key), descriptor); } } - function _createClass11(Constructor, protoProps, staticProps) { + function _createClass9(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties11(Constructor.prototype, protoProps); + _defineProperties9(Constructor.prototype, protoProps); if (staticProps) - _defineProperties11(Constructor, staticProps); + _defineProperties9(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey11(arg) { - var key = _toPrimitive11(arg, "string"); - return _typeof11(key) === "symbol" ? key : String(key); + function _toPropertyKey9(arg) { + var key = _toPrimitive9(arg, "string"); + return _typeof10(key) === "symbol" ? key : String(key); } - function _toPrimitive11(input, hint) { - if (_typeof11(input) !== "object" || input === null) + function _toPrimitive9(input, hint) { + if (_typeof10(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof11(res) !== "object") + if (_typeof10(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits9(subClass, superClass) { + function _inherits7(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) - _setPrototypeOf9(subClass, superClass); + _setPrototypeOf7(subClass, superClass); } - function _setPrototypeOf9(o4, p3) { - _setPrototypeOf9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf7(o4, p3) { + _setPrototypeOf7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf9(o4, p3); + return _setPrototypeOf7(o4, p3); } - function _createSuper9(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct9(); + function _createSuper7(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct7(); return function _createSuperInternal() { - var Super = _getPrototypeOf9(Derived), result; + var Super = _getPrototypeOf7(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf9(this).constructor; + var NewTarget = _getPrototypeOf7(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn9(this, result); + return _possibleConstructorReturn7(this, result); }; } - function _possibleConstructorReturn9(self2, call8) { - if (call8 && (_typeof11(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn7(self2, call8) { + if (call8 && (_typeof10(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized9(self2); + return _assertThisInitialized7(self2); } - function _assertThisInitialized9(self2) { + function _assertThisInitialized7(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct9() { + function _isNativeReflectConstruct7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -8930,396 +9221,378 @@ return false; } } - function _getPrototypeOf9(o4) { - _getPrototypeOf9 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf7(o4) { + _getPrototypeOf7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf9(o4); + return _getPrototypeOf7(o4); } - function forceIonSliderUpdate(slider) { - if (slider.$cache && slider.$cache.input) - slider.$cache.input.trigger("change"); - else - console.log("Couldn't force ion slider to update"); + var zoneActive = "shiny-file-input-active"; + var zoneOver = "shiny-file-input-over"; + function zoneOf(el) { + return (0, import_jquery12.default)(el).closest("div.input-group"); } - function getTypePrettifyer(dataType, timeFormat, timezone) { - var timeFormatter; - var prettify; - if (dataType === "date") { - timeFormatter = window.strftime.utc(); - prettify = function prettify2(num) { - return timeFormatter(timeFormat, new Date(num)); - }; - } else if (dataType === "datetime") { - if (timezone) - timeFormatter = window.strftime.timezone(timezone); - else - timeFormatter = window.strftime; - prettify = function prettify2(num) { - return timeFormatter(timeFormat, new Date(num)); - }; + function enableDraghover(el) { + var $el = (0, import_jquery12.default)(el); + var childCounter = 0; + $el.on({ + "dragenter.draghover": function dragenterDraghover(e4) { + if (childCounter++ === 0) { + $el.trigger("draghover:enter", e4); + } + }, + "dragleave.draghover": function dragleaveDraghover(e4) { + if (--childCounter === 0) { + $el.trigger("draghover:leave", e4); + } + if (childCounter < 0) { + console.error("draghover childCounter is negative somehow"); + } + }, + "dragover.draghover": function dragoverDraghover(e4) { + e4.preventDefault(); + }, + "drop.draghover": function dropDraghover(e4) { + childCounter = 0; + $el.trigger("draghover:drop", e4); + e4.preventDefault(); + } + }); + return $el; + } + function disableDraghover(el) { + return (0, import_jquery12.default)(el).off(".draghover"); + } + function enableDocumentEvents() { + var $doc = (0, import_jquery12.default)("html"); + enableDraghover($doc).on({ + "draghover:enter.draghover": function draghoverEnterDraghover() { + zoneOf($fileInputs).addClass(zoneActive); + }, + "draghover:leave.draghover": function draghoverLeaveDraghover() { + zoneOf($fileInputs).removeClass(zoneActive); + }, + "draghover:drop.draghover": function draghoverDropDraghover() { + zoneOf($fileInputs).removeClass(zoneOver).removeClass(zoneActive); + } + }); + } + function disableDocumentEvents() { + var $doc = (0, import_jquery12.default)("html"); + $doc.off(".draghover"); + disableDraghover($doc); + } + function canSetFiles(fileList) { + var testEl = document.createElement("input"); + testEl.type = "file"; + try { + testEl.files = fileList; + } catch (e4) { + return false; + } + return true; + } + function handleDrop(e4, el) { + var _e$originalEvent, _e$originalEvent$data; + var files = (_e$originalEvent = e4.originalEvent) === null || _e$originalEvent === void 0 ? void 0 : (_e$originalEvent$data = _e$originalEvent.dataTransfer) === null || _e$originalEvent$data === void 0 ? void 0 : _e$originalEvent$data.files, $el = (0, import_jquery12.default)(el); + if (files === void 0 || files === null) { + console.log("Dropping files is not supported on this browser. (no FileList)"); + } else if (!canSetFiles(files)) { + $el.val(""); + uploadDroppedFilesIE10Plus(el, files); } else { - prettify = function prettify2(num) { - return formatNumber(num, this.prettify_separator); - }; + $el.val(""); + el.files = files; + $el.trigger("change"); } - return prettify; } - function getLabelNode5(el) { - return (0, import_jquery13.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); + function setFileText($el, files) { + var $fileText = $el.closest("div.input-group").find("input[type=text]"); + if (files.length === 1) { + $fileText.val(files[0].name); + } else { + $fileText.val(files.length + " files"); + } } - function numValues(el) { - if ((0, import_jquery13.default)(el).data("ionRangeSlider").options.type === "double") - return 2; - else - return 1; + function abortCurrentUpload($el) { + var uploader = $el.data("currentUploader"); + if (uploader) + uploader.abort(); + $el.removeAttr("data-restore"); } - var SliderInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) { - _inherits9(SliderInputBinding2, _TextInputBindingBase); - var _super = _createSuper9(SliderInputBinding2); - function SliderInputBinding2() { - _classCallCheck11(this, SliderInputBinding2); + function uploadDroppedFilesIE10Plus(el, files) { + var $el = (0, import_jquery12.default)(el); + abortCurrentUpload($el); + setFileText($el, files); + $el.data("currentUploader", new FileUploader(shinyShinyApp(), fileInputBindingGetId(el), files, el)); + } + function uploadFiles(evt) { + var $el = (0, import_jquery12.default)(evt.target); + abortCurrentUpload($el); + var files = evt.target.files; + var id = fileInputBindingGetId(evt.target); + if (files.length === 0) + return; + setFileText($el, files); + $el.data("currentUploader", new FileUploader(shinyShinyApp(), id, files, evt.target)); + } + var $fileInputs = (0, import_jquery12.default)(); + function fileInputBindingGetId(el) { + return InputBinding.prototype.getId.call(this, el) || el.name; + } + var FileInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits7(FileInputBinding2, _InputBinding); + var _super = _createSuper7(FileInputBinding2); + function FileInputBinding2() { + _classCallCheck9(this, FileInputBinding2); return _super.apply(this, arguments); } - _createClass11(SliderInputBinding2, [{ + _createClass9(FileInputBinding2, [{ key: "find", value: function find2(scope) { - if (!import_jquery13.default.fn.ionRangeSlider) { - return (0, import_jquery13.default)(); - } - return (0, import_jquery13.default)(scope).find("input.js-range-slider"); + return (0, import_jquery12.default)(scope).find('input[type="file"]'); } }, { - key: "getType", - value: function getType(el) { - var dataType = (0, import_jquery13.default)(el).data("data-type"); - if (dataType === "date") - return "shiny.date"; - else if (dataType === "datetime") - return "shiny.datetime"; - else - return null; + key: "getId", + value: function getId(el) { + return fileInputBindingGetId(el); } }, { key: "getValue", value: function getValue(el) { - var $el = (0, import_jquery13.default)(el); - var result = (0, import_jquery13.default)(el).data("ionRangeSlider").result; - var convert; - var dataType = $el.data("data-type"); - if (dataType === "date") { - convert = function convert2(val) { - return formatDateUTC(new Date(Number(val))); - }; - } else if (dataType === "datetime") { - convert = function convert2(val) { - return Number(val) / 1e3; - }; - } else { - convert = function convert2(val) { - return Number(val); - }; - } - if (numValues(el) === 2) { - return [convert(result.from), convert(result.to)]; + var data = (0, import_jquery12.default)(el).attr("data-restore"); + if (data) { + var dataParsed = JSON.parse(data); + var $fileText = (0, import_jquery12.default)(el).closest("div.input-group").find("input[type=text]"); + if (dataParsed.name.length === 1) { + $fileText.val(dataParsed.name[0]); + } else { + $fileText.val(dataParsed.name.length + " files"); + } + var $progress = (0, import_jquery12.default)(el).closest("div.form-group").find(".progress"); + var $bar = $progress.find(".progress-bar"); + $progress.removeClass("active"); + $bar.width("100%"); + $bar.css("visibility", "visible"); + return dataParsed; } else { - return convert(result.from); + return null; } } }, { key: "setValue", value: function setValue(el, value) { - var $el = (0, import_jquery13.default)(el); - var slider = $el.data("ionRangeSlider"); - $el.data("immediate", true); - try { - if (numValues(el) === 2 && value instanceof Array) { - slider.update({ - from: value[0], - to: value[1] - }); - } else { - slider.update({ - from: value - }); - } - forceIonSliderUpdate(slider); - } finally { - $el.data("immediate", false); - } + el; + value; + } + }, { + key: "getType", + value: function getType(el) { + return "shiny.file"; + el; } }, { key: "subscribe", value: function subscribe(el, callback) { - (0, import_jquery13.default)(el).on("change.sliderInputBinding", function() { - callback(!(0, import_jquery13.default)(el).data("immediate") && !(0, import_jquery13.default)(el).data("animating")); + callback; + (0, import_jquery12.default)(el).on("change.fileInputBinding", uploadFiles); + if ($fileInputs.length === 0) + enableDocumentEvents(); + $fileInputs = $fileInputs.add(el); + var $zone = zoneOf(el); + enableDraghover($zone).on({ + "draghover:enter.draghover": function draghoverEnterDraghover(e4) { + e4; + $zone.addClass(zoneOver); + }, + "draghover:leave.draghover": function draghoverLeaveDraghover(e4) { + $zone.removeClass(zoneOver); + e4.stopPropagation(); + }, + "draghover:drop.draghover": function draghoverDropDraghover(e4, dropEvent) { + e4; + handleDrop(dropEvent, el); + } }); } }, { key: "unsubscribe", value: function unsubscribe(el) { - (0, import_jquery13.default)(el).off(".sliderInputBinding"); - } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var $el = (0, import_jquery13.default)(el); - var slider = $el.data("ionRangeSlider"); - var msg = {}; - if (hasDefinedProperty(data, "value")) { - if (numValues(el) === 2 && data.value instanceof Array) { - msg.from = data.value[0]; - msg.to = data.value[1]; - } else { - if (Array.isArray(data.value)) { - var errorReason = ["an empty array.", "a single-value array.", "an array with more than two values."]; - throw "Slider requires two values to update with an array, but message value was " + errorReason[Math.min(data.value.length, 2)]; - } - msg.from = data.value; - } - } - var sliderFeatures = ["min", "max", "step"]; - for (var i5 = 0; i5 < sliderFeatures.length; i5++) { - var feats = sliderFeatures[i5]; - if (hasDefinedProperty(data, feats)) { - msg[feats] = data[feats]; - } - } - updateLabel(data.label, getLabelNode5(el)); - var domElements = ["data-type", "time-format", "timezone"]; - for (var _i = 0; _i < domElements.length; _i++) { - var elem = domElements[_i]; - if (hasDefinedProperty(data, elem)) { - $el.data(elem, data[elem]); - } - } - var dataType = $el.data("data-type"); - var timeFormat = $el.data("time-format"); - var timezone = $el.data("timezone"); - msg.prettify = getTypePrettifyer(dataType, timeFormat, timezone); - $el.data("immediate", true); - try { - slider.update(msg); - forceIonSliderUpdate(slider); - } finally { - $el.data("immediate", false); - } - } - }, { - key: "getRatePolicy", - value: function getRatePolicy(el) { - return { - policy: "debounce", - delay: 250 - }; - el; - } - }, { - key: "getState", - value: function getState(el) { - el; - } - }, { - key: "initialize", - value: function initialize(el) { - var $el = (0, import_jquery13.default)(el); - var dataType = $el.data("data-type"); - var timeFormat = $el.data("time-format"); - var timezone = $el.data("timezone"); - var opts = { - prettify: getTypePrettifyer(dataType, timeFormat, timezone) - }; - $el.ionRangeSlider(opts); + var $el = (0, import_jquery12.default)(el), $zone = zoneOf(el); + $zone.removeClass(zoneOver).removeClass(zoneActive); + disableDraghover($zone); + $el.off(".fileInputBinding"); + $zone.off(".draghover"); + $fileInputs = $fileInputs.not(el); + if ($fileInputs.length === 0) + disableDocumentEvents(); } }]); - return SliderInputBinding2; - }(TextInputBindingBase); - function formatNumber(num) { - var thousandSep = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ","; - var decimalSep = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "."; - var parts = num.toString().split("."); - parts[0] = parts[0].replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + thousandSep); - if (parts.length === 1) - return parts[0]; - else if (parts.length === 2) - return parts[0] + decimalSep + parts[1]; - else - return ""; - } - (0, import_jquery13.default)(document).on("click", ".slider-animate-button", function(evt) { - evt.preventDefault(); - var self2 = (0, import_jquery13.default)(this); - var target = (0, import_jquery13.default)("#" + $escape(self2.attr("data-target-id"))); - var startLabel = "Play"; - var stopLabel = "Pause"; - var loop = self2.attr("data-loop") !== void 0 && !/^\s*false\s*$/i.test(self2.attr("data-loop")); - var animInterval = self2.attr("data-interval"); - if (isNaN(animInterval)) - animInterval = 1500; - else - animInterval = Number(animInterval); - if (!target.data("animTimer")) { - var timer; - if (target.hasClass("jslider")) { - var slider = target.slider(); - if (!slider.canStepNext()) - slider.resetToStart(); - timer = setInterval(function() { - if (loop && !slider.canStepNext()) { - slider.resetToStart(); - } else { - slider.stepNext(); - if (!loop && !slider.canStepNext()) { - self2.click(); - } - } - }, animInterval); - } else { - var _slider = target.data("ionRangeSlider"); - var sliderCanStep = function sliderCanStep2() { - if (_slider.options.type === "double") - return _slider.result.to < _slider.result.max; - else - return _slider.result.from < _slider.result.max; - }; - var sliderReset = function sliderReset2() { - var val = { - from: _slider.result.min - }; - if (_slider.options.type === "double") - val.to = val.from + (_slider.result.to - _slider.result.from); - _slider.update(val); - forceIonSliderUpdate(_slider); - }; - var sliderStep = function sliderStep2() { - var val = { - from: Math.min(_slider.result.max, _slider.result.from + _slider.options.step) - }; - if (_slider.options.type === "double") - val.to = Math.min(_slider.result.max, _slider.result.to + _slider.options.step); - _slider.update(val); - forceIonSliderUpdate(_slider); - }; - if (!sliderCanStep()) - sliderReset(); - timer = setInterval(function() { - if (loop && !sliderCanStep()) { - sliderReset(); - } else { - sliderStep(); - if (!loop && !sliderCanStep()) { - self2.click(); - } - } - }, animInterval); - } - target.data("animTimer", timer); - self2.attr("title", stopLabel); - self2.addClass("playing"); - target.data("animating", true); - } else { - clearTimeout(target.data("animTimer")); - target.removeData("animTimer"); - self2.attr("title", startLabel); - self2.removeClass("playing"); - target.removeData("animating"); - } - }); + return FileInputBinding2; + }(InputBinding); - // srcts/src/bindings/input/daterange.ts + // srcts/src/bindings/input/number.ts + var import_es_regexp_exec3 = __toESM(require_es_regexp_exec()); var import_es_array_iterator12 = __toESM(require_es_array_iterator()); var import_jquery14 = __toESM(require_jquery()); - function _typeof12(obj) { - "@babel/helpers - typeof"; - return _typeof12 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof12(obj); - } - function _classCallCheck12(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties12(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey12(descriptor.key), descriptor); - } + + // node_modules/core-js/modules/es.reflect.get.js + var $35 = require_export(); + var call3 = require_function_call(); + var isObject4 = require_is_object(); + var anObject5 = require_an_object(); + var isDataDescriptor = require_is_data_descriptor(); + var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor(); + var getPrototypeOf2 = require_object_get_prototype_of(); + function get(target, propertyKey) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var descriptor, prototype; + if (anObject5(target) === receiver) + return target[propertyKey]; + descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey); + if (descriptor) + return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === void 0 ? void 0 : call3(descriptor.get, receiver); + if (isObject4(prototype = getPrototypeOf2(target))) + return get(prototype, propertyKey, receiver); } - function _createClass12(Constructor, protoProps, staticProps) { + $35({ target: "Reflect", stat: true }, { + get: get + }); + + // node_modules/core-js/modules/es.object.get-own-property-descriptor.js + var $36 = require_export(); + var fails9 = require_fails(); + var toIndexedObject2 = require_to_indexed_object(); + var nativeGetOwnPropertyDescriptor = require_object_get_own_property_descriptor().f; + var DESCRIPTORS5 = require_descriptors(); + var FORCED6 = !DESCRIPTORS5 || fails9(function() { + nativeGetOwnPropertyDescriptor(1); + }); + $36({ target: "Object", stat: true, forced: FORCED6, sham: !DESCRIPTORS5 }, { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor2(it, key) { + return nativeGetOwnPropertyDescriptor(toIndexedObject2(it), key); + } + }); + + // srcts/src/bindings/input/text.ts + var import_es_array_iterator11 = __toESM(require_es_array_iterator()); + var import_jquery13 = __toESM(require_jquery()); + function _typeof11(obj) { + "@babel/helpers - typeof"; + return _typeof11 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof11(obj); + } + function _classCallCheck10(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties10(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey10(descriptor.key), descriptor); + } + } + function _createClass10(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties12(Constructor.prototype, protoProps); + _defineProperties10(Constructor.prototype, protoProps); if (staticProps) - _defineProperties12(Constructor, staticProps); + _defineProperties10(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey12(arg) { - var key = _toPrimitive12(arg, "string"); - return _typeof12(key) === "symbol" ? key : String(key); + function _toPropertyKey10(arg) { + var key = _toPrimitive10(arg, "string"); + return _typeof11(key) === "symbol" ? key : String(key); } - function _toPrimitive12(input, hint) { - if (_typeof12(input) !== "object" || input === null) + function _toPrimitive10(input, hint) { + if (_typeof11(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof12(res) !== "object") + if (_typeof11(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits10(subClass, superClass) { + function _get() { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get.bind(); + } else { + _get = function _get3(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) + return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(arguments.length < 3 ? target : receiver); + } + return desc.value; + }; + } + return _get.apply(this, arguments); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf8(object); + if (object === null) + break; + } + return object; + } + function _inherits8(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) - _setPrototypeOf10(subClass, superClass); + _setPrototypeOf8(subClass, superClass); } - function _setPrototypeOf10(o4, p3) { - _setPrototypeOf10 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf8(o4, p3) { + _setPrototypeOf8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf10(o4, p3); + return _setPrototypeOf8(o4, p3); } - function _createSuper10(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct10(); + function _createSuper8(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct8(); return function _createSuperInternal() { - var Super = _getPrototypeOf10(Derived), result; + var Super = _getPrototypeOf8(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf10(this).constructor; + var NewTarget = _getPrototypeOf8(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn10(this, result); + return _possibleConstructorReturn8(this, result); }; } - function _possibleConstructorReturn10(self2, call8) { - if (call8 && (_typeof12(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn8(self2, call8) { + if (call8 && (_typeof11(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized10(self2); + return _assertThisInitialized8(self2); } - function _assertThisInitialized10(self2) { + function _assertThisInitialized8(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct10() { + function _isNativeReflectConstruct8() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -9334,143 +9607,57 @@ return false; } } - function _getPrototypeOf10(o4) { - _getPrototypeOf10 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf8(o4) { + _getPrototypeOf8 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf10(o4); + return _getPrototypeOf8(o4); } - function getLabelNode6(el) { - return (0, import_jquery14.default)(el).find('label[for="' + $escape(el.id) + '"]'); + function getLabelNode3(el) { + return (0, import_jquery13.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); } - var DateRangeInputBinding = /* @__PURE__ */ function(_DateInputBindingBase) { - _inherits10(DateRangeInputBinding2, _DateInputBindingBase); - var _super = _createSuper10(DateRangeInputBinding2); - function DateRangeInputBinding2() { - _classCallCheck12(this, DateRangeInputBinding2); + var TextInputBindingBase = /* @__PURE__ */ function(_InputBinding) { + _inherits8(TextInputBindingBase2, _InputBinding); + var _super = _createSuper8(TextInputBindingBase2); + function TextInputBindingBase2() { + _classCallCheck10(this, TextInputBindingBase2); return _super.apply(this, arguments); } - _createClass12(DateRangeInputBinding2, [{ + _createClass10(TextInputBindingBase2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery14.default)(scope).find(".shiny-date-range-input"); + var $inputs = (0, import_jquery13.default)(scope).find('input[type="text"], input[type="search"], input[type="url"], input[type="email"]'); + return $inputs.not('input[type="text"][id$="-selectized"]'); + } + }, { + key: "getId", + value: function getId(el) { + return _get(_getPrototypeOf8(TextInputBindingBase2.prototype), "getId", this).call(this, el) || el.name; } }, { key: "getValue", value: function getValue(el) { - var $inputs = (0, import_jquery14.default)(el).find("input"); - var start = $inputs.eq(0).bsDatepicker("getUTCDate"); - var end = $inputs.eq(1).bsDatepicker("getUTCDate"); - return [formatDateUTC(start), formatDateUTC(end)]; + throw "not implemented"; + el; } }, { key: "setValue", value: function setValue(el, value) { - if (!(value instanceof Object)) { - return; - } - var $inputs = (0, import_jquery14.default)(el).find("input"); - if (value.start !== void 0) { - if (value.start === null) { - $inputs.eq(0).val("").bsDatepicker("update"); - } else { - var start = this._newDate(value.start); - $inputs.eq(0).bsDatepicker("setUTCDate", start); - } - } - if (value.end !== void 0) { - if (value.end === null) { - $inputs.eq(1).val("").bsDatepicker("update"); - } else { - var end = this._newDate(value.end); - $inputs.eq(1).bsDatepicker("setUTCDate", end); - } - } - } - }, { - key: "getState", - value: function getState(el) { - var $el = (0, import_jquery14.default)(el); - var $inputs = $el.find("input"); - var $startinput = $inputs.eq(0); - var $endinput = $inputs.eq(1); - var min6 = $startinput.bsDatepicker("getStartDate"); - var max4 = $startinput.bsDatepicker("getEndDate"); - var minStr = min6 === -Infinity ? null : formatDateUTC(min6); - var maxStr = max4 === Infinity ? null : formatDateUTC(max4); - var startview = $startinput.data("datepicker").startView; - if (startview === 2) - startview = "decade"; - else if (startview === 1) - startview = "year"; - else if (startview === 0) - startview = "month"; - return { - label: getLabelNode6(el).text(), - value: this.getValue(el), - valueString: [$startinput.val(), $endinput.val()], - min: minStr, - max: maxStr, - weekstart: $startinput.data("datepicker").weekStart, - format: this._formatToString($startinput.data("datepicker").format), - language: $startinput.data("datepicker").language, - startview: startview - }; - } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var $el = (0, import_jquery14.default)(el); - var $inputs = $el.find("input"); - var $startinput = $inputs.eq(0); - var $endinput = $inputs.eq(1); - updateLabel(data.label, getLabelNode6(el)); - if (hasDefinedProperty(data, "min")) { - this._setMin($startinput[0], data.min); - this._setMin($endinput[0], data.min); - } - if (hasDefinedProperty(data, "max")) { - this._setMax($startinput[0], data.max); - this._setMax($endinput[0], data.max); - } - if (hasDefinedProperty(data, "value")) { - this.setValue(el, data.value); - } - $el.trigger("change"); - } - }, { - key: "initialize", - value: function initialize(el) { - var $el = (0, import_jquery14.default)(el); - var $inputs = $el.find("input"); - var $startinput = $inputs.eq(0); - var $endinput = $inputs.eq(1); - var start = $startinput.data("initial-date"); - var end = $endinput.data("initial-date"); - if (start === void 0 || start === null) - start = this._dateAsUTC(new Date()); - if (end === void 0 || end === null) - end = this._dateAsUTC(new Date()); - this.setValue(el, { - start: start, - end: end - }); - this._setMin($startinput[0], $startinput.data("min-date")); - this._setMin($endinput[0], $startinput.data("min-date")); - this._setMax($startinput[0], $endinput.data("max-date")); - this._setMax($endinput[0], $endinput.data("max-date")); + throw "not implemented"; + el; + value; } }, { key: "subscribe", value: function subscribe(el, callback) { - (0, import_jquery14.default)(el).on( - "keyup.dateRangeInputBinding input.dateRangeInputBinding", + (0, import_jquery13.default)(el).on( + "keyup.textInputBinding input.textInputBinding", function() { callback(true); } ); - (0, import_jquery14.default)(el).on( - "changeDate.dateRangeInputBinding change.dateRangeInputBinding", + (0, import_jquery13.default)(el).on( + "change.textInputBinding", function() { callback(false); } @@ -9479,112 +9666,165 @@ }, { key: "unsubscribe", value: function unsubscribe(el) { - (0, import_jquery14.default)(el).off(".dateRangeInputBinding"); + (0, import_jquery13.default)(el).off(".textInputBinding"); } - }]); - return DateRangeInputBinding2; - }(DateInputBindingBase); - - // srcts/src/bindings/input/selectInput.ts - var import_es_json_stringify = __toESM(require_es_json_stringify()); - var import_es_array_iterator13 = __toESM(require_es_array_iterator()); - var import_jquery15 = __toESM(require_jquery()); - - // srcts/src/utils/eval.ts - var indirectEval = eval; + }, { + key: "receiveMessage", + value: function receiveMessage(el, data) { + throw "not implemented"; + el; + data; + } + }, { + key: "getState", + value: function getState(el) { + throw "not implemented"; + el; + } + }, { + key: "getRatePolicy", + value: function getRatePolicy(el) { + return { + policy: "debounce", + delay: 250 + }; + el; + } + }]); + return TextInputBindingBase2; + }(InputBinding); + var TextInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) { + _inherits8(TextInputBinding2, _TextInputBindingBase); + var _super2 = _createSuper8(TextInputBinding2); + function TextInputBinding2() { + _classCallCheck10(this, TextInputBinding2); + return _super2.apply(this, arguments); + } + _createClass10(TextInputBinding2, [{ + key: "setValue", + value: function setValue(el, value) { + el.value = value; + } + }, { + key: "getValue", + value: function getValue(el) { + return el.value; + } + }, { + key: "getState", + value: function getState(el) { + return { + label: getLabelNode3(el).text(), + value: el.value, + placeholder: el.placeholder + }; + } + }, { + key: "receiveMessage", + value: function receiveMessage(el, data) { + if (hasDefinedProperty(data, "value")) + this.setValue(el, data.value); + updateLabel(data.label, getLabelNode3(el)); + if (hasDefinedProperty(data, "placeholder")) + el.placeholder = data.placeholder; + (0, import_jquery13.default)(el).trigger("change"); + } + }]); + return TextInputBinding2; + }(TextInputBindingBase); - // srcts/src/bindings/input/selectInput.ts - function _typeof13(obj) { + // srcts/src/bindings/input/number.ts + function _typeof12(obj) { "@babel/helpers - typeof"; - return _typeof13 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof12 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof13(obj); + }, _typeof12(obj); } - function _classCallCheck13(instance, Constructor) { + function _classCallCheck11(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties13(target, props) { + function _defineProperties11(target, props) { for (var i5 = 0; i5 < props.length; i5++) { var descriptor = props[i5]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey13(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey11(descriptor.key), descriptor); } } - function _createClass13(Constructor, protoProps, staticProps) { + function _createClass11(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties13(Constructor.prototype, protoProps); + _defineProperties11(Constructor.prototype, protoProps); if (staticProps) - _defineProperties13(Constructor, staticProps); + _defineProperties11(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey13(arg) { - var key = _toPrimitive13(arg, "string"); - return _typeof13(key) === "symbol" ? key : String(key); + function _toPropertyKey11(arg) { + var key = _toPrimitive11(arg, "string"); + return _typeof12(key) === "symbol" ? key : String(key); } - function _toPrimitive13(input, hint) { - if (_typeof13(input) !== "object" || input === null) + function _toPrimitive11(input, hint) { + if (_typeof12(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof13(res) !== "object") + if (_typeof12(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits11(subClass, superClass) { + function _inherits9(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) - _setPrototypeOf11(subClass, superClass); + _setPrototypeOf9(subClass, superClass); } - function _setPrototypeOf11(o4, p3) { - _setPrototypeOf11 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf9(o4, p3) { + _setPrototypeOf9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf11(o4, p3); + return _setPrototypeOf9(o4, p3); } - function _createSuper11(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct11(); + function _createSuper9(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct9(); return function _createSuperInternal() { - var Super = _getPrototypeOf11(Derived), result; + var Super = _getPrototypeOf9(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf11(this).constructor; + var NewTarget = _getPrototypeOf9(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn11(this, result); + return _possibleConstructorReturn9(this, result); }; } - function _possibleConstructorReturn11(self2, call8) { - if (call8 && (_typeof13(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn9(self2, call8) { + if (call8 && (_typeof12(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized11(self2); + return _assertThisInitialized9(self2); } - function _assertThisInitialized11(self2) { + function _assertThisInitialized9(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct11() { + function _isNativeReflectConstruct9() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -9599,322 +9839,176 @@ return false; } } - function _getPrototypeOf11(o4) { - _getPrototypeOf11 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf9(o4) { + _getPrototypeOf9 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf11(o4); - } - function getLabelNode7(el) { - var escapedId = $escape(el.id); - if (isSelectize(el)) { - escapedId += "-selectized"; - } - return (0, import_jquery15.default)(el).parent().parent().find('label[for="' + escapedId + '"]'); + return _getPrototypeOf9(o4); } - function isSelectize(el) { - var config = (0, import_jquery15.default)(el).parent().find('script[data-for="' + $escape(el.id) + '"]'); - return config.length > 0; + function getLabelNode4(el) { + return (0, import_jquery14.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); } - var SelectInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits11(SelectInputBinding2, _InputBinding); - var _super = _createSuper11(SelectInputBinding2); - function SelectInputBinding2() { - _classCallCheck13(this, SelectInputBinding2); + var NumberInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) { + _inherits9(NumberInputBinding2, _TextInputBindingBase); + var _super = _createSuper9(NumberInputBinding2); + function NumberInputBinding2() { + _classCallCheck11(this, NumberInputBinding2); return _super.apply(this, arguments); } - _createClass13(SelectInputBinding2, [{ + _createClass11(NumberInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery15.default)(scope).find("select"); + return (0, import_jquery14.default)(scope).find('input[type="number"]'); } }, { - key: "getType", - value: function getType(el) { - var $el = (0, import_jquery15.default)(el); - if (!$el.hasClass("symbol")) { - return null; + key: "getValue", + value: function getValue(el) { + var numberVal = (0, import_jquery14.default)(el).val(); + if (typeof numberVal == "string") { + if (/^\s*$/.test(numberVal)) + return null; } - if ($el.attr("multiple") === "multiple") { - return "shiny.symbolList"; - } else { - return "shiny.symbol"; + var numberValue = Number(numberVal); + if (!isNaN(numberValue)) { + return numberValue; } + return numberVal; } }, { - key: "getId", - value: function getId(el) { - return InputBinding.prototype.getId.call(this, el) || el.name; + key: "setValue", + value: function setValue(el, value) { + el.value = "" + value; } }, { - key: "getValue", - value: function getValue(el) { - if (!isSelectize(el)) { - return (0, import_jquery15.default)(el).val(); - } else { - var selectize = this._selectize(el); - return selectize === null || selectize === void 0 ? void 0 : selectize.getValue(); - } + key: "getType", + value: function getType(el) { + return "shiny.number"; + el; } }, { - key: "setValue", - value: function setValue(el, value) { - if (!isSelectize(el)) { - (0, import_jquery15.default)(el).val(value); - } else { - var selectize = this._selectize(el); - selectize === null || selectize === void 0 ? void 0 : selectize.setValue(value); - } + key: "receiveMessage", + value: function receiveMessage(el, data) { + var _data$value, _data$min, _data$max, _data$step; + if (hasDefinedProperty(data, "value")) + el.value = (_data$value = data.value) !== null && _data$value !== void 0 ? _data$value : ""; + if (hasDefinedProperty(data, "min")) + el.min = (_data$min = data.min) !== null && _data$min !== void 0 ? _data$min : ""; + if (hasDefinedProperty(data, "max")) + el.max = (_data$max = data.max) !== null && _data$max !== void 0 ? _data$max : ""; + if (hasDefinedProperty(data, "step")) + el.step = (_data$step = data.step) !== null && _data$step !== void 0 ? _data$step : ""; + updateLabel(data.label, getLabelNode4(el)); + (0, import_jquery14.default)(el).trigger("change"); } }, { key: "getState", value: function getState(el) { - var options = new Array(el.length); - for (var i5 = 0; i5 < el.length; i5++) { - options[i5] = { - value: el[i5].value, - label: el[i5].label - }; - } return { - label: getLabelNode7(el), + label: getLabelNode4(el).text(), value: this.getValue(el), - options: options + min: Number(el.min), + max: Number(el.max), + step: Number(el.step) }; } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var $el = (0, import_jquery15.default)(el); - if (hasDefinedProperty(data, "options")) { - var selectize = this._selectize(el); - selectize === null || selectize === void 0 ? void 0 : selectize.destroy(); - $el.empty().append(data.options); - this._selectize(el); - } - if (hasDefinedProperty(data, "config")) { - $el.parent().find('script[data-for="' + $escape(el.id) + '"]').replaceWith(data.config); - this._selectize(el, true); - } - if (hasDefinedProperty(data, "url")) { - var _selectize2 = this._selectize(el); - _selectize2.clearOptions(); - if (hasDefinedProperty(data, "value")) { - _selectize2.clear(); - } - var loaded = false; - _selectize2.settings.load = function(query, callback) { - var settings = _selectize2.settings; - import_jquery15.default.ajax({ - url: data.url, - data: { - query: query, - field: JSON.stringify([settings.searchField]), - value: settings.valueField, - conju: settings.searchConjunction, - maxop: settings.maxOptions - }, - type: "GET", - error: function error() { - callback(); - }, - success: function success(res) { - import_jquery15.default.each(res, function(index, elem) { - var optgroupId = elem[settings.optgroupField || "optgroup"]; - var optgroup = {}; - optgroup[settings.optgroupLabelField || "label"] = optgroupId; - optgroup[settings.optgroupValueField || "value"] = optgroupId; - _selectize2.addOptionGroup(optgroupId, optgroup); - }); - callback(res); - if (!loaded) { - if (hasDefinedProperty(data, "value")) { - _selectize2.setValue(data.value); - } else if (settings.maxItems === 1) { - _selectize2.setValue(res[0].value); - } - } - loaded = true; - } - }); - }; - _selectize2.load(function(callback) { - _selectize2.settings.load.apply(_selectize2, ["", callback]); - }); - } else if (hasDefinedProperty(data, "value")) { - this.setValue(el, data.value); - } - updateLabel(data.label, getLabelNode7(el)); - (0, import_jquery15.default)(el).trigger("change"); - } - }, { - key: "subscribe", - value: function subscribe(el, callback) { - var _this = this; - (0, import_jquery15.default)(el).on( - "change.selectInputBinding", - function() { - if (el.nonempty && _this.getValue(el) === "") { - return; - } - callback(false); - } - ); - } - }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery15.default)(el).off(".selectInputBinding"); - } - }, { - key: "initialize", - value: function initialize(el) { - this._selectize(el); - } - }, { - key: "_selectize", - value: function _selectize(el) { - var update = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - if (!import_jquery15.default.fn.selectize) - return void 0; - var $el = (0, import_jquery15.default)(el); - var config = $el.parent().find('script[data-for="' + $escape(el.id) + '"]'); - if (config.length === 0) - return void 0; - var options = import_jquery15.default.extend({ - labelField: "label", - valueField: "value", - searchField: ["label"] - }, JSON.parse(config.html())); - if (typeof config.data("nonempty") !== "undefined") { - el.nonempty = true; - options = import_jquery15.default.extend(options, { - onItemRemove: function onItemRemove(value) { - if (this.getValue() === "") - (0, import_jquery15.default)("select#" + $escape(el.id)).empty().append((0, import_jquery15.default)("", { - value: value, - selected: true - })).trigger("change"); - }, - onDropdownClose: function onDropdownClose() { - if (this.getValue() === "") { - this.setValue((0, import_jquery15.default)("select#" + $escape(el.id)).val()); - } - } - }); - } else { - el.nonempty = false; - } - if (config.data("eval") instanceof Array) - import_jquery15.default.each(config.data("eval"), function(i5, x2) { - options[x2] = indirectEval("(" + options[x2] + ")"); - }); - var control = $el.selectize(options)[0].selectize; - if (update) { - var settings = import_jquery15.default.extend(control.settings, options); - control.destroy(); - control = $el.selectize(settings)[0].selectize; - } - return control; - } }]); - return SelectInputBinding2; - }(InputBinding); + return NumberInputBinding2; + }(TextInputBindingBase); - // srcts/src/bindings/input/actionbutton.ts - var import_es_array_iterator14 = __toESM(require_es_array_iterator()); - var import_jquery16 = __toESM(require_jquery()); - function _typeof14(obj) { + // srcts/src/bindings/input/password.ts + var import_es_array_iterator13 = __toESM(require_es_array_iterator()); + var import_jquery15 = __toESM(require_jquery()); + function _typeof13(obj) { "@babel/helpers - typeof"; - return _typeof14 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof13 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof14(obj); + }, _typeof13(obj); } - function _classCallCheck14(instance, Constructor) { + function _classCallCheck12(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties14(target, props) { + function _defineProperties12(target, props) { for (var i5 = 0; i5 < props.length; i5++) { var descriptor = props[i5]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey14(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey12(descriptor.key), descriptor); } } - function _createClass14(Constructor, protoProps, staticProps) { + function _createClass12(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties14(Constructor.prototype, protoProps); + _defineProperties12(Constructor.prototype, protoProps); if (staticProps) - _defineProperties14(Constructor, staticProps); + _defineProperties12(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey14(arg) { - var key = _toPrimitive14(arg, "string"); - return _typeof14(key) === "symbol" ? key : String(key); + function _toPropertyKey12(arg) { + var key = _toPrimitive12(arg, "string"); + return _typeof13(key) === "symbol" ? key : String(key); } - function _toPrimitive14(input, hint) { - if (_typeof14(input) !== "object" || input === null) + function _toPrimitive12(input, hint) { + if (_typeof13(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof14(res) !== "object") + if (_typeof13(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits12(subClass, superClass) { + function _inherits10(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) - _setPrototypeOf12(subClass, superClass); + _setPrototypeOf10(subClass, superClass); } - function _setPrototypeOf12(o4, p3) { - _setPrototypeOf12 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf10(o4, p3) { + _setPrototypeOf10 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf12(o4, p3); + return _setPrototypeOf10(o4, p3); } - function _createSuper12(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct12(); + function _createSuper10(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct10(); return function _createSuperInternal() { - var Super = _getPrototypeOf12(Derived), result; + var Super = _getPrototypeOf10(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf12(this).constructor; + var NewTarget = _getPrototypeOf10(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn12(this, result); + return _possibleConstructorReturn10(this, result); }; } - function _possibleConstructorReturn12(self2, call8) { - if (call8 && (_typeof14(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn10(self2, call8) { + if (call8 && (_typeof13(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized12(self2); + return _assertThisInitialized10(self2); } - function _assertThisInitialized12(self2) { + function _assertThisInitialized10(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct12() { + function _isNativeReflectConstruct10() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -9929,196 +10023,128 @@ return false; } } - function _getPrototypeOf12(o4) { - _getPrototypeOf12 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf10(o4) { + _getPrototypeOf10 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf12(o4); + return _getPrototypeOf10(o4); } - var ActionButtonInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits12(ActionButtonInputBinding2, _InputBinding); - var _super = _createSuper12(ActionButtonInputBinding2); - function ActionButtonInputBinding2() { - _classCallCheck14(this, ActionButtonInputBinding2); + var PasswordInputBinding = /* @__PURE__ */ function(_TextInputBinding) { + _inherits10(PasswordInputBinding2, _TextInputBinding); + var _super = _createSuper10(PasswordInputBinding2); + function PasswordInputBinding2() { + _classCallCheck12(this, PasswordInputBinding2); return _super.apply(this, arguments); } - _createClass14(ActionButtonInputBinding2, [{ + _createClass12(PasswordInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery16.default)(scope).find(".action-button"); - } - }, { - key: "getValue", - value: function getValue(el) { - return (0, import_jquery16.default)(el).data("val") || 0; - } - }, { - key: "setValue", - value: function setValue(el, value) { - (0, import_jquery16.default)(el).data("val", value); + return (0, import_jquery15.default)(scope).find('input[type="password"]'); } }, { key: "getType", value: function getType(el) { - return "shiny.action"; + return "shiny.password"; el; } - }, { - key: "subscribe", - value: function subscribe(el, callback) { - (0, import_jquery16.default)(el).on( - "click.actionButtonInputBinding", - function() { - var $el = (0, import_jquery16.default)(this); - var val = $el.data("val") || 0; - $el.data("val", val + 1); - callback(false); - } - ); - } - }, { - key: "getState", - value: function getState(el) { - return { - value: this.getValue(el) - }; - } - }, { - key: "receiveMessage", - value: function receiveMessage(el, data) { - var $el = (0, import_jquery16.default)(el); - if (hasDefinedProperty(data, "label") || hasDefinedProperty(data, "icon")) { - var label = $el.text(); - var icon = ""; - if ($el.find("i[class]").length > 0) { - var iconHtml = $el.find("i[class]")[0]; - if (iconHtml === $el.children()[0]) { - icon = (0, import_jquery16.default)(iconHtml).prop("outerHTML"); - } - } - if (hasDefinedProperty(data, "label")) { - label = data.label; - } - if (hasDefinedProperty(data, "icon")) { - var _data$icon; - icon = Array.isArray(data.icon) ? "" : (_data$icon = data.icon) !== null && _data$icon !== void 0 ? _data$icon : ""; - } - $el.html(icon + " " + label); - } - if (hasDefinedProperty(data, "disabled")) { - if (data.disabled) { - $el.attr("disabled", ""); - } else { - $el.attr("disabled", null); - } - } - } - }, { - key: "unsubscribe", - value: function unsubscribe(el) { - (0, import_jquery16.default)(el).off(".actionButtonInputBinding"); - } }]); - return ActionButtonInputBinding2; - }(InputBinding); - (0, import_jquery16.default)(document).on("click", "a.action-button", function(e4) { - e4.preventDefault(); - }); + return PasswordInputBinding2; + }(TextInputBinding); - // srcts/src/bindings/input/tabinput.ts - var import_es_array_iterator15 = __toESM(require_es_array_iterator()); - var import_jquery17 = __toESM(require_jquery()); - function _typeof15(obj) { + // srcts/src/bindings/input/radio.ts + var import_es_array_iterator14 = __toESM(require_es_array_iterator()); + var import_jquery16 = __toESM(require_jquery()); + function _typeof14(obj) { "@babel/helpers - typeof"; - return _typeof15 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof14 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof15(obj); + }, _typeof14(obj); } - function _classCallCheck15(instance, Constructor) { + function _classCallCheck13(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties15(target, props) { + function _defineProperties13(target, props) { for (var i5 = 0; i5 < props.length; i5++) { var descriptor = props[i5]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey15(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey13(descriptor.key), descriptor); } } - function _createClass15(Constructor, protoProps, staticProps) { + function _createClass13(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties15(Constructor.prototype, protoProps); + _defineProperties13(Constructor.prototype, protoProps); if (staticProps) - _defineProperties15(Constructor, staticProps); + _defineProperties13(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey15(arg) { - var key = _toPrimitive15(arg, "string"); - return _typeof15(key) === "symbol" ? key : String(key); + function _toPropertyKey13(arg) { + var key = _toPrimitive13(arg, "string"); + return _typeof14(key) === "symbol" ? key : String(key); } - function _toPrimitive15(input, hint) { - if (_typeof15(input) !== "object" || input === null) + function _toPrimitive13(input, hint) { + if (_typeof14(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof15(res) !== "object") + if (_typeof14(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits13(subClass, superClass) { + function _inherits11(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) - _setPrototypeOf13(subClass, superClass); + _setPrototypeOf11(subClass, superClass); } - function _setPrototypeOf13(o4, p3) { - _setPrototypeOf13 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf11(o4, p3) { + _setPrototypeOf11 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf13(o4, p3); + return _setPrototypeOf11(o4, p3); } - function _createSuper13(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct13(); + function _createSuper11(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct11(); return function _createSuperInternal() { - var Super = _getPrototypeOf13(Derived), result; + var Super = _getPrototypeOf11(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf13(this).constructor; + var NewTarget = _getPrototypeOf11(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn13(this, result); + return _possibleConstructorReturn11(this, result); }; } - function _possibleConstructorReturn13(self2, call8) { - if (call8 && (_typeof15(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn11(self2, call8) { + if (call8 && (_typeof14(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized13(self2); + return _assertThisInitialized11(self2); } - function _assertThisInitialized13(self2) { + function _assertThisInitialized11(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct13() { + function _isNativeReflectConstruct11() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -10133,574 +10159,531 @@ return false; } } - function _getPrototypeOf13(o4) { - _getPrototypeOf13 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf11(o4) { + _getPrototypeOf11 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf13(o4); + return _getPrototypeOf11(o4); } - function getTabName(anchor) { - return anchor.attr("data-value") || anchor.text(); + function getLabelNode5(el) { + return (0, import_jquery16.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); } - var BootstrapTabInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits13(BootstrapTabInputBinding2, _InputBinding); - var _super = _createSuper13(BootstrapTabInputBinding2); - function BootstrapTabInputBinding2() { - _classCallCheck15(this, BootstrapTabInputBinding2); + function getLabel2(obj) { + var parentNode = obj.parentNode; + if (parentNode.tagName === "LABEL") { + return (0, import_jquery16.default)(parentNode).find("span").text().trim(); + } + return null; + } + var RadioInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits11(RadioInputBinding2, _InputBinding); + var _super = _createSuper11(RadioInputBinding2); + function RadioInputBinding2() { + _classCallCheck13(this, RadioInputBinding2); return _super.apply(this, arguments); } - _createClass15(BootstrapTabInputBinding2, [{ + _createClass13(RadioInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery17.default)(scope).find("ul.nav.shiny-tab-input"); + return (0, import_jquery16.default)(scope).find(".shiny-input-radiogroup"); } }, { key: "getValue", value: function getValue(el) { - var anchor = isBS3() ? (0, import_jquery17.default)(el).find("li:not(.dropdown).active > a") : (0, import_jquery17.default)(el).find(".nav-link:not(.dropdown-toggle).active, .dropdown-menu .dropdown-item.active"); - if (anchor.length === 1) - return getTabName(anchor); - return null; + var checkedItems = (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"]:checked'); + if (checkedItems.length === 0) { + return null; + } + return checkedItems.val(); } }, { key: "setValue", value: function setValue(el, value) { - var success = false; - if (value) { - var anchors = isBS3() ? (0, import_jquery17.default)(el).find("li:not(.dropdown) > a") : (0, import_jquery17.default)(el).find(".nav-link:not(.dropdown-toggle), .dropdown-menu .dropdown-item"); - anchors.each(function() { - if (getTabName((0, import_jquery17.default)(this)) === value) { - (0, import_jquery17.default)(this).tab("show"); - success = true; - return false; - } - return; - }); - } - if (!success) { - (0, import_jquery17.default)(el).trigger("change"); + if (Array.isArray(value) && value.length === 0) { + (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"]').prop("checked", false); + } else { + (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"][value="' + $escape(value) + '"]').prop("checked", true); } } }, { key: "getState", value: function getState(el) { + var $objs = (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"]'); + var options = new Array($objs.length); + for (var i5 = 0; i5 < options.length; i5++) { + options[i5] = { + value: $objs[i5].value, + label: getLabel2($objs[i5]) + }; + } return { - value: this.getValue(el) + label: getLabelNode5(el).text(), + value: this.getValue(el), + options: options }; } }, { key: "receiveMessage", value: function receiveMessage(el, data) { - if (hasDefinedProperty(data, "value")) + var $el = (0, import_jquery16.default)(el); + if (hasDefinedProperty(data, "options")) { + $el.find("div.shiny-options-group").remove(); + $el.find("label.radio").remove(); + $el.append(data.options); + } + if (hasDefinedProperty(data, "value")) { this.setValue(el, data.value); - (0, import_jquery17.default)(el).trigger("change"); + } + updateLabel(data.label, getLabelNode5(el)); + (0, import_jquery16.default)(el).trigger("change"); } }, { key: "subscribe", value: function subscribe(el, callback) { - (0, import_jquery17.default)(el).on( - "change shown.bootstrapTabInputBinding shown.bs.tab.bootstrapTabInputBinding", - function() { - callback(false); - } - ); + (0, import_jquery16.default)(el).on("change.radioInputBinding", function() { + callback(false); + }); } }, { key: "unsubscribe", value: function unsubscribe(el) { - (0, import_jquery17.default)(el).off(".bootstrapTabInputBinding"); + (0, import_jquery16.default)(el).off(".radioInputBinding"); } }]); - return BootstrapTabInputBinding2; + return RadioInputBinding2; }(InputBinding); - // srcts/src/bindings/input/fileinput.ts - var import_es_array_iterator18 = __toESM(require_es_array_iterator()); - var import_jquery20 = __toESM(require_jquery()); - - // node_modules/core-js/modules/es.array.from.js - var $40 = require_export(); - var from = require_array_from(); - var checkCorrectnessOfIteration = require_check_correctness_of_iteration(); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { - Array.from(iterable); - }); - $40({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { - from: from - }); - - // node_modules/core-js/modules/es.array.map.js - var $41 = require_export(); - var $map = require_array_iteration().map; - var arrayMethodHasSpeciesSupport4 = require_array_method_has_species_support(); - var HAS_SPECIES_SUPPORT3 = arrayMethodHasSpeciesSupport4("map"); - $41({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT3 }, { - map: function map(callbackfn) { - return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0); - } - }); - - // srcts/src/file/fileProcessor.ts - var import_es_array_iterator17 = __toESM(require_es_array_iterator()); - var import_jquery19 = __toESM(require_jquery()); + // srcts/src/bindings/input/selectInput.ts + var import_es_json_stringify = __toESM(require_es_json_stringify()); + var import_es_array_iterator15 = __toESM(require_es_array_iterator()); + var import_jquery17 = __toESM(require_jquery()); - // srcts/src/events/inputChanged.ts - var import_jquery18 = __toESM(require_jquery()); - function triggerFileInputChanged(name, value, binding, el, inputType, onEl) { - var evt = import_jquery18.default.Event("shiny:inputchanged"); - evt.name = name; - evt.value = value; - evt.binding = binding; - evt.el = el; - evt.inputType = inputType; - (0, import_jquery18.default)(onEl).trigger(evt); - return evt; - } + // srcts/src/utils/eval.ts + var indirectEval = eval; - // srcts/src/shiny/initedMethods.ts - var import_es_array_iterator16 = __toESM(require_es_array_iterator()); - function _typeof16(obj) { + // srcts/src/bindings/input/selectInput.ts + function _typeof15(obj) { "@babel/helpers - typeof"; - return _typeof16 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof15 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof16(obj); + }, _typeof15(obj); } - function _regeneratorRuntime() { - "use strict"; - _regeneratorRuntime = function _regeneratorRuntime16() { - return exports; - }; - var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) { - obj[key] = desc.value; - }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - function define(obj, key, value) { - return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key]; - } - try { - define({}, ""); - } catch (err) { - define = function define2(obj, key, value) { - return obj[key] = value; - }; + function _classCallCheck14(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); } - function wrap(innerFn, outerFn, self2, tryLocsList) { - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); - return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator; + } + function _defineProperties14(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey14(descriptor.key), descriptor); } - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } + } + function _createClass14(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties14(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties14(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _toPropertyKey14(arg) { + var key = _toPrimitive14(arg, "string"); + return _typeof15(key) === "symbol" ? key : String(key); + } + function _toPrimitive14(input, hint) { + if (_typeof15(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof15(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); } - exports.wrap = wrap; - var ContinueSentinel = {}; - function Generator() { + return (hint === "string" ? String : Number)(input); + } + function _inherits12(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); } - function GeneratorFunction() { + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf12(subClass, superClass); + } + function _setPrototypeOf12(o4, p3) { + _setPrototypeOf12 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + o5.__proto__ = p4; + return o5; + }; + return _setPrototypeOf12(o4, p3); + } + function _createSuper12(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct12(); + return function _createSuperInternal() { + var Super = _getPrototypeOf12(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf12(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn12(this, result); + }; + } + function _possibleConstructorReturn12(self2, call8) { + if (call8 && (_typeof15(call8) === "object" || typeof call8 === "function")) { + return call8; + } else if (call8 !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); } - function GeneratorFunctionPrototype() { + return _assertThisInitialized12(self2); + } + function _assertThisInitialized12(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } - var IteratorPrototype = {}; - define(IteratorPrototype, iteratorSymbol, function() { - return this; - }); - var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([]))); - NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - define(prototype, method, function(arg) { - return this._invoke(method, arg); - }); - }); - } - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if ("throw" !== record.type) { - var result = record.arg, value = result.value; - return value && "object" == _typeof16(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) { - invoke("next", value2, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }) : PromiseImpl.resolve(value).then(function(unwrapped) { - result.value = unwrapped, resolve(result); - }, function(error) { - return invoke("throw", error, resolve, reject); - }); - } - reject(record.arg); - } - var previousPromise; - defineProperty3(this, "_invoke", { value: function value(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } }); - } - function makeInvokeMethod(innerFn, self2, context) { - var state = "suspendedStart"; - return function(method, arg) { - if ("executing" === state) - throw new Error("Generator is already running"); - if ("completed" === state) { - if ("throw" === method) - throw arg; - return doneResult(); - } - for (context.method = method, context.arg = arg; ; ) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) - continue; - return delegateResult; - } - } - if ("next" === context.method) - context.sent = context._sent = context.arg; - else if ("throw" === context.method) { - if ("suspendedStart" === state) - throw state = "completed", context.arg; - context.dispatchException(context.arg); - } else - "return" === context.method && context.abrupt("return", context.arg); - state = "executing"; - var record = tryCatch(innerFn, self2, context); - if ("normal" === record.type) { - if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) - continue; - return { value: record.arg, done: context.done }; - } - "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); - } - }; - } - function maybeInvokeDelegate(delegate, context) { - var methodName = context.method, method = delegate.iterator[methodName]; - if (void 0 === method) - return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; - var record = tryCatch(method, delegate.iterator, context.arg); - if ("throw" === record.type) - return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; - var info = record.arg; - return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); - } - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); + return self2; + } + function _isNativeReflectConstruct12() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e4) { + return false; } - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal", delete record.arg, entry.completion = record; + } + function _getPrototypeOf12(o4) { + _getPrototypeOf12 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + return o5.__proto__ || Object.getPrototypeOf(o5); + }; + return _getPrototypeOf12(o4); + } + function getLabelNode6(el) { + var escapedId = $escape(el.id); + if (isSelectize(el)) { + escapedId += "-selectized"; } - function Context(tryLocsList) { - this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true); + return (0, import_jquery17.default)(el).parent().parent().find('label[for="' + escapedId + '"]'); + } + function isSelectize(el) { + var config = (0, import_jquery17.default)(el).parent().find('script[data-for="' + $escape(el.id) + '"]'); + return config.length > 0; + } + var SelectInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits12(SelectInputBinding2, _InputBinding); + var _super = _createSuper12(SelectInputBinding2); + function SelectInputBinding2() { + _classCallCheck14(this, SelectInputBinding2); + return _super.apply(this, arguments); } - function values2(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) - return iteratorMethod.call(iterable); - if ("function" == typeof iterable.next) - return iterable; - if (!isNaN(iterable.length)) { - var i5 = -1, next2 = function next3() { - for (; ++i5 < iterable.length; ) - if (hasOwn5.call(iterable, i5)) - return next3.value = iterable[i5], next3.done = false, next3; - return next3.value = void 0, next3.done = true, next3; - }; - return next2.next = next2; - } + _createClass14(SelectInputBinding2, [{ + key: "find", + value: function find2(scope) { + return (0, import_jquery17.default)(scope).find("select"); } - return { next: doneResult }; - } - function doneResult() { - return { value: void 0, done: true }; - } - return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) { - var ctor = "function" == typeof genFun && genFun.constructor; - return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); - }, exports.mark = function(genFun) { - return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; - }, exports.awrap = function(arg) { - return { __await: arg }; - }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() { - return this; - }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) { - void 0 === PromiseImpl && (PromiseImpl = Promise); - var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl); - return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() { - return this; - }), define(Gp, "toString", function() { - return "[object Generator]"; - }), exports.keys = function(val) { - var object = Object(val), keys2 = []; - for (var key in object) - keys2.push(key); - return keys2.reverse(), function next2() { - for (; keys2.length; ) { - var key2 = keys2.pop(); - if (key2 in object) - return next2.value = key2, next2.done = false, next2; + }, { + key: "getType", + value: function getType(el) { + var $el = (0, import_jquery17.default)(el); + if (!$el.hasClass("symbol")) { + return null; + } + if ($el.attr("multiple") === "multiple") { + return "shiny.symbolList"; + } else { + return "shiny.symbol"; } - return next2.done = true, next2; - }; - }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { - if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset) - for (var name in this) - "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0); - }, stop: function stop() { - this.done = true; - var rootRecord = this.tryEntries[0].completion; - if ("throw" === rootRecord.type) - throw rootRecord.arg; - return this.rval; - }, dispatchException: function dispatchException(exception) { - if (this.done) - throw exception; - var context = this; - function handle(loc, caught) { - return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught; } - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5], record = entry.completion; - if ("root" === entry.tryLoc) - return handle("end"); - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc"); - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) - return handle(entry.catchLoc, true); - if (this.prev < entry.finallyLoc) - return handle(entry.finallyLoc); - } else if (hasCatch) { - if (this.prev < entry.catchLoc) - return handle(entry.catchLoc, true); - } else { - if (!hasFinally) - throw new Error("try statement without catch or finally"); - if (this.prev < entry.finallyLoc) - return handle(entry.finallyLoc); - } + }, { + key: "getId", + value: function getId(el) { + return InputBinding.prototype.getId.call(this, el) || el.name; + } + }, { + key: "getValue", + value: function getValue(el) { + if (!isSelectize(el)) { + return (0, import_jquery17.default)(el).val(); + } else { + var selectize = this._selectize(el); + return selectize === null || selectize === void 0 ? void 0 : selectize.getValue(); } } - }, abrupt: function abrupt(type, arg) { - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5]; - if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; + }, { + key: "setValue", + value: function setValue(el, value) { + if (!isSelectize(el)) { + (0, import_jquery17.default)(el).val(value); + } else { + var selectize = this._selectize(el); + selectize === null || selectize === void 0 ? void 0 : selectize.setValue(value); } } - finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); - var record = finallyEntry ? finallyEntry.completion : {}; - return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); - }, complete: function complete(record, afterLoc) { - if ("throw" === record.type) - throw record.arg; - return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; - }, finish: function finish(finallyLoc) { - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5]; - if (entry.finallyLoc === finallyLoc) - return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; + }, { + key: "getState", + value: function getState(el) { + var options = new Array(el.length); + for (var i5 = 0; i5 < el.length; i5++) { + options[i5] = { + value: el[i5].value, + label: el[i5].label + }; + } + return { + label: getLabelNode6(el), + value: this.getValue(el), + options: options + }; } - }, catch: function _catch(tryLoc) { - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if ("throw" === record.type) { - var thrown = record.arg; - resetTryEntry(entry); + }, { + key: "receiveMessage", + value: function receiveMessage(el, data) { + var $el = (0, import_jquery17.default)(el); + if (hasDefinedProperty(data, "options")) { + var selectize = this._selectize(el); + selectize === null || selectize === void 0 ? void 0 : selectize.destroy(); + $el.empty().append(data.options); + this._selectize(el); + } + if (hasDefinedProperty(data, "config")) { + $el.parent().find('script[data-for="' + $escape(el.id) + '"]').replaceWith(data.config); + this._selectize(el, true); + } + if (hasDefinedProperty(data, "url")) { + var _selectize2 = this._selectize(el); + _selectize2.clearOptions(); + if (hasDefinedProperty(data, "value")) { + _selectize2.clear(); } - return thrown; + var loaded = false; + _selectize2.settings.load = function(query, callback) { + var settings = _selectize2.settings; + import_jquery17.default.ajax({ + url: data.url, + data: { + query: query, + field: JSON.stringify([settings.searchField]), + value: settings.valueField, + conju: settings.searchConjunction, + maxop: settings.maxOptions + }, + type: "GET", + error: function error() { + callback(); + }, + success: function success(res) { + import_jquery17.default.each(res, function(index, elem) { + var optgroupId = elem[settings.optgroupField || "optgroup"]; + var optgroup = {}; + optgroup[settings.optgroupLabelField || "label"] = optgroupId; + optgroup[settings.optgroupValueField || "value"] = optgroupId; + _selectize2.addOptionGroup(optgroupId, optgroup); + }); + callback(res); + if (!loaded) { + if (hasDefinedProperty(data, "value")) { + _selectize2.setValue(data.value); + } else if (settings.maxItems === 1) { + _selectize2.setValue(res[0].value); + } + } + loaded = true; + } + }); + }; + _selectize2.load(function(callback) { + _selectize2.settings.load.apply(_selectize2, ["", callback]); + }); + } else if (hasDefinedProperty(data, "value")) { + this.setValue(el, data.value); } + updateLabel(data.label, getLabelNode6(el)); + (0, import_jquery17.default)(el).trigger("change"); } - throw new Error("illegal catch attempt"); - }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { - return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel; - } }, exports; - } - function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - function _asyncToGenerator(fn) { - return function() { - var self2 = this, args = arguments; - return new Promise(function(resolve, reject) { - var gen = fn.apply(self2, args); - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + }, { + key: "subscribe", + value: function subscribe(el, callback) { + var _this = this; + (0, import_jquery17.default)(el).on( + "change.selectInputBinding", + function() { + if (el.nonempty && _this.getValue(el) === "") { + return; + } + callback(false); + } + ); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery17.default)(el).off(".selectInputBinding"); + } + }, { + key: "initialize", + value: function initialize(el) { + this._selectize(el); + } + }, { + key: "_selectize", + value: function _selectize(el) { + var update = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + if (!import_jquery17.default.fn.selectize) + return void 0; + var $el = (0, import_jquery17.default)(el); + var config = $el.parent().find('script[data-for="' + $escape(el.id) + '"]'); + if (config.length === 0) + return void 0; + var options = import_jquery17.default.extend({ + labelField: "label", + valueField: "value", + searchField: ["label"] + }, JSON.parse(config.html())); + if (typeof config.data("nonempty") !== "undefined") { + el.nonempty = true; + options = import_jquery17.default.extend(options, { + onItemRemove: function onItemRemove(value) { + if (this.getValue() === "") + (0, import_jquery17.default)("select#" + $escape(el.id)).empty().append((0, import_jquery17.default)("", { + value: value, + selected: true + })).trigger("change"); + }, + onDropdownClose: function onDropdownClose() { + if (this.getValue() === "") { + this.setValue((0, import_jquery17.default)("select#" + $escape(el.id)).val()); + } + } + }); + } else { + el.nonempty = false; } - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + if (config.data("eval") instanceof Array) + import_jquery17.default.each(config.data("eval"), function(i5, x2) { + options[x2] = indirectEval("(" + options[x2] + ")"); + }); + var control = $el.selectize(options)[0].selectize; + if (update) { + var settings = import_jquery17.default.extend(control.settings, options); + control.destroy(); + control = $el.selectize(settings)[0].selectize; } - _next(void 0); - }); - }; - } - var fullShinyObj; - function setShinyObj(shiny) { - fullShinyObj = shiny; + return control; + } + }]); + return SelectInputBinding2; + }(InputBinding); + + // srcts/src/bindings/input/slider.ts + var import_es_regexp_exec4 = __toESM(require_es_regexp_exec()); + var import_es_array_iterator16 = __toESM(require_es_array_iterator()); + var import_jquery18 = __toESM(require_jquery()); + function _typeof16(obj) { + "@babel/helpers - typeof"; + return _typeof16 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof16(obj); } - function validateShinyHasBeenSet() { - if (typeof fullShinyObj === "undefined") { - throw "Shiny has not finish initialization yet. Please wait for the 'shiny-initialized' event."; + function _classCallCheck15(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); } - return fullShinyObj; } - function shinySetInputValue(name, value, opts) { - validateShinyHasBeenSet().setInputValue(name, value, opts); + function _defineProperties15(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey15(descriptor.key), descriptor); + } } - function shinyShinyApp() { - return validateShinyHasBeenSet().shinyapp; + function _createClass15(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties15(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties15(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; } - function setShinyUser(user) { - validateShinyHasBeenSet().user = user; + function _toPropertyKey15(arg) { + var key = _toPrimitive15(arg, "string"); + return _typeof16(key) === "symbol" ? key : String(key); } - function shinyForgetLastInputValue(name) { - validateShinyHasBeenSet().forgetLastInputValue(name); + function _toPrimitive15(input, hint) { + if (_typeof16(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof16(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); } - function shinyBindAll(_x) { - return _shinyBindAll.apply(this, arguments); + function _inherits13(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf13(subClass, superClass); } - function _shinyBindAll() { - _shinyBindAll = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(scope) { - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return validateShinyHasBeenSet().bindAll(scope); - case 2: - case "end": - return _context.stop(); - } - }, _callee); - })); - return _shinyBindAll.apply(this, arguments); - } - function shinyUnbindAll(scope) { - var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - validateShinyHasBeenSet().unbindAll(scope, includeSelf); - } - function shinyInitializeInputs(scope) { - validateShinyHasBeenSet().initializeInputs(scope); - } - function shinyAppBindOutput(_x2, _x3) { - return _shinyAppBindOutput.apply(this, arguments); - } - function _shinyAppBindOutput() { - _shinyAppBindOutput = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(id, binding) { - return _regeneratorRuntime().wrap(function _callee2$(_context2) { - while (1) - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return shinyShinyApp().bindOutput(id, binding); - case 2: - case "end": - return _context2.stop(); - } - }, _callee2); - })); - return _shinyAppBindOutput.apply(this, arguments); - } - function shinyAppUnbindOutput(id, binding) { - return shinyShinyApp().unbindOutput(id, binding); - } - function getShinyOnCustomMessage() { - return validateShinyHasBeenSet().oncustommessage; - } - var fileInputBinding; - function getFileInputBinding() { - return fileInputBinding; - } - function setFileInputBinding(fileInputBinding_) { - fileInputBinding = fileInputBinding_; - } - function getShinyCreateWebsocket() { - return validateShinyHasBeenSet().createSocket; - } - - // srcts/src/file/fileProcessor.ts - function _typeof17(obj) { - "@babel/helpers - typeof"; - return _typeof17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof17(obj); - } - function _inherits14(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf14(subClass, superClass); - } - function _setPrototypeOf14(o4, p3) { - _setPrototypeOf14 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf13(o4, p3) { + _setPrototypeOf13 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf14(o4, p3); + return _setPrototypeOf13(o4, p3); } - function _createSuper14(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct14(); + function _createSuper13(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct13(); return function _createSuperInternal() { - var Super = _getPrototypeOf14(Derived), result; + var Super = _getPrototypeOf13(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf14(this).constructor; + var NewTarget = _getPrototypeOf13(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn14(this, result); + return _possibleConstructorReturn13(this, result); }; } - function _possibleConstructorReturn14(self2, call8) { - if (call8 && (_typeof17(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn13(self2, call8) { + if (call8 && (_typeof16(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized14(self2); + return _assertThisInitialized13(self2); } - function _assertThisInitialized14(self2) { + function _assertThisInitialized13(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct14() { + function _isNativeReflectConstruct13() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -10715,388 +10698,396 @@ return false; } } - function _getPrototypeOf14(o4) { - _getPrototypeOf14 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf13(o4) { + _getPrototypeOf13 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf14(o4); - } - function _classCallCheck16(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties16(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey16(descriptor.key), descriptor); - } + return _getPrototypeOf13(o4); } - function _createClass16(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties16(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties16(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; + function forceIonSliderUpdate(slider) { + if (slider.$cache && slider.$cache.input) + slider.$cache.input.trigger("change"); + else + console.log("Couldn't force ion slider to update"); } - function _defineProperty3(obj, key, value) { - key = _toPropertyKey16(key); - if (key in obj) { - Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + function getTypePrettifyer(dataType, timeFormat, timezone) { + var timeFormatter; + var prettify; + if (dataType === "date") { + timeFormatter = window.strftime.utc(); + prettify = function prettify2(num) { + return timeFormatter(timeFormat, new Date(num)); + }; + } else if (dataType === "datetime") { + if (timezone) + timeFormatter = window.strftime.timezone(timezone); + else + timeFormatter = window.strftime; + prettify = function prettify2(num) { + return timeFormatter(timeFormat, new Date(num)); + }; } else { - obj[key] = value; + prettify = function prettify2(num) { + return formatNumber(num, this.prettify_separator); + }; } - return obj; + return prettify; } - function _toPropertyKey16(arg) { - var key = _toPrimitive16(arg, "string"); - return _typeof17(key) === "symbol" ? key : String(key); + function getLabelNode7(el) { + return (0, import_jquery18.default)(el).parent().find('label[for="' + $escape(el.id) + '"]'); } - function _toPrimitive16(input, hint) { - if (_typeof17(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof17(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); + function numValues(el) { + if ((0, import_jquery18.default)(el).data("ionRangeSlider").options.type === "double") + return 2; + else + return 1; } - var FileProcessor = /* @__PURE__ */ function() { - function FileProcessor2(files) { - var exec$run = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - _classCallCheck16(this, FileProcessor2); - _defineProperty3(this, "files", void 0); - _defineProperty3(this, "fileIndex", -1); - _defineProperty3(this, "aborted", false); - _defineProperty3(this, "completed", false); - this.files = Array.from(files); - if (exec$run) { - this.$run(); - } + var SliderInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) { + _inherits13(SliderInputBinding2, _TextInputBindingBase); + var _super = _createSuper13(SliderInputBinding2); + function SliderInputBinding2() { + _classCallCheck15(this, SliderInputBinding2); + return _super.apply(this, arguments); } - _createClass16(FileProcessor2, [{ - key: "onBegin", - value: function onBegin(files, cont) { - files; - setTimeout(cont, 0); + _createClass15(SliderInputBinding2, [{ + key: "find", + value: function find2(scope) { + if (!import_jquery18.default.fn.ionRangeSlider) { + return (0, import_jquery18.default)(); + } + return (0, import_jquery18.default)(scope).find("input.js-range-slider"); } }, { - key: "onFile", - value: function onFile(file, cont) { - file; - setTimeout(cont, 0); + key: "getType", + value: function getType(el) { + var dataType = (0, import_jquery18.default)(el).data("data-type"); + if (dataType === "date") + return "shiny.date"; + else if (dataType === "datetime") + return "shiny.datetime"; + else + return null; } }, { - key: "onComplete", - value: function onComplete() { - return; + key: "getValue", + value: function getValue(el) { + var $el = (0, import_jquery18.default)(el); + var result = (0, import_jquery18.default)(el).data("ionRangeSlider").result; + var convert; + var dataType = $el.data("data-type"); + if (dataType === "date") { + convert = function convert2(val) { + return formatDateUTC(new Date(Number(val))); + }; + } else if (dataType === "datetime") { + convert = function convert2(val) { + return Number(val) / 1e3; + }; + } else { + convert = function convert2(val) { + return Number(val); + }; + } + if (numValues(el) === 2) { + return [convert(result.from), convert(result.to)]; + } else { + return convert(result.from); + } } }, { - key: "onAbort", - value: function onAbort() { - return; + key: "setValue", + value: function setValue(el, value) { + var $el = (0, import_jquery18.default)(el); + var slider = $el.data("ionRangeSlider"); + $el.data("immediate", true); + try { + if (numValues(el) === 2 && value instanceof Array) { + slider.update({ + from: value[0], + to: value[1] + }); + } else { + slider.update({ + from: value + }); + } + forceIonSliderUpdate(slider); + } finally { + $el.data("immediate", false); + } } }, { - key: "abort", - value: function abort() { - if (this.completed || this.aborted) - return; - this.aborted = true; - this.onAbort(); + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery18.default)(el).on("change.sliderInputBinding", function() { + callback(!(0, import_jquery18.default)(el).data("immediate") && !(0, import_jquery18.default)(el).data("animating")); + }); } }, { - key: "$getRun", - value: function $getRun() { - var _this = this; - var called = false; - return function() { - if (called) - return; - called = true; - _this.$run(); - }; + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery18.default)(el).off(".sliderInputBinding"); } }, { - key: "$run", - value: function $run() { - if (this.aborted || this.completed) - return; - if (this.fileIndex < 0) { - this.fileIndex = 0; - this.onBegin(this.files, this.$getRun()); - return; + key: "receiveMessage", + value: function receiveMessage(el, data) { + var $el = (0, import_jquery18.default)(el); + var slider = $el.data("ionRangeSlider"); + var msg = {}; + if (hasDefinedProperty(data, "value")) { + if (numValues(el) === 2 && data.value instanceof Array) { + msg.from = data.value[0]; + msg.to = data.value[1]; + } else { + if (Array.isArray(data.value)) { + var errorReason = ["an empty array.", "a single-value array.", "an array with more than two values."]; + throw "Slider requires two values to update with an array, but message value was " + errorReason[Math.min(data.value.length, 2)]; + } + msg.from = data.value; + } } - if (this.fileIndex === this.files.length) { - this.completed = true; - this.onComplete(); - return; + var sliderFeatures = ["min", "max", "step"]; + for (var i5 = 0; i5 < sliderFeatures.length; i5++) { + var feats = sliderFeatures[i5]; + if (hasDefinedProperty(data, feats)) { + msg[feats] = data[feats]; + } } - var file = this.files[this.fileIndex++]; - this.onFile(file, this.$getRun()); - } - }]); - return FileProcessor2; - }(); - var FileUploader = /* @__PURE__ */ function(_FileProcessor) { - _inherits14(FileUploader2, _FileProcessor); - var _super = _createSuper14(FileUploader2); - function FileUploader2(shinyapp, id, files, el) { - var _this2; - _classCallCheck16(this, FileUploader2); - _this2 = _super.call(this, files, false); - _defineProperty3(_assertThisInitialized14(_this2), "shinyapp", void 0); - _defineProperty3(_assertThisInitialized14(_this2), "id", void 0); - _defineProperty3(_assertThisInitialized14(_this2), "el", void 0); - _defineProperty3(_assertThisInitialized14(_this2), "jobId", void 0); - _defineProperty3(_assertThisInitialized14(_this2), "uploadUrl", void 0); - _defineProperty3(_assertThisInitialized14(_this2), "progressBytes", void 0); - _defineProperty3(_assertThisInitialized14(_this2), "totalBytes", void 0); - _this2.shinyapp = shinyapp; - _this2.id = id; - _this2.el = el; - _this2.$run(); - return _this2; - } - _createClass16(FileUploader2, [{ - key: "makeRequest", - value: function makeRequest(method, args, onSuccess, onFailure, blobs) { - this.shinyapp.makeRequest(method, args, onSuccess, onFailure, blobs); - } - }, { - key: "onBegin", - value: function onBegin(files, cont) { - var _this3 = this; - this.$setError(null); - this.$setActive(true); - this.$setVisible(true); - this.onProgress(null, 0); - this.totalBytes = 0; - this.progressBytes = 0; - import_jquery19.default.each(files, function(i5, file) { - _this3.totalBytes += file.size; - }); - var fileInfo = import_jquery19.default.map(files, function(file) { - return { - name: file.name, - size: file.size, - type: file.type - }; - }); - this.makeRequest("uploadInit", [fileInfo], function(response) { - _this3.jobId = response.jobId; - _this3.uploadUrl = response.uploadUrl; - cont(); - }, function(error) { - _this3.onError(error); - }, void 0); - } - }, { - key: "onFile", - value: function onFile(file, cont) { - var _this4 = this; - this.onProgress(file, 0); - import_jquery19.default.ajax(this.uploadUrl, { - type: "POST", - cache: false, - xhr: function xhr() { - if (typeof import_jquery19.default.ajaxSettings.xhr !== "function") - throw "jQuery's XHR is not a function"; - var xhrVal = import_jquery19.default.ajaxSettings.xhr(); - if (xhrVal.upload) { - xhrVal.upload.onprogress = function(e4) { - if (e4.lengthComputable) { - _this4.onProgress(file, (_this4.progressBytes + e4.loaded) / _this4.totalBytes); - } - }; - } - return xhrVal; - }, - data: file, - contentType: "application/octet-stream", - processData: false, - success: function success() { - _this4.progressBytes += file.size; - cont(); - }, - error: function error(jqXHR, textStatus, errorThrown) { - errorThrown; - _this4.onError(jqXHR.responseText || textStatus); + updateLabel(data.label, getLabelNode7(el)); + var domElements = ["data-type", "time-format", "timezone"]; + for (var _i = 0; _i < domElements.length; _i++) { + var elem = domElements[_i]; + if (hasDefinedProperty(data, elem)) { + $el.data(elem, data[elem]); } - }); - } - }, { - key: "onComplete", - value: function onComplete() { - var _this5 = this; - var fileInfo = import_jquery19.default.map(this.files, function(file, i5) { - return { - name: file.name, - size: file.size, - type: file.type - }; - i5; - }); - var evt = triggerFileInputChanged(this.id, fileInfo, getFileInputBinding(), this.el, "shiny.fileupload", document); - this.makeRequest("uploadEnd", [this.jobId, this.id], function() { - _this5.$setActive(false); - _this5.onProgress(null, 1); - _this5.$bar().text("Upload complete"); - (0, import_jquery19.default)(evt.el).val(""); - }, function(error) { - _this5.onError(error); - }, void 0); - this.$bar().text("Finishing upload"); - } - }, { - key: "onError", - value: function onError(message) { - this.$setError(message || ""); - this.$setActive(false); - } - }, { - key: "onAbort", - value: function onAbort() { - this.$setVisible(false); - } - }, { - key: "onProgress", - value: function onProgress(file, completed) { - this.$bar().width(Math.round(completed * 100) + "%"); - this.$bar().text(file ? file.name : ""); - } - }, { - key: "$container", - value: function $container() { - return (0, import_jquery19.default)("#" + $escape(this.id) + "_progress.shiny-file-input-progress"); - } - }, { - key: "$bar", - value: function $bar() { - return (0, import_jquery19.default)("#" + $escape(this.id) + "_progress.shiny-file-input-progress .progress-bar"); + } + var dataType = $el.data("data-type"); + var timeFormat = $el.data("time-format"); + var timezone = $el.data("timezone"); + msg.prettify = getTypePrettifyer(dataType, timeFormat, timezone); + $el.data("immediate", true); + try { + slider.update(msg); + forceIonSliderUpdate(slider); + } finally { + $el.data("immediate", false); + } } }, { - key: "$setVisible", - value: function $setVisible(visible) { - this.$container().css("visibility", visible ? "visible" : "hidden"); + key: "getRatePolicy", + value: function getRatePolicy(el) { + return { + policy: "debounce", + delay: 250 + }; + el; } }, { - key: "$setError", - value: function $setError(error) { - this.$bar().toggleClass("progress-bar-danger", error !== null); - if (error !== null) { - this.onProgress(null, 1); - this.$bar().text(error); - } + key: "getState", + value: function getState(el) { + el; } }, { - key: "$setActive", - value: function $setActive(active) { - this.$container().toggleClass("active", !!active); + key: "initialize", + value: function initialize(el) { + var $el = (0, import_jquery18.default)(el); + var dataType = $el.data("data-type"); + var timeFormat = $el.data("time-format"); + var timezone = $el.data("timezone"); + var opts = { + prettify: getTypePrettifyer(dataType, timeFormat, timezone) + }; + $el.ionRangeSlider(opts); } }]); - return FileUploader2; - }(FileProcessor); - - // srcts/src/bindings/input/fileinput.ts - function _typeof18(obj) { - "@babel/helpers - typeof"; - return _typeof18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof18(obj); - } - function _classCallCheck17(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } + return SliderInputBinding2; + }(TextInputBindingBase); + function formatNumber(num) { + var thousandSep = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ","; + var decimalSep = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "."; + var parts = num.toString().split("."); + parts[0] = parts[0].replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + thousandSep); + if (parts.length === 1) + return parts[0]; + else if (parts.length === 2) + return parts[0] + decimalSep + parts[1]; + else + return ""; } - function _defineProperties17(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { + (0, import_jquery18.default)(document).on("click", ".slider-animate-button", function(evt) { + evt.preventDefault(); + var self2 = (0, import_jquery18.default)(this); + var target = (0, import_jquery18.default)("#" + $escape(self2.attr("data-target-id"))); + var startLabel = "Play"; + var stopLabel = "Pause"; + var loop = self2.attr("data-loop") !== void 0 && !/^\s*false\s*$/i.test(self2.attr("data-loop")); + var animInterval = self2.attr("data-interval"); + if (isNaN(animInterval)) + animInterval = 1500; + else + animInterval = Number(animInterval); + if (!target.data("animTimer")) { + var timer; + if (target.hasClass("jslider")) { + var slider = target.slider(); + if (!slider.canStepNext()) + slider.resetToStart(); + timer = setInterval(function() { + if (loop && !slider.canStepNext()) { + slider.resetToStart(); + } else { + slider.stepNext(); + if (!loop && !slider.canStepNext()) { + self2.click(); + } + } + }, animInterval); + } else { + var _slider = target.data("ionRangeSlider"); + var sliderCanStep = function sliderCanStep2() { + if (_slider.options.type === "double") + return _slider.result.to < _slider.result.max; + else + return _slider.result.from < _slider.result.max; + }; + var sliderReset = function sliderReset2() { + var val = { + from: _slider.result.min + }; + if (_slider.options.type === "double") + val.to = val.from + (_slider.result.to - _slider.result.from); + _slider.update(val); + forceIonSliderUpdate(_slider); + }; + var sliderStep = function sliderStep2() { + var val = { + from: Math.min(_slider.result.max, _slider.result.from + _slider.options.step) + }; + if (_slider.options.type === "double") + val.to = Math.min(_slider.result.max, _slider.result.to + _slider.options.step); + _slider.update(val); + forceIonSliderUpdate(_slider); + }; + if (!sliderCanStep()) + sliderReset(); + timer = setInterval(function() { + if (loop && !sliderCanStep()) { + sliderReset(); + } else { + sliderStep(); + if (!loop && !sliderCanStep()) { + self2.click(); + } + } + }, animInterval); + } + target.data("animTimer", timer); + self2.attr("title", stopLabel); + self2.addClass("playing"); + target.data("animating", true); + } else { + clearTimeout(target.data("animTimer")); + target.removeData("animTimer"); + self2.attr("title", startLabel); + self2.removeClass("playing"); + target.removeData("animating"); + } + }); + + // srcts/src/bindings/input/tabinput.ts + var import_es_array_iterator17 = __toESM(require_es_array_iterator()); + var import_jquery19 = __toESM(require_jquery()); + function _typeof17(obj) { + "@babel/helpers - typeof"; + return _typeof17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof17(obj); + } + function _classCallCheck16(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties16(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { var descriptor = props[i5]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey17(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey16(descriptor.key), descriptor); } } - function _createClass17(Constructor, protoProps, staticProps) { + function _createClass16(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties17(Constructor.prototype, protoProps); + _defineProperties16(Constructor.prototype, protoProps); if (staticProps) - _defineProperties17(Constructor, staticProps); + _defineProperties16(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey17(arg) { - var key = _toPrimitive17(arg, "string"); - return _typeof18(key) === "symbol" ? key : String(key); + function _toPropertyKey16(arg) { + var key = _toPrimitive16(arg, "string"); + return _typeof17(key) === "symbol" ? key : String(key); } - function _toPrimitive17(input, hint) { - if (_typeof18(input) !== "object" || input === null) + function _toPrimitive16(input, hint) { + if (_typeof17(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof18(res) !== "object") + if (_typeof17(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits15(subClass, superClass) { + function _inherits14(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) - _setPrototypeOf15(subClass, superClass); + _setPrototypeOf14(subClass, superClass); } - function _setPrototypeOf15(o4, p3) { - _setPrototypeOf15 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + function _setPrototypeOf14(o4, p3) { + _setPrototypeOf14 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { o5.__proto__ = p4; return o5; }; - return _setPrototypeOf15(o4, p3); + return _setPrototypeOf14(o4, p3); } - function _createSuper15(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct15(); + function _createSuper14(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct14(); return function _createSuperInternal() { - var Super = _getPrototypeOf15(Derived), result; + var Super = _getPrototypeOf14(Derived), result; if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf15(this).constructor; + var NewTarget = _getPrototypeOf14(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } - return _possibleConstructorReturn15(this, result); + return _possibleConstructorReturn14(this, result); }; } - function _possibleConstructorReturn15(self2, call8) { - if (call8 && (_typeof18(call8) === "object" || typeof call8 === "function")) { + function _possibleConstructorReturn14(self2, call8) { + if (call8 && (_typeof17(call8) === "object" || typeof call8 === "function")) { return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized15(self2); + return _assertThisInitialized14(self2); } - function _assertThisInitialized15(self2) { + function _assertThisInitialized14(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct15() { + function _isNativeReflectConstruct14() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -11111,215 +11102,216 @@ return false; } } - function _getPrototypeOf15(o4) { - _getPrototypeOf15 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf14(o4) { + _getPrototypeOf14 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf15(o4); + return _getPrototypeOf14(o4); } - var zoneActive = "shiny-file-input-active"; - var zoneOver = "shiny-file-input-over"; - function zoneOf(el) { - return (0, import_jquery20.default)(el).closest("div.input-group"); + function getTabName(anchor) { + return anchor.attr("data-value") || anchor.text(); } - function enableDraghover(el) { - var $el = (0, import_jquery20.default)(el); - var childCounter = 0; - $el.on({ - "dragenter.draghover": function dragenterDraghover(e4) { - if (childCounter++ === 0) { - $el.trigger("draghover:enter", e4); - } - }, - "dragleave.draghover": function dragleaveDraghover(e4) { - if (--childCounter === 0) { - $el.trigger("draghover:leave", e4); + var BootstrapTabInputBinding = /* @__PURE__ */ function(_InputBinding) { + _inherits14(BootstrapTabInputBinding2, _InputBinding); + var _super = _createSuper14(BootstrapTabInputBinding2); + function BootstrapTabInputBinding2() { + _classCallCheck16(this, BootstrapTabInputBinding2); + return _super.apply(this, arguments); + } + _createClass16(BootstrapTabInputBinding2, [{ + key: "find", + value: function find2(scope) { + return (0, import_jquery19.default)(scope).find("ul.nav.shiny-tab-input"); + } + }, { + key: "getValue", + value: function getValue(el) { + var anchor = isBS3() ? (0, import_jquery19.default)(el).find("li:not(.dropdown).active > a") : (0, import_jquery19.default)(el).find(".nav-link:not(.dropdown-toggle).active, .dropdown-menu .dropdown-item.active"); + if (anchor.length === 1) + return getTabName(anchor); + return null; + } + }, { + key: "setValue", + value: function setValue(el, value) { + var success = false; + if (value) { + var anchors = isBS3() ? (0, import_jquery19.default)(el).find("li:not(.dropdown) > a") : (0, import_jquery19.default)(el).find(".nav-link:not(.dropdown-toggle), .dropdown-menu .dropdown-item"); + anchors.each(function() { + if (getTabName((0, import_jquery19.default)(this)) === value) { + (0, import_jquery19.default)(this).tab("show"); + success = true; + return false; + } + return; + }); } - if (childCounter < 0) { - console.error("draghover childCounter is negative somehow"); + if (!success) { + (0, import_jquery19.default)(el).trigger("change"); } - }, - "dragover.draghover": function dragoverDraghover(e4) { - e4.preventDefault(); - }, - "drop.draghover": function dropDraghover(e4) { - childCounter = 0; - $el.trigger("draghover:drop", e4); - e4.preventDefault(); } - }); - return $el; + }, { + key: "getState", + value: function getState(el) { + return { + value: this.getValue(el) + }; + } + }, { + key: "receiveMessage", + value: function receiveMessage(el, data) { + if (hasDefinedProperty(data, "value")) + this.setValue(el, data.value); + (0, import_jquery19.default)(el).trigger("change"); + } + }, { + key: "subscribe", + value: function subscribe(el, callback) { + (0, import_jquery19.default)(el).on( + "change shown.bootstrapTabInputBinding shown.bs.tab.bootstrapTabInputBinding", + function() { + callback(false); + } + ); + } + }, { + key: "unsubscribe", + value: function unsubscribe(el) { + (0, import_jquery19.default)(el).off(".bootstrapTabInputBinding"); + } + }]); + return BootstrapTabInputBinding2; + }(InputBinding); + + // srcts/src/bindings/input/textarea.ts + var import_es_array_iterator18 = __toESM(require_es_array_iterator()); + var import_jquery20 = __toESM(require_jquery()); + function _typeof18(obj) { + "@babel/helpers - typeof"; + return _typeof18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof18(obj); } - function disableDraghover(el) { - return (0, import_jquery20.default)(el).off(".draghover"); + function _classCallCheck17(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } } - function enableDocumentEvents() { - var $doc = (0, import_jquery20.default)("html"); - enableDraghover($doc).on({ - "draghover:enter.draghover": function draghoverEnterDraghover() { - zoneOf($fileInputs).addClass(zoneActive); - }, - "draghover:leave.draghover": function draghoverLeaveDraghover() { - zoneOf($fileInputs).removeClass(zoneActive); - }, - "draghover:drop.draghover": function draghoverDropDraghover() { - zoneOf($fileInputs).removeClass(zoneOver).removeClass(zoneActive); - } - }); + function _defineProperties17(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey17(descriptor.key), descriptor); + } } - function disableDocumentEvents() { - var $doc = (0, import_jquery20.default)("html"); - $doc.off(".draghover"); - disableDraghover($doc); + function _createClass17(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties17(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties17(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; } - function canSetFiles(fileList) { - var testEl = document.createElement("input"); - testEl.type = "file"; - try { - testEl.files = fileList; - } catch (e4) { - return false; - } - return true; + function _toPropertyKey17(arg) { + var key = _toPrimitive17(arg, "string"); + return _typeof18(key) === "symbol" ? key : String(key); } - function handleDrop(e4, el) { - var _e$originalEvent, _e$originalEvent$data; - var files = (_e$originalEvent = e4.originalEvent) === null || _e$originalEvent === void 0 ? void 0 : (_e$originalEvent$data = _e$originalEvent.dataTransfer) === null || _e$originalEvent$data === void 0 ? void 0 : _e$originalEvent$data.files, $el = (0, import_jquery20.default)(el); - if (files === void 0 || files === null) { - console.log("Dropping files is not supported on this browser. (no FileList)"); - } else if (!canSetFiles(files)) { - $el.val(""); - uploadDroppedFilesIE10Plus(el, files); - } else { - $el.val(""); - el.files = files; - $el.trigger("change"); + function _toPrimitive17(input, hint) { + if (_typeof18(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof18(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); } + return (hint === "string" ? String : Number)(input); } - function setFileText($el, files) { - var $fileText = $el.closest("div.input-group").find("input[type=text]"); - if (files.length === 1) { - $fileText.val(files[0].name); - } else { - $fileText.val(files.length + " files"); + function _inherits15(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf15(subClass, superClass); } - function abortCurrentUpload($el) { - var uploader = $el.data("currentUploader"); - if (uploader) - uploader.abort(); - $el.removeAttr("data-restore"); + function _setPrototypeOf15(o4, p3) { + _setPrototypeOf15 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + o5.__proto__ = p4; + return o5; + }; + return _setPrototypeOf15(o4, p3); } - function uploadDroppedFilesIE10Plus(el, files) { - var $el = (0, import_jquery20.default)(el); - abortCurrentUpload($el); - setFileText($el, files); - $el.data("currentUploader", new FileUploader(shinyShinyApp(), fileInputBindingGetId(el), files, el)); + function _createSuper15(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct15(); + return function _createSuperInternal() { + var Super = _getPrototypeOf15(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf15(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn15(this, result); + }; } - function uploadFiles(evt) { - var $el = (0, import_jquery20.default)(evt.target); - abortCurrentUpload($el); - var files = evt.target.files; - var id = fileInputBindingGetId(evt.target); - if (files.length === 0) - return; - setFileText($el, files); - $el.data("currentUploader", new FileUploader(shinyShinyApp(), id, files, evt.target)); + function _possibleConstructorReturn15(self2, call8) { + if (call8 && (_typeof18(call8) === "object" || typeof call8 === "function")) { + return call8; + } else if (call8 !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized15(self2); } - var $fileInputs = (0, import_jquery20.default)(); - function fileInputBindingGetId(el) { - return InputBinding.prototype.getId.call(this, el) || el.name; + function _assertThisInitialized15(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; } - var FileInputBinding = /* @__PURE__ */ function(_InputBinding) { - _inherits15(FileInputBinding2, _InputBinding); - var _super = _createSuper15(FileInputBinding2); - function FileInputBinding2() { - _classCallCheck17(this, FileInputBinding2); + function _isNativeReflectConstruct15() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e4) { + return false; + } + } + function _getPrototypeOf15(o4) { + _getPrototypeOf15 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + return o5.__proto__ || Object.getPrototypeOf(o5); + }; + return _getPrototypeOf15(o4); + } + var TextareaInputBinding = /* @__PURE__ */ function(_TextInputBinding) { + _inherits15(TextareaInputBinding2, _TextInputBinding); + var _super = _createSuper15(TextareaInputBinding2); + function TextareaInputBinding2() { + _classCallCheck17(this, TextareaInputBinding2); return _super.apply(this, arguments); } - _createClass17(FileInputBinding2, [{ + _createClass17(TextareaInputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery20.default)(scope).find('input[type="file"]'); - } - }, { - key: "getId", - value: function getId(el) { - return fileInputBindingGetId(el); - } - }, { - key: "getValue", - value: function getValue(el) { - var data = (0, import_jquery20.default)(el).attr("data-restore"); - if (data) { - var dataParsed = JSON.parse(data); - var $fileText = (0, import_jquery20.default)(el).closest("div.input-group").find("input[type=text]"); - if (dataParsed.name.length === 1) { - $fileText.val(dataParsed.name[0]); - } else { - $fileText.val(dataParsed.name.length + " files"); - } - var $progress = (0, import_jquery20.default)(el).closest("div.form-group").find(".progress"); - var $bar = $progress.find(".progress-bar"); - $progress.removeClass("active"); - $bar.width("100%"); - $bar.css("visibility", "visible"); - return dataParsed; - } else { - return null; - } - } - }, { - key: "setValue", - value: function setValue(el, value) { - el; - value; - } - }, { - key: "getType", - value: function getType(el) { - return "shiny.file"; - el; - } - }, { - key: "subscribe", - value: function subscribe(el, callback) { - callback; - (0, import_jquery20.default)(el).on("change.fileInputBinding", uploadFiles); - if ($fileInputs.length === 0) - enableDocumentEvents(); - $fileInputs = $fileInputs.add(el); - var $zone = zoneOf(el); - enableDraghover($zone).on({ - "draghover:enter.draghover": function draghoverEnterDraghover(e4) { - e4; - $zone.addClass(zoneOver); - }, - "draghover:leave.draghover": function draghoverLeaveDraghover(e4) { - $zone.removeClass(zoneOver); - e4.stopPropagation(); - }, - "draghover:drop.draghover": function draghoverDropDraghover(e4, dropEvent) { - e4; - handleDrop(dropEvent, el); - } - }); - } - }, { - key: "unsubscribe", - value: function unsubscribe(el) { - var $el = (0, import_jquery20.default)(el), $zone = zoneOf(el); - $zone.removeClass(zoneOver).removeClass(zoneActive); - disableDraghover($zone); - $el.off(".fileInputBinding"); - $zone.off(".draghover"); - $fileInputs = $fileInputs.not(el); - if ($fileInputs.length === 0) - disableDocumentEvents(); + return (0, import_jquery20.default)(scope).find("textarea"); } }]); - return FileInputBinding2; - }(InputBinding); + return TextareaInputBinding2; + }(TextInputBinding); // srcts/src/bindings/input/index.ts function initInputBindings() { @@ -11345,10 +11337,6 @@ }; } - // srcts/src/bindings/output/text.ts - var import_es_array_iterator20 = __toESM(require_es_array_iterator()); - var import_jquery22 = __toESM(require_jquery()); - // node_modules/core-js/modules/es.array.join.js var $45 = require_export(); var uncurryThis8 = require_function_uncurry_this(); @@ -11364,340 +11352,225 @@ } }); - // srcts/src/bindings/output/outputBinding.ts - var import_es_regexp_exec5 = __toESM(require_es_regexp_exec()); - var import_es_array_iterator19 = __toESM(require_es_array_iterator()); - var import_jquery21 = __toESM(require_jquery()); - function _typeof19(obj) { - "@babel/helpers - typeof"; - return _typeof19 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof19(obj); - } - function _regeneratorRuntime2() { - "use strict"; - _regeneratorRuntime2 = function _regeneratorRuntime16() { - return exports; - }; - var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) { - obj[key] = desc.value; - }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - function define(obj, key, value) { - return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key]; - } - try { - define({}, ""); - } catch (err) { - define = function define2(obj, key, value) { - return obj[key] = value; - }; - } - function wrap(innerFn, outerFn, self2, tryLocsList) { - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); - return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator; - } - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; + // srcts/src/bindings/output/datatable.ts + var import_es_regexp_exec6 = __toESM(require_es_regexp_exec()); + + // node_modules/core-js/modules/es.string.search.js + var call4 = require_function_call(); + var fixRegExpWellKnownSymbolLogic2 = require_fix_regexp_well_known_symbol_logic(); + var anObject6 = require_an_object(); + var isNullOrUndefined2 = require_is_null_or_undefined(); + var requireObjectCoercible2 = require_require_object_coercible(); + var sameValue = require_same_value(); + var toString6 = require_to_string(); + var getMethod2 = require_get_method(); + var regExpExec3 = require_regexp_exec_abstract(); + fixRegExpWellKnownSymbolLogic2("search", function(SEARCH, nativeSearch, maybeCallNative) { + return [ + function search(regexp) { + var O = requireObjectCoercible2(this); + var searcher = isNullOrUndefined2(regexp) ? void 0 : getMethod2(regexp, SEARCH); + return searcher ? call4(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString6(O)); + }, + function(string) { + var rx = anObject6(this); + var S4 = toString6(string); + var res = maybeCallNative(nativeSearch, rx, S4); + if (res.done) + return res.value; + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) + rx.lastIndex = 0; + var result = regExpExec3(rx, S4); + if (!sameValue(rx.lastIndex, previousLastIndex)) + rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; } + ]; + }); + + // srcts/src/bindings/output/datatable.ts + var import_es_array_iterator23 = __toESM(require_es_array_iterator()); + var import_jquery22 = __toESM(require_jquery()); + + // srcts/src/time/debounce.ts + var import_es_array_iterator19 = __toESM(require_es_array_iterator()); + function _typeof19(obj) { + "@babel/helpers - typeof"; + return _typeof19 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof19(obj); + } + function _classCallCheck18(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); } - exports.wrap = wrap; - var ContinueSentinel = {}; - function Generator() { + } + function _defineProperties18(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey18(descriptor.key), descriptor); } - function GeneratorFunction() { + } + function _createClass18(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties18(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties18(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _defineProperty4(obj, key, value) { + key = _toPropertyKey18(key); + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; } - function GeneratorFunctionPrototype() { + return obj; + } + function _toPropertyKey18(arg) { + var key = _toPrimitive18(arg, "string"); + return _typeof19(key) === "symbol" ? key : String(key); + } + function _toPrimitive18(input, hint) { + if (_typeof19(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof19(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); } - var IteratorPrototype = {}; - define(IteratorPrototype, iteratorSymbol, function() { - return this; - }); - var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([]))); - NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - define(prototype, method, function(arg) { - return this._invoke(method, arg); - }); - }); + return (hint === "string" ? String : Number)(input); + } + var Debouncer = /* @__PURE__ */ function() { + function Debouncer2(target, func, delayMs) { + _classCallCheck18(this, Debouncer2); + _defineProperty4(this, "target", void 0); + _defineProperty4(this, "func", void 0); + _defineProperty4(this, "delayMs", void 0); + _defineProperty4(this, "timerId", void 0); + _defineProperty4(this, "args", void 0); + this.target = target; + this.func = func; + this.delayMs = delayMs; + this.timerId = null; + this.args = null; } - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if ("throw" !== record.type) { - var result = record.arg, value = result.value; - return value && "object" == _typeof19(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) { - invoke("next", value2, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }) : PromiseImpl.resolve(value).then(function(unwrapped) { - result.value = unwrapped, resolve(result); - }, function(error) { - return invoke("throw", error, resolve, reject); - }); + _createClass18(Debouncer2, [{ + key: "normalCall", + value: function normalCall() { + var _this = this; + this.$clearTimer(); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - reject(record.arg); + this.args = args; + this.timerId = setTimeout(function() { + if (_this.timerId === null) + return; + _this.$clearTimer(); + _this.$invoke(); + }, this.delayMs); } - var previousPromise; - defineProperty3(this, "_invoke", { value: function value(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } }); - } - function makeInvokeMethod(innerFn, self2, context) { - var state = "suspendedStart"; - return function(method, arg) { - if ("executing" === state) - throw new Error("Generator is already running"); - if ("completed" === state) { - if ("throw" === method) - throw arg; - return doneResult(); - } - for (context.method = method, context.arg = arg; ; ) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) - continue; - return delegateResult; - } - } - if ("next" === context.method) - context.sent = context._sent = context.arg; - else if ("throw" === context.method) { - if ("suspendedStart" === state) - throw state = "completed", context.arg; - context.dispatchException(context.arg); - } else - "return" === context.method && context.abrupt("return", context.arg); - state = "executing"; - var record = tryCatch(innerFn, self2, context); - if ("normal" === record.type) { - if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) - continue; - return { value: record.arg, done: context.done }; - } - "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); + }, { + key: "immediateCall", + value: function immediateCall() { + this.$clearTimer(); + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - }; - } - function maybeInvokeDelegate(delegate, context) { - var methodName = context.method, method = delegate.iterator[methodName]; - if (void 0 === method) - return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; - var record = tryCatch(method, delegate.iterator, context.arg); - if ("throw" === record.type) - return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; - var info = record.arg; - return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); - } - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); - } - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal", delete record.arg, entry.completion = record; - } - function Context(tryLocsList) { - this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true); - } - function values2(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) - return iteratorMethod.call(iterable); - if ("function" == typeof iterable.next) - return iterable; - if (!isNaN(iterable.length)) { - var i5 = -1, next2 = function next3() { - for (; ++i5 < iterable.length; ) - if (hasOwn5.call(iterable, i5)) - return next3.value = iterable[i5], next3.done = false, next3; - return next3.value = void 0, next3.done = true, next3; - }; - return next2.next = next2; + this.args = args; + this.$invoke(); + } + }, { + key: "isPending", + value: function isPending() { + return this.timerId !== null; + } + }, { + key: "$clearTimer", + value: function $clearTimer() { + if (this.timerId !== null) { + clearTimeout(this.timerId); + this.timerId = null; } } - return { next: doneResult }; - } - function doneResult() { - return { value: void 0, done: true }; - } - return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) { - var ctor = "function" == typeof genFun && genFun.constructor; - return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); - }, exports.mark = function(genFun) { - return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; - }, exports.awrap = function(arg) { - return { __await: arg }; - }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() { - return this; - }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) { - void 0 === PromiseImpl && (PromiseImpl = Promise); - var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl); - return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() { - return this; - }), define(Gp, "toString", function() { - return "[object Generator]"; - }), exports.keys = function(val) { - var object = Object(val), keys2 = []; - for (var key in object) - keys2.push(key); - return keys2.reverse(), function next2() { - for (; keys2.length; ) { - var key2 = keys2.pop(); - if (key2 in object) - return next2.value = key2, next2.done = false, next2; - } - return next2.done = true, next2; - }; - }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { - if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset) - for (var name in this) - "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0); - }, stop: function stop() { - this.done = true; - var rootRecord = this.tryEntries[0].completion; - if ("throw" === rootRecord.type) - throw rootRecord.arg; - return this.rval; - }, dispatchException: function dispatchException(exception) { - if (this.done) - throw exception; - var context = this; - function handle(loc, caught) { - return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught; - } - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5], record = entry.completion; - if ("root" === entry.tryLoc) - return handle("end"); - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc"); - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) - return handle(entry.catchLoc, true); - if (this.prev < entry.finallyLoc) - return handle(entry.finallyLoc); - } else if (hasCatch) { - if (this.prev < entry.catchLoc) - return handle(entry.catchLoc, true); - } else { - if (!hasFinally) - throw new Error("try statement without catch or finally"); - if (this.prev < entry.finallyLoc) - return handle(entry.finallyLoc); - } - } - } - }, abrupt: function abrupt(type, arg) { - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5]; - if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; + }, { + key: "$invoke", + value: function $invoke() { + if (this.args && this.args.length > 0) { + this.func.apply(this.target, this.args); + } else { + this.func.apply(this.target); } + this.args = null; } - finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); - var record = finallyEntry ? finallyEntry.completion : {}; - return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); - }, complete: function complete(record, afterLoc) { - if ("throw" === record.type) - throw record.arg; - return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; - }, finish: function finish(finallyLoc) { - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5]; - if (entry.finallyLoc === finallyLoc) - return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; + }]); + return Debouncer2; + }(); + function debounce(threshold, func) { + var timerId = null; + return function thisFunc() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; } - }, catch: function _catch(tryLoc) { - for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { - var entry = this.tryEntries[i5]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if ("throw" === record.type) { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } + if (timerId !== null) { + clearTimeout(timerId); + timerId = null; } - throw new Error("illegal catch attempt"); - }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { - return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel; - } }, exports; - } - function asyncGeneratorStep2(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - function _asyncToGenerator2(fn) { - return function() { - var self2 = this, args = arguments; - return new Promise(function(resolve, reject) { - var gen = fn.apply(self2, args); - function _next(value) { - asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "next", value); - } - function _throw(err) { - asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "throw", err); - } - _next(void 0); - }); + timerId = setTimeout(function() { + if (timerId === null) + return; + timerId = null; + func.apply(thisFunc, args); + }, threshold); }; } - function _classCallCheck18(instance, Constructor) { + + // srcts/src/time/invoke.ts + var import_es_array_iterator20 = __toESM(require_es_array_iterator()); + function _typeof20(obj) { + "@babel/helpers - typeof"; + return _typeof20 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof20(obj); + } + function _classCallCheck19(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _defineProperties18(target, props) { + function _defineProperties19(target, props) { for (var i5 = 0; i5 < props.length; i5++) { var descriptor = props[i5]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey18(descriptor.key), descriptor); + Object.defineProperty(target, _toPropertyKey19(descriptor.key), descriptor); } } - function _createClass18(Constructor, protoProps, staticProps) { + function _createClass19(Constructor, protoProps, staticProps) { if (protoProps) - _defineProperties18(Constructor.prototype, protoProps); + _defineProperties19(Constructor.prototype, protoProps); if (staticProps) - _defineProperties18(Constructor, staticProps); + _defineProperties19(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _defineProperty4(obj, key, value) { - key = _toPropertyKey18(key); + function _defineProperty5(obj, key, value) { + key = _toPropertyKey19(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { @@ -11705,244 +11578,52 @@ } return obj; } - function _toPropertyKey18(arg) { - var key = _toPrimitive18(arg, "string"); - return _typeof19(key) === "symbol" ? key : String(key); + function _toPropertyKey19(arg) { + var key = _toPrimitive19(arg, "string"); + return _typeof20(key) === "symbol" ? key : String(key); } - function _toPrimitive18(input, hint) { - if (_typeof19(input) !== "object" || input === null) + function _toPrimitive19(input, hint) { + if (_typeof20(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof19(res) !== "object") + if (_typeof20(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - var OutputBinding = /* @__PURE__ */ function() { - function OutputBinding2() { - _classCallCheck18(this, OutputBinding2); - _defineProperty4(this, "name", void 0); + var Invoker = /* @__PURE__ */ function() { + function Invoker2(target, func) { + _classCallCheck19(this, Invoker2); + _defineProperty5(this, "target", void 0); + _defineProperty5(this, "func", void 0); + this.target = target; + this.func = func; } - _createClass18(OutputBinding2, [{ - key: "find", - value: function find2(scope) { - throw "Not implemented"; - scope; - } - }, { - key: "renderValue", - value: function renderValue(el, data) { - throw "Not implemented"; - el; - data; - } - }, { - key: "getId", - value: function getId(el) { - return el.getAttribute("data-input-id") || el.id; - } - }, { - key: "onValueChange", - value: function() { - var _onValueChange = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee(el, data) { - return _regeneratorRuntime2().wrap(function _callee$(_context) { - while (1) - switch (_context.prev = _context.next) { - case 0: - this.clearError(el); - _context.next = 3; - return this.renderValue(el, data); - case 3: - case "end": - return _context.stop(); - } - }, _callee, this); - })); - function onValueChange(_x, _x2) { - return _onValueChange.apply(this, arguments); + _createClass19(Invoker2, [{ + key: "normalCall", + value: function normalCall() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - return onValueChange; - }() - }, { - key: "onValueError", - value: function onValueError(el, err) { - this.renderError(el, err); + this.func.apply(this.target, args); } }, { - key: "renderError", - value: function renderError(el, err) { - this.clearError(el); - if (err.message === "") { - (0, import_jquery21.default)(el).empty(); - return; - } - var errClass = "shiny-output-error"; - if (err.type !== null) { - errClass = errClass + " " + import_jquery21.default.map(asArray(err.type), function(type) { - return errClass + "-" + type; - }).join(" "); + key: "immediateCall", + value: function immediateCall() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - (0, import_jquery21.default)(el).addClass(errClass).text(err.message); - } - }, { - key: "clearError", - value: function clearError(el) { - (0, import_jquery21.default)(el).attr("class", function(i5, c5) { - return c5.replace(/(^|\s)shiny-output-error\S*/g, ""); - }); - } - }, { - key: "showProgress", - value: function showProgress(el, show3) { - var recalcClass = "recalculating"; - if (show3) - (0, import_jquery21.default)(el).addClass(recalcClass); - else - (0, import_jquery21.default)(el).removeClass(recalcClass); + this.func.apply(this.target, args); } }]); - return OutputBinding2; + return Invoker2; }(); - // srcts/src/bindings/output/text.ts - function _typeof20(obj) { - "@babel/helpers - typeof"; - return _typeof20 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof20(obj); - } - function _classCallCheck19(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties19(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey19(descriptor.key), descriptor); - } - } - function _createClass19(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties19(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties19(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _toPropertyKey19(arg) { - var key = _toPrimitive19(arg, "string"); - return _typeof20(key) === "symbol" ? key : String(key); - } - function _toPrimitive19(input, hint) { - if (_typeof20(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof20(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - function _inherits16(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf16(subClass, superClass); - } - function _setPrototypeOf16(o4, p3) { - _setPrototypeOf16 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { - o5.__proto__ = p4; - return o5; - }; - return _setPrototypeOf16(o4, p3); - } - function _createSuper16(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct16(); - return function _createSuperInternal() { - var Super = _getPrototypeOf16(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf16(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn16(this, result); - }; - } - function _possibleConstructorReturn16(self2, call8) { - if (call8 && (_typeof20(call8) === "object" || typeof call8 === "function")) { - return call8; - } else if (call8 !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); - } - return _assertThisInitialized16(self2); - } - function _assertThisInitialized16(self2) { - if (self2 === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self2; - } - function _isNativeReflectConstruct16() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) - return false; - if (typeof Proxy === "function") - return true; - try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - return true; - } catch (e4) { - return false; - } - } - function _getPrototypeOf16(o4) { - _getPrototypeOf16 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { - return o5.__proto__ || Object.getPrototypeOf(o5); - }; - return _getPrototypeOf16(o4); - } - var TextOutputBinding = /* @__PURE__ */ function(_OutputBinding) { - _inherits16(TextOutputBinding2, _OutputBinding); - var _super = _createSuper16(TextOutputBinding2); - function TextOutputBinding2() { - _classCallCheck19(this, TextOutputBinding2); - return _super.apply(this, arguments); - } - _createClass19(TextOutputBinding2, [{ - key: "find", - value: function find2(scope) { - return (0, import_jquery22.default)(scope).find(".shiny-text-output"); - } - }, { - key: "renderValue", - value: function renderValue(el, data) { - (0, import_jquery22.default)(el).text(data); - } - }]); - return TextOutputBinding2; - }(OutputBinding); - - // srcts/src/bindings/output/downloadlink.ts + // srcts/src/time/throttle.ts var import_es_array_iterator21 = __toESM(require_es_array_iterator()); - var import_jquery23 = __toESM(require_jquery()); function _typeof21(obj) { "@babel/helpers - typeof"; return _typeof21 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { @@ -11974,6 +11655,15 @@ Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + function _defineProperty6(obj, key, value) { + key = _toPropertyKey20(key); + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } function _toPropertyKey20(arg) { var key = _toPrimitive20(arg, "string"); return _typeof21(key) === "symbol" ? key : String(key); @@ -11990,236 +11680,30 @@ } return (hint === "string" ? String : Number)(input); } - function _inherits17(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + var Throttler = /* @__PURE__ */ function() { + function Throttler2(target, func, delayMs) { + _classCallCheck20(this, Throttler2); + _defineProperty6(this, "target", void 0); + _defineProperty6(this, "func", void 0); + _defineProperty6(this, "delayMs", void 0); + _defineProperty6(this, "timerId", void 0); + _defineProperty6(this, "args", void 0); + this.target = target; + this.func = func; + this.delayMs = delayMs; + this.timerId = null; + this.args = null; } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf17(subClass, superClass); - } - function _setPrototypeOf17(o4, p3) { - _setPrototypeOf17 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { - o5.__proto__ = p4; - return o5; - }; - return _setPrototypeOf17(o4, p3); - } - function _createSuper17(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct17(); - return function _createSuperInternal() { - var Super = _getPrototypeOf17(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf17(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn17(this, result); - }; - } - function _possibleConstructorReturn17(self2, call8) { - if (call8 && (_typeof21(call8) === "object" || typeof call8 === "function")) { - return call8; - } else if (call8 !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); - } - return _assertThisInitialized17(self2); - } - function _assertThisInitialized17(self2) { - if (self2 === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self2; - } - function _isNativeReflectConstruct17() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) - return false; - if (typeof Proxy === "function") - return true; - try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - return true; - } catch (e4) { - return false; - } - } - function _getPrototypeOf17(o4) { - _getPrototypeOf17 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { - return o5.__proto__ || Object.getPrototypeOf(o5); - }; - return _getPrototypeOf17(o4); - } - var DownloadLinkOutputBinding = /* @__PURE__ */ function(_OutputBinding) { - _inherits17(DownloadLinkOutputBinding2, _OutputBinding); - var _super = _createSuper17(DownloadLinkOutputBinding2); - function DownloadLinkOutputBinding2() { - _classCallCheck20(this, DownloadLinkOutputBinding2); - return _super.apply(this, arguments); - } - _createClass20(DownloadLinkOutputBinding2, [{ - key: "find", - value: function find2(scope) { - return (0, import_jquery23.default)(scope).find("a.shiny-download-link"); - } - }, { - key: "renderValue", - value: function renderValue(el, data) { - el.setAttribute("href", data); - el.classList.remove("disabled"); - el.removeAttribute("aria-disabled"); - el.removeAttribute("tabindex"); - } - }, { - key: "showProgress", - value: function showProgress(el, show3) { - return; - el; - show3; - } - }]); - return DownloadLinkOutputBinding2; - }(OutputBinding); - (0, import_jquery23.default)(document).on("click.shinyDownloadLink", "a.shiny-download-link", function(e4) { - e4; - var evt = import_jquery23.default.Event("shiny:filedownload"); - evt.name = this.id; - evt.href = this.href; - (0, import_jquery23.default)(document).trigger(evt); - }); - - // srcts/src/bindings/output/datatable.ts - var import_es_regexp_exec6 = __toESM(require_es_regexp_exec()); - - // node_modules/core-js/modules/es.string.search.js - var call4 = require_function_call(); - var fixRegExpWellKnownSymbolLogic2 = require_fix_regexp_well_known_symbol_logic(); - var anObject6 = require_an_object(); - var isNullOrUndefined2 = require_is_null_or_undefined(); - var requireObjectCoercible2 = require_require_object_coercible(); - var sameValue = require_same_value(); - var toString6 = require_to_string(); - var getMethod2 = require_get_method(); - var regExpExec3 = require_regexp_exec_abstract(); - fixRegExpWellKnownSymbolLogic2("search", function(SEARCH, nativeSearch, maybeCallNative) { - return [ - function search(regexp) { - var O = requireObjectCoercible2(this); - var searcher = isNullOrUndefined2(regexp) ? void 0 : getMethod2(regexp, SEARCH); - return searcher ? call4(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString6(O)); - }, - function(string) { - var rx = anObject6(this); - var S4 = toString6(string); - var res = maybeCallNative(nativeSearch, rx, S4); - if (res.done) - return res.value; - var previousLastIndex = rx.lastIndex; - if (!sameValue(previousLastIndex, 0)) - rx.lastIndex = 0; - var result = regExpExec3(rx, S4); - if (!sameValue(rx.lastIndex, previousLastIndex)) - rx.lastIndex = previousLastIndex; - return result === null ? -1 : result.index; - } - ]; - }); - - // srcts/src/bindings/output/datatable.ts - var import_es_array_iterator25 = __toESM(require_es_array_iterator()); - var import_jquery24 = __toESM(require_jquery()); - - // srcts/src/time/debounce.ts - var import_es_array_iterator22 = __toESM(require_es_array_iterator()); - function _typeof22(obj) { - "@babel/helpers - typeof"; - return _typeof22 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof22(obj); - } - function _classCallCheck21(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties21(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey21(descriptor.key), descriptor); - } - } - function _createClass21(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties21(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties21(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _defineProperty5(obj, key, value) { - key = _toPropertyKey21(key); - if (key in obj) { - Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey21(arg) { - var key = _toPrimitive21(arg, "string"); - return _typeof22(key) === "symbol" ? key : String(key); - } - function _toPrimitive21(input, hint) { - if (_typeof22(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof22(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - var Debouncer = /* @__PURE__ */ function() { - function Debouncer2(target, func, delayMs) { - _classCallCheck21(this, Debouncer2); - _defineProperty5(this, "target", void 0); - _defineProperty5(this, "func", void 0); - _defineProperty5(this, "delayMs", void 0); - _defineProperty5(this, "timerId", void 0); - _defineProperty5(this, "args", void 0); - this.target = target; - this.func = func; - this.delayMs = delayMs; - this.timerId = null; - this.args = null; - } - _createClass21(Debouncer2, [{ - key: "normalCall", - value: function normalCall() { - var _this = this; - this.$clearTimer(); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - this.args = args; - this.timerId = setTimeout(function() { - if (_this.timerId === null) - return; - _this.$clearTimer(); - _this.$invoke(); - }, this.delayMs); + _createClass20(Throttler2, [{ + key: "normalCall", + value: function normalCall() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + this.args = args; + if (this.timerId === null) { + this.$invoke(); + } } }, { key: "immediateCall", @@ -12234,7 +11718,7 @@ }, { key: "isPending", value: function isPending() { - return this.timerId !== null; + return this.args !== null; } }, { key: "$clearTimer", @@ -12247,341 +11731,560 @@ }, { key: "$invoke", value: function $invoke() { - if (this.args && this.args.length > 0) { - this.func.apply(this.target, this.args); - } else { - this.func.apply(this.target); + var _this = this; + if (this.args === null) { + return; } + this.func.apply(this.target, this.args); this.args = null; + this.timerId = setTimeout(function() { + if (_this.timerId === null) + return; + _this.$clearTimer(); + if (_this.isPending()) { + _this.$invoke(); + } + }, this.delayMs); } }]); - return Debouncer2; + return Throttler2; }(); - function debounce(threshold, func) { - var timerId = null; - return function thisFunc() { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - if (timerId !== null) { - clearTimeout(timerId); - timerId = null; - } - timerId = setTimeout(function() { - if (timerId === null) - return; - timerId = null; - func.apply(thisFunc, args); - }, threshold); - }; - } - // srcts/src/time/invoke.ts - var import_es_array_iterator23 = __toESM(require_es_array_iterator()); - function _typeof23(obj) { + // srcts/src/bindings/output/outputBinding.ts + var import_es_regexp_exec5 = __toESM(require_es_regexp_exec()); + var import_es_array_iterator22 = __toESM(require_es_array_iterator()); + var import_jquery21 = __toESM(require_jquery()); + function _typeof22(obj) { "@babel/helpers - typeof"; - return _typeof23 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return _typeof22 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof23(obj); + }, _typeof22(obj); } - function _classCallCheck22(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); + function _regeneratorRuntime2() { + "use strict"; + _regeneratorRuntime2 = function _regeneratorRuntime16() { + return exports; + }; + var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) { + obj[key] = desc.value; + }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + function define(obj, key, value) { + return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key]; } - } - function _defineProperties22(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey22(descriptor.key), descriptor); + try { + define({}, ""); + } catch (err) { + define = function define2(obj, key, value) { + return obj[key] = value; + }; } - } - function _createClass22(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties22(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties22(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _defineProperty6(obj, key, value) { - key = _toPropertyKey22(key); - if (key in obj) { - Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; + function wrap(innerFn, outerFn, self2, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); + return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator; } - return obj; - } - function _toPropertyKey22(arg) { - var key = _toPrimitive22(arg, "string"); - return _typeof23(key) === "symbol" ? key : String(key); - } - function _toPrimitive22(input, hint) { - if (_typeof23(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof23(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - var Invoker = /* @__PURE__ */ function() { - function Invoker2(target, func) { - _classCallCheck22(this, Invoker2); - _defineProperty6(this, "target", void 0); - _defineProperty6(this, "func", void 0); - this.target = target; - this.func = func; - } - _createClass22(Invoker2, [{ - key: "normalCall", - value: function normalCall() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - this.func.apply(this.target, args); - } - }, { - key: "immediateCall", - value: function immediateCall() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - this.func.apply(this.target, args); + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; } - }]); - return Invoker2; - }(); - - // srcts/src/time/throttle.ts - var import_es_array_iterator24 = __toESM(require_es_array_iterator()); - function _typeof24(obj) { - "@babel/helpers - typeof"; - return _typeof24 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof24(obj); - } - function _classCallCheck23(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); } - } - function _defineProperties23(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey23(descriptor.key), descriptor); + exports.wrap = wrap; + var ContinueSentinel = {}; + function Generator() { } - } - function _createClass23(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties23(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties23(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _defineProperty7(obj, key, value) { - key = _toPropertyKey23(key); - if (key in obj) { - Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; + function GeneratorFunction() { } - return obj; - } - function _toPropertyKey23(arg) { - var key = _toPrimitive23(arg, "string"); - return _typeof24(key) === "symbol" ? key : String(key); - } - function _toPrimitive23(input, hint) { - if (_typeof24(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (_typeof24(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); + function GeneratorFunctionPrototype() { } - return (hint === "string" ? String : Number)(input); - } - var Throttler = /* @__PURE__ */ function() { - function Throttler2(target, func, delayMs) { - _classCallCheck23(this, Throttler2); - _defineProperty7(this, "target", void 0); - _defineProperty7(this, "func", void 0); - _defineProperty7(this, "delayMs", void 0); - _defineProperty7(this, "timerId", void 0); - _defineProperty7(this, "args", void 0); - this.target = target; - this.func = func; - this.delayMs = delayMs; - this.timerId = null; - this.args = null; + var IteratorPrototype = {}; + define(IteratorPrototype, iteratorSymbol, function() { + return this; + }); + var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([]))); + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + define(prototype, method, function(arg) { + return this._invoke(method, arg); + }); + }); } - _createClass23(Throttler2, [{ - key: "normalCall", - value: function normalCall() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - this.args = args; - if (this.timerId === null) { - this.$invoke(); - } - } - }, { - key: "immediateCall", - value: function immediateCall() { - this.$clearTimer(); - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if ("throw" !== record.type) { + var result = record.arg, value = result.value; + return value && "object" == _typeof22(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) { + invoke("next", value2, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }) : PromiseImpl.resolve(value).then(function(unwrapped) { + result.value = unwrapped, resolve(result); + }, function(error) { + return invoke("throw", error, resolve, reject); + }); } - this.args = args; - this.$invoke(); - } - }, { - key: "isPending", - value: function isPending() { - return this.args !== null; + reject(record.arg); } - }, { - key: "$clearTimer", - value: function $clearTimer() { - if (this.timerId !== null) { - clearTimeout(this.timerId); - this.timerId = null; + var previousPromise; + defineProperty3(this, "_invoke", { value: function value(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); } - } - }, { - key: "$invoke", - value: function $invoke() { - var _this = this; - if (this.args === null) { - return; + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } }); + } + function makeInvokeMethod(innerFn, self2, context) { + var state = "suspendedStart"; + return function(method, arg) { + if ("executing" === state) + throw new Error("Generator is already running"); + if ("completed" === state) { + if ("throw" === method) + throw arg; + return doneResult(); } - this.func.apply(this.target, this.args); - this.args = null; - this.timerId = setTimeout(function() { - if (_this.timerId === null) - return; - _this.$clearTimer(); - if (_this.isPending()) { - _this.$invoke(); + for (context.method = method, context.arg = arg; ; ) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) + continue; + return delegateResult; + } } - }, this.delayMs); - } - }]); - return Throttler2; - }(); - - // srcts/src/bindings/output/datatable.ts - function _typeof25(obj) { - "@babel/helpers - typeof"; - return _typeof25 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { - return typeof obj2; - } : function(obj2) { - return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }, _typeof25(obj); - } - function _classCallCheck24(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties24(target, props) { - for (var i5 = 0; i5 < props.length; i5++) { - var descriptor = props[i5]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey24(descriptor.key), descriptor); + if ("next" === context.method) + context.sent = context._sent = context.arg; + else if ("throw" === context.method) { + if ("suspendedStart" === state) + throw state = "completed", context.arg; + context.dispatchException(context.arg); + } else + "return" === context.method && context.abrupt("return", context.arg); + state = "executing"; + var record = tryCatch(innerFn, self2, context); + if ("normal" === record.type) { + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) + continue; + return { value: record.arg, done: context.done }; + } + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); + } + }; } - } - function _createClass24(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties24(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties24(Constructor, staticProps); + function maybeInvokeDelegate(delegate, context) { + var methodName = context.method, method = delegate.iterator[methodName]; + if (void 0 === method) + return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; + var record = tryCatch(method, delegate.iterator, context.arg); + if ("throw" === record.type) + return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; + var info = record.arg; + return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); + } + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); + } + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal", delete record.arg, entry.completion = record; + } + function Context(tryLocsList) { + this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true); + } + function values2(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) + return iteratorMethod.call(iterable); + if ("function" == typeof iterable.next) + return iterable; + if (!isNaN(iterable.length)) { + var i5 = -1, next2 = function next3() { + for (; ++i5 < iterable.length; ) + if (hasOwn5.call(iterable, i5)) + return next3.value = iterable[i5], next3.done = false, next3; + return next3.value = void 0, next3.done = true, next3; + }; + return next2.next = next2; + } + } + return { next: doneResult }; + } + function doneResult() { + return { value: void 0, done: true }; + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) { + var ctor = "function" == typeof genFun && genFun.constructor; + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); + }, exports.mark = function(genFun) { + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; + }, exports.awrap = function(arg) { + return { __await: arg }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() { + return this; + }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) { + void 0 === PromiseImpl && (PromiseImpl = Promise); + var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() { + return this; + }), define(Gp, "toString", function() { + return "[object Generator]"; + }), exports.keys = function(val) { + var object = Object(val), keys2 = []; + for (var key in object) + keys2.push(key); + return keys2.reverse(), function next2() { + for (; keys2.length; ) { + var key2 = keys2.pop(); + if (key2 in object) + return next2.value = key2, next2.done = false, next2; + } + return next2.done = true, next2; + }; + }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset) + for (var name in this) + "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0); + }, stop: function stop() { + this.done = true; + var rootRecord = this.tryEntries[0].completion; + if ("throw" === rootRecord.type) + throw rootRecord.arg; + return this.rval; + }, dispatchException: function dispatchException(exception) { + if (this.done) + throw exception; + var context = this; + function handle(loc, caught) { + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught; + } + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5], record = entry.completion; + if ("root" === entry.tryLoc) + return handle("end"); + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc"); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) + return handle(entry.catchLoc, true); + if (this.prev < entry.finallyLoc) + return handle(entry.finallyLoc); + } else if (hasCatch) { + if (this.prev < entry.catchLoc) + return handle(entry.catchLoc, true); + } else { + if (!hasFinally) + throw new Error("try statement without catch or finally"); + if (this.prev < entry.finallyLoc) + return handle(entry.finallyLoc); + } + } + } + }, abrupt: function abrupt(type, arg) { + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5]; + if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); + var record = finallyEntry ? finallyEntry.completion : {}; + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); + }, complete: function complete(record, afterLoc) { + if ("throw" === record.type) + throw record.arg; + return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; + }, finish: function finish(finallyLoc) { + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5]; + if (entry.finallyLoc === finallyLoc) + return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; + } + }, catch: function _catch(tryLoc) { + for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) { + var entry = this.tryEntries[i5]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if ("throw" === record.type) { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + throw new Error("illegal catch attempt"); + }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { + return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel; + } }, exports; + } + function asyncGeneratorStep2(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator2(fn) { + return function() { + var self2 = this, args = arguments; + return new Promise(function(resolve, reject) { + var gen = fn.apply(self2, args); + function _next(value) { + asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(void 0); + }); + }; + } + function _classCallCheck21(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties21(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey21(descriptor.key), descriptor); + } + } + function _createClass21(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties21(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties21(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - function _toPropertyKey24(arg) { - var key = _toPrimitive24(arg, "string"); - return _typeof25(key) === "symbol" ? key : String(key); + function _defineProperty7(obj, key, value) { + key = _toPropertyKey21(key); + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; } - function _toPrimitive24(input, hint) { - if (_typeof25(input) !== "object" || input === null) + function _toPropertyKey21(arg) { + var key = _toPrimitive21(arg, "string"); + return _typeof22(key) === "symbol" ? key : String(key); + } + function _toPrimitive21(input, hint) { + if (_typeof22(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); - if (_typeof25(res) !== "object") + if (_typeof22(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } - function _inherits18(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + var OutputBinding = /* @__PURE__ */ function() { + function OutputBinding2() { + _classCallCheck21(this, OutputBinding2); + _defineProperty7(this, "name", void 0); } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); - Object.defineProperty(subClass, "prototype", { writable: false }); - if (superClass) - _setPrototypeOf18(subClass, superClass); - } - function _setPrototypeOf18(o4, p3) { - _setPrototypeOf18 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { - o5.__proto__ = p4; - return o5; - }; - return _setPrototypeOf18(o4, p3); - } - function _createSuper18(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct18(); - return function _createSuperInternal() { - var Super = _getPrototypeOf18(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf18(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + _createClass21(OutputBinding2, [{ + key: "find", + value: function find2(scope) { + throw "Not implemented"; + scope; } - return _possibleConstructorReturn18(this, result); - }; - } - function _possibleConstructorReturn18(self2, call8) { - if (call8 && (_typeof25(call8) === "object" || typeof call8 === "function")) { - return call8; + }, { + key: "renderValue", + value: function renderValue(el, data) { + throw "Not implemented"; + el; + data; + } + }, { + key: "getId", + value: function getId(el) { + return el.getAttribute("data-input-id") || el.id; + } + }, { + key: "onValueChange", + value: function() { + var _onValueChange = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee(el, data) { + return _regeneratorRuntime2().wrap(function _callee$(_context) { + while (1) + switch (_context.prev = _context.next) { + case 0: + this.clearError(el); + _context.next = 3; + return this.renderValue(el, data); + case 3: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function onValueChange(_x, _x2) { + return _onValueChange.apply(this, arguments); + } + return onValueChange; + }() + }, { + key: "onValueError", + value: function onValueError(el, err) { + this.renderError(el, err); + } + }, { + key: "renderError", + value: function renderError(el, err) { + this.clearError(el); + if (err.message === "") { + (0, import_jquery21.default)(el).empty(); + return; + } + var errClass = "shiny-output-error"; + if (err.type !== null) { + errClass = errClass + " " + import_jquery21.default.map(asArray(err.type), function(type) { + return errClass + "-" + type; + }).join(" "); + } + (0, import_jquery21.default)(el).addClass(errClass).text(err.message); + } + }, { + key: "clearError", + value: function clearError(el) { + (0, import_jquery21.default)(el).attr("class", function(i5, c5) { + return c5.replace(/(^|\s)shiny-output-error\S*/g, ""); + }); + } + }, { + key: "showProgress", + value: function showProgress(el, show3) { + var recalcClass = "recalculating"; + if (show3) + (0, import_jquery21.default)(el).addClass(recalcClass); + else + (0, import_jquery21.default)(el).removeClass(recalcClass); + } + }]); + return OutputBinding2; + }(); + + // srcts/src/bindings/output/datatable.ts + function _typeof23(obj) { + "@babel/helpers - typeof"; + return _typeof23 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof23(obj); + } + function _classCallCheck22(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties22(target, props) { + for (var i5 = 0; i5 < props.length; i5++) { + var descriptor = props[i5]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey22(descriptor.key), descriptor); + } + } + function _createClass22(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties22(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties22(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _toPropertyKey22(arg) { + var key = _toPrimitive22(arg, "string"); + return _typeof23(key) === "symbol" ? key : String(key); + } + function _toPrimitive22(input, hint) { + if (_typeof23(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof23(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _inherits16(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf16(subClass, superClass); + } + function _setPrototypeOf16(o4, p3) { + _setPrototypeOf16 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) { + o5.__proto__ = p4; + return o5; + }; + return _setPrototypeOf16(o4, p3); + } + function _createSuper16(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct16(); + return function _createSuperInternal() { + var Super = _getPrototypeOf16(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf16(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn16(this, result); + }; + } + function _possibleConstructorReturn16(self2, call8) { + if (call8 && (_typeof23(call8) === "object" || typeof call8 === "function")) { + return call8; } else if (call8 !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } - return _assertThisInitialized18(self2); + return _assertThisInitialized16(self2); } - function _assertThisInitialized18(self2) { + function _assertThisInitialized16(self2) { if (self2 === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self2; } - function _isNativeReflectConstruct18() { + function _isNativeReflectConstruct16() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) @@ -12596,23 +12299,23 @@ return false; } } - function _getPrototypeOf18(o4) { - _getPrototypeOf18 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { + function _getPrototypeOf16(o4) { + _getPrototypeOf16 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) { return o5.__proto__ || Object.getPrototypeOf(o5); }; - return _getPrototypeOf18(o4); + return _getPrototypeOf16(o4); } var DatatableOutputBinding = /* @__PURE__ */ function(_OutputBinding) { - _inherits18(DatatableOutputBinding2, _OutputBinding); - var _super = _createSuper18(DatatableOutputBinding2); + _inherits16(DatatableOutputBinding2, _OutputBinding); + var _super = _createSuper16(DatatableOutputBinding2); function DatatableOutputBinding2() { - _classCallCheck24(this, DatatableOutputBinding2); + _classCallCheck22(this, DatatableOutputBinding2); return _super.apply(this, arguments); } - _createClass24(DatatableOutputBinding2, [{ + _createClass22(DatatableOutputBinding2, [{ key: "find", value: function find2(scope) { - return (0, import_jquery24.default)(scope).find(".shiny-datatable-output"); + return (0, import_jquery22.default)(scope).find(".shiny-datatable-output"); } }, { key: "onValueError", @@ -12624,17 +12327,17 @@ key: "renderValue", value: function renderValue(el, _data) { var _data$options$searchi, _data$options, _data$options2, _data$options2$search; - var $el = (0, import_jquery24.default)(el).empty(); + var $el = (0, import_jquery22.default)(el).empty(); if (!_data || !_data.colnames) return; - var colnames = import_jquery24.default.makeArray(_data.colnames); - var header = import_jquery24.default.map(colnames, function(x2) { + var colnames = import_jquery22.default.makeArray(_data.colnames); + var header = import_jquery22.default.map(colnames, function(x2) { return "